/* 全站公共：颜色变量、重置、后台/钟控共用顶栏 */
:root {
  color-scheme: light;
  --bg: #f3f5f8;
  --panel: #ffffff;
  --line: #e2e6ee;
  --text: #1c2330;
  --muted: #6b7385;
  --gold: #c48a1a;
  --red: #dc2626;
  --green: #059669;
  --blue: #2563eb;
  --fill: #eef1f6;
  --fill-strong: #e4e9f2;
  --inset: #f6f8fb;
  --table-head: #f3f5f9;
  --table-hover: #eef1f6;
  --table-muted: #9aa3b2;
  --off: #9aa3b2;
  --mask: rgba(15, 23, 42, .4);
  --shadow: rgba(15, 23, 42, .12);
  --loading-mask: rgba(255, 255, 255, .78);
}
html.dark {
  color-scheme: dark;
  --bg: #07090d;
  --panel: #12161e;
  --line: #232a36;
  --text: #f3f4f6;
  --muted: #8b93a7;
  --gold: #f5c15d;
  --red: #ef4444;
  --green: #34d399;
  --blue: #60a5fa;
  --fill: #1d2430;
  --fill-strong: #161b24;
  --inset: #0e1218;
  --table-head: #161b24;
  --table-hover: #1d2430;
  --table-muted: #4a5160;
  --off: #3a4250;
  --mask: rgba(0, 0, 0, .5);
  --shadow: rgba(0, 0, 0, .4);
  --loading-mask: rgba(7, 9, 13, .72);
}
* { box-sizing: border-box; }
html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: "Avenir Next", "PingFang SC", "Helvetica Neue", sans-serif;
}
a { color: var(--gold); text-decoration: none; }
[v-cloak] { display: none !important; }
.num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }

/* 外观切换：自动 / 月亮 / 太阳，悬停立刻显示当前档 */
.theme-toggle {
  position: relative;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  flex-shrink: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.theme-toggle:hover { color: var(--text); }
.theme-toggle svg {
  width: 20px;
  height: 20px;
  display: block;
}
.theme-toggle::after {
  content: attr(data-tip);
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  padding: 5px 8px;
  border-radius: 6px;
  background: var(--text);
  color: var(--bg);
  font-size: 12px;
  line-height: 1.2;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  z-index: 80;
}
.theme-toggle:hover::after,
.theme-toggle:focus-visible::after {
  opacity: 1;
}
.theme-toggle.is-fixed {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 30;
}

/* 后台 / 钟控共用顶栏 */
.ctrl-head, .admin-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  border-bottom: 1px solid var(--line);
}
.admin-head-ops,
.ctrl-head-ops {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.admin-head-ops .el-dropdown,
.ctrl-head-ops .el-dropdown {
  margin-right: 12px;
}
.user-menu {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
  line-height: 1;
  outline: none;
}
.user-menu:hover { color: var(--text); }
.user-menu .caret {
  font-size: 12px;
  opacity: .7;
}
.brand { font-size: 22px; font-weight: 700; color: var(--gold); }
.el-loading-mask {
  background-color: var(--loading-mask) !important;
}
