:root {
  --ink: #121519;
  --ink-2: #20262d;
  --paper: #fff;
  --canvas: #f2f3f5;
  --line: #dce0e4;
  --muted: #69717c;
  --muted-2: #949ba4;
  --red: #ff4d30;
  --red-dark: #df3218;
  --red-soft: #fff0ed;
  --green: #228768;
  --amber: #c27a14;
  --blue: #3169a8;
  --radius: 1rem;
  --shadow: 0 20px 55px rgba(18,21,25,.08);
}
* { box-sizing: border-box; }
html { font-size: 16px; }
body { margin: 0; color: var(--ink); background: var(--canvas); font-family: Inter, "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif; line-height: 1.55; -webkit-font-smoothing: antialiased; }
button, input, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
svg { width: 1.2rem; height: 1.2rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
[hidden] { display: none !important; }
.site-header { height: 4.6rem; padding: 0 clamp(1rem, 4vw, 3rem); display: flex; align-items: center; justify-content: space-between; gap: 1rem; color: white; background: var(--ink); border-bottom: .2rem solid var(--red); }
.brand { display: flex; align-items: center; gap: .72rem; }
.brand-number { width: 2.65rem; height: 2.45rem; display: grid; grid-template-columns: 1fr 1fr; align-items: center; padding: .3rem; border: 1px solid rgba(255,255,255,.3); font-size: .68rem; line-height: 1; }
.brand-number b:last-child { color: var(--red); }
.brand > span:last-child small, .brand > span:last-child strong { display: block; }
.brand > span:last-child small { color: #9199a4; font-size: .6rem; letter-spacing: .16em; }
.brand > span:last-child strong { font-size: .92rem; }
.header-meta { display: flex; align-items: center; gap: 1rem; }
.private-badge { display: flex; align-items: center; gap: .42rem; color: #bbc1c9; font-size: .76rem; }
.private-badge i, .system-chip i { width: .48rem; aspect-ratio: 1; border-radius: 50%; background: #49c58c; box-shadow: 0 0 0 .2rem rgba(73,197,140,.12); }
.header-button { min-height: 2.35rem; padding: .45rem .75rem; border: 1px solid #3b424c; border-radius: .55rem; color: white; background: transparent; cursor: pointer; }
.header-button:hover { background: #272d34; }
.page-shell { width: min(72rem, calc(100% - 2rem)); margin: 0 auto; padding: clamp(2rem, 5vw, 4rem) 0 5rem; }
.page-intro, .job-hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 1.5rem; margin-bottom: 1.6rem; }
.overline { margin: 0 0 .35rem; color: var(--red); font-size: .72rem; letter-spacing: .14em; font-weight: 800; }
.overline.light { color: #ff856f; }
.page-intro h1, .job-hero h1 { margin: 0; font: 700 clamp(2rem, 5vw, 3.7rem)/1.08 Georgia, "Noto Serif TC", serif; letter-spacing: -.035em; }
.page-intro p:last-child { margin: .55rem 0 0; color: var(--muted); }
.system-chip { display: flex; align-items: center; gap: .55rem; padding: .62rem .8rem; border: 1px solid var(--line); border-radius: 2rem; background: white; color: var(--muted); font-size: .8rem; white-space: nowrap; }
.upload-card, .process-card, .notes-card { border: 1px solid var(--line); border-radius: var(--radius); background: white; box-shadow: var(--shadow); }
.upload-card { overflow: hidden; }
.upload-card-head { display: flex; gap: 1rem; align-items: flex-start; padding: 1.35rem 1.5rem; border-bottom: 1px solid var(--line); }
.upload-card-head h2, .section-title h2 { margin: 0; font-size: 1.05rem; }
.upload-card-head p { margin: .2rem 0 0; color: var(--muted); font-size: .8rem; }
.step-tag { width: 2.1rem; height: 1.55rem; display: grid; place-items: center; flex: 0 0 auto; color: white; background: var(--red); font: 700 .72rem Georgia, serif; clip-path: polygon(0 0, 85% 0, 100% 50%, 85% 100%, 0 100%); }
.step-tag.dark { background: var(--ink); }
.upload-form { padding: 1.5rem; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 1rem; }
.field { display: grid; gap: .38rem; color: #505963; font-size: .8rem; font-weight: 700; }
.field span b { color: var(--red); }
.field.span-2 { grid-column: 1 / -1; }
.field input, .field textarea { width: 100%; min-height: 2.8rem; padding: .68rem .78rem; border: 1px solid var(--line); border-radius: .6rem; outline: 0; color: var(--ink); background: #fbfcfd; font-size: .92rem; resize: vertical; }
.field input:focus, .field textarea:focus { border-color: var(--red); box-shadow: 0 0 0 3px var(--red-soft); }
.drop-zone { min-height: 12rem; margin-top: 1rem; border: 1.5px dashed #b8bec6; border-radius: .8rem; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 1.5rem; text-align: center; cursor: pointer; background: #fafbfc; transition: .16s ease; }
.drop-zone:hover, .drop-zone.is-dragging { border-color: var(--red); background: var(--red-soft); }
.drop-zone.has-file { border-style: solid; border-color: var(--green); background: #f1faf6; }
.drop-zone input { position: absolute; inline-size: 1px; block-size: 1px; opacity: 0; }
.upload-icon { width: 3rem; aspect-ratio: 1; margin-bottom: .7rem; border-radius: 50%; display: grid; place-items: center; color: white; background: var(--ink); }
.upload-icon svg { width: 1.35rem; }
.drop-zone strong { max-width: 100%; overflow-wrap: anywhere; font-size: .95rem; }
.drop-zone small { margin-top: .2rem; color: var(--muted); font-size: .76rem; }
.upload-footer { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 1rem; }
.upload-footer p { margin: 0; color: var(--muted); font-size: .74rem; }
.upload-progress { margin-top: 1rem; padding: .9rem 1rem; border: 1px solid var(--line); border-radius: .7rem; background: #fafbfc; }
.upload-progress-head, .upload-progress-meta { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.upload-progress-head strong { font-size: .82rem; }
.upload-progress-head span { color: var(--ink); font: 700 1rem Georgia, serif; }
.upload-progress-track { height: .58rem; margin-top: .65rem; overflow: hidden; border-radius: 2rem; background: #e4e7ea; }
.upload-progress-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--red), #ff816a); transition: width .18s ease; }
.upload-progress-meta { margin-top: .45rem; color: var(--muted); }
.upload-progress-meta small { font-size: .7rem; }
.upload-progress.is-complete .upload-progress-track span { background: var(--green); }
.upload-progress.has-error { border-color: #f1b7ad; background: var(--red-soft); }
.upload-progress.has-error .upload-progress-track span { background: var(--red); }
.upload-progress-error { margin: .6rem 0 0; color: #9f2818; font-size: .76rem; font-weight: 700; }
.lock-icon { color: var(--green); font-weight: 900; }
.button { min-height: 2.75rem; border: 1px solid transparent; border-radius: .62rem; padding: .58rem .9rem; display: inline-flex; align-items: center; justify-content: center; gap: .45rem; font-size: .84rem; font-weight: 800; cursor: pointer; }
.button.primary { color: white; background: var(--ink); }
.button.primary:hover { background: #2b323a; }
.button.primary svg { width: 1rem; }
.button.danger { color: #b82d1b; border-color: #f1b7ad; background: white; }
.button.danger:hover { background: var(--red-soft); }
.button:disabled { opacity: .45; cursor: not-allowed; }
.button.full { width: 100%; }
.jobs-section { margin-top: 3rem; }
.section-title, .section-title > div { display: flex; align-items: center; }
.section-title { justify-content: space-between; gap: 1rem; margin-bottom: .8rem; }
.section-title > div { gap: .72rem; }
.section-title > span { color: var(--muted); font-size: .78rem; }
.job-list { overflow: hidden; border: 1px solid var(--line); border-radius: .85rem; background: white; }
.job-row { min-height: 4.8rem; display: grid; grid-template-columns: auto minmax(0,1fr) auto 9rem auto; align-items: center; gap: 1rem; padding: .8rem 1rem; border-top: 1px solid var(--line); }
.job-row:first-child { border-top: 0; }
.job-row:hover { background: #fafbfc; }
.job-state { width: .55rem; aspect-ratio: 1; border-radius: 50%; background: var(--blue); }
.job-state.state-completed { background: var(--green); }
.job-state.state-failed { background: var(--red); }
.job-main { min-width: 0; }
.job-main strong, .job-main small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.job-main strong { font-size: .9rem; }
.job-main small { margin-top: .2rem; color: var(--muted); font-size: .72rem; }
.status-pill { display: inline-flex; align-items: center; justify-content: center; min-height: 1.7rem; padding: .25rem .52rem; border-radius: 2rem; color: var(--blue); background: #edf4fc; font-size: .7rem; font-weight: 800; white-space: nowrap; }
.status-pill.status-completed { color: var(--green); background: #eaf7f2; }
.status-pill.status-failed { color: #c23720; background: var(--red-soft); }
.status-pill.large { min-height: 2.25rem; padding-inline: .8rem; font-size: .78rem; }
.job-progress { display: grid; grid-template-columns: 1fr 2rem; align-items: center; gap: .45rem; }
.job-progress i { height: .28rem; overflow: hidden; background: #e4e7ea; border-radius: 2rem; }
.job-progress i b { display: block; height: 100%; background: var(--ink); }
.job-progress small { color: var(--muted); font-size: .68rem; }
.row-arrow { color: var(--muted); width: 1rem; }
.empty-state { padding: 3.5rem 1.5rem; border: 1px dashed #c8cdd3; border-radius: .85rem; text-align: center; background: rgba(255,255,255,.45); }
.empty-state span { color: var(--red); font: 700 1.5rem ui-monospace, monospace; }
.empty-state h3 { margin: .6rem 0 .2rem; }
.empty-state p { margin: 0; color: var(--muted); font-size: .84rem; }
.site-footer { min-height: 4rem; padding: 1rem clamp(1rem,4vw,3rem); display: flex; align-items: center; justify-content: space-between; gap: 1rem; color: #8f97a0; background: var(--ink); font-size: .72rem; }

.login-body { min-height: 100vh; background: var(--ink); }
.login-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(0,1.05fr) minmax(28rem,.95fr); }
.login-identity { position: relative; overflow: hidden; padding: clamp(2rem, 7vw, 7rem); display: flex; flex-direction: column; justify-content: center; color: white; background: var(--ink); }
.login-identity::after { content: "9501"; position: absolute; right: -3rem; bottom: -6rem; color: rgba(255,255,255,.025); font: 900 clamp(9rem,25vw,25rem)/1 Arial, sans-serif; letter-spacing: -.1em; }
.login-mark { width: 4.8rem; aspect-ratio: 1; margin-bottom: 2rem; border: 1px solid #4b515a; display: grid; grid-template-columns: 1fr 1fr; place-items: center; font-weight: 900; }
.login-mark span:last-child { color: var(--red); }
.login-identity h1 { position: relative; z-index: 1; margin: .5rem 0 1rem; font: 700 clamp(2.5rem,5.6vw,5.2rem)/1.06 Georgia, "Noto Serif TC", serif; letter-spacing: -.045em; }
.login-identity > p:not(.overline) { max-width: 34rem; color: #abb2bb; }
.signal-line { display: flex; align-items: center; gap: .35rem; height: 3rem; margin-top: 2rem; }
.signal-line i { width: .22rem; height: 25%; background: var(--red); }
.signal-line i:nth-child(2), .signal-line i:nth-child(8) { height: 50%; }
.signal-line i:nth-child(3), .signal-line i:nth-child(7) { height: 85%; }
.signal-line i:nth-child(4), .signal-line i:nth-child(6) { height: 38%; }
.signal-line i:nth-child(5) { height: 100%; }
.login-panel { padding: 2rem; display: grid; place-items: center; background: #f5f6f7; }
.login-form-wrap { width: min(25rem, 100%); }
.login-form-wrap h2 { margin: .15rem 0 .3rem; font: 700 2rem/1.2 Georgia, "Noto Serif TC", serif; }
.muted { color: var(--muted); }
.login-form { display: grid; gap: 1rem; margin-top: 1.6rem; }
.login-form label { display: grid; gap: .42rem; font-size: .8rem; font-weight: 700; }
.login-form input { min-height: 3rem; border: 1px solid var(--line); border-radius: .6rem; padding: .7rem .8rem; outline: 0; }
.login-form input:focus { border-color: var(--red); box-shadow: 0 0 0 3px var(--red-soft); }
.privacy-note { color: var(--muted); font-size: .72rem; }
.alert { margin-top: 1rem; padding: .75rem .85rem; border-radius: .55rem; font-size: .8rem; }
.alert.warning { color: #7b5200; background: #fff2c6; }
.alert.error { color: #9f2818; background: var(--red-soft); }

.job-page { max-width: 62rem; }
.back-link { display: inline-flex; align-items: center; gap: .35rem; margin-bottom: 1.5rem; color: var(--muted); font-size: .8rem; }
.back-link:hover { color: var(--ink); }
.back-link svg { width: 1rem; }
.job-participants { margin: .55rem 0 0; color: var(--muted); font-size: .84rem; }
.process-card { padding: 1.4rem 1.5rem; }
.process-header, .process-header > div { display: flex; align-items: center; }
.process-header { justify-content: space-between; gap: 1rem; }
.process-header > div { gap: .72rem; }
.process-header small, .process-header strong { display: block; }
.process-header small { color: var(--muted); font-size: .7rem; }
.process-header strong { font-size: .93rem; }
.process-header > strong { font: 700 1.35rem Georgia, serif; }
.pulse-dot { width: .7rem; aspect-ratio: 1; border-radius: 50%; background: var(--blue); box-shadow: 0 0 0 .3rem #e7f0fa; }
.pulse-dot.state-completed { background: var(--green); box-shadow: 0 0 0 .3rem #e5f5ef; }
.pulse-dot.state-failed { background: var(--red); box-shadow: 0 0 0 .3rem var(--red-soft); }
.large-progress { height: .55rem; margin-top: 1.2rem; overflow: hidden; border-radius: 2rem; background: #e7e9ec; }
.large-progress span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--red), #ff816a); transition: width .35s ease; }
.pipeline { display: grid; grid-template-columns: repeat(5,1fr); margin-top: .6rem; color: var(--muted); font-size: .68rem; }
.pipeline span { text-align: center; }
.pipeline span:first-child { text-align: left; }
.pipeline span:last-child { text-align: right; }
.process-note { margin: 1.2rem 0 0; padding-top: 1rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .78rem; }
.notes-card { margin-top: 1rem; padding: 1rem 1.25rem; box-shadow: none; }
.notes-card p:last-child { margin: .3rem 0 0; white-space: pre-wrap; }
.notes-form { display: grid; gap: .75rem; margin-top: .6rem; }
.notes-form textarea { width: 100%; resize: vertical; }
.notes-form .button { justify-self: end; }
.downloads-section { margin-top: 2.5rem; }
.download-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .7rem; }
.download-card { min-height: 5rem; padding: .8rem .9rem; display: grid; grid-template-columns: 3rem minmax(0,1fr) auto; gap: .75rem; align-items: center; border: 1px solid var(--line); border-radius: .75rem; background: white; }
.download-card:hover { border-color: #aeb5bd; transform: translateY(-1px); box-shadow: 0 10px 25px rgba(18,21,25,.06); }
.download-card.featured { color: white; border-color: var(--ink); background: var(--ink); }
.download-card > span { width: 2.8rem; aspect-ratio: 1; display: grid; place-items: center; border-radius: .45rem; color: var(--red); background: var(--red-soft); font-size: .65rem; font-weight: 900; }
.download-card strong, .download-card small { display: block; }
.download-card strong { font-size: .84rem; }
.download-card small { margin-top: .15rem; color: var(--muted); font-size: .7rem; }
.download-card.featured small { color: #aeb5bd; }
.download-card > b { color: var(--muted); }
.failure-card { margin-top: 1rem; padding: 1rem 1.15rem; border: 1px solid #f2b7ad; border-radius: .75rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; background: var(--red-soft); }
.failure-card > div { display: flex; align-items: flex-start; gap: .75rem; }
.failure-card > div > span { width: 1.8rem; aspect-ratio: 1; display: grid; place-items: center; border-radius: 50%; color: white; background: var(--red); font-weight: 900; }
.failure-card p { margin: .15rem 0 0; color: #7d3c32; font-size: .78rem; }
.danger-zone { margin-top: 3rem; padding-top: 1.3rem; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.danger-zone strong { font-size: .86rem; }
.danger-zone p { margin: .15rem 0 0; color: var(--muted); font-size: .72rem; }

@media (max-width: 760px) {
  .login-shell { grid-template-columns: 1fr; }
  .login-identity { min-height: 42vh; padding: 2rem 1.4rem; }
  .login-mark { width: 3.6rem; margin-bottom: 1rem; }
  .login-identity h1 { font-size: 2.55rem; }
  .login-identity > p:not(.overline), .signal-line { display: none; }
  .login-panel { min-height: 58vh; padding: 2rem 1.2rem; align-items: start; }
  .field-grid { grid-template-columns: 1fr; }
  .field.span-2 { grid-column: auto; }
  .upload-footer { align-items: stretch; flex-direction: column; }
  .upload-footer .button { width: 100%; }
  .upload-progress-meta { align-items: flex-start; flex-direction: column; gap: .1rem; }
  .job-row { grid-template-columns: auto minmax(0,1fr) auto; gap: .65rem; }
  .job-row .status-pill { grid-column: 2; justify-self: start; }
  .job-progress { display: none; }
  .row-arrow { grid-column: 3; grid-row: 1 / span 2; }
  .download-grid { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  .site-header { height: 4.2rem; padding: 0 .8rem; }
  .brand > span:last-child small { display: none; }
  .brand > span:last-child strong { font-size: .78rem; }
  .private-badge { display: none; }
  .page-shell { width: min(100% - 1.2rem, 72rem); padding-top: 1.6rem; }
  .page-intro, .job-hero { align-items: flex-start; flex-direction: column; }
  .page-intro h1, .job-hero h1 { font-size: 2.25rem; }
  .system-chip { align-self: flex-start; }
  .upload-card-head, .upload-form, .process-card { padding: 1rem; }
  .drop-zone { min-height: 10.5rem; }
  .pipeline { font-size: .58rem; }
  .failure-card, .danger-zone { align-items: stretch; flex-direction: column; }
  .danger-zone .button { width: 100%; }
  .site-footer { align-items: flex-start; flex-direction: column; }
}

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