/* 江小囤业务系统总览 — 门户样式（浅色主题） */

:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --text: #1e293b;
  --text-soft: #64748b;
  --text-faint: #94a3b8;
  --border: #e8edf5;
  --brand: #4f46e5;
  --brand-deep: #3730a3;
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.05), 0 1px 2px rgba(15, 23, 42, 0.03);
  --shadow-md: 0 10px 24px -10px rgba(15, 23, 42, 0.15), 0 4px 8px -4px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 22px 40px -16px rgba(15, 23, 42, 0.24), 0 8px 16px -8px rgba(15, 23, 42, 0.1);
  --radius: 16px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background-color: var(--bg);
  background-image:
    radial-gradient(circle at 12% 8%, rgba(99, 102, 241, 0.07), transparent 32%),
    radial-gradient(circle at 88% 4%, rgba(14, 165, 233, 0.07), transparent 30%);
  -webkit-font-smoothing: antialiased;
}

.page {
  max-width: 1280px;
  margin: 0 auto;
  padding: 32px 28px 20px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ---------------- Hero ---------------- */

.hero {
  position: relative;
  overflow: hidden;
  border-radius: 22px;
  background: linear-gradient(115deg, #4338ca 0%, #4f46e5 42%, #0ea5e9 100%);
  box-shadow: var(--shadow-md);
  color: #fff;
}

.hero-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 82% -30%, rgba(255, 255, 255, 0.22), transparent 45%),
    radial-gradient(circle at 15% 130%, rgba(255, 255, 255, 0.14), transparent 40%);
}

.hero-bg::after {
  content: "";
  position: absolute;
  width: 320px;
  height: 320px;
  right: 8%;
  top: -190px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  box-shadow: 0 0 0 48px rgba(255, 255, 255, 0.05), 0 0 0 96px rgba(255, 255, 255, 0.035);
}

.hero-inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 40px 44px;
}

.brand { display: flex; align-items: center; gap: 20px; min-width: 0; }

.brand-mark {
  flex: none;
  width: 76px;
  height: 76px;
  display: grid;
  place-items: center;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: 0 6px 18px -6px rgba(8, 47, 73, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.6);
  overflow: hidden;
  padding: 6px;
}
.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.brand-text h1 {
  margin: 0;
  font-size: clamp(24px, 3vw, 34px);
  font-weight: 700;
  letter-spacing: 0.5px;
  line-height: 1.25;
}

.brand-text p {
  margin: 8px 0 0;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.82);
  letter-spacing: 1px;
}

.admin-entry {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 999px;
  color: #fff;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.26);
  transition: background 0.18s ease, transform 0.18s ease;
}

.admin-entry:hover { background: rgba(255, 255, 255, 0.24); transform: translateY(-1px); }
.admin-entry svg { width: 17px; height: 17px; }

/* ---------------- 内容区 ---------------- */

.content { flex: 1; padding-top: 28px; }

.group + .group { margin-top: 40px; }

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.section-head h2 {
  margin: 0;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 0.3px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.section-head h2::before {
  content: "";
  width: 4px;
  height: 18px;
  border-radius: 3px;
  background: linear-gradient(180deg, var(--brand), #0ea5e9);
}
.group:nth-child(2) .section-head h2::before {
  background: linear-gradient(180deg, #0ea5e9, #10b981);
}
.section-sub { margin: 5px 0 0 14px; font-size: 12px; color: var(--text-soft); }

.count-badge {
  flex: none;
  padding: 6px 14px;
  border-radius: 999px;
  background: #eef2ff;
  color: var(--brand-deep);
  font-size: 13px;
  font-weight: 600;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 16px;
}

.empty-group {
  padding: 22px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  color: var(--text-soft);
  font-size: 13px;
  background: rgba(255, 255, 255, 0.6);
}
.empty-group a { color: var(--brand); font-weight: 600; text-decoration: none; }
.empty-group a:hover { text-decoration: underline; }

/* ---------------- 卡片 ---------------- */

.card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow-sm);
  transition: transform 0.22s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.22s ease, border-color 0.22s ease;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(79, 70, 229, 0.28);
}

.card:focus-visible { outline: 3px solid rgba(79, 70, 229, 0.45); outline-offset: 3px; }

.card-media {
  position: relative;
  width: 100%;
  height: 92px;
  overflow: hidden;
  background: #eef2f7;
}

.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.card:hover .card-media img { transform: scale(1.05); }

.card-media.fallback {
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, hsl(var(--hue) 72% 56%), hsl(calc(var(--hue) + 42) 72% 48%));
}

.card-media.fallback::after {
  content: "";
  position: absolute;
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  right: -30px;
  top: -45px;
}

.fallback-letter {
  position: relative;
  z-index: 1;
  font-size: 46px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.92);
  text-shadow: 0 4px 18px rgba(0, 0, 0, 0.12);
}

.card-body { padding: 13px 16px 12px; display: flex; flex-direction: column; flex: 1; }

.card-body h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 650;
  letter-spacing: 0.2px;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card .desc {
  margin: 5px 0 0;
  font-size: 12px;
  color: var(--text-soft);
  line-height: 1.5;
  min-height: 18px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-foot {
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px dashed var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.card .host {
  font-size: 12px;
  color: var(--text-faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 65%;
}

.card .go {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  flex: none;
  font-size: 12px;
  font-weight: 600;
  color: var(--brand);
}

.card .go svg { width: 14px; height: 14px; transition: transform 0.18s ease; }
.card:hover .go svg { transform: translate(2px, -2px); }

/* ---------------- 骨架屏 / 空状态 / 错误 ---------------- */

.skeleton-card {
  height: 176px;
  border-radius: var(--radius);
  background: linear-gradient(100deg, #eef1f7 20%, #f8fafc 40%, #eef1f7 60%);
  background-size: 200% 100%;
  animation: shimmer 1.3s linear infinite;
}

@keyframes shimmer { to { background-position: -200% 0; } }

.empty {
  padding: 70px 20px;
  text-align: center;
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}

.empty-icon {
  width: 62px;
  height: 62px;
  margin: 0 auto 18px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: #eef2ff;
  color: var(--brand);
}
.empty-icon svg { width: 30px; height: 30px; }
.empty h3 { margin: 0 0 8px; font-size: 18px; }
.empty p { margin: 0 0 22px; color: var(--text-soft); font-size: 14px; }

.btn-primary {
  display: inline-block;
  padding: 10px 20px;
  border-radius: 10px;
  background: var(--brand);
  color: #fff;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  transition: background 0.18s ease, transform 0.18s ease;
}
.btn-primary:hover { background: var(--brand-deep); transform: translateY(-1px); }

.error-box {
  grid-column: 1 / -1;
  padding: 40px;
  text-align: center;
  color: #b91c1c;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: var(--radius);
}

/* ---------------- 页脚 ---------------- */

.footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 30px 4px 6px;
  color: var(--text-faint);
  font-size: 12px;
}

/* ---------------- 响应式 ---------------- */

@media (max-width: 720px) {
  .page { padding: 16px 14px 12px; }
  .hero-inner { padding: 28px 24px; align-items: flex-start; }
  .brand-mark { width: 58px; height: 58px; padding: 4px; border-radius: 14px; }
  .admin-entry span { display: none; }
  .admin-entry { padding: 9px; }
  .content { padding-top: 26px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
  .section-sub { display: none; }
}

@media (max-width: 480px) {
  .grid { grid-template-columns: 1fr; }
  .hero-inner { gap: 12px; }
  .brand { gap: 14px; }
}
