:root {
    --ink: #17221c;
    --muted: #7b857f;
    --paper: #f5f6f2;
    --card: #ffffff;
    --green: #1c6848;
    --green-light: #dcecdf;
    --line: #e7eae5;
    --danger: #c84c43;
    font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
    color: var(--ink);
    background: var(--paper);
    font-synthesis: none;
}

* { box-sizing: border-box; }
html { background: #dde1dc; }
body { margin: 0; min-width: 320px; background: var(--paper); }
button, input, textarea { font: inherit; }
button { color: inherit; }
button, .task-content { -webkit-tap-highlight-color: transparent; }
[v-cloak] { display: none; }
.reminder-card { min-width: 0; margin: 20px 0; padding: 17px; border: 1px solid var(--line); border-radius: 18px; background: var(--card); }
.reminder-card summary { cursor: pointer; font-size: 14px; font-weight: 700; }
.reminder-card summary span { float: right; color: var(--green); font-size: 12px; }
.reminder-card p { font-size: 12px; line-height: 1.6; color: var(--muted); }
.reminder-card fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.reminder-card .field { min-width: 0; }
/* Constrain the native time control on iOS to the card's content width. */
.reminder-card input[type="time"] { display: block; box-sizing: border-box; width: 100%; min-width: 0; max-width: 100%; -webkit-appearance: none; appearance: none; }
.reminder-toggle { display: flex; align-items: center; gap: 8px; margin: 16px 0; font-size: 13px; }
.reminder-toggle input { width: 18px; height: 18px; accent-color: var(--green); }
.reminder-card .save-button { width: 100%; min-height: 44px; }
.reminder-card .reminder-error { color: var(--danger); }
.sheet-visible { overflow: hidden; }

.auth-shell {
    width: 100%; min-height: 100vh; min-height: 100dvh; margin: 0 auto;
    padding: max(42px, env(safe-area-inset-top)) 22px calc(28px + env(safe-area-inset-bottom));
    display: flex; flex-direction: column; justify-content: center;
    background:
        radial-gradient(circle at 95% 5%, rgba(149, 194, 160, .38), transparent 220px),
        radial-gradient(circle at 0 100%, rgba(205, 223, 207, .45), transparent 260px),
        var(--paper);
}
.auth-loading { align-items: center; gap: 12px; color: var(--muted); font-size: 13px; }
.auth-loading p { margin: 0; }
.auth-hero { padding: 0 8px 31px; }
.brand-mark { width: 48px; height: 48px; display: flex; align-items: flex-end; gap: 4px; margin-bottom: 25px; padding: 11px; border-radius: 17px; background: var(--ink); box-shadow: 0 10px 25px rgba(23,34,28,.19); }
.brand-mark span { flex: 1; border-radius: 5px; background: #91c59f; }
.brand-mark span:nth-child(1) { height: 45%; }
.brand-mark span:nth-child(2) { height: 82%; }
.brand-mark span:nth-child(3) { height: 62%; }
.auth-hero .eyebrow { margin-bottom: 7px; }
.auth-hero h1 { margin: 0 0 9px; font: 600 clamp(36px, 11vw, 48px)/1.15 Georgia, "Songti SC", serif; letter-spacing: -.04em; }
.auth-hero > p:last-child { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.7; }
.auth-card { padding: 22px; border: 1px solid rgba(224,229,223,.9); border-radius: 27px; background: rgba(255,255,255,.91); box-shadow: 0 18px 50px rgba(34,53,41,.09); backdrop-filter: blur(10px); }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin-bottom: 23px; padding: 4px; border-radius: 14px; background: #edf0ec; }
.auth-tabs button { height: 39px; border: 0; border-radius: 11px; background: transparent; color: var(--muted); font-size: 13px; font-weight: 700; }
.auth-tabs button.active { background: white; color: var(--ink); box-shadow: 0 3px 11px rgba(30,42,34,.08); }
.auth-field { margin-bottom: 15px; }
.auth-error { display: flex; flex-direction: column; gap: 3px; margin: 2px 0 14px; padding: 11px 13px; border-radius: 12px; background: #f8ebe9; color: #9c3f38; font-size: 11px; line-height: 1.4; }
.auth-error.locked { background: #fff1dc; color: #895b16; }
.auth-error strong { font-size: 12px; }
.auth-submit { width: 100%; height: 52px; margin-top: 4px; border: 0; border-radius: 16px; background: var(--ink); color: white; font-size: 14px; font-weight: 700; box-shadow: 0 9px 20px rgba(23,34,28,.16); }
.auth-submit:disabled { opacity: .58; }
.security-note { margin: 17px 0 0; display: flex; align-items: center; justify-content: center; gap: 5px; color: #929b95; font-size: 10px; text-align: center; }
.security-icon { flex: 0 0 15px; width: 15px; height: 15px; display: grid; place-items: center; border-radius: 50%; background: var(--green-light); color: var(--green); }
.security-icon svg { width: 10px; height: 10px; display: block; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2; }

.user-strip { display: flex; align-items: center; gap: 9px; margin-bottom: 19px; }
.user-avatar { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 12px; background: var(--green-light); color: var(--green); font: 700 14px Georgia, serif; }
.user-strip > span:nth-child(2) { display: flex; flex: 1; flex-direction: column; gap: 1px; }
.user-strip small { color: #929b95; font-size: 9px; }
.user-strip strong { max-width: 180px; overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.user-strip button { padding: 7px 11px; border: 0; border-radius: 10px; background: #e9ede8; color: #69756d; font-size: 10px; font-weight: 700; }

.app-shell {
    width: 100%; min-height: 100vh; min-height: 100dvh; margin: 0 auto;
    padding: max(22px, env(safe-area-inset-top)) 20px calc(110px + env(safe-area-inset-bottom));
    background:
        radial-gradient(circle at 94% 2%, rgba(171, 205, 178, .3), transparent 190px),
        var(--paper);
}

.topbar { display: flex; justify-content: space-between; align-items: flex-start; padding: 10px 2px 24px; }
.eyebrow { margin: 0 0 11px; color: var(--green); font-size: 12px; font-weight: 700; letter-spacing: .07em; }
.topbar h1 { margin: 0; font-family: Georgia, "Songti SC", serif; font-size: clamp(30px, 9vw, 42px); line-height: 1.18; letter-spacing: -.04em; font-weight: 600; }
.topbar h1 span { color: var(--green); }
.date-badge { flex: 0 0 58px; height: 70px; border: 0; border-radius: 29px; background: var(--ink); color: white; display: flex; flex-direction: column; align-items: center; justify-content: center; box-shadow: 0 10px 22px rgba(23, 34, 28, .17); }
.date-badge strong { font: 600 20px/1 Georgia, serif; }
.date-badge small { margin-top: 6px; font-size: 9px; opacity: .72; }

.progress-card { padding: 20px; border-radius: 24px; background: var(--ink); color: white; box-shadow: 0 16px 35px rgba(23,34,28,.12); }
.progress-copy { display: flex; align-items: baseline; justify-content: space-between; }
.progress-copy span { font-size: 13px; color: #c7cec9; }
.progress-copy strong { font: 600 21px/1 Georgia, serif; }
.progress-track { height: 6px; margin: 15px 0 12px; overflow: hidden; border-radius: 9px; background: rgba(255,255,255,.13); }
.progress-track i { display: block; height: 100%; min-width: 0; border-radius: inherit; background: #8fc69f; transition: width .35s ease; }
.progress-card p { margin: 0; color: #aeb9b2; font-size: 12px; }

.scope-tabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin: 24px 0 26px; padding: 4px; border-radius: 16px; background: #e9ece7; }
.scope-tabs button { min-height: 40px; padding: 0 5px; border: 0; border-radius: 12px; background: transparent; color: var(--muted); font-size: 13px; font-weight: 600; }
.scope-tabs button.active { background: white; color: var(--ink); box-shadow: 0 4px 14px rgba(30,42,34,.08); }

.section-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.section-title h2 { margin: 0; font: 600 22px/1.2 Georgia, "Songti SC", serif; }
.section-title button { display: inline-flex; align-items: center; justify-content: center; gap: 4px; border: 0; background: transparent; color: var(--green); font-size: 13px; font-weight: 700; }
.section-title button svg { width: 15px; height: 15px; display: block; fill: none; stroke: currentColor; stroke-linecap: round; stroke-width: 1.8; }
.task-list { display: grid; gap: 11px; }
.task-card { display: grid; grid-template-columns: 42px minmax(0,1fr) 30px; align-items: flex-start; min-height: 93px; padding: 17px 11px 15px 13px; border: 1px solid rgba(220,225,219,.8); border-radius: 20px; background: var(--card); box-shadow: 0 7px 24px rgba(32,48,38,.05); transition: opacity .2s, transform .2s; }
.task-card:active { transform: scale(.99); }
.check-button { width: 26px; height: 26px; margin-top: 1px; padding: 0; display: grid; place-items: center; border: 1.5px solid #bec7c0; border-radius: 50%; background: white; }
.check-button svg { width: 17px; height: 17px; display: block; fill: none; stroke: transparent; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2.5; }
.completed .check-button { border-color: var(--green); background: var(--green); }
.completed .check-button svg { stroke: white; }
.task-content { min-width: 0; cursor: pointer; }
.task-line { display: flex; align-items: center; gap: 9px; }
.task-line h3 { max-width: 100%; margin: 0; overflow: hidden; color: var(--ink); font-size: 15px; line-height: 1.5; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.priority-dot { flex: 0 0 6px; width: 6px; height: 6px; border-radius: 50%; background: #83a98e; }
.priority-dot.low { background: #a8b2ab; }
.priority-dot.high { background: #d06754; }
.task-content > p { margin: 5px 0 0; overflow: hidden; color: var(--muted); font-size: 12px; line-height: 1.45; text-overflow: ellipsis; white-space: nowrap; }
.task-meta { display: flex; gap: 9px; margin-top: 10px; color: #9aa39d; font-size: 10px; }
.task-meta span + span::before { content: "·"; margin-right: 9px; }
.task-meta .done-time { color: var(--green); }
.more-button { width: 30px; height: 28px; padding: 0; display: grid; place-items: center; border: 0; background: transparent; color: #a5aca7; }
.more-button svg { width: 20px; height: 20px; display: block; fill: currentColor; }
.task-card.completed { opacity: .6; }
.task-card.completed h3 { text-decoration: line-through; text-decoration-color: #8a958d; }

.state-card { min-height: 210px; display: flex; flex-direction: column; align-items: center; justify-content: center; border: 1px dashed #cfd5cf; border-radius: 24px; color: var(--muted); text-align: center; }
.state-card p { margin: 10px 0 0; font-size: 13px; }
.loader { width: 28px; height: 28px; border: 2px solid #dfe3df; border-top-color: var(--green); border-radius: 50%; animation: spin .7s linear infinite; }
.empty-icon { width: 48px; height: 48px; display: grid; place-items: center; margin-bottom: 13px; border-radius: 50%; background: var(--green-light); color: var(--green); }
.empty-icon svg { width: 24px; height: 24px; display: block; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2.2; }
.empty-state h3 { margin: 0; color: var(--ink); font: 600 18px Georgia, "Songti SC", serif; }
.empty-state p { margin: 7px 0 17px; }
.empty-state button { padding: 9px 17px; border: 0; border-radius: 12px; background: var(--ink); color: white; font-size: 12px; }

.fab { position: fixed; right: max(20px, calc((100vw - 600px) / 2 + 20px)); bottom: calc(22px + env(safe-area-inset-bottom)); z-index: 5; width: 58px; height: 58px; display: grid; place-items: center; border: 0; border-radius: 21px; background: var(--green); box-shadow: 0 12px 28px rgba(28,104,72,.3); }
.fab svg { width: 25px; fill: none; stroke: white; stroke-linecap: round; stroke-width: 1.8; }

.sheet-backdrop { position: fixed; inset: 0; z-index: 20; display: flex; align-items: flex-end; justify-content: center; background: rgba(15,24,19,.45); backdrop-filter: blur(3px); }
.bottom-sheet { width: min(100%, 600px); max-height: 92dvh; overflow-y: auto; overscroll-behavior: contain; padding: 8px 22px calc(24px + env(safe-area-inset-bottom)); border-radius: 30px 30px 0 0; background: #fbfcfa; box-shadow: 0 -14px 40px rgba(20,30,24,.17); }
.bottom-sheet.is-dragging { transition: none !important; will-change: transform; }
.bottom-sheet.is-settling { transition: transform .22s cubic-bezier(.22, .8, .32, 1) !important; will-change: transform; }
.sheet-drag-zone { height: 30px; margin: -8px -22px 0; padding-top: 12px; display: grid; place-items: start center; cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; }
.sheet-drag-zone:active { cursor: grabbing; }
.sheet-handle { width: 38px; height: 4px; border-radius: 4px; background: #d5dad5; }
.sheet-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 24px; }
.sheet-header small { color: var(--green); font-size: 9px; font-weight: 800; letter-spacing: .16em; }
.sheet-header h2 { margin: 6px 0 0; font: 600 25px Georgia, "Songti SC", serif; }
.sheet-header button { flex: 0 0 34px; width: 34px; height: 34px; padding: 0; display: grid; place-items: center; border: 0; border-radius: 50%; background: #ebeeea; color: #657068; }
.sheet-header button svg { width: 18px; height: 18px; display: block; fill: none; stroke: currentColor; stroke-linecap: round; stroke-width: 1.7; }
.field { display: block; margin-bottom: 19px; }
.field > span, .priority-field legend { display: block; margin-bottom: 8px; color: #526059; font-size: 12px; font-weight: 700; }
.field em { color: #a3aaa5; font-size: 10px; font-style: normal; font-weight: 400; }
.field input, .field textarea { width: 100%; border: 1px solid #e2e6e1; border-radius: 14px; outline: none; background: white; color: var(--ink); font-size: 14px; transition: border .2s, box-shadow .2s; }
.field input { height: 50px; padding: 0 15px; }
.field textarea { padding: 13px 15px; resize: none; line-height: 1.55; }
.field input:focus, .field textarea:focus { border-color: #8eb29b; box-shadow: 0 0 0 3px rgba(57,121,82,.08); }
.field input::placeholder, .field textarea::placeholder { color: #b1b8b3; }
.priority-field { margin: 0 0 26px; padding: 0; border: 0; }
.priority-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.priority-options label { height: 43px; display: flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid #e2e6e1; border-radius: 13px; background: white; color: var(--muted); font-size: 12px; }
.priority-options label.selected { border-color: #8eb29b; background: #eff6f0; color: var(--green); font-weight: 700; }
.priority-options input { position: absolute; opacity: 0; pointer-events: none; }
.priority-options i { width: 7px; height: 7px; border-radius: 50%; background: #a8b2ab; }
.priority-options i.medium { background: #83a98e; }
.priority-options i.high { background: #d06754; }
.form-actions { display: flex; gap: 10px; }
.form-actions button { height: 52px; border: 0; border-radius: 16px; font-size: 14px; font-weight: 700; }
.delete-button { flex: 0 0 76px; background: #f7eae8; color: var(--danger); }
.save-button { flex: 1; background: var(--ink); color: white; box-shadow: 0 8px 18px rgba(23,34,28,.15); }
.form-actions button:disabled { opacity: .55; }

.toast-message { position: fixed; left: 50%; bottom: calc(94px + env(safe-area-inset-bottom)); z-index: 40; max-width: calc(100vw - 40px); transform: translateX(-50%); padding: 11px 18px; border-radius: 14px; background: rgba(23,34,28,.94); color: white; box-shadow: 0 8px 22px rgba(0,0,0,.18); font-size: 12px; white-space: nowrap; }
.fade-enter-active, .fade-leave-active { transition: opacity .22s ease; }
.fade-enter-active .bottom-sheet, .fade-leave-active .bottom-sheet { transition: transform .25s ease; }
.fade-enter-from, .fade-leave-to { opacity: 0; }
.fade-enter-from .bottom-sheet, .fade-leave-to .bottom-sheet { transform: translateY(100%); }
.toast-enter-active, .toast-leave-active { transition: opacity .2s, transform .2s; }
.toast-enter-from, .toast-leave-to { opacity: 0; transform: translate(-50%, 8px); }
@keyframes spin { to { transform: rotate(360deg); } }

@media (min-width: 601px) {
    body { width: 600px; margin: 0 auto; box-shadow: 0 0 50px rgba(30,40,34,.12); }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation-duration: .01ms !important; }
    .bottom-sheet.is-settling { transition: none !important; }
}
