:root {
  color-scheme: light;
  --ink: #1b1e1d;
  --muted: #6f726d;
  --paper: #f6f4ed;
  --card: #fffdf8;
  --line: #ddd9cd;
  --accent: #155c50;
  --accent-dark: #0e433b;
  --accent-soft: #dcebe5;
  --danger: #a33c2d;
  --shadow: 0 20px 55px rgba(39, 45, 40, 0.08);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
html { background: var(--paper); }
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 88% 3%, rgba(21, 92, 80, 0.12), transparent 26rem),
    linear-gradient(180deg, #fbfaf5 0, var(--paper) 42rem);
  min-height: 100vh;
  min-height: 100dvh;
}
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
.hidden { display: none !important; }
.shell { width: min(100%, 720px); margin: 0 auto; padding: 0 20px calc(96px + env(safe-area-inset-bottom)); }
.offline-banner {
  position: sticky; top: 0; z-index: 20; padding: calc(8px + env(safe-area-inset-top)) 16px 8px;
  color: white; background: var(--danger); text-align: center; font-size: 13px;
}
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(18px + env(safe-area-inset-top)) 0 12px;
}
.brand { display: flex; align-items: center; gap: 11px; color: inherit; text-decoration: none; }
.brand img { border-radius: 12px; box-shadow: 0 6px 18px rgba(20, 62, 54, 0.18); }
.brand span { display: grid; gap: 2px; }
.brand strong { font-size: 19px; letter-spacing: .12em; }
.brand small { color: var(--muted); font-size: 11px; }
.private-badge { padding: 7px 10px; border-radius: 999px; color: var(--accent); background: var(--accent-soft); font-size: 11px; font-weight: 700; }
.text-button, .soft-button, .guide-link, .close-button {
  border: 0; background: transparent; color: var(--accent); cursor: pointer;
}
.text-button { padding: 10px 2px 10px 14px; font-weight: 650; }
.eyebrow { margin: 0 0 12px; color: var(--accent); font-size: 11px; font-weight: 800; letter-spacing: .2em; }
.muted { color: var(--muted); }

.login-card, .composer, .task-card, .guide-card, .install-card {
  border: 1px solid rgba(211, 207, 195, .9); background: rgba(255, 253, 248, .92);
  box-shadow: var(--shadow); border-radius: 25px;
}
.login-card { margin: 10vh 0 18vh; padding: 30px 24px; }
.login-card h1 { margin: 0 0 12px; font-size: clamp(34px, 10vw, 52px); letter-spacing: -.045em; }
.login-card > p { line-height: 1.7; }
form label, .advanced label { display: block; margin: 22px 0 8px; font-size: 13px; font-weight: 700; }
.field-row { display: flex; gap: 8px; }
input, textarea, select {
  width: 100%; color: var(--ink); background: white; border: 1px solid var(--line);
  border-radius: 15px; outline: none; transition: border-color .2s, box-shadow .2s;
}
input { min-height: 52px; padding: 0 14px; }
textarea { padding: 16px; line-height: 1.65; resize: vertical; min-height: 138px; }
select { min-height: 48px; padding: 0 12px; }
input:focus, textarea:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(21, 92, 80, .12); }

.primary, .secondary {
  min-height: 52px; border-radius: 15px; padding: 0 18px; font-weight: 750;
  cursor: pointer; transition: transform .15s, background .15s, opacity .15s;
}
.primary { border: 1px solid var(--accent); color: white; background: var(--accent); box-shadow: 0 10px 24px rgba(21, 92, 80, .2); }
.primary:active, .secondary:active { transform: scale(.985); }
.primary:hover { background: var(--accent-dark); }
.primary:disabled { cursor: wait; opacity: .55; }
.secondary { border: 1px solid var(--line); color: var(--ink); background: white; }
.compact { white-space: nowrap; }
.full { width: 100%; }
.link-button { display: grid; place-items: center; text-decoration: none; }
.disabled-link { pointer-events: none; cursor: wait; opacity: .55; }
.form-error { min-height: 20px; margin: 9px 2px 0; color: var(--danger); font-size: 13px; }

.hero { padding: 60px 3px 34px; }
.hero h1 { margin: 0; max-width: 620px; font-size: clamp(43px, 13vw, 76px); line-height: .98; letter-spacing: -.065em; }
.hero h1 em { color: var(--accent); font-style: normal; }
.hero > p:last-child { max-width: 530px; margin: 24px 0 0; color: var(--muted); line-height: 1.8; }
.compact-hero { padding: 16px 2px 12px; }
.compact-hero h1 { max-width: none; font-size: clamp(30px, 8.8vw, 48px); line-height: 1.08; white-space: nowrap; }
.composer, .task-card, .guide-card { padding: 22px; margin-bottom: 18px; }
.workflow-card, .compact-task { margin-bottom: 10px; }
.compact-head { margin-bottom: 11px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 17px; }
.section-head > div { display: flex; align-items: center; gap: 10px; }
.section-head h2 { margin: 0; font-size: 19px; }
.step { color: var(--accent); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; font-weight: 800; }
.soft-button { padding: 8px 13px; border-radius: 999px; background: var(--accent-soft); font-weight: 700; }
.compact-action { min-height: 46px; margin-top: 9px; }
.composer-locked textarea { background: #f0eee7; }
.soft-button:disabled { cursor: not-allowed; opacity: .48; }
.check-row { display: flex; align-items: flex-start; gap: 10px; margin: 16px 2px; color: #4c4f4b; font-size: 13px; line-height: 1.55; }
.check-row input { flex: 0 0 19px; min-height: auto; width: 19px; height: 19px; margin: 1px 0 0; accent-color: var(--accent); }
.advanced { margin: 0 0 16px; padding: 13px 15px; background: #f2f0e8; border-radius: 14px; }
.advanced summary { color: #4b4e49; cursor: pointer; font-size: 13px; font-weight: 700; }
.advanced p { margin: 10px 0 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.status-pill, .privacy-mark { color: var(--accent); background: var(--accent-soft); border-radius: 999px; padding: 7px 10px; font-size: 11px; font-weight: 750; }
.progress-track { overflow: hidden; height: 7px; margin: 5px 0 21px; background: #e6e2d8; border-radius: 999px; }
.progress-track span { display: block; width: 12%; height: 100%; background: var(--accent); border-radius: inherit; transition: width .45s ease; }
.task-card h3 { margin: 0 0 8px; font-size: 19px; }
.task-card p { line-height: 1.65; }
.task-actions { display: grid; gap: 9px; margin-top: 18px; }
.backup-save-block { display: grid; gap: 7px; margin-top: 22px; padding-top: 20px; border-top: 1px dashed #c8c1af; }
.backup-save-block > span { color: var(--muted); font-size: 11px; font-weight: 750; letter-spacing: .08em; }
.backup-save-block small { color: var(--muted); font-size: 10px; line-height: 1.45; text-align: center; }
.backup-button { min-height: 46px; border: 1px solid #c8b78b; border-radius: 15px; color: #594b2f; background: #fff9eb; font-weight: 750; }
.backup-button:active { transform: scale(.985); }
.guide-link { display: block; margin: 15px auto 0; text-decoration: underline; text-underline-offset: 3px; }
.guide-card { position: relative; border-color: rgba(21, 92, 80, .24); }
.guide-card h2 { margin: 0; }
.guide-card ol { padding-left: 22px; line-height: 1.8; }
.close-button { position: absolute; right: 13px; top: 10px; padding: 8px; font-size: 28px; line-height: 1; }

.more-heading { display: flex; align-items: flex-end; justify-content: space-between; padding: 28px 2px 18px; }
.more-heading .eyebrow { margin-bottom: 5px; }
.more-heading h1 { margin: 0; font-size: 42px; letter-spacing: -.045em; }
.bottom-tabs {
  position: fixed; z-index: 30; left: 50%; bottom: 0; transform: translateX(-50%);
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
  width: min(100%, 720px); padding: 8px 20px calc(8px + env(safe-area-inset-bottom));
  border-top: 1px solid rgba(211, 207, 195, .9); background: rgba(250, 249, 244, .92);
  -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
}
.tab-button {
  display: grid; grid-template-columns: auto auto; justify-content: center; align-items: center; gap: 7px;
  min-height: 48px; border: 0; border-radius: 15px; color: var(--muted); background: transparent;
  font-weight: 750; cursor: pointer;
}
.tab-button span { font-size: 18px; line-height: 1; }
.tab-button.active { color: white; background: var(--accent); }

.resume-paste {
  position: fixed; z-index: 40; left: 50%; bottom: calc(74px + env(safe-area-inset-bottom));
  transform: translateX(-50%); display: grid; grid-template-columns: 1fr auto; gap: 10px;
  align-items: center; width: min(calc(100% - 28px), 680px); padding: 14px 14px 14px 17px;
  border: 1px solid rgba(21, 92, 80, .24); border-radius: 20px; background: rgba(255, 253, 248, .98);
  box-shadow: 0 18px 48px rgba(17, 49, 43, .22);
}
.resume-paste span { display: grid; gap: 2px; }
.resume-paste strong { font-size: 14px; }
.resume-paste small { color: var(--muted); font-size: 11px; }
.resume-paste .primary { min-height: 42px; padding: 0 14px; font-size: 13px; }
.resume-close { position: absolute; top: -9px; right: -5px; width: 27px; height: 27px; border: 0; border-radius: 50%; color: white; background: #5d625e; font-size: 18px; line-height: 1; }

.history-section { padding: 34px 2px 24px; }
.history-list { display: grid; gap: 10px; }
.history-item { display: grid; grid-template-columns: 1fr auto; gap: 9px 14px; padding: 16px; border: 1px solid var(--line); border-radius: 17px; background: rgba(255,255,255,.55); }
.history-item strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.history-item time { color: var(--muted); font-size: 11px; }
.history-item .history-status { color: var(--accent); font-size: 12px; font-weight: 700; }
.history-item button { grid-column: 1 / -1; justify-self: start; padding: 0; border: 0; color: var(--accent); background: none; cursor: pointer; font-size: 12px; text-decoration: underline; }
.empty-state { padding: 24px; color: var(--muted); border: 1px dashed var(--line); border-radius: 17px; text-align: center; }
.install-card { display: grid; grid-template-columns: auto 1fr; gap: 15px; align-items: start; margin: 16px 0 40px; padding: 20px; }
.install-card h2 { margin: 0 0 7px; font-size: 17px; }
.install-card p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.65; }
.install-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 13px; color: white; background: var(--accent); font-size: 25px; }
footer { display: flex; justify-content: space-between; gap: 12px; padding-top: 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; }

@media (min-width: 600px) {
  .shell { padding-left: 30px; padding-right: 30px; }
  .composer, .task-card, .guide-card { padding: 28px; }
}
@media (max-width: 599px) {
  .shell { padding-left: 14px; padding-right: 14px; }
  .topbar { padding-top: calc(11px + env(safe-area-inset-top)); padding-bottom: 7px; }
  .brand { gap: 8px; }
  .brand img { width: 38px; height: 38px; border-radius: 10px; }
  .brand strong { font-size: 17px; }
  .brand small { display: none; }
  .compact-hero { padding-top: 9px; padding-bottom: 8px; }
  .composer, .task-card { padding: 14px; border-radius: 20px; }
  .section-head h2 { font-size: 17px; }
  .soft-button { padding: 7px 10px; font-size: 12px; }
  textarea { min-height: 82px; max-height: 108px; padding: 11px 12px; border-radius: 13px; font-size: 14px; line-height: 1.45; resize: none; }
  .form-error { min-height: 17px; margin-top: 5px; font-size: 12px; }
  .compact-task .progress-track { margin: 3px 0 12px; }
  .compact-task h3 { overflow: hidden; margin-bottom: 4px; font-size: 16px; text-overflow: ellipsis; white-space: nowrap; }
  .compact-task p { margin: 4px 0; font-size: 12px; line-height: 1.45; }
  .compact-task .task-actions { margin-top: 11px; }
  .compact-task .primary { min-height: 47px; font-size: 14px; }
  .guide-link { margin-top: 9px; font-size: 11px; }
  .bottom-tabs { padding-left: 14px; padding-right: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
