:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  --page: #f7f6f2;
  --surface: #ffffff;
  --ink: #24332e;
  --muted: #69746f;
  --line: #e4e9e3;
  --accent: #315d4f;
  --accent-hover: #254c40;
  --soft-accent: #eaf2eb;
  --danger: #9c3f35;
}

* { box-sizing: border-box; }

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

body {
  min-width: 320px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  color: var(--ink);
  background: var(--page);
}

button, textarea, input { font: inherit; }

button { cursor: pointer; }

button:disabled { cursor: not-allowed; opacity: .52; }

[hidden] { display: none !important; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.app-shell {
  width: min(100% - 36px, 650px);
  margin: 0 auto;
  padding: max(18px, env(safe-area-inset-top)) 0 max(40px, env(safe-area-inset-bottom));
}

.topbar {
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .02em;
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: var(--accent);
  background: var(--soft-accent);
  border-radius: 11px;
}

.brand-mark svg { width: 23px; height: 23px; }

.text-button {
  padding: 9px 0 9px 10px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
}

.text-button:hover { color: var(--ink); }

.workspace-view, .login-view { padding-top: 39px; }

.hero { padding-bottom: 28px; }

.eyebrow {
  color: var(--accent);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: .13em;
}

h1, h2, p { margin-top: 0; }

h1 {
  margin: 13px 0 12px;
  font-size: clamp(30px, 7.6vw, 43px);
  line-height: 1.27;
  letter-spacing: -.035em;
}

.lede {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.7;
}

.work-card, .login-card, .task-card {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: 0 8px 30px rgba(31, 54, 42, .035);
}

.section-heading {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  margin-bottom: 17px;
}

.section-number {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 29px;
  height: 29px;
  border-radius: 9px;
  color: var(--accent);
  background: var(--soft-accent);
  font-size: 11px;
  font-weight: 800;
}

h2 { margin: 1px 0 3px; font-size: 17px; line-height: 1.4; }

.section-heading p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }

textarea, .login-card input {
  display: block;
  width: 100%;
  border: 1px solid #d8e1d8;
  border-radius: 12px;
  background: #fbfcfa;
  color: var(--ink);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}

textarea:focus, .login-card input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(49, 93, 79, .11);
}

textarea {
  min-height: 133px;
  padding: 14px 15px;
  resize: vertical;
  font-size: 15px;
  line-height: 1.6;
}

textarea::placeholder { color: #9aa59c; }

.link-actions { display: flex; gap: 10px; margin-top: 14px; }

.button {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 18px;
  border: 1px solid transparent;
  border-radius: 11px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
  text-decoration: none;
  text-align: center;
  transition: background-color .15s, border-color .15s, transform .15s;
}

.button:not(:disabled):active { transform: translateY(1px); }

.button-primary { color: #fff; background: var(--accent); }
.button-primary:not(:disabled):hover { background: var(--accent-hover); }
.button-secondary { border-color: var(--line); color: var(--accent); background: #fff; }
.button-secondary:not(:disabled):hover { background: var(--soft-accent); }
.link-actions .button-primary { flex: 1; }

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 23px 0;
  color: #7d8780;
  font-size: 12px;
  white-space: nowrap;
}

.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.file-picker {
  min-height: 96px;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 17px;
  border: 1.5px dashed #b8cbb9;
  border-radius: 13px;
  background: #f9fbf8;
  cursor: pointer;
}

.file-picker:hover, .file-picker:focus-within { border-color: var(--accent); background: #f3f8f2; }

.file-picker-icon {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 37px;
  height: 37px;
  border-radius: 11px;
  color: var(--accent);
  background: var(--soft-accent);
  font-size: 26px;
  font-weight: 300;
}

.file-picker-label { flex: 0 0 auto; font-size: 14px; font-weight: 700; }

.selected-file {
  min-width: 0;
  margin-left: auto;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upload-button { width: 100%; margin-top: 14px; }

.format-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 24px 3px 0;
}

.format-row strong, .format-row span { display: block; }
.format-row strong { margin-bottom: 4px; font-size: 13px; }
.format-row div > span { color: var(--muted); font-size: 12px; line-height: 1.5; }

.format-choice {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}

.format-choice input { width: 15px; height: 15px; margin: 0; accent-color: var(--accent); }

.action-error, .field-error {
  margin: 15px 0 0;
  color: var(--danger);
  font-size: 13px;
  line-height: 1.6;
}

.task-card { margin-top: 25px; border-color: #cedfd0; background: #f9fcf8; }
.task-card[data-state="failed"], .task-card[data-state="expired"] { border-color: #e7d7cf; background: #fffaf7; }

.task-topline { display: flex; align-items: center; gap: 9px; }

.task-indicator { width: 9px; height: 9px; border-radius: 50%; background: #a9b9ad; }
.task-card[data-state="active"] .task-indicator { background: #5b9d71; animation: pulse 1.3s ease-in-out infinite; }
.task-card[data-state="completed"] .task-indicator { background: #3e8862; }
.task-card[data-state="failed"] .task-indicator, .task-card[data-state="expired"] .task-indicator { background: #bd7c68; }
.task-status { font-size: 14px; font-weight: 750; }
.task-message { margin: 9px 0 0 18px; color: var(--muted); font-size: 13px; line-height: 1.65; }
.download-button { width: 100%; margin-top: 17px; }
.download-hint { margin: 9px 0 0; color: var(--muted); font-size: 11px; line-height: 1.6; text-align: center; }
.footer-note { max-width: 570px; margin: 26px auto 0; color: #87918b; font-size: 11px; line-height: 1.7; text-align: center; }

.login-view { max-width: 430px; margin: 0 auto; padding-top: clamp(70px, 14vh, 145px); }
.login-view h1 { font-size: 38px; }
.login-card { margin-top: 29px; }
.login-card label { display: block; margin-bottom: 9px; font-size: 13px; font-weight: 700; }
.login-card input { height: 47px; padding: 0 13px; }
.login-card .button { width: 100%; margin-top: 16px; }

@keyframes pulse { 50% { opacity: .4; transform: scale(1.35); } }

@media (max-width: 440px) {
  .app-shell { width: calc(100% - 32px); }
  .workspace-view { padding-top: 35px; }
  .work-card, .task-card { padding: 18px; border-radius: 18px; }
  .file-picker { flex-wrap: wrap; }
  .selected-file { flex-basis: 100%; margin: -3px 0 0 50px; }
}

@media (prefers-reduced-motion: reduce) {
  .task-card[data-state="active"] .task-indicator { animation: none; }
  .button, textarea, .login-card input { transition: none; }
}
