:root {
  color-scheme: light;
  --ink: #24251f;
  --muted: #83837b;
  --paper: #f6f5f1;
  --card: #fffefa;
  --line: #eae8e0;
  --green: #52684c;
  --green-dark: #3e5239;
  --green-soft: #edf2e9;
  --amber: #bb774a;
  --red: #b45c4e;
  --shadow: 0 18px 48px rgba(47, 48, 39, .07);
  font-family: "Aptos", "Microsoft YaHei UI", "PingFang SC", system-ui, sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); min-height: 100vh; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 3px solid #9eb292; outline-offset: 2px; }
.app-shell { min-height: 100vh; }
.loading-card, .auth-card { width: min(440px, calc(100vw - 32px)); margin: 12vh auto; padding: 38px; border-radius: 24px; background: var(--card); box-shadow: var(--shadow); }
.loading-card { text-align: center; color: var(--muted); }
.brand-mark { display: inline-grid; place-items: center; width: 48px; height: 48px; border-radius: 16px; background: var(--green-soft); }
.brand-mark img { width: 30px; height: 30px; }
.auth-card h1, .auth-card h2 { margin: 18px 0 8px; font-size: 28px; letter-spacing: -.04em; }
.auth-card p { color: var(--muted); line-height: 1.65; margin: 0 0 24px; }
.eyebrow { color: var(--green); font-size: 11px; font-weight: 750; letter-spacing: .14em; text-transform: uppercase; margin: 0 0 9px; }
.field-label { display: block; margin: 16px 0 7px; color: #55564f; font-size: 13px; font-weight: 650; }
.text-input { width: 100%; min-height: 45px; border: 1px solid var(--line); border-radius: 11px; background: #fff; color: var(--ink); padding: 10px 13px; }
.text-input::placeholder { color: #aaa99f; }
.text-area { resize: vertical; min-height: 100px; }
.button { border: 0; border-radius: 11px; padding: 11px 16px; font-weight: 650; transition: background .16s ease, transform .16s ease; }
.button:hover { transform: translateY(-1px); }
.button-primary { color: white; background: var(--green); }
.button-primary:hover { background: var(--green-dark); }
.button-quiet { color: #55564f; background: #f0efe9; }
.auth-card .button { width: 100%; margin-top: 18px; }
.form-error { color: var(--red) !important; min-height: 20px; font-size: 13px; margin: 12px 0 0 !important; }
.hint { color: var(--muted); font-size: 12px; margin-top: 12px; }

.dashboard { width: min(1030px, calc(100vw - 48px)); margin: 0 auto; padding: 34px 0 64px; }
.topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 42px; }
.brand { display: flex; align-items: center; gap: 11px; font-weight: 750; letter-spacing: -.03em; }
.brand .brand-mark { width: 38px; height: 38px; border-radius: 13px; }
.brand .brand-mark img { width: 24px; height: 24px; }
.topbar-actions { display: flex; gap: 9px; align-items: center; }
.icon-button { display: inline-grid; place-items: center; width: 38px; height: 38px; border: 1px solid var(--line); background: var(--card); color: var(--muted); border-radius: 12px; font-size: 20px; }
.icon-button:hover { color: var(--ink); background: #f2f1ec; }
.install-button { display: none; border: 1px solid var(--line); background: var(--card); color: var(--green-dark); border-radius: 10px; padding: 9px 12px; font-size: 13px; font-weight: 650; }
.install-button.show { display: inline-flex; }
.hero { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 24px; margin-bottom: 28px; }
.hero-date { color: var(--green); font-size: 13px; font-weight: 650; margin: 0 0 12px; }
.hero h1 { font-size: clamp(32px, 5vw, 46px); line-height: 1.1; letter-spacing: -.055em; margin: 0; }
.hero-subtitle { color: var(--muted); margin: 12px 0 0; }
.progress-badge { border: 1px solid #e0e7da; background: var(--green-soft); color: var(--green-dark); padding: 11px 14px; border-radius: 14px; white-space: nowrap; font-size: 13px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 24px; }
.stat-card { padding: 17px 19px; background: var(--card); border: 1px solid rgba(234,232,224,.85); border-radius: 15px; }
.stat-label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 7px; }
.stat-value { font-size: 25px; letter-spacing: -.05em; font-weight: 700; }
.composer { display: flex; align-items: center; gap: 10px; padding: 10px; background: var(--card); border: 1px solid var(--line); border-radius: 17px; box-shadow: 0 8px 25px rgba(47,48,39,.035); }
.composer-mark { flex: 0 0 22px; height: 22px; border: 1.5px solid #c5c8bd; border-radius: 50%; margin-left: 6px; }
.composer input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 15px; color: var(--ink); padding: 10px 2px; }
.composer input::placeholder { color: #a09f96; }
.composer-date { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; white-space: nowrap; }
.composer-date input { width: 118px; padding: 8px 0; font-size: 12px; color: #686960; }
.composer .button { padding: 10px 16px; }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin: 30px 0 13px; }
.tabs { display: flex; gap: 4px; background: #ecebe5; padding: 4px; border-radius: 12px; }
.tab { border: 0; background: transparent; color: #77786e; border-radius: 9px; padding: 8px 13px; font-size: 13px; font-weight: 620; }
.tab.active { color: var(--ink); background: var(--card); box-shadow: 0 1px 4px rgba(34,35,28,.08); }
.search-box { width: min(235px, 38vw); border: 1px solid var(--line); background: var(--card); border-radius: 10px; padding: 9px 12px; color: var(--ink); font-size: 13px; }
.task-list { display: grid; gap: 9px; }
.task-row { display: grid; grid-template-columns: 76px minmax(0, 1fr) auto; align-items: center; gap: 13px; padding: 15px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); transition: border .16s ease, transform .16s ease; }
.task-row:hover { border-color: #d6dccf; transform: translateY(-1px); }
.task-toggle { min-width: 72px; min-height: 34px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid #dce4d7; border-radius: 999px; background: var(--green-soft); color: var(--green-dark); padding: 6px 9px; font-size: 12px; font-weight: 700; white-space: nowrap; transition: background .16s ease, border-color .16s ease; }
.task-toggle:hover { background: #e2ebdc; border-color: #c5d2bf; }
.task-toggle::before { content: ""; display: inline-grid; place-items: center; width: 15px; height: 15px; flex: 0 0 15px; border: 1.5px solid #84947d; border-radius: 50%; }
.task-toggle.is-complete { background: #f2f2ee; border-color: #e3e2db; color: #85857d; }
.task-toggle.is-complete::before { content: "✓"; border-color: var(--green); background: var(--green); color: #fff; font-size: 10px; line-height: 1; }
.task-main { min-width: 0; }
.task-title { border: 0; padding: 0; background: none; text-align: left; color: var(--ink); font-size: 14px; font-weight: 650; line-height: 1.5; overflow-wrap: anywhere; }
.task-title:hover { color: var(--green-dark); }
.task-row.is-complete .task-title { color: #9b9b92; text-decoration: line-through; text-decoration-thickness: 1px; }
.task-notes { margin: 3px 0 0; color: #929188; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-meta { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 11px; margin-top: 7px; }
.task-date { display: inline-flex; align-items: center; gap: 4px; }
.task-date.overdue { color: var(--red); }
.priority-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: #b2b2a7; }
.priority-dot.high { background: var(--amber); }
.priority-dot.low { background: #adb4a6; }
.task-actions { display: flex; gap: 4px; opacity: 0; transition: opacity .15s ease; }
.task-row:hover .task-actions, .task-actions:focus-within { opacity: 1; }
.task-actions .icon-button { width: 32px; height: 32px; border-color: transparent; background: transparent; font-size: 17px; }
.empty-state { text-align: center; padding: 56px 20px; border: 1px dashed #d9d8d0; border-radius: 16px; color: var(--muted); }
.empty-art { display: inline-grid; place-items: center; width: 54px; height: 54px; margin-bottom: 12px; border-radius: 18px; background: var(--green-soft); color: var(--green); font-size: 24px; }
.empty-state h3 { color: var(--ink); font-size: 16px; margin: 0 0 6px; }
.empty-state p { margin: 0; font-size: 13px; }
.footer-note { margin-top: 26px; text-align: center; color: #a09f96; font-size: 11px; }

.modal { width: min(500px, calc(100vw - 28px)); max-width: 100%; padding: 0; border: 0; background: transparent; color: var(--ink); }
.modal::backdrop { background: rgba(34, 35, 29, .35); backdrop-filter: blur(3px); }
.modal-card { padding: 26px; border-radius: 20px; background: var(--card); box-shadow: var(--shadow); }
.modal-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.modal-heading h2 { margin: 0; font-size: 22px; letter-spacing: -.04em; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 8px; }

@media (max-width: 650px) {
  .dashboard { width: min(100% - 28px, 540px); padding: 22px 0 44px; }
  .topbar { margin-bottom: 31px; }
  .hero { grid-template-columns: 1fr; align-items: start; gap: 16px; }
  .progress-badge { justify-self: start; }
  .stats { gap: 7px; }
  .stat-card { padding: 13px 12px; }
  .stat-value { font-size: 21px; }
  .composer { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 5px 9px; }
  .composer input:first-of-type { grid-column: 2 / 4; }
  .composer-date { grid-column: 2; }
  .composer-date input { width: 112px; }
  .composer .button { grid-column: 3; grid-row: 2; }
  .toolbar { align-items: flex-start; flex-direction: column; margin-top: 25px; }
  .tabs { width: 100%; justify-content: space-between; }
  .tab { flex: 1; padding-inline: 6px; }
  .search-box { width: 100%; }
  .task-row { grid-template-columns: 72px minmax(0, 1fr) auto; gap: 9px; padding: 13px 10px; }
  .task-toggle { min-width: 68px; padding-inline: 7px; }
  .task-actions { opacity: 1; }
  .task-actions .icon-button { width: 28px; }
  .install-button { padding: 8px 9px; font-size: 12px; }
  .auth-card { padding: 28px 23px; }
}
