/* ============================================================
   ESOP 管理后台 · 暗夜黛金主题
   ============================================================ */
:root {
  --bg: #0B1220;
  --bg-2: #0E1626;
  --panel: #111A2B;
  --panel-2: #16203400;
  --line: #1E2739;
  --line-2: #263248;
  --gold: #C9A961;
  --gold-2: #D8BC7E;
  --gold-dim: #8A6F3C;
  --text: #E6EAF2;
  --text-2: #A7B0C4;
  --text-3: #6C7789;
  --up: #E5484D;     /* 涨 · 红 */
  --down: #30A46E;   /* 跌 · 绿 */
  --warn: #E0A33E;
  --info: #5B8DEF;
  --f-serif: Georgia, "Songti SC", "SimSun", serif;
  --f-sans: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  --f-mono: "SF Mono", Consolas, "Roboto Mono", Menlo, monospace;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--f-sans);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
a { color: var(--gold); text-decoration: none; }
.num { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }

/* ---------------- 登录页 ---------------- */
.login-wrap { display: flex; min-height: 100vh; }
.login-brand {
  flex: 1 1 46%;
  padding: 64px 56px;
  background:
    radial-gradient(120% 90% at 12% 8%, rgba(201,169,97,.16), transparent 60%),
    linear-gradient(160deg, #0B1220 0%, #0E1728 55%, #0A101C 100%);
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
}
.brand-mark {
  width: 62px; height: 62px; border-radius: 16px;
  border: 1px solid var(--gold-dim);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--f-serif); font-size: 18px; letter-spacing: 1px;
  color: var(--gold); background: rgba(201,169,97,.08);
}
/* 品牌 logo 放进金色描边方块里，46px 留出内边距 */
.brand-mark img { width: 46px; height: 46px; object-fit: contain; display: block; }
.brand-title {
  margin: 30px 0 6px; font-family: var(--f-serif);
  font-size: 40px; line-height: 1.28; font-weight: 600; letter-spacing: 1px;
}
.brand-sub { margin: 0 0 44px; color: var(--text-3); letter-spacing: 3px; font-size: 12px; text-transform: uppercase; }
.brand-points { list-style: none; margin: 0; padding: 0; }
.brand-points li {
  padding: 14px 0 14px 18px; border-left: 2px solid var(--gold-dim);
  color: var(--text-2); margin-bottom: 18px; font-size: 13px; line-height: 1.7;
}
.brand-points span {
  display: inline-block; min-width: 62px; margin-right: 12px;
  color: var(--gold); font-family: var(--f-serif); font-size: 15px;
}
.brand-foot { margin-top: auto; display: flex; align-items: center; justify-content: flex-start; gap: 10px; color: var(--text-3); font-size: 12px; }
.brand-foot a { color: var(--text-3); text-decoration: none; }
.brand-foot a:hover { color: var(--gold); text-decoration: underline; }

.login-panel {
  flex: 1 1 54%; display: flex; align-items: center; justify-content: center; padding: 48px;
  background: var(--bg);
}
.login-card { width: 100%; max-width: 400px; }
.lc-head { margin-bottom: 28px; }
.lc-title { font-family: var(--f-serif); font-size: 26px; letter-spacing: 1px; }
.lc-desc { margin-top: 8px; color: var(--text-3); font-size: 12.5px; }

.field { display: block; margin-bottom: 18px; }
.f-label { display: block; margin-bottom: 8px; color: var(--text-2); font-size: 12.5px; letter-spacing: .5px; }
.f-input {
  width: 100%; height: 46px; padding: 0 14px;
  background: #0D1524; border: 1px solid var(--line-2); border-radius: 8px;
  color: var(--text); outline: none; transition: border-color .15s, box-shadow .15s;
}
.f-input:focus { border-color: var(--gold-dim); box-shadow: 0 0 0 3px rgba(201,169,97,.12); }
.f-input::placeholder { color: #4C566B; }

/* ---------- 公告富文本编辑器（零依赖 contenteditable） ---------- */
.rich-bar {
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
  padding: 8px 10px; border: 1px solid var(--line, #2A3245); border-bottom: none;
  border-radius: 10px 10px 0 0; background: #141A27;
}
.rich-b {
  min-width: 30px; height: 30px; padding: 0 9px; border: 1px solid var(--line, #2A3245);
  border-radius: 7px; background: #1A2130; color: var(--text, #E6EAF2);
  font-size: 13px; line-height: 1; cursor: pointer; user-select: none;
}
.rich-b:hover { border-color: var(--gold-dim, #C9A961); color: var(--gold, #C9A961); }
.rich-b:active { transform: translateY(1px); }
.rich-ed {
  min-height: 190px; max-height: 420px; overflow-y: auto;
  padding: 12px 14px; border: 1px solid var(--line, #2A3245); border-radius: 0 0 10px 10px;
  background: #131822; color: var(--text, #E6EAF2); font-size: 14px; line-height: 1.7; outline: none;
}
.rich-ed:focus { border-color: var(--gold-dim, #C9A961); box-shadow: 0 0 0 3px rgba(201,169,97,.12); }
.rich-ed p { margin: 0 0 10px; }
.rich-ed h3 { margin: 14px 0 8px; font-size: 16px; }
.rich-ed blockquote {
  margin: 10px 0; padding: 6px 12px; border-left: 3px solid var(--gold-dim, #C9A961);
  background: rgba(201,169,97,.07); color: var(--text-2, #A7B0C0);
}
.rich-ed ul, .rich-ed ol { margin: 8px 0; padding-left: 22px; }
.rich-ed li { margin: 4px 0; }
.rich-ed img { max-width: 100%; height: auto; border-radius: 8px; margin: 8px 0; display: block; }
.rich-ed a { color: var(--gold, #C9A961); }

.f-wrap { display: block; position: relative; }
.f-eye {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  background: none; border: 0; color: var(--text-3); cursor: pointer; font-size: 12px; padding: 6px 8px;
}
.f-eye:hover { color: var(--gold); }

.login-row { display: flex; align-items: center; justify-content: space-between; margin: 4px 0 16px; font-size: 12.5px; }
.remember { display: flex; align-items: center; gap: 7px; color: var(--text-2); cursor: pointer; }
.remember input { accent-color: var(--gold); }
.forgot { color: var(--text-3); }
.forgot:hover { color: var(--gold); }

.login-err {
  min-height: 20px; margin-bottom: 10px; font-size: 12.5px; color: var(--up);
}
.btn-primary {
  width: 100%; height: 48px; border: 0; border-radius: 8px; cursor: pointer;
  background: linear-gradient(135deg, var(--gold-2), var(--gold));
  color: #1A1405; font-size: 15px; letter-spacing: 4px; font-weight: 600;
}
.btn-primary:hover { filter: brightness(1.06); }
.btn-primary:disabled { opacity: .6; cursor: not-allowed; }

.demo-box { margin-top: 26px; padding-top: 20px; border-top: 1px dashed var(--line-2); }
.demo-title { color: var(--text-3); font-size: 12px; margin-bottom: 12px; }
.demo-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 7px 12px; border: 1px solid var(--line-2); border-radius: 999px;
  background: #0D1524; color: var(--text-2); cursor: pointer; font-size: 12px;
}
.chip:hover { border-color: var(--gold-dim); color: var(--gold); }
.login-note { margin-top: 22px; color: #4C566B; font-size: 11.5px; line-height: 1.8; }

/* ---------------- 后台框架 ---------------- */
.app { display: flex; min-height: 100vh; }
.side {
  width: 232px; flex: 0 0 232px; background: #0A111E; border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
}
.side-brand { display: flex; align-items: center; gap: 10px; padding: 20px 20px 18px; border-bottom: 1px solid var(--line); }
.sb-mark {
  width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--gold-dim);
  color: var(--gold); display: flex; align-items: center; justify-content: center;
  font-family: var(--f-serif); background: rgba(201,169,97,.08);
  overflow: hidden;
}
/* 侧边栏用 64×64 的小图（3.9KB），不用 231KB 原图 */
.sb-mark img { width: 24px; height: 24px; object-fit: contain; display: block; }
.sb-name { font-family: var(--f-serif); font-size: 15px; letter-spacing: 1px; }
.side-nav { flex: 1; padding: 14px 10px; overflow-y: auto; }
.nav-group { color: var(--text-3); font-size: 11px; letter-spacing: 1px; padding: 14px 12px 8px; }
.nav-item {
  display: block; width: 100%; text-align: left; padding: 10px 12px; margin-bottom: 2px;
  background: none; border: 0; border-radius: 7px; color: var(--text-2); cursor: pointer; font-size: 13.5px;
}
.nav-item:hover { background: #141E31; color: var(--text); }
.nav-item.on { background: linear-gradient(90deg, rgba(201,169,97,.16), rgba(201,169,97,.03)); color: var(--gold); }
.nav-item .nv-badge { float: right; color: var(--up); font-size: 11px; font-family: var(--f-mono); }
.side-foot { padding: 16px 18px; border-top: 1px solid var(--line); }
.sf-user { font-size: 13px; }
.sf-role { margin-top: 4px; color: var(--text-3); font-size: 11.5px; }
.sf-exit { margin-top: 12px; background: none; border: 1px solid var(--line-2); color: var(--text-3);
  border-radius: 6px; padding: 6px 12px; cursor: pointer; font-size: 12px; }
.sf-exit:hover { color: var(--up); border-color: var(--up); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 28px; border-bottom: 1px solid var(--line); background: var(--bg-2);
}
.tb-title { font-family: var(--f-serif); font-size: 20px; letter-spacing: 1px; }
.tb-sub { margin-top: 4px; color: var(--text-3); font-size: 12px; }
.tb-right { display: flex; align-items: center; gap: 14px; }
.tb-badge { padding: 5px 10px; border: 1px solid var(--gold-dim); border-radius: 6px; color: var(--gold); font-size: 11.5px; }
.tb-time { color: var(--text-3); font-size: 12px; font-family: var(--f-mono); }

.view { flex: 1; padding: 24px 28px 40px; overflow-x: hidden; }

/* ---------------- 通用组件 ---------------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 20px 22px; margin-bottom: 18px; }
.card-hd { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.card-t { font-family: var(--f-serif); font-size: 16px; letter-spacing: .5px; }
.card-d { color: var(--text-3); font-size: 12px; margin-top: 4px; }

.grid { display: grid; gap: 16px; }
.g4 { grid-template-columns: repeat(4, 1fr); }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g2 { grid-template-columns: repeat(2, 1fr); }

.kpi { background: linear-gradient(160deg, #131D30, #0F1728); border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; }
.kpi-t { color: var(--text-3); font-size: 12px; letter-spacing: .5px; }
.kpi-v { margin-top: 10px; font-family: var(--f-mono); font-size: 26px; letter-spacing: .5px; }
.kpi-s { margin-top: 8px; font-size: 12px; color: var(--text-3); }
.up { color: var(--up); }
.down { color: var(--down); }
.gold { color: var(--gold); }

table.tb { width: 100%; border-collapse: collapse; font-size: 13px; }
table.tb th {
  text-align: left; padding: 10px 12px; color: var(--text-3); font-weight: 500;
  border-bottom: 1px solid var(--line-2); font-size: 12px; letter-spacing: .5px; white-space: nowrap;
}
table.tb td { padding: 11px 12px; border-bottom: 1px solid var(--line); }
table.tb tr:hover td { background: #131D30; }
table.tb td.r, table.tb th.r { text-align: right; }
table.tb td.c, table.tb th.c { text-align: center; }

.tag { display: inline-block; padding: 3px 9px; border-radius: 5px; font-size: 11.5px; border: 1px solid; }
.tag.gold { color: var(--gold); border-color: var(--gold-dim); background: rgba(201,169,97,.08); }
.tag.warn { color: var(--warn); border-color: rgba(224,163,62,.4); background: rgba(224,163,62,.08); }
.tag.up { color: var(--up); border-color: rgba(229,72,77,.4); background: rgba(229,72,77,.08); }
.tag.down { color: var(--down); border-color: rgba(48,164,110,.4); background: rgba(48,164,110,.08); }
.tag.gray { color: var(--text-3); border-color: var(--line-2); }

.btn {
  padding: 8px 16px; border-radius: 7px; border: 1px solid var(--line-2);
  background: #101A2B; color: var(--text-2); cursor: pointer; font-size: 13px;
}
.btn:hover { border-color: var(--gold-dim); color: var(--gold); }
.btn.gold { background: linear-gradient(135deg, var(--gold-2), var(--gold)); color: #1A1405; border: 0; font-weight: 600; }
.btn.gold:hover { filter: brightness(1.06); color: #1A1405; }
.btn.danger:hover { border-color: var(--up); color: var(--up); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-sm { padding: 5px 11px; font-size: 12px; }

.form-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.form-grid .field { margin-bottom: 0; }
select.f-input { height: 46px; }
textarea.f-input { height: 84px; padding: 12px 14px; resize: vertical; }

.hint { padding: 12px 14px; border-radius: 8px; background: #0D1524; border: 1px solid var(--line-2);
  color: var(--text-2); font-size: 12.5px; line-height: 1.8; }
.hint.gold { border-color: var(--gold-dim); background: rgba(201,169,97,.06); color: var(--gold-2); }
.hint.up { border-color: rgba(229,72,77,.35); background: rgba(229,72,77,.06); color: #F0959A; }

.empty { padding: 56px; text-align: center; color: var(--text-3); }
.empty-logo { width: 168px; height: auto; display: block; margin: 0 auto 24px; }
/* 欢迎语：用品牌金 + 加大字号，不再是灰色小字的「建设中」提示感 */
.empty-t { font-size: 20px; font-weight: 600; color: var(--gold); letter-spacing: 1px; }
.bars { display: flex; flex-direction: column; gap: 12px; }
.bar-row { display: grid; grid-template-columns: 92px 1fr 116px; align-items: center; gap: 14px; font-size: 12.5px; }
.bar-track { height: 8px; background: #1E2739; border-radius: 4px; overflow: hidden; }
.bar-fill { height: 100%; background: linear-gradient(90deg, #8A6F3C, var(--gold)); }

.sign-area { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 12px; }
.sign-box { border: 1px solid var(--line-2); border-radius: 10px; padding: 16px; }
.sign-role { color: var(--gold); font-family: var(--f-serif); font-size: 14px; }
.sign-line { margin: 26px 0 8px; border-bottom: 1px solid var(--line-2); height: 30px; }
.sign-meta { color: var(--text-3); font-size: 11.5px; }

.toast {
  position: fixed; left: 50%; top: 26px; transform: translateX(-50%);
  background: #162034; border: 1px solid var(--gold-dim); color: var(--gold-2);
  padding: 11px 22px; border-radius: 8px; font-size: 13px; z-index: 99;
  box-shadow: 0 8px 30px rgba(0,0,0,.45);
}
.toast.err { border-color: var(--up); color: #F0959A; }

.mono { font-family: var(--f-mono); }
.muted { color: var(--text-3); }
.small { font-size: 12px; }
.mt { margin-top: 16px; }
.mb { margin-bottom: 16px; }
.row { display: flex; gap: 10px; align-items: center; }
.spread { display: flex; justify-content: space-between; align-items: center; }

@media (max-width: 1180px) {
  .g4 { grid-template-columns: repeat(2, 1fr); }
  .form-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  .login-brand { display: none; }
  .g3, .g2 { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .sign-area { grid-template-columns: 1fr; }
  .studio { grid-template-columns: 1fr; }
  .form-grid.f4 { grid-template-columns: 1fr; }
}

/* ============================================================
   新增模块：弹层 / 公告 / 人事 / 小程序装修 / 回收站
   ============================================================ */
/* hidden 属性兜底：任何带 hidden 的元素必须隐藏（否则下面的 .modal-root
   的 display:flex 优先级更高，会把 hidden 顶掉，导致空弹窗一直挡在登录页） */
[hidden] { display: none !important; }
.modal-root { position: fixed; inset: 0; z-index: 120; display: flex; align-items: flex-start; justify-content: center; }
.modal-mask { position: absolute; inset: 0; background: rgba(4, 8, 16, .72); backdrop-filter: blur(2px); }
.modal-card {
  position: relative; z-index: 1; width: 720px; max-width: calc(100vw - 48px);
  margin: 6vh auto 40px; max-height: 86vh; display: flex; flex-direction: column;
  background: var(--panel); border: 1px solid var(--line-2); border-radius: 14px;
  box-shadow: 0 24px 70px rgba(0,0,0,.6);
}
.modal-card.wide { width: 940px; }
.modal-card.sm { width: 480px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.mh-title { font-family: var(--f-serif); font-size: 17px; letter-spacing: .5px; }
.mh-x { background: none; border: 0; font-size: 22px; line-height: 1; color: var(--text-3); cursor: pointer; }
.mh-x:hover { color: var(--up); }
.modal-body { padding: 20px 22px; overflow-y: auto; flex: 1; }
.modal-foot { padding: 14px 22px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 10px; }
.modal-foot .left { margin-right: auto; }

/* 开关 */
.sw { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.sw input { display: none; }
.sw i {
  width: 40px; height: 22px; border-radius: 11px; background: #1E2739;
  border: 1px solid var(--line-2); position: relative; transition: background .18s;
}
.sw i::after {
  content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px;
  border-radius: 50%; background: var(--text-3); transition: transform .18s, background .18s;
}
.sw input:checked + i { background: rgba(201,169,97,.22); border-color: var(--gold-dim); }
.sw input:checked + i::after { transform: translateX(18px); background: var(--gold); }
.sw span { font-size: 12.5px; color: var(--text-2); }

/* 取色器 */
.cf-row { display: flex; align-items: center; gap: 12px; }
.cf-swatch { width: 46px; height: 34px; border-radius: 8px; border: 1px solid var(--line-2); padding: 0; background: none; cursor: pointer; }
input[type="color"].cf-swatch::-webkit-color-swatch-wrapper { padding: 2px; }
input[type="color"].cf-swatch::-webkit-color-swatch { border: 0; border-radius: 6px; }
.cf-hex { width: 120px; font-family: var(--f-mono); text-transform: uppercase; }

/* 分段切换 */
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: 8px; overflow: hidden; }
.seg button {
  padding: 8px 16px; background: #0F1828; border: 0; border-right: 1px solid var(--line);
  color: var(--text-3); cursor: pointer; font-size: 12.5px;
}
.seg button:last-child { border-right: 0; }
.seg button.on { background: rgba(201,169,97,.14); color: var(--gold); }
.seg button:hover { color: var(--text); }

/* 小程序装修：左配置右预览 */
.studio { display: grid; grid-template-columns: 1fr 300px; gap: 20px; align-items: start; }
.form-grid.f4 { grid-template-columns: repeat(4, 1fr); }
.phone {
  width: 280px; border: 1px solid var(--line-2); border-radius: 30px; padding: 10px;
  background: linear-gradient(160deg, #16213A, #0D1524); position: sticky; top: 12px;
}
.phone-bar { height: 26px; display: flex; align-items: center; justify-content: center; color: var(--text-3); font-size: 10.5px; }
.phone-screen { border-radius: 18px; overflow: hidden; min-height: 470px; padding: 14px 12px; }
.ph-hero { border-radius: 14px; padding: 16px 14px; margin-bottom: 10px; }
.ph-lab { font-size: 10.5px; opacity: .75; }
.ph-big { font-family: var(--f-mono); font-size: 24px; margin-top: 6px; }
.ph-sub { font-size: 10.5px; margin-top: 8px; display: flex; gap: 10px; }
.ph-card { border-radius: 12px; padding: 12px; margin-bottom: 9px; }
.ph-mod { font-size: 11.5px; }
.ph-kv { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 10px 0; text-align: center; }
.ph-q { border: 1px dashed rgba(255,255,255,.18); border-radius: 8px; padding: 6px 2px; font-size: 9.5px; }
.ph-nav { display: grid; grid-template-columns: repeat(5, 1fr); gap: 2px; padding: 8px 4px 4px; border-top: 1px solid rgba(255,255,255,.1); text-align: center; font-size: 9.5px; }
.ph-off { opacity: .28; }
.ph-row { font-size: 10.5px; padding: 7px 0; border-bottom: 1px solid rgba(255,255,255,.08); display: flex; justify-content: space-between; }

/* 排序列表 */
.sort-list { display: flex; flex-direction: column; gap: 8px; }
.sort-item {
  display: flex; align-items: center; gap: 12px; padding: 11px 14px;
  border: 1px solid var(--line); border-radius: 9px; background: #0F1828;
}
.sort-item .si-name { flex: 1; font-size: 13px; }
.sort-item .si-key { font-family: var(--f-mono); color: var(--text-3); font-size: 11px; }
.mini { padding: 3px 9px; font-size: 11px; border-radius: 6px; border: 1px solid var(--line-2); background: #101A2B; color: var(--text-3); cursor: pointer; }
.mini:hover { color: var(--gold); border-color: var(--gold-dim); }
.mini:disabled { opacity: .35; cursor: not-allowed; }
.mini:disabled:hover { color: var(--text-3); border-color: var(--line-2); }
.mini.danger:hover { color: var(--up); border-color: var(--up); }

/* 公告卡片 */
.ann-list { display: flex; flex-direction: column; gap: 10px; }
.ann-item { border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; background: #0F1828; }
.ann-item.on-top { border-color: var(--gold-dim); background: rgba(201,169,97,.05); }
.ann-t { font-size: 14px; display: flex; align-items: center; gap: 8px; }
.ann-sum { color: var(--text-3); font-size: 12.5px; margin-top: 6px; line-height: 1.7; }
.ann-meta { margin-top: 9px; color: var(--text-3); font-size: 11.5px; display: flex; gap: 16px; flex-wrap: wrap; }

/* 回收站 */
.rc-item { border: 1px solid var(--line); border-left: 3px solid var(--up); border-radius: 9px; padding: 13px 16px; background: #0F1828; margin-bottom: 10px; }
.rc-t { font-size: 13.5px; }
.rc-m { color: var(--text-3); font-size: 12px; margin-top: 6px; line-height: 1.7; }

/* 危险区与提示条 */
.danger-zone { border: 1px solid rgba(229,72,77,.32); border-radius: 10px; padding: 16px 18px; background: rgba(229,72,77,.05); }
.danger-zone .dz-t { color: #F0959A; font-size: 13px; margin-bottom: 8px; }
.lock-note { border: 1px dashed var(--line-2); border-radius: 9px; padding: 13px 15px; color: var(--text-3); font-size: 12.5px; line-height: 1.8; }
.lock-note b { color: var(--gold); }

/* 键值表 */
.kv-grid { display: grid; grid-template-columns: 140px 1fr; gap: 10px 16px; font-size: 13px; }
.kv-grid .k { color: var(--text-3); }
.kv-grid .v { color: var(--text); }

/* chips 多选 */
.chips-wrap { display: flex; flex-wrap: wrap; gap: 7px; }
.chips-wrap .chip.on { border-color: var(--gold-dim); color: var(--gold); background: rgba(201,169,97,.08); }

/* ---------------- 部门层级树 ---------------- */
.dept-tree { padding: 4px 0; }
.dept-node { position: relative; }
.dept-children { margin-left: 22px; padding-left: 12px; border-left: 1px dashed var(--line-2); }
.dept-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; margin: 5px 0;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 10px; transition: border-color .15s, background .15s;
}
.dept-row:hover { border-color: var(--gold-dim); background: #0F1828; }
.dept-row.off { opacity: .55; }
.dept-rail { width: 4px; align-self: stretch; border-radius: 3px; background: linear-gradient(180deg, var(--gold), var(--gold-dim)); opacity: .7; }
.dept-name { font-weight: 600; font-size: 15px; letter-spacing: .3px; }
.dept-leader { margin-left: 2px; }
.dept-meta { margin-left: auto; }
.dept-ops { display: flex; gap: 6px; margin-left: 14px; }
.dept-ops .mini { padding: 3px 11px; }

.hr { height: 1px; background: var(--line); margin: 18px 0; }
.sub-t { font-size: 13px; color: var(--gold); letter-spacing: .5px; margin: 4px 0 12px; font-family: var(--f-serif); }
.nowrap { white-space: nowrap; }
.w100 { width: 100%; }
.ta-r { text-align: right; }
.break { word-break: break-all; white-space: pre-wrap; }

/* ============================================================
   云服务接入（登录页云账号 Tab / 状态徽标 / 状态弹层）
   ============================================================ */
.lc-tabs { display: flex; gap: 6px; margin: 18px 0 20px; border-bottom: 1px solid var(--line); }
.lc-tab {
  flex: 1; padding: 9px 6px; background: none; border: none; border-bottom: 2px solid transparent;
  color: var(--text-3); font-size: 13.5px; font-family: inherit; cursor: pointer; letter-spacing: .5px;
}
.lc-tab:hover { color: var(--text-2); }
.lc-tab.on { color: var(--gold); border-bottom-color: var(--gold); }

.f-btn {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  background: rgba(201,169,97,.12); border: 1px solid var(--gold-dim); color: var(--gold);
  border-radius: 6px; padding: 5px 10px; font-size: 12px; cursor: pointer; font-family: inherit;
  white-space: nowrap;
}
.f-btn:hover { filter: brightness(1.12); }
.f-btn:disabled { opacity: .55; cursor: not-allowed; }
.f-err { display: block; margin-top: 6px; color: #F0959A; font-size: 12px; min-height: 0; }

.login-or { position: relative; text-align: center; margin: 18px 0 14px; }
.login-or::before { content: ''; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: var(--line); }
.login-or span { position: relative; padding: 0 12px; background: var(--panel); color: var(--text-3); font-size: 12px; }

.btn-wx {
  width: 100%; padding: 12px; border-radius: 9px; cursor: pointer; font-family: inherit; font-size: 15px;
  letter-spacing: 2px; background: rgba(48,164,108,.12); border: 1px solid rgba(48,164,108,.4); color: #4CC38A;
}
.btn-wx:hover { filter: brightness(1.12); }

button.tb-badge { cursor: pointer; font-family: inherit; background: rgba(201,169,97,.06); line-height: 1.4; }
button.tb-badge:hover { filter: brightness(1.15); }
button.tb-badge.off { border-color: var(--line-2); color: var(--text-3); background: none; }

.cs-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px dashed var(--line); }
.cs-row:last-child { border-bottom: none; }
.cs-k { color: var(--text-3); font-size: 12.5px; }
.cs-v { color: var(--text); font-size: 13px; text-align: right; word-break: break-all; }
.cs-v.gold { color: var(--gold); }
.cs-v.up { color: #F0959A; }
#cCode { padding-right: 106px; }

/* 诊断弹窗：步骤行与可复制域名 */
.cs-row .cs-v.gold { user-select: all; cursor: text; }
#mpDiagDomain { font-weight: 600; letter-spacing: .3px; }

/* 原生日期框（《操作日志》筛选条）：深色主题适配 —— 否则日历图标与弹出面板会是白底，与本界面冲突 */
input[type="date"].f-input { color-scheme: dark; }
input[type="date"].f-input::-webkit-calendar-picker-indicator { opacity: .7; cursor: pointer; }
input[type="date"].f-input::-webkit-calendar-picker-indicator:hover { opacity: 1; }

/* ============================================================
   主题切换：深色「暗夜黛金」（默认） / 浅色「石灰岩」
   由 <html data-theme="light"> 驱动；首屏防闪脚本在 index.html 的 <head> 里
   两套主题共用同一份 CSS 变量，浅色只做覆盖，不动深色任何一行
   ============================================================ */
[data-theme="light"] {
  --bg: #CBC6BC;        /* 页面底：暖中灰，与卡片拉开 1.34 对比度 */
  --bg-2: #D6D1C7;
  --panel: #E8E4DC;     /* 卡片：暖灰白，不再是一大片白 */
  --panel-2: #E8E4DC;
  --line: #BCB4A6;      /* 边框：与卡片 1.62 对比度，边界清楚 */
  --line-2: #ABA294;
  --gold: #7E6320;      /* 灰底上压深的字金，保证可读 */
  --gold-2: #C9A961;    /* 金色按钮的渐变起点，保持亮金质感 */
  --gold-dim: #C9A961;
  --text: #231F1A;
  --text-2: #4B453C;
  --text-3: #6A6459;
  --up: #C0392B;        /* 涨 · 红（沪深口径，不变） */
  --down: #16795C;      /* 跌 · 绿，压深保证浅底可读 */
  --warn: #8A5A06;
  --info: #204F8C;
}

/* 登录面板：给主题开关提供定位上下文 */
.login-panel { position: relative; }

/* 深浅共用：主题开关按钮 */
.th-btn {
  padding: 5px 11px; border: 1px solid var(--line-2); border-radius: 6px;
  background: none; color: var(--text-2); font-size: 11.5px; line-height: 1.5;
  cursor: pointer; font-family: inherit;
}
.th-btn:hover { border-color: var(--gold-dim); color: var(--gold); }
.th-float { position: absolute; top: 18px; right: 20px; }

/* 浅色主题下：原本「写在深色上才看得清」的浅字色，改深 */
[data-theme="light"] .hint.up { color: #A62B22; }
[data-theme="light"] .toast.err { color: #A62B22; }
[data-theme="light"] .danger-zone .dz-t { color: #A62B22; }
[data-theme="light"] .f-err { color: #A62B22; }
[data-theme="light"] .cs-v.up { color: #A62B22; }
[data-theme="light"] .btn-wx { color: #0F6E4E; }

/* 浅色主题下：硬编码的深色底，换成浅底 */
[data-theme="light"] .login-brand {
  background:
    radial-gradient(120% 90% at 12% 8%, rgba(201,169,97,.20), transparent 60%),
    linear-gradient(160deg, #DAD5CB 0%, #D0CAC0 55%, #C7C1B6 100%);
}
[data-theme="light"] .f-input { background: #EDEAE3; }
[data-theme="light"] .f-input::placeholder { color: #7E786D; }
[data-theme="light"] .rich-bar { background: #DDD8CF; }
[data-theme="light"] .rich-b { background: #EDEAE3; }
[data-theme="light"] .rich-ed { background: #EDEAE3; }
[data-theme="light"] .chip { background: #EDEAE3; }
[data-theme="light"] .login-note { color: #615B52; }
[data-theme="light"] .side { background: #E8E4DC; }
[data-theme="light"] .nav-item:hover { background: #DDD8CF; }
[data-theme="light"] .kpi { background: linear-gradient(160deg, #EDEAE3, #E4E0D7); }
[data-theme="light"] table.tb tr:hover td { background: #DFDAD1; }
[data-theme="light"] .btn { background: #EDEAE3; }
[data-theme="light"] .hint { background: #DDD8CF; }
[data-theme="light"] .bar-track { background: #BCB4A6; }
[data-theme="light"] .toast { background: #EDEAE3; box-shadow: 0 8px 26px rgba(50,44,36,.18); }
[data-theme="light"] .modal-mask { background: rgba(50,44,36,.48); }
[data-theme="light"] .modal-card { box-shadow: 0 24px 60px rgba(50,44,36,.28); }
[data-theme="light"] .sw i { background: #ABA294; }
[data-theme="light"] .seg button { background: #DDD8CF; }
[data-theme="light"] .phone { background: linear-gradient(160deg, #EDEAE3, #DFDAD1); }
[data-theme="light"] .sort-item { background: #E8E4DC; }
[data-theme="light"] .mini { background: #E8E4DC; }
[data-theme="light"] .ann-item { background: #E8E4DC; }
[data-theme="light"] .rc-item { background: #E8E4DC; }
[data-theme="light"] .dept-row:hover { background: #DFDAD1; }

/* 原生日期控件：深色主题强制深色日历，浅色主题还原浅色日历 */
[data-theme="light"] input[type="date"].f-input { color-scheme: light; }
