/* TecDao 运营后台 · 原型样式 */
:root {
  --brand: #5b4cf5; --ink: #1b1d33; --ink-2: #4b4e69; --ink-3: #8b8ea7; --line: #e6e8f0; --bg: #f4f5f9; --card: #fff;
  --ok: #12a26a; --warn: #df8800; --bad: #d63c3c; --info: #2a7fd4; --side: #16172b;
}
* { box-sizing: border-box; }
body { margin: 0; font: 14px/1.55 system-ui, -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; color: var(--ink); background: var(--bg); }
a { color: var(--brand); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
.hidden { display: none !important; }
.muted { color: var(--ink-3); } .small { font-size: 12px; } .spacer { flex: 1; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.mono { font-family: ui-monospace, Consolas, monospace; font-size: 12px; }
.logo-mark { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; color: #fff; font-weight: 800; background: linear-gradient(135deg, #5b4cf5, #22c1c3); flex: none; }

/* shell */
.shell { display: grid; grid-template-columns: 228px 1fr; min-height: 100vh; }
.side { background: var(--side); color: #c9cbe0; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; gap: 10px; align-items: center; padding: 18px 18px 14px; color: #fff; }
.brand small { display: block; color: #8d90b0; font-size: 11px; }
.side nav { padding: 6px 10px; flex: 1; }
.nav-group { font-size: 11px; color: #6f7294; padding: 14px 10px 6px; letter-spacing: 1px; }
.side nav a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 9px; color: #c9cbe0; margin-bottom: 2px; }
.side nav a:hover { background: #22243d; }
.side nav a.on { background: #2d2f52; color: #fff; }
.side nav a .cnt { margin-left: auto; background: var(--bad); color: #fff; font-size: 11px; border-radius: 999px; padding: 0 7px; }
.side-foot { padding: 14px 18px; border-top: 1px solid #25273f; display: grid; gap: 6px; font-size: 13px; }
.side-foot a { color: #9fe3e4; }
.main { min-width: 0; }
.head { height: 58px; background: #fff; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 12px; padding: 0 22px; position: sticky; top: 0; z-index: 10; }
.crumb { font-weight: 600; }
.crumb span { color: var(--ink-3); font-weight: 400; }
.env { font-size: 12px; padding: 3px 10px; border-radius: 999px; font-weight: 600; }
.env.live { background: #e3f7ee; color: var(--ok); } .env.test { background: #fff3dd; color: var(--warn); }
.me { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.me .av { width: 30px; height: 30px; border-radius: 50%; background: #efedff; color: var(--brand); display: grid; place-items: center; font-weight: 700; }
.icon-btn { border: 1px solid var(--line); background: #fff; border-radius: 8px; width: 34px; height: 34px; cursor: pointer; }
.menu-btn { display: none; }
.view { padding: 22px; max-width: 1400px; }
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; z-index: 40; left: 0; width: 240px; transform: translateX(-100%); transition: transform .2s; }
  .side.open { transform: none; box-shadow: 0 0 40px rgba(0,0,0,.4); }
  .menu-btn { display: block; }
  .view { padding: 14px; }
  .me span { display: none; }
}

/* common */
.page-h { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.page-h h1 { font-size: 20px; margin: 0; }
.page-h p { margin: 2px 0 0; color: var(--ink-3); font-size: 13px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
.panel { padding: 16px 18px; margin-bottom: 16px; }
.panel > h3 { margin: 0 0 12px; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } .g6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
@media (max-width: 1200px) { .g6 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) { .g2, .g3, .g4, .g6 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .g2, .g3 { grid-template-columns: 1fr; } }
.kpi { padding: 14px 16px; }
.kpi .lbl { font-size: 12px; color: var(--ink-3); }
.kpi .val { font-size: 22px; font-weight: 800; margin: 4px 0 2px; letter-spacing: -.3px; }
.kpi .delta { font-size: 12px; }
.up { color: var(--ok); } .down { color: var(--bad); }

.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid transparent; border-radius: 9px; padding: 7px 14px; font-weight: 600; cursor: pointer; background: var(--brand); color: #fff; white-space: nowrap; }
.btn.ghost { background: #fff; color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { border-color: #c8cbe0; }
.btn.danger { background: var(--bad); } .btn.ok { background: var(--ok); } .btn.warn { background: var(--warn); }
.btn.sm { padding: 4px 10px; font-size: 12px; border-radius: 7px; }
.btn.link { background: none; border: 0; color: var(--brand); padding: 0; font-weight: 500; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }

.tag { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; padding: 1px 8px; border-radius: 999px; font-weight: 600; background: #eef0f5; color: var(--ink-2); white-space: nowrap; }
.tag.ok { background: #e3f7ee; color: var(--ok); } .tag.warn { background: #fff3dd; color: var(--warn); } .tag.bad { background: #fde7e7; color: var(--bad); }
.tag.info { background: #e6f1fc; color: var(--info); } .tag.brand { background: #efedff; color: var(--brand); }

.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.input, .select, textarea.input { border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; background: #fff; outline: none; min-width: 0; }
.input:focus, .select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px #e7e4ff; }
textarea.input { width: 100%; resize: vertical; min-height: 70px; }
.field { display: grid; gap: 5px; margin-bottom: 12px; }
.field > label { font-size: 12px; font-weight: 600; color: var(--ink-2); }
.field .input, .field .select { width: 100%; }
.req::after { content: " *"; color: var(--bad); }

.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th, .tbl td { padding: 10px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; white-space: nowrap; }
.tbl th { background: #fafbfd; color: var(--ink-3); font-weight: 600; font-size: 12px; position: sticky; top: 0; }
.tbl tbody tr:hover { background: #fafaff; }
.tbl tr.click { cursor: pointer; }
.tbl td.num, .tbl th.num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl td.wrap { white-space: normal; min-width: 220px; }
.prod-cell { display: flex; align-items: center; gap: 10px; }
.thumb { width: 38px; height: 38px; border-radius: 9px; display: grid; place-items: center; font-size: 18px; flex: none; }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 14px; overflow-x: auto; }
.tabs button { background: none; border: 0; padding: 9px 14px; cursor: pointer; color: var(--ink-3); font-weight: 600; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs button.on { color: var(--ink); border-color: var(--brand); }

/* bars */
.bar { height: 8px; border-radius: 99px; background: #eef0f5; overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 99px; background: var(--brand); }
.bar.warn > i { background: var(--warn); } .bar.bad > i { background: var(--bad); } .bar.ok > i { background: var(--ok); }
.quota { display: grid; grid-template-columns: 130px 1fr 150px; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 13px; }
.quota:last-child { border: 0; }
@media (max-width: 600px) { .quota { grid-template-columns: 1fr; gap: 4px; } }
.funnel { display: grid; gap: 8px; }
.funnel-row { display: grid; grid-template-columns: 90px 1fr 110px; gap: 10px; align-items: center; font-size: 13px; }
.funnel-row .fbar { height: 28px; border-radius: 7px; background: linear-gradient(90deg, #5b4cf5, #8f84ff); color: #fff; font-size: 12px; display: flex; align-items: center; padding-left: 10px; min-width: 40px; }
.chart { display: flex; align-items: flex-end; gap: 6px; height: 150px; padding-top: 10px; }
.chart .col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 11px; color: var(--ink-3); }
.chart .col i { width: 100%; max-width: 30px; border-radius: 5px 5px 0 0; background: linear-gradient(180deg, #8f84ff, #5b4cf5); display: block; }
.alerts { display: grid; gap: 8px; }
.alert { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 10px; background: #fafbfd; border: 1px solid var(--line); font-size: 13px; }
.alert.warn { background: #fffaf0; border-color: #f6dfb1; } .alert.bad { background: #fff6f6; border-color: #f5c9c9; } .alert.info { background: #f4f9ff; border-color: #cfe3f8; }
.alert .btn { margin-left: auto; }

.progress-goal { display: grid; gap: 6px; margin-bottom: 12px; font-size: 13px; }

/* form layout */
.form-grid { display: grid; grid-template-columns: 1fr 340px; gap: 16px; align-items: start; }
@media (max-width: 1100px) { .form-grid { grid-template-columns: 1fr; } }
.sticky { position: sticky; top: 74px; }
.check-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.check-list li { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; }
.check-list .ok { color: var(--ok); } .check-list .no { color: var(--bad); }
.src-row { display: grid; grid-template-columns: 120px 1fr 130px 34px; gap: 8px; margin-bottom: 8px; }
@media (max-width: 700px) { .src-row { grid-template-columns: 1fr; } }
.cover-prev { height: 120px; border-radius: 10px; display: grid; place-items: center; font-size: 50px; color: #fff; }
.locale-tabs button .dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-left: 6px; }
.switch { position: relative; display: inline-block; width: 38px; height: 22px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: #cfd2e0; border-radius: 99px; cursor: pointer; transition: .2s; }
.switch span::before { content: ""; position: absolute; width: 16px; height: 16px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; }
.switch input:checked + span { background: var(--ok); }
.switch input:checked + span::before { transform: translateX(16px); }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 8px 14px; font-size: 13px; }
.kv dt { color: var(--ink-3); } .kv dd { margin: 0; word-break: break-all; }
.timeline { list-style: none; padding: 0; margin: 0; border-left: 2px solid var(--line); }
.timeline li { padding: 0 0 12px 14px; position: relative; font-size: 13px; }
.timeline li::before { content: ""; position: absolute; left: -6px; top: 5px; width: 10px; height: 10px; border-radius: 50%; background: var(--brand); }
.timeline li.dup::before { background: var(--ink-3); } .timeline li.bad::before { background: var(--bad); }
.miss { background: #fff1f1 !important; }
td .input.inline { width: 100%; min-width: 200px; }

/* drawer */
.drawer-mask { position: fixed; inset: 0; background: rgba(15,16,36,.4); z-index: 50; display: none; }
.drawer-mask.show { display: block; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 100vw); background: #fff; z-index: 51; transform: translateX(100%); transition: transform .22s; overflow-y: auto; box-shadow: -10px 0 40px rgba(0,0,0,.15); }
.drawer.show { transform: none; }
.drawer-h { padding: 16px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; position: sticky; top: 0; background: #fff; }
.drawer-h h3 { margin: 0; font-size: 16px; }
.drawer-b { padding: 18px 20px; }
.toast { position: fixed; left: 50%; top: 20px; transform: translateX(-50%) translateY(-20px); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 10px; opacity: 0; transition: .25s; z-index: 70; pointer-events: none; max-width: 90vw; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* login */
.login { min-height: 100vh; display: grid; place-items: center; background: radial-gradient(800px 400px at 80% 0%, #2c2f6b, transparent), #16172b; padding: 16px; }
.login-card { background: #fff; border-radius: 16px; padding: 30px; width: 100%; max-width: 400px; }
.login-card h1 { font-size: 20px; margin: 14px 0 4px; }
