/* ============================================================
   大鱼盘 - 现代 SaaS 风格 (Modern Blue-Purple Theme)
   参考图片：蓝紫渐变 Hero + 白色圆角卡片 + 简洁列表
   ============================================================ */

/* ---------- CSS Variables ---------- */
:root {
  --primary: #4a6cf7;
  --accent: var(--primary);
  --primary-light: #6b8cff;
  --primary-dark: #3a5ce5;
  --primary-soft: rgba(74, 108, 247, 0.08);
  --success: #48bb78;
  --success-soft: rgba(72, 187, 120, 0.1);
  --danger: #f56565;
  --danger-soft: rgba(245, 101, 101, 0.1);
  --warning: #ed8936;
  --warning-soft: rgba(237, 137, 54, 0.1);

  --bg: #f5f7fa;
  --bg-2: #ffffff;
  --bg-3: #f8fafc;
  --bg-header: #1a1a2e;
  --bg-header-hover: #252545;

  --text: #1a202c;
  --text-strong: #111827;
  --text-muted: #718096;
  --text-dim: #a0aec0;
  --text-on-dark: #e2e8f0;

  --border: #e2e8f0;
  --border-light: #edf2f7;
  --border-input: #cbd5e0;
  --border-focus: #4a6cf7;

  --radius: 12px;
  --radius-sm: 8px;
  --radius-pill: 9999px;
  --radius-card: 14px;

  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04), 0 1px 3px rgba(0,0,0,0.02);
  --shadow: 0 4px 6px -1px rgba(0,0,0,0.06), 0 2px 4px -1px rgba(0,0,0,0.03);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.07), 0 4px 6px -2px rgba(0,0,0,0.03);
  --shadow-card: 0 2px 8px rgba(0,0,0,0.04), 0 0 1px rgba(0,0,0,0.06);
  --shadow-card-hover: 0 8px 24px rgba(0,0,0,0.08), 0 0 1px rgba(0,0,0,0.08);

  --font-ui: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', 'Helvetica Neue', sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --font-mono: 'SF Mono', 'Fira Code', 'Cascadia Code', Consolas, monospace;

  --max-width: 1100px;
  --transition: all 0.2s ease;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.7 var(--font-ui);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background 0.3s, color 0.3s;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--primary); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--primary-light); text-decoration: none; }

.container { width: 92%; max-width: var(--max-width); margin: 0 auto; }

/* ============================================================
   HEADER
   ============================================================ */
.site-header {
  background: var(--bg-header);
  border-bottom: none;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

/* Brand */
.brand {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-display);
  font-weight: 700; font-size: 18px; color: var(--text-on-dark);
  letter-spacing: -0.3px;
}
.brand:hover { color: var(--primary-light); }
.brand-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px;
  background: linear-gradient(135deg, #5a7bff 0%, #4a6cf7 100%);
  color: #fff;
  font-size: 16px; font-weight: 700;
  border-radius: var(--radius-sm);
  box-shadow: 0 2px 8px rgba(74, 108, 247, 0.35);
}
.brand-icon svg { width: 20px; height: 20px; }

/* Nav */
.main-nav {
  display: flex; align-items: center; gap: 4px;
}
.main-nav a {
  font-size: 14px; color: var(--text-on-dark);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-weight: 500;
  transition: var(--transition);
  opacity: 0.85;
}
.main-nav a:hover {
  color: #fff;
  background: rgba(255,255,255,0.08);
  opacity: 1;
  text-decoration: none;
}
.nav-user {
  font-size: 13px; color: var(--text-on-dark);
  padding: 0 12px;
  opacity: 0.7;
}
.nav-user small { color: var(--primary-light); font-weight: 600; opacity: 1; }

/* 个人中心下拉菜单 */
.nav-dropdown { position: relative; }
.nav-caret { margin-left: 5px; vertical-align: 2px; opacity: 0.7; }
.nav-dropdown::before {
  /* 透明桥接区，悬停从入口移到菜单时不掉落 */
  content: '';
  position: absolute; top: 100%; left: 0; right: 0;
  height: 8px;
  display: none;
}
.nav-dropdown:hover::before, .nav-dropdown.open::before { display: block; }
.nav-drop-menu {
  position: absolute; top: calc(100% + 6px); right: 0;
  min-width: 150px;
  background: var(--bg-2);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  display: none;
  z-index: 300;
}
.nav-dropdown:hover .nav-drop-menu,
.nav-dropdown.open .nav-drop-menu { display: block; }
.nav-drop-menu a {
  display: flex; align-items: center;
  padding: 9px 12px;
  font-size: 14px; font-weight: 500;
  color: var(--text) !important;
  opacity: 1;
  border-radius: 6px;
  white-space: nowrap;
}
.nav-drop-menu a:hover {
  background: var(--bg-3);
  color: var(--primary) !important;
}
.nav-drop-menu a .nav-ico { opacity: 0.6; }

/* 导航 Unicode 图标 */
.nav-ico {
  display: inline-block;
  margin-right: 4px;
  font-size: 12px;
  opacity: 0.7;
  line-height: 1;
}

/* Nav Toggle（移动端汉堡菜单） */
.nav-toggle {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.15);
  color: var(--text-on-dark);
  cursor: pointer;
  padding: 7px 12px;
  font-family: var(--font-mono);
  font-size: 13px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  margin-left: 4px;
}
.nav-toggle:hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.3);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  padding: 10px 10px;
  border: none;
  background: transparent;
}
.nav-toggle span {
  display: block;
  width: 22px; height: 2.5px;
  background: var(--text-on-dark);
  border-radius: 2px;
  transition: 0.25s;
}

/* Mobile nav */
@media (max-width: 760px) {
  .nav-toggle { display: flex; }
  .main-nav {
    position: absolute; top: 60px; left: 0; right: 0;
    background: var(--bg-header);
    border-top: 1px solid rgba(255,255,255,0.06);
    flex-direction: column; align-items: stretch; gap: 0;
    padding: 12px 4% 20px;
    transform: translateY(-120%);
    opacity: 0; pointer-events: none;
    transition: transform 0.3s, opacity 0.3s;
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
    border-radius: 0 0 var(--radius) var(--radius);
  }
  .main-nav.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }
  .main-nav a, .nav-user {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
  }
  /* 移动端：个人中心子菜单平铺内嵌展示 */
  .nav-dropdown::before { display: none !important; }
  .nav-caret { display: none; }
  .nav-drop-menu {
    position: static;
    display: block;
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0 0 0 18px;
  }
  .nav-drop-menu a {
    color: var(--text-on-dark) !important;
    opacity: 0.85;
    border-radius: var(--radius-sm);
  }
  .nav-drop-menu a:hover {
    background: rgba(255,255,255,0.08);
    color: #fff !important;
  }
}

/* ============================================================
   MAIN
   ============================================================ */
.main { flex: 1; padding: 36px 0 56px; }
.section { margin-bottom: 32px; }
.section:last-child { margin-bottom: 0; }

/* ============================================================
   HERO
   ============================================================ */
.hero {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  padding: 64px 0 56px;
  margin-top: -36px; /* 抵消 .main 顶部间距，保持 Hero 与导航无缝衔接 */
  margin-bottom: 36px;
  position: relative;
  overflow: hidden;
  text-align: center;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  opacity: 1;
  pointer-events: none;
}
.hero .container {
  position: relative;
  z-index: 1;
}
.hero h1 {
  font-family: var(--font-display);
  font-size: 36px; font-weight: 800;
  color: #fff;
  letter-spacing: -1px;
  margin: 0 0 8px;
  text-shadow: 0 2px 10px rgba(0,0,0,0.15);
}
.hero p {
  color: rgba(255,255,255,0.8);
  font-size: 16px;
  margin: 0 0 28px;
  font-weight: 400;
}

.search-box {
  display: flex;
  max-width: 640px; margin: 0 auto;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.15), 0 1px 3px rgba(0,0,0,0.1);
  overflow: hidden;
  padding: 5px;
  gap: 4px;
}
.search-box .input {
  flex: 1;
  font-size: 16px;
  padding: 12px 20px;
  background: transparent;
  border: none;
  box-shadow: none;
  color: #1a202c;
}
.search-box .input::placeholder { color: #a0aec0; }
.search-box .input:focus {
  box-shadow: none;
  outline: none;
  background: transparent;
}
.search-box .btn {
  flex-shrink: 0;
  padding: 12px 28px;
  font-size: 15px;
  border-radius: 6px;
  background: var(--primary);
  border: none;
  color: #fff;
  box-shadow: 0 2px 8px rgba(74, 108, 247, 0.35);
  font-weight: 600;
}
.search-box .btn:hover {
  background: var(--primary-light);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(74, 108, 247, 0.45);
}
.search-box .btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(74, 108, 247, 0.35);
}

@media (max-width: 640px) {
  .hero { padding: 48px 0 40px; }
  .hero h1 { font-size: 28px; }
  .search-box { border-radius: 8px; padding: 4px; }
  .search-box .btn { border-radius: 5px; padding: 10px 20px; }
}

/* ============================================================
   FILTER BAR (Category Pills)
   ============================================================ */
.filter-bar {
  display: flex; flex-wrap: wrap; gap: 10px;
  justify-content: center;
  margin-top: 24px;
  padding: 0 16px;
}

.filter-bar a {
  padding: 7px 18px;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 6px;
  font-size: 13px; font-weight: 500;
  color: rgba(255,255,255,0.85);
  transition: var(--transition);
  display: inline-flex; align-items: center; gap: 5px;
  backdrop-filter: blur(4px);
}
.filter-bar a:hover {
  background: rgba(255,255,255,0.25);
  color: #fff;
  border-color: rgba(255,255,255,0.4);
  text-decoration: none;
  transform: translateY(-1px);
}
.filter-bar a.active {
  background: #fff;
  color: #667eea;
  border-color: #fff;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
/* 移动端隐藏分类 emoji 图标，PC 端不变 */
@media (max-width: 640px) {
  .filter-bar .cat-ico { display: none; }
}

/* ============================================================
   TYPOGRAPHY
   ============================================================ */
h1, h2, h3 {
  margin: 0 0 16px;
  color: var(--text-strong);
  font-weight: 700;
  font-family: var(--font-display);
  letter-spacing: -0.3px;
  line-height: 1.3;
}
h1 { font-size: 30px; }
h2 { font-size: 22px; }
h3 { font-size: 18px; }

.muted { color: var(--text-muted); }
.small { font-size: 13px; }

/* ============================================================
   SECTION HEADERS
   ============================================================ */
.section-header {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 20px;
  font-size: 18px; font-weight: 700; color: var(--text-strong);
}
.section-header-icon {
  font-size: 20px;
  line-height: 1;
}

/* ============================================================
   RESOURCE LIST (index page cards)
   ============================================================ */
.resource-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.resource-item {
  display: block;
  background: var(--bg-2);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 18px 18px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  transition: var(--transition);
  position: relative;
}
.resource-item:hover {
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
  border-color: var(--border);
  transform: translateY(-1px);
}

/* 网盘徽章：实心主色底白字 */
.disk-badge {
  background: var(--primary) !important;
  color: #fff !important;
  border-color: transparent !important;
  font-weight: 500;
  padding: 5px 12px;
  font-size: 12.5px;
}
/* 分类徽章：浅灰小巧 */
.cat-badge {
  background: var(--bg-3) !important;
  color: var(--text-muted) !important;
  border-color: transparent !important;
  font-size: 12px;
}
/* 提取码徽章：等宽字体醒目橙，点击复制 */
.pwd-badge {
  flex-shrink: 0;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 600;
  font-family: var(--font-mono);
  color: var(--warning);
  background: var(--warning-soft);
  border: 1px solid rgba(237, 137, 54, 0.25);
  border-radius: var(--radius-pill);
  cursor: copy;
  line-height: 1.5;
  white-space: nowrap;
  transition: var(--transition);
}
.pwd-badge:hover {
  border-color: var(--warning);
  background: rgba(237, 137, 54, 0.18);
}

/* 两行布局：首行徽章与大小，次行标题 */
.resource-item .ri-top {
  display: flex; align-items: center; gap: 10px;
  flex-wrap: wrap;
}
.resource-item .ri-top .resource-size {
  margin-left: auto;
  font-size: 12px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.resource-item .resource-title {
  margin-top: 8px;
  font-size: 15px; font-weight: 500;
  color: var(--text-strong);
  line-height: 1.55;
  word-break: break-word;
}
.resource-item .resource-title a {
  color: inherit;
}
.resource-item .resource-title a:hover {
  color: var(--primary);
}

.resource-item[data-url] { cursor: pointer; }

/* PC 端：资源项一行显示（移动端为两行） */
@media (min-width: 641px) {
  .resource-item {
    display: flex; align-items: center; gap: 10px;
  }
  /* ri-top 展开为父级 flex 子项，与标题同行排列 */
  .resource-item .ri-top { display: contents; }
  .resource-item .resource-title {
    flex: 1; min-width: 0;
    margin-top: 0;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  /* 文件大小排到行尾 */
  .resource-item .ri-top .resource-size {
    order: 2;
    margin-left: 0;
    flex-shrink: 0;
  }
}
/* 网盘徽章/筛选器移动端缩写（默认隐藏，仅移动端显示；须在 media 规则之前定义） */
.disk-short,
.pill-short { display: none; }

@media (max-width: 640px) {
  .resource-item {
    padding: 13px 14px;
  }
  /* 移动端网盘徽章显示缩写 */
  .disk-full { display: none; }
  .disk-short { display: inline; }
  /* 移动端筛选器显示缩写，并可横向滑动兜底 */
  .pill-full { display: none; }
  .pill-short { display: inline; }
  .filter-pills {
    max-width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .filter-pills::-webkit-scrollbar { display: none; }
}

/* ============================================================
   CARDS (general)
   ============================================================ */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}
.card {
  background: var(--bg-2);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-card);
  padding: 20px;
  box-shadow: var(--shadow-card);
  transition: var(--transition);
  position: relative;
  top: 0; left: 0;
}
.card:hover {
  box-shadow: var(--shadow-card-hover);
  border-color: var(--border);
  transform: translateY(-2px);
}
.card-title {
  font-size: 16px; font-weight: 600;
  color: var(--text-strong);
  margin: 0 0 10px;
  line-height: 1.4;
  word-break: break-all;
}
.card-title a { color: inherit; }
.card-title a:hover { color: var(--primary); }
.card-meta {
  font-size: 13px; color: var(--text-muted);
  display: flex; flex-wrap: wrap; gap: 6px 12px;
  margin-bottom: 14px;
}
.card-meta span {
  display: inline-flex; align-items: center; gap: 4px;
}
.card-actions {
  display: flex; gap: 8px; flex-wrap: wrap;
}

/* ============================================================
   FORMS
   ============================================================ */
.form-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 32px;
  box-shadow: var(--shadow-lg);
  max-width: 440px;
  margin: 0 auto;
}
.form-row { margin-bottom: 20px; }
.form-row label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-strong);
  letter-spacing: 0.02em;
}

.input, .select, textarea {
  width: 100%;
  padding: 11px 14px;
  background: var(--bg-3);
  color: var(--text);
  border: 1px solid var(--border-input);
  border-radius: var(--radius-sm);
  font: inherit; font-size: 15px;
  outline: none;
  transition: var(--transition);
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.04);
}
.input:focus, .select:focus, textarea:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(74, 108, 247, 0.12), inset 0 1px 2px rgba(0,0,0,0.04);
  background: var(--bg-2);
}
textarea { min-height: 90px; resize: vertical; }
.input::placeholder, textarea::placeholder { color: var(--text-dim); }

/* 验证码 */
.captcha-row { display: flex; gap: 10px; align-items: stretch; }
.captcha-row .input { flex: 1; }
.captcha-img {
  width: 110px; height: 44px;
  border: 1px solid var(--border-input);
  border-radius: var(--radius-sm);
  background: #f4f6fb;
  cursor: pointer;
  flex-shrink: 0;
}
/* 蜜罐字段（对用户不可见） */
.hp-field {
  position: absolute !important;
  left: -9999px !important;
  width: 1px; height: 1px;
  opacity: 0;
  pointer-events: none;
}

/* 自动识别网盘类型后的高亮反馈 */
@keyframes selectFlash {
  0% { box-shadow: 0 0 0 0 rgba(74, 108, 247, 0.4); border-color: var(--primary); }
  100% { box-shadow: 0 0 0 7px rgba(74, 108, 247, 0); }
}
.select.flash { animation: selectFlash 0.9s ease; border-color: var(--primary); }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 20px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font: inherit; font-size: 14px; font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 2px 8px rgba(74, 108, 247, 0.25);
  position: relative;
  top: 0; left: 0;
  letter-spacing: 0.01em;
}
.btn:hover {
  background: var(--primary-light);
  color: #fff;
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(74, 108, 247, 0.35);
}
.btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(74, 108, 247, 0.25);
}
.btn:disabled {
  opacity: 0.6; cursor: not-allowed;
  transform: none;
  box-shadow: 0 2px 8px rgba(74, 108, 247, 0.25);
}

.btn.block { width: 100%; justify-content: center; }

.btn.secondary {
  background: var(--bg-3);
  color: var(--text);
  box-shadow: 0 1px 2px rgba(0,0,0,0.06);
  border: 1px solid var(--border);
}
.btn.secondary:hover {
  background: var(--bg);
  color: var(--text-strong);
  box-shadow: 0 2px 4px rgba(0,0,0,0.08);
  border-color: var(--border-input);
}

.btn.danger {
  background: var(--danger);
  color: #fff;
  box-shadow: 0 2px 8px rgba(245, 101, 101, 0.25);
}
.btn.danger:hover { background: #e53e3e; box-shadow: 0 4px 12px rgba(245, 101, 101, 0.35); }

.btn.small {
  padding: 5px 12px;
  font-size: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  gap: 4px;
}
.btn.small:hover { box-shadow: 0 2px 6px rgba(0,0,0,0.1); }

/* ============================================================
   BADGES
   ============================================================ */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: 11px; font-weight: 600;
  border: 1px solid transparent;
  background: var(--bg-3);
  color: var(--text-muted);
  line-height: 1.5;
  white-space: nowrap;
  flex-shrink: 0;
}
.badge.ok {
  background: var(--success-soft);
  color: var(--success);
  border-color: rgba(72, 187, 120, 0.2);
}
.badge.bad {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: rgba(245, 101, 101, 0.2);
}
.badge.unknown {
  background: var(--warning-soft);
  color: var(--warning);
  border-color: rgba(237, 137, 54, 0.2);
}
.badge.promo {
  background: var(--warning-soft);
  color: var(--warning);
  border-color: rgba(237, 137, 54, 0.25);
}

/* ============================================================
   TABLES
   ============================================================ */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  background: var(--bg-2);
}
.data-table th, .data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-light);
  text-align: left;
}
.data-table th {
  color: var(--text-muted);
  font-weight: 600; font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--bg-3);
  border-bottom: 1px solid var(--border);
}
.data-table tbody tr {
  transition: background 0.15s;
}
.data-table tbody tr:hover td {
  background: var(--primary-soft);
}
.data-table tbody tr:last-child td {
  border-bottom: none;
}

@media (max-width: 760px) {
  .data-table, .data-table thead, .data-table tbody,
  .data-table th, .data-table td, .data-table tr { display: block; }
  .data-table { border: none; box-shadow: none; background: transparent; }
  .data-table thead { display: none; }
  .data-table tr {
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
    margin-bottom: 12px;
    background: var(--bg-2);
    padding: 10px 0;
    overflow: hidden;
  }
  .data-table td {
    position: relative;
    padding: 10px 12px 10px 38%;
    border: none;
    border-bottom: 1px solid var(--border-light);
  }
  .data-table td:last-child { border-bottom: none; }
  .data-table td::before {
    position: absolute; left: 12px; width: 34%;
    content: attr(data-label);
    font-weight: 600; font-size: 11px;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.04em;
  }
  .data-table tbody tr:hover td { background: transparent; }
}

/* ============================================================
   PAGINATION
   ============================================================ */
.pagination {
  display: flex; justify-content: center; gap: 6px;
  margin-top: 28px;
}
.pagination a, .pagination span {
  padding: 8px 16px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 14px; font-weight: 500;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  min-width: 40px;
  text-align: center;
}
.pagination a:hover {
  background: var(--primary-soft);
  color: var(--primary);
  border-color: var(--primary);
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(74, 108, 247, 0.15);
}
.pagination .current {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(74, 108, 247, 0.25);
}

/* ============================================================
   TOAST
   ============================================================ */
#toast-container {
  position: fixed;
  right: 20px; bottom: 20px;
  z-index: 9999;
  display: flex; flex-direction: column; gap: 10px;
}
.toast {
  min-width: 260px; max-width: 400px;
  padding: 14px 20px;
  background: var(--bg-2);
  color: var(--text-strong);
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  font-size: 14px; font-weight: 500;
  animation: toastIn 0.3s ease;
  cursor: pointer;
}
.toast.error { border-left-color: var(--danger); }
.toast.success { border-left-color: var(--success); }

@keyframes toastIn {
  from { transform: translateX(120%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
@keyframes toastOut {
  from { transform: translateX(0); opacity: 1; }
  to { transform: translateX(120%); opacity: 0; }
}

/* ============================================================
   LOADING SKELETON
   ============================================================ */
.skeleton {
  background: linear-gradient(90deg, var(--bg-3) 25%, var(--bg-2) 50%, var(--bg-3) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite;
  border-radius: var(--radius-sm);
  border: 1px dashed var(--border);
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ============================================================
   STATUS DOT
   ============================================================ */
.status-dot {
  width: 8px; height: 8px;
  display: inline-block;
  margin-right: 5px;
  border-radius: 50%;
}
.status-dot.ok { background: var(--success); box-shadow: 0 0 0 2px var(--success-soft); }
.status-dot.bad { background: var(--danger); box-shadow: 0 0 0 2px var(--danger-soft); }
.status-dot.unknown { background: var(--warning); box-shadow: 0 0 0 2px var(--warning-soft); }

/* ============================================================
   ADMIN LAYOUT
   ============================================================ */
.admin-wrap {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 24px;
}
.admin-sidebar {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 16px;
  position: sticky;
  top: 100px; /* 导航60px + 主区间距36px，留4px呼吸感 */
  align-self: start;
}
.admin-sidebar::before {
  content: '管理菜单';
  display: block;
  font-size: 11px; font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-light);
}
.admin-sidebar a {
  display: block;
  padding: 10px 12px;
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  transition: var(--transition);
  margin-bottom: 2px;
}
.admin-sidebar a:hover,
.admin-sidebar a.active {
  background: var(--primary-soft);
  color: var(--primary);
  border-color: rgba(74, 108, 247, 0.15);
  text-decoration: none;
}
.admin-main { min-width: 0; }

@media (max-width: 760px) {
  .admin-wrap { grid-template-columns: 1fr; }
  .admin-sidebar {
    display: flex; flex-wrap: wrap; gap: 6px;
    position: static;
  }
  .admin-sidebar::before { display: none; }
  .admin-sidebar a { padding: 8px 12px; font-size: 13px; }
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  background: var(--bg-2);
  border-top: 1px solid var(--border-light);
  padding: 28px 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  margin-top: auto;
}
.site-footer p { margin: 0; }

/* ============================================================
   UTILITY
   ============================================================ */
.empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
  font-size: 16px;
  border: 2px dashed var(--border-light);
  border-radius: var(--radius-card);
  background: var(--bg-2);
}
.text-right { text-align: right; }
.mt-2 { margin-top: 16px; }
.mb-2 { margin-bottom: 16px; }

/* ============================================================
   CHECK_IN PAGE
   ============================================================ */
.form-card[style*="text-align:center"] {
  text-align: center;
}

/* ============================================================
   RESPONSIVE FINE-TUNING
   ============================================================ */
@media (max-width: 480px) {
  .card-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .card { padding: 16px; }
  .hero h1 { font-size: 24px; }
  .form-card { padding: 24px 18px; }
  h1 { font-size: 24px; }
  h2 { font-size: 20px; }
  .btn { padding: 8px 16px; font-size: 13px; }
}

/* ============================================================
   ADMIN STAT CARDS
   ============================================================ */
.stat-card {
  background: var(--bg-2);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-card);
  padding: 22px 20px;
  box-shadow: var(--shadow-card);
  display: flex;
  align-items: center;
  gap: 16px;
  transition: var(--transition);
}
.stat-card:hover {
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-2px);
}
.stat-icon {
  width: 48px; height: 48px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
  font-size: 22px;
  background: var(--primary-soft);
  color: var(--primary);
  flex-shrink: 0;
}
.stat-icon.danger { background: var(--danger-soft); color: var(--danger); }
.stat-icon.success { background: var(--success-soft); color: var(--success); }
.stat-icon.warning { background: var(--warning-soft); color: var(--warning); }
.stat-num {
  font-size: 28px; font-weight: 800;
  color: var(--text-strong);
  line-height: 1.1;
  letter-spacing: -0.5px;
  font-variant-numeric: tabular-nums;
}
.stat-label { font-size: 13px; color: var(--text-muted); margin-top: 2px; }

/* 后台主区标题 */
.admin-main > h2 {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 20px;
}
.admin-main > h2::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-light);
}

/* ============================================================
   ADMIN LINK LIST (两行布局，替代宽表格)
   ============================================================ */
.admin-link-list { display: flex; flex-direction: column; gap: 10px; }
.alink {
  background: var(--bg-2);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-card);
  padding: 13px 16px;
  box-shadow: var(--shadow-card);
  transition: var(--transition);
}
.alink:hover { border-color: var(--border); box-shadow: var(--shadow-card-hover); }
.alink-top {
  display: flex; align-items: center; gap: 10px;
  min-width: 0;
}
.alink-id {
  font-size: 12px; color: var(--text-dim);
  font-family: var(--font-mono);
  flex-shrink: 0;
}
.alink-title {
  flex: 1; min-width: 0;
  font-size: 15px; font-weight: 600;
  color: var(--text-strong);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.alink-title:hover { color: var(--primary); text-decoration: none; }
.alink-top .badge { flex-shrink: 0; }
.alink-bottom {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-top: 9px; flex-wrap: wrap;
}
.alink-meta {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-size: 12px; color: var(--text-muted);
  min-width: 0;
}
.alink-meta .sep { color: var(--text-dim); }
.alink-ops { display: flex; gap: 6px; flex-wrap: wrap; flex-shrink: 0; }

@media (max-width: 640px) {
  .alink-title { white-space: normal; line-height: 1.5; }
  .alink-bottom { flex-direction: column; align-items: stretch; }
  .alink-ops { justify-content: flex-end; }
}

/* ============================================================
   NOTICE BAR
   ============================================================ */
.notice-bar {
  background: var(--primary-soft);
  border: 1px solid rgba(74, 108, 247, 0.2);
  border-left: 3px solid var(--primary);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 14px;
  color: var(--text);
  line-height: 1.6;
  margin-bottom: 18px;
  word-break: break-word;
}

/* ============================================================
   TOOLBAR & FILTER PILLS
   ============================================================ */
.toolbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
  margin-bottom: 16px;
}
.filter-pills {
  display: inline-flex; align-items: center; gap: 2px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 3px;
  box-shadow: var(--shadow-sm);
}
.filter-pills a {
  padding: 6px 14px;
  font-size: 13px;
  color: var(--text-muted);
  border-radius: 7px;
  line-height: 1.4;
  white-space: nowrap;
}
.filter-pills a:hover {
  color: var(--text-strong);
  text-decoration: none;
  background: var(--bg-3);
}
.filter-pills a.active {
  background: var(--primary);
  color: #fff;
  font-weight: 600;
}

/* ============================================================
   MODAL
   ============================================================ */
.modal-mask {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(15, 18, 30, 0.55);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  animation: modalFade 0.18s ease;
}
.modal-mask[hidden] { display: none; }
.modal {
  width: 100%; max-width: 520px; max-height: 90vh;
  overflow-y: auto;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
  animation: modalUp 0.2s ease;
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 15px 20px;
  border-bottom: 1px solid var(--border-light);
}
.modal-title { font-size: 16px; font-weight: 700; color: var(--text-strong); }
.modal-close {
  width: 30px; height: 30px;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: none; border-radius: 6px;
  color: var(--text-muted); font-size: 20px; line-height: 1;
  cursor: pointer;
}
.modal-close:hover { background: var(--bg-3); color: var(--text-strong); }
.modal-body { padding: 20px; }
.modal-body .form-row { margin-bottom: 14px; }
.modal-foot {
  display: flex; justify-content: flex-end; gap: 10px;
  margin-top: 18px;
}
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }

@keyframes modalFade { from { opacity: 0; } }
@keyframes modalUp { from { opacity: 0; transform: translateY(8px); } }

@media (max-width: 560px) {
  .form-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   COLLECTION / DESCRIPTION
   ============================================================ */
.coll-filter { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.coll-filter .input { flex: 1; min-width: 180px; }
.coll-list {
  max-height: 340px; overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px;
}
.coll-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px;
  border-radius: 6px;
  cursor: pointer;
}
.coll-item:hover { background: var(--bg-3); }
.coll-item input[type="checkbox"] { flex-shrink: 0; width: 16px; height: 16px; }
.coll-item-title {
  flex: 1; min-width: 0;
  font-size: 14px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.coll-item-meta { flex-shrink: 0; font-size: 12px; color: var(--text-muted); }

/* 资源描述对话框 */
.desc-text {
  font-size: 14px; line-height: 1.8;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0;
}
.desc-pwd-row {
  margin-top: 12px;
  font-size: 13px;
  color: var(--text-muted);
  display: flex; align-items: center; gap: 6px;
}
.desc-pwd-row[hidden] { display: none; }

/* ============================================================
   COLLECTION SQUARE (合辑广场)
   ============================================================ */
.coll-list-square { display: flex; flex-direction: column; gap: 12px; }
.coll-row {
  display: block;
  background: var(--bg-2);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 14px 18px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  transition: var(--transition);
  cursor: pointer;
}
.coll-row:hover {
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
  border-color: var(--border);
  transform: translateY(-1px);
  text-decoration: none;
}
/* 首行：徽章 + 右侧统计 */
.cr-top {
  display: flex; align-items: center; gap: 10px;
  flex-wrap: wrap;
}
.cr-count {
  background: var(--primary-soft) !important;
  color: var(--primary) !important;
  border-color: rgba(74, 108, 247, 0.15) !important;
}
.cr-stats {
  margin-left: auto;
  font-size: 12px;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
/* 次行：标题 */
.cr-title {
  margin-top: 8px;
  font-size: 15px; font-weight: 500;
  color: var(--text-strong);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.coll-row:hover .cr-title { color: var(--primary); }
/* 末行：描述，单行截断 */
.cr-desc {
  margin-top: 4px;
  font-size: 13px; line-height: 1.6;
  color: var(--text-muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
@media (max-width: 640px) {
  .cr-stats { width: 100%; margin-left: 0; }
  .cr-title { white-space: normal; }
}

/* ============================================================
   FOCUS VISIBLE
   ============================================================ */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* ============================================================
   SCROLLBAR
   ============================================================ */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb {
  background: var(--border-input);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover { background: var(--primary); }
