:root {
  color-scheme: light;
  --ink: #17221d;
  --muted: #65716a;
  --paper: #f6f5ef;
  --card: #fffef9;
  --line: #d9ddd6;
  --accent: #146c4b;
  --accent-dark: #0b4f36;
  --tint: #dff3e8;
  --danger: #ad2e24;
  --shadow: 0 20px 55px rgba(25, 42, 33, .09);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(rgba(23, 34, 29, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(23, 34, 29, .035) 1px, transparent 1px),
    var(--paper);
  background-size: 28px 28px;
  font-family: Inter, "Microsoft YaHei", system-ui, sans-serif;
}

button, input { font: inherit; }
.shell { width: min(1120px, calc(100% - 32px)); margin: 0 auto; padding: 54px 0 72px; }
.topbar { display: flex; justify-content: space-between; gap: 24px; align-items: flex-start; margin-bottom: 32px; }
.eyebrow, .step { margin: 0 0 8px; color: var(--accent); font: 700 12px/1.2 ui-monospace, SFMono-Regular, monospace; letter-spacing: .15em; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 8px; font: 650 clamp(32px, 5vw, 54px)/1.05 Georgia, "Songti SC", serif; }
h2 { margin-bottom: 6px; font-size: 23px; }
.subtitle, .card p { color: var(--muted); }
.card { background: color-mix(in srgb, var(--card) 96%, transparent); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); }
.login-card { max-width: 650px; margin: 70px auto; padding: 30px; display: grid; grid-template-columns: auto 1fr; gap: 12px 18px; }
.login-card form { grid-column: 2; }
.status-mark { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; color: white; background: var(--accent); font-size: 22px; }
label { display: block; margin-bottom: 8px; font-size: 13px; font-weight: 700; }
.input-row { display: flex; gap: 10px; }
input[type="password"] { min-width: 0; flex: 1; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; background: white; outline: none; }
input[type="password"]:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(20,108,75,.13); }
.workspace { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 22px; align-items: start; }
.upload-card, .files-card { padding: 26px; }
.section-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 20px; }
.limit { color: var(--muted); font-size: 12px; }
.drop-zone { margin: 0; min-height: 210px; padding: 32px; border: 1.5px dashed #9eaaa2; border-radius: 14px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; color: var(--muted); cursor: pointer; transition: .18s ease; text-align: center; }
.drop-zone:hover, .drop-zone.dragging { background: var(--tint); border-color: var(--accent); transform: translateY(-1px); }
.drop-zone strong { color: var(--ink); font-size: 18px; }
.upload-icon { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; background: var(--tint); color: var(--accent); font-size: 26px; }
#fileInput { position: absolute; opacity: 0; pointer-events: none; }
.selection { margin: 14px 0; min-height: 50px; }
.selection.empty { color: var(--muted); display: grid; place-items: center; border: 1px solid var(--line); border-radius: 10px; font-size: 13px; }
.file-chip { display: flex; justify-content: space-between; gap: 12px; padding: 10px 12px; margin-top: 8px; background: #f0f2ed; border-radius: 9px; font-size: 13px; }
.file-chip span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.button { border: 1px solid transparent; border-radius: 10px; padding: 10px 15px; font-weight: 700; cursor: pointer; transition: .16s ease; }
.button:disabled { cursor: not-allowed; opacity: .45; }
.button.primary { background: var(--accent); color: white; }
.button.primary:hover:not(:disabled) { background: var(--accent-dark); }
.button.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.button.ghost:hover { background: #ebece7; }
.button.wide { width: 100%; padding: 13px; }
.message { min-height: 22px; margin: 12px 0 0; font-size: 13px; }
.message.error { color: var(--danger); }
.message.success { color: var(--accent); }
.progress-wrap { margin-top: 15px; color: var(--muted); font-size: 12px; }
.progress-track { height: 7px; overflow: hidden; background: #e1e4de; border-radius: 10px; margin-bottom: 6px; }
.progress-bar { height: 100%; width: 0; background: var(--accent); transition: width .15s linear; }
.files-state { display: grid; place-items: center; min-height: 260px; color: var(--muted); }
.breadcrumb { min-height: 38px; margin: -7px 0 12px; padding: 8px 10px; display: flex; align-items: center; flex-wrap: wrap; gap: 5px; background: #f0f2ed; border-radius: 9px; }
.crumb { border: 0; padding: 2px 4px; background: transparent; color: var(--accent); cursor: pointer; font-weight: 700; }
.crumb:hover { text-decoration: underline; }
.crumb-separator { color: #9aa39d; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { color: var(--muted); text-align: left; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
th, td { padding: 13px 10px; border-bottom: 1px solid var(--line); }
td:first-child { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 650; }
.entry-button { max-width: 100%; border: 0; padding: 4px 0; background: transparent; color: var(--accent); cursor: pointer; font-weight: 750; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; }
.entry-button:hover { text-decoration: underline; }
.download-button { border: 0; padding: 5px 8px; border-radius: 7px; background: var(--tint); color: var(--accent-dark); cursor: pointer; font-size: 12px; font-weight: 750; }
.download-button:hover { background: #caead9; }
.hidden { display: none !important; }

@media (max-width: 820px) {
  .shell { padding-top: 30px; }
  .workspace { grid-template-columns: 1fr; }
  .topbar { align-items: center; }
}

@media (max-width: 520px) {
  .shell { width: min(100% - 20px, 1120px); }
  .login-card, .upload-card, .files-card { padding: 20px; }
  .login-card { grid-template-columns: 1fr; margin-top: 36px; }
  .login-card form { grid-column: 1; }
  .status-mark { display: none; }
  .input-row { flex-direction: column; }
  .section-head { align-items: flex-start; }
}
