:root {
  --ink: #17231f;
  --ink-2: #34443e;
  --muted: #697872;
  --line: #dce5e1;
  --line-strong: #c4d0cb;
  --paper: #f4f7f8;
  --panel: #ffffff;
  --green: #087f5b;
  --green-dark: #056747;
  --green-soft: #e7f5ef;
  --coral: #d95740;
  --coral-soft: #fff0ec;
  --blue: #2768b2;
  --blue-soft: #edf5ff;
  --gold: #9a6a13;
  --gold-soft: #fff8e7;
  --shadow: 0 10px 30px rgba(24, 48, 40, .07);
  --radius: 8px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-height: 100%; }
body {
  min-height: 100vh;
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.65;
  letter-spacing: 0;
  display: flex;
  flex-direction: column;
}
body > main { flex: 1 0 auto; }
body > header, body > footer { flex: 0 0 auto; }
html { scroll-behavior: smooth; }
section[id] { scroll-margin-top: 88px; }
:focus-visible { outline: 3px solid #3b9b77; outline-offset: 4px; }
h1, h2, h3, strong { text-wrap: pretty; }
h1, h2, h3 { font-weight: 780; }
p { text-wrap: pretty; }
button, input, select, textarea { font: inherit; letter-spacing: 0; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: var(--green); }
svg { width: 18px; height: 18px; }
.muted { color: var(--muted); }
.text-danger { color: #b33e2d; }
.text-success { color: var(--green); }
.nowrap { white-space: nowrap; }
.inline-form { display: inline; margin: 0; }

.app-header { position: sticky; top: 0; z-index: 40; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.96); }
.header-inner { width: min(1180px, calc(100% - 32px)); min-height: 68px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; flex: 0 0 auto; }
.brand-mark { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 7px; background: var(--ink); color: #fff; font-family: Georgia, serif; font-size: 14px; }
.brand-copy { display: grid; line-height: 1.2; }
.brand-copy strong { font-size: 16px; }
.brand-copy small { margin-top: 3px; color: var(--muted); font-size: 10px; font-weight: 400; }
.main-nav, .guest-nav { display: flex; align-items: center; gap: 8px; }
.main-nav > a { display: inline-flex; align-items: center; gap: 7px; padding: 8px 10px; color: var(--muted); border-radius: 6px; text-decoration: none; font-size: 14px; }
.main-nav > a:hover, .main-nav > a.active { background: var(--green-soft); color: var(--green); }
.nav-points { display: inline-flex; align-items: center; gap: 6px; margin-left: 7px; padding: 6px 10px; background: var(--gold-soft); color: var(--gold); border-radius: 6px; font-size: 13px; }
.user-name { max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 700; }
.guest-nav > a:not(.button) { padding: 8px 10px; color: var(--ink); text-decoration: none; }
.mobile-nav-toggle { display: none !important; }

.icon-button { width: 38px; height: 38px; padding: 0; display: inline-grid; place-items: center; border: 1px solid transparent; border-radius: 6px; background: transparent; color: var(--muted); cursor: pointer; }
.icon-button:hover { border-color: var(--line); background: var(--paper); color: var(--ink); }
.button { min-height: 42px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 8px 16px; border: 1px solid var(--line-strong); border-radius: 6px; background: #fff; color: var(--ink); text-decoration: none; font-weight: 700; cursor: pointer; transition: transform .18s ease, border-color .18s ease, background .18s ease, box-shadow .18s ease; }
.button:hover { border-color: #8ca39a; background: #fafcfb; transform: translateY(-1px); box-shadow: 0 7px 18px rgba(24,48,40,.08); }
.button.primary { border-color: var(--green); background: var(--green); color: #fff; }
.button.primary:hover { border-color: var(--green-dark); background: var(--green-dark); box-shadow: 0 9px 22px rgba(8,127,91,.22); }
.button.danger { border-color: #efc6bd; color: #a63b29; background: #fff; }
.button.small { min-height: 34px; padding: 5px 11px; font-size: 13px; }
.button.full { width: 100%; }
.button:disabled { opacity: .55; cursor: not-allowed; }
.button:disabled:hover { transform: none; box-shadow: none; }
.button-spinner { animation: spin 1s linear infinite; }
.text-link { display: inline-flex; align-items: center; gap: 8px; margin-top: 25px; color: var(--green); text-decoration: none; font-size: 14px; font-weight: 700; }
.text-link:hover { text-decoration: underline; text-underline-offset: 4px; }

.flash-stack { position: fixed; z-index: 80; top: 84px; right: 24px; width: min(350px, calc(100% - 48px)); display: grid; gap: 9px; pointer-events: none; }
.flash { display: grid; grid-template-columns: 22px minmax(0,1fr) 26px; align-items: start; gap: 10px; padding: 13px 11px 13px 13px; border: 1px solid var(--line); border-radius: 7px; background: #fff; box-shadow: 0 14px 36px rgba(24,48,40,.14); pointer-events: auto; animation: toast-in .22s ease-out both; transition: opacity .18s ease, transform .18s ease; }
.flash.is-leaving { opacity: 0; transform: translateY(-8px); }
.flash-icon { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; background: var(--blue-soft); color: var(--blue); }
.flash-icon svg { width: 15px; height: 15px; }
.flash.success .flash-icon { background: var(--green-soft); color: var(--green); }
.flash.error .flash-icon { background: var(--coral-soft); color: var(--coral); }
.flash-message { min-width: 0; padding-top: 1px; color: var(--ink-2); font-size: 13px; line-height: 1.65; overflow-wrap: anywhere; }
.flash button { width: 26px; height: 26px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 5px; background: transparent; color: var(--muted); cursor: pointer; }
.flash button:hover { background: var(--paper); color: var(--ink); }
.flash button svg { width: 15px; height: 15px; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }

.page-shell { width: min(1180px, calc(100% - 32px)); margin: 0 auto; padding: 34px 0 70px; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 25px; }
.page-heading h1 { margin: 0 0 7px; font-size: 30px; line-height: 1.25; }
.page-heading p { margin: 0; color: var(--muted); }
.eyebrow { margin: 0 0 7px; color: var(--green); font-size: 12px; font-weight: 800; text-transform: uppercase; }
.eyebrow:has(svg) { display: flex; align-items: center; gap: 6px; }
.eyebrow svg { width: 15px; height: 15px; }
.page-heading .eyebrow { margin-bottom: 10px; color: var(--green); }
.heading-with-icon { display: flex; align-items: center; gap: 10px; }
.heading-with-icon > span { width: 32px; height: 32px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 6px; background: var(--green-soft); color: var(--green); }
.heading-with-icon > span svg { width: 17px; height: 17px; }

.auth-page { background: #f4f7f8; }
.auth-page .app-header { position: static; }
.auth-shell { width: min(1080px, calc(100% - 32px)); min-height: calc(100vh - 137px); margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1fr) 430px; align-items: center; gap: 72px; padding: 48px 0; }
.auth-context { max-width: 520px; }
.auth-context h1 { margin: 0 0 18px; font-size: clamp(34px, 5vw, 58px); line-height: 1.15; }
.auth-context > p { max-width: 470px; margin: 0; color: var(--muted); font-size: 17px; }
.auth-context > .eyebrow { margin: 0 0 17px; color: var(--green); font-size: 12px; letter-spacing: .08em; }
.auth-points { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 35px; }
.auth-point { border-top: 3px solid var(--green); padding-top: 12px; color: var(--ink-2); font-size: 13px; }
.auth-point:nth-child(2) { border-color: var(--blue); }
.auth-point:nth-child(3) { border-color: var(--coral); }
.auth-point strong { display: block; margin-bottom: 4px; font-size: 15px; color: var(--ink); }
.auth-point > svg { width: 22px; height: 22px; display: block; margin-bottom: 12px; color: var(--green); }
.auth-point:nth-child(2) > svg { color: var(--blue); }
.auth-point:nth-child(3) > svg { color: var(--coral); }
.auth-journey { display: grid; gap: 0; max-width: 390px; margin-top: 30px; padding: 0; list-style: none; }
.auth-journey li { display: flex; align-items: center; gap: 13px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.auth-journey li > span { display: grid; place-items: center; width: 36px; height: 36px; flex: 0 0 auto; border-radius: 10px; background: #e7f1ec; color: var(--green); }
.auth-journey strong { display: block; font-size: 14px; }
.auth-journey small { display: block; color: var(--muted); font-size: 12px; }
.auth-card { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; padding: 30px; box-shadow: var(--shadow); }
.auth-card h2 { margin: 0 0 3px; font-size: 24px; line-height: 1.25; }
.auth-card > p { margin: 0 0 23px; color: var(--muted); }
.auth-card-heading { display: flex; align-items: center; gap: 13px; margin-bottom: 24px; }
.auth-card-heading > span { width: 46px; height: 46px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 7px; background: var(--green-soft); color: var(--green); }
.auth-card-heading > span svg { width: 22px; height: 22px; }
.auth-card-heading p { margin: 0; color: var(--muted); font-size: 13px; }
.auth-card-note { padding: 13px 14px; border-left: 3px solid var(--blue); background: var(--blue-soft); color: var(--ink-2) !important; }
.verification-mail { display: flex; align-items: center; gap: 12px; margin: -8px 0 20px; padding: 13px; border: 1px solid #cfe4da; border-radius: 7px; background: #f3faf7; color: var(--green); }
.verification-mail > svg { flex: 0 0 auto; }
.verification-mail span, .verification-mail strong, .verification-mail small { display: block; }
.verification-mail span { min-width: 0; color: var(--muted); font-size: 12px; }
.verification-mail strong { overflow: hidden; color: var(--ink); font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.auth-footer { margin: 20px 0 0 !important; text-align: center; font-size: 14px; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { margin-bottom: 16px; }
.form-grid .field { margin-bottom: 0; }
.field label { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; color: var(--ink-2); font-size: 13px; font-weight: 700; }
.field label svg { width: 14px; height: 14px; color: var(--green); }
.field input, .field select, .field textarea { width: 100%; min-height: 44px; border: 1px solid var(--line-strong); border-radius: 6px; background: #fff; color: var(--ink); padding: 9px 12px; outline: none; }
.field textarea { min-height: 100px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(8,127,91,.1); }
.input-wrap { position: relative; }
.input-wrap input { padding-right: 46px; }
.input-wrap.has-prefix input { padding-left: 42px; }
.input-prefix { position: absolute; z-index: 1; top: 13px; left: 13px; width: 17px; height: 17px; color: #87958f; pointer-events: none; }
.input-action { position: absolute; top: 3px; right: 3px; width: 38px; height: 38px; display: grid; place-items: center; border: 0; background: transparent; color: var(--muted); cursor: pointer; }
.field-hint { display: block; margin-top: 5px; color: var(--muted); font-size: 12px; }
.form-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 2px 0 18px; font-size: 13px; }
.check { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--green); }
.error-list { margin: 0 0 18px; padding: 12px 14px 12px 34px; border: 1px solid #f0c8c0; border-radius: 6px; background: var(--coral-soft); color: #963c2d; font-size: 13px; }
.code-input { text-align: center; font-size: 27px !important; font-weight: 700; letter-spacing: 8px !important; }

.home-page { background: #fff; }
.home-page .app-header { position: absolute; inset: 0 0 auto; border-bottom-color: rgba(255,255,255,.18); background: rgba(13,29,24,.88); }
.home-page .brand, .home-page .guest-nav > a:not(.button), .home-page .main-nav > a, .home-page .user-name { color: #fff; }
.home-page .brand-copy small { color: #bfd0ca; }
.home-page .brand-mark { background: #fff; color: var(--ink); }
.home-page .main-nav > a:hover, .home-page .main-nav > a.active { background: rgba(255,255,255,.12); color: #fff; }
.home-page .mobile-nav-toggle, .home-page .main-nav .icon-button { color: #fff; }
.home-page .app-footer { border-top-color: #cad6d1; }
.home-hero { position: relative; min-height: 690px; overflow: hidden; background-color: #18342b; background-image: var(--home-image); background-size: cover; background-position: center center; }
.home-hero-shade { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(8,25,20,.92) 0%, rgba(8,25,20,.83) 38%, rgba(8,25,20,.42) 67%, rgba(8,25,20,.24) 100%); }
.home-hero-inner { position: relative; z-index: 1; width: min(1180px, calc(100% - 32px)); min-height: 690px; margin: 0 auto; padding-top: 128px; padding-bottom: 52px; display: flex; align-items: flex-start; flex-direction: column; justify-content: center; color: #fff; }
.home-kicker { display: flex; align-items: center; gap: 8px; margin: 0 0 18px; color: #a9e2cc; font-size: 13px; font-weight: 700; letter-spacing: .06em; }
.home-kicker svg { width: 17px; height: 17px; }
.home-hero h1 { max-width: 850px; margin: 0; color: #fff; font-size: clamp(42px, 7vw, 78px); line-height: 1.08; }
.home-hero-tagline { margin: 18px 0 0; color: #e0f1e9; font-size: clamp(24px,3vw,34px); line-height: 1.4; font-weight: 600; letter-spacing: .03em; }
.home-lead { max-width: 590px; margin: 18px 0 0; color: #c2d0ca; font-size: 16px; line-height: 1.9; }
.home-actions { display: flex; align-items: center; gap: 11px; margin-top: 28px; }
.home-primary { min-height: 48px; padding-inline: 20px; }
.home-secondary { min-height: 48px; border-color: rgba(255,255,255,.35); background: transparent; color: #fff; }
.home-secondary:hover { border-color: #fff; background: rgba(255,255,255,.08); }
.home-facts { display: flex; gap: 0; margin-top: 30px; border-top: 1px solid rgba(255,255,255,.22); border-bottom: 1px solid rgba(255,255,255,.22); }
.home-facts > span { display: flex; align-items: center; gap: 9px; padding: 12px 22px; color: #c7d6d1; font-size: 13px; }
.home-facts > span:first-child { padding-left: 0; }
.home-facts > span + span { border-left: 1px solid rgba(255,255,255,.22); }
.home-facts > span > svg { width: 19px; height: 19px; flex: 0 0 auto; color: #9fe1c8; }
.home-facts > span > span { display: block; }
.home-facts strong { color: #fff; }
.home-section-inner { width: min(1180px, calc(100% - 32px)); margin: 0 auto; }
.home-start-band { background: #fff; border-bottom: 1px solid var(--line); }
.home-start-inner { min-height: 170px; display: grid; grid-template-columns: minmax(0,1fr) minmax(360px,520px); align-items: center; gap: 50px; }
.home-start-inner h2, .home-section-heading h2, .home-final-inner h2 { margin: 0; font-size: clamp(24px, 3vw, 36px); line-height: 1.35; }
.home-upload-command { min-width: 0; display: grid; grid-template-columns: 48px minmax(0,1fr) 24px; align-items: center; gap: 14px; padding: 16px; border: 1px dashed #9eb3ab; border-radius: 7px; background: #f8fbfa; color: var(--ink); text-decoration: none; }
.home-upload-command:hover { border-color: var(--green); background: var(--green-soft); }
.home-upload-command > svg { color: var(--green); }
.home-upload-command strong, .home-upload-command small { display: block; }
.home-upload-command small { margin-top: 2px; color: var(--muted); }
.home-upload-icon { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 6px; background: var(--green); color: #fff; }
.home-upload-icon svg { width: 23px; height: 23px; }
.home-process-band { padding: 82px 0 88px; background: var(--paper); }
.home-section-heading { max-width: 680px; }
.home-section-heading > p:not(.eyebrow) { margin: 16px 0 0; color: var(--muted); font-size: 15px; }
.home-process { display: grid; grid-template-columns: repeat(4,1fr); gap: 28px; margin-top: 43px; }
.home-process-item { position: relative; min-width: 0; padding-top: 19px; border-top: 3px solid var(--green); }
.home-process-item:nth-child(2) { border-color: var(--blue); }
.home-process-item:nth-child(3) { border-color: var(--coral); }
.home-process-item:nth-child(4) { border-color: var(--gold); }
.home-process-item > span { position: absolute; top: 16px; right: 0; color: #a6b3ae; font-size: 12px; font-weight: 800; }
.home-process-item > svg { width: 28px; height: 28px; color: var(--green); }
.home-process-item:nth-child(2) > svg { color: var(--blue); }
.home-process-item:nth-child(3) > svg { color: var(--coral); }
.home-process-item:nth-child(4) > svg { color: var(--gold); }
.home-process-item h3 { margin: 16px 0 7px; font-size: 18px; }
.home-process-item p { margin: 0; color: var(--muted); font-size: 14px; }
.home-final-band { padding: 48px 0; background: var(--green-soft); border-top: 1px solid #c9e3d9; }
.home-final-inner { display: flex; align-items: center; justify-content: space-between; gap: 30px; }
.home-final-inner .eyebrow { margin-bottom: 5px; }
.home-final-inner .button { flex: 0 0 auto; }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(310px, .6fr); gap: 22px; align-items: start; }
.panel { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 19px 21px; border-bottom: 1px solid var(--line); }
.panel-head h2, .panel-head h3 { margin: 0; font-size: 18px; }
.panel-body { padding: 21px; }
.balance-panel { overflow: hidden; }
.balance-band { display: flex; justify-content: space-between; gap: 20px; padding: 24px; background: var(--ink); color: #fff; }
.balance-number small { display: block; color: #adc0b9; font-size: 12px; }
.balance-number strong { font-size: 37px; line-height: 1.15; }
.cost-note { align-self: center; color: #d7e1dd; text-align: right; font-size: 13px; }
.cost-note strong { color: #9fe1c8; }
.upload-form { padding: 21px; }
.dropzone { position: relative; min-height: 265px; border: 1.5px dashed #aabbb4; border-radius: 7px; display: grid; place-items: center; background: #fbfcfc; overflow: hidden; transition: .18s ease; }
.dropzone:hover, .dropzone.dragging { border-color: var(--green); background: var(--green-soft); }
.dropzone input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; z-index: 2; }
.dropzone-content { text-align: center; padding: 25px; pointer-events: none; }
.upload-icon { width: 52px; height: 52px; margin: 0 auto 13px; display: grid; place-items: center; border-radius: 50%; background: var(--green-soft); color: var(--green); }
.upload-icon svg { width: 24px; height: 24px; }
.dropzone-content strong { display: block; font-size: 17px; }
.dropzone-content span { display: block; margin-top: 5px; color: var(--muted); font-size: 13px; }
.upload-preview { display: none; position: absolute; inset: 0; z-index: 3; background: #fff; }
.upload-preview.visible { display: grid; grid-template-rows:minmax(0,1fr) auto; }
.upload-preview img { width: 100%; height: 100%; min-height: 200px; object-fit: contain; background: #eef2f0; }
.preview-meta { min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 12px; border-top: 1px solid var(--line); }
.preview-meta span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.upload-guidance { display: grid; grid-template-columns: minmax(210px,.78fr) minmax(0,1.22fr); gap: 20px; margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--line); }
.upload-example { min-width: 0; }
.upload-example-trigger { position: relative; width: 100%; display: block; padding: 0; overflow: hidden; border: 1px solid var(--line-strong); border-radius: 6px; background: #fff; cursor: zoom-in; }
.upload-example-trigger img { width: 100%; height: auto; aspect-ratio: 1108 / 471; display: block; object-fit: contain; background: #f4f6f5; }
.upload-example-trigger > span { position: absolute; right: 8px; bottom: 8px; min-height: 30px; display: inline-flex; align-items: center; gap: 5px; padding: 4px 8px; border-radius: 5px; background: rgba(17,38,31,.9); color: #fff; font-size: 11px; font-weight: 700; }
.upload-example-trigger > span svg { width: 14px; height: 14px; }
.upload-example > p { margin: 9px 0 0; }
.upload-example > p strong, .upload-example > p span { display: block; }
.upload-example > p strong { font-size: 13px; }
.upload-example > p span { margin-top: 2px; color: var(--muted); font-size: 12px; line-height: 1.65; }
.upload-guidance-title { display: flex; align-items: flex-start; gap: 10px; }
.upload-guidance-title > span { width: 34px; height: 34px; flex: 0 0 34px; display: grid; place-items: center; border-radius: 6px; background: var(--green-soft); color: var(--green); }
.upload-guidance-title > span svg { width: 18px; height: 18px; }
.upload-guidance-title h2 { margin: 0; font-size: 16px; }
.upload-guidance-title p { margin: 2px 0 0; color: var(--muted); font-size: 12px; }
.upload-checklist ul { display: grid; gap: 7px; margin: 14px 0 0; padding: 0; list-style: none; }
.upload-checklist li { display: grid; grid-template-columns: 18px minmax(0,1fr); gap: 7px; color: var(--muted); font-size: 12px; line-height: 1.55; }
.upload-checklist li > svg { width: 16px; height: 16px; margin-top: 1px; color: var(--green); }
.upload-checklist li strong { color: var(--ink-2); }
.upload-warning { display: grid; grid-template-columns: 22px minmax(0,1fr); gap: 9px; margin-top: 13px; padding: 10px 11px; border-left: 3px solid #e86624; background: #fff7f1; }
.upload-warning > svg { width: 19px; height: 19px; color: #c95017; }
.upload-warning p { margin: 0; }
.upload-warning strong, .upload-warning span { display: block; }
.upload-warning strong { color: #8f3815; font-size: 13px; }
.upload-warning span { margin-top: 2px; color: #735548; font-size: 12px; line-height: 1.6; }
.upload-actions { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 16px; }
.upload-rules { color: var(--muted); font-size: 12px; }
.upload-rules strong { color: var(--ink-2); }
.upload-example-dialog { width: min(94vw,1160px); max-height: 92vh; padding: 0; overflow: hidden; border: 0; border-radius: 8px; background: #fff; box-shadow: 0 24px 80px rgba(0,0,0,.28); }
.upload-example-dialog::backdrop { background: rgba(13,27,23,.76); }
.upload-example-dialog-head { min-height: 62px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 12px 10px 18px; border-bottom: 1px solid var(--line); }
.upload-example-dialog-head strong, .upload-example-dialog-head span { display: block; }
.upload-example-dialog-head strong { font-size: 15px; }
.upload-example-dialog-head span { margin-top: 2px; color: var(--muted); font-size: 12px; }
.dialog-icon-button { width: 40px; height: 40px; flex: 0 0 40px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 5px; background: transparent; color: var(--ink); cursor: pointer; }
.dialog-icon-button:hover { background: #eef4f1; }
.dialog-icon-button svg { width: 21px; height: 21px; }
.upload-example-dialog-body { max-height: calc(92vh - 62px); overflow: auto; padding: 18px; background: #eef2f0; }
.upload-example-dialog-body img { width: 100%; height: auto; display: block; background: #fff; }

.stats-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 22px; }
.stat { min-height: 106px; padding: 17px; border: 1px solid var(--line); border-radius: 7px; background: #fff; }
.stat-icon { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 6px; background: var(--green-soft); color: var(--green); }
.stat:nth-child(2) .stat-icon { background: var(--blue-soft); color: var(--blue); }
.stat:nth-child(3) .stat-icon { background: var(--gold-soft); color: var(--gold); }
.stat strong { display: block; margin-top: 10px; font-size: 24px; line-height: 1; }
.stat span { color: var(--muted); font-size: 12px; }

.problem-list { display: grid; }
.problem-row { display: grid; grid-template-columns: 52px minmax(0,1fr) auto; gap: 14px; align-items: center; padding: 15px 20px; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.problem-row:last-child { border-bottom: 0; }
.problem-row:hover { background: #fafcfb; }
.problem-thumb { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 6px; background: var(--paper); color: var(--muted); }
.problem-title { min-width: 0; }
.problem-title strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.problem-title span { color: var(--muted); font-size: 12px; }
.status { display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px; border-radius: 5px; background: var(--paper); color: var(--muted); font-size: 12px; font-weight: 700; white-space: nowrap; }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #97a59f; }
.status.queued::before, .status.processing::before { background: var(--blue); }
.status.processing::before { animation: pulse 1.4s infinite; }
.status.completed::before { background: var(--green); }
.status.non_math::before, .status.failed::before { background: var(--coral); }
@keyframes pulse { 50% { opacity: .25; transform: scale(.75); } }
.empty { padding: 45px 20px; text-align: center; color: var(--muted); }
.empty svg { width: 35px; height: 35px; margin-bottom: 9px; }

.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 22px; align-items: start; }
.image-viewer { min-height: 430px; display: grid; place-items: center; background: #e9eeec; border-radius: 7px; overflow: hidden; }
.image-viewer img { display: block; max-width: 100%; max-height: 680px; object-fit: contain; }
.processing-panel { text-align: center; padding: 42px 25px; }
.processing-ring { width: 64px; height: 64px; margin: 0 auto 18px; border: 5px solid #dfe9e5; border-top-color: var(--green); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.processing-panel h2 { margin: 0 0 8px; font-size: 21px; }
.processing-panel p { margin: 0; color: var(--muted); }
.progress-steps { margin: 25px 0 0; text-align: left; }
.progress-step { display: flex; gap: 11px; padding: 9px 0; color: var(--muted); font-size: 13px; }
.progress-step > span { width: 23px; height: 23px; flex: 0 0 auto; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; }
.progress-step.done { color: var(--ink); }
.progress-step.done > span { border-color: var(--green); background: var(--green); color: #fff; }
.detail-meta { margin: 0; }
.detail-meta div { display: grid; grid-template-columns: 90px minmax(0,1fr); gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.detail-meta div:last-child { border-bottom: 0; }
.detail-meta dt { color: var(--muted); }
.detail-meta dd { margin: 0; word-break: break-word; }
.result-actions { display: grid; gap: 9px; margin-top: 18px; }
.completion-panel { padding: 28px 24px 24px; }
.completion-lead { display: flex; align-items: flex-start; gap: 14px; }
.completion-icon { width: 46px; height: 46px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 50%; background: var(--green-soft); color: var(--green); }
.completion-icon.non_math { background: var(--coral-soft); color: var(--coral); }
.completion-icon svg { width: 24px; height: 24px; }
.completion-copy { min-width: 0; }
.completion-copy h2 { margin: 9px 0 0; font-size: 20px; line-height: 1.4; }
.completion-description { margin: 18px 0 0; padding-top: 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; line-height: 1.8; }
.button.result-primary { width: 100%; min-height: 48px; border-color: #e86624; background: #e86624; color: #fff; font-size: 15px; box-shadow: 0 8px 18px rgba(232, 102, 36, .22); }
.button.result-primary:hover { border-color: #c95017; background: #c95017; color: #fff; box-shadow: 0 11px 24px rgba(201, 80, 23, .3); }
.button.result-primary:focus-visible { outline-color: #e86624; }

.admin-layout { display: grid; grid-template-columns: 210px minmax(0,1fr); gap: 26px; }
.admin-nav { align-self: start; position: sticky; top: 94px; padding: 10px; border: 1px solid var(--line); border-radius: 7px; background: #fff; }
.admin-nav a { display: flex; align-items: center; gap: 9px; padding: 10px 11px; border-radius: 5px; color: var(--muted); text-decoration: none; }
.admin-nav a:hover, .admin-nav a.active { background: var(--green-soft); color: var(--green); }
.admin-nav hr { border: 0; border-top: 1px solid var(--line); margin: 9px 0; }
.metric-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 14px; margin-bottom: 22px; }
.metric { border: 1px solid var(--line); border-radius: 7px; background: #fff; padding: 18px; }
.metric span { color: var(--muted); font-size: 12px; }
.metric strong { display: block; margin-top: 8px; font-size: 28px; line-height: 1; }
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th, .data-table td { padding: 12px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.data-table th { background: #f9fbfa; color: var(--muted); font-size: 12px; white-space: nowrap; }
.data-table tbody tr:hover { background: #fbfcfc; }
.data-table a { color: var(--ink); font-weight: 700; text-decoration: none; }
.data-table a:hover { color: var(--green); }
.data-table .credit-manage-link { color: #fff; border-color: #e86624; background: #e86624; white-space: nowrap; }
.data-table .credit-manage-link:hover { color: #fff; border-color: #c95017; background: #c95017; }
.table-actions { display: flex; gap: 6px; }
.filters { display: flex; align-items: end; gap: 10px; padding: 15px 18px; border-bottom: 1px solid var(--line); }
.filters .field { flex: 1; margin: 0; }
.filters .field.select { max-width: 170px; }
.pagination { display: flex; justify-content: center; align-items: center; gap: 7px; margin-top: 20px; }
.pagination a, .pagination span { min-width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 5px; background: #fff; color: var(--ink); text-decoration: none; }
.pagination .current { border-color: var(--green); background: var(--green); color: #fff; }
.profile-band { display: flex; align-items: center; gap: 18px; padding: 23px; background: var(--ink); color: #fff; }
.profile-avatar { width: 54px; height: 54px; display: grid; place-items: center; border-radius: 50%; background: #2d423a; color: #9fe1c8; font-size: 22px; font-weight: 700; }
.profile-band h2 { margin: 0; }
.profile-band p { margin: 3px 0 0; color: #b9c8c3; }
.profile-balance { margin-left: auto; text-align: right; }
.profile-balance strong { display: block; font-size: 26px; color: #9fe1c8; }
.split-panels { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.credit-adjustment-card { scroll-margin-top: 90px; }
.panel-subtitle { display: block; margin-top: 3px; color: var(--muted); font-size: 13px; }
.credit-mode-fieldset { min-width: 0; margin: 0 0 18px; padding: 0; border: 0; }
.credit-mode-fieldset legend { margin-bottom: 8px; color: var(--ink); font-size: 14px; font-weight: 700; }
.credit-mode { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.credit-mode label { position: relative; min-width: 0; cursor: pointer; }
.credit-mode input { position: absolute; inline-size: 1px; block-size: 1px; opacity: 0; pointer-events: none; }
.credit-mode span { min-height: 42px; display: flex; align-items: center; justify-content: center; gap: 7px; padding: 8px 10px; border: 1px solid var(--line-strong); border-radius: 6px; background: #fff; color: var(--muted); font-weight: 700; transition: border-color .18s ease, background .18s ease, color .18s ease, box-shadow .18s ease; }
.credit-mode svg { width: 18px; height: 18px; }
.credit-mode .increase input:checked + span { border-color: var(--green); background: #e9f6f1; color: var(--green-dark); box-shadow: 0 0 0 2px rgba(8,127,91,.1); }
.credit-mode .decrease input:checked + span { border-color: #d65b43; background: #fff1ed; color: #a63b29; box-shadow: 0 0 0 2px rgba(214,91,67,.1); }
.credit-mode input:focus-visible + span { outline: 3px solid rgba(24,100,171,.22); outline-offset: 2px; }
.danger-note { padding: 12px 14px; border-left: 3px solid var(--coral); background: var(--coral-soft); color: #8f3b2e; font-size: 13px; }
.system-checks { display: grid; gap: 10px; }
.system-check { display: flex; justify-content: space-between; gap: 20px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.system-check:last-child { border-bottom: 0; }
.ok { color: var(--green); font-weight: 700; }
.bad { color: var(--coral); font-weight: 700; }

.app-footer { border-top: 1px solid var(--line); background: #fff; color: var(--muted); font-size: 12px; }
.app-footer > div { width: min(1180px, calc(100% - 32px)); min-height: 68px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.app-footer a { color: var(--muted); text-decoration: none; }
.app-footer a:hover { color: var(--green); }

@media (max-width: 900px) {
  .mobile-nav-toggle { display: inline-grid !important; margin-left: auto; }
  .main-nav { display: none; position: absolute; top: 60px; right: 16px; width: min(300px, calc(100% - 32px)); align-items: stretch; flex-direction: column; padding: 10px; border: 1px solid var(--line); border-radius: 7px; background: #fff; box-shadow: var(--shadow); }
  .main-nav.open { display: flex; }
  .main-nav > a { padding: 10px; }
  .nav-points { margin: 5px 0; }
  .user-name { max-width: none; padding: 4px 10px; }
  .auth-shell { grid-template-columns: 1fr; gap: 30px; padding: 35px 0; }
  .auth-context { max-width: 680px; }
  .auth-context h1 { font-size: 38px; }
  .dashboard-grid, .detail-grid { grid-template-columns: 1fr; }
  .admin-layout { grid-template-columns: 1fr; }
  .admin-nav { position: static; display: flex; overflow-x: auto; }
  .admin-nav a { flex: 0 0 auto; }
  .admin-nav hr { width: 1px; border: 0; border-left: 1px solid var(--line); margin: 5px; }
  .metric-grid { grid-template-columns: repeat(2,1fr); }
  .home-page .main-nav { background: var(--ink); }
  .home-start-inner { grid-template-columns: 1fr; gap: 24px; padding: 38px 0; }
  .home-process { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 620px) {
  .flash-stack { top: 72px; right: 12px; width: calc(100% - 24px); }
  body:not(.home-page) .flash-stack { position: relative; top: auto; right: auto; width: calc(100% - 24px); margin: 12px auto 0; }
  .flash { padding: 12px 9px 12px 12px; }
  .header-inner { min-height: 60px; }
  .header-inner { gap: 10px; }
  .guest-nav { gap: 3px; }
  .guest-nav > a:not(.button) { padding-inline: 5px; font-size: 13px; }
  .brand-copy small { display: none; }
  .guest-nav > a:not(.button) { display: none; }
  .page-shell { padding-top: 24px; }
  .page-heading { align-items: flex-start; flex-direction: column; }
  .page-heading h1 { font-size: 25px; }
  .auth-shell { width: min(100% - 24px, 500px); }
  .auth-context h1 { font-size: 31px; }
  .auth-context > p { font-size: 15px; }
  .auth-points { grid-template-columns: 1fr; }
  .auth-card { padding: 23px 19px; }
  .form-grid { grid-template-columns: 1fr; }
  .stats-row { grid-template-columns: 1fr; }
  .stat { min-height: 0; display: grid; grid-template-columns: 34px 1fr; grid-template-rows: auto auto; gap: 0 10px; }
  .stat-icon { grid-row: 1 / 3; }
  .stat strong { margin: 0; font-size: 21px; }
  .problem-row { grid-template-columns: 42px minmax(0,1fr); padding: 13px 14px; }
  .problem-thumb { width: 42px; height: 42px; }
  .problem-row .status { grid-column: 2; justify-self: start; }
  .balance-band { padding: 20px; }
  .dropzone { min-height: 230px; }
  .upload-guidance { grid-template-columns: 1fr; gap: 16px; }
  .upload-example-trigger { width: min(100%, 520px); }
  .upload-actions { align-items: stretch; flex-direction: column; }
  .upload-actions .button { width: 100%; }
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .metric { padding: 14px; }
  .metric strong { font-size: 23px; }
  .filters { align-items: stretch; flex-direction: column; }
  .filters .field.select { max-width: none; }
  .split-panels { grid-template-columns: 1fr; }
  .profile-band { align-items: flex-start; flex-wrap: wrap; }
  .profile-balance { width: 100%; margin-left: 72px; text-align: left; }
  .app-footer > div { align-items: flex-start; flex-direction: column; justify-content: center; gap: 3px; padding: 14px 0; }
  .home-page .guest-nav > a:not(.button) { display: inline-flex; color: #fff; }
  .home-page .guest-nav .button { padding-inline: 10px; }
  .home-hero { min-height: 640px; background-position: 64% center; }
  .home-hero-shade { background: rgba(8,25,20,.77); }
  .home-hero-inner { min-height: 640px; padding-top: 110px; padding-bottom: 38px; justify-content: center; }
  .home-kicker { font-size: 12px; }
  .home-hero h1 { font-size: 40px; }
  .home-lead { margin-top: 16px; font-size: 15px; }
  .home-actions { width: 100%; align-items: stretch; flex-direction: column; margin-top: 21px; }
  .home-actions .button { width: 100%; }
  .home-facts { width: 100%; margin-top: 27px; }
  .home-facts > span { flex: 1; justify-content: center; gap: 4px; padding: 9px 6px; font-size: 10px; text-align: center; }
  .home-facts > span:first-child { padding-left: 4px; }
  .home-facts > span > svg { display: none; }
  .home-facts strong { display: block; }
  .home-start-inner { gap: 20px; padding: 32px 0; }
  .home-start-inner h2, .home-section-heading h2, .home-final-inner h2 { font-size: 25px; }
  .home-upload-command { grid-template-columns: 42px minmax(0,1fr) 20px; gap: 10px; padding: 13px; }
  .home-upload-icon { width: 42px; height: 42px; }
  .home-upload-command small { font-size: 11px; }
  .home-process-band { padding: 58px 0; }
  .home-process { grid-template-columns: 1fr; gap: 27px; margin-top: 34px; }
  .auth-points { gap: 16px; }
  .auth-point { display: grid; grid-template-columns: 28px minmax(0,1fr); gap: 2px 8px; border-top-width: 1px; font-size: 12px; }
  .auth-point > svg { grid-column: 1; grid-row: 1 / 3; margin-top: 3px; margin-bottom: 0; }
  .auth-point > strong { grid-column: 2; margin: 0; }
  .auth-journey { margin-top: 22px; }
  .home-final-inner { align-items: stretch; flex-direction: column; }
  .home-final-inner .button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
