:root {
  --green: #14524c;
  --green-2: #1d6b63;
  --chalk: #fbbf24;
  --bg: #f6f4ee;
  --panel: #ffffff;
  --text: #1c2524;
  --muted: #66716f;
  --line: #e3e0d6;
  --danger: #b42318;
  --ok: #1f7a4d;
  --radius: 12px;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101615;
    --panel: #18201f;
    --text: #e7ece9;
    --muted: #93a09c;
    --line: #2a3533;
    --green-2: #2c8a7f;
    --danger: #f97066;
    --ok: #4ade80;
  }
}
* { box-sizing: border-box; }
body { margin: 0; min-block-size: 100dvh; line-height: 1.55; }
[hidden] { display: none !important; }
a { color: var(--green-2); }
code, pre { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: .88em; }
.muted { color: var(--muted); }
h1 { font-size: 1.2rem; margin: 0 0 .75rem; }
h2 { font-size: 1.05rem; margin: 0; }
h3 { font-size: .98rem; margin: 1.4rem 0 .4rem; }

/* 品牌 */
.brand { display: flex; align-items: center; gap: .55rem; font-weight: 650; white-space: nowrap; }
.brand-lg { font-size: 1.3rem; margin-block-end: .4rem; }
.logo { inline-size: 30px; block-size: 30px; flex: none; background: url("mark.svg") center/contain no-repeat; }
.brand-sub { font-weight: 400; color: var(--muted); font-size: .85rem; padding-inline-start: .5rem; border-inline-start: 1px solid var(--line); }

/* 按钮和表单 */
.btn {
  font: inherit; font-size: .92rem; cursor: pointer; border-radius: 8px; padding: .5rem 1rem;
  border: 1px solid var(--line); background: var(--panel); color: var(--text);
  min-block-size: 36px; min-inline-size: 24px;
}
.btn:hover { border-color: var(--green-2); }
.btn:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible, .table-wrapper:focus-visible { outline: 2px solid var(--chalk); outline-offset: 2px; }
.btn.primary { background: var(--green); border-color: var(--green); color: #fff; }
.btn.primary:hover { background: var(--green-2); }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.ghost { background: transparent; }
.btn.sm { padding: .25rem .65rem; min-block-size: 30px; font-size: .85rem; }
.btn.block { inline-size: 100%; }
.btn.link { border: none; background: none; color: var(--green-2); padding: .2rem .35rem; min-block-size: 28px; }
.btn.link.danger-text { color: var(--danger); }
.btn:disabled { opacity: .55; cursor: progress; }
label { display: grid; gap: .3rem; font-size: .9rem; color: var(--muted); margin-block-end: .9rem; }
label.inline { display: inline-flex; align-items: center; gap: .4rem; margin: 0; }
input, select {
  font: inherit; color: var(--text); background: var(--panel); border: 1px solid var(--line);
  border-radius: 8px; padding: .55rem .7rem; min-block-size: 38px;
}
select { padding-block: .35rem; min-block-size: 34px; }
.form-error { color: var(--danger); min-block-size: 1.3em; margin: 0 0 .6rem; font-size: .88rem; }

/* 外框 */
.topbar {
  position: sticky; inset-block-start: 0; z-index: 5; display: flex; align-items: center; gap: 1.5rem;
  padding: .7rem clamp(1rem, 3vw, 2rem); background: var(--panel); border-block-end: 1px solid var(--line);
  flex-wrap: wrap;
}
.tabs { display: flex; gap: .2rem; flex: 1; overflow-x: auto; }
.tabs a {
  text-decoration: none; color: var(--muted); padding: .45rem .8rem; border-radius: 8px; white-space: nowrap;
}
.tabs a[aria-current="page"] { color: var(--green-2); background: color-mix(in srgb, var(--green) 10%, transparent); font-weight: 600; }
.me { display: flex; align-items: center; gap: .4rem; font-size: .88rem; }
.content { max-inline-size: 1180px; margin: 0 auto; padding: 1.4rem clamp(1rem, 3vw, 2rem) 3rem; display: grid; gap: 1rem; }
.content section { display: grid; gap: 1rem; }
@media (width < 720px) {
  .topbar { gap: .6rem; }
  .tabs { order: 3; flex-basis: 100%; }
  .me { margin-inline-start: auto; }
  #me-name { display: none; }
}

/* 卡片 */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.25rem; min-inline-size: 0; }
.card > p.muted { margin: .3rem 0 .9rem; font-size: .88rem; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: .8rem; flex-wrap: wrap; margin-block-end: .8rem; }
.cards { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.stat-label { color: var(--muted); font-size: .88rem; }
.stat-value { font-size: 1.75rem; font-weight: 700; margin: .25rem 0; font-variant-numeric: tabular-nums; }
.stat-sub { color: var(--muted); font-size: .8rem; }
.stat.hero { background: var(--green); border-color: var(--green); color: #fff; }
.stat.hero .stat-label, .stat.hero .stat-sub { color: rgb(255 255 255 / .75); }
.stat.hero .stat-value { color: var(--chalk); font-size: 2rem; }
.stat-value.low { color: var(--danger); }

/* 分段按钮 */
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg button { font: inherit; font-size: .85rem; border: 0; background: transparent; color: var(--muted); padding: .3rem .8rem; cursor: pointer; min-block-size: 30px; }
.seg button[aria-pressed="true"] { background: var(--green); color: #fff; }

/* 柱状图 */
.chart { display: flex; align-items: flex-end; gap: 4px; block-size: 200px; padding-block-start: 1.4rem; }
.chart .bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; block-size: 100%; min-inline-size: 0; }
.chart .bar {
  inline-size: min(100%, 36px); background: var(--green-2); border-radius: 4px 4px 0 0; min-block-size: 2px; position: relative;
}
.chart .bar:hover { background: var(--chalk); }
.chart .bar-val { font-size: .68rem; color: var(--muted); white-space: nowrap; margin-block-end: 2px; font-variant-numeric: tabular-nums; }
.chart .bar-lab { font-size: .68rem; color: var(--muted); margin-block-start: 4px; white-space: nowrap; }
.chart.dense .bar-val { display: none; }
.chart.dense .bar-col:nth-child(odd) .bar-lab { visibility: hidden; }
.chart-empty { color: var(--muted); align-self: center; margin: auto; }

/* 表格 */
.table-wrapper { overflow: auto; max-inline-size: 100%; container-type: inline-size; }
table { border-collapse: separate; border-spacing: 0; inline-size: 100%; font-size: .9rem; }
th, td { text-align: start; padding: .55rem .6rem; border-block-end: 1px solid var(--line); white-space: nowrap; }
thead th { color: var(--muted); font-weight: 500; font-size: .82rem; position: sticky; inset-block-start: 0; background: var(--panel); z-index: 1; }
td.num, th.num { text-align: end; font-variant-numeric: tabular-nums; }
td.empty { text-align: center; color: var(--muted); padding: 2rem; }
.keycell { display: inline-flex; align-items: center; gap: .3rem; }
.keycell code { background: color-mix(in srgb, var(--text) 6%, transparent); padding: .1rem .4rem; border-radius: 5px; }
.badge { display: inline-block; font-size: .78rem; padding: .05rem .5rem; border-radius: 99px; border: 1px solid currentColor; }
.badge.on { color: var(--ok); }
.badge.off { color: var(--muted); }
.pager { display: flex; justify-content: flex-end; align-items: center; gap: .6rem; margin-block-start: .8rem; }
.filters { display: flex; gap: .8rem; flex-wrap: wrap; }

@container (width < 640px) {
  table.stack, table.stack thead, table.stack tbody, table.stack tr, table.stack th, table.stack td { display: block; }
  table.stack thead { display: none; }
  table.stack tr { border: 1px solid var(--line); border-radius: 10px; margin-block-end: .7rem; padding: .3rem .2rem; }
  table.stack td { border: 0; padding: .3rem .7rem; text-align: start; display: flex; justify-content: space-between; gap: 1rem; white-space: normal; }
  table.stack td.num { text-align: start; }
  table.stack td::before { content: attr(data-label); color: var(--muted); font-size: .82rem; flex: none; }
  table.stack td.empty::before { content: none; }
  table.stack td.empty { justify-content: center; }
}

/* 文档 */
.prose { max-inline-size: 860px; }
.prose p, .prose li { font-size: .93rem; }
.prose pre {
  background: color-mix(in srgb, var(--text) 6%, transparent); padding: .9rem 1rem; border-radius: 10px; overflow-x: auto; line-height: 1.5;
}
.prose :not(pre) > code { background: color-mix(in srgb, var(--text) 7%, transparent); padding: .08rem .35rem; border-radius: 5px; }
.kv { display: grid; gap: .55rem; margin: .8rem 0; }
.kv > div { display: flex; gap: .8rem; align-items: center; flex-wrap: wrap; }
.kv code { font-size: .95rem; background: color-mix(in srgb, var(--green) 10%, transparent); padding: .25rem .6rem; border-radius: 6px; }

/* 弹窗 */
dialog {
  border: 1px solid var(--line); border-radius: 14px; padding: 1.4rem 1.5rem; background: var(--panel); color: var(--text);
  inline-size: min(440px, calc(100vw - 2rem));
}
dialog:modal { overscroll-behavior: contain; }
dialog::backdrop { background: rgb(0 0 0 / .4); overflow: hidden; overscroll-behavior: contain; }
dialog input { inline-size: 100%; }
.dlg-actions { display: flex; justify-content: flex-end; gap: .6rem; margin-block-start: .6rem; }
.copyline { display: flex; align-items: center; gap: .6rem; background: color-mix(in srgb, var(--text) 6%, transparent); border-radius: 8px; padding: .6rem .7rem; margin: .8rem 0; }
.copyline code { flex: 1; word-break: break-all; }

/* 复制反馈 */
.copy { position: relative; display: inline-flex; }
.copy .tip {
  position: absolute; inset-block-end: calc(100% + 4px); inset-inline-start: 50%; translate: -50% 0;
  background: var(--text); color: var(--panel); font-size: .75rem; padding: .15rem .5rem; border-radius: 6px;
  white-space: nowrap; opacity: 0; transition: opacity .15s; pointer-events: none;
}
.copy .tip:not(:empty) { opacity: 1; }

.toast {
  position: fixed; inset-block-end: 1.5rem; inset-inline-start: 50%; translate: -50% 0; z-index: 50;
  background: var(--text); color: var(--panel); padding: .55rem 1rem; border-radius: 8px; font-size: .9rem;
  opacity: 0; transition: opacity .2s; pointer-events: none;
}
.toast:not(:empty) { opacity: 1; }
.toast.err { background: var(--danger); color: #fff; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ================= 登录 / 产品宣传页 ================= */
.login {
  --ink: #fff7e8; --ink-2: rgb(255 247 232 / .72); --teal: #14b8a6;
  position: relative; min-block-size: 100dvh; overflow: hidden; isolation: isolate;
  display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(340px, .75fr); align-items: center;
  gap: clamp(1.5rem, 4vw, 4rem); padding: clamp(1.5rem, 5vw, 4.5rem) clamp(1.2rem, 6vw, 6rem) 4rem;
  color: var(--ink); background: radial-gradient(120% 90% at 70% 20%, #14524c 0%, #0b3b38 45%, #041d1b 100%);
}
.sky { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.aurora { position: absolute; border-radius: 50%; filter: blur(70px); opacity: .55; animation: drift 18s ease-in-out infinite alternate; }
.a1 { inline-size: 46vmax; block-size: 46vmax; background: #fbbf24; inset-block-start: -18vmax; inset-inline-end: -10vmax; opacity: .22; }
.a2 { inline-size: 40vmax; block-size: 40vmax; background: #14b8a6; inset-block-end: -20vmax; inset-inline-start: -12vmax; opacity: .3; animation-duration: 22s; }
.a3 { inline-size: 26vmax; block-size: 26vmax; background: #0f766e; inset-block-start: 30%; inset-inline-start: 40%; opacity: .35; animation-duration: 26s; }
@keyframes drift { from { transform: translate(0, 0) scale(1); } to { transform: translate(6vmax, 4vmax) scale(1.15); } }
.stars { position: absolute; inset: 0; }
.stars i { position: absolute; inline-size: var(--s); block-size: var(--s); border-radius: 50%; background: #fff7e8; opacity: .2; animation: twinkle var(--t) ease-in-out var(--dl) infinite; }
@keyframes twinkle { 50% { opacity: .95; transform: scale(1.4); } }
.grid-floor {
  position: absolute; inset-inline: -20%; inset-block-end: -10%; block-size: 45%;
  background-image: linear-gradient(rgb(255 247 232 / .07) 1px, transparent 1px), linear-gradient(90deg, rgb(255 247 232 / .07) 1px, transparent 1px);
  background-size: 48px 48px; transform: perspective(500px) rotateX(62deg); transform-origin: bottom;
  mask-image: linear-gradient(to top, #000 10%, transparent 90%);
  animation: floor 6s linear infinite;
}
@keyframes floor { to { background-position: 0 48px, 0 0; } }

.hero { max-inline-size: 760px; animation: rise .9s cubic-bezier(.2, .7, .2, 1) both; }
@keyframes rise { from { opacity: 0; transform: translateY(24px); } }
.hero-brand { display: flex; align-items: center; gap: .6rem; font-size: 1.6rem; font-weight: 750; letter-spacing: -.01em; }
.hero-brand em { font-style: normal; font-size: .82rem; font-weight: 500; color: var(--ink-2); border: 1px solid rgb(255 247 232 / .25); padding: .1rem .6rem; border-radius: 99px; }
.hero h1 { font-size: clamp(2rem, 4.4vw, 3.6rem); line-height: 1.15; margin: 1.3rem 0 1rem; letter-spacing: -.02em; text-wrap: balance; }
.glow-text {
  background: linear-gradient(90deg, #fbbf24, #fde68a 40%, #5eead4 70%, #fbbf24); background-size: 200% auto;
  -webkit-background-clip: text; background-clip: text; color: transparent; animation: shine 6s linear infinite;
}
@keyframes shine { to { background-position: 200% center; } }
.hero-sub { color: var(--ink-2); font-size: clamp(.95rem, 1.3vw, 1.08rem); line-height: 1.8; margin: 0 0 1.6rem; max-inline-size: 640px; }

.terminal {
  max-inline-size: 560px; border-radius: 12px; overflow: hidden; margin-block-end: 1.6rem;
  background: rgb(4 29 27 / .65); border: 1px solid rgb(255 247 232 / .14); box-shadow: 0 20px 60px rgb(0 0 0 / .35);
  backdrop-filter: blur(8px);
}
.term-bar { display: flex; align-items: center; gap: 6px; padding: .5rem .8rem; border-block-end: 1px solid rgb(255 247 232 / .08); font-size: .75rem; color: var(--ink-2); }
.term-bar i { inline-size: 10px; block-size: 10px; border-radius: 50%; background: #f87171; }
.term-bar i:nth-child(2) { background: #fbbf24; } .term-bar i:nth-child(3) { background: #34d399; }
.term-bar span { margin-inline-start: .5rem; }
.term-body { padding: .9rem 1rem; font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: .92rem; min-block-size: 3.2em; color: #fde68a; }
.prompt { color: var(--teal); font-weight: 700; }
.caret { display: inline-block; inline-size: .55em; block-size: 1.1em; vertical-align: -.15em; background: #fbbf24; margin-inline-start: 2px; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

.modes { list-style: none; padding: 0; margin: 0 0 1.4rem; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .6rem; }
.modes li {
  padding: .7rem .8rem; border-radius: 12px; background: rgb(255 247 232 / .06); border: 1px solid rgb(255 247 232 / .12);
  display: grid; gap: .2rem; transition: transform .25s, background .25s, border-color .25s;
  animation: rise .7s cubic-bezier(.2, .7, .2, 1) calc(.3s + var(--d)) both;
}
.modes li:hover { transform: translateY(-4px); background: rgb(251 191 36 / .12); border-color: rgb(251 191 36 / .5); }
.modes b { font-size: .95rem; font-weight: 650; }
.modes span { font-size: .78rem; color: var(--ink-2); }
@media (width >= 1200px) { .modes { grid-template-columns: repeat(5, minmax(0, 1fr)); } .hero { max-inline-size: 820px; } }
@media (width < 1200px) { .modes li:last-child:nth-child(odd) { grid-column: 1 / -1; } }
.models { display: flex; flex-wrap: wrap; gap: .5rem; }
.chip { font-size: .8rem; padding: .25rem .75rem; border-radius: 99px; border: 1px solid rgb(94 234 212 / .45); color: #99f6e4; background: rgb(20 184 166 / .1); }
.chip.gold { border-color: rgb(251 191 36 / .6); color: #fde68a; background: rgb(251 191 36 / .12); }
.chip.ghost { border-style: dashed; border-color: rgb(255 247 232 / .3); color: var(--ink-2); background: none; }

.login-side { display: grid; justify-items: center; gap: 0; animation: rise 1s cubic-bezier(.2, .7, .2, 1) .15s both; }
.box-float { position: relative; inline-size: 150px; block-size: 150px; margin-block-end: -26px; z-index: 1; animation: float 5s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-14px); } }
.box-halo { position: absolute; inset: -30%; border-radius: 50%; background: radial-gradient(circle, rgb(251 191 36 / .45), transparent 65%); animation: pulse 3.2s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.18); opacity: .6; } }
.box-mark { position: relative; inline-size: 100%; block-size: 100%; filter: drop-shadow(0 18px 30px rgb(0 0 0 / .45)); }
.spark { position: absolute; inline-size: 14px; block-size: 14px; background: #fbbf24;
  clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%); animation: sparkle 2.6s ease-in-out infinite; }
.s1 { inset-block-start: -6%; inset-inline-start: 4%; }
.s2 { inset-block-start: 22%; inset-inline-end: -10%; inline-size: 10px; block-size: 10px; animation-delay: .9s; }
.s3 { inset-block-start: -14%; inset-inline-end: 22%; inline-size: 8px; block-size: 8px; animation-delay: 1.6s; }
@keyframes sparkle { 0%, 100% { transform: scale(.3) rotate(0); opacity: 0; } 50% { transform: scale(1) rotate(90deg); opacity: 1; } }

.login-card {
  position: relative; inline-size: min(400px, 100%); padding: 2.6rem 1.9rem 1.6rem; border-radius: 20px;
  background: rgb(255 247 232 / .08); border: 1px solid rgb(255 247 232 / .18);
  backdrop-filter: blur(18px) saturate(140%); box-shadow: 0 30px 80px rgb(0 0 0 / .4), inset 0 1px 0 rgb(255 255 255 / .12);
}
.login-card::before {
  content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; pointer-events: none;
  background: conic-gradient(from var(--ang, 0deg), transparent 0 70%, #fbbf24 80%, #5eead4 90%, transparent 100%);
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  animation: spin 6s linear infinite;
}
@property --ang { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
@keyframes spin { to { --ang: 360deg; } }
.login-card h2 { font-size: 1.35rem; margin: 0; text-align: center; color: var(--ink); }
.login-tip { text-align: center; color: var(--ink-2); font-size: .85rem; margin: .3rem 0 1.4rem; letter-spacing: .05em; }
.login-card label { color: var(--ink-2); }
.login-card input { background: rgb(4 29 27 / .55); border-color: rgb(255 247 232 / .18); color: var(--ink); }
.login-card input::placeholder { color: rgb(255 247 232 / .35); }
.login-card input:focus { border-color: #fbbf24; outline: none; box-shadow: 0 0 0 3px rgb(251 191 36 / .25); }
.login-card .form-error { color: #fca5a5; }
.btn-shine {
  position: relative; overflow: hidden; inline-size: 100%; min-block-size: 46px; border: 0; border-radius: 10px; cursor: pointer;
  font: inherit; font-weight: 700; font-size: 1rem; color: #0b3b38; background: linear-gradient(135deg, #fde68a, #fbbf24 55%, #f59e0b);
  box-shadow: 0 10px 30px rgb(251 191 36 / .35); transition: transform .15s, box-shadow .15s;
}
.btn-shine:hover { transform: translateY(-1px); box-shadow: 0 14px 36px rgb(251 191 36 / .5); }
.btn-shine::after { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, rgb(255 255 255 / .55) 50%, transparent 70%); translate: -100% 0; animation: sweep 3.5s ease-in-out infinite; }
@keyframes sweep { 60%, 100% { translate: 100% 0; } }
.btn-shine:disabled { opacity: .7; cursor: progress; }
.btn-shine:focus-visible { outline: 2px solid #fff7e8; outline-offset: 3px; }
.login-foot { text-align: center; font-size: .78rem; color: var(--ink-2); margin: 1.1rem 0 0; }
.login-foot a { color: #fde68a; }
.login-footer { position: absolute; inset-block-end: 1.1rem; inset-inline: 0; text-align: center; font-size: .75rem; color: rgb(255 247 232 / .45); }

@media (width < 960px) {
  .login { grid-template-columns: 1fr; padding-block-start: 2rem; }
  .login-side { order: -1; }
  .box-float { inline-size: 110px; block-size: 110px; margin-block-end: -20px; }
  .terminal { display: none; }
  .hero { text-align: center; margin-inline: auto; }
  .hero-brand, .models { justify-content: center; }
}
@media (prefers-reduced-motion: reduce) {
  .login *, .login *::before, .login *::after { animation: none !important; }
}
