:root {
  --paper: #f6f2e9;
  --ink: #1c2824;
  --muted: #73807a;
  --card: rgba(255,255,255,.82);
  --line: rgba(28,40,36,.09);
  --green: #214f43;
  --shadow: 0 14px 34px rgba(38,51,45,.10);
}
* { box-sizing: border-box; }
html { background: var(--paper); }
body {
  margin: 0; min-height: 100vh; color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: radial-gradient(circle at 85% 8%, #dce9de 0, transparent 28%), var(--paper);
}
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
.app-shell { width: min(100%, 620px); margin: 0 auto; padding: max(22px, env(safe-area-inset-top)) 18px 110px; }
.topbar { display: flex; align-items: center; justify-content: space-between; margin: 8px 2px 22px; }
.top-actions { display: flex; align-items: center; gap: 9px; }
.new-task-button { height: 42px; padding: 0 15px; border: 0; border-radius: 14px; color: white; background: var(--green); box-shadow: 0 10px 22px rgba(33,79,67,.20); font-weight: 700; }
.eyebrow { margin: 0 0 4px; color: var(--muted); font-size: 13px; letter-spacing: .04em; }
h1 { margin: 0; font-family: Georgia, "Songti SC", serif; font-size: 34px; letter-spacing: -.04em; }
.icon-button { width: 44px; height: 44px; border: 0; border-radius: 50%; background: rgba(255,255,255,.75); color: var(--green); box-shadow: var(--shadow); font-size: 23px; }
.summary-card { padding: 20px; border-radius: 24px; color: white; background: linear-gradient(135deg, #214f43, #3d7565); box-shadow: 0 18px 40px rgba(33,79,67,.22); }
.progress-copy { display: flex; justify-content: space-between; align-items: baseline; }
.progress-copy span { font-size: 14px; opacity: .8; }
.progress-copy strong { font-size: 22px; }
.progress-track { height: 7px; margin: 15px 0 13px; overflow: hidden; border-radius: 10px; background: rgba(255,255,255,.18); }
.progress-bar { height: 100%; width: 0; border-radius: inherit; background: #f5d68b; transition: width .25s ease; }
.summary-card p { margin: 0; font-size: 13px; opacity: .82; }
.view-tabs { display: grid; grid-template-columns: repeat(3,1fr); gap: 4px; margin: 24px 0 16px; padding: 4px; border-radius: 15px; background: rgba(37,60,51,.07); }
.tab { padding: 9px; border: 0; border-radius: 11px; color: var(--muted); background: transparent; font-weight: 600; }
.tab.active { color: var(--ink); background: white; box-shadow: 0 3px 12px rgba(33,50,44,.08); }
.quadrant-grid { display: grid; gap: 13px; }
.quadrant { overflow: hidden; border: 1px solid var(--line); border-radius: 21px; background: var(--card); box-shadow: 0 8px 22px rgba(42,55,49,.06); }
.quadrant-header { display: flex; align-items: center; gap: 11px; padding: 15px 16px 12px; }
.q-number { display: grid; place-items: center; width: 29px; height: 29px; border-radius: 10px; font-weight: 700; font-size: 13px; background: var(--q-soft); color: var(--q); }
.quadrant-header h2 { margin: 0; font-size: 16px; }
.quadrant-header p { margin: 2px 0 0; color: var(--muted); font-size: 12px; }
.task-count { margin-left: auto; color: var(--muted); font-size: 12px; }
.task-list { padding: 0 11px 10px; }
.task-card { display: flex; gap: 11px; align-items: flex-start; padding: 12px 7px; border-top: 1px solid var(--line); }
.check { flex: 0 0 auto; width: 22px; height: 22px; border: 2px solid var(--q); border-radius: 50%; background: transparent; }
.task-card.done .check { background: var(--q); box-shadow: inset 0 0 0 4px white; }
.task-card.done .task-title { color: #9aa39f; text-decoration: line-through; }
.task-main { min-width: 0; flex: 1; }
.task-title { margin: 0; font-weight: 650; line-height: 1.35; }
.task-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 5px; color: var(--muted); font-size: 11px; }
.deadline-text { color: #9a681f; font-weight: 650; }
.urgency-badge { display: inline-flex; margin-top: 7px; padding: 3px 7px; border-radius: 7px; font-size: 10px; font-weight: 750; }
.urgency-badge.soon { color: #9a681f; background: #fff0cf; }
.urgency-badge.overdue { color: #b23b3b; background: #ffe4df; }
.task-actions { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
.deadline-task { max-width: 112px; border: 0; padding: 5px 8px; border-radius: 9px; color: #315e50; background: #e8f1ed; font-size: 11px; line-height: 1.25; }
.snooze-task { border: 0; padding: 5px 8px; border-radius: 9px; color: #9a681f; background: #fff0cf; font-size: 11px; white-space: nowrap; }
.edit-task { border: 0; padding: 5px 8px; border-radius: 9px; color: var(--green); background: #edf3f0; font-size: 12px; font-weight: 700; }
.empty-state { width: 100%; padding: 10px 7px 13px; border: 0; border-top: 1px solid var(--line); color: var(--green); background: transparent; font-size: 12px; text-align: left; }
.add-button { position: fixed; z-index: 20; right: max(22px, calc((100vw - 620px)/2 + 22px)); bottom: max(25px, env(safe-area-inset-bottom)); width: 58px; height: 58px; border: 0; border-radius: 19px; color: white; background: var(--green); box-shadow: 0 15px 30px rgba(33,79,67,.33); font-size: 31px; line-height: 1; }
.sheet { width: min(calc(100% - 20px), 600px); max-height: 90vh; overflow-y: auto; margin: auto auto 0; padding: 8px 20px max(25px, env(safe-area-inset-bottom)); border: 0; border-radius: 26px 26px 0 0; color: var(--ink); background: #fffefa; }
.sheet::backdrop { background: rgba(18,27,23,.36); backdrop-filter: blur(4px); }
.sheet-handle { width: 42px; height: 5px; margin: 3px auto 6px; border-radius: 10px; background: #d9d9d4; }
.sheet-header { display: grid; grid-template-columns: 1fr 2fr 1fr; align-items: center; margin-bottom: 16px; }
.sheet-header h2 { text-align: center; font-size: 17px; }
.text-button { border: 0; padding: 8px 0; color: var(--muted); background: none; text-align: left; }
.text-button.primary { color: var(--green); text-align: right; font-weight: 700; }
label, legend { color: #66716c; font-size: 12px; font-weight: 600; }
input, textarea, select { width: 100%; margin-top: 7px; padding: 13px; border: 1px solid var(--line); border-radius: 13px; color: var(--ink); background: #f8f7f2; outline: none; }
input:focus, textarea:focus, select:focus { border-color: #7aa294; box-shadow: 0 0 0 3px rgba(122,162,148,.15); }
.field-row { display: grid; grid-template-columns: 1.2fr 1fr; gap: 10px; margin: 15px 0; }
fieldset { margin: 15px 0; padding: 0; border: 0; }
.deadline-box { padding: 13px; border: 1px solid rgba(178,123,45,.20); border-radius: 16px; background: #fffaf0; }
.deadline-box .field-row { margin: 10px 0 0; }
.field-help { margin: 9px 2px 0; color: var(--muted); font-size: 11px; }
.quadrant-picker { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.picker-option { padding: 11px; border: 1px solid var(--line); border-radius: 13px; color: var(--ink); background: white; text-align: left; font-size: 12px; }
.picker-option.selected { border-color: var(--q); background: var(--q-soft); box-shadow: inset 0 0 0 1px var(--q); }
.delete-button { width: 100%; margin-top: 14px; padding: 12px; border: 0; border-radius: 12px; color: #b23b3b; background: #fff0ee; }
.hidden { display: none; }
.compact-sheet { padding-bottom: 30px; }
.setting-row { display: flex; align-items: center; justify-content: space-between; padding: 15px 4px; border-top: 1px solid var(--line); }
.setting-row strong, .setting-row small { display: block; }
.setting-row small { margin-top: 3px; color: var(--muted); }
.pill-button { border: 0; border-radius: 20px; padding: 8px 13px; color: white; background: var(--green); }
.status-dot { width: 10px; height: 10px; border-radius: 50%; background: #d7a844; box-shadow: 0 0 0 5px #fbf2d9; }
.settings-note { color: var(--muted); font-size: 12px; line-height: 1.6; }
@media (min-width: 700px) { .quadrant-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 430px) {
  .new-task-button { padding: 0 11px; font-size: 13px; }
  h1 { font-size: 30px; }
}
