:root {
  color-scheme: light;
  --ink: #292f2e;
  --muted: #717875;
  --line: #e5e9e6;
  --rose: #a44358;
  --rose-soft: #fbf0f2;
  --green: #416b59;
  --green-soft: #edf5ef;
  --surface: #fff;
  --background: #f8faf8;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  color: var(--ink);
  background: var(--background);
}
* { box-sizing: border-box; letter-spacing: 0; }
body { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button, select { cursor: pointer; }
button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; }
button:disabled { cursor: default; opacity: .6; }
input, select, textarea { min-width: 0; border: 1px solid #dce2de; border-radius: 5px; background: var(--surface); padding: 8px 10px; }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible { outline: 2px solid var(--rose); outline-offset: 3px; }
input[type="number"] { font-variant-numeric: tabular-nums; appearance: textfield; }
input[type="number"]::-webkit-inner-spin-button { appearance: none; }
input::placeholder, textarea::placeholder { color: #9ba19e; }
svg { width: 17px; height: 17px; flex-shrink: 0; stroke-width: 1.7; }
[hidden] { display: none !important; }
h1, h2, p { margin: 0; }
.auth-screen { min-height: 100vh; display: grid; place-items: center; padding: 36px 20px; }
.auth-content { width: min(400px, 100%); }
.auth-content h1 { font-size: 25px; }
.auth-photo { width: 100%; height: 190px; object-fit: cover; border-radius: 6px; margin: 24px 0; }
.auth-content .primary-button { width: 100%; min-height: 44px; font-size: 14px; }
.auth-message { color: var(--muted); font-size: 12px; line-height: 1.7; margin-top: 16px; overflow-wrap: anywhere; }
.auth-message:empty { display: none; }
#connect-retry { margin-top: 12px; }
.page-header { background: var(--surface); }
.header-inner, .main-tabs, main, footer { max-width: 1240px; margin: 0 auto; padding-left: 36px; padding-right: 36px; }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding-top: 30px; padding-bottom: 26px; }
.eyebrow { color: var(--rose); display: flex; align-items: center; gap: 7px; font-size: 11px; font-weight: 600; margin-bottom: 10px; }
h1 { font-size: 29px; font-weight: 650; line-height: 1.4; }
h1 span { color: #737b76; font-weight: 400; }
.start-date { display: flex; align-items: center; gap: 10px; color: var(--muted); margin-top: 13px; font-size: 12px; }
.start-date input { font-size: 12px; padding: 4px 7px; border-color: var(--line); }
.header-side { display: flex; align-items: center; gap: 18px; }
.header-side img { width: 164px; height: 104px; object-fit: cover; border-radius: 6px; }
.file-actions { display: flex; flex-direction: column; gap: 8px; }
.icon-button { width: 32px; height: 32px; padding: 0; border: 1px solid transparent; border-radius: 5px; background: transparent; color: var(--muted); flex-shrink: 0; }
.icon-button:hover { background: #edf1ed; color: var(--ink); }
.delete-button:hover { color: #b53943; background: #ffedef; }
.navigation-band { background: var(--surface); border-bottom: 1px solid var(--line); }
.main-tabs { display: flex; align-items: center; gap: 30px; }
.tab-buttons { display: flex; align-items: center; gap: 30px; min-width: 0; }
.cloud-controls { margin-left: auto; display: flex; align-items: center; justify-content: flex-end; gap: 10px; min-width: 0; }
.sync-actions { display: flex; align-items: center; gap: 3px; flex-shrink: 0; }
.main-tab { min-height: 52px; border: 0; border-bottom: 3px solid transparent; background: transparent; color: var(--muted); font-weight: 500; padding: 0 2px; }
.main-tab.active { color: var(--rose); border-bottom-color: var(--rose); }
.save-state { display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: 11px; min-width: 0; line-height: 1.5; }
.save-state span { overflow-wrap: anywhere; }
.save-state svg { color: var(--green); width: 14px; }
.save-state.error { color: #b53943; }
.save-state.error svg { color: inherit; }
.sync-notice { border-left: 3px solid var(--rose); background: var(--rose-soft); color: #8d374b; padding: 12px 14px; margin-bottom: 22px; font-size: 12px; line-height: 1.7; overflow-wrap: anywhere; }
main { padding-top: 26px; padding-bottom: 45px; min-height: 58vh; }
.summary-line { display: flex; align-items: center; padding-bottom: 26px; gap: 46px; }
.summary-item { display: flex; flex-direction: column; min-width: 175px; gap: 8px; }
.summary-label { color: var(--muted); font-size: 12px; }
.summary-item strong { font-size: 25px; font-weight: 600; font-variant-numeric: tabular-nums; }
.summary-item small { font-size: 14px; font-weight: 400; color: var(--muted); }
.progress-track { height: 4px; width: 175px; background: #e4eae5; overflow: hidden; margin-top: 1px; }
#progress-fill { height: 100%; background: var(--green); transition: width .2s; }
.summary-note { display: flex; gap: 12px; margin-left: auto; color: var(--rose); }
.summary-note > svg { width: 22px; height: 22px; margin-top: 2px; }
.summary-note div { display: flex; flex-direction: column; gap: 6px; }
.summary-note strong { font-weight: 500; font-size: 13px; }
.summary-note span { font-size: 12px; color: var(--muted); }
.day-nav { display: grid; grid-template-columns: .8fr repeat(6, 1fr); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--surface); }
.day-button { flex-direction: column; gap: 7px; padding: 16px 6px; background: transparent; border: 0; border-bottom: 3px solid transparent; min-width: 0; }
.day-button.active { background: var(--rose-soft); color: var(--rose); border-bottom-color: var(--rose); }
.day-button:hover:not(.active) { background: #f2f5f2; }
.day-button .day-label { font-size: 13px; font-weight: 600; }
.day-button .day-subtitle { font-size: 11px; color: var(--muted); line-height: 1.4; }
.day-button.active .day-subtitle { color: var(--rose); }
.plan-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 24px 0 16px; }
.toolbar-title { display: flex; align-items: baseline; gap: 10px; }
.toolbar-title h2 { font-size: 17px; font-weight: 600; }
.toolbar-title > span { font-size: 12px; color: var(--muted); }
.toolbar-actions { display: flex; align-items: center; gap: 10px; }
.toolbar-actions select { font-size: 12px; min-height: 36px; padding: 7px 25px 7px 10px; }
.primary-button, .secondary-button, .danger-button { min-height: 36px; padding: 8px 13px; border: 1px solid transparent; border-radius: 5px; font-size: 12px; white-space: nowrap; }
.primary-button { color: #fff; background: var(--rose); }
.primary-button:hover { background: #8d374b; }
.secondary-button { background: var(--surface); border-color: #dce2de; }
.danger-button { background: #b53943; color: #fff; }
.day-section { margin-bottom: 25px; }
.day-heading { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding: 12px 0; }
.day-number { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; font-size: 13px; }
.day-number svg { color: var(--rose); width: 15px; }
.day-date { color: var(--muted); font-size: 12px; }
.day-theme { margin-left: 3px; font-size: 12px; color: var(--green); }
.day-progress { margin-left: auto; font-size: 11px; color: var(--muted); }
.table-wrap { overflow-x: auto; background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; table-layout: fixed; }
th { background: #f0f4f0; text-align: left; color: #737b76; padding: 11px 14px; font-size: 11px; font-weight: 500; }
td { padding: 10px 14px; border-top: 1px solid #edf0ed; vertical-align: middle; }
tbody tr:hover { background: #fcfdfb; }
.category-col { width: 100px; }
.time-col { width: 137px; }
.status-col { width: 113px; }
.cost-col { width: 144px; }
.action-col { width: 80px; }
.task-category { color: var(--muted); font-size: 12px; }
.task-label { line-height: 1.5; overflow-wrap: anywhere; }
.completed .task-label { color: #8b938e; }
.completed .task-label-text { text-decoration: line-through; text-decoration-color: #bac2bb; }
.purchased-label { display: inline-block; color: var(--green); font-size: 10px; background: var(--green-soft); padding: 2px 5px; border-radius: 3px; margin-left: 8px; vertical-align: middle; white-space: nowrap; }
.detail-link { display: inline-flex; align-items: center; margin-left: 6px; vertical-align: middle; width: 24px; height: 24px; color: var(--rose); background: transparent; border: 0; border-radius: 4px; padding: 0; }
.detail-link:hover { background: var(--rose-soft); }
.detail-link svg { width: 14px; height: 14px; }
.time-input { width: 100%; font-size: 12px; padding: 7px 3px; border-color: transparent; background: transparent; }
.time-input:hover, .time-input:focus { border-color: #dce2de; background: var(--surface); }
.status-select { width: 88px; font-size: 11px; padding: 6px 5px; background: #f2f4f2; border-color: transparent; color: #737b76; }
.status-select.doing { color: #876417; background: #fbf5e7; }
.status-select.done { color: var(--green); background: var(--green-soft); }
.money-field { position: relative; display: flex; align-items: center; color: #8b938e; }
.money-field span { position: absolute; left: 7px; font-size: 12px; pointer-events: none; }
.money-field input { width: 100%; text-align: right; padding: 7px 7px 7px 23px; background: transparent; border-color: #e5e9e6; font-size: 12px; }
.money-field input[readonly] { background: #f2f6f2; color: var(--green); border-color: transparent; }
.source-note { display: block; font-size: 10px; color: var(--green); text-align: right; margin-top: 3px; }
.row-actions { display: flex; justify-content: flex-end; gap: 2px; }
.row-actions .icon-button { width: 28px; height: 28px; }
.row-actions svg { width: 14px; height: 14px; }
.empty-state { padding: 60px 16px; display: flex; flex-direction: column; align-items: center; gap: 15px; text-align: center; }
.empty-state > svg { height: 36px; width: 36px; color: #a4b5a6; }
.empty-state p { color: var(--muted); font-size: 13px; }
.decor-layout { display: grid; grid-template-columns: 207px minmax(0, 1fr); gap: 32px; }
.area-sidebar { border-right: 1px solid var(--line); padding-right: 20px; }
.area-sidebar h2 { font-size: 16px; font-weight: 600; margin-bottom: 22px; }
.area-group-title { display: block; font-size: 11px; color: var(--muted); margin: 18px 0 8px 10px; }
.area-button { width: 100%; justify-content: space-between; text-align: left; padding: 9px 10px; background: transparent; border: 0; border-radius: 5px; font-size: 12px; margin: 2px 0; line-height: 1.5; }
.area-button.active { background: var(--rose-soft); color: var(--rose); font-weight: 600; }
.area-button:hover:not(.active) { background: #edf1ed; }
.area-button span:first-child { overflow-wrap: anywhere; }
.area-button small { color: var(--muted); font-size: 10px; font-weight: 400; flex-shrink: 0; }
.detail-heading { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding-top: 3px; padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.section-kicker { color: var(--rose); font-size: 11px; }
.detail-heading h2 { font-size: 24px; font-weight: 600; margin: 8px 0 11px; overflow-wrap: anywhere; }
.detail-schedule { color: var(--muted); font-size: 12px; }
.detail-total { text-align: right; display: flex; flex-direction: column; gap: 8px; }
.detail-total span { color: var(--muted); font-size: 11px; }
.detail-total strong { font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.detail-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 18px 0; }
.detail-toolbar > span { color: var(--muted); font-size: 12px; }
.detail-table .name-col { width: 24%; }
.detail-table .quantity-col { width: 65px; }
.detail-table .note-col { width: auto; }
.detail-table .status-col { width: 106px; }
.detail-table .cost-col { width: 130px; }
.detail-table .action-col { width: 44px; }
.detail-input, .detail-note { width: 100%; background: transparent; border-color: transparent; padding: 7px 5px; font-size: 12px; }
.detail-input:hover, .detail-input:focus, .detail-note:hover, .detail-note:focus { border-color: #dce2de; background: var(--surface); }
.detail-note { resize: vertical; min-height: 36px; line-height: 1.5; }
.detail-table td { padding: 10px 7px; }
.detail-table th { padding: 11px 12px; }
.detail-table input[type="number"].detail-input { text-align: center; }
.detail-table tfoot td { background: #f3f6f3; font-size: 12px; padding: 13px 12px; }
.detail-table tfoot strong { font-variant-numeric: tabular-nums; color: var(--green); }
footer { display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--line); padding-top: 20px; padding-bottom: 25px; color: #929a94; font-size: 11px; }
dialog { border: 1px solid var(--line); border-radius: 8px; padding: 26px; width: min(450px, calc(100% - 32px)); color: var(--ink); box-shadow: 0 18px 60px #29342a26; }
dialog::backdrop { background: #222e285c; }
.dialog-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
dialog h2 { font-size: 20px; font-weight: 600; }
.field-label { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; font-size: 12px; color: var(--muted); }
.field-label input, .field-label select { color: var(--ink); min-height: 40px; font-size: 14px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; }
#confirm-text { color: var(--muted); line-height: 1.7; margin-top: 14px; overflow-wrap: anywhere; }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: #2b4034; color: #fff; padding: 12px 20px; max-width: calc(100% - 32px); border-radius: 6px; box-shadow: 0 6px 22px #29342a26; z-index: 5; font-size: 12px; line-height: 1.6; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.auth-local-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.auth-local-actions a { display: inline-flex; align-items: center; gap: 7px; text-decoration: none; }
@media (max-width: 960px) {
  .header-inner, .main-tabs, main, footer { padding-left: 24px; padding-right: 24px; }
  .summary-line { gap: 26px; }
  .summary-note span { max-width: 170px; line-height: 1.7; }
  .category-col { width: 87px; }
  .time-col { width: 117px; }
  .status-col { width: 101px; }
  .cost-col { width: 123px; }
  .action-col { width: 68px; }
  td, th { padding-left: 10px; padding-right: 10px; }
  .decor-layout { grid-template-columns: 174px minmax(0, 1fr); gap: 21px; }
  .area-sidebar { padding-right: 12px; }
  .detail-table { min-width: 660px; }
  .detail-total strong { font-size: 19px; }
}
@media (max-width: 700px) {
  .header-inner, .main-tabs, main, footer { padding-left: 16px; padding-right: 16px; }
  .header-inner { padding-top: 22px; padding-bottom: 20px; gap: 10px; }
  h1 { font-size: 23px; }
  .eyebrow { font-size: 10px; }
  .header-side { gap: 7px; align-self: stretch; }
  .header-side img { width: 66px; height: 88px; }
  .file-actions { gap: 8px; }
  .main-tabs { gap: 19px; flex-wrap: wrap; }
  .tab-buttons { gap: 19px; width: 100%; }
  .cloud-controls { width: 100%; justify-content: space-between; margin: -12px 0 8px; gap: 8px; }
  .main-tab { font-size: 12px; min-height: 48px; gap: 6px; }
  .main-tab svg { width: 15px; }
  .save-state { font-size: 10px; }
  main { padding-top: 22px; }
  .summary-line { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 20px; padding-bottom: 22px; }
  .summary-item { min-width: 0; }
  .summary-item strong { font-size: 23px; }
  .summary-item small { font-size: 12px; }
  .progress-track { width: 100%; max-width: 160px; }
  .summary-note { grid-column: 1 / -1; margin: 0; gap: 8px; align-items: center; }
  .summary-note div { flex-direction: row; flex-wrap: wrap; gap: 5px 10px; align-items: center; }
  .summary-note > svg { height: 16px; width: 16px; margin: 0; }
  .summary-note strong { font-size: 11px; }
  .summary-note span { font-size: 10px; max-width: none; }
  .day-nav { grid-template-columns: repeat(3, 1fr); }
  .day-button { padding: 11px 4px; gap: 5px; }
  .day-button:first-child { grid-column: 1 / -1; flex-direction: row; gap: 10px; padding: 9px 4px; }
  .day-button .day-label { font-size: 12px; }
  .day-button .day-subtitle { font-size: 10px; }
  .plan-toolbar { flex-direction: column; align-items: stretch; gap: 14px; }
  .toolbar-actions { gap: 7px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; }
  .toolbar-actions select { width: 100%; padding-right: 8px; min-height: 40px; }
  .toolbar-actions .primary-button { padding: 8px 10px; font-size: 11px; min-height: 40px; }
  .toolbar-actions svg { width: 14px; }
  .plan-table, .plan-table thead, .plan-table tbody { display: block; width: 100%; }
  .plan-table colgroup { display: none; }
  .plan-table thead { display: none; }
  .plan-table tr { display: grid; grid-template-columns: 1fr 1fr; padding: 13px 13px 10px; position: relative; border-bottom: 1px solid var(--line); gap: 7px 16px; }
  .plan-table tbody tr:last-child { border-bottom: 0; }
  .plan-table td { display: block; padding: 0; border: 0; min-width: 0; }
  .plan-table .category-cell { grid-column: 1 / -1; color: var(--rose); font-size: 10px; padding-right: 70px; }
  .plan-table .name-cell { grid-column: 1 / -1; padding-right: 76px; margin-bottom: 2px; font-size: 14px; }
  .plan-table .time-cell { grid-column: 1 / -1; display: flex; align-items: center; gap: 5px; }
  .plan-table .time-cell::before { content: "计划时间"; color: var(--muted); font-size: 11px; flex-shrink: 0; }
  .time-input { max-width: 180px; font-size: 13px; min-height: 38px; }
  .plan-table .status-cell::before { content: "完成状态"; display: block; color: var(--muted); font-size: 10px; margin-bottom: 5px; }
  .plan-table .cost-cell::before { content: "实际花费"; display: block; color: var(--muted); font-size: 10px; margin-bottom: 5px; }
  .status-select { width: 100%; min-height: 38px; font-size: 12px; padding: 7px; }
  .money-field input { min-height: 38px; font-size: 14px; }
  .plan-table .action-cell { position: absolute; right: 9px; top: 5px; }
  .row-actions .icon-button { width: 36px; height: 36px; }
  .day-heading { gap: 7px; }
  .day-theme { font-size: 11px; }
  .day-progress { font-size: 10px; }
  .decor-layout { display: block; }
  .area-sidebar { border: 0; padding: 0 0 18px; }
  .area-sidebar h2 { margin-bottom: 14px; }
  #area-nav { display: flex; flex-wrap: wrap; gap: 5px; }
  .area-group-title { width: 100%; margin: 8px 0 3px; }
  .area-button { width: auto; padding: 7px 10px; margin: 0; border: 1px solid var(--line); background: var(--surface); min-height: 35px; font-size: 11px; gap: 8px; }
  .area-button.active { border-color: #e8b6c1; }
  .detail-heading { padding-top: 15px; }
  .detail-heading h2 { font-size: 21px; }
  .detail-total strong { font-size: 17px; }
  .detail-schedule { font-size: 11px; }
  .detail-table, .detail-table tbody { display: block; min-width: 0; }
  .detail-table thead, .detail-table colgroup { display: none; }
  .detail-table tbody tr { display: grid; grid-template-columns: 1fr 1fr; padding: 13px; gap: 10px 15px; border-bottom: 1px solid var(--line); position: relative; }
  .detail-table td { display: block; padding: 0; border: 0; min-width: 0; }
  .detail-table td::before { content: attr(data-label); display: block; color: var(--muted); font-size: 10px; margin-bottom: 5px; }
  .detail-table .detail-name-cell, .detail-table .detail-note-cell { grid-column: 1 / -1; }
  .detail-table .detail-name-cell { padding-right: 46px; }
  .detail-table .detail-quantity-cell { grid-column: 1 / -1; max-width: 100px; }
  .detail-table .detail-action-cell { position: absolute; right: 9px; top: 9px; }
  .detail-input, .detail-note { border-color: var(--line); font-size: 14px; padding: 8px; min-height: 38px; }
  .detail-table tfoot { display: block; }
  .detail-table tfoot tr { display: flex; justify-content: space-between; padding: 14px; background: #f3f6f3; }
  .detail-table tfoot td { padding: 0; }
  .detail-table tfoot td:empty { display: none; }
  .detail-table tfoot td::before { display: none; }
  footer { gap: 12px; font-size: 10px; }
}
@media (max-width: 380px) {
  h1 { font-size: 20px; }
  .header-side img { width: 44px; height: 84px; }
  .start-date { flex-wrap: wrap; gap: 5px; }
  .start-date input { width: 150px; }
  .main-tabs { gap: 13px; }
  .tab-buttons { gap: 13px; }
  .cloud-controls { margin-top: -6px; }
  .main-tab { font-size: 11px; }
  .summary-item strong { font-size: 21px; }
  .detail-heading { align-items: flex-start; }
  .detail-total strong { font-size: 15px; }
}
@media (pointer: coarse) {
  input, select, textarea, .start-date input, .toolbar-actions select, .time-input, .status-select, .money-field input, .detail-input, .detail-note { font-size: 16px; }
  .icon-button, .row-actions .icon-button { width: 40px; height: 40px; }
  .day-button, .area-button, .primary-button, .secondary-button { min-height: 44px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
