:root {
  --yellow: #ffd166;
  --yellow-light: #ffe5a8;
  --yellow-dark: #9d7200;
  --yellow-soft: rgba(255, 209, 102, 0.12);
  --black: #080808;
  --panel: #101010;
  --panel-raised: #171717;
  --line: rgba(255, 209, 102, 0.18);
  --line-neutral: rgba(255, 255, 255, 0.09);
  --text: #f2f2f2;
  --muted: #9b9b9b;
  --danger: #ff667e;
  --success: #68d391;
  --topbar-height: 66px;
  --sidebar-width: 250px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html { min-width: 0; color-scheme: dark; }
body {
  min-height: 100vh;
  color: var(--text);
  background: var(--black);
  font-family: "Segoe UI", "Microsoft YaHei", sans-serif;
}
button, input, select, textarea { font: inherit; }
button { color: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--yellow);
  outline-offset: 2px;
}
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }

.app-shell { min-height: 100vh; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(8, 8, 8, 0.96);
  backdrop-filter: blur(12px);
}
.brand { display: flex; align-items: center; gap: 11px; color: var(--text); text-decoration: none; }
.brand > span:last-child { display: grid; gap: 1px; }
.brand strong { font: 800 15px Consolas, monospace; }
.brand small { color: var(--muted); font-size: 10px; }
.menu-toggle { width: 34px; height: 34px; display: grid; align-content: center; flex: 0 0 34px; gap: 4px; padding: 7px; border: 1px solid var(--yellow); border-radius: 6px; background: transparent; cursor: pointer; }
.menu-toggle span { display: block; height: 2px; background: var(--yellow); transition: width 180ms ease; }
.menu-toggle span:nth-child(2) { width: 70%; }
.menu-toggle span:nth-child(3) { width: 45%; }
.menu-toggle:hover { background: var(--yellow-soft); }
.menu-toggle[aria-expanded="false"] span:nth-child(2), .menu-toggle[aria-expanded="false"] span:nth-child(3) { width: 100%; }
.topbar-date { margin-left: auto; color: var(--muted); font-size: 12px; white-space: nowrap; }
.add-button {
  height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 16px;
  border: 1px solid var(--yellow);
  border-radius: 6px;
  color: #171100;
  background: var(--yellow);
  font-weight: 800;
  cursor: pointer;
  transition: background 160ms ease, transform 160ms ease;
}
.add-button span { font-size: 20px; font-weight: 400; line-height: 1; }
.add-button:hover { background: var(--yellow-light); transform: translateY(-1px); }

.workspace { min-height: calc(100vh - var(--topbar-height)); display: grid; grid-template-columns: var(--sidebar-width) minmax(0, 1fr); transition: grid-template-columns 300ms cubic-bezier(0.22, 1, 0.36, 1); }
.app-shell.menu-collapsed .workspace { grid-template-columns: 0 minmax(0, 1fr); }
.sidebar { position: sticky; top: var(--topbar-height); min-width: 0; height: calc(100vh - var(--topbar-height)); display: flex; flex-direction: column; padding: 31px 18px 22px; border-right: 1px solid var(--line-neutral); overflow: hidden; background: #0c0c0c; opacity: 1; transform: translateX(0); transition: padding 300ms cubic-bezier(0.22, 1, 0.36, 1), opacity 300ms ease, transform 300ms cubic-bezier(0.22, 1, 0.36, 1), border-color 300ms ease; }
.app-shell.menu-collapsed .sidebar { padding-right: 0; padding-left: 0; border-color: transparent; opacity: 0; transform: translateX(calc(-1 * var(--sidebar-width))); pointer-events: none; }
.sidebar-heading { padding: 0 10px 23px; }
.eyebrow { color: var(--yellow); font-size: 10px; font-weight: 800; text-transform: uppercase; }
.sidebar h1 { margin-top: 6px; font-size: 19px; letter-spacing: 0; }
.filters { position: relative; display: grid; gap: 5px; }
.filter-indicator { position: absolute; z-index: 0; top: 0; left: 0; width: 0; height: 0; border: 1px solid var(--line); border-radius: 6px; background: var(--yellow-soft); opacity: 0; pointer-events: none; transform: translate(0, 0); }
.filter-indicator.ready { opacity: 1; transition: width 300ms cubic-bezier(0.22, 1, 0.36, 1), height 300ms cubic-bezier(0.22, 1, 0.36, 1), transform 300ms cubic-bezier(0.22, 1, 0.36, 1), opacity 160ms ease; }
.filter-indicator.hidden { opacity: 0; }
.filter-button { position: relative; z-index: 1; width: 100%; height: 42px; display: flex; align-items: center; justify-content: space-between; padding: 0 11px; border: 1px solid transparent; border-radius: 6px; color: #c0c0c0; background: transparent; cursor: pointer; text-align: left; }
.filter-button:hover { color: var(--text); background: #171717; }
.filter-button.active { color: var(--yellow-light); }
.filter-count { min-width: 25px; padding: 3px 6px; border-radius: 4px; color: #777; background: #1b1b1b; font: 11px Consolas, monospace; text-align: center; }
.filter-button.active .filter-count { color: #191200; background: var(--yellow); }
.tags-menu-button.active { border-color: var(--line); background: var(--yellow-soft); }
.tag-panel { position: absolute; z-index: 8; top: 286px; right: 18px; left: 18px; max-height: min(320px, calc(100vh - 360px)); overflow-y: auto; border: 1px solid rgba(255, 209, 102, 0.4); border-radius: 7px; background: #151515; box-shadow: 0 18px 45px rgba(0, 0, 0, 0.6); }
.tag-panel-header { position: sticky; top: 0; display: flex; align-items: center; justify-content: space-between; min-height: 42px; padding: 0 9px 0 12px; border-bottom: 1px solid var(--line-neutral); background: #151515; }
.tag-panel-header strong { font-size: 11px; }
.tag-panel-close { width: 28px; height: 28px; border: 0; border-radius: 4px; color: #888; background: transparent; cursor: pointer; font-size: 17px; }
.tag-panel-close:hover { color: var(--yellow); background: #202020; }
.tag-filter-list { display: grid; gap: 4px; padding: 7px; }
.tag-filter-button { min-height: 36px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 9px; border: 1px solid transparent; border-radius: 5px; color: #aaa; background: transparent; cursor: pointer; text-align: left; }
.tag-filter-button:hover, .tag-filter-button.active { border-color: var(--line); color: var(--yellow-light); background: var(--yellow-soft); }
.tag-filter-button span:first-child { min-width: 0; overflow-wrap: anywhere; }
.tag-filter-button span:last-child { flex: 0 0 auto; color: #686868; font: 10px Consolas, monospace; }
.tag-filter-empty { padding: 18px 10px; color: #777; font-size: 11px; text-align: center; }
.storage-note { margin-top: auto; padding: 16px 10px 0; border-top: 1px solid var(--line-neutral); color: #707070; font-size: 11px; line-height: 1.7; }

.main-content { width: min(100%, 1120px); margin: 0 auto; padding: 42px clamp(24px, 5vw, 70px) 72px; }
.task-toolbar { display: flex; align-items: center; gap: 10px; margin: 0 0 18px; }
.search-box { height: 42px; min-width: 0; flex: 1; display: flex; align-items: center; gap: 9px; padding: 0 12px; border: 1px solid var(--line-neutral); border-radius: 6px; color: #777; background: #0e0e0e; }
.search-box:focus-within { border-color: var(--yellow); }
.search-box input { width: 100%; min-width: 0; border: 0; outline: 0; color: var(--text); background: transparent; }
.search-box input::placeholder { color: #656565; }
.sort-menu { position: relative; width: 150px; flex: 0 0 150px; }
.sort-menu-trigger { width: 100%; height: 42px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 12px; border: 1px solid var(--line-neutral); border-radius: 6px; color: #bbb; background: #111; cursor: pointer; text-align: left; }
.sort-menu-trigger:hover, .sort-menu-trigger[aria-expanded="true"] { border-color: var(--yellow); color: var(--yellow-light); background: #171717; }
.sort-menu-trigger > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sort-chevron { width: 7px; height: 7px; flex: 0 0 7px; border-right: 1px solid currentColor; border-bottom: 1px solid currentColor; transform: translateY(-2px) rotate(45deg); transition: transform 180ms ease; }
.sort-menu-trigger[aria-expanded="true"] .sort-chevron { transform: translateY(2px) rotate(225deg); }
.sort-options { position: absolute; z-index: 12; top: calc(100% + 6px); right: 0; left: 0; display: grid; gap: 3px; padding: 5px; border: 1px solid rgba(255, 209, 102, 0.35); border-radius: 6px; background: #151515; box-shadow: 0 16px 40px rgba(0, 0, 0, 0.58); }
.sort-option { width: 100%; min-height: 36px; padding: 7px 9px; border: 1px solid transparent; border-radius: 4px; color: #aaa; background: transparent; cursor: pointer; font-size: 11px; text-align: left; }
.sort-option:hover, .sort-option:focus-visible { border-color: var(--line-neutral); color: var(--text); background: #202020; }
.sort-option.active { border-color: var(--line); color: #181100; background: var(--yellow); font-weight: 800; }

.task-list { display: grid; gap: 10px; will-change: transform, opacity; }
.task-list.leaving-left { animation: task-list-out-left 140ms ease-in both; pointer-events: none; }
.task-list.leaving-right { animation: task-list-out-right 140ms ease-in both; pointer-events: none; }
.task-list.entering-left { animation: task-list-in-left 180ms cubic-bezier(0.22, 1, 0.36, 1) both; }
.task-list.entering-right { animation: task-list-in-right 180ms cubic-bezier(0.22, 1, 0.36, 1) both; }
.task-card { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 13px; padding: 17px 16px; border: 1px solid var(--line-neutral); border-radius: 7px; background: var(--panel); cursor: pointer; user-select: none; transition: border-color 160ms ease, background 160ms ease, transform 160ms ease; }
.task-detail-modal { user-select: text; }
.task-card:hover { border-color: var(--line); background: #121212; }
.task-card:focus-visible { border-color: var(--yellow); outline: 2px solid var(--yellow); outline-offset: 2px; }
.task-card:active { transform: translateY(1px); }
.task-card.completed { opacity: 0.7; }
.task-card.completed .task-title { color: #898989; text-decoration: line-through; }
.task-content { min-width: 0; }
.task-title-row { min-width: 0; display: flex; align-items: center; gap: 8px; }
.task-title { overflow-wrap: anywhere; font-size: 15px; line-height: 1.45; }
.type-badge { flex: 0 0 auto; padding: 3px 6px; border: 1px solid var(--line-neutral); border-radius: 4px; color: #929292; font-size: 9px; font-weight: 800; }
.type-badge.daily { border-color: rgba(104, 211, 145, 0.3); color: var(--success); }
.type-badge.long { border-color: var(--line); color: var(--yellow); }
.task-description { margin-top: 7px; color: #a5a5a5; font-size: 12px; line-height: 1.65; white-space: pre-wrap; overflow-wrap: anywhere; }
.task-method { margin-top: 8px; padding-left: 9px; border-left: 2px solid var(--line); color: #7f7f7f; font-size: 11px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.task-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: 11px; }
.tag { padding: 3px 7px; border-radius: 4px; color: #9d9d9d; background: #1b1b1b; font-size: 10px; }
.created-at { color: #626262; font-size: 10px; }
.task-actions { position: relative; display: flex; align-items: flex-start; gap: 5px; }
.icon-button { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid transparent; border-radius: 5px; color: #888; background: transparent; cursor: pointer; font-size: 18px; line-height: 1; }
.icon-button:hover { border-color: var(--line-neutral); color: var(--yellow); background: #1b1b1b; }
.task-complete-button, .task-menu-trigger { width: 31px; height: 31px; display: grid; place-items: center; border: 1px solid var(--line-neutral); border-radius: 5px; color: #858585; background: #151515; cursor: pointer; line-height: 1; }
.task-complete-button { font-size: 17px; }
.task-complete-button:hover { border-color: var(--yellow); color: var(--yellow); background: var(--yellow-soft); }
.task-complete-button[aria-pressed="true"] { border-color: var(--yellow); color: #181100; background: var(--yellow); }
.task-menu { position: relative; }
.task-menu-trigger { padding: 0 0 5px; font: 800 17px Consolas, monospace; letter-spacing: 0; }
.task-menu-trigger:hover, .task-menu-trigger[aria-expanded="true"] { border-color: var(--yellow); color: var(--yellow); background: var(--yellow-soft); }
.task-action-dropdown { position: absolute; z-index: 14; top: calc(100% + 5px); right: 0; width: 122px; display: grid; gap: 3px; padding: 5px; border: 1px solid rgba(255, 209, 102, 0.35); border-radius: 6px; background: #151515; box-shadow: 0 16px 40px rgba(0, 0, 0, 0.58); }
.task-action-item { width: 100%; min-height: 35px; padding: 7px 9px; border: 1px solid transparent; border-radius: 4px; color: #aaa; background: transparent; cursor: pointer; font-size: 11px; text-align: left; }
.task-action-item:hover, .task-action-item:focus-visible { border-color: var(--line-neutral); color: var(--text); background: #202020; }
.task-action-item.delete:hover, .task-action-item.delete:focus-visible { border-color: rgba(255, 102, 126, 0.35); color: var(--danger); background: #271216; }
.long-progress { margin-top: 14px; padding: 12px; border: 1px solid var(--line-neutral); border-radius: 6px; background: #0b0b0b; }
.progress-stage-summary { display: grid; grid-template-columns: minmax(0, 0.75fr) minmax(0, 1.25fr); align-items: end; gap: 18px; }
.progress-stage-value { min-width: 0; display: grid; gap: 4px; }
.progress-stage-value:last-child { justify-items: end; text-align: right; }
.progress-stage-value small { color: #777; font-size: 9px; font-weight: 800; text-transform: uppercase; }
.progress-stage-value strong { max-width: 100%; overflow-wrap: anywhere; color: var(--yellow-light); font: 700 11px/1.45 Consolas, monospace; }
.progress-next-target strong { color: #bbb; font-family: "Segoe UI", "Microsoft YaHei", sans-serif; }
.progress-next-target.goal-reached strong { color: var(--success); }
.progress-track { height: 6px; margin-top: 10px; overflow: hidden; border-radius: 3px; background: #292929; }
.progress-track span { display: block; width: 0; height: 100%; max-width: 100%; border-radius: inherit; background: var(--yellow); transition: width 300ms cubic-bezier(0.22, 1, 0.36, 1); }
.progress-value-refresh { animation: progress-value-refresh 300ms ease both; }
.update-progress-button { height: 29px; margin-top: 12px; padding: 0 9px; border: 1px solid var(--line); border-radius: 5px; color: var(--yellow-light); background: var(--yellow-soft); cursor: pointer; font-size: 10px; font-weight: 800; }
.update-progress-button:hover { border-color: var(--yellow); }

.empty-state { min-height: 310px; display: grid; place-items: center; padding: 50px 20px; border: 1px dashed var(--line-neutral); border-radius: 7px; text-align: center; }
.empty-state-mark { width: 52px; height: 52px; display: grid; place-items: center; margin: 0 auto 16px; border: 1px solid var(--line); border-radius: 7px; color: var(--yellow); font: 25px Consolas, monospace; }
.empty-state h3 { font-size: 17px; }
.empty-state p { max-width: 340px; margin-top: 7px; color: var(--muted); font-size: 12px; line-height: 1.7; }
.empty-state button { height: 38px; margin-top: 18px; padding: 0 13px; border: 1px solid var(--yellow); border-radius: 5px; color: #181100; background: var(--yellow); cursor: pointer; font-weight: 800; }

.modal { position: fixed; inset: 50% auto auto 50%; width: min(620px, calc(100vw - 28px)); max-height: calc(100vh - 28px); overflow-y: auto; transform: translate(-50%, -50%); border: 1px solid rgba(255, 209, 102, 0.42); border-radius: 8px; color: var(--text); background: #121212; box-shadow: 0 28px 90px rgba(0, 0, 0, 0.8); }
.modal::backdrop { background: rgba(0, 0, 0, 0.78); backdrop-filter: blur(3px); }
.modal form { padding: 22px; }
.modal-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.modal-header h2 { margin-top: 5px; font-size: 21px; }
.modal-header .icon-button { margin: -4px -5px 0 0; }
.book-modal { overflow: hidden; perspective: 1200px; }
.book-modal::before { content: ""; position: absolute; z-index: 2; top: 0; bottom: 0; left: 9px; width: 1px; background: linear-gradient(transparent, rgba(255, 209, 102, 0.22) 12%, rgba(255, 209, 102, 0.22) 88%, transparent); pointer-events: none; }
.book-header { margin-bottom: 9px; padding-bottom: 10px; border-bottom: 1px solid var(--line-neutral); }
.book-header-tools { display: flex; align-items: center; gap: 8px; }
.book-page-indicator { min-width: 42px; color: #777; font: 10px Consolas, monospace; text-align: right; }
.book-pages { position: relative; min-height: 220px; max-height: calc(100vh - 220px); overflow-x: hidden; overflow-y: auto; scrollbar-gutter: stable; }
.book-page { min-height: 220px; padding: 8px 4px 12px; background: #121212; transform-style: preserve-3d; }
.book-page h3 { margin-top: 5px; margin-bottom: 15px; font-size: 18px; line-height: 1.35; }
.book-chapter { color: var(--yellow); font-size: 9px; font-weight: 800; text-transform: uppercase; }
.book-page.book-leaving-forward, .book-page.book-leaving-backward { position: absolute; z-index: 2; inset: 0; width: 100%; }
.book-page.book-entering-forward, .book-page.book-entering-backward { position: relative; z-index: 1; }
.book-page.book-leaving-forward { animation: book-page-out-forward 300ms ease both; transform-origin: left center; }
.book-page.book-entering-forward { animation: book-page-in-forward 300ms cubic-bezier(0.22, 1, 0.36, 1) both; transform-origin: right center; }
.book-page.book-leaving-backward { animation: book-page-out-backward 300ms ease both; transform-origin: right center; }
.book-page.book-entering-backward { animation: book-page-in-backward 300ms cubic-bezier(0.22, 1, 0.36, 1) both; transform-origin: left center; }
.book-page > .field:first-of-type { margin-top: 0; }
.book-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; padding-top: 11px; border-top: 1px solid var(--line-neutral); }
.book-navigation-actions { display: flex; justify-content: flex-end; gap: 8px; }
.book-actions button { min-width: 100px; height: 40px; padding: 0 14px; border-radius: 5px; cursor: pointer; font-weight: 800; }
.edit-field-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.edit-field-options label { min-width: 0; cursor: pointer; }
.edit-field-options input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.edit-field-options span { min-height: 46px; display: flex; align-items: center; padding: 10px 12px; border: 1px solid var(--line-neutral); border-radius: 5px; color: #999; background: #0b0b0b; font-size: 11px; }
.edit-field-options input:checked + span { border-color: var(--yellow); color: var(--yellow-light); background: var(--yellow-soft); }
.edit-field-options input:focus-visible + span { outline: 2px solid var(--yellow); outline-offset: 2px; }
.field { margin-top: 16px; }
.field label, .type-field legend, .subtask-header > label { display: block; margin-bottom: 7px; color: #cecece; font-size: 12px; font-weight: 700; }
.field em, .type-field em, .subtask-header em { color: var(--yellow); font-size: 10px; font-style: normal; }
.field label small { color: #777; font-size: 10px; font-weight: 400; }
.field input, .field textarea { border: 1px solid var(--line-neutral); }
.field input, .field textarea { width: 100%; padding: 10px 11px; border-radius: 5px; color: var(--text); background: #090909; }
.field input { height: 42px; }
.field textarea { resize: vertical; line-height: 1.5; }
.field input:hover, .field textarea:hover { border-color: #3f3f3f; }
.field input:focus, .field textarea:focus { border-color: var(--yellow); outline: 0; }
.field-error, .form-error { min-height: 16px; margin-top: 5px; color: var(--danger); font-size: 11px; }
.form-error { margin-top: 12px; }
.type-field { margin-top: 16px; border: 0; }
.segmented-control { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.segmented-control label { cursor: pointer; }
.segmented-control input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.segmented-control span { height: 40px; display: grid; place-items: center; border: 1px solid var(--line-neutral); border-radius: 5px; color: #999; background: #0b0b0b; font-size: 12px; }
.segmented-control input:checked + span { border-color: var(--yellow); color: #1b1400; background: var(--yellow); font-weight: 800; }
.segmented-control input:focus-visible + span { outline: 2px solid var(--yellow); outline-offset: 2px; }
.section-divider { margin-top: 22px; padding-top: 19px; border-top: 1px solid var(--line-neutral); }
.section-divider h3 { margin-top: 5px; font-size: 15px; }
.progress-fields { display: grid; grid-template-columns: 2fr 1fr; gap: 10px; }
.subtask-header { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 18px; }
.subtask-header > label { margin: 0; }
.text-button { padding: 4px 0; border: 0; color: var(--yellow); background: transparent; cursor: pointer; font-size: 11px; font-weight: 800; }
.subtask-list { display: grid; gap: 7px; margin-top: 8px; }
.subtask-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(100px, 0.45fr) 34px; gap: 7px; }
.subtask-row input { width: 100%; height: 39px; padding: 0 9px; border: 1px solid var(--line-neutral); border-radius: 5px; color: var(--text); background: #090909; }
.remove-subtask { width: 34px; height: 39px; border: 1px solid var(--line-neutral); border-radius: 5px; color: #777; background: #161616; cursor: pointer; font-size: 18px; }
.remove-subtask:hover { border-color: var(--danger); color: var(--danger); }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 5px; }
.modal-actions button { min-width: 100px; height: 40px; padding: 0 14px; border-radius: 5px; cursor: pointer; font-weight: 800; }
.primary-button { border: 1px solid var(--yellow); color: #181100; background: var(--yellow); }
.primary-button:hover { background: var(--yellow-light); }
.secondary-button { border: 1px solid var(--line-neutral); color: #aaa; background: #1b1b1b; }
.secondary-button:hover { border-color: #555; color: var(--text); }
.compact-modal { width: min(440px, calc(100vw - 28px)); }
.progress-adjust-row { display: grid; grid-template-columns: 46px minmax(0, 1fr); align-items: stretch; gap: 8px; }
.progress-operation { position: relative; width: 46px; }
.progress-operation-trigger { width: 46px; height: 46px; display: grid; grid-template-columns: 1fr 8px; align-items: center; padding: 0 6px 0 10px; border: 1px solid var(--yellow); border-radius: 5px; color: var(--yellow-light); background: var(--yellow-soft); cursor: pointer; font: 800 18px Consolas, monospace; }
.progress-operation-trigger:hover, .progress-operation-trigger[aria-expanded="true"] { color: #181100; background: var(--yellow); }
.operation-chevron { width: 5px; height: 5px; border-right: 1px solid currentColor; border-bottom: 1px solid currentColor; transform: translateY(-2px) rotate(45deg); }
.progress-operation-options { position: absolute; z-index: 16; top: calc(100% + 5px); left: 0; width: 46px; display: grid; gap: 3px; padding: 4px; border: 1px solid rgba(255, 209, 102, 0.4); border-radius: 5px; background: #151515; box-shadow: 0 14px 35px rgba(0, 0, 0, 0.58); }
.progress-operation-option { width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid transparent; border-radius: 4px; color: #aaa; background: transparent; cursor: pointer; font: 800 18px Consolas, monospace; }
.progress-operation-option:hover, .progress-operation-option:focus-visible { border-color: var(--line-neutral); color: var(--text); background: #222; }
.progress-operation-option.active { border-color: var(--yellow); color: #181100; background: var(--yellow); }
.progress-value-input { min-width: 0; height: 46px; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; padding-right: 11px; border: 1px solid var(--line-neutral); border-radius: 5px; background: #090909; }
.progress-value-input:focus-within { border-color: var(--yellow); }
.progress-value-input input { width: 100%; min-width: 0; height: 44px; padding: 0 11px; border: 0; outline: 0; color: var(--text); background: transparent; font: 15px Consolas, monospace; }
.progress-value-input span { max-width: 90px; overflow: hidden; color: var(--yellow); font: 11px Consolas, monospace; text-overflow: ellipsis; white-space: nowrap; }
.progress-dialog-actions { margin-top: 20px; }
.task-detail-modal { width: min(640px, calc(100vw - 28px)); }
.task-detail-shell { padding: 22px; }
.task-detail-header { margin-bottom: 13px; }
.task-detail-header h2 { max-width: 520px; overflow-wrap: anywhere; }
.task-detail-summary { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
.task-detail-status { padding: 3px 7px; border: 1px solid var(--line-neutral); border-radius: 4px; color: #aaa; font-size: 9px; font-weight: 800; text-transform: uppercase; }
.task-detail-status.completed { border-color: rgba(104, 211, 145, 0.3); color: var(--success); }
.task-detail-body { display: block; }
.task-detail-page { min-height: 220px; }
.task-detail-copy { max-width: 540px; color: #c6c6c6; font-size: 13px; line-height: 1.8; white-space: pre-wrap; overflow-wrap: anywhere; }
.task-detail-section { padding: 17px 0; border-bottom: 1px solid var(--line-neutral); }
.task-detail-section h3 { margin-bottom: 7px; color: #777; font-size: 9px; font-weight: 800; text-transform: uppercase; }
.task-detail-section p { color: #c6c6c6; font-size: 12px; line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere; }
.task-detail-section .not-provided { color: #676767; font-style: italic; }
.task-detail-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.task-detail-dates { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.task-detail-date { display: grid; gap: 5px; }
.task-detail-date span { color: #707070; font-size: 9px; font-weight: 800; text-transform: uppercase; }
.task-detail-date strong { color: #bbb; font-size: 11px; font-weight: 600; }
.task-detail-progress { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 12px; }
.task-detail-progress strong { color: var(--yellow-light); font: 700 15px Consolas, monospace; overflow-wrap: anywhere; }
.task-detail-progress span { color: #777; font-size: 10px; }
.task-detail-progress-track { grid-column: 1 / -1; height: 6px; overflow: hidden; border-radius: 3px; background: #292929; }
.task-detail-progress-track span { display: block; height: 100%; border-radius: inherit; background: var(--yellow); }
.task-detail-milestones { display: grid; gap: 7px; margin-top: 18px; }
.task-detail-milestone { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; align-items: center; gap: 8px; min-height: 35px; }
.task-detail-milestone-mark { width: 22px; height: 22px; display: grid; place-items: center; border: 1px solid var(--line-neutral); border-radius: 4px; color: #666; font-size: 11px; }
.task-detail-milestone.done .task-detail-milestone-mark { border-color: rgba(104, 211, 145, 0.35); color: #101510; background: var(--success); }
.task-detail-milestone-name { min-width: 0; color: #bbb; font-size: 11px; overflow-wrap: anywhere; }
.task-detail-milestone-value { color: #777; font: 10px Consolas, monospace; text-align: right; }
.task-detail-actions { margin-top: 16px; }
.confirm-modal { text-align: center; }
.warning-mark { width: 42px; height: 42px; display: grid; place-items: center; margin: 0 auto 13px; border: 1px solid var(--danger); border-radius: 50%; color: var(--danger); font-weight: 900; }
.confirm-modal p { margin: 10px auto 19px; color: var(--muted); font-size: 12px; line-height: 1.7; }
.confirm-modal .modal-actions { justify-content: center; }
.danger-button { border: 1px solid rgba(255, 102, 126, 0.5); color: #ffe0e5; background: #3b151c; }
.danger-button:hover { border-color: var(--danger); background: #531923; }
.toast { position: fixed; z-index: 50; right: 18px; bottom: 18px; max-width: min(360px, calc(100vw - 36px)); padding: 11px 14px; border: 1px solid var(--line); border-radius: 6px; color: #191300; background: var(--yellow); box-shadow: 0 14px 35px rgba(0, 0, 0, 0.45); font-size: 12px; font-weight: 800; }
.toast.show { animation: toast-in 240ms ease both; }
.noscript-message { max-width: 680px; margin: 40px auto; padding: 22px; border: 1px solid var(--line); color: var(--text); background: var(--panel); }
.noscript-message p { margin-top: 10px; color: var(--muted); line-height: 1.7; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes progress-value-refresh { from { opacity: 0.25; transform: translateY(3px); } to { opacity: 1; transform: translateY(0); } }
@keyframes dropdown-in { from { opacity: 0; transform: translateY(-9px) scale(0.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes dropdown-out { from { opacity: 1; transform: translateY(0) scale(1); } to { opacity: 0; transform: translateY(-9px) scale(0.98); } }
@keyframes tag-panel-in-left { from { opacity: 0; transform: translateX(-16px); } to { opacity: 1; transform: translateX(0); } }
@keyframes tag-panel-out-left { from { opacity: 1; transform: translateX(0); } to { opacity: 0; transform: translateX(-16px); } }
@keyframes tag-panel-in-top { from { opacity: 0; transform: translateY(-14px); } to { opacity: 1; transform: translateY(0); } }
@keyframes tag-panel-out-top { from { opacity: 1; transform: translateY(0); } to { opacity: 0; transform: translateY(-14px); } }
@keyframes task-list-out-left { to { opacity: 0; transform: translateX(-20px); } }
@keyframes task-list-out-right { to { opacity: 0; transform: translateX(20px); } }
@keyframes task-list-in-left { from { opacity: 0; transform: translateX(-20px); } to { opacity: 1; transform: translateX(0); } }
@keyframes task-list-in-right { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }
@keyframes book-page-out-forward { from { opacity: 1; transform: translateX(0) rotateY(0); } to { opacity: 0; transform: translateX(-18px) rotateY(-5deg); } }
@keyframes book-page-in-forward { from { opacity: 0; transform: translateX(24px) rotateY(5deg); } to { opacity: 1; transform: translateX(0) rotateY(0); } }
@keyframes book-page-out-backward { from { opacity: 1; transform: translateX(0) rotateY(0); } to { opacity: 0; transform: translateX(18px) rotateY(5deg); } }
@keyframes book-page-in-backward { from { opacity: 0; transform: translateX(-24px) rotateY(-5deg); } to { opacity: 1; transform: translateX(0) rotateY(0); } }

.sort-options.menu-entering, .task-action-dropdown.menu-entering, .progress-operation-options.menu-entering { animation: dropdown-in 300ms cubic-bezier(0.22, 1, 0.36, 1) both; }
.sort-options.menu-leaving, .task-action-dropdown.menu-leaving, .progress-operation-options.menu-leaving { animation: dropdown-out 300ms ease both; pointer-events: none; }
.tag-panel.menu-entering { animation: tag-panel-in-left 300ms cubic-bezier(0.22, 1, 0.36, 1) both; }
.tag-panel.menu-leaving { animation: tag-panel-out-left 300ms ease both; pointer-events: none; }

@media (max-width: 760px) {
  :root { --topbar-height: 60px; }
  .topbar { padding: 0 14px; }
  .brand small, .topbar-date { display: none; }
  .add-button { margin-left: auto; }
  .workspace { display: block; }
  .sidebar { position: static; width: 100%; height: auto; max-height: 86px; display: block; padding: 13px 14px; border-right: 0; border-bottom: 1px solid var(--line-neutral); overflow-x: auto; opacity: 1; transform: none; transition: max-height 300ms cubic-bezier(0.22, 1, 0.36, 1), padding 300ms cubic-bezier(0.22, 1, 0.36, 1), opacity 300ms ease, border-color 300ms ease; }
  .app-shell.menu-collapsed .sidebar { display: block; max-height: 0; padding-top: 0; padding-bottom: 0; border-bottom-color: transparent; opacity: 0; transform: none; }
  .sidebar-heading, .storage-note { display: none; }
  .filters { width: max-content; display: flex; gap: 6px; }
  .filter-button { width: auto; height: 36px; gap: 8px; padding: 0 10px; }
  .tag-panel { position: fixed; top: calc(var(--topbar-height) + 10px); right: 14px; left: 14px; max-height: min(360px, calc(100vh - var(--topbar-height) - 24px)); }
  .tag-panel.menu-entering { animation-name: tag-panel-in-top; }
  .tag-panel.menu-leaving { animation-name: tag-panel-out-top; }
  .main-content { padding: 28px 14px 50px; }
  .task-card { grid-template-columns: minmax(0, 1fr) auto; }
  .task-actions { grid-column: 2; justify-content: flex-end; margin-top: -2px; }
}

@media (max-width: 520px) {
  .task-toolbar { align-items: stretch; flex-direction: column; }
  .sort-menu { width: 100%; flex-basis: auto; }
  .task-card { padding: 15px 12px; }
  .task-title-row { align-items: flex-start; flex-direction: column-reverse; gap: 5px; }
  .segmented-control { grid-template-columns: 1fr; }
  .progress-fields { grid-template-columns: 1fr; gap: 0; }
  .subtask-row { grid-template-columns: minmax(0, 1fr) 34px; }
  .subtask-row .subtask-target { grid-column: 1; grid-row: 2; }
  .subtask-row .remove-subtask { grid-column: 2; grid-row: 1 / span 2; height: 100%; }
  .modal form { padding: 18px 15px; }
  .task-detail-shell { padding: 18px 15px; }
  .book-pages { min-height: 200px; max-height: calc(100vh - 225px); }
  .book-page, .task-detail-page { min-height: 200px; padding-right: 2px; padding-left: 2px; }
  .book-page h3 { font-size: 17px; }
  .edit-field-options { grid-template-columns: 1fr; }
  .book-actions { align-items: stretch; flex-direction: column; }
  .book-actions > .close-dialog { order: 2; }
  .book-navigation-actions { width: 100%; }
  .book-navigation-actions button { flex: 1; min-width: 0; }
  .task-detail-actions > span { display: none; }
  .task-detail-dates { grid-template-columns: 1fr; gap: 11px; }
  .task-detail-milestone { grid-template-columns: 22px minmax(0, 1fr); }
  .task-detail-milestone-value { grid-column: 2; text-align: left; }
  .modal-actions { flex-direction: column-reverse; }
  .modal-actions button { width: 100%; }
  .confirm-modal .modal-actions { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
}
