:root {
  --paper: #f5f1e8;
  --paper-deep: #e8e1d3;
  --ink: #17231f;
  --muted: #65716b;
  --line: rgba(23, 35, 31, .14);
  --green: #175b45;
  --green-dark: #0f4434;
  --lime: #c9ef65;
  --terracotta: #d66e4a;
  --white: #fffdf8;
  --shadow: 0 22px 60px rgba(31, 43, 36, .10);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--paper); }
body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(rgba(255,255,255,.22) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.22) 1px, transparent 1px),
    var(--paper);
  background-size: 38px 38px;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  overflow-x: hidden;
}
button, input { font: inherit; }
button { color: inherit; }
[hidden] { display: none !important; }

.ambient { position: fixed; border-radius: 50%; filter: blur(2px); pointer-events: none; opacity: .75; }
.ambient-one { width: 420px; height: 420px; right: -180px; top: -160px; background: radial-gradient(circle, rgba(201,239,101,.42), transparent 69%); }
.ambient-two { width: 380px; height: 380px; left: -180px; bottom: -150px; background: radial-gradient(circle, rgba(214,110,74,.22), transparent 69%); }
.shell { position: relative; width: min(1180px, calc(100% - 40px)); margin: 0 auto; }
.eyebrow { margin: 0 0 14px; color: var(--green); font-size: 12px; font-weight: 800; letter-spacing: .2em; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 0; font-family: Georgia, "Songti SC", serif; font-size: clamp(44px, 6.5vw, 84px); line-height: .98; font-weight: 500; letter-spacing: -.04em; }
h1 em { color: var(--green); font-weight: 500; }
h2 { margin-bottom: 6px; font-size: 24px; letter-spacing: -.02em; }

.login-view { min-height: 100vh; display: grid; grid-template-columns: 1.2fr .8fr; align-items: center; gap: clamp(50px, 9vw, 130px); padding: 64px 0; }
.login-copy .lede { max-width: 530px; margin: 30px 0 22px; color: var(--muted); font-size: 18px; line-height: 1.75; }
.privacy-note { display: inline-flex; align-items: center; gap: 10px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: 13px; background: rgba(255,255,255,.28); }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 5px rgba(23,91,69,.12); }
.card, .dialog-card { position: relative; padding: 38px; background: rgba(255,253,248,.91); border: 1px solid rgba(255,255,255,.8); border-radius: 26px; box-shadow: var(--shadow); backdrop-filter: blur(18px); }
.login-card { width: 100%; max-width: 430px; justify-self: end; }
.login-card > p:not(.form-error) { color: var(--muted); margin-bottom: 30px; }
.mark { display: grid; place-items: center; width: 48px; height: 48px; margin-bottom: 36px; border-radius: 15px; color: var(--lime); background: var(--green); font-size: 25px; font-weight: 700; }
label { display: block; margin: 17px 0 8px; font-size: 13px; font-weight: 700; }
input[type="password"] { width: 100%; height: 52px; padding: 0 14px; border: 1px solid var(--line); border-radius: 12px; outline: 0; color: var(--ink); background: var(--white); transition: border-color .2s, box-shadow .2s; }
input:focus { border-color: var(--green); box-shadow: 0 0 0 4px rgba(23,91,69,.1); }
.password-field { position: relative; }
.password-field input { padding-right: 72px; }
.reveal { position: absolute; right: 8px; top: 8px; height: 36px; border: 0; color: var(--green); background: transparent; cursor: pointer; font-size: 12px; font-weight: 700; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 12px; min-height: 44px; padding: 0 19px; border: 1px solid var(--line); border-radius: 12px; background: var(--white); cursor: pointer; font-weight: 750; transition: transform .18s, background .18s, opacity .18s; }
.button:hover, .icon-button:hover { transform: translateY(-1px); }
.button:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.button.primary { border-color: var(--green); color: white; background: var(--green); }
.button.primary:hover { background: var(--green-dark); }
.button.full { width: 100%; margin-top: 22px; }
.button.small { min-height: 38px; padding: 0 15px; font-size: 13px; }
.form-error { min-height: 20px; margin: 12px 0 -8px; color: #ad3e2b; font-size: 13px; line-height: 1.5; }

.portal-view { padding: 0 0 80px; }
.topbar { min-height: 84px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.topbar nav { display: flex; align-items: center; gap: 18px; }
.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--ink); text-decoration: none; font-weight: 800; }
.brand-mark { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; color: var(--lime); background: var(--green); }
.text-button { border: 0; color: var(--muted); background: none; cursor: pointer; font-size: 13px; }
.text-button:hover { color: var(--green); }
.hero { display: flex; align-items: end; justify-content: space-between; gap: 32px; padding: 72px 0 48px; }
.hero h1 { font-size: clamp(42px, 6vw, 72px); }
.hero-note { max-width: 280px; margin-bottom: 4px; color: var(--muted); font-size: 13px; line-height: 1.7; text-align: right; }

.drop-zone { min-height: 230px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 28px; padding: 42px; border: 2px dashed rgba(23,91,69,.34); border-radius: 25px; outline: 0; background: rgba(255,253,248,.62); transition: border-color .2s, background .2s, transform .2s; cursor: pointer; }
.drop-zone:hover, .drop-zone:focus, .drop-zone.dragging { border-color: var(--green); background: rgba(255,253,248,.95); transform: translateY(-2px); }
.drop-icon { display: grid; place-items: center; width: 78px; height: 78px; border-radius: 23px; color: var(--green); background: var(--lime); font-size: 34px; }
.drop-zone h2 { margin-bottom: 8px; font-size: clamp(24px, 3vw, 34px); }
.drop-zone p { margin-bottom: 0; color: var(--muted); }
.drop-zone p span { color: var(--green); font-weight: 750; }

.section { margin-top: 68px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; margin-bottom: 22px; }
.section-heading h2 { margin: 0; font-size: 30px; }
.section-heading .eyebrow { margin-bottom: 7px; }
.subtle, .hint { color: var(--muted); font-size: 13px; }
.upload-queue { display: grid; gap: 12px; }
.upload-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px 24px; padding: 22px; border: 1px solid var(--line); border-radius: 17px; background: rgba(255,253,248,.76); }
.upload-title { display: flex; justify-content: space-between; gap: 15px; }
.upload-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 750; }
.upload-stats { flex: 0 0 auto; color: var(--muted); font-size: 12px; }
.progress { grid-column: 1; height: 7px; overflow: hidden; border-radius: 999px; background: var(--paper-deep); }
.progress > span { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--green), #4b9979); transition: width .2s; }
.upload-item.done .progress > span { background: var(--lime); }
.upload-item.error .progress > span { background: var(--terracotta); }
.upload-actions { grid-column: 2; grid-row: 1 / span 2; display: flex; align-items: center; gap: 7px; }
.mini-button { min-width: 56px; height: 34px; padding: 0 10px; border: 1px solid var(--line); border-radius: 9px; background: transparent; cursor: pointer; color: var(--muted); font-size: 12px; }
.mini-button:hover { color: var(--green); border-color: var(--green); }

.files-section { min-height: 210px; }
.icon-button { width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 50%; background: rgba(255,253,248,.7); cursor: pointer; font-size: 20px; transition: transform .2s; }
.file-list { border-top: 1px solid var(--line); }
.file-row { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto auto; align-items: center; gap: 18px; min-height: 76px; border-bottom: 1px solid var(--line); }
.file-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; color: var(--green); background: rgba(23,91,69,.09); font-weight: 800; font-size: 11px; text-transform: uppercase; }
.file-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 720; }
.file-meta { margin-top: 5px; color: var(--muted); font-size: 12px; }
.file-date { color: var(--muted); font-size: 13px; }
.download { padding: 9px 13px; border-radius: 10px; color: var(--green); text-decoration: none; font-size: 13px; font-weight: 750; }
.download:hover { background: rgba(23,91,69,.08); }
.empty-state { padding: 40px 0; border-top: 1px solid var(--line); color: var(--muted); text-align: center; }

dialog { width: min(470px, calc(100% - 28px)); padding: 0; border: 0; border-radius: 26px; background: transparent; }
dialog::backdrop { background: rgba(15,31,25,.46); backdrop-filter: blur(5px); }
.dialog-card { width: 100%; }
.dialog-close { position: absolute; right: 20px; top: 17px; width: 36px; height: 36px; border: 0; border-radius: 50%; color: var(--muted); background: var(--paper); cursor: pointer; font-size: 23px; }
.dialog-card h2 { margin-bottom: 22px; }
.hint { margin: 9px 0 0; line-height: 1.6; }
.toast { position: fixed; left: 50%; bottom: 24px; z-index: 10; max-width: min(440px, calc(100% - 30px)); padding: 13px 18px; border-radius: 12px; color: white; background: var(--ink); box-shadow: var(--shadow); opacity: 0; transform: translate(-50%, 18px); pointer-events: none; transition: opacity .2s, transform .2s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 760px) {
  .shell { width: min(100% - 28px, 650px); }
  .login-view { grid-template-columns: 1fr; gap: 42px; padding: 55px 0; }
  .login-card { justify-self: stretch; max-width: none; }
  .login-copy .lede { margin-top: 22px; }
  .topbar { min-height: 70px; }
  .brand #brandName { display: none; }
  .hero { display: block; padding: 48px 0 34px; }
  .hero-note { margin: 22px 0 0; text-align: left; }
  .drop-zone { grid-template-columns: 1fr; justify-items: center; gap: 16px; padding: 30px 22px; text-align: center; }
  .drop-icon { width: 64px; height: 64px; }
  .section { margin-top: 52px; }
  .upload-item { grid-template-columns: minmax(0, 1fr); }
  .upload-actions { grid-column: 1; grid-row: auto; }
  .file-row { grid-template-columns: 42px minmax(0, 1fr) auto; gap: 12px; padding: 10px 0; }
  .file-date { display: none; }
  .download { padding-right: 4px; }
}

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