:root {
  color-scheme: light;
  --paper: #eeebe1;
  --paper-deep: #e1ddd0;
  --ink: #17201d;
  --green: #245e49;
  --green-dark: #173d31;
  --orange: #e8542e;
  --lime: #c7f04f;
  --line: rgba(23, 32, 29, 0.22);
  --muted: #6d746f;
}

* { box-sizing: border-box; }

html { min-height: 100%; background: var(--paper); }

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family: "Avenir Next", "PingFang SC", "Microsoft YaHei", sans-serif;
  background:
    linear-gradient(90deg, transparent 49.9%, rgba(23, 32, 29, 0.08) 50%, transparent 50.1%),
    radial-gradient(circle at 88% 8%, rgba(232, 84, 46, 0.13), transparent 28rem),
    var(--paper);
}

button, input, textarea { font: inherit; }
button { color: inherit; }

.masthead {
  position: sticky;
  z-index: 10;
  top: 0;
  height: 68px;
  padding: 0 clamp(20px, 4vw, 64px);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  border-bottom: 1px solid var(--ink);
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(18px);
}

.brand, .text-button {
  font-family: "Avenir Next Condensed", "DIN Condensed", sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.brand { color: inherit; text-decoration: none; }
.text-button { border: 0; padding: 6px 0; background: none; cursor: pointer; }
.masthead .text-button { justify-self: end; }

.system-state {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--green);
  font-size: 12px;
  font-weight: 700;
}

.pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 0 5px rgba(199, 240, 79, 0.2);
}

.shell { width: min(1500px, 100%); margin: 0 auto; padding: 0 clamp(20px, 4vw, 64px) 80px; }

.hero {
  min-height: 520px;
  padding: clamp(70px, 10vh, 130px) 0 80px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.42fr);
  align-items: end;
  gap: clamp(48px, 9vw, 150px);
  border-bottom: 1px solid var(--ink);
}

.kicker {
  margin: 0 0 24px;
  color: var(--green);
  font-family: "Avenir Next Condensed", "DIN Condensed", sans-serif;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.2em;
}

h1 {
  margin: 0;
  font-family: "Songti SC", "STSong", "Noto Serif CJK SC", serif;
  font-size: clamp(68px, 9.5vw, 148px);
  font-weight: 400;
  letter-spacing: -0.08em;
  line-height: 0.83;
}

h1 em { color: var(--green); font-weight: 400; }

.hero-note { padding-top: 20px; border-top: 8px solid var(--orange); }
.hero-note span { color: var(--orange); font-size: 12px; font-weight: 800; letter-spacing: 0.15em; }
.hero-note strong { display: block; margin-top: 18px; font-family: "Songti SC", serif; font-size: clamp(25px, 3vw, 39px); font-weight: 400; line-height: 1.25; }
.hero-note p { margin: 20px 0 0; color: var(--muted); line-height: 1.8; }

.metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-bottom: 1px solid var(--ink);
}

.metrics article { min-height: 132px; padding: 24px; display: flex; flex-direction: column; justify-content: space-between; border-right: 1px solid var(--line); }
.metrics article:last-child { border-right: 0; }
.metrics span { color: var(--muted); font-size: 12px; letter-spacing: 0.12em; }
.metrics strong { font-family: "Avenir Next Condensed", sans-serif; font-size: clamp(32px, 4vw, 58px); line-height: 1; }

.workspace { display: grid; grid-template-columns: minmax(0, 0.95fr) minmax(420px, 1.05fr); gap: 0; }
.composer, .queue { padding: 52px clamp(24px, 4vw, 58px) 64px 0; }
.queue { padding-right: 0; padding-left: clamp(24px, 4vw, 58px); border-left: 1px solid var(--ink); }

.section-heading { margin-bottom: 36px; display: grid; grid-template-columns: 44px 1fr auto; gap: 16px; align-items: start; }
.section-heading > span { color: var(--orange); font-family: "Avenir Next Condensed", sans-serif; font-weight: 800; }
.section-heading h2 { margin: 0; font-family: "Songti SC", serif; font-size: 30px; font-weight: 400; }
.section-heading p { margin: 8px 0 0; color: var(--muted); font-size: 13px; line-height: 1.6; }

.composer { display: grid; grid-template-columns: 1fr 1fr; gap: 24px 18px; }
.composer .section-heading, .field-wide, .submit-zone { grid-column: 1 / -1; }

.field { display: grid; gap: 9px; }
.field > span, .targets legend { font-size: 12px; font-weight: 800; letter-spacing: 0.08em; }
.field small { color: var(--muted); }

input, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 0;
  padding: 14px 15px;
  color: var(--ink);
  outline: 0;
  background: rgba(255, 255, 255, 0.28);
}

input:focus, textarea:focus { border-color: var(--green); box-shadow: inset 4px 0 0 var(--lime); }
textarea { resize: vertical; line-height: 1.7; }
input[type="file"] { padding: 11px; }
input[type="file"]::file-selector-button { margin-right: 14px; border: 0; padding: 9px 12px; color: white; background: var(--green); cursor: pointer; }

.targets { margin: 0; padding: 20px; border: 1px solid var(--line); }
.targets legend { padding: 0 8px; }
.target-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.target {
  position: relative;
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid transparent;
  background: rgba(255,255,255,0.25);
  cursor: pointer;
}
.target:has(input:checked) { border-color: var(--green); background: rgba(36,94,73,0.1); }
.target input { width: auto; accent-color: var(--green); }
.target small { margin-left: auto; color: var(--muted); }

.submit-zone { margin-top: 8px; padding-top: 20px; border-top: 1px solid var(--ink); }
.submit-zone p { min-height: 22px; margin: 14px 0; color: var(--muted); font-size: 13px; }
.progress-track { height: 5px; overflow: hidden; background: var(--paper-deep); }
.progress-track span { display: block; width: 0; height: 100%; background: var(--orange); transition: width 180ms ease; }

.primary-button {
  min-height: 52px;
  border: 1px solid var(--green-dark);
  padding: 0 24px;
  color: white;
  font-weight: 800;
  letter-spacing: 0.08em;
  background: var(--green);
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease;
}
.primary-button:hover { transform: translate(-3px, -3px); box-shadow: 5px 5px 0 var(--lime); }
.primary-button:disabled { opacity: 0.5; cursor: wait; transform: none; box-shadow: none; }

.task-list { display: grid; gap: 12px; }
.empty-state { padding: 70px 20px; color: var(--muted); text-align: center; border: 1px dashed var(--line); }
.task-card { position: relative; display: grid; grid-template-columns: 66px 1fr auto; border: 1px solid var(--line); background: rgba(255,255,255,0.22); animation: rise 280ms ease both; }
.task-index { display: grid; place-items: start center; padding-top: 21px; color: var(--green); font-family: "Avenir Next Condensed", sans-serif; font-size: 24px; font-weight: 800; border-right: 1px solid var(--line); }
.task-body { min-width: 0; padding: 20px; }
.task-topline { display: flex; justify-content: space-between; gap: 14px; }
.task-meta { margin: 0 0 5px; color: var(--muted); font-size: 11px; letter-spacing: 0.08em; }
.task-card h3 { margin: 0; font-family: "Songti SC", serif; font-size: 21px; font-weight: 400; }
.status-badge { height: fit-content; padding: 5px 8px; color: var(--green-dark); font-size: 11px; font-weight: 800; background: var(--lime); white-space: nowrap; }
.task-caption { max-height: 3.4em; overflow: hidden; margin: 16px 0; color: var(--muted); font-size: 13px; line-height: 1.7; }
.task-targets { display: flex; flex-wrap: wrap; gap: 5px; }
.task-targets span { padding: 4px 7px; border: 1px solid var(--line); font-size: 10px; }
.task-file { margin-top: 14px; font-size: 12px; font-weight: 700; }
.task-error { margin: 12px 0 0; color: #a72715; font-size: 12px; }
.delete-button { align-self: stretch; width: 48px; border: 0; border-left: 1px solid var(--line); color: var(--muted); background: transparent; writing-mode: vertical-rl; letter-spacing: 0.15em; cursor: pointer; }
.delete-button:hover { color: white; background: var(--orange); }

.login-dialog { width: min(480px, calc(100% - 32px)); border: 1px solid var(--ink); padding: 0; color: var(--ink); background: var(--paper); box-shadow: 20px 20px 0 rgba(23,32,29,0.2); }
.login-dialog::backdrop { background: rgba(23, 32, 29, 0.76); backdrop-filter: blur(7px); }
.login-dialog form { padding: 42px; }
.login-dialog h2 { margin: 0; font-family: "Songti SC", serif; font-size: 34px; font-weight: 400; }
.login-dialog form > p:not(.kicker) { color: var(--muted); line-height: 1.7; }
.login-dialog .field { margin: 28px 0 18px; }
.error-message { min-height: 22px; color: #a72715 !important; font-size: 12px; }

@keyframes rise { from { opacity: 0; transform: translateY(10px); } }

@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; }
  .hero-note { width: min(520px, 100%); margin-left: auto; }
  .workspace { grid-template-columns: 1fr; }
  .composer { padding-right: 0; }
  .queue { padding-left: 0; border-top: 1px solid var(--ink); border-left: 0; }
}

@media (max-width: 640px) {
  body { background: var(--paper); }
  .masthead { grid-template-columns: 1fr auto; }
  .system-state { display: none; }
  .hero { min-height: auto; padding-top: 60px; }
  .metrics { grid-template-columns: 1fr 1fr; }
  .metrics article:nth-child(2) { border-right: 0; }
  .metrics article:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .composer { grid-template-columns: 1fr; }
  .field, .field-wide, .submit-zone { grid-column: 1; }
  .target-grid { grid-template-columns: 1fr; }
  .task-card { grid-template-columns: 52px 1fr; }
  .delete-button { grid-column: 1 / -1; width: 100%; height: 38px; border-top: 1px solid var(--line); border-left: 0; writing-mode: initial; }
}
