:root {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #f6f7fb; color: #1e263b; line-height: 1.5;
  --ink: #1e263b; --muted: #5e6b81; --line: #e0e5ee; --accent: #4338ca;
  --surface: #fff; --soft: #eeedff; --radius: 14px;
}
* { box-sizing: border-box; }
body { margin: 0; display: grid; grid-template-columns: 223px minmax(0, 1fr); min-height: 100vh; }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { outline-offset: 3px; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid #6a5bea; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .65; }
a { color: var(--accent); }
.rail { background: #171d34; color: #ecedf9; padding: 28px 15px; display: flex; flex-direction: column; min-height: 100%; }
.brand { display: flex; align-items: center; gap: 11px; padding: 0 7px 29px; font-size: 17px; font-weight: 700; }
.brand > span { display: grid; place-items: center; width: 39px; height: 39px; background: #6a5bea; color: white; border-radius: 12px; font-size: 27px; line-height: 1; }
.brand small { display: block; font-size: 9px; letter-spacing: .11em; color: #b3b9d4; margin-top: 1px; }
nav { display: grid; gap: 7px; }
nav button { text-align: left; padding: 11px 12px; background: none; border: 0; color: #c9cde1; border-radius: 9px; font-size: 14px; }
nav button > span[aria-hidden="true"] { display: inline-block; width: 22px; font-size: 17px; }
nav[hidden] { display: none; }
nav button:hover, nav button[aria-current="page"] { background: #32395c; color: white; }
.rail-foot { margin-top: auto; padding: 24px 8px 0; color: #b3b9d4; font-size: 12px; }
.rail-foot i { display: inline-block; width: 7px; height: 7px; background: #76d7ad; border-radius: 50%; margin-right: 6px; }
main { width: min(100%, 1240px); padding: 0 36px 40px; margin-inline: auto; }
.top { min-height: 64px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 13px; color: var(--muted); }
.top b { color: #9ca4b7; margin-inline: 5px; }
.hero { display: flex; justify-content: space-between; gap: 16px; align-items: center; margin: 27px 0 18px; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(26px, 4vw, 34px); letter-spacing: -.035em; }
h2 { font-size: 19px; }
h3 { font-size: 15px; }
.hero p, .muted { color: var(--muted); font-size: 13px; }
.hero p { margin-top: 5px; }
.primary, .secondary, .quiet, .icon { border: 1px solid transparent; border-radius: 9px; padding: 8px 13px; font-weight: 600; font-size: 13px; white-space: nowrap; }
.primary { background: var(--accent); color: white; }
.primary:hover { background: #3730a3; }
.secondary { border-color: var(--line); background: white; color: var(--ink); }
.quiet, .icon { background: var(--soft); color: var(--accent); }
.icon { font-size: 20px; padding: 1px 9px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 17px; margin-bottom: 14px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 9px; margin-bottom: 12px; flex-wrap: wrap; }
.grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(250px, 1fr); gap: 15px; align-items: start; }
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; margin-top: 12px; }
.week button { border: 1px solid var(--line); border-radius: 10px; background: #fafbfe; color: var(--ink); padding: 7px 2px; }
.week button[aria-pressed="true"] { border-color: #b8b1f6; background: var(--soft); color: #332b9c; }
.week b, .week small { display: block; }
.week small { color: var(--muted); font-size: 11px; }
.week-count-key { display: none; }
.task-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.task-row:first-of-type { border-top: 0; }
.task-title { border: 0; background: transparent; padding: 0; color: var(--ink); text-align: left; font-weight: 650; overflow-wrap: anywhere; }
.task-title:hover { color: var(--accent); text-decoration: underline; }
.task-shortcuts, .stage-actions { margin-top: 7px; }
.task-state { display: grid; justify-items: end; gap: 5px; }
.daily-summary { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap;
  padding: 8px 10px; margin: 8px 0; border-radius: 8px; background: var(--soft); color: var(--ink); font-size: 13px; }
.daily-trigger { min-height: 36px; }
.carry-warning { color: #845021; font-size: 13px; margin-top: 4px; overflow-wrap: anywhere; }
.stage > .muted + .muted { margin-top: 4px; }
.badge { border-radius: 999px; background: #eceff6; color: #404d65; padding: 3px 8px; font-size: 11px; white-space: nowrap; }
.badge.blocked, .badge.returned { background: #ffebe6; color: #8b3527; }
.badge.done, .badge.accepted { background: #e5f7ed; color: #235e45; }
.badge.submitted { background: #fff4d8; color: #725115; }
.goal { border-left: 4px solid #7767e8; }
.goal h3 { overflow-wrap: anywhere; }
progress { accent-color: #6753dd; width: 100%; height: 9px; margin: 8px 0; }
.empty { padding: 10px 0; color: var(--muted); font-size: 13px; }
.actions { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
dialog { border: 1px solid var(--line); border-radius: 18px; color: var(--ink); width: min(560px, calc(100% - 24px)); max-height: 89vh; padding: 19px; box-shadow: 0 16px 45px #19233b35; }
dialog::backdrop { background: #141b3a80; }
.dialog-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 13px; gap: 10px; }
form { display: grid; gap: 11px; }
label { display: grid; gap: 3px; font-size: 13px; font-weight: 600; }
input, select, textarea { width: 100%; min-width: 0; border: 1px solid #cbd3e2; padding: 7px 9px; border-radius: 8px; background: white; color: var(--ink); }
textarea { min-height: 84px; resize: vertical; }
input[type="checkbox"] { width: auto; }
.field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.checks { display: flex; gap: 9px; flex-wrap: wrap; }
.checks label { display: flex; align-items: center; gap: 3px; font-weight: 400; }
[hidden] { display: none !important; }
#notice, .form-error { color: #8e3324; background: #fff0ea; border-radius: 8px; padding: 9px 11px; margin-top: 10px; font-size: 13px; }
#notice.ok { color: #235e45; background: #e5f7ed; }
#release-update {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 12px;
  margin-top: 10px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px;
  background: #eeedff; color: var(--ink); font-size: 13px;
}
.record { border-top: 1px solid var(--line); padding: 8px 0; overflow-wrap: anywhere; }
.note { white-space: pre-wrap; overflow-wrap: anywhere; margin: 8px 0; }
.review-item { border-top: 1px solid var(--line); padding: 9px 0; }
.sign-in { max-width: 430px; margin: 36px auto; padding: 24px; }
.sign-in form { margin-top: 18px; }
@media (max-width: 900px) { main { padding-inline: 20px; } body { grid-template-columns: 178px minmax(0, 1fr); } .grid { grid-template-columns: 1fr; } }
@media (max-width: 600px) {
  body { display: block; }
  .rail { padding: 12px; }
  .brand { padding: 0 2px 10px; }
  .brand > span { height: 31px; width: 31px; font-size: 22px; }
  nav { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 3px; }
  nav button { padding: 6px 3px; text-align: center; font-size: 12px; }
  nav button > span[aria-hidden="true"] { width: 15px; font-size: 13px; }
  .rail-foot { display: none; }
  main { padding-inline: 12px; }
  .top { min-height: 40px; }
  .hero { margin: 16px 0 12px; flex-wrap: wrap; }
  .task-row { align-items: flex-start; }
  .task-shortcuts button { min-height: 40px; }
  .daily-trigger { min-height: 44px; }
  .panel { padding: 12px; }
}

.badge.waiting { background: #fff2da; color: #7a4c20; }

.task-center { display: grid; grid-template-columns: minmax(190px, 235px) minmax(0, 1fr); gap: 13px; align-items: start; }
.category-panel > h2, .task-list > h2 { margin-bottom: 10px; }
.category-views { display: grid; gap: 3px; margin-bottom: 10px; }
.category-tree > summary { padding: 5px 0; color: var(--muted); cursor: pointer; }
.category-tree ul { margin: 2px 0 6px; padding-inline-start: 12px; list-style: none; }
.category-tree > ul { padding: 0; }
.category-tree ul ul { border-inline-start: 1px solid var(--line); margin-inline-start: 7px; }
.category-node { display: flex; align-items: center; gap: 3px; min-width: 0; }
.category-pick { flex: 1; border: 0; border-radius: 8px; background: transparent; text-align: left; padding: 7px 8px; min-height: 36px; color: var(--ink); overflow-wrap: anywhere; }
.category-pick[aria-pressed="true"] { background: var(--soft); color: var(--accent); font-weight: 700; }
.category-pick small { display: inline-block; color: var(--muted); }
.category-edit { flex: none; padding: 5px 6px; background: transparent; font-size: 11px; }
.task-filters { display: grid; grid-template-columns: minmax(120px, 1.6fr) minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
.center-batch:not(:empty) { padding: 8px; margin-top: 8px; background: var(--soft); border-radius: 8px; }
.result-count { margin: 9px 0 5px; }
.center-task { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; }
.task-select { width: 32px; min-height: 38px; align-content: center; justify-content: center; }
.task-select input { width: 17px; height: 17px; accent-color: var(--accent); }
.center-task-info p { overflow-wrap: anywhere; }
.android-ui .rail nav:has([data-view="tasks"]) { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.android-ui .rail nav [data-view="tasks"] > span { display: grid; place-items: center; height: 28px; width: 49px; border-radius: 999px; font-size: 19px; }
.android-ui .rail nav [data-view="tasks"][aria-current="page"] > span { background: var(--soft); }
@media (max-width: 680px) {
  .task-center { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .category-views { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .task-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .task-filters > label:first-child { grid-column: 1 / -1; }
}
@media (max-width: 600px) {
  .rail nav:has([data-view="tasks"]) { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.category-toggle { border: 0; background: transparent; color: var(--muted); min-width: 32px; min-height: 36px; padding: 0 4px; }

.brief-inputs > summary { cursor: pointer; color: var(--accent); padding: 6px 0; }
.brief-inputs > label { margin: 7px 0; }
.task-brief { margin: 10px 0; border: 1px solid var(--line); border-radius: 10px; padding: 10px; background: var(--surface); }
.task-brief dl { display: grid; gap: 7px; margin: 7px 0; }
.task-brief dt { color: var(--muted); font-size: 12px; font-weight: 700; }
.task-brief dd { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; }
.task-brief-preview { border: 0; background: transparent; padding: 0; margin: 4px 0 0; }
.task-brief-preview dl { gap: 3px; margin: 0; }
.task-brief-preview dl > div { display: grid; grid-template-columns: 7.5em minmax(0, 1fr); gap: 4px; }
.task-brief-preview dd { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
@media (max-width: 520px) {
  .task-brief-preview dl > div { grid-template-columns: minmax(0, 1fr); gap: 0; }
}

.phase-summary:not(:empty) { margin: 0 0 10px; }
.phase-summary button[aria-pressed="true"] { border-color: #b8b1f6; background: var(--soft); color: var(--accent); }
.badge.planned { background: #eef1f7; color: #46536a; }
.badge.paused { background: #fff4d8; color: #725115; }
.badge.ended { background: #eef1f7; color: #46536a; }

.learning-unit-choices { max-height: 220px; overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; }
.learning-unit-choices label { display: flex; align-items: flex-start; gap: 7px; padding: 4px 0; overflow-wrap: anywhere; }

.nav-compact { display: none; }
@media (max-width: 600px) {
  html:has(nav:not([hidden])) { scroll-padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
  html:not(.android-ui) body:has(nav:not([hidden])) main { padding-bottom: calc(80px + env(safe-area-inset-bottom)); }
  html:not(.android-ui) .rail:has(nav:not([hidden])) {
    position: fixed; z-index: 4; inset: auto 0 0; min-height: 0;
    padding: 4px 8px calc(4px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--line); background: var(--surface); color: var(--ink);
  }
  html:not(.android-ui) .rail:has(nav:not([hidden])) .brand { display: none; }
  html:not(.android-ui) nav button { min-height: 52px; color: var(--ink); display: grid; place-items: center; gap: 1px; }
  html:not(.android-ui) nav button[aria-current="page"] { background: var(--soft); color: var(--accent); }
  html:not(.android-ui) nav button > span[aria-hidden="true"] { width: auto; }
  html:not(.android-ui) .nav-name { display: none; }
  html:not(.android-ui) .nav-compact { display: block; }
  .week { gap: 3px; }
  .week button { min-width: 0; padding-inline: 2px; }
  .week button small { font-size: 10px; }
  html:not(.android-ui) .week b { font-size: clamp(11px, 3vw, 14px); white-space: nowrap; }
  html:not(.android-ui) .week-count-label { display: none; }
  html:not(.android-ui) .week-count-key { display: block; margin: 4px 0 0; font-size: 11px; }
  .task-state { flex-wrap: wrap; }
}

#workspace-menu { display: none; }
.rail nav .nav-extra[data-view="guide"] { margin-top: 9px; }
.workspace-links { display: grid; gap: 7px; }
.workspace-links button { min-height: 44px; text-align: left; }
.workspace-links button[aria-current="page"] { color: var(--accent); background: var(--soft); }
.manual { max-width: 900px; }
.manual h2, .release-history h2 { margin-bottom: 9px; }
.manual p + p, .manual li + li { margin-top: 7px; }
.manual ol { margin-bottom: 0; padding-inline-start: 1.5em; }
.manual-options { margin: 13px 0 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.manual-options > div { background: #f6f7fb; padding: 10px 12px; border-radius: 9px; }
.manual-options dt { font-weight: 700; }
.manual-options dd { margin: 4px 0 0; color: var(--muted); }
.runtime-filter { display: flex; align-items: center; gap: 8px; }
.runtime-filter select { width: auto; }
.runtime-records { margin-top: 12px; }
.runtime-entry { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 2px 8px; }
.runtime-entry p { grid-column: 1 / -1; }
.release-hero { background: var(--soft); border-color: #dbd8fd; }
.release-version { font-size: clamp(32px, 6vw, 48px); color: var(--accent); font-weight: 750; }
.release-history article p { color: var(--muted); margin-top: 3px; }
.task-form-section { display: grid; gap: 9px; min-width: 0; margin: 0; padding: 12px; border: 1px solid var(--line); border-radius: 10px; }
.task-form-section h3 { color: var(--accent); }
.task-form-section [data-task-habit] { display: grid; gap: 8px; }
.daily-card-controls { display: none; }
.daily-card-buttons { display: flex; flex-wrap: wrap; gap: 6px; }
.daily-card-buttons button { min-height: 44px; flex: 1 0 auto; }
.daily-card-buttons button.quiet { flex-grow: 0; }
.daily-card-message { margin-top: 5px; }
.daily-card-error { color: #8e3324; }
.android-ui .daily-card-controls { display: block; margin-top: 9px; }
.android-ui .has-daily-card .daily-trigger { display: none; }
@media (max-width: 600px) {
  .task-form-section { padding: 10px; }
  .task-form-section .field-row { grid-template-columns: minmax(0, 1fr); }
  .has-daily-card { display: grid; grid-template-columns: minmax(0, 1fr); gap: 5px; }
  .has-daily-card .task-state { justify-items: start; }
  .has-daily-card .daily-trigger { display: none; }
  .daily-card-controls { display: block; margin-top: 9px; }
}
@media (min-width: 601px) {
  html:not(.android-ui) .rail { position: sticky; top: 0; align-self: start; min-height: 100vh; max-height: 100vh; overflow-y: auto; }
}
.android-ui #workspace-menu { display: inline-block; }
.android-ui .rail nav .nav-extra { display: none; }
.android-ui .manual-options { grid-template-columns: minmax(0, 1fr); }
@media (max-width: 600px) {
  #workspace-menu { display: inline-block; }
  .rail nav .nav-extra { display: none; }
  .manual-options { grid-template-columns: minmax(0, 1fr); }
}

.release-record-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 8px; }
.center-detail { display: none; }
.review-attention { margin: 15px 0 20px; }
.review-attention-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr)); gap: 8px; align-items: start; }
.review-attention-group { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; background: #fafbfe; overflow-wrap: anywhere; }
.review-attention-group > summary { cursor: pointer; color: var(--accent); }
.review-attention-group > summary strong, .review-attention-empty strong { margin-right: 3px; }
.review-attention-empty { color: var(--muted); }
.review-attention-group .actions:empty { display: none; }
.review-evidence { margin: 4px 0; }
.review-evidence > summary { color: var(--accent); cursor: pointer; font-size: 13px; }
.stage { scroll-margin-top: 18px; }

@media (min-width: 601px) {
  html:not(.android-ui) .today-tasks .daily-card-controls { display: block; margin-top: 7px; }
  html:not(.android-ui) .today-tasks .daily-card-buttons button { min-height: 32px; flex: 0 0 auto; padding: 5px 9px; }
  html:not(.android-ui) .today-tasks .has-daily-card .daily-trigger { display: none; }
}

@media (min-width: 1000px) {
  body:has(.task-center) main { width: min(100%, 1480px); padding-inline: 20px; }
  .task-center:not(.center-inbox) { grid-template-columns: minmax(164px, .6fr) minmax(0, 1.35fr) minmax(270px, 1fr); }
  .task-center .panel { min-width: 0; padding: 13px; }
  .task-center .category-panel, .center-detail { position: sticky; top: 12px; max-height: calc(100vh - 24px); overflow-y: auto; }
  .task-center .category-tree ul ul { margin-inline-start: 4px; padding-inline-start: 7px; }
  .task-center .category-pick { min-width: 0; padding-inline: 6px; }
  .task-center .category-toggle { min-width: 22px; }
  .task-center .category-edit { padding-inline: 4px; }
  .center-detail { display: block; overflow-wrap: anywhere; scrollbar-gutter: stable; }
  .center-detail-head { align-items: start; }
  .center-detail h3 { margin-top: 12px; }
  .center-detail .task-brief h3 { margin-top: 0; }
  .task-center .task-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .task-center .task-filters > label:first-child { grid-column: 1 / -1; }
  .task-center #center-results { max-height: max(230px, calc(100vh - 330px)); overflow-y: auto; scrollbar-gutter: stable; }
  .center-task { padding-inline: 4px; }
  .center-task-active { background: var(--soft); border-radius: 8px; }
}
