:root {
  color-scheme: light;
  --bg: #f4f6fa; --surface: #fff; --ink: #172640; --muted: #748199;
  --border: #e3e9f2; --accent: #2b62e8; --accent-hover: #2153d0;
  --ok: #15805b; --bad: #c24145; --wait: #9a6b12;
  --font: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "SF Mono", ui-monospace, Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--ink); font: 14px/1.6 var(--font); -webkit-font-smoothing: antialiased; }
[hidden], .icon-library { display: none !important; }
button, input, textarea { font: inherit; }
button { display: inline-flex; justify-content: center; align-items: center; gap: 7px; border: 1px solid transparent; border-radius: 8px; padding: 10px 14px; background: var(--accent); color: #fff; font-weight: 600; font-size: 13px; cursor: pointer; transition: background .15s, border-color .15s; }
button:hover { background: var(--accent-hover); }
button:disabled { opacity: .5; cursor: not-allowed; }
button[aria-busy="true"] { cursor: wait; }
button:focus-visible { outline: 3px solid #a4bfff; outline-offset: 3px; }
button.quiet { background: #fff; border-color: var(--border); color: #50617c; }
button.quiet:hover { background: #f4f7fd; border-color: #bdcdef; }
button.text-button { padding: 0 2px; background: transparent; color: var(--accent); font-size: 12px; }
.icon { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }
h1, h2, p { margin: 0; }
h1 { font-size: 29px; line-height: 1.3; letter-spacing: -.025em; }
h2 { font-size: 17px; font-weight: 650; line-height: 1.4; }
.lead { color: var(--muted); }
.eyebrow { font-size: 12px; letter-spacing: .07em; font-weight: 500; }
.brand { display: inline-flex; align-items: center; gap: 11px; font-size: 21px; font-weight: 700; line-height: 1.1; }
.brand-mark { display: grid; place-items: center; width: 38px; height: 40px; color: #fff; background: #3269ed; border-radius: 10px; font-size: 26px; font-weight: 500; }
.brand-sub { display: block; margin-top: 5px; font-size: 11px; color: var(--muted); font-weight: 400; letter-spacing: .04em; }
label { display: block; color: #42516a; font-size: 13px; font-weight: 600; margin-bottom: 8px; }
input, textarea { width: 100%; padding: 12px 14px; border: 1px solid #dce4f0; border-radius: 8px; background: #fff; color: var(--ink); font-size: 14px; outline: none; transition: border-color .15s, box-shadow .15s; }
input::placeholder, textarea::placeholder { color: #98a3b4; }
input:focus, textarea:focus { border-color: #83a5f3; box-shadow: 0 0 0 3px #edf2ff; }
textarea { display: block; min-height: 240px; resize: vertical; font: 12px/1.9 var(--mono); overflow-wrap: anywhere; }
.status { padding: 11px 13px; border-radius: 8px; margin: 12px 0; font-size: 12px; line-height: 1.65; background: #f4f7fc; color: var(--muted); overflow-wrap: anywhere; }
.status:empty { display: none; }
.status.ok { color: #23704f; background: #eef8f2; }
.status.bad { color: #b44246; background: #fff2f2; }
/* Login */
.login-shell { display: grid; grid-template-columns: 1.1fr 1fr; width: min(1040px, calc(100% - 64px)); min-height: 640px; margin: max(36px, calc((100vh - 680px) / 2)) auto 36px; border: 1px solid var(--border); border-radius: 22px; overflow: hidden; background: #fff; box-shadow: 0 20px 80px rgba(28, 49, 87, .08); }
.login-story { display: flex; flex-direction: column; padding: 40px; background: radial-gradient(ellipse at 100% 0, #244d82, transparent 65%), #142540; color: #fff; }
.login-story .brand-sub { color: #a9bfdb; }
.story-content { margin: auto 0; padding: 55px 0; }
.story-content > .eyebrow { display: inline-block; color: #acc3e8; border: 1px solid #47668e; border-radius: 20px; padding: 5px 12px; margin-bottom: 24px; letter-spacing: .03em; }
.story-content h1 { font-size: 38px; line-height: 1.5; margin-bottom: 18px; font-weight: 600; }
.story-content > p { font-size: 13px; color: #b6c8df; max-width: 350px; line-height: 1.9; }
.workflow { display: flex; gap: 20px; margin-top: 36px; }
.workflow > div { flex: 1; min-width: 0; }
.workflow-number { display: block; color: #7fa4d8; font-size: 11px; font-family: var(--mono); margin-bottom: 8px; }
.workflow strong { display: block; font-size: 13px; font-weight: 500; }
.workflow small { display: block; margin-top: 5px; font-size: 10px; color: #91aaca; white-space: nowrap; }
.story-footer { display: flex; align-items: center; gap: 8px; color: #9eb6d4; font-size: 11px; }
.login-panel { display: flex; align-items: center; justify-content: center; padding: 48px; }
.login-form { width: 100%; max-width: 340px; }
.login-form > .eyebrow { display: block; color: var(--accent); margin-bottom: 9px; }
.login-form h2 { font-size: 25px; margin-bottom: 10px; }
.login-form .lead { font-size: 13px; margin-bottom: 34px; }
.login-form > input { margin-bottom: 22px; }
.login-form input { height: 48px; }
.password-field { position: relative; margin-bottom: 24px; }
.password-field input { padding-right: 50px; }
.icon-button { position: absolute; right: 5px; top: 5px; width: 38px; height: 38px; padding: 8px; background: transparent; color: var(--muted); }
.icon-button:hover { background: #f2f5fc; color: var(--accent); }
.login-submit { width: 100%; height: 48px; justify-content: space-between; padding: 12px 18px; }
.login-help { text-align: center; margin-top: 24px; font-size: 11px; color: var(--muted); }
/* Workspace */
.portal-header { display: flex; justify-content: space-between; align-items: center; height: 76px; padding: 0 max(28px, calc((100% - 1280px) / 2)); border-bottom: 1px solid var(--border); background: #fff; }
.portal-header .brand { font-size: 19px; }
.account-menu { display: flex; align-items: center; gap: 14px; }
.account-name { color: #52627b; font-size: 12px; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-menu button { padding: 7px 12px; font-size: 12px; }
.portal-content { width: min(1280px, calc(100% - 56px)); margin: 32px auto 0; }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.page-heading .eyebrow { color: var(--muted); }
.page-heading h1 { margin: 6px 0 8px; }
.page-heading .lead { font-size: 13px; }
.billing-note { display: inline-flex; align-items: center; gap: 7px; border: 1px solid #dce7e1; border-radius: 7px; padding: 7px 11px; background: #f2f8f5; color: #4b7763; font-size: 11px; }
.billing-note .icon { width: 15px; height: 15px; }
.overview { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 24px; }
.overview-item { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 18px 22px; border: 1px solid var(--border); border-radius: 11px; background: #fff; }
.overview-item > span { font-size: 12px; color: #64748e; }
.overview-item strong { display: flex; align-items: baseline; gap: 7px; font-size: 29px; font-weight: 650; line-height: 1.35; font-variant-numeric: tabular-nums; }
.overview-item small { font-size: 10px; color: #8a96a8; font-weight: 400; }
.balance-card { border-color: #cfddfb; background: #f0f5ff; }
.balance-card strong { color: var(--accent); }
.workspace-grid { display: grid; grid-template-columns: 350px minmax(0, 1fr); gap: 22px; align-items: start; }
.card { padding: 22px; border: 1px solid var(--border); border-radius: 11px; background: var(--surface); box-shadow: 0 2px 6px rgba(29, 47, 80, .015); min-width: 0; }
.section-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.section-description { font-size: 12px; color: var(--muted); margin: 8px 0 18px; }
.tag { color: #8190a8; font-size: 10px; white-space: nowrap; }
.input-tools { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin: 9px 0 18px; font-size: 11px; color: var(--muted); }
.estimate { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border: 1px solid var(--border); border-radius: 8px; background: #f8faff; font-size: 12px; color: #65738c; }
.estimate strong { color: var(--ink); font-size: 19px; font-variant-numeric: tabular-nums; }
.hint { color: var(--muted); font-size: 11px; line-height: 1.7; margin: 10px 0 20px; }
.hint.warning { color: var(--bad); }
.submit-button { width: 100%; min-height: 44px; }
.shortcut { text-align: center; color: #9aa5b7; font-size: 10px; margin-top: 8px; }
.submission-note { display: flex; gap: 9px; color: #8592a8; margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--border); }
.submission-note .icon { width: 15px; height: 15px; margin-top: 2px; }
.submission-note p { font-size: 11px; }
.results-heading { align-items: flex-start; }
.results-heading h2 { display: flex; align-items: center; gap: 8px; }
.count-tag { display: inline-flex; align-items: center; min-width: 24px; justify-content: center; padding: 2px 6px; border-radius: 5px; background: #eef2f8; color: #7987a0; font-size: 11px; font-weight: 500; }
.results-heading .section-description { margin-bottom: 0; }
.result-tools { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin: 22px 0 18px; }
.result-filters { display: flex; gap: 3px; padding: 3px; border-radius: 7px; background: #f2f5fa; }
.result-filters .filter { padding: 6px 10px; background: transparent; color: #7b88a0; border-radius: 5px; font-size: 11px; font-weight: 500; }
.result-filters .filter:hover { color: var(--accent); }
.result-filters .filter.active { color: var(--accent); background: #fff; box-shadow: 0 1px 4px #dce3ef; }
.export-actions { display: flex; gap: 6px; }
.export-actions button { padding: 7px 9px; font-size: 11px; }
.export-actions .icon { width: 14px; height: 14px; }
.task-progress { padding: 13px; border: 1px solid #e2eafa; border-radius: 8px; background: #f6f9ff; margin-bottom: 16px; }
.task-progress > div:first-child { display: flex; justify-content: space-between; gap: 10px; font-size: 11px; color: #6c7e9d; margin-bottom: 8px; }
.progress-track { height: 5px; overflow: hidden; border-radius: 8px; background: #e5ecfa; }
.progress-track i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 8px; transition: width .3s; }
.table-wrap { overflow: auto; border: 1px solid var(--border); border-radius: 8px; }
table { width: 100%; border-collapse: collapse; font-size: 12px; table-layout: fixed; }
th, td { text-align: left; vertical-align: top; padding: 14px 12px; border-bottom: 1px solid var(--border); }
th { background: #f7f9fd; color: #7c89a0; font-size: 11px; font-weight: 500; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fafcff; }
.col-number { width: 42px; }
.col-state { width: 110px; }
.col-action { width: 82px; }
.state-badge { display: inline-flex; align-items: center; gap: 5px; border-radius: 5px; padding: 3px 7px; font-size: 10px; font-weight: 500; white-space: nowrap; }
.state-badge::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.state-ok { color: var(--ok); background: #edf8f1; }
.state-fail { color: var(--bad); background: #fff0f0; }
.state-wait { color: var(--wait); background: #fff7e8; }
.state-badge.running::before { animation: blink 1.5s ease-in-out infinite; }
.link { color: #506587; font: 10px/1.8 var(--mono); overflow-wrap: anywhere; }
.result-note { color: #95a0b2; font-size: 11px; overflow-wrap: anywhere; }
.result-note.failed { color: #b36569; }
button.tiny { font-size: 10px; padding: 5px 8px; background: #f0f4fb; color: #4261a3; border-radius: 5px; }
button.tiny:hover { background: #e2eaff; }
.empty { padding: 70px 20px; color: #94a0b2; text-align: center; }
.empty strong, .empty span { display: block; }
.empty strong { font-size: 13px; font-weight: 500; color: #6b7d99; margin-bottom: 7px; }
.empty span { font-size: 11px; }
.portal-footer { text-align: center; color: #9ba6b8; font-size: 10px; margin: 28px 0; }
#app[data-authed="true"] .login-shell { display: none; }
#app[data-authed="false"] .portal-shell { display: none; }
@keyframes blink { 50% { opacity: .25; } }
@media (max-width: 1080px) {
  .workspace-grid { grid-template-columns: 310px minmax(0, 1fr); gap: 16px; }
  .card { padding: 18px; }
  .result-tools { align-items: flex-start; }
  .col-state { width: 90px; }
  .login-shell { min-height: 600px; }
  .login-story { padding: 32px; }
  .story-content h1 { font-size: 32px; }
  .login-panel { padding: 36px; }
}
@media (max-width: 820px) {
  .workspace-grid { grid-template-columns: 1fr; }
  textarea { min-height: 180px; }
  .overview { gap: 10px; }
  .overview-item { padding: 14px; }
  .login-shell { grid-template-columns: .9fr 1fr; width: calc(100% - 40px); }
  .login-story { padding: 28px; }
  .workflow { flex-direction: column; gap: 14px; margin-top: 28px; }
  .workflow-number { display: none; }
  .workflow small { margin-top: 2px; }
  .story-content { padding: 30px 0; }
}
@media (max-width: 600px) {
  .login-shell { display: block; width: calc(100% - 28px); min-height: 0; margin: 22px auto; border-radius: 16px; }
  .login-story { padding: 24px; }
  .story-content { padding: 24px 0 0; }
  .story-content > .eyebrow, .workflow, .story-footer { display: none; }
  .story-content h1 { font-size: 25px; line-height: 1.5; margin-bottom: 8px; }
  .story-content > p { font-size: 11px; }
  .login-panel { padding: 30px 24px; }
  .login-form { max-width: none; }
  .login-form h2 { font-size: 22px; }
  .login-form .lead { margin-bottom: 24px; }
  .portal-header { height: 68px; padding: 0 16px; }
  .portal-header .brand { gap: 8px; font-size: 17px; }
  .portal-header .brand-mark { width: 31px; height: 34px; font-size: 23px; }
  .account-menu { gap: 8px; }
  .account-name { max-width: 85px; font-size: 10px; }
  .account-menu button { padding: 6px 8px; font-size: 10px; }
  .portal-content { width: calc(100% - 28px); margin-top: 24px; }
  .page-heading h1 { font-size: 25px; }
  .page-heading .eyebrow { font-size: 10px; }
  .page-heading .lead { font-size: 12px; }
  .billing-note { display: none; }
  .overview { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 18px; }
  .overview-item { padding: 14px 16px; }
  .overview-item strong { font-size: 25px; }
  .overview-item small { font-size: 9px; }
  .card { padding: 18px 16px; }
  .tag { font-size: 9px; }
  .result-tools { margin-top: 18px; }
  .export-actions { margin-left: auto; }
  .results-heading button { padding: 7px 10px; }
  th, td { padding: 12px 8px; }
  .col-number { width: 28px; }
  .col-state { width: 80px; }
  .col-action { width: 65px; }
  .state-badge { padding: 3px 5px; font-size: 9px; }
  .link { font-size: 9px; }
  .empty { padding: 45px 8px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before { animation: none !important; transition: none !important; } }
