/* ============================================================
 * 掼蛋会员信息系统 · 样式
 * 视觉规范统一到「掼蛋比赛编排系统」：深色底 + 明金强调色 + 左侧栏导航
 * （配色变量、侧栏/顶栏/按钮/面板/表格/标签均照搬编排系统 css/style.css 的口径）
 * ============================================================ */
:root {
  --bg: #0f1420;
  --bg-soft: #151b2b;
  --panel: #1a2236;
  --panel-2: #202a42;
  --border: #2b3654;
  --text: #e8ecf5;
  --text-dim: #9aa7c4;
  --muted: #6b7797;
  --primary: #e6a23c;
  --primary-2: #c98a26;
  --danger: #e0564f;
  --ok: #3fbf7f;
  --warn: #d9a13b;
  /* 选中态绿：与编排系统一致（黄＝可点功能按钮，绿＝已选中） */
  --pick: #2e9e5b;
  --pick-2: #26804a;
  --radius: 10px;
  --shadow: 0 8px 24px rgba(0, 0, 0, .35);
  --primary-grad: linear-gradient(135deg, #f5c56a 0%, #e0a231 100%);
  --primary-soft: rgba(230, 162, 60, .12);
  --ease-spring: cubic-bezier(.34, 1.4, .4, 1);
}

/* ============ 浅色主题（html.light，顶栏右侧“浅色/深色”切换）
 * 变量口径与编排系统 css/style.css 的 html.light 完全一致，保证两套系统视觉统一。 ============ */
html.light {
  --bg: #eef1f6;
  --bg-soft: #ffffff;
  --panel: #ffffff;
  --panel-2: #f3f6fb;
  --border: #d8e0ec;
  --text: #22303e;
  --text-dim: #54657c;
  --muted: #8796ab;
  --primary: #b8860b;
  --primary-2: #9a7008;
  --danger: #d6453f;
  --ok: #2f9e68;
  --warn: #b7791f;
  --shadow: 0 8px 24px rgba(35, 60, 100, .10);
  /* 浅色下明金渐变压深一档，否则白底上看不清 */
  --primary-grad: linear-gradient(135deg, #e0a83f 0%, #b8860b 100%);
  --primary-soft: rgba(184, 134, 11, .13);
}
/* 浅色主题下的局部修正（对照编排系统 html.light 的补充规则） */
html.light #topbar { background: linear-gradient(90deg, #f7f4ea, #eef4fb); border-bottom-color: #dce4ef; }
html.light .brand-text h1 { color: #16324a; background: none; -webkit-text-fill-color: #16324a; }
html.light .logo { box-shadow: 0 2px 10px rgba(184, 134, 11, .3), 0 0 16px rgba(184, 134, 11, .16); }
html.light #sidebar { border-right-color: #dce4ef; }
html.light .nav-ico { background: var(--panel-2); }
html.light table td { border-bottom-color: #e6ecf4; }
html.light table tr:hover td { background: rgba(30, 70, 130, .05); }
html.light table tr.bad td { background: rgba(214, 69, 63, .08); }
html.light .note { border-left-color: var(--border); }
html.light .login-box { box-shadow: var(--shadow); }
html.light .card .v, html.light .stat b { color: var(--primary); }

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.6 "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
}
a { color: var(--primary); text-decoration: none; }
button { font-family: inherit; }
input, select, textarea {
  font-family: inherit; font-size: 13px;
  background: var(--bg-soft); color: var(--text);
  border: 1px solid var(--border); border-radius: 6px;
  padding: 7px 10px; outline: none; width: 100%;
}
input:focus, select:focus, textarea:focus { border-color: var(--primary); }
textarea { resize: vertical; }

/* ---------- 布局：顶栏 + 左侧栏 + 内容 ---------- */
#app { display: flex; flex-direction: column; height: 100vh; }
#topbar {
  height: 60px; flex: 0 0 60px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px;
  background: linear-gradient(90deg, #181f33, #1c2438);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 12px; }
/* LOGO：与编排系统同一张 logo-icon.png，金色渐变底 + 发光 */
.logo {
  width: 40px; height: 40px; flex: none; border-radius: 10px;
  object-fit: contain;
  background: var(--primary-grad);
  box-shadow: 0 2px 10px rgba(230, 162, 60, .35),
              0 0 18px rgba(230, 162, 60, .22),
              inset 0 1px 0 rgba(255, 255, 255, .35);
  transition: transform .2s var(--ease-spring);
}
.brand:hover .logo { transform: scale(1.05) rotate(-2deg); }
.brand-text h1 {
  font-size: 17px; font-weight: 700; letter-spacing: 1px;
  background: linear-gradient(90deg, var(--text), #f6d9a0);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.brand-text .sub { font-size: 11px; color: var(--muted); }
.ver { color: var(--muted); font-size: 12px; margin-left: 6px; letter-spacing: 0; }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.comp-info { display: flex; flex-direction: column; align-items: flex-end; margin-right: 6px; }
.comp-name { font-weight: 600; color: var(--primary); }
.comp-name.muted { color: var(--muted); }
.comp-meta { font-size: 11px; color: var(--muted); }

#layout { flex: 1; display: flex; overflow: hidden; }
#sidebar {
  width: 200px; flex: 0 0 200px;
  background: var(--bg-soft); border-right: 1px solid var(--border);
  padding: 14px 10px; overflow-y: auto;
}
#nav-list { list-style: none; }
/* 间距与编排系统一致：li 只负责外框与 4px 行距，内边距全部交给内层 a，避免双层 padding 把行距撑开 */
#nav-list li {
  position: relative;
  display: flex; align-items: center;
  margin-bottom: 4px; border-radius: 8px;
  cursor: pointer; color: var(--text-dim);
  transition: background .15s, color .15s, transform .15s;
}
#nav-list a {
  display: flex; align-items: center; gap: 10px;
  flex: 1; padding: 10px 12px; color: inherit;
}
/* 选中：左侧明黄竖条（平时收起，选中时弹开） */
#nav-list li::before {
  content: ""; position: absolute; left: 0; top: 50%;
  transform: translateY(-50%) scaleY(0);
  width: 3px; height: 60%; border-radius: 3px;
  background: var(--primary-grad);
  transition: transform .2s var(--ease-spring);
}
#nav-list li:hover { background: var(--panel); color: var(--text); transform: translateX(2px); }
#nav-list li.on {
  background: linear-gradient(90deg, var(--primary-soft), transparent);
  color: var(--primary); font-weight: 600;
}
#nav-list li.on::before { transform: translateY(-50%) scaleY(1); }
.nav-ico {
  font-size: 11px; font-weight: 700; width: 22px; flex: none; text-align: center;
  color: var(--muted); font-variant-numeric: tabular-nums;
  background: var(--bg); border: 1px solid var(--border); border-radius: 5px; padding: 2px 0;
  transition: all .15s;
}
#nav-list li.on .nav-ico {
  color: #1a1406; background: var(--primary-grad);
  border-color: transparent;
  box-shadow: 0 0 10px rgba(230, 162, 60, .3);
}
.sidebar-footer {
  margin-top: 18px; padding: 10px 12px;
  font-size: 11px; color: var(--muted);
  border-top: 1px solid var(--border);
  text-align: center; white-space: nowrap;
}
/* 侧栏底部微信二维码（扫码联系掼蛋博士），与编排系统同款 */
.sidebar-qr {
  margin-top: 10px; padding: 9px 8px 8px;
  background: var(--panel-2); border: 1px solid var(--border);
  border-radius: 10px; text-align: center;
}
.sidebar-qr img {
  display: block; width: 140px; height: 140px; margin: 0 auto;
  border-radius: 8px; background: #fff; object-fit: contain;
}
.sidebar-qr p {
  margin-top: 7px; font-size: 10px; line-height: 1.35;
  color: var(--muted); white-space: nowrap;
}

#content { flex: 1; overflow-y: auto; padding: 22px 26px; }
main { max-width: 1280px; }

/* ---------- 通用组件 ---------- */
.page-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 18px;
}
.page-head h2 {
  font-size: 20px; font-weight: 700; letter-spacing: .3px;
  display: flex; align-items: center; gap: 8px;
}
.page-head h2::before {
  content: ""; width: 4px; height: 18px; border-radius: 2px;
  background: var(--primary-grad); flex: none;
}
h3 {
  font-size: 15px; font-weight: 700; margin: 22px 0 10px;
  display: flex; align-items: center; gap: 8px;
}
h3::before {
  content: ""; width: 4px; height: 15px; border-radius: 2px;
  background: var(--primary-grad); flex: none;
}
.hint { font-size: 12px; color: var(--muted); margin-top: 6px; }
.muted { color: var(--muted); }
.note {
  font-size: 12px; color: var(--muted); margin: 8px 0 16px;
  padding: 8px 12px; background: var(--bg-soft);
  border-left: 3px solid var(--border); border-radius: 4px;
}
.head-actions { display: flex; gap: 10px; align-items: center; }

.btn {
  display: inline-block;
  background: var(--panel-2); color: var(--text);
  border: 1px solid var(--border); border-radius: 8px;
  padding: 8px 16px; cursor: pointer; font-size: 13px;
  transition: all .15s; white-space: nowrap;
}
.btn:hover { border-color: var(--primary); color: var(--primary); }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #1a1406; font-weight: 600; }
.btn.primary:hover { background: var(--primary-2); color: #1a1406; }
.btn.ghost { background: transparent; }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.danger:hover { color: #fff; border-color: var(--danger); }
.btn.small { padding: 5px 12px; font-size: 12px; }
.btn.tiny { padding: 3px 8px; font-size: 11px; border-radius: 6px; }
.actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 12px 0; }

/* 面板 / 卡片：与编排系统 .panel 一致 */
.card, .panel {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px; margin-bottom: 16px;
}
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 12px 0 16px; }
.cards .card { margin-bottom: 0; text-align: center; }
.card .k { color: var(--muted); font-size: 12px; }
.card .v { font-size: 22px; font-weight: 600; margin-top: 4px; color: var(--primary); font-variant-numeric: tabular-nums; }
.card.wide { margin-bottom: 16px; }

/* 待办条 */
.todo { display: grid; gap: 10px; margin: 12px 0 16px; }
.todo-item {
  display: flex; align-items: center; gap: 10px;
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 8px; padding: 12px 14px; font-size: 13px;
}
.todo-item b { color: var(--primary); font-size: 16px; font-variant-numeric: tabular-nums; }
.todo-item .btn { margin-left: auto; }

/* 表格 */
table.grid, table {
  width: 100%; border-collapse: collapse; margin: 10px 0 16px;
}
table th {
  text-align: left; font-size: 12px; color: var(--muted);
  padding: 8px 10px; border-bottom: 1px solid var(--border); font-weight: 600;
}
table td { padding: 9px 10px; border-bottom: 1px solid rgba(43, 54, 84, .5); font-size: 13px; }
table tr:hover td { background: rgba(255, 255, 255, .02); }
table tr.bad td { background: rgba(224, 86, 79, .08); }
table td.num, table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.ops { white-space: nowrap; }

/* 标签 */
.tag {
  display: inline-block; padding: 2px 9px; border-radius: 20px;
  font-size: 11px; background: var(--panel-2); color: var(--text-dim);
}
.tag.ok { background: rgba(63, 191, 127, .15); color: var(--ok); }
.tag.warn { background: rgba(217, 161, 59, .15); color: var(--warn); }
.tag.danger { background: rgba(224, 108, 92, .15); color: var(--danger); }
.mini { font-size: 11px; color: var(--muted); margin-top: 3px; }
.err { color: var(--danger); }

/* 空状态 */
.empty {
  text-align: center; padding: 70px 20px; color: var(--muted);
  background: var(--panel); border: 1px dashed var(--border);
  border-radius: var(--radius); margin: 12px 0;
}

/* 提示条 */
.flash {
  padding: 10px 14px; margin: 0 0 16px; border-radius: 8px;
  font-size: 13px; background: var(--panel-2);
  border-left: 3px solid var(--primary); color: var(--text);
}
.flash.ok { border-left-color: var(--ok); }
.flash.bad { border-left-color: var(--danger); }

/* 表单 */
.form { max-width: 720px; }
.form label, .fld { display: block; margin-bottom: 14px; font-size: 12px; color: var(--muted); }
.form label input, .form label select, .form label textarea { margin-top: 6px; font-size: 13px; color: var(--text); }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0 14px; }
.map-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 14px; }
.filters { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.filters input, .filters select { width: auto; min-width: 130px; }
.chk { display: flex; align-items: center; gap: 8px; padding: 8px 0; font-size: 13px; }
.chk input { width: auto; }
.consent-box {
  background: var(--panel-2); border: 1px solid var(--border);
  border-radius: 8px; padding: 12px 14px; font-size: 12px;
  color: var(--text-dim); line-height: 1.7; margin: 10px 0;
}

/* 分段选择（本月 / 近30天 / 本年）：选中＝绿 */
.seg { display: flex; gap: 8px; flex-wrap: wrap; }
.seg a {
  background: var(--panel); border: 1px solid var(--border); color: var(--text-dim);
  padding: 6px 16px; border-radius: 20px; font-size: 13px; transition: all .15s;
}
.seg a:hover { border-color: var(--primary); color: var(--text); }
.seg a.on { background: var(--pick); border-color: var(--pick); color: #fff; font-weight: 600; }

/* 步骤条（导入向导） */
.steps { display: flex; gap: 8px; list-style: none; margin: 0 0 16px; flex-wrap: wrap; }
.steps li {
  padding: 6px 14px; border-radius: 20px; font-size: 12px;
  background: var(--panel); border: 1px solid var(--border); color: var(--muted);
}
.steps li.on { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); font-weight: 600; }
.summary { font-size: 13px; color: var(--text-dim); margin: 12px 0; }
.summary b { color: var(--primary); }
.preview tr.bad td { background: rgba(224, 86, 79, .08); }

/* 统计行 */
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; }
.stat {
  background: var(--bg-soft); border: 1px solid var(--border); border-radius: 8px;
  padding: 14px; text-align: center;
}
.stat b { display: block; font-size: 22px; color: var(--primary); }
.stat span { font-size: 12px; color: var(--muted); }

footer {
  flex: none; text-align: center; color: var(--muted); font-size: 12px;
  padding: 10px 18px; border-top: 1px solid var(--border); background: var(--bg-soft);
}

/* ---------- 登录页 ---------- */
body.login { display: flex; align-items: center; justify-content: center; }
.login-box {
  width: 380px; max-width: 92vw;
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 14px; padding: 30px 28px; box-shadow: var(--shadow);
}
.login-box h1 {
  font-size: 20px; font-weight: 700; margin-bottom: 6px;
  background: linear-gradient(90deg, var(--text), #f6d9a0);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.login-box .sub { font-size: 12px; color: var(--muted); margin-bottom: 20px; }
.login-box label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 14px; }
.login-box label input { margin-top: 6px; }
.login-box .btn { width: 100%; margin-top: 6px; }

/* ---------- 窄屏：侧栏收起，顶栏汉堡按钮展开 ---------- */
.nav-toggle {
  display: none; width: 36px; height: 36px; flex: none;
  background: var(--panel-2); border: 1px solid var(--border); border-radius: 8px;
  color: var(--text); font-size: 15px; cursor: pointer;
}
@media (max-width: 900px) {
  .nav-toggle { display: flex; align-items: center; justify-content: center; }
  #sidebar {
    position: fixed; z-index: 60; top: 60px; bottom: 0; left: 0;
    transform: translateX(-100%); transition: transform .2s var(--ease-spring);
    box-shadow: var(--shadow);
  }
  body.nav-open #sidebar { transform: translateX(0); }
  #content { padding: 16px 14px; }
}
