:root {
  --ink: #17201f;
  --muted: #6c7775;
  --paper: #f2f5f4;
  --white: #fff;
  --forest: #153e39;
  --green: #1e7468;
  --mint: #dff2ed;
  --line: #d9e2df;
  --coral: #b65d50;
  --coral-soft: #f9ebe8;
  --blue: #426f9f;
  --blue-soft: #e8f0f7;
  --shadow: 0 22px 65px rgba(22, 40, 37, .1);
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; color: var(--ink); background: var(--paper); font-family: Inter, "Noto Sans SC", "Microsoft YaHei", system-ui, sans-serif; line-height: 1.55; letter-spacing: 0; }
button, input, select { font: inherit; letter-spacing: 0; }
button, a { -webkit-tap-highlight-color: transparent; }
.shell { width: min(1040px, calc(100% - 40px)); margin: 0 auto; }
.section-label { display: block; color: var(--green); font-size: 11px; font-weight: 750; }
.topbar { border-bottom: 1px solid var(--line); background: rgba(255, 255, 255, .92); backdrop-filter: blur(14px); }
.topbar-inner { min-height: 70px; display: flex; align-items: center; justify-content: space-between; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 750; }
.brand-mark { width: 36px; height: 36px; display: grid; place-items: center; color: #fff; border-radius: 7px; background: var(--forest); }
.brand-mark svg { width: 18px; height: 18px; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.top-actions form { display: flex; }
.secure-label { display: inline-flex; align-items: center; gap: 6px; color: var(--green); font-size: 11px; font-weight: 700; }
.secure-label svg { width: 15px; }
.main-content { min-height: calc(100svh - 134px); padding-top: 54px; padding-bottom: 90px; }

.btn { min-height: 42px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 15px; border: 1px solid transparent; border-radius: 7px; cursor: pointer; text-decoration: none; font-size: 13px; font-weight: 750; transition: transform .2s, background .2s, border-color .2s; }
.btn:hover { transform: translateY(-1px); }
.btn svg { width: 17px; height: 17px; }
.btn-primary { color: #fff; background: var(--green); }
.btn-primary:hover { background: #185e55; }
.btn-secondary { color: var(--forest); border-color: #b8c9c5; background: #fff; }
.btn-large { min-height: 50px; }
.icon-btn { width: 40px; height: 40px; display: inline-grid; place-items: center; padding: 0; color: #52605d; border: 1px solid var(--line); border-radius: 7px; background: #fff; cursor: pointer; }
.icon-btn:hover { color: var(--forest); border-color: #a9bcb7; }
.icon-btn.danger { color: var(--coral); }
.icon-btn svg { width: 17px; height: 17px; }

input, select { width: 100%; min-height: 46px; padding: 0 13px; color: var(--ink); border: 1px solid #cbd6d3; border-radius: 7px; outline: none; background: #fff; }
input:focus, select:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(30,116,104,.12); }
label { display: grid; gap: 7px; }
label > span { color: #4e5b58; font-size: 12px; font-weight: 700; }
.alert { margin-bottom: 20px; padding: 12px 14px; border: 1px solid; border-radius: 7px; font-size: 13px; }
.alert-success { color: #185e55; border-color: #b8dcd4; background: #eaf7f4; }
.alert-error { color: #9b4136; border-color: #ebc6bf; background: #fcefeb; }

.access-layout { min-height: 520px; display: grid; grid-template-columns: 1.15fr .85fr; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: #fff; box-shadow: var(--shadow); }
.access-context { display: flex; flex-direction: column; justify-content: center; padding: 56px; color: #fff; background: var(--forest); }
.access-context .section-label { color: #8fc8bf; }
.access-context h1 { max-width: 520px; margin: 12px 0 14px; font-size: 48px; line-height: 1.15; font-weight: 620; }
.access-context > p { max-width: 470px; margin: 0; color: #bad2cd; }
.policy-row { display: flex; flex-wrap: wrap; gap: 20px; margin-top: 46px; color: #d7e6e2; font-size: 11px; }
.policy-row span { display: inline-flex; align-items: center; gap: 7px; }
.policy-row svg { width: 15px; color: #8fd5c9; }
.access-form { display: grid; align-content: center; gap: 18px; padding: 48px; }
.access-form h2 { margin: -3px 0 8px; font-size: 27px; }

.workspace-heading { display: flex; align-items: end; justify-content: space-between; gap: 30px; margin-bottom: 25px; }
.workspace-heading h1 { margin: 6px 0 4px; font-size: 36px; line-height: 1.2; }
.workspace-heading p { margin: 0; color: var(--muted); }
.storage-note { display: flex; align-items: center; gap: 10px; color: #465350; font-size: 12px; }
.storage-note svg { width: 22px; color: var(--green); }
.storage-note span { display: grid; }
.storage-note small { color: #87918f; }

.upload-workspace { overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: #fff; box-shadow: var(--shadow); }
.drop-zone { min-height: 300px; display: grid; place-items: center; align-content: center; gap: 8px; padding: 38px; border-bottom: 1px solid var(--line); cursor: pointer; text-align: center; background: #fbfcfc; transition: background .2s; }
.drop-zone.is-dragging { background: var(--mint); }
.drop-zone input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.drop-zone strong { font-size: 20px; }
.drop-zone > span:not(.drop-icon) { max-width: 520px; overflow: hidden; color: var(--muted); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.drop-zone small { color: #929b99; }
.drop-icon { width: 56px; height: 56px; display: grid; place-items: center; margin-bottom: 6px; color: var(--green); border: 1px solid #bad6d0; border-radius: 8px; background: var(--mint); }
.drop-icon svg { width: 27px; height: 27px; }
.upload-options { display: grid; grid-template-columns: 1fr 1fr 1.25fr auto; align-items: end; gap: 16px; padding: 22px; }
.progress-wrap { padding: 0 22px 22px; }
.progress-meta { display: flex; justify-content: space-between; color: var(--muted); font-size: 11px; }
.progress-meta strong { color: var(--green); }
.progress-track { height: 7px; margin-top: 8px; overflow: hidden; border-radius: 4px; background: #e3e9e7; }
.progress-track span { display: block; width: 0; height: 100%; background: var(--green); transition: width .15s linear; }

.active-section { margin-top: 60px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.section-heading h2 { margin: 5px 0 0; font-size: 25px; }
.count-label { color: var(--muted); font-size: 12px; }
.file-list { border-top: 1px solid var(--line); }
.file-row { min-height: 78px; display: grid; grid-template-columns: 44px minmax(0, 1fr) 84px 40px 40px; align-items: center; gap: 13px; padding: 12px 6px; border-bottom: 1px solid var(--line); }
.file-row form { display: flex; }
.file-type { width: 40px; height: 40px; display: grid; place-items: center; color: var(--blue); border-radius: 7px; background: var(--blue-soft); }
.file-type svg { width: 19px; }
.file-info { min-width: 0; display: grid; gap: 2px; }
.file-info strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-info span, .file-usage span { color: var(--muted); font-size: 11px; }
.file-usage { display: grid; text-align: right; }
.file-usage strong { font-size: 13px; }
.empty-state, .expired-state { min-height: 220px; display: grid; place-items: center; align-content: center; gap: 10px; color: var(--muted); border: 1px dashed #c9d4d1; border-radius: 8px; text-align: center; }
.empty-state svg { width: 30px; }
.empty-state p, .expired-state p { margin: 0; }

.pickup-layout { width: min(100%, 720px); margin: 30px auto 0; }
.pickup-heading { margin-bottom: 24px; text-align: center; }
.pickup-heading h1 { margin: 5px 0 0; font-size: 34px; }
.file-receipt { min-height: 150px; display: grid; grid-template-columns: 62px minmax(0, 1fr) auto; align-items: center; gap: 20px; padding: 28px; color: #fff; background: var(--forest); }
.file-symbol { width: 58px; height: 58px; display: grid; place-items: center; border: 1px solid #59736e; border-radius: 8px; }
.file-symbol svg { width: 27px; }
.file-main { min-width: 0; }
.file-main > span { color: #91b7b0; font-size: 11px; }
.file-main h2 { margin: 5px 0 4px; overflow-wrap: anywhere; font-size: 21px; }
.file-main p { margin: 0; color: #b8ceca; font-size: 12px; }
.download-counter { display: grid; padding-left: 24px; border-left: 1px solid #49645f; text-align: center; }
.download-counter strong { font-size: 28px; }
.download-counter span { color: #a6c0bb; font-size: 10px; }
.pickup-form { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 14px; padding: 25px; border: 1px solid var(--line); border-top: 0; background: #fff; box-shadow: var(--shadow); }
.back-link { display: inline-flex; align-items: center; gap: 7px; margin-top: 20px; color: var(--muted); text-decoration: none; font-size: 12px; }
.back-link svg { width: 15px; }
.expired-state { background: #fff; box-shadow: var(--shadow); }
.expired-state h2 { margin: 5px 0 0; }
.state-icon { width: 56px; height: 56px; display: grid; place-items: center; color: var(--coral); border-radius: 8px; background: var(--coral-soft); }
.state-icon svg { width: 27px; }

.dialog { width: min(520px, calc(100% - 28px)); padding: 28px; border: 0; border-radius: 8px; box-shadow: 0 25px 80px rgba(15, 35, 31, .28); }
.dialog::backdrop { background: rgba(17, 31, 29, .56); backdrop-filter: blur(3px); }
.dialog h2 { margin: 7px 0 3px; font-size: 26px; }
.dialog > p { margin: 0 0 22px; color: var(--muted); }
.dialog-close { float: right; }
.settings-form { display: grid; gap: 16px; clear: both; }
.result-mark { width: 46px; height: 46px; display: grid; place-items: center; float: right; color: #fff; border-radius: 50%; background: var(--green); }
.result-mark svg { width: 22px; }
.result-field { display: grid; gap: 6px; margin-top: 15px; }
.result-field > span { color: #56625f; font-size: 11px; font-weight: 700; }
.result-field > div { display: grid; grid-template-columns: 1fr 40px; gap: 8px; }
.result-field input { min-width: 0; background: #f5f7f6; }
.dialog-actions { display: flex; gap: 10px; margin-top: 22px; }
.dialog-actions .btn-primary { flex: 1; }
.toast { position: fixed; left: 50%; bottom: 28px; z-index: 100; transform: translate(-50%, 20px); padding: 10px 14px; color: #fff; border-radius: 6px; background: #192421; opacity: 0; pointer-events: none; font-size: 12px; transition: .2s; }
.toast.show { transform: translate(-50%, 0); opacity: 1; }

footer { padding: 22px 0; color: #7a8582; border-top: 1px solid var(--line); background: #fff; font-size: 11px; }
footer .shell { display: flex; justify-content: space-between; }

@media (max-width: 760px) {
  .shell { width: min(100% - 28px, 1040px); }
  .main-content { padding-top: 28px; padding-bottom: 60px; }
  .access-layout { min-height: 0; grid-template-columns: 1fr; }
  .access-context { padding: 34px 25px; }
  .access-context h1 { font-size: 34px; }
  .policy-row { gap: 12px; margin-top: 28px; }
  .access-form { padding: 30px 24px 36px; }
  .workspace-heading { align-items: center; }
  .workspace-heading h1 { font-size: 30px; }
  .storage-note { display: none; }
  .drop-zone { min-height: 240px; padding: 28px 20px; }
  .upload-options { grid-template-columns: 1fr 1fr; }
  .upload-options label:nth-child(3), .upload-options .btn { grid-column: 1 / -1; }
  .file-row { grid-template-columns: 40px minmax(0, 1fr) 40px 40px; }
  .file-usage { display: none; }
  .file-receipt { grid-template-columns: 50px 1fr; padding: 22px; }
  .file-symbol { width: 48px; height: 48px; }
  .download-counter { grid-column: 1 / -1; display: flex; align-items: baseline; justify-content: center; gap: 6px; padding: 14px 0 0; border-top: 1px solid #49645f; border-left: 0; }
  .download-counter strong { font-size: 20px; }
  .pickup-form { grid-template-columns: 1fr; padding: 20px; }
  .pickup-form .btn { width: 100%; }
  .dialog { padding: 22px; }
  .dialog-actions { display: grid; }
  footer .shell { display: grid; gap: 4px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
