:root {
  --ink: #11131b;
  --muted: #747985;
  --blue: #5962dc;
  --blue-soft: #eef0ff;
  --orange: #4d48d7;
  --orange-dark: #3935b8;
  --line: #dfe2ea;
  --bg: #f5f6fa;
  --white: #fff;
  --violet: #4d3eef;
  --violet-soft: #b9bafa;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; color: var(--ink); background: var(--bg); font: 15px/1.7 -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif; overflow-wrap: anywhere; }
body.login-mode { overflow: hidden; background: #fff; }
header { min-height: 0; padding: 0; display: block; border-bottom: 1px solid var(--line); background: white; }
.header-bar { min-height: 72px; padding: 0 max(22px, calc((100vw - 1160px) / 2)); display: flex; align-items: center; gap: 18px; }
.brand { display: flex; width: 168px; height: 44px; flex: 0 0 auto; align-items: center; color: var(--ink); text-decoration: none; white-space: nowrap; overflow: hidden; }
.brand img { display: block; width: 168px; height: auto; }
.product-name { font-size: 16px; font-weight: 650; white-space: nowrap; }
.beta { padding: 3px 8px; border: 1px solid #e9c7b7; border-radius: 5px; color: var(--orange); font-size: 12px; white-space: nowrap; }
.account-meta { margin-left: auto; display: grid; line-height: 1.25; text-align: right; }
.account-meta span { color: var(--muted); font-size: 11px; }
.account-meta strong { font-size: 14px; font-weight: 650; }
main { max-width: 1160px; margin: 40px auto; padding: 0 22px; }
body.login-mode main { max-width: none; min-height: 100vh; margin: 0; padding: 0; }
#login { display: grid; min-height: 100vh; grid-template-columns: minmax(0, 53%) minmax(0, 47%); grid-template-rows: 1fr auto; background: #fff; }
.login-visual { position: relative; min-height: 0; overflow: hidden; }
.login-pillars { position: absolute; z-index: 1; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; object-position: center bottom; }
.login-logo { position: absolute; z-index: 3; top: clamp(42px,6.5vh,88px); left: clamp(44px,6vw,110px); width: clamp(260px,25vw,430px); height: auto; mix-blend-mode: multiply; }
.login-tagline { position: absolute; z-index: 3; top: 38%; left: clamp(44px,6vw,110px); right: clamp(44px,6vw,110px); display: grid; color: #141620; font-size: clamp(24px,2.15vw,39px); font-weight: 620; line-height: 1.45; letter-spacing: -.02em; }
.login-access { display: grid; min-width: 0; min-height: 0; place-items: safe center; padding: 32px clamp(58px,7vw,130px); overflow: auto; background: rgba(255,255,255,.97); }
.login-form-wrap { width: min(100%,650px); }
.login-form-wrap h1 { margin: 0 0 8px; font-size: clamp(32px,2.55vw,48px); line-height: 1.22; letter-spacing: -.035em; }
.login-subtitle { margin: 0 0 38px; color: var(--muted); font-size: 18px; }
.login-form label { margin: 20px 0 9px; color: #232630; font-size: 14px; font-weight: 650; }
.login-field { position: relative; display: flex; height: 62px; align-items: center; gap: 13px; padding: 0 16px; border: 1px solid #d7dae2; border-radius: 10px; background: #fff; box-shadow: 0 1px 0 rgba(26,29,45,.02); transition: border-color .18s,box-shadow .18s; }
.login-field:focus-within { border-color: #7774e8; box-shadow: 0 0 0 4px rgba(82,76,222,.10); }
.login-field input { min-width: 0; height: 100%; margin: 0; padding: 0; border: 0; outline: 0; background: transparent; font-size: 16px; }
.login-field input::placeholder { color: #a2a5af; }
.field-icon { flex: 0 0 21px; width: 21px; height: 23px; color: #8b909d; }
.field-icon svg { display: block; width: 21px; height: 23px; }
.password-toggle { flex: 0 0 auto; min-height: auto; padding: 7px 5px; border: 0; color: #5c606b; background: transparent; font-size: 12px; font-weight: 600; white-space: nowrap; }
.password-toggle:hover { color: var(--violet); background: transparent; }
.login-error { min-height: 25px; margin: 9px 0 0; color: #a13e35; font-size: 13px; }
.login-submit { width: 100%; min-height: 58px; margin-top: 14px; border: 0; border-radius: 10px; background: linear-gradient(100deg,#4436d5,#4234c8 55%,#3426b8); box-shadow: 0 12px 26px rgba(60,48,190,.17); font-size: 17px; }
.login-submit:hover { background: linear-gradient(100deg,#3d31c4,#3326b3); }
.first-use { margin: 20px 0 0; color: var(--muted); font-size: 13px; }
.first-use strong { color: #5a59cb; font-weight: 650; }
.secure-note { display: flex; margin-top: 28px; align-items: center; gap: 10px; color: #5c606b; font-size: 13px; }
.secure-note strong { color: #5c606b; font-weight: 650; }
.login-footer { z-index: 4; grid-column: 1 / -1; display: flex; min-height: 72px; padding: 16px clamp(34px,5vw,84px) 16px; margin-bottom: env(safe-area-inset-bottom, 0px); align-items: center; justify-content: space-between; gap: 24px; border-top: 1px solid rgba(37,41,65,.07); color: #6e737f; background: rgba(249,250,253,.96); font-size: 12px; }
.login-footer span:last-child { color: #5c606b; font-size: 12px; letter-spacing: .12em; }
h1 { margin: 12px 0 22px; font-size: 34px; line-height: 1.4; font-weight: 650; letter-spacing: -.02em; }
h2 { margin: 0 0 18px; font-size: 22px; line-height: 1.4; }
h3 { margin: 24px 0 12px; font-size: 17px; }
.intro p { max-width: 540px; color: #50616d; font-size: 17px; }
.route { margin: 28px 0; padding: 12px 16px; border: 1px solid #d5dcf8; border-radius: 8px; }
.route span { display: block; padding: 6px 0; color: var(--blue); font-weight: 600; }
.subtle, .help { color: var(--muted) !important; font-size: 13px !important; }
.panel { padding: 26px; border: 1px solid var(--line); border-radius: 12px; background: white; }
.panel + .panel { margin-top: 22px; }
label { display: block; margin: 14px 0 6px; font-weight: 550; }
input, textarea, select, button { font: inherit; }
input, textarea, select { width: 100%; margin-top: 6px; padding: 10px 12px; border: 1px solid #bdc9d1; border-radius: 7px; color: var(--ink); background: #fff; }
textarea { min-height: 100px; resize: vertical; }
input[type=checkbox] { width: auto; margin-right: 7px; accent-color: var(--orange); }
button { min-height: 44px; padding: 9px 16px; border: 1px solid #cdd7dd; border-radius: 7px; color: var(--ink); background: #fff; font-weight: 550; cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
button:hover { background: #eef3f6; }
button:disabled { opacity: .52; cursor: not-allowed; }
.primary { border-color: var(--orange); color: #fff; background: var(--orange); }
.primary:hover { background: var(--orange-dark); }
a { color: var(--blue); text-underline-offset: 4px; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible { outline: 3px solid #327da6; outline-offset: 3px; }
#notice { position: sticky; top: 0; z-index: 10; display: none; padding: 12px 22px; border-bottom: 1px solid #b8d6e4; background: var(--blue-soft); text-align: center; }
#notice.error { border-color: #e9c7b7; color: #8e3416; background: #fff1e9; }
.workspace-top { display: flex; align-items: center; justify-content: space-between; gap: 25px; }
.workspace-top h1 { margin: 5px 0 12px; font-size: 28px; }
.device-status { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin: 4px 0 16px; color: var(--muted); font-size: 12px; }
.device-status strong, .device-status span { padding: 4px 8px; border: 1px solid var(--line); border-radius: 999px; background: white; }
.device-status .ready { border-color: #b8d6c8; color: #30634d; background: #edf5f1; }
.device-status .blocked { border-color: #e9c7b7; color: #8e3416; background: #fff1e9; }
nav { display: flex; gap: 4px; margin: 0; padding: 0 max(22px, calc((100vw - 1160px) / 2)); overflow-x: auto; border-bottom: 0; }
nav button, nav a { flex: 0 0 auto; display: inline-flex; align-items: center; min-height: 44px; padding: 8px 14px; border: 0; border-bottom: 2px solid transparent; border-radius: 0; color: var(--ink); background: transparent; font-weight: 550; text-decoration: none; }
nav button:hover, nav a:hover { background: transparent; color: var(--ink); }
nav button[aria-current=page] { color: var(--ink); background: transparent; border-bottom-color: var(--ink); font-weight: 700; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin: 20px 0 5px; }
.actions a { display: inline-flex; min-height: 44px; align-items: center; padding: 9px 16px; border: 1px solid #cdd7dd; border-radius: 7px; color: var(--ink); background: #fff; font-weight: 550; text-decoration: none; }
.task-list { display: grid; gap: 12px; }
.task-row { display: flex; justify-content: space-between; gap: 20px; padding: 20px; border: 1px solid var(--line); border-radius: 10px; background: white; }
.task-row h3 { margin: 0 0 6px; }
.task-row button { align-self: center; }
.tag { padding: 3px 8px; border-radius: 4px; color: var(--blue); background: #eaf1f5; font-size: 12px; }
.warn { margin: 15px 0; padding: 14px 16px; border: 1px solid #e4c48a; border-radius: 8px; background: #fff6e8; }
.ok { margin: 15px 0; padding: 14px 16px; border: 1px solid #b7d4c6; border-radius: 8px; background: #edf5f1; }
.empty { padding: 40px 22px; border: 1px dashed #cad5dd; background: white; text-align: center; }
.files { padding-left: 18px; }
.files li { margin: 8px 0; }
.files button { min-height: 36px; margin-left: 6px; padding: 5px 10px; }
.progress { height: 7px; overflow: hidden; border-radius: 4px; background: #e2e8ec; }
.progress span { display: block; height: 100%; background: var(--blue); }
.task-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; margin: 20px 0; }
.task-heading h2 { margin: 0; }
.task-heading small { color: var(--muted); word-break: break-all; }
.section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.section-heading h3 { margin: 4px 0 12px; font-size: 21px; }
.intake-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 22px 0 14px; }
.intake-option { display: flex; min-width: 0; min-height: 112px; margin: 0; padding: 14px; flex-direction: column; align-items: flex-start; justify-content: center; border: 1px solid #cdd7dd; border-radius: 10px; color: var(--ink); background: #f9fbfc; cursor: pointer; text-align: left; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; touch-action: manipulation; }
.intake-option:hover { border-color: #94b2c1; background: #edf4f6; }
.intake-option strong { margin-top: 8px; line-height: 1.35; }
.intake-option small { margin-top: 4px; color: var(--muted); font-size: 11px; font-weight: 450; line-height: 1.45; }
.intake-mark { display: inline-grid; width: 30px; height: 30px; place-items: center; border-radius: 50%; color: white; background: var(--blue); font-size: 13px; }
.record { border-color: #e1b8a7; color: var(--orange-dark); background: #fff8f4; touch-action: none; }
.record .intake-mark { background: var(--orange); }
.record.active { border-color: #a9361e; color: white; background: #b33e24; }
.record.active .intake-mark { color: #b33e24; background: white; }
.record.active small { color: #fff0e9; }
.record-controls { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-height: 44px; }
.record-controls .help { flex: 1 1 360px; margin: 0; }
.upload-state { min-height: 24px; color: var(--blue); font-size: 13px; }
.intake-panel[aria-busy=true] .intake-grid { opacity: .58; pointer-events: none; }
.visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; margin: -1px !important; padding: 0 !important; overflow: hidden !important; clip: rect(0 0 0 0) !important; white-space: nowrap !important; border: 0 !important; }
.table-wrap { max-width: 100%; overflow-x: auto; overscroll-behavior-inline: contain; -webkit-overflow-scrolling: touch; }
table { width: 100%; min-width: 650px; border-collapse: collapse; font-size: 14px; }
th, td { padding: 12px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { background: #edf2f5; font-weight: 550; white-space: nowrap; }
td.money { font-variant-numeric: tabular-nums; white-space: nowrap; }
.cost-row { display: grid; grid-template-columns: 110px 1fr 1fr; gap: 10px; align-items: end; margin: 10px 0; }
.cost-row label { margin: 0; }
.cost-row .label { align-self: center; }
.version { color: var(--muted); font: 12px/1.6 ui-monospace, monospace; word-break: break-all; }
details { padding: 15px 0; border-top: 1px solid var(--line); }
summary { font-weight: 600; cursor: pointer; }
pre { padding: 15px; color: var(--ink); background: #f5f7f9; font: 14px/1.7 inherit; white-space: pre-wrap; word-break: break-word; }
footer { padding: 24px 24px calc(24px + var(--safe-bottom)); border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; text-align: center; }
[hidden] { display: none !important; }
@media (max-width: 760px) {
  body.login-mode { overflow: auto; }
  header { padding: 0; }
  .header-bar { min-height: 64px; padding: 0 16px; gap: 10px; }
  .brand { width: 128px; height: 36px; }
  .brand img { width: 128px; }
  .product-name { max-width: 42vw; overflow: hidden; text-overflow: ellipsis; font-size: 15px; }
  main { margin: 22px auto; padding: 0 14px; }
  body.login-mode main { min-height: 100vh; }
  #login { min-height: 100vh; grid-template-columns: 1fr; grid-template-rows: 255px 1fr auto; }
  .login-visual { border: 0; }
  .login-logo { top: 26px; left: 28px; width: min(72vw,330px); }
  .login-pillars { object-position: 64% bottom; }
  .login-tagline { top: 126px; left: 30px; right: 24px; font-size: clamp(20px,5.8vw,28px); line-height: 1.35; }
  .login-access { place-items: start center; padding: 42px 24px 56px; }
  .login-form-wrap { max-width: 520px; }
  .login-form-wrap h1 { font-size: 32px; }
  .login-subtitle { margin-bottom: 28px; font-size: 16px; }
  .login-field { height: 56px; }
  .secure-note { margin-top: 40px; }
  .login-footer { grid-column: 1; min-height: 80px; padding: 16px 24px 16px; flex-direction: column; align-items: flex-start; justify-content: center; gap: 8px; }
  .panel { padding: 18px; border-radius: 10px; }
  .grid { grid-template-columns: 1fr; gap: 4px; }
  .workspace-top { display: block; }
  .workspace-top h1 { margin-bottom: 5px; }
  .device-status { margin-top: 10px; }
  .task-row { display: block; padding: 17px; }
  .task-row button { width: 100%; margin-top: 10px; }
  .task-heading { display: block; }
  .task-heading .tag { display: inline-block; margin-top: 10px; }
  .section-heading { display: block; }
  .section-heading button { width: 100%; margin-top: 4px; }
  .intake-grid { grid-template-columns: 1fr 1fr; }
  .intake-option { min-height: 124px; padding: 13px; }
  .record-controls button { flex: 1 1 130px; }
  .record-controls .help { flex-basis: 100%; }
  .cost-row { grid-template-columns: 1fr; gap: 3px; padding: 12px 0; border-bottom: 1px solid var(--line); }
  .cost-row .label { font-weight: 650; }
  nav { padding: 0 16px; white-space: nowrap; -webkit-overflow-scrolling: touch; }
  h2 { font-size: 20px; }
  input, textarea, select { min-height: 46px; font-size: 16px; }
  textarea { min-height: 120px; }
  .actions > button, .actions > a { flex-grow: 1; text-align: center; }
  .files { padding-left: 20px; }
  .files button { display: block; width: 100%; margin: 6px 0 0; }
  #notice { padding-right: 14px; padding-left: 14px; }
}
@media (max-width: 420px) {
  .header-bar { flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; }
  .account-meta { margin-left: auto; }
  header #logout { margin-left: 0; }
  #login { grid-template-rows: 225px 1fr auto; }
  .login-logo { left: 21px; width: 310px; max-width: 82vw; }
  .login-tagline { top: 116px; left: 23px; right: 20px; font-size: 21px; }
  .login-access { padding: 34px 20px 44px; }
  .login-form-wrap h1 { font-size: 29px; }
  .secure-note { align-items: flex-start; }
  .intake-grid { gap: 8px; }
  .intake-option { min-height: 132px; }
  .device-status span { max-width: 100%; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; } }
