:root {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  color-scheme: light;
  --bg: #f7f7fb;
  --panel: #fff;
  --sidebar: #eeedf7;
  --line: #e5e3ee;
  --text: #29283e;
  --muted: #68667e;
  --soft: #ece9fa;
  --accent: #5c52b5;
  --accent-hover: #4d44a0;
  --on-accent: #fff;
  --shadow: 0 12px 36px #2e245508;
  --sidebar-width: 232px;
}
@media (prefers-color-scheme: dark) {
:root {
  color-scheme: dark;
  --bg: #1c1a29;
  --panel: #242237;
  --sidebar: #201e31;
  --line: #39364f;
  --text: #f3f0fc;
  --muted: #bcb6d0;
  --soft: #363055;
  --accent: #b5a9ff;
  --accent-hover: #c8bdff;
  --on-accent: #211b39;
  --shadow: 0 12px 36px #0002;
}
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--text); background: var(--bg); }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
button, input, select, textarea { border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
input, select, textarea { min-width: 0; padding: 10px 12px; }
input::placeholder, textarea::placeholder { color: var(--muted); }
button { padding: 8px 12px; cursor: pointer; }
button:disabled { cursor: default; opacity: .48; }
button:hover:not(:disabled) { background: var(--soft); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
input[type="checkbox"] { width: 16px; height: 16px; flex: none; accent-color: var(--accent); cursor: pointer; }
textarea { resize: vertical; }
button.primary { background: var(--accent); border-color: transparent; color: var(--on-accent); font-weight: 650; }
button.primary:hover:not(:disabled) { background: var(--accent-hover); }
button.quiet { border-color: transparent; background: transparent; color: var(--muted); }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-width);
  padding: 30px 18px 20px;
  display: flex;
  flex-direction: column;
  overflow: auto;
  background: var(--sidebar);
  border-right: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 11px; margin: 0 5px; text-decoration: none; color: inherit; font-size: 20px; font-weight: 750; letter-spacing: -.02em; }
.logo { width: 39px; height: 39px; object-fit: contain; }
.brand small { display: block; margin-top: 4px; color: var(--muted); font-size: .8125rem; font-weight: 500; letter-spacing: 0; }
nav { display: grid; gap: 5px; margin-top: 32px; }
nav button { border: 0; background: transparent; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 10px; font-size: .875rem; color: var(--text); text-align: left; }
nav button[aria-pressed="true"] { background: color-mix(in srgb, var(--accent) 13%, var(--sidebar)); color: var(--accent); font-weight: 650; }
.nav-entry { display: flex; align-items: center; gap: 10px; }
.nav-icon { width: 21px; text-align: center; font-size: 17px; line-height: 1; }
nav b { font-size: .8125rem; font-weight: 500; font-variant-numeric: tabular-nums; }
.sidebar-bottom { margin-top: auto; padding-top: 24px; }

.account { position: relative; }
.account-summary { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 11px 4px; border-top: 1px solid var(--line); list-style: none; cursor: pointer; font-size: .8125rem; }
.account-summary::-webkit-details-marker { display: none; }
.account-avatar { width: 32px; height: 32px; flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--soft); color: var(--accent); font-weight: 650; }
#account-email { overflow-wrap: anywhere; }
.account-menu { position: absolute; bottom: calc(100% + 4px); left: 0; width: max-content; min-width: 112px; z-index: 2; padding: 5px; border: 1px solid var(--line); background: var(--panel); border-radius: 8px; box-shadow: var(--shadow); }
.account-menu button { border: 0; width: 100%; text-align: left; }

main { max-width: 1460px; margin-left: var(--sidebar-width); padding: 40px clamp(26px, 4vw, 64px) 22px; }
.page-header, .section-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.eyebrow { margin-bottom: 7px; color: var(--muted); font-size: .875rem; }
h1 { margin: 0; font-size: clamp(1.85rem, 3.4vw, 2.65rem); line-height: 1.18; font-weight: 750; letter-spacing: -.045em; }
h2 { margin: 0; font-size: 1.25rem; font-weight: 700; }
.header-actions, .tools { display: flex; gap: 8px; align-items: center; }
.header-actions button { white-space: nowrap; flex-shrink: 0; padding: 10px 13px; font-size: .875rem; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(0, 1.45fr); gap: 12px; margin: 26px 0 22px; }
.stats > div { min-width: 0; border: 1px solid var(--line); background: var(--panel); border-radius: 13px; padding: 15px 18px; box-shadow: var(--shadow); }
.stats span { display: block; color: var(--muted); font-size: .875rem; }
.stats strong { display: block; font-size: 1.9rem; line-height: 1; margin-top: 9px; letter-spacing: -.04em; font-variant-numeric: tabular-nums; font-weight: 720; }
.stats > div:nth-child(2) strong { color: var(--accent); }
.stats .progress-card { background: var(--soft); border-color: transparent; }
.progress-card b { float: right; color: var(--accent); font-weight: 700; }
progress { display: block; appearance: none; width: 100%; height: 7px; margin: 10px 0 6px; accent-color: var(--accent); border: 0; border-radius: 99px; overflow: hidden; background: var(--panel); }
progress::-webkit-progress-bar { background: var(--panel); }
progress::-webkit-progress-value { background: var(--accent); border-radius: inherit; }
progress::-moz-progress-bar { background: var(--accent); border-radius: inherit; }
.stats small { color: var(--muted); font-size: .8125rem; }

.workspace { background: var(--panel); border: 1px solid var(--line); border-radius: 15px; box-shadow: var(--shadow); overflow: hidden; }
.section-heading { padding: 16px 20px 12px; flex-wrap: wrap; }
.tools { flex-wrap: wrap; gap: 4px; }
.tools button { border-color: transparent; font-size: .8125rem; color: var(--muted); padding: 6px 8px; }
.quick-add { margin: 0 20px 12px; display: flex; align-items: center; border: 1px solid var(--line); background: var(--bg); border-radius: 9px; padding: 4px; gap: 5px; }
.quick-add > span { color: var(--accent); font-size: 1.25rem; margin-left: 6px; }
.quick-add input { border: 0; padding: 8px; background: transparent; flex: 1; font-size: .9375rem; }
.quick-add .primary { font-size: .875rem; white-space: nowrap; }
.toolbar, .refine, .bulk { display: flex; align-items: center; gap: 10px; padding: 0 20px 10px; }
.toolbar { justify-content: space-between; flex-wrap: wrap; }
.filters { display: flex; align-items: center; gap: 3px; }
.filters button { border: 0; color: var(--muted); font-size: .875rem; padding: 7px 10px; white-space: nowrap; }
.filters button[aria-pressed="true"] { color: var(--accent); background: var(--soft); font-weight: 650; }
.search { display: flex; align-items: center; gap: 3px; border: 1px solid var(--line); border-radius: 8px; padding-left: 9px; color: var(--muted); }
.search-icon { width: 12px; height: 12px; margin-right: 3px; flex: none; border: 1.5px solid currentColor; border-radius: 50%; position: relative; }
.search-icon::after { content: ""; position: absolute; width: 5px; height: 1.5px; background: currentColor; left: 8px; top: 9px; transform: rotate(45deg); }
.search input { border: 0; padding: 7px; width: min(210px, 100%); font-size: .875rem; }
.refine { flex-wrap: wrap; }
.refine label { display: flex; gap: 6px; align-items: center; color: var(--muted); font-size: .875rem; }
.refine select { background: var(--bg); padding: 5px 6px; max-width: 160px; font-size: .875rem; }
.refine .quiet { margin-left: auto; font-size: .8125rem; padding: 6px; }
.bulk { background: var(--bg); border-block: 1px solid var(--line); padding-block: 7px; flex-wrap: wrap; color: var(--muted); font-size: .8125rem; }
.bulk label { display: flex; align-items: center; gap: 5px; }
.bulk button { background: transparent; font-size: .8125rem; padding: 4px 7px; }

.task-list { list-style: none; margin: 0; padding: 0; }
.task { padding: 13px 20px; border-bottom: 1px solid var(--line); }
.task-row { display: flex; align-items: flex-start; gap: 9px; }
.task-row > input { margin-top: 4px; }
.pick { opacity: .65; }
.complete { width: 19px !important; height: 19px !important; }
.task-body { flex: 1; min-width: 0; }
.task-title { font-weight: 600; font-size: 1rem; line-height: 1.4; overflow-wrap: anywhere; }
.done .task-title { color: var(--muted); text-decoration: line-through; text-decoration-thickness: 1px; }
.task-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: 5px; font-size: .8125rem; color: var(--muted); }
.pill { padding: 2px 7px; border-radius: 5px; background: var(--soft); color: var(--muted); }
.high { background: #fceee6; color: #984625; }
.low { background: #edf1fa; color: #4d6090; }
.overdue { color: #a33b47; }
@media (prefers-color-scheme: dark) {
.high { background: #573a34; color: #ffc4a9; }
.low { background: #323b57; color: #c4d2ff; }
.overdue { color: #ffc1c8; }
}
.notes { margin: 7px 0 0; color: var(--muted); line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; font-size: .875rem; }
.task-actions { display: flex; gap: 3px; }
.task-actions button { border: 0; color: var(--muted); font-size: .8125rem; padding: 6px; white-space: nowrap; }
.task-actions .star { padding: 0 4px; font-size: 1.25rem; }
.star[aria-pressed="true"] { color: var(--accent); }
.subtasks { margin: 10px 0 0 63px; color: var(--muted); font-size: .875rem; }
.subtasks summary { cursor: pointer; }
.subtasks label { display: flex; align-items: center; gap: 7px; overflow-wrap: anywhere; margin-top: 6px; }
.empty { text-align: center; padding: 32px 20px; }
.empty > span { display: grid; place-items: center; width: 42px; height: 42px; margin: auto; border-radius: 12px; background: var(--soft); color: var(--accent); font-size: 1.3rem; }
.empty h3 { margin: 12px 0 6px; }
.empty p, .empty button { font-size: .875rem; color: var(--muted); }
.list-footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 7px; padding: 11px 20px; font-size: .8125rem; color: var(--muted); }
footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 16px; margin-top: 13px; font-size: .8125rem; color: var(--muted); line-height: 1.6; }

dialog { border: 1px solid var(--line); border-radius: 15px; background: var(--panel); color: var(--text); width: min(540px, calc(100% - 28px)); max-height: 90vh; padding: 0; box-shadow: 0 24px 75px #1f183c3b; }
dialog::backdrop { background: #21193468; backdrop-filter: blur(3px); }
dialog form { padding: 23px; }
dialog header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
dialog header button { border: 0; font-size: 1.4rem; }
dialog label { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; font-size: .875rem; }
dialog input, dialog textarea, dialog select { width: 100%; }
dialog small { color: var(--muted); font-size: .8125rem; }
.form-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
dialog .star-field { flex-direction: row; align-items: center; margin-top: 10px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.toast { position: fixed; z-index: 5; bottom: 20px; left: 50%; transform: translateX(-50%); width: max-content; max-width: calc(100% - 28px); display: flex; align-items: center; gap: 12px; padding: 10px 14px; color: white; background: #362d56; box-shadow: 0 8px 28px #1b132944; border-radius: 10px; font-size: .875rem; }
.toast button { border: 0; background: transparent; color: white; white-space: nowrap; }
.toast button:hover:not(:disabled) { background: #ffffff22; }
.toast #dismiss { font-size: 1.25rem; padding: 2px 5px; }

@media (max-width: 980px) {
  :root { --sidebar-width: 194px; }
  .sidebar { padding-inline: 13px; }
  main { padding-inline: 22px; }
  .stats > div { padding-inline: 12px; }
}
@media (max-width: 720px) {
  .sidebar { position: static; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 57%); width: auto; padding: 13px 14px 9px; border: 0; border-bottom: 1px solid var(--line); }
  .brand { grid-row: 1; margin: 0; font-size: 1rem; gap: 7px; }
  .logo { width: 32px; height: 32px; }
  .brand small { display: none; }
  nav { grid-row: 2; grid-column: 1 / -1; display: flex; gap: 4px; overflow-x: auto; margin-top: 10px; }
  nav button { flex: none; white-space: nowrap; gap: 6px; padding: 8px; }
  .nav-entry { gap: 4px; }
  .sidebar-bottom { grid-row: 1; grid-column: 2; padding: 0; margin: 0; justify-self: end; min-width: 0; }
  .account-summary { padding: 0 0 0 6px; border: 0; }
  .account-avatar { width: 26px; height: 26px; }
  .account-menu { top: calc(100% + 5px); bottom: auto; right: 0; left: auto; }
  main { margin: 0; padding: 20px 13px; }
  .page-header { align-items: flex-end; }
  .header-actions { gap: 5px; }
  .header-actions button { padding: 8px 9px; }
  .eyebrow { font-size: .8125rem; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; margin: 15px 0; }
  .stats > div { padding: 10px; }
  .stats strong { font-size: 1.5rem; margin-top: 5px; }
  .section-heading, .task, .list-footer, .toolbar, .refine, .bulk { padding-inline: 12px; }
  .quick-add { margin-inline: 12px; }
  .search, .search input { width: 100%; }
  .refine .quiet { margin-left: 0; }
  .task-row { flex-wrap: wrap; }
  .task-body { flex-basis: calc(100% - 75px); }
  .task-actions { margin-left: auto; }
  dialog form { padding: 16px; }
}

.apk-download { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }

.save-area button { padding: 3px 7px; margin-left: 3px; }
