:root {
  --brand: #5B4BE8;
  --brand-600: #4A3AD6;
  --brand-700: #3C2EB8;
  --brand-50: #EEEDFE;
  --brand-100: #DCDAFB;
  --ink: #15151A;
  --ink-2: #43434D;
  --ink-3: #71717D;
  --ink-4: #9C9CA8;
  --line: #E9E9F0;
  --line-2: #DCDCE6;
  --bg: #FFFFFF;
  --bg-2: #F7F7FB;
  --bg-3: #F1F1F8;
  --ok: #0F6E56;
  --ok-bg: #E1F5EE;
  --warn: #854F0B;
  --warn-bg: #FAEEDA;
  --danger: #A32D2D;
  --danger-bg: #FCEBEB;
  --info: #185FA5;
  --info-bg: #E6F1FB;
  --radius: 10px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(21, 21, 26, .06);
  --shadow: 0 4px 16px rgba(21, 21, 26, .08);
  --shadow-lg: 0 18px 48px rgba(21, 21, 26, .14);
  --sans: system-ui, -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Consolas, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--bg);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
img, video { display: block; max-width: 100%; }

/* ---------- 布局 ---------- */
.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 24px; }
.row { display: flex; align-items: center; gap: 12px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.col { display: flex; flex-direction: column; gap: 12px; }
.grow { flex: 1; min-width: 0; }
.hidden { display: none !important; }
.muted { color: var(--ink-3); }
.small { font-size: 12.5px; }
.mono { font-family: var(--mono); }
.center { text-align: center; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 38px; padding: 0 16px; border-radius: var(--radius);
  border: 1px solid var(--line-2); background: var(--bg); color: var(--ink);
  cursor: pointer; font-weight: 500; white-space: nowrap;
  transition: background .15s, border-color .15s, transform .06s;
}
.btn:hover { background: var(--bg-2); border-color: var(--ink-4); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-600); border-color: var(--brand-600); }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: var(--bg-3); border-color: transparent; }
.btn-danger { color: var(--danger); border-color: #F0C9C9; background: #fff; }
.btn-danger:hover { background: var(--danger-bg); border-color: var(--danger); }
.btn-ok { color: var(--ok); border-color: #BFE3D6; background: #fff; }
.btn-ok:hover { background: var(--ok-bg); border-color: var(--ok); }
.btn-sm { height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: 8px; }
.btn-lg { height: 46px; padding: 0 26px; font-size: 15px; border-radius: 12px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- 表单 ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label { font-size: 13px; font-weight: 500; color: var(--ink-2); }
.field .hint { font-size: 12px; color: var(--ink-4); }
.input, .select, .textarea {
  width: 100%; height: 40px; padding: 0 12px; border-radius: var(--radius);
  border: 1px solid var(--line-2); background: #fff; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.textarea { height: auto; padding: 10px 12px; resize: vertical; min-height: 84px; line-height: 1.6; }
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-50);
}
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 4.5L6 8l3.5-3.5' fill='none' stroke='%2371717D' stroke-width='1.4' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }

/* ---------- 卡片 ---------- */
.card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 20px;
}
.card-title { font-size: 15px; font-weight: 500; margin-bottom: 4px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }

.stat {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 16px 18px;
}
.stat .k { font-size: 12.5px; color: var(--ink-3); }
.stat .v { font-size: 24px; font-weight: 500; margin-top: 6px; letter-spacing: -.02em; }
.stat .v small { font-size: 13px; font-weight: 400; color: var(--ink-3); margin-left: 3px; }
.stat .s { font-size: 12px; color: var(--ink-4); margin-top: 4px; }

/* ---------- 标签 ---------- */
.tag {
  display: inline-flex; align-items: center; gap: 4px;
  height: 22px; padding: 0 8px; border-radius: 6px;
  font-size: 12px; font-weight: 500; white-space: nowrap;
  background: var(--bg-3); color: var(--ink-2);
}
.tag-ok { background: var(--ok-bg); color: var(--ok); }
.tag-warn { background: var(--warn-bg); color: var(--warn); }
.tag-danger { background: var(--danger-bg); color: var(--danger); }
.tag-info { background: var(--info-bg); color: var(--info); }
.tag-brand { background: var(--brand-50); color: var(--brand-700); }

/* ---------- 表格 ---------- */
.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: left; font-size: 12.5px; font-weight: 500; color: var(--ink-3);
  padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.table td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: var(--bg-2); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; font-family: var(--mono); font-size: 13px; }
.table-wrap { overflow-x: auto; margin: 0 -20px -20px; padding: 0 20px 4px; }

/* ---------- 进度条 ---------- */
.bar { height: 6px; border-radius: 3px; background: var(--bg-3); overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--brand); border-radius: 3px; transition: width .4s; }
.bar.ok > i { background: var(--ok); }

/* ---------- 提示 ---------- */
.alert {
  border-radius: var(--radius); padding: 12px 14px; font-size: 13px;
  border: 1px solid transparent; line-height: 1.6;
}
.alert-info { background: var(--info-bg); color: var(--info); }
.alert-warn { background: var(--warn-bg); color: var(--warn); }
.alert-ok { background: var(--ok-bg); color: var(--ok); }
.alert-danger { background: var(--danger-bg); color: var(--danger); }

.empty { padding: 44px 20px; text-align: center; color: var(--ink-4); font-size: 13px; }

/* ---------- 弹窗 ---------- */
.mask {
  position: fixed; inset: 0; background: rgba(18, 18, 26, .5);
  display: flex; align-items: center; justify-content: center; z-index: 90; padding: 24px;
}
.modal {
  background: #fff; border-radius: var(--radius-lg); width: 100%; max-width: 560px;
  max-height: 88vh; display: flex; flex-direction: column; box-shadow: var(--shadow-lg);
}
.modal-head { padding: 18px 22px; border-bottom: 1px solid var(--line); font-size: 16px; font-weight: 500; }
.modal-body { padding: 22px; overflow-y: auto; }
.modal-foot { padding: 16px 22px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 10px; }
.modal-lg { max-width: 780px; }

/* ---------- toast ---------- */
#toasts {
  position: fixed; top: 20px; left: 50%; transform: translateX(-50%);
  z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center;
  pointer-events: none;
}
.toast {
  background: #1D1D24; color: #fff; padding: 10px 18px; border-radius: 999px;
  font-size: 13px; box-shadow: var(--shadow); animation: toastIn .2s ease-out;
  max-width: 80vw; text-align: center;
}
.toast.ok { background: #0F6E56; }
.toast.err { background: #A32D2D; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

/* ---------- 应用框架（工作台 / 后台） ---------- */
.app { display: flex; min-height: 100vh; background: var(--bg-2); }
.side {
  width: 226px; flex: 0 0 226px; background: #fff; border-right: 1px solid var(--line);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.side-logo { padding: 20px 20px 16px; display: flex; align-items: center; gap: 10px; }
.side-nav { padding: 6px 12px; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; flex: 1; }
.side-nav a {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 9px;
  color: var(--ink-2); font-weight: 400; font-size: 13.5px;
}
.side-nav a:hover { background: var(--bg-2); }
.side-nav a.on { background: var(--brand-50); color: var(--brand-700); font-weight: 500; }
.side-foot { padding: 14px 16px; border-top: 1px solid var(--line); font-size: 12.5px; }
.side-group { font-size: 11.5px; color: var(--ink-4); padding: 14px 12px 6px; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 60px; background: #fff; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 26px; position: sticky; top: 0; z-index: 20;
}
.topbar h1 { font-size: 16px; font-weight: 500; }
.content { padding: 24px 26px 60px; }
.content > section { display: none; }
.content > section.on { display: block; }
.stack { display: flex; flex-direction: column; gap: 18px; }

/* ---------- 品牌 ---------- */
.logo-mark {
  width: 30px; height: 30px; border-radius: 9px; flex: 0 0 30px;
  background: var(--brand); color: #fff; display: flex; align-items: center;
  justify-content: center; font-weight: 500; font-size: 15px;
}
.logo-text { font-weight: 500; font-size: 15.5px; letter-spacing: -.01em; }

/* ---------- 官网 ---------- */
.site-nav {
  position: sticky; top: 0; z-index: 50; background: rgba(255, 255, 255, .88);
  backdrop-filter: saturate(180%) blur(12px); border-bottom: 1px solid var(--line);
}
.site-nav .wrap { height: 64px; display: flex; align-items: center; justify-content: space-between; }
.site-nav nav { display: flex; align-items: center; gap: 26px; font-size: 13.5px; color: var(--ink-2); }
.site-nav nav a:hover { color: var(--brand); }

.hero { padding: 76px 0 64px; background: var(--bg-2); border-bottom: 1px solid var(--line); }
.hero h1 { font-size: 42px; line-height: 1.2; font-weight: 500; letter-spacing: -.03em; max-width: 15em; }
.hero .sub { font-size: 16px; color: var(--ink-2); margin-top: 16px; max-width: 34em; line-height: 1.7; }

.section { padding: 72px 0; }
.section.alt { background: var(--bg-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section h2 { font-size: 26px; font-weight: 500; letter-spacing: -.02em; }
.section .lead { color: var(--ink-3); margin-top: 10px; font-size: 14.5px; }

.vcard {
  border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden;
  background: #fff; transition: box-shadow .2s, transform .2s; cursor: pointer;
}
.vcard:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.vcard .cover { aspect-ratio: 16 / 9; position: relative; display: flex; align-items: center; justify-content: center; }
.vcard .cover .play {
  width: 46px; height: 46px; border-radius: 50%; background: rgba(255, 255, 255, .92);
  display: flex; align-items: center; justify-content: center;
}
.vcard .body { padding: 14px 16px 16px; }
.vcard .ttl { font-weight: 500; font-size: 14.5px; line-height: 1.45; }
.vcard .meta { font-size: 12.5px; color: var(--ink-3); margin-top: 8px; display: flex; justify-content: space-between; gap: 8px; }
.grid-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }

.step-num {
  width: 30px; height: 30px; border-radius: 9px; background: var(--brand-50); color: var(--brand-700);
  display: flex; align-items: center; justify-content: center; font-weight: 500; font-size: 14px;
}

.footer { background: #14141A; color: #B9B9C6; padding: 48px 0 32px; font-size: 13px; }
.footer a:hover { color: #fff; }
.footer .cols { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 32px; }

.calc-panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 24px; }
.seg { display: inline-flex; background: var(--bg-3); border-radius: 10px; padding: 3px; }
.seg button {
  height: 32px; padding: 0 16px; border: none; background: transparent; border-radius: 8px;
  cursor: pointer; font-size: 13px; color: var(--ink-2);
}
.seg button.on { background: #fff; color: var(--brand-700); font-weight: 500; box-shadow: var(--shadow-sm); }

.result-row { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px dashed var(--line); font-size: 13.5px; }
.result-row:last-child { border-bottom: none; }
.result-row .v { font-family: var(--mono); font-variant-numeric: tabular-nums; }

@media (max-width: 1024px) {
  .grid-cards, .grid3, .grid4 { grid-template-columns: repeat(2, 1fr); }
  .footer .cols { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  .wrap { padding: 0 16px; }
  .hero h1 { font-size: 30px; }
  .grid-cards, .grid2, .grid3, .grid4 { grid-template-columns: 1fr; }
  .site-nav nav { display: none; }
  .app { flex-direction: column; }
  .side { width: 100%; flex: none; height: auto; position: static; }
  .side-nav { flex-direction: row; overflow-x: auto; }
  .content { padding: 16px; }
}
