/* 田野之友 · 项目管理
   工作面，不是工程后台。
   令牌真源：田野之友集群 / 智库；层级只靠填充，不画结构描边。
   动效只保留三处：doing 慢呼吸、写操作 flash、视图淡入。 */

:root {
  color-scheme: light;

  --bg: #FAF9F5;
  --surface: #FFFFFF;
  --bg-deep: #F3F1EA;
  --card-2: #F7F5F0;
  --ink: #141413;
  --ink-2: #4D4C48;
  --muted: #73726C;
  --muted-strong: #6D6C66;
  --line: rgba(31, 30, 29, .15);

  --accent: #D97757;
  --accent-2: #CE6B45;
  --accent-ink: #A44D2B;
  --accent-soft: rgba(217, 119, 87, .12);
  --on-accent: #1A1918;

  --ok: #558A42;
  --ok-ink: #345C28;
  --ok-soft: rgba(85, 138, 66, .12);
  --warn: #B4791A;
  --warn-ink: #8A5A12;
  --warn-soft: rgba(180, 121, 26, .13);
  --danger: #A63244;
  --danger-ink: #A63244;
  --danger-soft: rgba(166, 50, 68, .10);
  --on-danger: #FFFFFF;

  --focus-ring: #A44D2B;
  --glass: rgba(250, 249, 245, .86);
  --scrim: rgba(20, 20, 19, .34);
  --track: rgba(31, 30, 29, .10);
  --row-hover: #F7F5F0;
  --shadow-raised: 0 10px 30px rgba(20, 20, 19, .08);
  --shadow-drawer: -18px 0 48px rgba(20, 20, 19, .16);
  --shadow-notice: 0 10px 28px rgba(20, 20, 19, .14);

  --logo-wash: #EDF2E7;
  --logo-blue: #51769E;
  --logo-green: #558A42;

  --sans: "Inter", "PingFang SC", "Noto Sans SC", "WenQuanYi Zen Hei", system-ui, sans-serif;
  --display: ui-serif, "Newsreader", "Noto Serif SC", "WenQuanYi Zen Hei Sharp", Georgia, serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, "Noto Sans Mono", monospace;

  --r-1: 6px;
  --r-2: 8px;
  --r-3: 12px;
  --ease: cubic-bezier(.2, .8, .25, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;

    --bg: #1A1D23;
    --bg-deep: #14171C;
    --surface: #22252D;
    --card-2: #282C34;
    --ink: #EAEDF0;
    --ink-2: #C6CDD6;
    --muted: #96A1B0;
    --muted-strong: #96A1B0;
    --line: #363B45;

    --accent: #4DB2B2;
    --accent-2: #4DB2B2;
    --accent-ink: #6FC4C4;
    --accent-soft: rgba(77, 178, 178, .14);
    --on-accent: #0C1717;

    --ok: #4DB283;
    --ok-ink: #7FC9A4;
    --ok-soft: rgba(77, 178, 131, .14);
    --warn: #E79823;
    --warn-ink: #E9B44C;
    --warn-soft: rgba(231, 152, 35, .14);
    --danger: #B23A2E;
    --danger-ink: #EFA9A3;
    --danger-soft: rgba(178, 58, 46, .18);

    --focus-ring: #4DB2B2;
    --glass: rgba(26, 29, 35, .82);
    --scrim: rgba(0, 0, 0, .58);
    --track: rgba(255, 255, 255, .10);
    --row-hover: #282C34;
    --shadow-raised: 0 12px 34px rgba(0, 0, 0, .24);
    --shadow-drawer: -18px 0 48px rgba(0, 0, 0, .48);
    --shadow-notice: 0 12px 32px rgba(0, 0, 0, .34);

    --logo-wash: #E7EDE2;
    --logo-blue: #7EA4CF;
    --logo-green: #72A95C;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;

  --bg: #1A1D23;
  --bg-deep: #14171C;
  --surface: #22252D;
  --card-2: #282C34;
  --ink: #EAEDF0;
  --ink-2: #C6CDD6;
  --muted: #96A1B0;
  --muted-strong: #96A1B0;
  --line: #363B45;

  --accent: #4DB2B2;
  --accent-2: #4DB2B2;
  --accent-ink: #6FC4C4;
  --accent-soft: rgba(77, 178, 178, .14);
  --on-accent: #0C1717;

  --ok: #4DB283;
  --ok-ink: #7FC9A4;
  --ok-soft: rgba(77, 178, 131, .14);
  --warn: #E79823;
  --warn-ink: #E9B44C;
  --warn-soft: rgba(231, 152, 35, .14);
  --danger: #B23A2E;
  --danger-ink: #EFA9A3;
  --danger-soft: rgba(178, 58, 46, .18);

  --focus-ring: #4DB2B2;
  --glass: rgba(26, 29, 35, .82);
  --scrim: rgba(0, 0, 0, .58);
  --track: rgba(255, 255, 255, .10);
  --row-hover: #282C34;
  --shadow-raised: 0 12px 34px rgba(0, 0, 0, .24);
  --shadow-drawer: -18px 0 48px rgba(0, 0, 0, .48);
  --shadow-notice: 0 12px 32px rgba(0, 0, 0, .34);

  --logo-wash: #E7EDE2;
  --logo-blue: #7EA4CF;
  --logo-green: #72A95C;
}

/* ------------------------------------------------------------------------- */
/* 基础                                                                       */
/* ------------------------------------------------------------------------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  background: var(--bg);
  font-size: 19.5px;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 24px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
}

body.layer-open {
  overflow: hidden;
}

button,
input,
select,
textarea {
  border: 0;
  border-radius: 0;
  background: none;
  color: inherit;
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: .55;
}

a {
  color: inherit;
}

h1, h2, h3, p, ul, ol, dl, dd, figure {
  margin: 0;
}

ul, ol {
  padding: 0;
  list-style: none;
}

fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

summary {
  cursor: pointer;
}

summary::-webkit-details-marker {
  display: none;
}

::selection {
  background: var(--accent-soft);
  color: var(--ink);
}

[hidden] {
  display: none !important;
}

::placeholder {
  color: var(--muted);
  opacity: 1;
}

a:focus-visible,
button:focus-visible,
select:focus-visible,
input:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--focus-ring);
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  box-shadow: 0 0 0 2px var(--focus-ring);
}

.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;
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 12px;
  z-index: 300;
  padding: 8px 12px;
  border-radius: var(--r-2);
  background: var(--ink);
  color: var(--bg);
  text-decoration: none;
  transform: translateY(-180%);
}

.skip-link:focus {
  transform: translateY(0);
}

.mono,
.task-row-meta,
.event-time,
.stage-index,
.project-key {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}

.noscript-note {
  padding: 12px;
  border-radius: var(--r-3);
  background: var(--warn-soft);
  color: var(--ink-2);
}

.eyebrow {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .06em;
  line-height: 19.5px;
}

.icon {
  width: 14px;
  height: 14px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.is-muted,
.subtle,
.empty-inline {
  color: var(--muted);
}

.is-overdue {
  color: var(--danger-ink) !important;
}

.is-zero {
  opacity: .58;
}

/* ------------------------------------------------------------------------- */
/* 外壳：顶栏                                                                 */
/* ------------------------------------------------------------------------- */

.appbar {
  position: sticky;
  top: 0;
  z-index: 60;
  background: var(--glass);
  backdrop-filter: blur(14px) saturate(1.05);
  -webkit-backdrop-filter: blur(14px) saturate(1.05);
}

.appbar-inner {
  width: min(100%, 1560px);
  min-height: 48px;
  margin: 0 auto;
  padding: 0 clamp(16px, 3vw, 32px);
  display: flex;
  align-items: center;
  gap: 22px;
}

.brandmark {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  flex: none;
  color: var(--ink);
  text-decoration: none;
  border-radius: var(--r-2);
}

.brand-logo {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex: none;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent-ink);
}

.brand-logo svg {
  display: block;
}

.brand-copy {
  display: inline-flex;
  align-items: baseline;
  gap: 9px;
  min-width: 0;
}

.brand-name {
  font-size: 16.5px;
  font-weight: 600;
  letter-spacing: -.01em;
  white-space: nowrap;
}

.module-name {
  color: var(--muted);
  font-size: 14.5px;
  font-weight: 500;
  white-space: nowrap;
  padding-left: 3px;
}

.primary-tabs {
  display: flex;
  align-items: center;
  gap: 2px;
  min-width: 0;
}

.tab {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 32px;
  padding: 5px 10px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 14.5px;
  line-height: 21.5px;
  white-space: nowrap;
  transition: background-color .14s var(--ease), color .14s var(--ease);
}

.tab svg {
  width: 16px;
  height: 16px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.35;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: .9;
}

.tab:hover {
  color: var(--ink);
  background: var(--card-2);
}

.tab.is-active {
  color: var(--accent-ink);
  background: var(--accent-soft);
  font-weight: 600;
}

.appbar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.context-tools,
.primary-tools {
  display: flex;
  align-items: center;
}

.context-tools {
  gap: 9px;
  min-width: 0;
}

.primary-tools {
  gap: 1px;
}

.sync-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 19.5px;
  white-space: nowrap;
}

.sync-status::before {
  content: "";
  width: 6px;
  height: 6px;
  flex: none;
  border-radius: 50%;
  background: var(--muted);
}

.sync-status[data-tone="live"]::before {
  background: var(--ok);
}

.sync-status[data-tone="busy"]::before {
  background: var(--warn);
}

.sync-status[data-tone="error"]::before {
  background: var(--danger);
}

.auth-identity {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--card-2);
  color: var(--ink-2);
  font-size: 13px;
  line-height: 19.5px;
}

.auth-identity[data-mode="auth"] {
  background: var(--accent-soft);
  color: var(--accent-ink);
}

.auth-identity[data-mode="readonly"] {
  background: var(--bg-deep);
  color: var(--muted-strong);
}

.actor-picker {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 7px;
  border-radius: 999px;
  background: var(--bg-deep);
  color: var(--muted-strong);
  font-size: 13px;
  line-height: 19.5px;
  white-space: nowrap;
}

.actor-picker select {
  max-width: 94px;
  padding: 0 14px 0 0;
  color: var(--ink-2);
  font-size: 13.5px;
  line-height: 19.5px;
  cursor: pointer;
}

.icon-btn {
  width: 32px;
  height: 32px;
  min-height: 32px;
  flex: none;
  display: inline-grid;
  place-items: center;
  border-radius: var(--r-2);
  color: var(--ink-2);
  background: transparent;
  transition: background-color .14s var(--ease), color .14s var(--ease);
}

.icon-btn:hover {
  background: var(--card-2);
  color: var(--ink);
}

.icon-btn svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-btn.is-busy {
  color: var(--warn);
}

.theme-icon {
  display: inline-grid;
  place-items: center;
}

.theme-icon svg {
  width: 16px;
  height: 16px;
}

.nav-toggle {
  display: none;
}

/* ------------------------------------------------------------------------- */
/* 页面骨架                                                                   */
/* ------------------------------------------------------------------------- */

.app-main {
  padding-bottom: calc(48px + env(safe-area-inset-bottom, 0px));
}

.page-frame {
  width: min(100%, 1560px);
  margin: 0 auto;
  padding: 24px clamp(18px, 3vw, 40px) 0;
}

.view-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 16px;
  min-height: 40px;
}

.view-heading {
  min-width: 0;
  flex: 1 1 auto;
}

.view-title {
  font-family: var(--display);
  font-size: 29px;
  font-weight: 600;
  line-height: 38.5px;
  letter-spacing: -.02em;
  overflow-wrap: anywhere;
}

.view-copy {
  margin-top: 2px;
  max-width: 880px;
  color: var(--muted);
  font-size: 14.5px;
  line-height: 21.5px;
}

.view-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  flex: none;
  margin-left: auto;
}

.tab-panel {
  margin-top: 20px;
}

.tab-panel:not([hidden]) {
  animation: view-fade-in 160ms var(--ease-out) both;
}

/* ------------------------------------------------------------------------- */
/* 捕获条                                                                     */
/* ------------------------------------------------------------------------- */

.capture-panel {
  margin-top: 18px;
  padding: 3px 4px;
  border-radius: var(--r-3);
  background: var(--surface);
}

.capture-form {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 38px;
  padding: 2px;
  border-radius: var(--r-2);
  background: var(--bg-deep);
}

.capture-mark {
  width: 32px;
  height: 32px;
  min-height: 32px;
  flex: none;
  display: inline-grid;
  place-items: center;
  border-radius: var(--r-2);
  color: var(--accent-ink);
  background: var(--accent-soft);
}

.capture-mark svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
}

.capture-mark:hover {
  background: var(--accent);
  color: var(--on-accent);
}

.capture-field {
  min-width: 0;
  flex: 1;
}

.capture-field input {
  width: 100%;
  height: 32px;
  padding: 0 4px;
  font-size: 15px;
  line-height: 24px;
}

.capture-submit {
  flex: none;
  min-height: 32px;
  padding: 4px 12px;
  border-radius: var(--r-2);
  font-size: 14.5px;
}

.capture-tools {
  display: flex;
  align-items: center;
  gap: 1px;
  flex: none;
}

.capture-tool {
  width: 32px;
  height: 32px;
  min-height: 32px;
  display: inline-grid;
  place-items: center;
  border-radius: var(--r-2);
  color: var(--ink-2);
  background: transparent;
  transition: background-color .14s var(--ease), color .14s var(--ease);
}

.capture-tool:hover {
  background: var(--card-2);
  color: var(--ink);
}

.capture-tool:disabled {
  color: var(--muted);
  background: transparent;
  opacity: .56;
  cursor: not-allowed;
}

.capture-tool svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.capture-tool svg .fill {
  fill: currentColor;
  stroke: none;
}

.capture-tool--ai {
  color: var(--accent-ink);
}

.capture-tool.on {
  color: var(--accent-ink);
  background: var(--accent-soft);
  animation: dot-breathe 1.8s ease-in-out infinite;
}

.capture-tool.busy {
  color: var(--warn-ink);
}

.capture-tool.busy svg {
  animation: tool-spin .8s linear infinite;
}

.capture-panel.is-readonly .capture-tool {
  color: var(--muted);
  background: transparent;
}

.capture-panel.is-readonly .capture-tool.on {
  animation: none;
}

.capture-foot {
  display: none;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px 16px;
  padding: 6px 8px 2px;
  color: var(--muted);
  font-size: 13px;
  line-height: 18px;
}

.capture-panel:focus-within .capture-foot,
.capture-panel.has-input .capture-foot,
.capture-panel.is-readonly .capture-foot,
.capture-panel.has-tool-reason .capture-foot {
  display: flex;
}

.capture-panel.is-readonly {
  background: var(--bg-deep);
}

.capture-panel.is-readonly .capture-form {
  background: color-mix(in srgb, var(--bg-deep) 70%, var(--card-2));
}

.capture-panel.is-readonly .capture-mark {
  color: var(--muted);
  background: var(--card-2);
}

.capture-keys {
  display: flex;
  gap: 10px;
  font-family: var(--mono);
}

.capture-keys b {
  color: var(--ink-2);
  font-weight: 500;
}

.capture-message {
  margin: 4px 8px 3px;
  color: var(--danger-ink);
  font-size: 14px;
  line-height: 19.5px;
}

/* ------------------------------------------------------------------------- */
/* 全局 notice                                                                */
/* ------------------------------------------------------------------------- */

.global-notice {
  position: fixed;
  top: 62px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  width: min(430px, calc(100vw - 24px));
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 10px 10px 12px;
  border-radius: var(--r-3);
  background: var(--surface);
  color: var(--ink-2);
  box-shadow: var(--shadow-notice);
  font-size: 14.5px;
  line-height: 21.5px;
}

.global-notice[data-tone="error"] {
  background: var(--danger-soft);
  color: var(--danger-ink);
}

body.layer-open .global-notice {
  left: clamp(12px, 3vw, 28px);
  transform: none;
}

.notice-mark {
  width: 18px;
  height: 18px;
  flex: none;
  display: inline-grid;
  place-items: center;
  margin-top: 1px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-ink);
}

.global-notice[data-tone="success"] .notice-mark {
  background: var(--ok-soft);
  color: var(--ok);
}

.global-notice[data-tone="error"] .notice-mark {
  background: var(--danger);
  color: var(--on-danger);
}

.global-notice[data-tone="error"] .notice-mark svg {
  display: none;
}

.global-notice[data-tone="error"] .notice-mark::before {
  content: "!";
  font-family: var(--mono);
  font-size: 14.5px;
  font-weight: 700;
  line-height: 1;
}

.notice-mark svg {
  width: 11px;
  height: 11px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.notice-text {
  min-width: 0;
  flex: 1;
  overflow-wrap: anywhere;
}

.notice-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: none;
}

.notice-close {
  width: 26px;
  height: 26px;
  min-height: 26px;
}

/* ------------------------------------------------------------------------- */
/* 按钮                                                                       */
/* ------------------------------------------------------------------------- */

.btn {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: var(--r-2);
  background: var(--card-2);
  color: var(--ink-2);
  font-size: 14.5px;
  line-height: 24px;
  white-space: nowrap;
  transition: background-color .14s var(--ease), color .14s var(--ease);
}

.btn:hover {
  background: var(--bg-deep);
  color: var(--ink);
}

.btn:active {
  background: var(--card-2);
}

.btn-primary {
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
}

.btn-primary:hover {
  background: var(--accent-2);
  color: var(--on-accent);
}

.btn-primary:disabled,
.btn-primary:disabled:hover {
  background: var(--bg-deep);
  color: var(--muted);
  opacity: .9;
}

.btn-quiet {
  background: var(--surface);
  color: var(--ink-2);
}

.btn-quiet:hover {
  background: var(--card-2);
}

.btn-ghost {
  background: transparent;
  color: var(--muted);
}

.btn-ghost:hover {
  background: var(--card-2);
  color: var(--ink);
}

.btn-small {
  min-height: 28px;
  padding: 3px 9px;
  font-size: 14px;
  line-height: 21.5px;
}

.btn-with-icon {
  padding-left: 9px;
}

.btn-with-icon .icon {
  width: 13px;
  height: 13px;
}

.btn-danger {
  background: var(--danger);
  color: var(--on-danger);
}

.mini-btn {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--r-1);
  background: var(--card-2);
  color: var(--ink-2);
  font-size: 13.5px;
  line-height: 21.5px;
  white-space: nowrap;
  transition: background-color .14s var(--ease), color .14s var(--ease);
}

.mini-btn:hover {
  background: var(--bg-deep);
  color: var(--ink);
}

.mini-btn.is-primary {
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-weight: 600;
}

.mini-btn.is-primary:hover {
  background: var(--accent);
  color: var(--on-accent);
}

.mini-btn.is-danger {
  background: var(--danger-soft);
  color: var(--danger-ink);
}

.mini-btn.is-disabled {
  opacity: .55;
}

.mini-btn:disabled {
  color: var(--muted);
}

.text-action {
  min-height: 24px;
  padding: 1px 2px;
  color: var(--accent-ink);
  font-size: 14px;
  line-height: 21.5px;
  background: transparent;
  white-space: nowrap;
}

.text-action:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ------------------------------------------------------------------------- */
/* 通用状态、徽标、提示                                                       */
/* ------------------------------------------------------------------------- */

.loading-panel,
.empty-state,
.error-state {
  padding: 18px 20px;
  border-radius: var(--r-3);
  background: var(--surface);
}

.error-state {
  background: var(--danger-soft);
}

.state-kicker {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .055em;
  line-height: 19.5px;
}

.state-title {
  margin-top: 4px;
  font-family: var(--display);
  font-size: 21.5px;
  font-weight: 600;
  line-height: 31px;
}

.state-copy {
  margin-top: 4px;
  max-width: 740px;
  color: var(--muted);
  font-size: 14.5px;
  line-height: 21.5px;
}

.state-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.inline-alert {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  margin-bottom: 8px;
  border-radius: var(--r-2);
  background: var(--danger-soft);
  color: var(--danger-ink);
  font-size: 14px;
  line-height: 20.5px;
}

.inline-alert p {
  min-width: 0;
}

.inline-refreshing {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 14px;
  line-height: 20.5px;
}

.permission-note {
  margin: 8px 0;
  padding: 7px 9px;
  border-radius: var(--r-2);
  background: var(--card-2);
  color: var(--muted);
  font-size: 13.5px;
  line-height: 19.5px;
}

.permission-inline {
  color: var(--muted);
  font-size: 13px;
  line-height: 18px;
}

.section-help {
  color: var(--muted);
  font-size: 13.5px;
  line-height: 20.5px;
}

.label-small {
  color: var(--muted-strong);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .055em;
  line-height: 18px;
}

.section-count,
.fact-count {
  display: inline-grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--card-2);
  color: var(--muted-strong);
  font-family: var(--mono);
  font-size: 12px;
  line-height: 21.5px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 19px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--card-2);
  color: var(--ink-2);
  font-size: 13px;
  line-height: 19.5px;
  white-space: nowrap;
}

.badge--accent {
  background: var(--accent-soft);
  color: var(--accent-ink);
}

.badge--done {
  background: var(--ok-soft);
  color: var(--ok-ink);
}

.badge--danger {
  background: var(--danger-soft);
  color: var(--danger-ink);
}

.badge--warn {
  background: var(--warn-soft);
  color: var(--warn-ink);
}

.badge--muted {
  background: var(--bg-deep);
  color: var(--muted-strong);
}

.current-badge {
  font-weight: 600;
}

.state-dot {
  width: 7px;
  height: 7px;
  flex: none;
  display: inline-block;
  border-radius: 50%;
  background: var(--muted);
  vertical-align: middle;
}

.state-dot[data-state="inbox"] {
  background: var(--muted);
}

.state-dot[data-state="ready"] {
  background: var(--accent);
}

.state-dot[data-state="doing"],
.state-dot[data-state="in_progress"] {
  background: var(--accent);
  animation: dot-breathe 2s ease-in-out infinite;
}

.state-dot[data-state="blocked"] {
  background: var(--danger);
  box-shadow: 0 0 0 3px var(--danger-soft);
}

.state-dot[data-state="done"],
.state-dot[data-state="active"] {
  background: var(--ok);
}

.state-dot[data-state="dropped"],
.state-dot[data-state="disabled"],
.state-dot[data-state="planned"] {
  background: var(--muted);
}

/* ------------------------------------------------------------------------- */
/* 看板                                                                       */
/* ------------------------------------------------------------------------- */

.kpi-band {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.kpi {
  min-width: 0;
  padding: 14px 16px 12px;
  border-radius: var(--r-3);
  background: var(--surface);
}

.kpi-label {
  display: block;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 19.5px;
}

.kpi-value {
  display: block;
  margin-top: 1px;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 31px;
  font-weight: 400;
  line-height: 36px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.04em;
}

.kpi.is-unavailable .kpi-value {
  color: var(--muted);
}

.kpi-note {
  display: block;
  margin-top: 1px;
  color: var(--muted);
  font-size: 12px;
  line-height: 16.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.board-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px 12px;
  margin-bottom: 10px;
}

.board-filter-row {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  flex: 1 1 0;
  overflow: hidden;
}

.filter-label {
  flex: none;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .055em;
}

.filter-scroll {
  display: flex;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
  min-width: 0;
  flex: 1 1 0;
}

.filter-scroll::-webkit-scrollbar {
  display: none;
}

.filter-chip {
  min-height: 26px;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--card-2);
  color: var(--muted-strong);
  font-size: 13.5px;
  line-height: 21.5px;
  white-space: nowrap;
  transition: background-color .14s var(--ease), color .14s var(--ease);
}

.filter-chip:hover {
  color: var(--ink);
  background: var(--bg-deep);
}

.filter-chip[aria-pressed="true"] {
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-weight: 600;
}

.board-filter-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
}

.filter-select {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 26px;
  padding: 2px 7px;
  border-radius: var(--r-1);
  background: var(--card-2);
  color: var(--muted);
}

.filter-select-label {
  color: var(--muted-strong);
  font-size: 12px;
  line-height: 18px;
  white-space: nowrap;
}

.filter-select select,
.filter-select input {
  max-width: 150px;
  height: 20px;
  padding: 0 12px 0 0;
  color: var(--ink-2);
  font-size: 13px;
  line-height: 24px;
  cursor: pointer;
}

.filter-select input {
  width: 110px;
  padding-right: 0;
  cursor: text;
}

.filter-select--value input {
  width: 100px;
}

.filter-reset {
  min-height: 26px;
  padding: 2px 6px;
  font-size: 13px;
}

.filter-empty-note {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 8px;
  padding: 6px 9px;
  border-radius: var(--r-1);
  background: var(--card-2);
  color: var(--muted);
  font-size: 13.5px;
  line-height: 20.5px;
}

.board-scroll {
  width: 100%;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
}

.board-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  align-items: start;
  min-width: 0;
}

.board-column {
  min-width: 0;
  padding: 10px;
  border-radius: var(--r-3);
  background: var(--bg-deep);
}

.column-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 2px 4px 10px;
}

.column-title {
  min-width: 0;
  flex: 1;
  color: var(--ink-2);
  font-size: 13.5px;
  font-weight: 600;
  line-height: 19.5px;
}

.column-count {
  color: var(--muted-strong);
  font-family: var(--mono);
  font-size: 13px;
  line-height: 19.5px;
  font-variant-numeric: tabular-nums;
}

.task-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.task-row {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 8px;
  border-radius: var(--r-1);
  background: transparent;
  transition: background-color .14s var(--ease);
}

.task-row:hover,
.task-row:focus-within {
  background: var(--surface);
}

.task-row-body {
  min-width: 0;
  width: 100%;
}

.task-card-top {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 3px 8px;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 19.5px;
}

.project-dot {
  width: 8px;
  height: 8px;
  flex: none;
  display: inline-block;
  border-radius: 50%;
  background: var(--project-color, var(--muted));
}

.project-dot.is-unset {
  background: var(--muted);
  opacity: .55;
}

.task-number {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
  line-height: 19.5px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.task-project {
  display: inline-flex;
  align-items: baseline;
  flex-wrap: nowrap;
  gap: 0 4px;
  min-width: 0;
  max-width: 100%;
  color: var(--ink-2);
  font-size: 13px;
  line-height: 19.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-group {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  max-width: 100%;
  flex: 0 1 auto;
  overflow: hidden;
}

.project-group .task-project {
  min-width: 0;
}

.task-card-top .task-number,
.task-card-top .task-due {
  flex: none;
}

.task-project .project-name {
  min-width: 0;
  margin-top: 0;
  font-family: inherit;
  font-size: 13px;
  font-weight: inherit;
  line-height: 19.5px;
  letter-spacing: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-project .project-key {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
  flex: none;
  white-space: nowrap;
}

.task-due {
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
  line-height: 19.5px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.task-due.is-today {
  color: var(--warn-ink);
}

.task-due.is-overdue {
  color: var(--danger-ink);
}

.task-due.is-unset {
  color: var(--muted);
}

.task-row-title {
  display: block;
  width: 100%;
  margin-top: 1px;
  padding: 0;
  color: var(--ink);
  font-size: 15.5px;
  line-height: 23px;
  text-align: left;
  overflow-wrap: anywhere;
}

.task-row-title:hover {
  color: var(--accent-ink);
}

.task-props {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px 7px;
  margin-top: 5px;
  color: var(--muted-strong);
  font-size: 12px;
  line-height: 19.5px;
}

.meta-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  max-width: 100%;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--card-2);
  color: var(--ink-2);
  font-size: 12px;
  line-height: 19.5px;
  overflow-wrap: anywhere;
}

.meta-chip--type {
  background: var(--bg-deep);
  color: var(--muted-strong);
}

.meta-chip--priority.is-muted {
  background: var(--card-2);
  color: var(--muted);
}

.meta-chip--priority.is-warn {
  background: var(--warn-soft);
  color: var(--warn-ink);
}

.meta-chip--priority.is-danger {
  background: var(--danger-soft);
  color: var(--danger-ink);
}

.meta-chip--tag {
  background: var(--accent-soft);
  color: var(--accent-ink);
}

.meta-chip--estimate {
  background: var(--bg-deep);
  color: var(--muted-strong);
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}

.meta-chip--blocked {
  background: var(--danger-soft);
  color: var(--danger-ink);
}

.blocked-dot {
  width: 5px;
  height: 5px;
  flex: none;
  display: inline-block;
  border-radius: 50%;
  background: var(--danger);
}

.assignee-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  max-width: 100%;
  color: var(--ink-2);
  font-size: 12px;
  line-height: 19.5px;
}

.assignee-chip > span:last-child {
  overflow-wrap: anywhere;
}

.avatar.avatar-xs {
  width: 17px;
  height: 17px;
  font-size: 12px;
  line-height: 1;
}

.task-row-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0 8px;
  margin-top: 1px;
  color: var(--muted-strong);
  font-size: 14px;
  line-height: 19.5px;
  font-variant-numeric: tabular-nums;
}

.task-row-meta .mono {
  white-space: nowrap;
}

.task-row-meta .blocker-inline {
  color: var(--danger-ink);
}

.task-row-meta .is-overdue {
  color: var(--danger-ink);
}

.task-row-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 2px;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: opacity .12s var(--ease), max-height .12s var(--ease);
}

.task-row:hover .task-row-actions,
.task-row:focus-within .task-row-actions {
  max-height: 44px;
  opacity: 1;
}

.task-row-actions .mini-btn {
  min-height: 24px;
  padding: 1px 5px;
  font-size: 12px;
}

.column-empty {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 7px 4px 10px;
  color: var(--muted-strong);
  font-size: 13px;
  line-height: 18px;
}

.column-empty .text-action {
  min-height: 22px;
  font-size: 13px;
}

.board-extra {
  margin-top: 10px;
}

.dropped-panel {
  border-radius: var(--r-2);
  background: var(--surface);
}

.dropped-panel summary {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 10px;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 20.5px;
}

.dropped-count {
  min-width: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--card-2);
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 12px;
  text-align: center;
}

.dropped-list {
  padding: 0 8px 8px;
}

.dropped-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 4px;
  border-radius: var(--r-1);
}

.dropped-row:hover {
  background: var(--card-2);
}

.dropped-title {
  flex: 1;
  min-width: 0;
  padding: 0;
  color: var(--ink-2);
  font-size: 14.5px;
  line-height: 21.5px;
  text-align: left;
  overflow-wrap: anywhere;
}

.dropped-row .task-actions,
.dropped-row .row-actions {
  display: flex;
  gap: 2px;
}

/* ------------------------------------------------------------------------- */
/* 主线                                                                       */
/* ------------------------------------------------------------------------- */

.mainline-control {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 2px 8px;
  border-radius: var(--r-2);
  background: var(--card-2);
  color: var(--muted);
}

.control-label {
  font-size: 13px;
  line-height: 19.5px;
  white-space: nowrap;
}

.control-select {
  max-width: 210px;
  color: var(--ink-2);
  font-size: 14px;
  line-height: 21.5px;
  cursor: pointer;
}

.line-context {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 18px;
  padding: 2px 2px 0;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 20.5px;
}

.line-context strong {
  color: var(--ink-2);
  font-weight: 500;
}

.line-project {
  color: var(--accent-ink);
  font-family: var(--mono);
  font-size: 13px;
}

.line-goal {
  margin: 3px 2px 0;
  max-width: 950px;
  color: var(--ink-2);
  font-size: 14.5px;
  line-height: 21.5px;
}

.timeline {
  position: relative;
  margin-top: 14px;
  padding-left: 30px;
}

.timeline::before {
  content: "";
  position: absolute;
  top: 4px;
  bottom: 14px;
  left: 8px;
  width: 2px;
  border-radius: 999px;
  background: var(--line);
}

.timeline-stage {
  position: relative;
  margin-bottom: 10px;
}

.timeline-node {
  position: absolute;
  top: 17px;
  left: -30px;
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--bg);
  z-index: 1;
}

.timeline-node .state-dot {
  width: 8px;
  height: 8px;
}

.stage-main {
  position: relative;
  padding: 12px 14px;
  border-radius: var(--r-3);
  background: var(--surface);
}

.timeline-stage.is-current .stage-main {
  background: var(--accent-soft);
}

.timeline-stage.is-current .stage-main::before {
  content: "";
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: 0;
  width: 3px;
  border-radius: 0 999px 999px 0;
  background: var(--accent);
}

.stage-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px 16px;
}

.stage-title-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.stage-index {
  color: var(--muted);
  font-size: 12px;
  line-height: 19.5px;
}

.stage-title {
  font-family: var(--display);
  font-size: 19.5px;
  font-weight: 600;
  line-height: 28px;
  letter-spacing: -.01em;
}

.stage-head-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: none;
  color: var(--muted);
  font-size: 13px;
  line-height: 19.5px;
}

.stage-due {
  white-space: nowrap;
}

.stage-criteria {
  margin: 6px 0 8px;
  padding: 0;
}

.stage-criteria--expandable summary {
  display: flex;
  align-items: baseline;
  gap: 8px;
  list-style: none;
}

.criteria-text {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0;
  color: var(--ink-2);
  font-size: 14px;
  line-height: 20.5px;
}

.stage-criteria--expandable[open] .criteria-text {
  display: none;
}

.criteria-more {
  color: var(--accent-ink);
  font-size: 12px;
  line-height: 18px;
  white-space: nowrap;
}

.stage-criteria--expandable[open] .criteria-more {
  font-size: 0;
}

.stage-criteria--expandable[open] .criteria-more::after {
  content: "收起";
  font-size: 12px;
}

.criteria-full {
  margin-top: 5px;
  color: var(--ink-2);
  font-size: 14px;
  line-height: 21.5px;
}

.stage-facts {
  display: grid;
  grid-template-columns: minmax(0, 1.85fr) minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.stage-side {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.fact-block {
  min-width: 0;
  padding: 8px 10px;
  border-radius: var(--r-2);
  background: var(--bg-deep);
}

.timeline-stage.is-current .fact-block {
  background: color-mix(in srgb, var(--surface) 55%, transparent);
}

.fact-head {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 20px;
  padding-bottom: 4px;
}

.fact-head .mini-btn {
  margin-left: auto;
  min-height: 24px;
  padding: 1px 6px;
  font-size: 12px;
}

.fact-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.fact-empty {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 3px 1px;
  color: var(--muted-strong);
  font-size: 13px;
  line-height: 18px;
}

.fact-empty .mini-btn {
  min-height: 24px;
  padding: 1px 6px;
  font-size: 12px;
}

.stage-task {
  width: 100%;
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr) auto;
  align-items: start;
  gap: 5px;
  padding: 4px 3px;
  border-radius: var(--r-1);
  text-align: left;
  background: transparent;
}

.stage-task:hover {
  background: var(--surface);
}

.stage-task > .state-dot {
  margin-top: 5px;
}

.task-row-main {
  min-width: 0;
}

.task-row-title {
  display: block;
}

.stage-task .task-row-title {
  color: var(--ink);
  font-size: 14.5px;
  line-height: 21.5px;
  overflow-wrap: anywhere;
}

.stage-task .task-row-meta {
  margin-top: 0;
  font-size: 13px;
  line-height: 18px;
  gap: 0 7px;
  color: var(--muted-strong);
}

.stage-task .badge {
  min-height: 17px;
  padding: 0 5px;
  font-size: 12px;
}

.coord-item {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 6px;
  padding: 2px 1px;
  font-size: 13px;
  line-height: 18px;
}

.coord-person {
  padding: 0 6px;
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 12px;
  line-height: 19.5px;
}

.coord-reason {
  color: var(--muted);
}

.narrative-box {
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: var(--r-2);
  background: var(--card-2);
}

.narrative-head {
  display: flex;
  align-items: center;
  gap: 6px;
}

.human-badge {
  padding: 0 5px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-size: 12px;
  line-height: 19.5px;
}

.narrative-text {
  margin-top: 3px;
  color: var(--ink-2);
  font-size: 13.5px;
  line-height: 20.5px;
}

/* ------------------------------------------------------------------------- */
/* 今日                                                                       */
/* ------------------------------------------------------------------------- */

.today-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px 24px;
  align-items: start;
}

.today-section {
  min-width: 0;
}

.today-section--done {
  grid-column: 1 / -1;
}

.today-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
  padding: 0 2px;
}

.today-section-title {
  color: var(--ink-2);
  font-size: 13.5px;
  font-weight: 600;
  line-height: 19.5px;
  letter-spacing: .015em;
}

.today-count {
  min-width: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--card-2);
  color: var(--muted-strong);
  font-family: var(--mono);
  font-size: 12px;
  line-height: 20.5px;
  text-align: center;
}

.today-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 3px;
  border-radius: var(--r-2);
  background: var(--bg-deep);
}

.today-item {
  width: 100%;
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr) auto;
  align-items: start;
  gap: 6px;
  padding: 5px 6px;
  border-radius: var(--r-1);
  background: transparent;
  text-align: left;
}

.today-item:hover {
  background: var(--surface);
}

.today-item > .state-dot {
  margin-top: 5px;
}

.today-item-main {
  min-width: 0;
}

.today-item-title {
  display: block;
  color: var(--ink);
  font-size: 15px;
  line-height: 21.5px;
  overflow-wrap: anywhere;
}

.today-item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0 8px;
  margin-top: 1px;
  color: var(--muted-strong);
  font-family: var(--mono);
  font-size: 13.5px;
  line-height: 19.5px;
}

.today-item-sub {
  display: block;
  margin-top: 1px;
  color: var(--accent-ink);
  font-size: 12px;
  line-height: 18px;
}

.today-item-evidence {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 13px;
  line-height: 18px;
  overflow-wrap: anywhere;
}

.today-check {
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--ok-soft);
  color: var(--ok-ink);
}

.today-check .icon {
  width: 11px;
  height: 11px;
}

.today-empty {
  padding: 7px 6px;
  color: var(--muted);
  font-size: 13px;
  line-height: 19.5px;
}

/* ------------------------------------------------------------------------- */
/* 项目                                                                       */
/* ------------------------------------------------------------------------- */

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 12px;
  align-items: stretch;
}

.project-card {
  position: relative;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 14px 15px;
  border-radius: var(--r-3);
  background: var(--surface);
}

.project-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.project-ident {
  min-width: 0;
}

.project-key {
  display: block;
  color: var(--accent-ink);
  font-size: 12px;
  line-height: 18px;
}

.project-name {
  margin-top: 1px;
  font-family: var(--display);
  font-size: 19.5px;
  font-weight: 600;
  line-height: 26px;
  letter-spacing: -.01em;
  overflow-wrap: anywhere;
}

.project-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 4px;
  flex: none;
}

.project-goal {
  color: var(--ink-2);
  font-size: 14px;
  line-height: 20.5px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.project-meta-line {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 12px;
  color: var(--muted);
  font-size: 13px;
  line-height: 19.5px;
}

.project-meta-line strong {
  color: var(--ink-2);
  font-weight: 500;
}

.project-progress {
  padding: 7px 8px;
  border-radius: var(--r-1);
  background: var(--bg-deep);
}

.project-progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
  color: var(--muted-strong);
  font-size: 12px;
  line-height: 18px;
}

.project-progress-head .mono {
  font-size: 12px;
}

.progress-track {
  height: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--track);
}

.progress-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.project-empty-line {
  color: var(--muted-strong);
  font-size: 12px;
  line-height: 18px;
}

.project-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
}

.stat-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 3px;
  padding: 1px 6px;
  border-radius: var(--r-1);
  background: var(--card-2);
  color: var(--muted-strong);
  font-size: 12px;
  line-height: 19.5px;
  white-space: nowrap;
}

.stat-chip strong {
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.project-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 3px;
  margin-top: auto;
  padding-top: 2px;
}

.project-actions > .mini-btn {
  min-height: 26px;
}

.project-more {
  position: relative;
}

.project-more > summary {
  list-style: none;
  min-height: 26px;
  padding: 2px 7px;
  border-radius: var(--r-1);
  background: var(--card-2);
  color: var(--ink-2);
  font-size: 13.5px;
  line-height: 21.5px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.project-more > summary .icon {
  width: 13px;
  height: 13px;
}

.project-more > summary:hover {
  background: var(--bg-deep);
}

.project-more-panel {
  position: absolute;
  right: 0;
  bottom: calc(100% + 4px);
  z-index: 20;
  display: grid;
  gap: 2px;
  min-width: 136px;
  padding: 4px;
  border-radius: var(--r-2);
  background: var(--surface);
  box-shadow: var(--shadow-raised);
}

.project-more-panel .mini-btn {
  justify-content: flex-start;
  width: 100%;
  min-height: 28px;
  background: transparent;
}

.project-more-panel .mini-btn:hover {
  background: var(--card-2);
}

/* ------------------------------------------------------------------------- */
/* 人员                                                                       */
/* ------------------------------------------------------------------------- */

.table-scroll {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--r-3);
  background: var(--surface);
  scrollbar-width: thin;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  border-spacing: 0;
  font-size: 14.5px;
  line-height: 21.5px;
}

.data-table th {
  padding: 7px 9px;
  background: var(--bg-deep);
  color: var(--muted-strong);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .04em;
  line-height: 18px;
  text-align: left;
  white-space: nowrap;
}

.data-table th:first-child {
  border-radius: var(--r-2) 0 0 var(--r-2);
}

.data-table th:last-child {
  border-radius: 0 var(--r-2) var(--r-2) 0;
}

.data-table td {
  padding: 7px 9px;
  color: var(--ink-2);
  vertical-align: middle;
  white-space: nowrap;
}

.data-table tbody tr {
  transition: background-color .12s var(--ease);
}

.data-table tbody tr:hover {
  background: var(--card-2);
}

.data-table .num-cell {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.people-table td:first-child {
  color: var(--ink);
}

.person-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.avatar {
  width: 27px;
  height: 27px;
  flex: none;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-family: var(--display);
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1;
}

.avatar.is-disabled {
  background: var(--bg-deep);
  color: var(--muted);
}

.person-name {
  font-weight: 500;
  overflow-wrap: anywhere;
}

.status-line {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 19.5px;
}

.workload-cell span {
  display: inline-block;
  margin-right: 9px;
  color: var(--muted);
  font-size: 13px;
}

.workload-cell strong {
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 13.5px;
  font-weight: 500;
}

.row-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 3px;
}

/* ------------------------------------------------------------------------- */
/* 设置                                                                       */
/* ------------------------------------------------------------------------- */

.settings-layout {
  display: grid;
  grid-template-columns: 138px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.settings-nav {
  position: sticky;
  top: 70px;
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 4px;
  border-radius: var(--r-2);
  background: var(--card-2);
}

.settings-nav-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 30px;
  padding: 4px 8px;
  border-radius: var(--r-1);
  color: var(--muted-strong);
  font-size: 14px;
  line-height: 21.5px;
  text-align: left;
}

.settings-nav-btn:hover {
  color: var(--ink);
  background: var(--surface);
}

.settings-nav-btn.is-active {
  color: var(--accent-ink);
  background: var(--accent-soft);
  font-weight: 600;
}

.settings-nav-count {
  font-size: 12px;
  color: inherit;
  opacity: .72;
}

.settings-content {
  min-width: 0;
}

.settings-panel {
  min-width: 0;
}

.settings-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-bottom: 8px;
}

.settings-title {
  font-family: var(--display);
  font-size: 20.5px;
  font-weight: 600;
  line-height: 29px;
  letter-spacing: -.01em;
}

.settings-filter-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px 10px;
  margin: 8px 0;
}

.settings-filter-row .filter-select {
  min-height: 26px;
}

.scope-flag {
  display: inline-block;
  padding: 0 5px;
  border-radius: 4px;
  background: var(--card-2);
  color: var(--muted);
  font-size: 12px;
  line-height: 20.5px;
}

.field-table {
  min-width: 820px;
}

.field-table td {
  font-size: 13.5px;
}

.field-table td.mono {
  font-size: 13px;
}

.options-cell {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.is-hidden-row {
  opacity: .65;
}

.settings-empty {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 14px;
  border-radius: var(--r-2);
  background: var(--bg-deep);
  color: var(--muted-strong);
  font-size: 14px;
}

.type-table {
  min-width: 620px;
}

.color-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 5px;
  border-radius: 50%;
  background: var(--dot, var(--muted));
  vertical-align: middle;
}

.status-map {
  padding: 4px 8px;
  border-radius: var(--r-2);
  background: var(--surface);
}

.status-map-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  padding: 4px 2px;
  color: var(--ink-2);
  font-size: 14px;
  line-height: 21.5px;
}

.status-map-row:hover {
  background: var(--bg-deep);
}

.status-map-row .mono {
  min-width: 64px;
  color: var(--muted);
  font-size: 13px;
}

.status-map-row .section-help {
  margin-left: auto;
  font-size: 12px;
}

.export-choices {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 12px;
  border-radius: var(--r-2);
  background: var(--surface);
}

/* ------------------------------------------------------------------------- */
/* 抽屉                                                                       */
/* ------------------------------------------------------------------------- */

.overlay {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
}

.scrim {
  position: absolute;
  inset: 0;
  background: var(--scrim);
}

.drawer-overlay {
  justify-content: flex-end;
}

.drawer {
  position: relative;
  z-index: 1;
  width: min(540px, 100vw);
  height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  box-shadow: var(--shadow-drawer);
  transform: translateX(100%);
  transition: transform 200ms var(--ease-out);
}

.drawer-overlay.is-open .drawer {
  transform: translateX(0);
}

.drawer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px 10px;
  flex: none;
}

.drawer-heading {
  min-width: 0;
}

.drawer-heading .eyebrow {
  margin-bottom: 1px;
}

.drawer-head h2 {
  font-family: var(--display);
  font-size: 21.5px;
  font-weight: 600;
  line-height: 31px;
  letter-spacing: -.01em;
  overflow-wrap: anywhere;
}

.drawer-back {
  min-height: 26px;
  margin-bottom: 3px;
  padding: 1px 6px;
  font-size: 13px;
}

.drawer-close {
  flex: none;
}

.drawer-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 4px 18px 24px;
  scrollbar-width: thin;
}

.drawer-loading {
  padding: 12px 2px;
}

.drawer-summary {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px 10px;
  padding: 8px 10px;
  border-radius: var(--r-2);
  background: var(--surface);
}

.summary-main {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  flex: 1 1 220px;
}

.summary-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px 8px;
  min-width: 0;
}

.summary-project,
.summary-due {
  color: var(--muted);
  font-size: 13px;
  line-height: 19.5px;
}

.summary-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 2px 10px;
  color: var(--muted);
  font-size: 12px;
  line-height: 18px;
  font-variant-numeric: tabular-nums;
}

.summary-empty {
  color: var(--muted);
  font-size: 12px;
  line-height: 19.5px;
}

.summary-line .task-due {
  margin-left: 0;
}

.summary-line .meta-chip {
  font-size: 12px;
}

.drawer-quick-actions {
  display: flex;
  gap: 3px;
}

.detail-grid--attributes {
  gap: 8px 12px;
}

.detail-inline {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
}

.summary-line .task-project,
.detail-attributes .task-project {
  white-space: normal;
  overflow: visible;
  flex-wrap: wrap;
}

.summary-line .task-project .project-name,
.detail-attributes .task-project .project-name {
  white-space: normal;
  overflow: visible;
}

.detail-chips {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 3px;
}

.detail-attributes .detail-value {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 3px;
}

.detail-attributes .detail-value > .subtle {
  display: inline;
  font-size: 12px;
  line-height: 18px;
}

.detail-readonly {
  margin-top: 8px;
}

.detail-section {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: var(--r-2);
  background: var(--surface);
}

.detail-section-title {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .055em;
  line-height: 19.5px;
}

.detail-section-title--spaced {
  margin-top: 10px;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px 12px;
  margin-top: 7px;
}

.detail-field {
  min-width: 0;
}

.detail-field--wide {
  grid-column: 1 / -1;
}

.detail-label {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 16.5px;
}

.detail-label em,
.field > span em,
legend em {
  margin-left: 4px;
  color: var(--accent-ink);
  font-size: 12px;
  font-style: normal;
}

.detail-value {
  display: block;
  margin-top: 1px;
  color: var(--ink-2);
  font-size: 14.5px;
  line-height: 21.5px;
  overflow-wrap: anywhere;
}

.detail-value.is-overdue {
  color: var(--danger-ink);
}

.detail-value.is-today {
  color: var(--warn-ink);
}

.detail-empty {
  padding: 4px 1px;
  color: var(--muted);
  font-size: 13px;
  line-height: 19.5px;
}

.task-fields-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-top: 7px;
}

.task-field-view {
  min-width: 0;
  padding: 6px 8px;
  border-radius: var(--r-1);
  background: var(--bg-deep);
}

.task-field-view.is-missing {
  background: var(--card-2);
}

.task-field-view .detail-value {
  font-size: 14px;
  line-height: 20.5px;
}

.task-field-view a,
.field-link {
  color: var(--accent-ink);
  text-decoration: underline;
  text-underline-offset: 2px;
  overflow-wrap: anywhere;
}

.detail-fact-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-top: 7px;
}

.detail-fact {
  min-width: 0;
  padding: 7px 8px;
  border-radius: var(--r-1);
  background: var(--bg-deep);
}

.detail-text {
  margin-top: 2px;
  color: var(--ink-2);
  font-size: 14px;
  line-height: 20.5px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.relation-group {
  margin-top: 7px;
}

.relation-head {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--ink-2);
  font-size: 13px;
  line-height: 19.5px;
}

.detail-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 2px;
}

.detail-row {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 5px 7px;
  border-radius: var(--r-1);
  background: var(--bg-deep);
  text-align: left;
}

.detail-row:hover {
  background: var(--card-2);
}

.detail-row-main {
  min-width: 0;
}

.detail-row-title {
  display: block;
  color: var(--ink-2);
  font-size: 14px;
  line-height: 20.5px;
  overflow-wrap: anywhere;
}

.detail-row-meta {
  display: block;
  color: var(--muted-strong);
  font-family: var(--mono);
  font-size: 12px;
  line-height: 16.5px;
}

.edge-note {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 18px;
}

.milestone-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}

.milestone-chip {
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--bg-deep);
  color: var(--ink-2);
  font-size: 13px;
  line-height: 21.5px;
}

.event-list {
  margin-top: 4px;
}

.event-item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 4px 1px;
  font-size: 13px;
  line-height: 19.5px;
}

.event-text {
  min-width: 0;
  color: var(--ink-2);
  overflow-wrap: anywhere;
}

.event-time {
  color: var(--muted);
  font-size: 12px;
  line-height: 18px;
  white-space: nowrap;
}

.drawer-edit {
  margin-top: 14px;
  padding-top: 2px;
}

.drawer-edit > .detail-section-title {
  margin-bottom: 7px;
}

.danger-zone {
  background: var(--bg-deep);
}

.danger-zone .row-actions {
  margin: 4px 0;
}

/* ------------------------------------------------------------------------- */
/* 表单                                                                       */
/* ------------------------------------------------------------------------- */

.stack-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 10px;
}

.form-grid--fields {
  margin-top: 2px;
}

.form-fieldset {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  padding: 0;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.field > span:first-child,
.field > legend {
  color: var(--muted);
  font-size: 13px;
  line-height: 19.5px;
}

.field--wide {
  grid-column: 1 / -1;
}

.field > input,
.field > select,
.field > textarea,
.field--multi,
.check-row {
  width: 100%;
}

.field > input,
.field > select {
  height: 32px;
  padding: 0 8px;
  border-radius: var(--r-1);
  background: var(--bg-deep);
  color: var(--ink);
  font-size: 14.5px;
  line-height: 24px;
}

.field > select {
  cursor: pointer;
}

.field > textarea {
  min-height: 56px;
  padding: 6px 8px;
  border-radius: var(--r-1);
  background: var(--bg-deep);
  color: var(--ink);
  font-size: 14.5px;
  line-height: 21.5px;
  resize: vertical;
}

.field > input[readonly] {
  color: var(--muted);
}

.field--checkbox {
  justify-content: flex-end;
  padding-bottom: 2px;
}

.checkbox-line {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-2);
  font-size: 14px;
  line-height: 21.5px;
}

input[type="checkbox"] {
  width: 15px;
  height: 15px;
  flex: none;
  accent-color: var(--accent);
}

.field-help {
  color: var(--muted);
  font-size: 12px;
  line-height: 18px;
}

.form-note {
  margin-top: 2px;
  color: var(--muted);
  font-size: 13px;
  line-height: 19.5px;
}

.draft-source {
  padding: 8px 10px;
  border-radius: var(--r-2);
  background: var(--bg-deep);
}

.draft-source-label {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 16.5px;
}

.draft-source-text {
  margin-top: 2px;
  color: var(--ink-2);
  font-size: 14.5px;
  line-height: 21.5px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.draft-understood {
  margin: 1px 0 0;
  color: var(--accent-ink);
  font-size: 13.5px;
  font-weight: 600;
  line-height: 19.5px;
}

.draft-chips {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  min-height: 24px;
}

.draft-chip {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  max-width: 100%;
  padding: 1px 3px 1px 7px;
  border-radius: 999px;
  background: var(--card-2);
  color: var(--ink-2);
  font-size: 13px;
  line-height: 24px;
}

.draft-chip > span {
  min-width: 0;
  max-width: min(260px, 60vw);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.draft-chip-remove {
  width: 20px;
  height: 20px;
  flex: none;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  color: var(--muted);
  font-size: 15.5px;
  line-height: 1;
}

.draft-chip-remove:hover {
  background: var(--danger-soft);
  color: var(--danger-ink);
}

.draft-chip-empty {
  color: var(--muted);
  font-size: 13px;
  line-height: 19.5px;
}

.form-error {
  padding: 6px 8px;
  border-radius: var(--r-1);
  background: var(--danger-soft);
  color: var(--danger-ink);
  font-size: 13.5px;
  line-height: 19.5px;
}

.form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.drawer-savebar {
  position: sticky;
  z-index: 3;
  bottom: -18px;
  margin: 8px -12px -14px;
  padding: 9px 12px;
  background: var(--bg);
}

.form-fieldset:disabled {
  opacity: .74;
}

.task-field-editors {
  min-width: 0;
}

.check-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.check-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 28px;
  padding: 3px 7px;
  border-radius: 999px;
  background: var(--bg-deep);
  color: var(--ink-2);
  font-size: 13px;
  line-height: 21.5px;
}

.check-chip:has(input:checked) {
  background: var(--accent-soft);
  color: var(--accent-ink);
}

.check-chip input {
  margin: 0;
}

fieldset.field--multi {
  border: 0;
  padding: 0;
}

fieldset.field--multi legend {
  padding: 0;
}

/* ------------------------------------------------------------------------- */
/* 弹层                                                                       */
/* ------------------------------------------------------------------------- */

.modal-overlay {
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-dialog {
  position: relative;
  z-index: 1;
  width: min(680px, 100%);
  max-height: min(88dvh, 900px);
  display: flex;
  flex-direction: column;
  border-radius: var(--r-3);
  background: var(--surface);
  box-shadow: var(--shadow-raised);
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 18px 6px;
  flex: none;
}

.modal-head h2 {
  margin-top: 1px;
  font-family: var(--display);
  font-size: 21.5px;
  font-weight: 600;
  line-height: 31px;
}

.modal-description {
  margin-top: 2px;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 19.5px;
  overflow-wrap: anywhere;
}

.modal-body {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 6px 18px 18px;
  scrollbar-width: thin;
}

.modal-body .form-actions {
  position: sticky;
  bottom: -18px;
  margin: 6px -18px -18px;
  padding: 9px 18px;
  background: var(--surface);
}

.member-panel {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 8px;
}

.member-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 9px;
  border-radius: var(--r-1);
  background: var(--bg-deep);
}

.member-ident {
  min-width: 0;
}

.member-name {
  display: block;
  color: var(--ink);
  font-size: 14.5px;
  line-height: 21.5px;
}

.member-account {
  display: block;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
  line-height: 18px;
  overflow-wrap: anywhere;
}

.member-controls {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.member-role-select {
  height: 26px;
  padding: 0 5px;
  border-radius: var(--r-1);
  background: var(--surface);
  color: var(--ink-2);
  font-size: 13px;
}

.member-add-form {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
  border-radius: var(--r-1);
  background: var(--bg-deep);
}

.member-error {
  padding: 6px 8px;
  border-radius: var(--r-1);
  background: var(--danger-soft);
  color: var(--danger-ink);
  font-size: 13px;
  line-height: 19.5px;
}

.interface-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.interface-item {
  padding: 7px 9px;
  border-radius: var(--r-1);
  background: var(--bg-deep);
}

.interface-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--ink-2);
  font-size: 13.5px;
  line-height: 20.5px;
}

.interface-line .mono {
  font-size: 12px;
}

.interface-type {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.interface-contract {
  margin-top: 2px;
  color: var(--muted);
  font-size: 13px;
  line-height: 19.5px;
}

.check-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
  max-height: 340px;
  overflow-y: auto;
}

.check-row {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  padding: 6px 8px;
  border-radius: var(--r-1);
  background: var(--bg-deep);
  cursor: pointer;
}

.check-row:hover {
  background: var(--card-2);
}

.check-row input {
  margin-top: 3px;
}

.check-row-main {
  min-width: 0;
}

.check-row-title {
  display: block;
  color: var(--ink-2);
  font-size: 14px;
  line-height: 20.5px;
  overflow-wrap: anywhere;
}

/* ------------------------------------------------------------------------- */
/* 动效                                                                       */
/* ------------------------------------------------------------------------- */

@keyframes dot-breathe {
  0%, 100% {
    opacity: .72;
    box-shadow: 0 0 0 0 transparent;
  }
  50% {
    opacity: 1;
    box-shadow: 0 0 0 3px var(--accent-soft);
  }
}

@keyframes row-flash {
  0% {
    background-color: var(--accent-soft);
  }
  100% {
    background-color: transparent;
  }
}

@keyframes tool-spin {
  to { transform: rotate(360deg); }
}

.is-flash {
  animation: row-flash 700ms var(--ease-out) both;
}

@keyframes view-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ------------------------------------------------------------------------- */
/* 响应式                                                                     */
/* ------------------------------------------------------------------------- */

@media (max-width: 1120px) {
  .board-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .project-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .appbar-inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "brand tools"
      "context context"
      "nav nav";
    align-items: center;
    gap: 1px 8px;
    padding-top: 7px;
    padding-bottom: 5px;
  }

  .brandmark {
    grid-area: brand;
  }

  .primary-tabs {
    grid-area: nav;
    display: none;
    width: 100%;
    padding: 3px 0 5px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 2px;
  }

  body.nav-open .primary-tabs {
    display: grid;
  }

  .primary-tabs .tab {
    justify-content: flex-start;
    border-radius: var(--r-2);
    padding: 6px 9px;
  }

  .appbar-right {
    display: contents;
  }

  .context-tools {
    grid-area: context;
    display: flex;
    align-items: center;
    gap: 7px;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    padding-bottom: 2px;
  }

  .context-tools::-webkit-scrollbar {
    display: none;
  }

  .primary-tools {
    grid-area: tools;
    justify-self: end;
  }

  .nav-toggle {
    display: inline-grid;
  }

  .sync-status {
    font-size: 12px;
  }

  .auth-identity {
    max-width: 200px;
    padding: 2px 7px;
    font-size: 12px;
  }

  .actor-picker {
    padding: 2px 6px;
  }

  .actor-picker select {
    max-width: 82px;
    font-size: 12px;
  }

  .view-title {
    font-size: 26px;
    line-height: 35px;
  }

  .kpi-band {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .board-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stage-facts {
    grid-template-columns: 1fr;
  }

  .stage-side {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .today-grid {
    grid-template-columns: 1fr;
  }

  .today-section--done {
    grid-column: auto;
  }

  .settings-layout {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .settings-nav {
    position: static;
    flex-direction: row;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .settings-nav::-webkit-scrollbar {
    display: none;
  }

  .settings-nav-btn {
    flex: none;
    gap: 6px;
    white-space: nowrap;
  }
}

@media (max-width: 760px) {
  .brand-name {
    display: none;
  }

  .module-name {
    padding-left: 0;
    color: var(--ink);
    font-size: 16px;
    font-weight: 600;
  }

  .app-main {
    padding-bottom: calc(40px + env(safe-area-inset-bottom, 0px));
  }

  .page-frame {
    padding-top: 14px;
  }

  .view-title {
    font-size: 24px;
    line-height: 32px;
  }

  .view-copy {
    font-size: 13.5px;
    line-height: 19.5px;
  }

  .view-head {
    align-items: flex-start;
  }

  .view-actions {
    gap: 4px;
  }

  .view-actions .btn {
    min-height: 30px;
    padding: 4px 9px;
    font-size: 13.5px;
  }

  .capture-panel {
    margin-top: 10px;
  }

  .capture-form {
    flex-wrap: wrap;
  }

  .capture-field {
    flex: 1 1 160px;
  }

  .capture-submit {
    flex: 1 0 auto;
  }

  .capture-tools {
    margin-left: auto;
  }

  .capture-foot {
    font-size: 12px;
  }

  .capture-keys {
    gap: 7px;
  }

  .global-notice {
    top: 68px;
    bottom: auto;
    left: 10px;
    right: 10px;
    width: auto;
    transform: none;
  }

  body.layer-open .global-notice {
    top: auto;
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    left: 10px;
    right: 10px;
  }

  .kpi {
    padding: 9px 10px 8px;
  }

  .kpi-value {
    font-size: 29px;
    line-height: 35px;
  }

  .board-toolbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
  }

  .board-filter-controls {
    width: 100%;
  }

  .filter-select {
    flex: 1 1 auto;
  }

  .filter-select select {
    max-width: none;
    flex: 1;
  }

  .filter-select--value {
    flex: 1 1 100%;
  }

  .filter-select--value input {
    flex: 1;
    max-width: none;
    width: auto;
  }

  .board-grid {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .board-column {
    padding: 6px 8px 7px;
  }

  .column-head {
    padding-bottom: 9px;
  }

  .task-row-actions {
    max-height: none;
    overflow: visible;
    opacity: 1;
  }

  .task-row-actions .mini-btn {
    min-height: 28px;
    font-size: 13px;
  }

  .board-column .task-row {
    padding: 10px 8px;
  }

  .task-row-title {
    font-size: 16px;
    line-height: 24px;
  }

  .task-row-meta {
    font-size: 14px;
    line-height: 19.5px;
  }

  .detail-grid--attributes {
    grid-template-columns: 1fr;
  }

  .task-card-top {
    gap: 2px 5px;
  }

  .task-props {
    gap: 3px 4px;
  }

  .task-row-actions {
    justify-content: flex-start;
  }

  .project-grid {
    grid-template-columns: 1fr;
  }

  .project-card {
    padding: 13px 14px;
  }

  .timeline {
    padding-left: 24px;
  }

  .timeline::before {
    left: 7px;
  }

  .timeline-node {
    left: -24px;
    width: 16px;
    height: 16px;
    top: 15px;
  }

  .stage-main {
    padding: 11px 12px;
  }

  .stage-title {
    font-size: 18px;
    line-height: 26px;
  }

  .stage-head {
    flex-direction: column;
    gap: 2px;
  }

  .stage-head-meta {
    align-self: flex-start;
  }

  .stage-side {
    grid-template-columns: 1fr;
  }

  .today-grid {
    gap: 12px;
  }

  .project-actions {
    gap: 4px;
  }

  .project-actions > .mini-btn,
  .project-more > summary {
    min-height: 32px;
    padding: 4px 8px;
    font-size: 13.5px;
  }

  .people-table,
  .people-table tbody {
    display: block;
    width: 100%;
  }

  .people-table thead {
    display: none;
  }

  .people-table tbody {
    padding: 4px;
  }

  .people-table tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "person status"
      "account account"
      "role workload"
      "actions actions";
    align-items: center;
    gap: 3px 10px;
    padding: 9px 9px 8px;
    margin-bottom: 3px;
    border-radius: var(--r-2);
    background: var(--surface);
  }

  .people-table tr:hover {
    background: var(--card-2);
  }

  .people-table td {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 0 1px;
    font-size: 13.5px;
    white-space: normal;
  }

  .people-table td::before {
    content: attr(data-label);
    flex: none;
    color: var(--muted);
    font-size: 12px;
    line-height: 18px;
  }

  .people-table td[data-label="人员"] {
    grid-area: person;
    justify-content: flex-start;
    padding-bottom: 1px;
  }

  .people-table td[data-label="人员"]::before,
  .people-table td[data-label="账号"]::before,
  .people-table td[data-label="状态"]::before,
  .people-table td[data-label="操作"]::before {
    display: none;
  }

  .people-table td[data-label="账号"] {
    grid-area: account;
    justify-content: flex-start;
    padding-top: 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 18px;
  }

  .people-table td[data-label="角色"] {
    grid-area: role;
    justify-content: flex-start;
  }

  .people-table td[data-label="状态"] {
    grid-area: status;
    justify-content: flex-end;
    align-self: start;
  }

  .people-table td[data-label="工作量"] {
    grid-area: workload;
    justify-content: flex-end;
    align-self: end;
  }

  .people-table td[data-label="操作"] {
    grid-area: actions;
    justify-content: flex-end;
    padding-top: 2px;
  }

  .people-table .person-cell {
    width: 100%;
  }

  .people-table .person-name {
    font-size: 15.5px;
  }

  .people-table .avatar {
    width: 28px;
    height: 28px;
    font-size: 14.5px;
  }

  .people-table .workload-cell span {
    margin-right: 0;
    margin-left: 8px;
  }

  .people-table .workload-cell span:first-child {
    margin-left: 0;
  }

  .settings-head .btn {
    min-height: 30px;
  }

  .field-table,
  .field-table tbody,
  .type-table,
  .type-table tbody {
    display: block;
    width: 100%;
    min-width: 0;
  }

  .field-table thead,
  .type-table thead {
    display: none;
  }

  .field-table tr,
  .type-table tr {
    display: grid;
    gap: 3px 8px;
    padding: 9px;
    margin-bottom: 3px;
    border-radius: var(--r-2);
    background: var(--surface);
  }

  .field-table tr:hover,
  .type-table tr:hover {
    background: var(--card-2);
  }

  .field-table td,
  .type-table td {
    display: flex;
    align-items: baseline;
    justify-content: flex-start;
    gap: 5px;
    min-width: 0;
    padding: 0 1px;
    font-size: 13.5px;
    line-height: 20.5px;
    white-space: normal;
  }

  .field-table td::before,
  .type-table td::before {
    content: attr(data-label);
    flex: none;
    color: var(--muted-strong);
    font-size: 12px;
    line-height: 18px;
  }

  .field-table tr {
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas:
      "key label actions"
      "scope type actions"
      "options options options"
      "required position visible";
  }

  .field-table td[data-label="key"] {
    grid-area: key;
    color: var(--accent-ink);
    font-size: 12px;
  }

  .field-table td[data-label="标签"] {
    grid-area: label;
    color: var(--ink);
    font-size: 15px;
    font-weight: 500;
  }

  .field-table td[data-label="作用域"] {
    grid-area: scope;
  }

  .field-table td[data-label="类型"] {
    grid-area: type;
    justify-content: flex-end;
  }

  .field-table td[data-label="选项"] {
    grid-area: options;
    max-width: none;
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
  }

  .field-table td[data-label="必填"] {
    grid-area: required;
  }

  .field-table td[data-label="排序"] {
    grid-area: position;
  }

  .field-table td[data-label="可见"] {
    grid-area: visible;
    justify-content: flex-end;
  }

  .field-table td[data-label="可见"]::before {
    content: "显示";
  }

  .field-table td[data-label="操作"] {
    grid-area: actions;
    align-self: start;
    justify-content: flex-end;
  }

  .field-table td[data-label="key"]::before,
  .field-table td[data-label="标签"]::before,
  .field-table td[data-label="操作"]::before,
  .type-table td[data-label="名称"]::before,
  .type-table td[data-label="操作"]::before {
    display: none;
  }

  .type-table tr {
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas:
      "name name actions"
      "project key actions"
      "color position position";
  }

  .type-table td[data-label="名称"] {
    grid-area: name;
    color: var(--ink);
    font-size: 15px;
    font-weight: 500;
  }

  .type-table td[data-label="项目"] {
    grid-area: project;
  }

  .type-table td[data-label="key"] {
    grid-area: key;
    color: var(--accent-ink);
    font-size: 12px;
  }

  .type-table td[data-label="颜色"] {
    grid-area: color;
  }

  .type-table td[data-label="排序"] {
    grid-area: position;
  }

  .type-table td[data-label="操作"] {
    grid-area: actions;
    align-self: start;
    justify-content: flex-end;
  }

  .settings-filter-row {
    align-items: flex-start;
  }

  .settings-filter-row .filter-select {
    flex: 1 1 auto;
  }

  .settings-filter-row .filter-select select {
    max-width: none;
    flex: 1;
  }

  .modal-overlay {
    align-items: flex-end;
    padding: 0;
  }

  .modal-dialog {
    width: 100%;
    max-height: 92dvh;
    border-radius: var(--r-3) var(--r-3) 0 0;
  }

  .modal-head {
    padding: 13px 14px 5px;
  }

  .modal-body {
    padding: 6px 14px 18px;
  }

  .modal-body .form-actions {
    margin: 6px -14px -18px;
    padding: 9px 14px;
  }

  .drawer {
    width: 100vw;
    transform: translateX(100%);
  }

  .drawer-head {
    padding: 12px 14px 8px;
  }

  .drawer-body {
    padding: 4px 14px 20px;
  }

  .form-grid,
  .detail-fact-grid {
    grid-template-columns: 1fr;
  }

  .form-grid--fields {
    grid-template-columns: 1fr;
  }

  .task-fields-grid {
    grid-template-columns: 1fr;
  }

  .detail-grid {
    grid-template-columns: 1fr;
  }

  .detail-field--wide {
    grid-column: auto;
  }

  .drawer-summary {
    align-items: flex-start;
  }
}

@media (hover: none), (pointer: coarse) {
  .task-row-actions {
    max-height: none;
    overflow: visible;
    opacity: 1;
  }

  .mini-btn,
  .filter-chip,
  .tab,
  .btn {
    min-height: 32px;
  }

  .capture-mark,
  .icon-btn {
    width: 34px;
    height: 34px;
    min-height: 34px;
  }

  .task-row-actions .mini-btn,
  .stage-task .mini-btn,
  .text-action,
  .settings-nav-btn,
  .project-more > summary {
    min-height: 32px;
  }

  .capture-tool {
    width: 34px;
    height: 34px;
    min-height: 34px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .tab-panel:not([hidden]),
  .state-dot,
  .is-flash,
  .capture-tool.on,
  .capture-tool.busy svg {
    animation: none !important;
  }

  .task-row,
  .task-row-actions,
  .tab,
  .btn,
  .mini-btn,
  .icon-btn,
  .capture-tool,
  .filter-chip,
  .drawer {
    transition: none !important;
  }
}

/* ------------------------------------------------------------------------- */
/* 用户判据（2026-10-26）：整体缩放真的太小                                   */
/* 字号/行高已统一放大一档；这里补控件、行距与抽屉尺寸，避免只放大字不放大壳。   */
/* ------------------------------------------------------------------------- */

.appbar-inner {
  min-height: 54px;
}

.brand-logo {
  width: 32px;
  height: 32px;
}

.brandmark {
  gap: 10px;
}

.tab {
  min-height: 36px;
  gap: 6px;
  padding: 6px 12px;
}

.tab svg {
  width: 18px;
  height: 18px;
}

.btn {
  min-height: 36px;
  padding: 6px 14px;
}

.btn-small {
  min-height: 32px;
}

.mini-btn {
  min-height: 32px;
  padding: 3px 9px;
}

.capture-form {
  min-height: 44px;
}

.capture-mark,
.capture-tool {
  width: 36px;
  height: 36px;
  min-height: 36px;
}

.capture-field input {
  height: 36px;
}

.capture-mark svg {
  width: 17px;
  height: 17px;
}

.capture-tool svg {
  width: 18px;
  height: 18px;
}

.capture-submit {
  min-height: 36px;
}

.page-frame {
  padding-top: 24px;
}

.view-title {
  font-size: 29px;
  line-height: 38.5px;
}

.kpi {
  padding: 14px 16px 12px;
}

.kpi-value {
  line-height: 36px;
}

.task-row {
  gap: 6px;
  padding: 10px 8px;
}

.task-row-title {
  line-height: 20.5px;
}

.avatar {
  width: 30px;
  height: 30px;
}

.avatar.avatar-xs {
  width: 20px;
  height: 20px;
}

.task-field-view .detail-value,
.detail-text {
  line-height: 22.5px;
}

.drawer {
  width: min(580px, 100vw);
}

.drawer-head {
  padding: 16px 20px 12px;
}

.modal-dialog {
  max-width: 580px;
}

@media (hover: none), (pointer: coarse) {
  .mini-btn,
  .filter-chip,
  .tab,
  .btn {
    min-height: 36px;
  }

  .capture-mark,
  .icon-btn {
    width: 38px;
    height: 38px;
    min-height: 38px;
  }

  .capture-tool {
    width: 38px;
    height: 38px;
    min-height: 38px;
  }

  .task-row-actions .mini-btn,
  .stage-task .mini-btn,
  .text-action,
  .settings-nav-btn,
  .project-more > summary {
    min-height: 36px;
  }
}

/* 字号放大后：卡片顶行不再折成两段；项目名过长只在自身省略。 */
.task-card-top {
  flex-wrap: nowrap;
}

.task-card-top .project-group {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
}

.task-card-top .task-project {
  max-width: 100%;
}

.task-card-top .task-project .project-key {
  flex: 0 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 1360px) {
  .sync-status {
    display: none;
  }
}


/* 卡片顶行空间有限：项目 key 在详情/筛选里可见，卡上只留项目名。 */
.task-card-top .project-key {
  display: none;
}

/* #项目 / @负责人 输入建议 */
.capture-panel {
  position: relative;
}

.capture-suggest {
  position: absolute;
  z-index: 140;
  padding: 6px;
  border-radius: var(--r-3);
  background: var(--surface);
  box-shadow: var(--shadow-raised);
  max-height: min(320px, 50vh);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.capture-suggest-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0;
  padding: 4px 8px 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.capture-suggest-head span {
  font-family: var(--mono);
  font-weight: 500;
}

.capture-suggest-item {
  width: 100%;
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 9px;
  border-radius: var(--r-2);
  text-align: left;
  color: var(--ink);
  cursor: pointer;
}

.capture-suggest-item:hover,
.capture-suggest-item.is-active {
  background: var(--accent-soft);
}

.capture-suggest-item .project-dot {
  width: 9px;
  height: 9px;
}

.suggest-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 15px;
  line-height: 22px;
}

.suggest-meta {
  margin-left: auto;
  flex: none;
  color: var(--muted);
  font-size: 12.5px;
}

.capture-suggest-empty {
  margin: 0;
  padding: 12px 10px;
  color: var(--muted);
  font-size: 14px;
  line-height: 20px;
}

/* 用户判据（2026-10-26）：各板块之间再开一点 */
.page-frame {
  padding-top: 30px;
}

.capture-panel {
  margin-top: 28px;
}

.tab-panel {
  margin-top: 30px;
}

.kpi-band {
  margin-bottom: 28px;
}

.board-toolbar {
  margin-bottom: 16px;
}

@media (max-width: 760px) {
  .page-frame {
    padding-top: 24px;
  }

  .capture-panel {
    margin-top: 18px;
  }

  .tab-panel {
    margin-top: 24px;
  }

  .kpi-band {
    margin-bottom: 22px;
  }
}

/* 协作人员：任务卡/详情/表单共用 */
.check-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.collaborator-chips {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.meta-chip--collab {
  gap: 4px;
}

.meta-chip--collab .avatar-xs {
  width: 16px;
  height: 16px;
  font-size: 9.5px;
}


/* 用户判据：网页 logo 保持亮色（暗色主题也用浅色底） */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .brand-logo {
    background: #FAF9F5;
    color: #A44D2B;
  }
}

:root[data-theme="dark"] .brand-logo {
  background: #FAF9F5;
  color: #A44D2B;
}

.stage-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

@media (max-width: 760px) {
  .stage-head-meta {
    flex-wrap: wrap;
  }

  .stage-actions {
    width: 100%;
    margin-left: 0;
  }
}

/* 关联项目：主项目之外的共同管理项目 */
.linked-project-chips {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.meta-chip--project {
  gap: 4px;
}

.meta-chip--project .project-dot {
  width: 8px;
  height: 8px;
}

/* 项目性质：一次性项目 / 长期事业部 */
.project-filter-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.project-filter-row .section-count {
  margin-left: auto;
  white-space: nowrap;
}

.badge-nature {
  background: var(--warn-soft);
  color: var(--warn-ink);
}

.meta-chip--waiting {
  background: var(--warn-soft);
  color: var(--warn-ink);
}

.relation-head .mini-btn {
  margin-left: auto;
}

/* 参考田野之效顶栏细节：品牌用衬线字，模块做成小胶囊；导航选中=浅底+短下划线 */
.brand-name {
  font-family: var(--display);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -.01em;
}

.module-name {
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--card-2);
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.primary-tabs {
  gap: 4px;
}

.tab {
  position: relative;
  border-radius: var(--r-2);
}

.tab::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 2px;
  height: 2px;
  border-radius: 999px;
  background: var(--accent-ink);
  opacity: 0;
  transform: scaleX(.6);
  transition: opacity 160ms var(--ease-out), transform 160ms var(--ease-out);
}

.tab.is-active::after {
  opacity: 1;
  transform: none;
}

@media (max-width: 760px) {
  .brand-name {
    display: none;
  }

  .module-name {
    padding: 0;
    background: none;
    color: var(--ink);
    font-size: 16px;
    font-weight: 600;
  }

  .tab::after {
    left: 9px;
    right: 9px;
    bottom: 1px;
  }
}

/* 任务附件 */
.attachment-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.attachment-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 7px 9px;
  border-radius: var(--r-2);
  background: var(--bg-deep);
}

.attachment-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink);
  font-size: 14px;
  text-decoration: none;
}

.attachment-name:hover {
  color: var(--accent-ink);
  text-decoration: underline;
}

.attachment-meta {
  flex: none;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.meta-chip--attachment {
  background: var(--card-2);
}

@media (max-width: 760px) {
  .attachment-row {
    flex-wrap: wrap;
  }

  .attachment-name {
    flex-basis: 100%;
  }

  .attachment-meta {
    margin-right: auto;
  }
}

/* 子任务 */
.subtask-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.subtask-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 36px;
  padding: 6px 9px;
  border-radius: var(--r-2);
  background: var(--bg-deep);
  text-align: left;
}

.subtask-row:hover {
  background: var(--card-2);
}

.subtask-title {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
}

.subtask-meta {
  flex: none;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.meta-chip--subtask {
  background: var(--card-2);
}

/* 任务链条 */
.task-chain {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.chain-level {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.chain-level-label {
  flex: none;
  width: 52px;
  color: var(--muted);
  font-size: 11.5px;
}

.chain-node {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 5px 9px;
  border-radius: var(--r-2);
  background: var(--bg-deep);
  text-align: left;
}

.chain-node:hover {
  background: var(--card-2);
}

.chain-node.is-current {
  background: var(--accent-soft);
}

.chain-node-title {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13.5px;
}

.chain-node-meta {
  color: var(--muted);
  font-size: 11.5px;
  white-space: nowrap;
}

.chain-arrow {
  color: var(--muted);
  font-size: 13px;
  line-height: 1;
  padding-left: 58px;
}

@media (max-width: 760px) {
  .chain-level-label {
    width: 100%;
  }

  .chain-arrow {
    padding-left: 0;
  }
}

/* 设置：今日与 GTD */
.settings-guide,
.today-rules {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 14px;
}

.guide-row,
.rule-row {
  display: flex;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--r-2);
  background: var(--surface);
}

.guide-step {
  flex: none;
  width: 42px;
  color: var(--accent-ink);
  font-size: 12px;
  font-weight: 600;
}

.guide-row strong,
.rule-name {
  display: block;
  color: var(--ink);
  font-size: 14px;
}

.guide-row p,
.rule-row p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 19px;
}

.rule-name {
  flex: none;
  width: 76px;
  font-weight: 600;
}

.rule-row p {
  margin: 0;
}

/* 主线：所有项目概览 */
.mainline-overview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.mainline-summary {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  padding: 13px 14px;
  border-radius: var(--r-3);
  background: var(--surface);
  text-align: left;
  transition: background-color .14s var(--ease);
}

.mainline-summary:hover {
  background: var(--card-2);
}

.mainline-summary.is-current {
  background: var(--accent-soft);
}

.mainline-summary-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.mainline-summary-ident {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.mainline-summary-ident .mono {
  color: var(--muted);
  font-size: 10.5px;
}

.mainline-summary-ident strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 15px;
}

.mainline-summary-badges {
  display: flex;
  gap: 4px;
  flex: none;
}

.mainline-summary-stage {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 20px;
  color: var(--ink-2);
  font-size: 13px;
}

.mainline-summary-stage .is-muted {
  margin-left: auto;
}

.mainline-summary-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  color: var(--muted);
  font-size: 11.5px;
}

.mainline-summary-stats > span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.mainline-summary-stats strong {
  color: var(--ink-2);
  font-weight: 600;
}

.mini-track {
  display: inline-block;
  width: 44px;
  height: 3px;
  border-radius: 999px;
  background: var(--track);
  overflow: hidden;
}

.mini-track > i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.mainline-summary-flags {
  display: flex;
  gap: 12px;
  color: var(--muted);
  font-size: 11.5px;
}

.mainline-overview-loading,
.mainline-overview-error {
  margin-top: 18px;
  padding: 12px 14px;
  border-radius: var(--r-2);
  background: var(--surface);
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 760px) {
  .mainline-overview {
    grid-template-columns: 1fr;
  }
}

.today-section-head .today-section-title {
  flex: 1 1 auto;
}

.today-section-head .today-count {
  flex: none;
}

.today-section-head .mini-btn {
  flex: none;
  margin-left: auto;
}

/* 任务详情：更宽、更分区、更好跳转 */
.drawer {
  width: min(760px, 100vw);
}

.drawer-head {
  padding: 18px 24px 12px;
}

.drawer-body {
  padding: 0 24px 32px;
}

.drawer-jump {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  gap: 4px;
  margin: 0 -4px;
  padding: 10px 4px;
  overflow-x: auto;
  scrollbar-width: none;
  background: var(--bg);
}

.drawer-jump::-webkit-scrollbar {
  display: none;
}

.drawer-jump button {
  flex: none;
  min-height: 28px;
  padding: 3px 9px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.drawer-jump button:hover {
  color: var(--ink);
  background: var(--card-2);
}

.drawer-jump button.is-active {
  color: var(--accent-ink);
  background: var(--accent-soft);
}

.drawer-summary {
  padding: 12px 14px;
}

.detail-section {
  margin-top: 14px;
  padding: 14px 16px;
}

.detail-grid {
  gap: 10px 18px;
  margin-top: 10px;
}

.drawer-edit {
  margin-top: 14px;
}

@media (max-width: 760px) {
  .drawer-head {
    padding: 12px 16px 8px;
  }

  .drawer-body {
    padding: 0 16px 24px;
  }

  .detail-section {
    margin-top: 12px;
    padding: 12px 14px;
  }
}

/* 详情分区条：与主界面标签同一套视觉语言 */
.drawer-jump {
  gap: 2px;
  padding: 10px 4px;
}

.drawer-jump button {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 32px;
  padding: 5px 10px;
  border-radius: var(--r-2);
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 500;
}

.drawer-jump button:hover {
  color: var(--ink);
  background: var(--card-2);
}

.drawer-jump button.is-active {
  color: var(--accent-ink);
  background: var(--accent-soft);
  font-weight: 600;
}

.drawer-jump button.is-active::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 1px;
  height: 2px;
  border-radius: 999px;
  background: var(--accent-ink);
}

/* 详情分区跳转：目标区不要被 sticky 分区条盖住 */
.drawer-body {
  scroll-padding-top: 64px;
}

.drawer-body [id^="drawerSection"] {
  scroll-margin-top: 62px;
}
