/* GRA 网页样式。配色照 xu 给的参考图：深色底、暖橙渐变重点卡、灰蓝/薄荷图表、黄/红小标签。 */
:root {
  --bg: #111113;
  --panel: #1b1b1e;
  --card: #232327;
  --card-2: #2b2b30;
  --line: #34343a;
  --text: #f3f2ef;
  --muted: #9b9aa2;
  --faint: #6c6b73;
  --peach-1: #f7dcb6;
  --peach-2: #eba57f;
  --peach-ink: #2a1c12;
  --slate: #5c6c75;
  --mint: #cfeae3;
  --teal: #6fb3a5;
  --blue: #7ea6d6;
  --mustard: #e9bf5f;
  --rose: #e47a72;
  --orange: #e8603c;
  --tag-yellow: #f2d27a;
  --tag-red: #e2725f;
  --radius: 18px;
  --radius-sm: 12px;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: radial-gradient(1200px 600px at 85% -10%, rgba(235,165,127,.10), transparent 60%), var(--bg); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }

/* ---------- 顶栏：图标导航，选中哪一项哪一项展开文字 ---------- */
.topbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 16px; padding: 14px 28px; background: rgba(17,17,19,.86); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: .3px; min-width: 170px; }
.brand-mark { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: linear-gradient(135deg, var(--peach-1), var(--peach-2)); color: var(--peach-ink); font-weight: 800; font-size: 14px; }
.brand small { display: block; color: var(--muted); font-weight: 500; font-size: 11px; letter-spacing: 0; }
.nav { margin: 0 auto; display: flex; gap: 4px; padding: 5px; background: var(--card); border: 1px solid var(--line); border-radius: 999px; }
.nav button { position: relative; display: flex; align-items: center; gap: 0; height: 38px; padding: 0 11px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); transition: background .28s, color .28s, gap .32s cubic-bezier(.2,.8,.2,1), padding .32s cubic-bezier(.2,.8,.2,1); }
.nav button svg { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.nav button .label { max-width: 0; overflow: hidden; white-space: nowrap; opacity: 0; transition: max-width .36s cubic-bezier(.2,.8,.2,1), opacity .2s; font-size: 14px; font-weight: 600; }
.nav button:hover { color: var(--text); }
.nav button[aria-current="page"] { background: var(--text); color: #151517; gap: 8px; padding: 0 16px 0 13px; }
.nav button[aria-current="page"] .label { max-width: 160px; opacity: 1; }
.nav .dot { position: absolute; top: 6px; right: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--tag-red); box-shadow: 0 0 0 2px var(--card); }
.top-actions { display: flex; align-items: center; gap: 10px; min-width: 170px; justify-content: flex-end; }
.lang { height: 36px; padding: 0 10px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); }
.who { display: flex; align-items: center; gap: 9px; padding: 3px 4px 3px 12px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); font-size: 13px; }
.avatar { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 12px; background: #f0a7a1; color: #3a1714; }
.avatar[data-role="spv"] { background: var(--mint); color: #17332d; }
.avatar[data-role="admin_omset"] { background: var(--tag-yellow); color: #3b2c07; }
.avatar[data-role="admin_klaim"] { background: var(--blue); color: #0f2038; }
.icon-btn { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); background: var(--card); display: grid; place-items: center; color: var(--muted); }
.icon-btn svg { width: 17px; height: 17px; stroke: currentColor; fill: none; stroke-width: 1.8; }

/* ---------- 页面 ---------- */
main.page { max-width: 1320px; margin: 0 auto; padding: 26px 28px 60px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.page-head h1 { margin: 0; font-size: 30px; letter-spacing: -.4px; }
.page-head p { margin: 6px 0 0; color: var(--muted); font-size: 14px; }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.field, .select { height: 38px; padding: 0 12px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); outline: none; }
.field:focus, .select:focus { border-color: var(--peach-2); }
.search { min-width: 300px; }

.grid { display: grid; gap: 14px; }
.grid.dash { grid-template-columns: 1.55fr 1fr 1fr; }
.grid.two { grid-template-columns: 2fr 1fr; align-items: start; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.card h3 { margin: 0 0 4px; font-size: 14px; font-weight: 600; color: var(--muted); display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.card .big { font-size: 34px; font-weight: 700; letter-spacing: -.6px; margin: 8px 0 4px; }
.card .big small { font-size: 14px; color: var(--muted); font-weight: 500; margin-left: 4px; }
.card .sub { font-size: 12px; color: var(--muted); }
.card.hero { background: linear-gradient(135deg, var(--peach-1) 0%, #f1c095 55%, var(--peach-2) 100%); color: var(--peach-ink); border: 0; grid-row: span 2; display: flex; flex-direction: column; position: relative; overflow: hidden; }
.card.hero::after { content: ""; position: absolute; right: -60px; bottom: -80px; width: 320px; height: 220px; background: rgba(255,255,255,.18); border-radius: 50% 50% 0 0; transform: rotate(-12deg); }
.card.hero h3, .card.hero .sub { color: rgba(42,28,18,.7); }
.card.hero .big { font-size: 52px; }
.progress { height: 5px; border-radius: 9px; background: rgba(42,28,18,.15); margin: 12px 0 8px; max-width: 260px; overflow: hidden; }
.progress i { display: block; height: 100%; width: var(--w, 0%); background: var(--peach-ink); border-radius: 9px; }
.hero-actions { margin-top: auto; padding-top: 16px; display: flex; gap: 8px; position: relative; z-index: 1; }
.pill { height: 34px; padding: 0 14px; border-radius: 999px; border: 1px solid transparent; font-size: 13px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.pill.dark { background: #19130f; color: #fff; }
.pill.light { background: rgba(255,255,255,.75); color: var(--peach-ink); }
.pill.ghost { background: var(--card-2); color: var(--text); border-color: var(--line); }
.pill.primary { background: var(--text); color: #151517; }
.pill.danger { background: rgba(226,114,95,.16); color: #ff9c8a; border-color: rgba(226,114,95,.35); }
.pill:disabled { opacity: .45; cursor: not-allowed; }

.tag { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 999px; font-size: 11.5px; font-weight: 700; white-space: nowrap; }
.tag.up { background: var(--tag-yellow); color: #3b2c07; }
.tag.down { background: var(--tag-red); color: #fff; }
.tag.mint { background: var(--mint); color: #17332d; }
.tag.grey { background: var(--card-2); color: var(--muted); border: 1px solid var(--line); }
.tag.red { background: rgba(226,114,95,.18); color: #ff9c8a; }

/* 柱状图（每天销量） */
.bars { display: flex; align-items: flex-end; gap: 6px; height: 190px; padding-top: 14px; }
.bars .bar { flex: 1; display: flex; flex-direction: column-reverse; gap: 2px; height: 100%; position: relative; }
.bars .seg { border-radius: 7px; min-height: 3px; height: var(--h, 0%); background: var(--slate); transition: height .5s cubic-bezier(.2,.8,.2,1); }
.bars .seg.ps { background: var(--teal); }
.bars .bar.latest .seg { background: var(--mint); }
.bars .bar.changed::before { content: ""; position: absolute; top: -10px; left: 50%; width: 6px; height: 6px; margin-left: -3px; border-radius: 50%; background: var(--tag-red); }
.bars .bar:hover .seg { filter: brightness(1.25); }
.bar-labels { display: flex; gap: 6px; margin-top: 6px; font-size: 10.5px; color: var(--faint); }
.bar-labels span { flex: 1; text-align: center; }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 5px; background: var(--slate); }
.legend i.ps { background: var(--teal); }
.legend i.red { background: var(--tag-red); border-radius: 50%; }

/* 环形图（两区占比） */
.donut { width: 132px; height: 132px; border-radius: 50%; background: conic-gradient(var(--mustard) 0 var(--a, 50%), var(--teal) var(--a, 50%) 100%); display: grid; place-items: center; flex: none; }
.donut > div { width: 98px; height: 98px; border-radius: 50%; background: var(--card); display: grid; place-items: center; text-align: center; font-size: 11px; color: var(--muted); }
.donut strong { display: block; color: var(--text); font-size: 17px; }
.split { display: flex; align-items: center; gap: 18px; margin-top: 10px; }
.split ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; font-size: 13px; }
.split li { border-left: 3px solid var(--mustard); padding-left: 8px; }
.split li.ps { border-color: var(--teal); }

/* 右侧列表（排行） */
.rank { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 8px; }
.rank li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--card-2); }
.rank .ic { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: #19191c; font-size: 12px; font-weight: 700; color: var(--muted); }
.rank .name { flex: 1; font-size: 13.5px; font-weight: 600; }
.rank .name small { display: block; font-weight: 500; color: var(--faint); font-size: 11px; }
.rank .val { text-align: right; font-weight: 700; }
.rank .val small { display: block; font-size: 10.5px; color: var(--muted); font-weight: 500; }

/* 表格 */
.table-wrap { overflow: auto; border-radius: var(--radius); border: 1px solid var(--line); background: var(--card); }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { position: sticky; top: 0; background: #202024; color: var(--muted); font-weight: 600; font-size: 12px; z-index: 1; }
td.r, th.r { text-align: right; }
tbody tr:hover { background: rgba(255,255,255,.025); }
tbody tr.clickable { cursor: pointer; }
tr.best td:first-child { box-shadow: inset 3px 0 0 var(--mint); }
tr.worst td:first-child { box-shadow: inset 3px 0 0 var(--tag-red); }
tr.detail > td { background: #1c1c20; padding: 0; }
tr.detail table { font-size: 12.5px; }
tr.detail th { background: #1c1c20; }
td.wrap { white-space: normal; min-width: 220px; }
.empty { padding: 40px; text-align: center; color: var(--muted); }

/* 数字卡（点哪张展开哪一类） */
.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin: 14px 0; }
.stat-card { text-align: left; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px 16px; }
.stat-card strong { display: block; font-size: 26px; margin-top: 4px; }
.stat-card span { color: var(--muted); font-size: 12.5px; }
.stat-card[aria-pressed="true"] { border-color: var(--peach-2); box-shadow: 0 0 0 1px var(--peach-2) inset; }
.stat-card.alert strong { color: #ff9c8a; }

/* 分段步骤卡（上传） */
.steps { display: grid; gap: 12px; }
.step { display: grid; grid-template-columns: 36px 1fr; gap: 14px; align-items: start; }
.step .no { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--card-2); border: 1px solid var(--line); font-weight: 700; color: var(--muted); }
.step.done .no { background: var(--mint); color: #17332d; border-color: transparent; }
.step.active .no { background: var(--text); color: #151517; }
.drop { display: block; cursor: pointer; margin-top: 10px; border: 1.5px dashed var(--line); border-radius: var(--radius); padding: 26px; text-align: center; color: var(--muted); }
.drop.over { border-color: var(--peach-2); color: var(--text); }
.check-row { display: flex; align-items: center; gap: 10px; }
.check-row input { width: 18px; height: 18px; accent-color: var(--peach-2); }
.arrow { color: var(--peach-2); font-weight: 700; margin: 0 4px; }

/* 红标 */
.alerts { display: grid; gap: 10px; }
.alert-item { display: grid; grid-template-columns: 14px 1fr auto; gap: 14px; align-items: center; padding: 14px 16px; border-radius: var(--radius-sm); background: var(--card); border: 1px solid rgba(226,114,95,.45); }
.alert-item .led { width: 10px; height: 10px; border-radius: 50%; background: var(--tag-red); box-shadow: 0 0 0 4px rgba(226,114,95,.18); }
.alert-item.seen { border-color: var(--line); opacity: .65; }
.alert-item.seen .led { background: var(--faint); box-shadow: none; }
.alert-item .title { font-weight: 700; }
.alert-item .meta { font-size: 12px; color: var(--muted); margin-top: 3px; }
.alert-item .what { margin-top: 6px; font-size: 13.5px; }

/* 弹窗、提示 */
dialog { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); color: var(--text); padding: 0; width: min(760px, 94vw); max-height: 86vh; }
dialog::backdrop { background: rgba(0,0,0,.55); backdrop-filter: blur(2px); }
.dialog-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.dialog-head h2 { margin: 0; font-size: 17px; }
.dialog-body { padding: 18px 20px; overflow: auto; max-height: calc(86vh - 130px); }
.dialog-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line); }
.form { display: grid; gap: 12px; }
.form label { display: grid; gap: 6px; font-size: 13px; color: var(--muted); }
.form .field, .form .select { border-radius: 10px; color: var(--text); }
textarea.field { height: 80px; padding: 10px 12px; resize: vertical; }
.toast { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%) translateY(20px); opacity: 0; transition: all .3s; padding: 12px 18px; border-radius: 14px; background: var(--text); color: #151517; font-weight: 600; font-size: 14px; max-width: min(640px, 92vw); z-index: 50; box-shadow: 0 12px 40px rgba(0,0,0,.4); }
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }
.toast.error { background: #3a1c18; color: #ffb4a6; border: 1px solid rgba(226,114,95,.5); }
.note { font-size: 12.5px; color: var(--muted); background: var(--card-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; }
details.note summary { cursor: pointer; color: var(--text); }

/* ---------- 登录页（照和中 ERP：左边说明，右边登录卡） ---------- */
.login-shell { min-height: 100vh; display: grid; grid-template-columns: 1.2fr minmax(380px, 460px); gap: 40px; align-items: center; padding: 40px clamp(20px, 6vw, 90px); background: radial-gradient(900px 520px at 70% 85%, rgba(235,165,127,.28), transparent 60%), radial-gradient(700px 420px at 10% 10%, rgba(111,179,165,.10), transparent 60%), var(--bg); }
.login-hero h1 { font-size: clamp(40px, 6vw, 76px); line-height: 1.02; margin: 18px 0 14px; letter-spacing: -1.5px; }
.login-hero h1 em { font-style: normal; color: var(--orange); }
.login-hero p { color: var(--muted); max-width: 520px; font-size: 16px; }
.login-hero .eyebrow { letter-spacing: 4px; font-size: 12px; color: var(--muted); font-family: ui-monospace, Menlo, monospace; }
.login-regions { display: flex; gap: 10px; margin-top: 26px; flex-wrap: wrap; }
.login-card { background: rgba(35,35,39,.78); backdrop-filter: blur(18px); border: 1px solid var(--line); border-radius: 24px; padding: 28px; display: grid; gap: 14px; box-shadow: 0 30px 80px rgba(0,0,0,.35); }
.login-card h2 { margin: 0; font-size: 22px; }
.login-card .field { width: 100%; border-radius: 12px; height: 44px; }
.login-card label { display: grid; gap: 6px; font-size: 13px; color: var(--muted); }
.login-card .code { letter-spacing: 8px; font-size: 20px; text-align: center; }
.login-card .submit { height: 46px; border-radius: 12px; border: 0; background: linear-gradient(135deg, var(--peach-1), var(--peach-2)); color: var(--peach-ink); font-weight: 700; font-size: 15px; }
.field-error { color: #ff9c8a; font-size: 12.5px; margin: -6px 0 0; }
.secret { font-family: ui-monospace, Menlo, monospace; letter-spacing: 2px; background: var(--card-2); border: 1px dashed var(--line); border-radius: 10px; padding: 10px; text-align: center; word-break: break-all; color: var(--text); }
.demo-panel { margin-top: 8px; border-top: 1px solid var(--line); padding-top: 14px; }
.demo-panel h3 { margin: 0 0 8px; font-size: 13px; color: var(--muted); font-weight: 600; }
.demo-accounts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.demo-accounts button { display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: 12px; border: 1px solid var(--line); background: var(--card-2); text-align: left; font-size: 13px; }
.demo-accounts small { display: block; color: var(--muted); font-size: 11px; }

@media (max-width: 1080px) {
  .grid.dash, .grid.two { grid-template-columns: 1fr; }
  .card.hero { grid-row: auto; }
  .brand, .top-actions { min-width: 0; }
  .brand small, .who > span:first-child { display: none; }
  .who { padding: 3px; }
  .login-shell { grid-template-columns: 1fr; }
  .login-hero { display: none; }
}
@media (max-width: 640px) {
  .topbar { padding: 10px 12px; flex-wrap: wrap; }
  .nav { order: 3; width: 100%; justify-content: space-between; }
  main.page { padding: 18px 14px 50px; }
  .page-head { flex-direction: column; align-items: stretch; }
  .page-head h1 { font-size: 26px; }
  .search { min-width: 0; width: 100%; }
}
.mt { margin-top: 14px; }
a.card { text-decoration: none; display: block; }
a.card:hover, .stat-card:hover { border-color: #4a4a52; }
.money-pair { display: flex; gap: 18px; margin-top: 10px; font-size: 12px; color: rgba(42,28,18,.7); position: relative; z-index: 1; }
.money-pair b { display: block; font-size: 17px; color: var(--peach-ink); margin-top: 2px; }
