/* ============================================================================
   styles_user.css - 4 主题用户端皮肤 (mobile-first)
   ========================================================================== */

/* ============== 4 主题 CSS 变量 (含深色面板/分隔/字体/背景径向) ==============
   默认主题落到 light-sun(:root), 用户加 body.theme-* 后覆盖。
   定义变量以满足任务规范(--bg / --panel / --line / --ink / --accent /
   --accent-soft / --muted / --bg-radial),其余非规范变量取自源 console CSS。 */
:root {
  --bg: #fef9f3;
  --panel: #fff;
  --line: #fde68a;
  --ink: #78350f;
  --accent: #f0b429;
  --accent-soft: rgba(240, 180, 41, 0.15);
  --muted: #92400e;
  --bg-radial: radial-gradient(circle at top, rgba(240, 180, 41, 0.12), transparent 70%);
}

/* 红黑月亮: 深底 + 红强调 */
body.theme-dark-moon {
  --bg: #0a0e14;
  --panel: rgba(255, 255, 255, 0.03);
  --line: rgba(239, 68, 68, 0.18);
  --ink: #f5f5f5;
  --accent: #ef4444;
  --accent-soft: rgba(239, 68, 68, 0.12);
  --muted: rgba(245, 245, 245, 0.55);
  --bg-radial: radial-gradient(circle at top, rgba(239, 68, 68, 0.10), transparent 70%);
}

/* 浅橙太阳: 米色 + 金色强调 */
body.theme-light-sun {
  --bg: #fef9f3;
  --panel: rgba(255, 255, 255, 0.7);
  --line: rgba(240, 180, 41, 0.2);
  --ink: #1a1410;
  --accent: #f0b429;
  --accent-soft: rgba(240, 180, 41, 0.14);
  --muted: rgba(26, 20, 16, 0.55);
  --bg-radial: radial-gradient(circle at top, rgba(240, 180, 41, 0.12), transparent 70%);
}

/* 极光蓝绿: 深青底 + 青色强调 */
body.theme-aurora {
  --bg: #0a1218;
  --panel: rgba(255, 255, 255, 0.03);
  --line: rgba(139, 229, 221, 0.18);
  --ink: #e6f5f3;
  --accent: #8be5dd;
  --accent-soft: rgba(139, 229, 221, 0.12);
  --muted: rgba(230, 245, 243, 0.55);
  --bg-radial: radial-gradient(circle at top, rgba(139, 229, 221, 0.10), transparent 70%);
}

/* 灰白纸质: 浅灰 + 板岩灰强调 */
body.theme-gray-paper {
  --bg: #f8fafc;
  --panel: rgba(255, 255, 255, 0.9);
  --line: rgba(71, 85, 105, 0.15);
  --ink: #0f172a;
  --accent: #475569;
  --accent-soft: rgba(71, 85, 105, 0.10);
  --muted: rgba(15, 23, 42, 0.55);
  --bg-radial: radial-gradient(circle at top, rgba(71, 85, 105, 0.06), transparent 70%);
}

/* ============== 基础布局 (mobile-first) ============== */
* { margin: 0; padding: 0; box-sizing: border-box; }
html {
  font-size: 14px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  overflow-x: hidden;
}
body {
  background: var(--bg-radial), var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
               "Microsoft YaHei", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button, .btn, a.btn, input, select {
  min-height: 44px;
  padding: 12px 16px;
  font-size: 15px;
  -webkit-tap-highlight-color: transparent;
}
button { font-family: inherit; cursor: pointer; border: 1px solid var(--line); }
h1, h2, h3 { color: var(--ink); font-weight: 800; }

/* ============== H5 自适应 (mobile-first) ============== */
@media (max-width: 768px) {
  html { font-size: 13px; }
  .nav-desktop { display: none !important; }
  .nav-mobile-toggle { display: flex !important; }
  .grid,
  [class*="grid"]:not(.theme-menu):not(.theme-switch) {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }
  .container,
  main,
  .main,
  section { padding: 12px 16px !important; }
  .card { padding: 12px !important; }
  .nav-inner { padding: 12px 16px !important; flex-wrap: wrap; }
}
@media (min-width: 769px) {
  .nav-mobile-toggle { display: none !important; }
}

/* ============== 触摸目标 (Apple HIG ≥ 44×44) ============== */
.nav-tab,
.nav-link,
.btn-primary,
.tpl-btn,
.theme-opt,
button[type="button"] { min-height: 44px; }

/* ============== 通用控件 ============== */
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  backdrop-filter: blur(8px);
}
.badge {
  display: inline-block;
  padding: 2px 8px;
  font-size: 11px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid var(--line);
}
.dot {
  display: inline-block;
  width: 10px; height: 10px;
  border-radius: 50%;
  margin-right: 8px;
  vertical-align: middle;
}
.dot-dark-moon { background: #ef4444; }
.dot-light-sun { background: #f0b429; }
.dot-aurora    { background: #8be5dd; }
.dot-gray-paper{ background: #475569; }

/* ============== 主题切换器 (浮动圆球控件) ============== */
.theme-switcher {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 100;
  display: flex;
  gap: 8px;
  padding: 6px 10px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 999px;
  backdrop-filter: blur(8px);
}
.theme-switcher button {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid var(--line);
  cursor: pointer;
  padding: 0;
  min-height: 32px;
  transition: transform 160ms ease, box-shadow 160ms ease;
}
.theme-switcher button:hover { transform: scale(1.12); }
.theme-switcher button.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}
.theme-switcher .t-dark-moon { background: #ef4444; }
.theme-switcher .t-light-sun { background: #f0b429; }
.theme-switcher .t-aurora    { background: #8be5dd; }
.theme-switcher .t-gray-paper{ background: #475569; }

/* ============== 表格 (支持 4 主题边框) ============== */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
table th {
  text-align: left;
  padding: 10px 12px;
  color: var(--muted);
  font-weight: 600;
  border-bottom: 1px solid var(--line);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}
table td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: var(--ink);
}
body.theme-light-sun table td,
body.theme-gray-paper table td {
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}
table tr:hover td { background: var(--accent-soft); }

/* ============== 横竖屏 (landscape 重排) ============== */
@media (orientation: landscape) and (max-width: 980px) {
  .nav-inner { flex-direction: row; }
}
