/* ============ dashboard board ============ */
.board-head{display:flex;justify-content:space-between;align-items:flex-end;margin-bottom:16px;gap:12px;flex-wrap:wrap}
.board-kicker{font-size:10.5px;letter-spacing:.14em;color:var(--primary);font-weight:700}
.board-head h2{font-size:22px;margin-top:3px;letter-spacing:-.02em}
.board-meta{font-size:12px;color:var(--muted);display:flex;align-items:center;gap:7px}
.dot-live{width:7px;height:7px;border-radius:50%;background:var(--green);box-shadow:0 0 0 3px rgba(18,183,106,.15)}
.kpi-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px;margin-bottom:14px}
.kpi{background:var(--panel);border:1px solid var(--line);border-radius:16px;padding:16px 18px;box-shadow:var(--shadow);position:relative;overflow:hidden}
.kpi-top{display:flex;justify-content:space-between;align-items:center;font-size:12.5px;color:var(--muted)}
.kpi-ico{width:28px;height:28px;border-radius:9px;display:flex;align-items:center;justify-content:center;font-style:normal;font-size:13px}
.k-blue{background:#eef1ff;color:#3b5bfd}.k-green{background:#e8f8f0;color:#12b76a}
.k-purple{background:#f3edff;color:#7c3aed}.k-orange{background:#fef4e6;color:#f79009}
.kpi-val{font-size:30px;font-weight:700;letter-spacing:-.03em;margin:6px 0 4px;line-height:1.15}
.kpi-val small{font-size:13px;font-weight:500;color:var(--muted);margin-left:3px}
.kpi-foot{display:flex;justify-content:space-between;align-items:flex-end;font-size:11.5px;color:var(--faint);min-height:34px;gap:8px}
.delta{font-weight:600}.delta.up{color:var(--green)}.delta.down{color:var(--red)}.delta.link{color:var(--primary)}
.spark svg{display:block}
.tchart{display:flex;align-items:flex-end;gap:6px;height:190px}
.tbar{flex:1;display:flex;flex-direction:column;justify-content:flex-end;align-items:center;height:100%;gap:6px;min-width:0}
.tbar-in{flex:1;display:flex;align-items:flex-end;width:100%;justify-content:center}
.tbar-in span{display:block;width:72%;max-width:26px;background:linear-gradient(180deg,#8fa4ff,#3b5bfd);border-radius:6px 6px 3px 3px;transition:height .3s}
.tbar em{font-style:normal;font-size:10px;color:var(--faint);white-space:nowrap}
.board-grid{display:grid;grid-template-columns:1.55fr 1fr;gap:14px}
.board-grid-3{grid-template-columns:1.1fr .95fr .95fr;margin-top:14px}
.board-card{height:100%}
.quality{display:flex;align-items:center;gap:18px}
.donut{width:128px;height:128px;border-radius:50%;position:relative;flex:0 0 128px}
.donut-hole{position:absolute;inset:15px;background:#fff;border-radius:50%;display:flex;flex-direction:column;align-items:center;justify-content:center;box-shadow:inset 0 0 0 1px var(--line-2)}
.donut-hole strong{font-size:20px;letter-spacing:-.02em}.donut-hole span{font-size:10.5px;color:var(--muted)}
.quality-legend{display:flex;flex-direction:column;gap:7px;font-size:12.5px;color:var(--text-2)}
.quality-legend i{width:8px;height:8px;border-radius:3px;display:inline-block;margin-right:6px}
.quality-legend b{margin-left:4px;color:var(--text)}
.rank-row{display:flex;align-items:center;gap:10px;padding:7px 0}
.rank-no{width:20px;height:20px;border-radius:6px;background:#f2f4f9;color:var(--muted);font-size:11px;display:flex;align-items:center;justify-content:center;flex:0 0 20px}
.rank-no.hot{background:var(--red-weak);color:var(--red)}
.rank-main{flex:1;min-width:0}
.rank-txt{font-size:12.8px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.rank-bar{height:4px;background:#f2f4f9;border-radius:3px;margin-top:4px;overflow:hidden}
.rank-bar i{display:block;height:100%;background:#c7d2fe;border-radius:3px}
.rank-c{font-size:12px;color:var(--muted);font-variant-numeric:tabular-nums}
.cap-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.cap-item{display:flex;align-items:center;gap:7px;font-size:12.5px;color:var(--text-2);padding:6px 8px;border-radius:8px;background:#fafbff}
.cap-dot{width:7px;height:7px;border-radius:50%;background:#d0d5dd}
.cap-dot.on{background:var(--green);box-shadow:0 0 0 3px rgba(18,183,106,.15)}
.cap-dot.off{background:var(--red)}
.cap-actions{display:flex;align-items:center;justify-content:space-between;gap:8px}
.cap-cards{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:12px}
.cap-card{border:1px solid var(--line);border-radius:12px;padding:12px 14px;background:var(--panel-2)}
.cap-card-top{display:flex;align-items:center;gap:8px;margin-bottom:5px}
.cap-card-top strong{font-size:13px;flex:1}
.hr-go{flex:0 0 auto;white-space:nowrap}
@media (max-width:1100px){
  .kpi-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .board-grid,.board-grid-3{grid-template-columns:1fr}
}

/* ============ design tokens ============ */
:root{
  --bg:#f5f6fa; --panel:#fff; --panel-2:#fbfcfe;
  --line:#e9ebf2; --line-2:#f0f2f7;
  --text:#1f2430; --text-2:#4b5464; --muted:#7b8398; --faint:#a9b0c0;
  --primary:#3b5bfd; --primary-2:#2c48e0; --primary-weak:#eef1ff;
  --green:#12b76a; --green-weak:#e8f8f0;
  --amber:#f79009; --amber-weak:#fef4e6;
  --red:#f04438; --red-weak:#feeceb;
  --radius:14px; --radius-sm:10px;
  --shadow:0 1px 2px rgba(16,24,40,.04),0 8px 24px -12px rgba(16,24,40,.10);
  --sans:-apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Hiragino Sans GB","Microsoft YaHei",sans-serif;
  --mono:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
}
*{box-sizing:border-box}
[hidden]{display:none !important}
html,body{margin:0;padding:0;height:100%}
body{background:var(--bg);color:var(--text);font-family:var(--sans);font-size:14px;line-height:1.6;-webkit-font-smoothing:antialiased}
a{color:var(--primary);text-decoration:none}
button{font-family:inherit}
h1,h2,h3,h4{margin:0;font-weight:600;letter-spacing:-.01em}
code{font-family:var(--mono);background:#f1f3f9;padding:1px 5px;border-radius:5px;font-size:12px}

/* ============ layout ============ */
.app{display:flex;min-height:100vh}
.sidebar{width:232px;flex:0 0 232px;background:var(--panel);border-right:1px solid var(--line);display:flex;flex-direction:column;position:sticky;top:0;height:100vh}
.brand{display:flex;align-items:center;gap:10px;padding:18px 16px 14px}
.brand-logo{width:36px;height:36px;border-radius:11px;background:linear-gradient(135deg,#3b5bfd,#7b95ff);color:#fff;display:flex;align-items:center;justify-content:center;font-weight:700;font-size:17px;box-shadow:0 6px 14px -6px rgba(59,91,253,.7)}
.brand-text{display:flex;flex-direction:column;line-height:1.25}
.brand-text strong{font-size:14px}
.brand-text span{font-size:11px;color:var(--muted)}
.nav{display:flex;flex-direction:column;gap:2px;padding:8px 10px;overflow-y:auto}
.nav a{display:flex;align-items:center;gap:9px;padding:9px 10px;border-radius:9px;color:var(--text-2);font-size:13.5px;font-weight:500;position:relative}
.nav a:hover{background:#f4f6fb;color:var(--text)}
.nav a.active{background:var(--primary-weak);color:var(--primary-2);font-weight:600}
.nav a.active::before{content:"";position:absolute;left:-10px;top:9px;bottom:9px;width:3px;border-radius:0 3px 3px 0;background:var(--primary)}
.nav-badge{margin-left:auto;background:var(--red);color:#fff;font-size:10.5px;padding:0 6px;border-radius:9px;min-width:18px;text-align:center;line-height:17px;display:none}
.nav-badge.show{display:inline-block}
.sidebar-foot{margin-top:auto;padding:12px 16px;border-top:1px solid var(--line-2);font-size:11.5px;color:var(--muted)}
.bot-state{display:flex;align-items:center;gap:6px;margin-bottom:6px}
.bot-state .dot{width:7px;height:7px;border-radius:50%;background:var(--faint)}
.bot-state.ok .dot{background:var(--green);box-shadow:0 0 0 3px rgba(18,183,106,.15)}
.bot-state.bad .dot{background:var(--red)}
.ver{color:var(--faint)}

.main{flex:1;min-width:0;display:flex;flex-direction:column}
.topbar{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:18px 28px 14px;background:linear-gradient(180deg,#fff,#fff 70%,rgba(255,255,255,0));border-bottom:1px solid var(--line-2);position:sticky;top:0;z-index:20}
.topbar-title h1{font-size:19px}
.topbar-title p{margin:2px 0 0;font-size:12.5px;color:var(--muted)}
.topbar-right{display:flex;align-items:center;gap:10px}
.user-chip{display:flex;align-items:center;gap:8px;padding:4px 10px 4px 4px;border:1px solid var(--line);border-radius:999px;background:#fff}
.avatar{width:28px;height:28px;border-radius:50%;background:var(--primary-weak);color:var(--primary-2);display:flex;align-items:center;justify-content:center;font-weight:700;font-size:12px}
.user-meta{display:flex;flex-direction:column;line-height:1.2}
.user-meta strong{font-size:12.5px}
.user-meta span{font-size:10.5px;color:var(--muted)}
.view{padding:22px 28px 40px;max-width:1360px;width:100%}

/* ============ icons ============ */
.ico{width:16px;height:16px;display:inline-block;background:currentColor;opacity:.85;
  -webkit-mask-size:contain;mask-size:contain;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-position:center;mask-position:center}
.ico-dash{-webkit-mask-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M3 13h8V3H3v10zm0 8h8v-6H3v6zm10 0h8V11h-8v10zm0-18v6h8V3h-8z'/></svg>");mask-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M3 13h8V3H3v10zm0 8h8v-6H3v6zm10 0h8V11h-8v10zm0-18v6h8V3h-8z'/></svg>")}
.ico-book{-webkit-mask-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M4 4h7v16H4a2 2 0 01-2-2V6a2 2 0 012-2zm9 0h7a2 2 0 012 2v12a2 2 0 01-2 2h-7V4z'/></svg>");mask-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M4 4h7v16H4a2 2 0 01-2-2V6a2 2 0 012-2zm9 0h7a2 2 0 012 2v12a2 2 0 01-2 2h-7V4z'/></svg>")}
.ico-inbox{-webkit-mask-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M19 3H5a2 2 0 00-2 2v14a2 2 0 002 2h14a2 2 0 002-2V5a2 2 0 00-2-2zm0 12h-4a2 2 0 01-4 0H7V5h12v10z'/></svg>");mask-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M19 3H5a2 2 0 00-2 2v14a2 2 0 002 2h14a2 2 0 002-2V5a2 2 0 00-2-2zm0 12h-4a2 2 0 01-4 0H7V5h12v10z'/></svg>")}
.ico-shield{-webkit-mask-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M12 2l8 3v6c0 5-3.4 9.4-8 11-4.6-1.6-8-6-8-11V5l8-3z'/></svg>");mask-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M12 2l8 3v6c0 5-3.4 9.4-8 11-4.6-1.6-8-6-8-11V5l8-3z'/></svg>")}
.ico-users{-webkit-mask-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M16 11a4 4 0 10-4-4 4 4 0 004 4zm-8 0a3 3 0 10-3-3 3 3 0 003 3zm0 2c-2.7 0-8 1.3-8 4v3h9v-3c0-1 .4-1.9 1-2.6A13 13 0 008 13zm8 0c-2.7 0-8 1.3-8 4v3h16v-3c0-2.7-5.3-4-8-4z'/></svg>");mask-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M16 11a4 4 0 10-4-4 4 4 0 004 4zm-8 0a3 3 0 10-3-3 3 3 0 003 3zm0 2c-2.7 0-8 1.3-8 4v3h9v-3c0-1 .4-1.9 1-2.6A13 13 0 008 13zm8 0c-2.7 0-8 1.3-8 4v3h16v-3c0-2.7-5.3-4-8-4z'/></svg>")}
.ico-log{-webkit-mask-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M4 4h16v2H4V4zm0 5h16v2H4V9zm0 5h10v2H4v-2zm0 5h16v2H4v-2z'/></svg>");mask-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M4 4h16v2H4V4zm0 5h16v2H4V9zm0 5h10v2H4v-2zm0 5h16v2H4v-2z'/></svg>")}
.ico-flask{-webkit-mask-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M9 2h6v2h-1v4.2l5.3 8.9A2 2 0 0117.6 21H6.4a2 2 0 01-1.7-3L10 9.2V4H9V2z'/></svg>");mask-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M9 2h6v2h-1v4.2l5.3 8.9A2 2 0 0117.6 21H6.4a2 2 0 01-1.7-3L10 9.2V4H9V2z'/></svg>")}
.ico-gear{-webkit-mask-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M19.4 13a7.6 7.6 0 000-2l2-1.6-2-3.4-2.4 1a7.5 7.5 0 00-1.7-1L15 3H9l-.3 2.6c-.6.3-1.2.6-1.7 1l-2.4-1-2 3.4L4.6 11a7.6 7.6 0 000 2l-2 1.6 2 3.4 2.4-1c.5.4 1.1.8 1.7 1L9 21h6l.3-2.6c.6-.3 1.2-.6 1.7-1l2.4 1 2-3.4-2-1zM12 15.5A3.5 3.5 0 1115.5 12 3.5 3.5 0 0112 15.5z'/></svg>");mask-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M19.4 13a7.6 7.6 0 000-2l2-1.6-2-3.4-2.4 1a7.5 7.5 0 00-1.7-1L15 3H9l-.3 2.6c-.6.3-1.2.6-1.7 1l-2.4-1-2 3.4L4.6 11a7.6 7.6 0 000 2l-2 1.6 2 3.4 2.4-1c.5.4 1.1.8 1.7 1L9 21h6l.3-2.6c.6-.3 1.2-.6 1.7-1l2.4 1 2-3.4-2-1zM12 15.5A3.5 3.5 0 1115.5 12 3.5 3.5 0 0112 15.5z'/></svg>")}
.ico-bolt{-webkit-mask-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M13 2L4 14h6l-1 8 9-12h-6l1-8z'/></svg>");mask-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M13 2L4 14h6l-1 8 9-12h-6l1-8z'/></svg>")}

/* ============ cards / stats ============ */
.grid{display:grid;gap:14px}
.stats{grid-template-columns:repeat(4,minmax(0,1fr))}
.stat{background:var(--panel);border:1px solid var(--line);border-radius:var(--radius);padding:16px 18px;box-shadow:var(--shadow);position:relative;overflow:hidden}
.stat .label{font-size:12px;color:var(--muted);display:flex;align-items:center;gap:6px}
.stat .value{font-size:26px;font-weight:700;letter-spacing:-.02em;margin-top:6px;line-height:1.2}
.stat .sub{font-size:11.5px;color:var(--faint);margin-top:2px}
.stat.accent::after{content:"";position:absolute;right:-20px;top:-20px;width:80px;height:80px;border-radius:50%;background:var(--primary-weak)}
.card{background:var(--panel);border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow)}
.card-head{display:flex;align-items:center;justify-content:space-between;padding:15px 18px;border-bottom:1px solid var(--line-2);gap:12px}
.card-head h3{font-size:14px}
.card-head .hint{font-size:12px;color:var(--muted)}
.card-body{padding:16px 18px}
.card-body.tight{padding:8px 0}
.two-col{display:grid;grid-template-columns:1.35fr .9fr;gap:14px;align-items:start}
.section-title{font-size:13px;font-weight:600;color:var(--text-2);margin:2px 0 10px}

/* chart */
.chart{display:flex;align-items:flex-end;gap:8px;height:150px;padding:6px 2px 0}
.chart .bar-wrap{flex:1;display:flex;flex-direction:column;align-items:center;gap:6px;height:100%;justify-content:flex-end}
.chart .bar{width:100%;max-width:34px;background:linear-gradient(180deg,#7b95ff,#3b5bfd);border-radius:6px 6px 3px 3px;min-height:3px;transition:height .3s}
.chart .bar.zero{background:#e8ebf4}
.chart .cap{font-size:10px;color:var(--faint);white-space:nowrap}
.chart .num{font-size:10.5px;color:var(--muted)}

/* list */
.list{display:flex;flex-direction:column}
.list-item{display:flex;gap:10px;align-items:center;padding:10px 18px;border-bottom:1px solid var(--line-2);font-size:13px}
.list-item:last-child{border-bottom:0}
.list-item .idx{width:20px;height:20px;border-radius:6px;background:#f3f5fa;color:var(--muted);font-size:11px;display:flex;align-items:center;justify-content:center;flex:0 0 20px}
.list-item .txt{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.list-item .meta{font-size:11.5px;color:var(--faint);white-space:nowrap}

/* ============ buttons / inputs ============ */
.btn{display:inline-flex;align-items:center;justify-content:center;gap:6px;border:1px solid var(--line);background:#fff;color:var(--text-2);padding:8px 13px;border-radius:9px;font-size:13px;font-weight:500;cursor:pointer;transition:.15s}
.btn:hover{background:#f7f8fc;border-color:#dfe3ee}
.btn:disabled{opacity:.55;cursor:not-allowed}
.btn-primary{background:var(--primary);border-color:var(--primary);color:#fff;box-shadow:0 4px 12px -6px rgba(59,91,253,.8)}
.btn-primary:hover{background:var(--primary-2);border-color:var(--primary-2)}
.btn-ghost{background:transparent;border-color:transparent;color:var(--text-2)}
.btn-ghost:hover{background:#f1f3f9}
.btn-danger{color:var(--red);border-color:#f7c9c4}
.btn-danger:hover{background:var(--red-weak)}
.btn-sm{padding:5px 10px;font-size:12px;border-radius:8px}
.btn-block{width:100%;padding:11px;font-size:14px}
.btn-row{display:flex;gap:8px;flex-wrap:wrap}

.field{display:flex;flex-direction:column;gap:5px;margin-bottom:13px}
.field > span{font-size:12.5px;color:var(--text-2);font-weight:500}
.field .desc{font-size:11.5px;color:var(--muted)}
input[type=text],input[type=password],input[type=number],select,textarea{
  width:100%;border:1px solid var(--line);border-radius:9px;padding:9px 11px;font-size:13.5px;color:var(--text);
  background:#fff;font-family:inherit;outline:none;transition:.15s}
input:focus,select:focus,textarea:focus{border-color:#b9c4ff;box-shadow:0 0 0 3px rgba(59,91,253,.10)}
textarea{resize:vertical;min-height:90px;line-height:1.65}
.row{display:flex;gap:12px}
.row > *{flex:1}
.switch{display:flex;align-items:center;gap:8px;font-size:13px;color:var(--text-2)}
.switch input{width:auto}

.toolbar{display:flex;gap:10px;align-items:center;flex-wrap:wrap;margin-bottom:14px}
.toolbar .search{position:relative;flex:1;min-width:200px;max-width:360px}
.toolbar .search input{padding-left:32px}
.toolbar .search::before{content:"";position:absolute;left:11px;top:50%;transform:translateY(-50%);width:14px;height:14px;background:var(--faint);-webkit-mask-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M10 2a8 8 0 105.3 14L21 21.7 22.7 20l-5.6-5.6A8 8 0 0010 2zm0 2a6 6 0 110 12 6 6 0 010-12z'/></svg>");mask-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M10 2a8 8 0 105.3 14L21 21.7 22.7 20l-5.6-5.6A8 8 0 0010 2zm0 2a6 6 0 110 12 6 6 0 010-12z'/></svg>");-webkit-mask-size:contain;mask-size:contain}
.toolbar select{width:auto;min-width:120px}
.spacer{flex:1}

/* ============ table ============ */
.table-wrap{background:var(--panel);border:1px solid var(--line);border-radius:var(--radius);overflow:hidden;box-shadow:var(--shadow)}
table{width:100%;border-collapse:collapse;font-size:13px}
th{text-align:left;font-weight:500;font-size:11.5px;letter-spacing:.02em;color:var(--muted);background:var(--panel-2);padding:10px 14px;border-bottom:1px solid var(--line);white-space:nowrap}
td{padding:11px 14px;border-bottom:1px solid var(--line-2);vertical-align:middle}
tr:last-child td{border-bottom:0}
tbody tr:hover{background:#fafbff}
td .q{font-weight:500;color:var(--text);cursor:pointer}
td .q:hover{color:var(--primary)}
td.ans{color:var(--text-2);max-width:420px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.pager{display:flex;align-items:center;justify-content:space-between;padding:10px 14px;border-top:1px solid var(--line-2);font-size:12.5px;color:var(--muted);background:#fff}
.empty{padding:44px 20px;text-align:center;color:var(--muted);font-size:13px}
.empty .big{font-size:26px;margin-bottom:6px;opacity:.4}

/* pills */
.pill{display:inline-flex;align-items:center;gap:4px;padding:2px 8px;border-radius:999px;font-size:11px;font-weight:500;white-space:nowrap}
.pill-green{background:var(--green-weak);color:#087443}
.pill-amber{background:var(--amber-weak);color:#b45309}
.pill-red{background:var(--red-weak);color:#b42318}
.pill-blue{background:var(--primary-weak);color:var(--primary-2)}
.pill-gray{background:#f2f4f9;color:var(--muted)}

/* drawer */
.drawer-mask{position:fixed;inset:0;background:rgba(16,24,40,.35);z-index:60;backdrop-filter:blur(1px)}
.drawer{position:fixed;top:0;right:0;bottom:0;width:min(620px,94vw);background:var(--panel);z-index:61;box-shadow:-18px 0 50px -20px rgba(16,24,40,.35);display:flex;flex-direction:column}
.drawer-head{display:flex;align-items:center;justify-content:space-between;padding:18px 22px;border-bottom:1px solid var(--line)}
.drawer-head h3{font-size:16px}
.drawer-body{padding:20px 22px;overflow-y:auto;flex:1}
.drawer-foot{padding:14px 22px;border-top:1px solid var(--line);display:flex;gap:10px;justify-content:flex-end;background:var(--panel-2)}
.close-x{border:0;background:transparent;font-size:20px;color:var(--muted);cursor:pointer;line-height:1;padding:2px 6px;border-radius:6px}
.close-x:hover{background:#f1f3f9;color:var(--text)}

/* modal */
.modal-mask{position:fixed;inset:0;background:rgba(16,24,40,.4);z-index:70;display:flex;align-items:center;justify-content:center;padding:20px}
.modal{background:var(--panel);border-radius:16px;width:min(560px,100%);box-shadow:0 24px 60px -20px rgba(16,24,40,.4);max-height:88vh;display:flex;flex-direction:column;overflow:hidden}
.modal-head{padding:16px 20px;border-bottom:1px solid var(--line);font-weight:600;display:flex;justify-content:space-between;align-items:center}
.modal-body{padding:18px 20px;overflow-y:auto}
.modal-foot{padding:13px 20px;border-top:1px solid var(--line);display:flex;justify-content:flex-end;gap:10px;background:var(--panel-2)}

/* toast */
.toast{position:fixed;left:50%;bottom:28px;transform:translateX(-50%);background:#1f2430;color:#fff;padding:10px 18px;border-radius:10px;font-size:13px;z-index:99;box-shadow:0 10px 30px -10px rgba(0,0,0,.5);max-width:80vw}
.toast.err{background:#b42318}

/* misc */
.muted{color:var(--muted)}
.small{font-size:12px}
.mono{font-family:var(--mono);font-size:12px}
.nowrap{white-space:nowrap}
.hr{height:1px;background:var(--line-2);margin:18px 0}
.tag{display:inline-block;background:#f3f5fa;color:var(--text-2);border-radius:6px;padding:1px 7px;font-size:11.5px;margin:2px 4px 2px 0}
.answer-box{background:var(--panel-2);border:1px solid var(--line-2);border-radius:12px;padding:14px 16px;white-space:pre-wrap;font-size:13.5px;line-height:1.75;color:var(--text)}
.score{font-variant-numeric:tabular-nums;color:var(--muted);font-size:12px}

/* auth */
.auth-body{background:radial-gradient(1200px 600px at 10% 0%,#e8ecff,#f5f6fa 60%)}
.auth-wrap{min-height:100vh;display:flex;align-items:center;justify-content:center;gap:70px;padding:30px;flex-wrap:wrap}
.auth-brand{max-width:340px}
.auth-logo{width:52px;height:52px;border-radius:16px;background:linear-gradient(135deg,#3b5bfd,#7b95ff);color:#fff;display:flex;align-items:center;justify-content:center;font-size:24px;font-weight:700;box-shadow:0 16px 30px -14px rgba(59,91,253,.8)}
.auth-brand h1{font-size:26px;margin:18px 0 6px}
.auth-brand p{color:var(--muted);margin:0}
.auth-card{background:#fff;padding:30px 28px;border-radius:18px;box-shadow:0 30px 70px -30px rgba(16,24,40,.35);width:360px;border:1px solid var(--line)}
.auth-card h2{font-size:17px;margin-bottom:18px}
.auth-error{color:var(--red);font-size:12.5px;min-height:18px;margin-bottom:6px}
.auth-hint{font-size:11.5px;color:var(--faint);text-align:center;margin:14px 0 0}

@media (max-width:1100px){
  .stats{grid-template-columns:repeat(2,minmax(0,1fr))}
  .two-col{grid-template-columns:1fr}
}
@media (max-width:820px){
  .sidebar{width:64px;flex:0 0 64px}
  .brand-text,.nav a span,.sidebar-foot .ver,.nav-badge{display:none}
  .nav a{justify-content:center;padding:11px 0}
  .nav a.active::before{display:none}
  .brand{justify-content:center;padding:16px 0 10px}
  .view{padding:16px}
  .topbar{padding:14px 16px}
  .topbar-title p{display:none}
  .user-meta{display:none}
}
