/*
 * premium.css — 深空极光 UI 升级 v2
 * 覆盖后台管理、登录/注册、排行榜三个界面
 * 字体沿用系统默认，不引入外部字体
 */

/* ─── 全局 CSS 变量（深空极光主题） ─── */
:root {
  --p-bg:         #080b12;
  --p-surface:    rgba(255,255,255,0.045);
  --p-surface-hv: rgba(255,255,255,0.08);
  --p-border:     rgba(255,255,255,0.09);
  --p-border-hv:  rgba(255,255,255,0.18);

  --p-aurora-1: #4f8bff;
  --p-aurora-2: #a855f7;
  --p-aurora-3: #06b6d4;
  --p-aurora-4: #f472b6;

  --p-text:       #e8eaf0;
  --p-text-sub:   rgba(232,234,240,0.55);
  --p-text-muted: rgba(232,234,240,0.32);

  --p-radius:    12px;
  --p-radius-lg: 20px;
  --p-blur:      blur(24px) saturate(180%);
}

/* ── 极光背景 DOM（登录/排行榜共用） ── */
.aurora-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}
.aurora-bg::before,
.aurora-bg::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.35;
  animation: auroraDrift 18s ease-in-out infinite alternate;
}
.aurora-bg::before {
  width: 70vw; height: 70vw;
  background: radial-gradient(circle, var(--p-aurora-1) 0%, transparent 70%);
  top: -20%; left: -15%;
  animation-duration: 18s;
}
.aurora-bg::after {
  width: 60vw; height: 60vw;
  background: radial-gradient(circle, var(--p-aurora-2) 0%, transparent 70%);
  bottom: -25%; right: -10%;
  animation-duration: 24s;
  animation-delay: -6s;
}
.aurora-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.22;
  animation: auroraDrift 20s ease-in-out infinite alternate;
}
.aurora-orb-1 {
  width: 40vw; height: 40vw;
  background: var(--p-aurora-3);
  top: 40%; left: 60%;
  animation-duration: 22s;
  animation-delay: -4s;
}
.aurora-orb-2 {
  width: 30vw; height: 30vw;
  background: var(--p-aurora-4);
  top: 10%; right: 20%;
  animation-duration: 16s;
  animation-delay: -10s;
}
@keyframes auroraDrift {
  from { transform: translate(0,0) scale(1); }
  to   { transform: translate(4%,6%) scale(1.08); }
}
.aurora-noise {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}


/* ══════════════════════════════════════════
   登录 / 注册 页面
══════════════════════════════════════════ */
body.auth-scene {
  background: var(--p-bg);
  color: var(--p-text);
  overflow: hidden;
}
body.auth-scene .stars { display: none; }
body.auth-scene .auth-page {
  position: relative;
  z-index: 10;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
body.auth-scene .auth-box {
  background: rgba(255,255,255,0.05);
  backdrop-filter: var(--p-blur);
  -webkit-backdrop-filter: var(--p-blur);
  border: 1px solid var(--p-border);
  border-radius: var(--p-radius-lg);
  padding: 48px 44px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 32px 80px rgba(0,0,0,0.55), 0 0 40px rgba(79,139,255,0.18);
  position: relative;
  overflow: hidden;
  animation: authBoxIn 0.7s cubic-bezier(0.22,1,0.36,1) both;
}
body.auth-scene .auth-box::before {
  content: '';
  position: absolute;
  top: 0; left: 10%; right: 10%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(79,139,255,0.8), rgba(168,85,247,0.8), transparent);
}
body.auth-scene .auth-box::after {
  content: '';
  position: absolute;
  top: -80px; left: 50%;
  transform: translateX(-50%);
  width: 280px; height: 160px;
  background: radial-gradient(ellipse, rgba(79,139,255,0.15) 0%, transparent 70%);
  pointer-events: none;
}
@keyframes authBoxIn {
  from { opacity: 0; transform: translateY(28px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
body.auth-scene .auth-title {
  font-size: 1.6rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 30px;
  color: var(--p-text);
  letter-spacing: -0.02em;
  position: relative;
  z-index: 1;
}
body.auth-scene .auth-title::after {
  content: '';
  display: block;
  width: 36px; height: 2px;
  background: linear-gradient(90deg, var(--p-aurora-1), var(--p-aurora-2));
  border-radius: 2px;
  margin: 8px auto 0;
}
body.auth-scene .form-label {
  color: var(--p-text-sub);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 7px;
}
body.auth-scene .form-input {
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--p-border);
  border-radius: var(--p-radius);
  color: var(--p-text);
  padding: 12px 15px;
  font-size: 0.95rem;
  transition: border-color 0.25s, box-shadow 0.25s, background 0.25s;
}
body.auth-scene .form-input::placeholder { color: var(--p-text-muted); }
body.auth-scene .form-input:focus {
  outline: none;
  border-color: rgba(79,139,255,0.6);
  background: rgba(255,255,255,0.09);
  box-shadow: 0 0 0 3px rgba(79,139,255,0.15);
}
body.auth-scene .btn-primary {
  width: 100%; padding: 13px;
  border-radius: var(--p-radius);
  font-weight: 600; font-size: 0.95rem;
  background: linear-gradient(135deg, var(--p-aurora-1), var(--p-aurora-2));
  border: none; color: #fff; cursor: pointer;
  position: relative; overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 20px rgba(79,139,255,0.35);
}
body.auth-scene .btn-primary::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.15), transparent);
  opacity: 0; transition: opacity 0.25s;
}
body.auth-scene .btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 32px rgba(79,139,255,0.5); }
body.auth-scene .btn-primary:hover::before { opacity: 1; }
body.auth-scene .auth-links { color: var(--p-text-muted); font-size: 0.88rem; }
body.auth-scene .auth-links a { color: var(--p-aurora-1); text-decoration: none; transition: color 0.2s; }
body.auth-scene .auth-links a:hover { color: #fff; }
body.auth-scene .auth-feature-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--p-border);
  border-radius: var(--p-radius);
  padding: 14px 16px; margin-bottom: 24px;
  font-size: 0.88rem; color: var(--p-text-sub);
  position: relative; z-index: 1;
}
body.auth-scene .auth-feature-card div {
  margin-bottom: 6px; display: flex; align-items: center; gap: 8px;
}
body.auth-scene .auth-feature-card div:last-child { margin-bottom: 0; }
body.auth-scene .msg-error {
  background: rgba(239,68,68,0.12); border: 1px solid rgba(239,68,68,0.35);
  color: #fca5a5; padding: 12px 16px; border-radius: var(--p-radius);
  margin-bottom: 20px; font-size: 0.9rem; position: relative; z-index: 1;
}
body.auth-scene .msg-success {
  background: rgba(34,197,94,0.1); border: 1px solid rgba(34,197,94,0.3);
  color: #86efac; padding: 12px 16px; border-radius: var(--p-radius);
  margin-bottom: 20px; font-size: 0.9rem; position: relative; z-index: 1;
}


/* ══════════════════════════════════════════
   排行榜页面
══════════════════════════════════════════ */
body.ranking-scene {
  background: var(--p-bg);
  color: var(--p-text);
}
body.ranking-scene .stars { display: none; }
body.ranking-scene .toolbar-btn {
  background: var(--p-surface); border: 1px solid var(--p-border);
  color: var(--p-text-sub);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}
body.ranking-scene .toolbar-btn:hover {
  background: var(--p-surface-hv); border-color: var(--p-border-hv);
  color: var(--p-text); transform: scale(1.08);
}
body.ranking-scene .ranking-page {
  max-width: 860px; margin: 0 auto; padding: 48px 20px 60px;
  position: relative; z-index: 2;
}
body.ranking-scene .ranking-title {
  font-size: 2.4rem; font-weight: 800; text-align: center;
  color: var(--p-text); letter-spacing: -0.03em; margin-bottom: 6px;
  background: linear-gradient(135deg, #fff 30%, var(--p-aurora-1) 70%, var(--p-aurora-2) 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
  animation: titleIn 0.8s cubic-bezier(0.22,1,0.36,1) both;
}
.ranking-title-sub {
  text-align: center; color: var(--p-text-muted);
  font-size: 0.88rem; margin-bottom: 34px;
  animation: titleIn 0.9s cubic-bezier(0.22,1,0.36,1) 0.1s both;
}
@keyframes titleIn {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}
body.ranking-scene .ranking-tabs {
  background: var(--p-surface); border: 1px solid var(--p-border);
  border-radius: 50px; padding: 4px;
  width: fit-content; margin: 0 auto 28px; display: flex; gap: 2px;
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
body.ranking-scene .ranking-tab {
  padding: 8px 28px; border-radius: 50px;
  background: transparent; border: none; color: var(--p-text-sub);
  font-size: 0.88rem; font-weight: 600; transition: all 0.25s;
  box-shadow: none; letter-spacing: 0.02em;
}
body.ranking-scene .ranking-tab:hover { background: var(--p-surface-hv); color: var(--p-text); }
body.ranking-scene .ranking-tab.active {
  background: linear-gradient(135deg, var(--p-aurora-1), var(--p-aurora-2));
  color: #fff; box-shadow: 0 4px 16px rgba(79,139,255,0.4);
}
body.ranking-scene .ranking-search input {
  background: var(--p-surface); border: 1px solid var(--p-border);
  border-radius: 50px; color: var(--p-text); font-size: 0.9rem;
  padding: 11px 20px;
  transition: border-color 0.25s, box-shadow 0.25s, background 0.25s;
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
body.ranking-scene .ranking-search input::placeholder { color: var(--p-text-muted); }
body.ranking-scene .ranking-search input:focus {
  outline: none; border-color: rgba(79,139,255,0.5);
  background: var(--p-surface-hv); box-shadow: 0 0 0 3px rgba(79,139,255,0.12);
}
body.ranking-scene .ranking-table {
  background: transparent; border: none; box-shadow: none; min-height: auto;
  display: flex; flex-direction: column; gap: 7px;
}
body.ranking-scene .ranking-row {
  background: var(--p-surface); border: 1px solid var(--p-border);
  border-radius: var(--p-radius); padding: 14px 18px;
  display: flex; align-items: center; gap: 14px;
  transition: background 0.2s, border-color 0.2s, transform 0.2s, box-shadow 0.2s;
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  animation: rowIn 0.45s cubic-bezier(0.22,1,0.36,1) both;
}
@keyframes rowIn {
  from { opacity: 0; transform: translateX(-14px); }
  to   { opacity: 1; transform: translateX(0); }
}
body.ranking-scene .ranking-row:hover {
  background: var(--p-surface-hv); border-color: var(--p-border-hv);
  transform: translateX(4px); box-shadow: -4px 0 20px rgba(79,139,255,0.1);
}
body.ranking-scene .rank-number {
  width: 42px; height: 42px; display: flex; align-items: center; justify-content: center;
  border-radius: 10px; font-size: 0.95rem; font-weight: 700; flex-shrink: 0;
  background: var(--p-surface); border: 1px solid var(--p-border); color: var(--p-text-muted);
}
body.ranking-scene .ranking-row:nth-child(1) .rank-number {
  background: linear-gradient(135deg, #ffd700, #ff8c00); border-color: transparent;
  color: #fff; font-size: 1.2rem; box-shadow: 0 4px 16px rgba(255,165,0,0.4);
}
body.ranking-scene .ranking-row:nth-child(2) .rank-number {
  background: linear-gradient(135deg, #c0c0c0, #888); border-color: transparent;
  color: #fff; font-size: 1.2rem; box-shadow: 0 4px 12px rgba(180,180,180,0.3);
}
body.ranking-scene .ranking-row:nth-child(3) .rank-number {
  background: linear-gradient(135deg, #cd7f32, #8b4513); border-color: transparent;
  color: #fff; font-size: 1.2rem; box-shadow: 0 4px 12px rgba(205,127,50,0.35);
}
body.ranking-scene .rank-info { flex: 1; min-width: 0; }
body.ranking-scene .rank-name {
  color: var(--p-text); font-weight: 500; font-size: 0.94rem;
  text-decoration: none; transition: color 0.2s; display: block; margin-bottom: 2px;
}
body.ranking-scene .rank-name:hover { color: var(--p-aurora-1); }
body.ranking-scene .rank-desc { font-size: 0.8rem; color: var(--p-text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.ranking-scene .rank-views {
  font-size: 0.8rem; font-weight: 600; color: var(--p-text-muted); white-space: nowrap;
  background: var(--p-surface); border: 1px solid var(--p-border); border-radius: 50px; padding: 4px 12px;
}


/* ══════════════════════════════════════════
   后台管理界面 — 修复白色模块 + 整体暗化
══════════════════════════════════════════ */

/* 覆盖原始 CSS 变量，让所有依赖 var(--bg-card) 的内联样式自动变暗 */
body.admin-scene {
  --bg-primary: #0c0e16;
  --bg-card: rgba(255,255,255,0.05);
  --bg-card-hover: rgba(255,255,255,0.09);
  --text-primary: #e8eaf0;
  --text-secondary: rgba(232,234,240,0.6);
  --text-muted: rgba(232,234,240,0.35);
  --border-color: rgba(255,255,255,0.09);
  --accent-color: #4f8bff;
  --accent-hover: #7aabff;
  --success-color: #4ade80;
  --warning-color: #fbbf24;
  --danger-color: #f87171;
  --shadow: 0 2px 12px rgba(0,0,0,0.3);
  --shadow-hover: 0 4px 24px rgba(0,0,0,0.4);

  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  background: #0c0e16;
  color: var(--p-text);
}

/* 侧边栏 */
body.admin-scene .admin-sidebar {
  background: rgba(8,11,20,0.98);
  border-right: 1px solid var(--p-border);
  box-shadow: 4px 0 40px rgba(0,0,0,0.5);
}
body.admin-scene .admin-logo {
  padding: 22px 20px 20px;
  border-bottom: 1px solid var(--p-border);
  margin-bottom: 12px;
}
body.admin-scene .admin-logo a {
  font-size: 1.1rem; font-weight: 700; color: var(--p-text);
}
body.admin-scene .admin-nav-link {
  color: var(--p-text-sub); border-radius: 8px; padding: 9px 13px; font-size: 0.88rem;
  transition: background 0.2s, color 0.2s;
}
body.admin-scene .admin-nav-link svg { opacity: 0.55; transition: opacity 0.2s; }
body.admin-scene .admin-nav-link:hover { background: var(--p-surface); color: var(--p-text); }
body.admin-scene .admin-nav-link:hover svg { opacity: 1; }
body.admin-scene .admin-nav-link.active {
  background: linear-gradient(135deg, rgba(79,139,255,0.2), rgba(168,85,247,0.12));
  color: #fff; border: 1px solid rgba(79,139,255,0.22); font-weight: 500;
}
body.admin-scene .admin-nav-link.active svg { opacity: 1; }
body.admin-scene .admin-sidebar > div:last-child { border-top: 1px solid var(--p-border); padding-top: 14px; }
body.admin-scene [href="/logout.php"] { color: rgba(248,113,113,0.75) !important; }
body.admin-scene [href="/logout.php"]:hover { background: rgba(239,68,68,0.1); color: #fca5a5 !important; }

/* 主内容区 */
body.admin-scene .admin-main {
  background: #0c0e16;
  color: var(--p-text);
  padding: 34px 38px;
}
body.admin-scene .admin-main h1, body.admin-scene .admin-main h2,
body.admin-scene .admin-main h3, body.admin-scene .admin-main h4 { color: var(--p-text); }
body.admin-scene .admin-main small { color: var(--p-text-muted) !important; }
body.admin-scene .admin-main label { color: var(--p-text-sub); }
body.admin-scene .admin-main a:not(.btn):not(.admin-nav-link) { color: var(--p-aurora-1); }

/* 页面标题 */
body.admin-scene .admin-title {
  font-size: 1.7rem; font-weight: 700; letter-spacing: -0.02em;
  color: var(--p-text); position: relative; padding-bottom: 12px; margin-bottom: 0;
}
body.admin-scene .admin-title::after {
  content: ''; position: absolute; bottom: 0; left: 0;
  width: 32px; height: 2px;
  background: linear-gradient(90deg, var(--p-aurora-1), var(--p-aurora-2)); border-radius: 2px;
}

/* 统计卡片 */
body.admin-scene .stat-card {
  background: var(--p-surface); border: 1px solid var(--p-border);
  border-radius: 14px; padding: 20px 22px; box-shadow: none;
  transition: background 0.2s, border-color 0.2s, transform 0.2s;
  position: relative; overflow: hidden;
}
body.admin-scene .stat-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, var(--p-aurora-1), var(--p-aurora-2), var(--p-aurora-3));
  opacity: 0; transition: opacity 0.3s;
}
body.admin-scene .stat-card:hover { background: var(--p-surface-hv); border-color: var(--p-border-hv); transform: translateY(-2px); }
body.admin-scene .stat-card:hover::before { opacity: 1; }
body.admin-scene .stat-label {
  color: var(--p-text-muted); font-size: 0.76rem;
  text-transform: uppercase; letter-spacing: 0.07em; font-weight: 500; margin-bottom: 9px;
}
body.admin-scene .stat-value { font-size: 1.9rem; font-weight: 700; letter-spacing: -0.02em; color: var(--p-text); }
body.admin-scene .stat-value.accent { color: var(--p-aurora-1); }
body.admin-scene .stat-value.success { color: #4ade80; }
body.admin-scene .stat-value.warning { color: #fbbf24; }

/* 内联卡片盒子 — 覆盖所有 style="background: var(--bg-card)..." 的元素 */
/* 因为 CSS 变量已在 body.admin-scene 级别被覆盖，所有依赖 var(--bg-card) 的内联样式自动生效 */
/* 额外处理直接写死的 bg-card class */
body.admin-scene [class*="category-item"],
body.admin-scene [class*="link-item-admin"],
body.admin-scene .link-item-admin {
  background: var(--p-surface) !important;
  border-color: var(--p-border) !important;
  color: var(--p-text) !important;
}
body.admin-scene .link-item-admin:hover {
  background: var(--p-surface-hv) !important;
}

/* 表单 */
body.admin-scene .form-label {
  color: var(--p-text-sub); font-size: 0.8rem;
  text-transform: uppercase; letter-spacing: 0.06em; font-weight: 500;
}
body.admin-scene .form-input {
  background: rgba(255,255,255,0.05); border: 1px solid var(--p-border);
  border-radius: 10px; color: var(--p-text); font-size: 0.9rem; padding: 11px 13px;
  transition: border-color 0.25s, box-shadow 0.25s, background 0.25s;
}
body.admin-scene .form-input::placeholder { color: var(--p-text-muted); }
body.admin-scene .form-input:focus {
  outline: none; border-color: rgba(79,139,255,0.55);
  background: rgba(255,255,255,0.08); box-shadow: 0 0 0 3px rgba(79,139,255,0.12);
}
body.admin-scene select.form-input option { background: #1a1d2e; color: var(--p-text); }

/* 按钮 */
body.admin-scene .btn-primary {
  background: linear-gradient(135deg, var(--p-aurora-1), var(--p-aurora-2));
  border: none; border-radius: 10px; color: #fff; font-weight: 600;
  font-size: 0.9rem; padding: 10px 22px; cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 16px rgba(79,139,255,0.3);
}
body.admin-scene .btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 28px rgba(79,139,255,0.45); }
body.admin-scene .btn-secondary {
  background: var(--p-surface); border: 1px solid var(--p-border); border-radius: 10px;
  color: var(--p-text-sub); font-size: 0.9rem; padding: 9px 18px;
  cursor: pointer; transition: background 0.2s, border-color 0.2s, color 0.2s;
  text-decoration: none; display: inline-block;
}
body.admin-scene .btn-secondary:hover { background: var(--p-surface-hv); border-color: var(--p-border-hv); color: var(--p-text); }
body.admin-scene .btn-danger {
  background: rgba(239,68,68,0.14); border: 1px solid rgba(239,68,68,0.28);
  border-radius: 10px; color: #fca5a5; font-size: 0.9rem; padding: 9px 18px; cursor: pointer;
  transition: background 0.2s;
}
body.admin-scene .btn-danger:hover { background: rgba(239,68,68,0.24); }

/* 表格 */
body.admin-scene .admin-table,
body.admin-scene .data-table {
  background: var(--p-surface); border: 1px solid var(--p-border); border-radius: 14px; overflow: hidden;
}
body.admin-scene .admin-table thead,
body.admin-scene .data-table thead { background: rgba(255,255,255,0.04); border-bottom: 1px solid var(--p-border); }
body.admin-scene .admin-table th,
body.admin-scene .data-table th {
  color: var(--p-text-muted); font-size: 0.75rem; text-transform: uppercase;
  letter-spacing: 0.08em; padding: 13px 15px; font-weight: 600;
}
body.admin-scene .admin-table td,
body.admin-scene .data-table td {
  color: var(--p-text-sub); font-size: 0.88rem; padding: 11px 15px; border-bottom: 1px solid var(--p-border);
}
body.admin-scene .admin-table tbody tr:hover td,
body.admin-scene .data-table tbody tr:hover td { background: var(--p-surface-hv); color: var(--p-text); }

/* Tag 徽章 */
body.admin-scene .tag { font-size: 0.74rem; padding: 3px 8px; border-radius: 6px; font-weight: 500; }
body.admin-scene .tag-primary { background: rgba(79,139,255,0.14); color: #93c5fd; border: 1px solid rgba(79,139,255,0.22); }
body.admin-scene .tag-success { background: rgba(74,222,128,0.12); color: #86efac; border: 1px solid rgba(74,222,128,0.22); }
body.admin-scene .tag-warning { background: rgba(251,191,36,0.12); color: #fde68a; border: 1px solid rgba(251,191,36,0.22); }
body.admin-scene .tag-danger  { background: rgba(239,68,68,0.12);  color: #fca5a5; border: 1px solid rgba(239,68,68,0.22); }

/* 拖拽 ghost */
body.admin-scene .sortable-ghost { opacity: 0.3; background: rgba(79,139,255,0.12) !important; border: 1px dashed rgba(79,139,255,0.4) !important; }

/* 页面内容淡入 */
@keyframes adminFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
body.admin-scene .admin-main > * { animation: adminFadeIn 0.35s cubic-bezier(0.22,1,0.36,1) both; }
body.admin-scene .admin-main > *:nth-child(1) { animation-delay: 0.04s; }
body.admin-scene .admin-main > *:nth-child(2) { animation-delay: 0.08s; }
body.admin-scene .admin-main > *:nth-child(3) { animation-delay: 0.12s; }
body.admin-scene .admin-main > *:nth-child(4) { animation-delay: 0.16s; }
body.admin-scene .admin-main > *:nth-child(5) { animation-delay: 0.20s; }

/* 滚动条 */
body.admin-scene ::-webkit-scrollbar { width: 5px; }
body.admin-scene ::-webkit-scrollbar-track { background: transparent; }
body.admin-scene ::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }
body.admin-scene ::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

/* 拖拽手柄 */
body.admin-scene .drag-handle { color: var(--p-text-muted) !important; }

/* modal (后台弹窗) */
body.admin-scene .modal-overlay { background: rgba(0,0,0,0.7); }
body.admin-scene .modal-box {
  background: #141720;
  border: 1px solid var(--p-border);
  box-shadow: 0 24px 80px rgba(0,0,0,0.6);
}
body.admin-scene .modal-header { border-bottom: 1px solid var(--p-border); }
body.admin-scene .modal-title { color: var(--p-text); }
body.admin-scene .modal-close { color: var(--p-text-sub); }
body.admin-scene .modal-close:hover { color: var(--p-text); }


/* ══════════════════════════════════════════
   前台右侧设置抽屉
══════════════════════════════════════════ */

/* 设置按钮（替换原来的齿轮跳转按钮） */
.settings-trigger-btn {
  position: relative;
}

/* 抽屉遮罩 */
.settings-drawer-overlay {
  position: fixed; inset: 0; z-index: 900;
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0; pointer-events: none;
  transition: opacity 0.3s ease;
}
.settings-drawer-overlay.open {
  opacity: 1; pointer-events: all;
}

/* 抽屉主体 */
.settings-drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 901;
  width: 320px;
  background: rgba(10,12,22,0.96);
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  border-left: 1px solid rgba(255,255,255,0.1);
  box-shadow: -8px 0 48px rgba(0,0,0,0.5);
  display: flex; flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.36s cubic-bezier(0.32,0,0,1);
  overflow: hidden;
}
.settings-drawer.open {
  transform: translateX(0);
}

/* 抽屉顶部条 */
.settings-drawer::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(79,139,255,0.7), rgba(168,85,247,0.7), transparent);
}

/* 抽屉头部 */
.sdrawer-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  flex-shrink: 0;
}
.sdrawer-title {
  font-size: 0.95rem; font-weight: 600; color: #fff;
  letter-spacing: -0.01em;
}
.sdrawer-close {
  width: 28px; height: 28px; border-radius: 8px;
  background: rgba(255,255,255,0.08); border: none;
  color: rgba(255,255,255,0.55); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s, color 0.2s; font-size: 1.1rem; line-height: 1;
}
.sdrawer-close:hover { background: rgba(255,255,255,0.14); color: #fff; }

/* 抽屉滚动区 */
.sdrawer-body {
  flex: 1; overflow-y: auto; padding: 16px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.1) transparent;
}
.sdrawer-body::-webkit-scrollbar { width: 4px; }
.sdrawer-body::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }

/* 抽屉分区 */
.sdrawer-section {
  margin-bottom: 20px;
}
.sdrawer-section-title {
  font-size: 0.7rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.1em; color: rgba(255,255,255,0.3);
  margin-bottom: 10px; padding: 0 2px;
}

/* 菜单项（页面跳转 / 功能按钮） */
.sdrawer-item {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px; border-radius: 10px;
  color: rgba(255,255,255,0.65); text-decoration: none;
  font-size: 0.88rem; cursor: pointer; border: none;
  background: transparent; width: 100%; text-align: left;
  transition: background 0.18s, color 0.18s;
  margin-bottom: 2px;
}
.sdrawer-item:hover { background: rgba(255,255,255,0.07); color: #fff; }
.sdrawer-item svg { width: 16px; height: 16px; flex-shrink: 0; opacity: 0.7; }
.sdrawer-item:hover svg { opacity: 1; }
.sdrawer-item.active { background: rgba(79,139,255,0.14); color: #fff; }
.sdrawer-item.active svg { opacity: 1; }
.sdrawer-item-badge {
  margin-left: auto; font-size: 0.7rem; padding: 2px 7px;
  background: rgba(79,139,255,0.2); border-radius: 20px; color: #93c5fd;
}

/* 外观设置区 — 布局选项卡片 */
.sdrawer-layout-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
  margin-top: 4px;
}
.layout-option {
  border: 1px solid rgba(255,255,255,0.1); border-radius: 10px;
  padding: 10px 8px; cursor: pointer; text-align: center;
  background: rgba(255,255,255,0.03);
  transition: border-color 0.2s, background 0.2s;
  position: relative;
}
.layout-option:hover { background: rgba(255,255,255,0.07); border-color: rgba(255,255,255,0.2); }
.layout-option.selected {
  border-color: rgba(79,139,255,0.6);
  background: rgba(79,139,255,0.1);
}
.layout-option.selected::after {
  content: '✓';
  position: absolute; top: 4px; right: 6px;
  font-size: 0.65rem; color: var(--p-aurora-1); font-weight: 700;
}
.layout-option-icon {
  font-size: 1.2rem; margin-bottom: 4px; line-height: 1;
}
.layout-option-label {
  font-size: 0.72rem; color: rgba(255,255,255,0.5); line-height: 1.3;
}
.layout-option.selected .layout-option-label { color: rgba(255,255,255,0.85); }

/* 开关行 */
.sdrawer-toggle-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 4px; margin-bottom: 2px;
}
.sdrawer-toggle-label {
  font-size: 0.86rem; color: rgba(255,255,255,0.6);
}
.sdrawer-toggle {
  width: 36px; height: 20px; border-radius: 10px;
  background: rgba(255,255,255,0.12); border: none; cursor: pointer;
  position: relative; transition: background 0.2s; flex-shrink: 0;
}
.sdrawer-toggle::after {
  content: ''; position: absolute; top: 2px; left: 2px;
  width: 16px; height: 16px; border-radius: 50%;
  background: rgba(255,255,255,0.55);
  transition: transform 0.2s, background 0.2s;
}
.sdrawer-toggle.on { background: rgba(79,139,255,0.7); }
.sdrawer-toggle.on::after { transform: translateX(16px); background: #fff; }

/* 抽屉底部保存按钮 */
.sdrawer-footer {
  padding: 14px 16px;
  border-top: 1px solid rgba(255,255,255,0.07);
  flex-shrink: 0;
}
.sdrawer-save-btn {
  width: 100%; padding: 11px;
  background: linear-gradient(135deg, #4f8bff, #a855f7);
  border: none; border-radius: 10px; color: #fff;
  font-size: 0.9rem; font-weight: 600; cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 16px rgba(79,139,255,0.3);
}
.sdrawer-save-btn:hover { transform: translateY(-1px); box-shadow: 0 7px 24px rgba(79,139,255,0.45); }
.sdrawer-save-btn:active { transform: translateY(0); }

/* 响应式 */
@media (max-width: 480px) {
  .settings-drawer { width: 290px; }
}


/* ══════════════════════════════════════════
   外观偏好布局类（由 JS 动态添加到 #navGrid）
══════════════════════════════════════════ */

/* 2列宽卡 */
#navGrid.pref-grid2 {
    grid-template-columns: repeat(auto-fill, minmax(480px, 1fr)) !important;
}
#navGrid.pref-grid2 .category-card {
    height: 260px !important;
    max-height: 260px !important;
}
#navGrid.pref-grid2 .links-list {
    grid-template-columns: repeat(4, 1fr) !important;
}

/* 紧凑列表 */
#navGrid.pref-list {
    grid-template-columns: 1fr !important;
    padding: 10px 80px 30px !important;
}
#navGrid.pref-list .category-card {
    height: auto !important;
    max-height: none !important;
    border-radius: 12px !important;
}
#navGrid.pref-list .links-list {
    grid-template-columns: repeat(6, 1fr) !important;
    overflow: visible !important;
}

/* 极简 */
#navGrid.pref-compact {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)) !important;
    gap: 10px !important;
}
#navGrid.pref-compact .category-card {
    height: 200px !important;
    max-height: 200px !important;
    border-radius: 14px !important;
    padding: 8px 0 !important;
}
#navGrid.pref-compact .category-header { padding: 4px 10px !important; min-height: 36px !important; }
#navGrid.pref-compact .category-title { font-size: 13px !important; }
#navGrid.pref-compact .links-list { grid-template-columns: repeat(3, 1fr) !important; }
#navGrid.pref-compact .link-item { min-height: 28px !important; max-height: 28px !important; font-size: 12px !important; }
