:root {
  color-scheme: light;
  --ink: #0f1b2d;
  --ink-soft: #2a3950;
  --muted: #5f6f86;
  --muted-2: #7c8a9d;
  --paper: #ffffff;
  --paper-deep: #eef3fa;
  --surface: #ffffff;
  --surface-soft: #f7f9fd;
  --line: rgba(var(--ink-rgb), 0.09);
  --line-strong: rgba(var(--ink-rgb), 0.16);
  --forest: #0b2545;
  --forest-2: #123a63;
  --green: #1d4e89;
  --green-soft: #e8eff9;
  --gold: #b58b4d;
  --gold-bright: #d8b979;
  --gold-soft: #f7edda;
  /* KR 编号字样：与侧栏深蓝同色（深色主题下由 themes.css 覆写） */
  --kr-ink: var(--forest);
  --coral: #b65e48;
  --coral-soft: #f5e4df;
  --blue: #53779c;
  --blue-soft: #e7eef5;
  --shadow-sm: 0 4px 18px rgba(15, 32, 60, 0.05);
  --shadow-md: 0 18px 55px rgba(15, 32, 60, 0.07);
  --shadow-lg: 0 28px 90px rgba(8, 20, 40, 0.16);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 30px;
  --sidebar-width: 246px;
  --font-sans: "Aptos", "Segoe UI Variable Text", "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-display: "Iowan Old Style", "Baskerville", "Georgia", "Times New Roman",
    "Songti SC", serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  /* 主题变量：默认主题「白曜」＝白底 + 深蓝侧栏 ---------------------------- */
  --ink-rgb: 15, 27, 45;
  --accent-rgb: 29, 78, 137;
  --forest-hover: #14416e;
  --hover-bg: rgba(255, 255, 255, 0.52);
  --control-bg: rgba(255, 255, 255, 0.6);
  --control-bg-strong: rgba(255, 255, 255, 0.92);
  --shimmer: rgba(255, 255, 255, 0.62);
  --card-bg: rgba(255, 255, 255, 0.74);
  --card-bg-soft: rgba(255, 255, 255, 0.56);
  --card-bg-hover: rgba(255, 255, 255, 0.96);
  --field-bg: #ffffff;
  --footer-bg: rgba(255, 255, 255, 0.92);
  --dialog-bg: #ffffff;
  --dialog-border: rgba(255, 255, 255, 0.7);
  --dialog-glow: rgba(226, 236, 249, 0.6);
  --topbar-bg: rgba(255, 255, 255, 0.8);
  --overlay-bg: rgba(10, 22, 17, 0.42);
  --page-glow-1: rgba(226, 236, 249, 0.55);
  --page-glow-2: rgba(29, 78, 137, 0.06);
  --sidebar-a: #0b2545;
  --sidebar-b: #091d36;
  --sidebar-c: #07172a;
  --sidebar-glow-1: rgba(216, 185, 121, 0.13);
  --sidebar-glow-2: rgba(74, 133, 200, 0.24);
  /* 侧栏始终为深色，文字色独立于主题的浅色变量 */
  --side-text: rgba(255, 255, 255, 0.78);
  --side-text-strong: rgba(255, 255, 255, 0.97);
  --side-text-dim: rgba(255, 255, 255, 0.52);
  --side-text-faint: rgba(255, 255, 255, 0.62);
  --hero-a: #0b2545;
  --hero-b: #123a63;
  --hero-c: #17456f;
  --hero-glow-1: rgba(216, 185, 121, 0.18);
  --hero-glow-2: rgba(88, 148, 214, 0.22);
  --panel-a: #123a63;
  --panel-b: #0b2545;
  --panel-glow: rgba(216, 185, 121, 0.22);
  --info: #2f6f9f;
  --info-soft: #e7eef5;
  --ok: #2f6c58;
  --ok-soft: #e5eee8;
  --neutral: #6e7d92;
  --neutral-soft: #eef1f6;
  /* 任务操作按钮：编辑=绿、删除=红（实心底 + 白字） */
  --action-edit: #17724f;
  --action-edit-hover: #12603f;
  --action-edit-shadow: rgba(23, 114, 79, 0.26);
  --action-delete: #c33a2e;
  --action-delete-hover: #a92f24;
  --action-delete-shadow: rgba(195, 58, 46, 0.26);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--paper);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 74% -10%, var(--page-glow-1), transparent 31rem),
    radial-gradient(circle at 104% 44%, var(--page-glow-2), transparent 28rem),
    var(--paper);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.is-locked {
  overflow: hidden;
}

button,
input,
textarea,
select {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

svg {
  display: block;
  width: 20px;
  height: 20px;
}

::selection {
  color: #fff;
  background: var(--green);
}

:focus-visible {
  outline: 2px solid rgba(var(--accent-rgb), 0.62);
  outline-offset: 3px;
}

.noscript {
  position: fixed;
  inset: 24px;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 24px;
  color: #fff;
  background: var(--forest);
  border-radius: var(--radius-lg);
}

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  min-height: 100vh;
}

/* -------------------------------------------------------------------------- */
/* Sidebar                                                                    */
/* -------------------------------------------------------------------------- */

.sidebar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  width: var(--sidebar-width);
  height: 100vh;
  padding: 28px 20px 22px;
  color: rgba(255, 255, 255, 0.78);
  overflow: hidden;
  background:
    radial-gradient(circle at 14% 4%, var(--sidebar-glow-1), transparent 14rem),
    radial-gradient(circle at 90% 86%, var(--sidebar-glow-2), transparent 18rem),
    linear-gradient(166deg, var(--sidebar-a) 0%, var(--sidebar-b) 56%, var(--sidebar-c) 100%);
  border-right: 1px solid rgba(255, 255, 255, 0.045);
}

.sidebar::before {
  position: absolute;
  inset: 0;
  pointer-events: none;
  content: "";
  opacity: 0.18;
  background-image: radial-gradient(rgba(255, 255, 255, 0.35) 0.55px, transparent 0.55px);
  background-size: 7px 7px;
  mask-image: linear-gradient(to bottom, #000, transparent 72%);
}

.sidebar > * {
  position: relative;
  z-index: 1;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 4px 8px 28px;
}

.brand-mark {
  position: relative;
  display: grid;
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  place-items: center;
  color: var(--gold-bright);
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(216, 185, 121, 0.28);
  border-radius: 12px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.brand-mark svg {
  width: 25px;
  height: 25px;
}

.brand-name {
  display: block;
  color: #ffffff;
  font-size: 16px;
  font-weight: 650;
  letter-spacing: 0.2em;
  line-height: 1.1;
}

.brand-caption {
  display: block;
  margin-top: 5px;
  color: var(--side-text-dim);
  font-size: 10.5px;
  letter-spacing: 0.08em;
}

.nav-label {
  padding: 0 12px 10px;
  color: rgba(255, 255, 255, 0.3);
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.primary-nav {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.nav-item {
  position: relative;
  display: flex;
  gap: 12px;
  align-items: center;
  min-height: 46px;
  padding: 0 12px;
  color: var(--side-text);
  border: 1px solid transparent;
  border-radius: 12px;
  transition:
    color 180ms ease,
    background 180ms ease,
    border-color 180ms ease,
    transform 180ms ease;
}

.nav-item svg {
  width: 18px;
  height: 18px;
  color: rgba(216, 185, 121, 0.7);
}

.nav-item span:first-of-type {
  font-size: 13.5px;
  font-weight: 540;
  letter-spacing: 0.015em;
}

.nav-item:hover {
  color: var(--side-text-strong);
  background: rgba(255, 255, 255, 0.04);
}

.nav-item.active {
  color: #ffffff;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.105), rgba(255, 255, 255, 0.045));
  border-color: rgba(255, 255, 255, 0.06);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.055);
}

.nav-item.active::before {
  position: absolute;
  top: 12px;
  bottom: 12px;
  left: -1px;
  width: 2px;
  content: "";
  background: var(--gold-bright);
  border-radius: 99px;
  box-shadow: 0 0 12px rgba(216, 185, 121, 0.55);
}

.nav-count {
  min-width: 23px;
  height: 20px;
  margin-left: auto;
  padding: 0 7px;
  color: var(--side-text-faint);
  font-size: 10.5px;
  font-variant-numeric: tabular-nums;
  line-height: 20px;
  text-align: center;
  background: rgba(255, 255, 255, 0.055);
  border-radius: 99px;
}

.nav-item.active .nav-count {
  color: var(--gold-bright);
  background: rgba(216, 185, 121, 0.12);
}

.sidebar-spacer {
  flex: 1;
  min-height: 26px;
}

    /* 固定置底的导航项（AI 小助手）：始终排在所有功能之后 */
    .nav-item-pinned {
      margin-top: 8px;
    }

.week-card {
  margin: 0 2px 16px;
  padding: 17px 16px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
}

.week-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: rgba(255, 255, 255, 0.37);
  font-size: 9.5px;
  font-weight: 650;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.week-card-number {
  margin: 8px 0 3px;
  color: #f6f9ff;
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1;
}

.week-card-copy {
  color: var(--side-text-faint);
  font-size: 11px;
}

.week-card-progress {
  height: 3px;
  margin-top: 14px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 99px;
}

.week-card-progress span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--gold), var(--gold-bright));
  border-radius: inherit;
}

.sidebar-footer {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 8px;
  color: rgba(255, 255, 255, 0.34);
  font-size: 10.5px;
}

.sync-dot {
  width: 6px;
  height: 6px;
  background: #75b89c;
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(117, 184, 156, 0.08);
}

.mobile-close {
  display: none;
}

/* -------------------------------------------------------------------------- */
/* Stage / topbar                                                             */
/* -------------------------------------------------------------------------- */

.app-stage {
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 82px;
  padding: 18px clamp(24px, 4vw, 58px);
  background: var(--topbar-bg);
  border-bottom: 1px solid rgba(var(--ink-rgb), 0.075);
  backdrop-filter: blur(18px);
}

.topbar-left,
.topbar-right {
  display: flex;
  align-items: center;
}

.topbar-left {
  gap: 15px;
}

.topbar-right {
  gap: 16px;
  min-width: 0;
  flex-wrap: nowrap;
  justify-content: flex-end;
  overflow: hidden;
}

.menu-button {
  display: none;
  width: 40px;
  height: 40px;
  padding: 0;
  place-items: center;
  color: var(--ink);
  background: var(--control-bg);
  border: 1px solid var(--line);
  border-radius: 11px;
}

.topbar-path {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.topbar-path svg {
  width: 13px;
  height: 13px;
  color: var(--muted-2);
}

.topbar-title {
  margin-top: 3px;
  color: var(--ink);
  font-size: 15px;
  font-weight: 650;
  letter-spacing: 0.01em;
}

.today-chip {
  display: flex;
  align-items: center;
  gap: 0;
  max-width: min(100%, 880px);
  padding: 8px 14px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1;
  white-space: nowrap;
  background: var(--control-bg);
  border: 1px solid var(--line);
  border-radius: 99px;
}

/* 春节倒计时：放在日期条前边，用金色点缀但与日期条同一套圆角胶囊语言 */
.spring-chip {
  display: inline-flex;
  flex: none;
  gap: 6px;
  align-items: center;
  height: 30px;
  padding: 0 13px;
  color: var(--ink-soft);
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  background: var(--gold-soft);
  border: 1px solid rgba(181, 139, 77, 0.26);
  border-radius: 99px;
}

.spring-chip svg {
  flex: none;
  width: 14px;
  height: 14px;
  color: var(--gold);
}

.spring-chip b {
  margin: 0 1px;
  color: var(--gold);
  font-size: 12.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.today-seg {
  display: inline-flex;
  gap: 5px;
  align-items: center;
  white-space: nowrap;
}

/* 分隔点挂在每一段自己身上，隐藏某一段时不会留下多余的点 */
.today-seg + .today-seg::before {
  flex: none;
  width: 3px;
  height: 3px;
  margin: 0 8px;
  content: "";
  background: var(--line-strong);
  border-radius: 50%;
}

.today-seg svg {
  flex: none;
  width: 14px;
  height: 14px;
  color: var(--green);
}

.today-date {
  color: var(--ink);
  font-weight: 600;
  letter-spacing: 0.01em;
}

.today-weekday {
  color: var(--green);
  font-weight: 600;
}

.today-lunar,
.today-zodiac {
  color: var(--muted-2);
}

.today-weather {
  color: var(--ink-soft);
  font-weight: 600;
}

.today-weather svg {
  color: var(--gold);
}

.today-range {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.today-now {
  color: var(--ink);
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.today-now svg {
  color: var(--coral);
}

.today-city {
  color: var(--muted);
  font-weight: 500;
}

.today-traffic {
  color: var(--ink);
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.today-traffic svg {
  color: var(--coral);
}

.today-traffic.is-clear {
  color: var(--muted);
  font-weight: 600;
}

.today-traffic.is-clear svg {
  color: var(--green);
}

.today-traffic.is-unknown {
  color: var(--coral);
  font-weight: 650;
}

@media (max-width: 1320px) {
  .today-zodiac {
    display: none;
  }
}

@media (max-width: 1180px) {
  .today-lunar {
    display: none;
  }

  .today-range {
    display: none;
  }
}

@media (max-width: 1100px) {
  .today-city {
    display: none;
  }
}

@media (max-width: 980px) {
  .today-weather {
    display: none;
  }

  .today-now {
    display: none;
  }

  .version-badge {
    display: none;
  }
}

@media (max-width: 880px) {
  .today-traffic {
    display: none;
  }
}

.version-badge {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  height: 30px;
  padding: 0 10px;
  color: var(--muted);
  font-family: "SFMono-Regular", "Cascadia Mono", "Consolas", monospace;
  font-size: 10.5px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
  white-space: nowrap;
  cursor: default;
  background: var(--control-bg);
  border: 1px solid var(--line);
  border-radius: 99px;
}

.version-dot {
  width: 5px;
  height: 5px;
  background: var(--green);
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.12);
}

/* -------------------------------------------------------------------------- */
/* Shared primitives                                                          */
/* -------------------------------------------------------------------------- */

.view-root {
  width: min(100%, 1510px);
  margin: 0 auto;
  padding: clamp(30px, 4vw, 54px) clamp(24px, 4vw, 58px) 76px;
}

.view-root:focus {
  outline: none;
}

.button {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  font-size: 12.5px;
  font-weight: 620;
  letter-spacing: 0.01em;
  white-space: nowrap;
  cursor: pointer;
  border: 1px solid transparent;
  border-radius: 11px;
  transition:
    transform 160ms var(--ease),
    background 160ms ease,
    border-color 160ms ease,
    color 160ms ease,
    box-shadow 160ms ease;
}

.button svg {
  width: 16px;
  height: 16px;
}

.button:hover {
  transform: translateY(-1px);
}

.button:active {
  transform: translateY(0);
}

.button:disabled {
  cursor: wait;
  opacity: 0.6;
  transform: none;
}

.button-primary {
  color: #ffffff;
  background: var(--forest);
  border-color: var(--forest);
  box-shadow: 0 8px 22px rgba(11, 37, 69, 0.16);
}

.button-primary:hover {
  background: var(--forest-hover);
  border-color: var(--forest-hover);
  box-shadow: 0 10px 28px rgba(11, 37, 69, 0.22);
}

.button-gold {
  color: #2a2113;
  background: linear-gradient(135deg, #e3c88e, #c5a15f);
  border-color: rgba(172, 132, 65, 0.34);
  box-shadow: 0 9px 24px rgba(160, 119, 48, 0.18);
}

.button-gold:hover {
  background: linear-gradient(135deg, #ecd49d, #cea965);
}

.button-secondary {
  color: var(--ink);
  background: var(--control-bg);
  border-color: var(--line);
}

.button-secondary:hover {
  background: var(--control-bg-strong);
  border-color: var(--line-strong);
}

.button-quiet {
  color: var(--muted);
  background: transparent;
  border-color: transparent;
}

.button-quiet:hover {
  color: var(--ink);
  background: rgba(var(--ink-rgb), 0.045);
}

.button-danger {
  color: var(--coral);
  background: var(--coral-soft);
  border-color: rgba(182, 94, 72, 0.15);
}

.icon-button {
  display: inline-grid;
  width: 38px;
  height: 38px;
  padding: 0;
  place-items: center;
  color: var(--muted);
  cursor: pointer;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 10px;
  transition:
    color 160ms ease,
    background 160ms ease,
    border-color 160ms ease;
}

.icon-button svg {
  width: 17px;
  height: 17px;
}

.icon-button:hover {
  color: var(--ink);
  background: rgba(var(--ink-rgb), 0.05);
}

.icon-button.danger:hover {
  color: var(--coral);
  background: var(--coral-soft);
}

.page-head {
  display: flex;
  gap: 24px;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 28px;
}

.page-head-copy {
  max-width: 680px;
}

.page-head h1 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(30px, 3.2vw, 46px);
  font-weight: 640;
  letter-spacing: -0.045em;
  line-height: 1.1;
}

.page-head-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  padding-bottom: 3px;
}

.eyebrow {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 13px;
  color: var(--green);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.17em;
  text-transform: uppercase;
}

.eyebrow::before {
  width: 18px;
  height: 1px;
  content: "";
  background: var(--gold);
}

.status-pill {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  height: 25px;
  padding: 0 9px;
  font-size: 10.5px;
  font-weight: 650;
  letter-spacing: 0.015em;
  white-space: nowrap;
  border-radius: 99px;
}

.status-pill::before {
  width: 5px;
  height: 5px;
  content: "";
  background: currentColor;
  border-radius: 50%;
}

.status-pill.progress {
  color: var(--info);
  background: var(--info-soft);
}

.status-pill.completed {
  color: var(--ok);
  background: var(--ok-soft);
}

.status-pill.planned {
  color: var(--neutral);
  background: var(--neutral-soft);
}

.status-pill.deferred {
  color: var(--coral);
  background: var(--coral-soft);
}

.priority-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 10.5px;
  white-space: nowrap;
}

.priority-label::before {
  width: 5px;
  height: 5px;
  content: "";
  background: var(--muted-2);
  border-radius: 50%;
}

.priority-label.high {
  color: var(--coral);
}

.priority-label.high::before {
  background: var(--coral);
}

.priority-label.medium::before {
  background: var(--gold);
}

.category-label {
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 550;
  letter-spacing: 0.03em;
}

.meta-dot {
  width: 3px;
  height: 3px;
  background: var(--muted-2);
  border-radius: 50%;
}

.task-meta-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 11px;
}

.task-meta-line svg {
  width: 13px;
  height: 13px;
}

/* -------------------------------------------------------------------------- */
/* Workbench                                                                  */
/* -------------------------------------------------------------------------- */

.range-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  padding: 15px 18px;
  margin-bottom: 30px;
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.preset-group {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  background: var(--control-bg);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.preset-button {
  min-height: 42px;
  padding: 0 24px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 620;
  letter-spacing: 0.01em;
  cursor: pointer;
  background: transparent;
  border: none;
  border-radius: 10px;
  transition:
    color 160ms ease,
    background 160ms ease,
    box-shadow 160ms ease;
}

.preset-button:hover {
  color: var(--ink);
}

.preset-button.active {
  color: var(--ink);
  background: var(--control-bg-strong);
  box-shadow: 0 3px 12px rgba(15, 32, 60, 0.09);
}

.date-range-control {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  height: 50px;
  padding: 0 16px;
  color: var(--muted);
  background: var(--field-bg);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.date-range-control svg {
  width: 18px;
  height: 18px;
  color: var(--green);
}

.date-range-control input {
  width: 134px;
  padding: 0;
  color: var(--ink-soft);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  background: transparent;
  border: 0;
  outline: 0;
}

.date-range-control input::-webkit-calendar-picker-indicator {
  opacity: 0.42;
  cursor: pointer;
}

/* 支持 showPicker 时：整块日期输入都可点击唤起选择器，隐藏原生小图标避免重复触发 */
.has-show-picker .date-range-control input {
  cursor: pointer;
}

.has-show-picker .date-range-control input::-webkit-calendar-picker-indicator {
  display: none;
}

.range-dash {
  color: var(--muted-2);
  font-size: 13px;
}

.range-bar .task-meta-line {
  font-size: 11.5px;
  letter-spacing: 0.02em;
}

.section-heading {
  display: flex;
  gap: 16px;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 17px;
}

.section-title-wrap {
  display: flex;
  gap: 11px;
  align-items: center;
}

.section-title {
  margin: 0;
  font-size: 18px;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.section-count {
  display: inline-grid;
  min-width: 25px;
  height: 22px;
  padding: 0 7px;
  place-items: center;
  color: var(--muted);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  background: rgba(var(--ink-rgb), 0.055);
  border-radius: 99px;
}

.section-side {
  display: flex;
  gap: 9px;
  align-items: center;
  color: var(--muted);
  font-size: 11px;
}

.text-button {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  padding: 0;
  color: var(--green);
  font-size: 11.5px;
  font-weight: 620;
  cursor: pointer;
  background: transparent;
  border: none;
}

.text-button svg {
  width: 14px;
  height: 14px;
  transition: transform 160ms ease;
}

.text-button:hover svg {
  transform: translateX(2px);
}

.report-panel {
  overflow: hidden;
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.report-group + .report-group {
  border-top: 1px solid var(--line);
}

.report-group-heading {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 15px 22px 11px;
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.report-group-heading::after {
  flex: 1;
  height: 1px;
  content: "";
  background: var(--line);
}

.report-group-heading span {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}

.report-group-heading span::before {
  width: 5px;
  height: 5px;
  content: "";
  background: var(--muted-2);
  border-radius: 50%;
}

.report-group-heading.completed span::before {
  background: var(--green);
}

.report-group-heading.progress span::before {
  background: var(--blue);
}

.report-group-heading.planned span::before {
  background: var(--gold);
}

.report-group-heading.deferred span::before {
  background: var(--coral);
}

.report-task {
  position: relative;
  display: grid;
  grid-template-columns: 33px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
  padding: 17px 22px 18px;
  cursor: pointer;
  transition: background 170ms ease;
}

.report-task + .report-task {
  border-top: 1px solid rgba(var(--ink-rgb), 0.065);
}

.report-task:hover {
  background: var(--hover-bg);
}

.task-index {
  padding-top: 1px;
  color: #aab6c7;
  font-family: var(--font-display);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.report-task-title-row {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  align-items: baseline;
}

.report-task h3 {
  flex: 0 1 auto;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  font-size: 14.5px;
  font-weight: 630;
  letter-spacing: -0.01em;
  line-height: 1.45;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.report-task-note {
  display: -webkit-box;
  margin: 6px 0 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.6;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

/* 汇报说明跟标题同一行；字号沿用 11.5px，不抢标题层级 */
.report-task-note.is-inline {
  display: block;
  flex: 0 0 auto;
  max-width: min(46%, 320px);
  min-width: 0;
  margin: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  -webkit-line-clamp: unset;
}

.report-task-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 10px;
  color: var(--muted);
  font-size: 10.5px;
}

.task-subprogress {
  display: inline-flex;
  gap: 7px;
  align-items: center;
}

.task-subprogress-bar {
  width: 35px;
  height: 3px;
  overflow: hidden;
  background: rgba(var(--ink-rgb), 0.08);
  border-radius: 99px;
}

.task-subprogress-bar span {
  display: block;
  height: 100%;
  background: var(--green);
  border-radius: inherit;
}

/* 工作台：默认展开的子任务清单 */
.report-subtasks {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin-top: 9px;
  padding-left: 14px;
}

.report-subtasks::before {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 3px;
  width: 1px;
  content: "";
  background: linear-gradient(
    180deg,
    rgba(var(--ink-rgb), 0.16),
    rgba(var(--ink-rgb), 0.04)
  );
}

.report-subtask {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding: 3px 6px 3px 2px;
  border-radius: 6px;
  transition: background 150ms ease;
}

.report-subtask:hover {
  background: rgba(var(--ink-rgb), 0.035);
}

.report-subtask-check {
  display: grid;
  flex: 0 0 15px;
  width: 15px;
  height: 15px;
  padding: 0;
  margin-top: 1px;
  place-items: center;
  color: transparent;
  cursor: pointer;
  background: transparent;
  border: 1px solid rgba(var(--ink-rgb), 0.22);
  border-radius: 4px;
  transition:
    color 150ms ease,
    background 150ms ease,
    border-color 150ms ease;
}

.report-subtask-check svg {
  width: 9px;
  height: 9px;
}

.report-subtask-check:hover {
  border-color: var(--green);
}

.report-subtask-check:focus-visible {
  outline: 2px solid rgba(var(--accent-rgb), 0.45);
  outline-offset: 2px;
}

.report-subtask-check.done {
  color: #fff;
  background: var(--green);
  border-color: var(--green);
}

.report-subtask-label {
  color: var(--ink-soft);
  font-size: 11.5px;
  line-height: 1.55;
}

.report-subtask-label.done {
  color: var(--muted-2);
  /* 已完成子任务不加删除线，避免影响阅读，只用颜色与勾选框区分 */
  text-decoration: none;
}

/* 子任务截止日期小标签：灰=未到期 / 金=今天 / 红=逾期 / 淡=已完成 */
.subtask-due,
.report-subtask-due,
.archive-subtask-due {
  flex: 0 0 auto;
  padding: 1px 6px;
  color: var(--muted-2);
  font-size: 9px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.03em;
  white-space: nowrap;
  background: rgba(var(--ink-rgb), 0.045);
  border-radius: 999px;
}

.subtask-due.is-planned,
.report-subtask-due.is-planned,
.archive-subtask-due.is-planned {
  color: var(--muted);
}

.subtask-due.is-today,
.report-subtask-due.is-today,
.archive-subtask-due.is-today {
  color: #8a6520;
  background: var(--gold-soft);
}

.subtask-due.is-overdue,
.report-subtask-due.is-overdue,
.archive-subtask-due.is-overdue {
  color: var(--coral);
  background: var(--coral-soft);
}

.subtask-due.is-done,
.report-subtask-due.is-done,
.archive-subtask-due.is-done {
  color: var(--muted-2);
  background: rgba(var(--ink-rgb), 0.035);
}

.report-task-side {
  display: flex;
  gap: 8px;
  align-items: center;
  padding-top: 1px;
}

.archive-mini {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 28px;
  padding: 0 9px;
  color: var(--green);
  font-size: 10px;
  font-weight: 620;
  white-space: nowrap;
  cursor: pointer;
  background: var(--green-soft);
  border: 1px solid rgba(var(--accent-rgb), 0.12);
  border-radius: 8px;
  transition:
    color 160ms ease,
    background 160ms ease;
}

.archive-mini svg {
  width: 13px;
  height: 13px;
}

.archive-mini:hover {
  color: #fff;
  background: var(--green);
}

.task-row-arrow {
  color: var(--muted-2);
}

.task-row-arrow svg {
  width: 15px;
  height: 15px;
  transition: transform 160ms ease;
}

.report-task:hover .task-row-arrow svg {
  transform: translateX(2px);
}

.empty-report {
  padding: 42px 24px;
  color: var(--muted);
  text-align: center;
}

.empty-report svg {
  width: 34px;
  height: 34px;
  margin: 0 auto 13px;
  color: var(--muted-2);
}

.empty-report strong {
  display: block;
  margin-bottom: 4px;
  color: var(--ink-soft);
  font-size: 13px;
}

.empty-report p {
  margin: 0;
  font-size: 11.5px;
}

.report-section + .upcoming-section {
  margin-top: 36px;
}

.plan-badge {
  display: grid;
  gap: 2px;
  min-width: 62px;
  padding: 6px 10px;
  text-align: center;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.plan-badge strong {
  color: var(--ink-soft);
  font-family: var(--font-display);
  font-size: 13.5px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.plan-badge small {
  color: var(--muted-2);
  font-size: 8.5px;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.plan-task .report-task-side {
  gap: 10px;
}


/* -------------------------------------------------------------------------- */
/* Task records                                                               */
/* -------------------------------------------------------------------------- */

.task-stats-strip {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  margin-bottom: 24px;
  overflow: hidden;
  background: var(--card-bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.task-stat {
  padding: 16px 19px;
}

.task-stat + .task-stat {
  border-left: 1px solid var(--line);
}

.task-stat-label {
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 650;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.task-stat-value {
  margin-top: 6px;
  font-family: var(--font-display);
  font-size: 27px;
  line-height: 1;
}

.task-stat-value small {
  color: var(--muted-2);
  font-family: var(--font-sans);
  font-size: 9px;
}

.list-toolbar {
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.filter-tabs {
  display: flex;
  gap: 2px;
  padding: 3px;
  background: var(--control-bg);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.filter-tab {
  min-height: 33px;
  padding: 0 12px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  background: transparent;
  border: none;
  border-radius: 9px;
  transition:
    color 160ms ease,
    background 160ms ease,
    box-shadow 160ms ease;
}

.filter-tab:hover {
  color: var(--ink);
}

.filter-tab.active {
  color: var(--ink);
  background: var(--field-bg);
  box-shadow: 0 2px 8px rgba(15, 32, 60, 0.07);
}

.search-box {
  display: flex;
  gap: 9px;
  align-items: center;
  width: 245px;
  height: 40px;
  padding: 0 12px;
  color: var(--muted);
  background: var(--control-bg);
  border: 1px solid var(--line);
  border-radius: 12px;
  transition:
    border-color 160ms ease,
    background 160ms ease;
}

.list-toolbar-right {
  display: flex;
  gap: 9px;
  align-items: center;
}

.classify-button {
  display: flex;
  gap: 7px;
  align-items: center;
  height: 40px;
  padding: 0 13px;
  color: var(--green);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  background: rgba(var(--accent-rgb), 0.09);
  border: 1px solid rgba(var(--accent-rgb), 0.26);
  border-radius: 12px;
  transition:
    background 160ms ease,
    border-color 160ms ease,
    transform 160ms ease;
}

.classify-button:hover {
  background: rgba(var(--accent-rgb), 0.15);
  border-color: rgba(var(--accent-rgb), 0.4);
}

.classify-button:active {
  transform: translateY(1px);
}

.classify-button svg {
  width: 14px;
  height: 14px;
  color: var(--green);
}

.classify-button em {
  padding: 1px 6px;
  color: #fff;
  font-size: 9.5px;
  font-style: normal;
  font-weight: 700;
  background: var(--green);
  border-radius: 20px;
}

.classify-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 240px;
  padding: 4px;
  margin: 15px 0 0;
  overflow-y: auto;
  list-style: none;
  background: var(--control-bg);
  border: 1px solid var(--line);
  border-radius: 11px;
}

.classify-row {
  display: flex;
  gap: 9px;
  align-items: center;
  padding: 8px 9px;
  border-radius: 8px;
}

.classify-row:hover {
  background: var(--field-bg);
}

.classify-row-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.5;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.classify-row-arrow {
  flex: 0 0 auto;
  color: var(--muted-2);
}

.classify-row-arrow svg {
  width: 13px;
  height: 13px;
}

.classify-row-tag {
  flex: 0 0 auto;
  padding: 3px 9px;
  color: var(--ink);
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
  background: var(--field-bg);
  border: 1px solid var(--line);
  border-radius: 20px;
}

.classify-row-tag.is-empty {
  color: var(--muted);
  background: transparent;
  border-style: dashed;
}

.classify-row-select {
  flex: 0 0 auto;
  width: 118px;
  height: 30px;
  padding: 0 8px;
  color: var(--ink);
  font-size: 11px;
  font-weight: 600;
  background: var(--field-bg);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.classify-row-select.is-empty {
  color: var(--muted);
  border-style: dashed;
}

.classify-add-category {
  display: inline-flex;
  gap: 5px;
  align-items: center;
  margin-top: 10px;
  padding: 0;
  color: var(--accent-strong, var(--accent));
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  background: none;
  border: 0;
}

.classify-add-category:hover {
  text-decoration: underline;
}

.classify-add-category[hidden],
.field-inline-action[hidden] {
  display: none;
}

.category-creator-mount:empty {
  display: none;
}

.category-creator {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-top: 8px;
}

.category-creator-input {
  flex: 1;
  min-width: 0;
  height: 32px;
  padding: 0 10px;
  font-size: 11.5px;
}

.button-sm {
  min-height: 32px;
  padding: 0 12px;
  font-size: 11.5px;
  border-radius: 9px;
}

.field-label-with-action {
  justify-content: space-between;
}

.field-inline-action {
  padding: 0;
  color: var(--accent-strong, var(--accent));
  font-size: 9.5px;
  font-weight: 600;
  cursor: pointer;
  background: none;
  border: 0;
}

.field-inline-action:hover {
  text-decoration: underline;
}

.confirm-icon.classify-icon {
  color: var(--gold);
  background: rgba(var(--gold-rgb, 180, 140, 60), 0.14);
}

.search-box:focus-within {
  background: var(--field-bg);
  border-color: rgba(var(--accent-rgb), 0.28);
}

.search-box svg {
  flex: 0 0 15px;
  width: 15px;
  height: 15px;
}

.search-box input {
  min-width: 0;
  flex: 1;
  padding: 0;
  color: var(--ink);
  font-size: 11.5px;
  background: transparent;
  border: 0;
  outline: 0;
}

.search-box input::placeholder {
  color: var(--muted-2);
}

.search-clear {
  display: grid;
  width: 22px;
  height: 22px;
  padding: 0;
  place-items: center;
  color: var(--muted);
  cursor: pointer;
  background: transparent;
  border: 0;
  border-radius: 50%;
}

.search-clear:hover {
  background: rgba(var(--ink-rgb), 0.06);
}

.search-clear svg {
  width: 12px;
  height: 12px;
}

.task-list {
  overflow: hidden;
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.task-list-header {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 116px 150px 96px 42px;
  gap: 13px;
  padding: 12px 20px;
  color: var(--muted-2);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--line);
}

.task-list-header span:nth-child(4) {
  text-align: left;
}

.task-item {
  transition: background 160ms ease;
}

.task-item + .task-item {
  border-top: 1px solid rgba(var(--ink-rgb), 0.065);
}

.task-item.completed-pending {
  background: linear-gradient(90deg, rgba(229, 238, 232, 0.25), transparent 34%);
}

.task-item:hover {
  background: var(--hover-bg);
}

.task-item.expanded {
  background: var(--hover-bg);
}

.task-item-row {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 116px 150px 96px 42px;
  gap: 13px;
  align-items: center;
  min-height: 72px;
  padding: 13px 20px;
  cursor: pointer;
}

.task-check {
  display: grid;
  width: 23px;
  height: 23px;
  padding: 0;
  place-items: center;
  color: var(--muted-2);
  cursor: pointer;
  background: transparent;
  border: 1px solid rgba(var(--ink-rgb), 0.19);
  border-radius: 50%;
  transition:
    color 160ms ease,
    background 160ms ease,
    border-color 160ms ease,
    transform 160ms var(--ease);
}

.task-check:hover {
  color: var(--green);
  border-color: rgba(var(--accent-rgb), 0.45);
  transform: scale(1.06);
}

.task-check svg {
  width: 13px;
  height: 13px;
  opacity: 0;
  transform: scale(0.7);
  transition:
    opacity 160ms ease,
    transform 160ms var(--ease);
}

.task-check.checked {
  color: #fff;
  background: var(--green);
  border-color: var(--green);
}

.task-check.checked svg {
  opacity: 1;
  transform: scale(1);
}

.task-name-wrap {
  min-width: 0;
}

.task-name {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 0;
  color: var(--ink);
  font-size: 13px;
  font-weight: 610;
  letter-spacing: -0.005em;
  line-height: 1.45;
}

.task-name .priority-label {
  padding: 2px 7px;
  background: rgba(var(--ink-rgb), 0.035);
  border-radius: 99px;
}

.task-name .priority-label::before {
  width: 4px;
  height: 4px;
}

.task-subline {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 4px;
  color: var(--muted);
  font-size: 10.5px;
}

.task-mobile-meta {
  display: none;
}

.mobile-status {
  font-weight: 650;
}

.mobile-status.completed {
  color: var(--ok);
}

.mobile-status.progress {
  color: var(--info);
}

.mobile-status.planned {
  color: var(--neutral);
}

.mobile-status.deferred {
  color: var(--coral);
}

.task-period {
  color: var(--muted);
  font-size: 10.5px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.task-period strong {
  display: block;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 540;
}

.task-period span {
  color: var(--muted-2);
  font-size: 9px;
}

.task-progress {
  display: flex;
  gap: 8px;
  align-items: center;
}

.progress-ring {
  position: relative;
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
}

.progress-ring svg {
  width: 30px;
  height: 30px;
  transform: rotate(-90deg);
}

.progress-ring circle {
  fill: none;
  stroke-width: 2.4;
}

.progress-ring .ring-track {
  stroke: rgba(var(--ink-rgb), 0.075);
}

.progress-ring .ring-value {
  stroke: var(--green);
  stroke-linecap: round;
}

.progress-ring span {
  position: absolute;
  color: var(--muted);
  font-size: 7.5px;
  font-weight: 650;
}

.task-progress-copy {
  color: var(--muted);
  font-size: 9.5px;
  line-height: 1.3;
}

.task-progress-copy strong {
  display: block;
  color: var(--ink-soft);
  font-size: 10.5px;
  font-weight: 550;
}

.task-status-select {
  height: 29px;
  max-width: 116px;
  padding: 0 27px 0 10px;
  color: var(--ink-soft);
  font-size: 10.5px;
  font-weight: 580;
  cursor: pointer;
  background-color: var(--control-bg);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='m6.5 9.25 5.5 5.5 5.5-5.5' stroke='%238090a6' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: 0;
  appearance: none;
}

.task-status-select:focus {
  border-color: rgba(var(--accent-rgb), 0.32);
}

.task-row-chevron {
  display: grid;
  width: 30px;
  height: 30px;
  padding: 0;
  place-items: center;
  color: var(--muted-2);
  cursor: pointer;
  background: transparent;
  border: 0;
  border-radius: 8px;
  transition:
    color 160ms ease,
    background 160ms ease,
    transform 200ms var(--ease);
}

.task-row-chevron:hover {
  color: var(--ink);
  background: rgba(var(--ink-rgb), 0.05);
}

.task-item.expanded .task-row-chevron {
  transform: rotate(180deg);
}

.task-expand {
  display: none;
  padding: 0 20px 20px 71px;
}

.task-item.expanded .task-expand {
  display: block;
  animation: reveal 220ms var(--ease);
}

.task-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(260px, 0.85fr);
  gap: 24px;
  padding-top: 17px;
  border-top: 1px solid var(--line);
}

.detail-label {
  display: block;
  margin-bottom: 7px;
  color: var(--muted-2);
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.detail-copy {
  margin: 0;
  color: var(--ink-soft);
  font-size: 11.5px;
  line-height: 1.7;
  white-space: pre-wrap;
}

.detail-block + .detail-block {
  margin-top: 16px;
}

.subtask-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.subtask {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  padding: 6px 4px;
  border-radius: 7px;
}

.subtask:hover {
  background: rgba(var(--ink-rgb), 0.03);
}

.subtask-check {
  display: grid;
  flex: 0 0 17px;
  width: 17px;
  height: 17px;
  padding: 0;
  margin-top: 1px;
  place-items: center;
  color: transparent;
  cursor: pointer;
  background: transparent;
  border: 1px solid rgba(var(--ink-rgb), 0.2);
  border-radius: 5px;
  transition:
    color 160ms ease,
    background 160ms ease,
    border-color 160ms ease;
}

.subtask-check svg {
  width: 11px;
  height: 11px;
}

.subtask-check.done {
  color: #fff;
  background: var(--green);
  border-color: var(--green);
}

.subtask-label {
  flex: 1;
  min-width: 0;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.55;
}

.subtask-label.done {
  color: var(--muted-2);
  /* 已完成子任务不加删除线，避免影响阅读，只用颜色与勾选框区分 */
  text-decoration: none;
}

.subtask-empty {
  padding: 5px 4px;
  color: var(--muted-2);
  font-size: 10.5px;
}

.inline-subtask-form {
  display: flex;
  gap: 6px;
  margin-top: 9px;
}

.inline-subtask-form input {
  min-width: 0;
  flex: 1;
  height: 31px;
  padding: 0 9px;
  color: var(--ink);
  font-size: 10.5px;
  background: var(--control-bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: 0;
}

.inline-subtask-form input:focus {
  background: var(--field-bg);
  border-color: rgba(var(--accent-rgb), 0.3);
}

.inline-subtask-form button {
  display: grid;
  width: 31px;
  height: 31px;
  padding: 0;
  place-items: center;
  color: var(--green);
  cursor: pointer;
  background: var(--green-soft);
  border: 1px solid rgba(var(--accent-rgb), 0.12);
  border-radius: 8px;
}

.inline-subtask-form button svg {
  width: 14px;
  height: 14px;
}

.task-detail-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  padding-top: 16px;
  margin-top: 18px;
  border-top: 1px solid var(--line);
}

.detail-actions {
  display: flex;
  gap: 4px;
  align-items: center;
}

.detail-action {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  height: 32px;
  padding: 0 12px;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 620;
  cursor: pointer;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
}

.detail-action svg {
  width: 13px;
  height: 13px;
}

.detail-action:hover {
  color: var(--ink);
  background: rgba(var(--ink-rgb), 0.045);
}

.detail-action.edit {
  color: #fff;
  background: var(--action-edit);
  border-color: var(--action-edit);
  box-shadow: 0 3px 10px var(--action-edit-shadow);
}

.detail-action.edit:hover {
  color: #fff;
  background: var(--action-edit-hover);
  border-color: var(--action-edit-hover);
}

.detail-action.danger {
  color: #fff;
  background: var(--action-delete);
  border-color: var(--action-delete);
  box-shadow: 0 3px 10px var(--action-delete-shadow);
}

.detail-action.danger:hover {
  color: #fff;
  background: var(--action-delete-hover);
  border-color: var(--action-delete-hover);
}

.detail-action.archive {
  color: var(--green);
  background: var(--green-soft);
  border-color: rgba(var(--accent-rgb), 0.1);
}

.detail-action.archive:hover {
  color: #fff;
  background: var(--green);
}

.archive-hint {
  display: flex;
  gap: 7px;
  align-items: center;
  color: var(--muted);
  font-size: 9.5px;
}

.archive-hint svg {
  width: 12px;
  height: 12px;
  color: var(--gold);
}

/* -------------------------------------------------------------------------- */
/* Archive                                                                    */
/* -------------------------------------------------------------------------- */

.archive-countbar {
  display: flex;
  gap: 10px;
  align-items: baseline;
  padding: 0 2px 16px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.archive-countbar-label {
  color: var(--ink);
  font-size: 13px;
  font-weight: 620;
  letter-spacing: -0.005em;
}

.archive-countbar-value {
  color: var(--green);
  font-family: var(--font-display);
  font-size: 25px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.archive-countbar-unit {
  color: var(--muted-2);
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.archive-table .task-list-header,
.archive-row {
  grid-template-columns: 38px minmax(0, 1fr) 88px 150px 96px 104px;
}

.archive-row {
  display: grid;
  gap: 13px;
  align-items: center;
  min-height: 72px;
  padding: 13px 20px;
  cursor: pointer;
  transition: background 160ms ease;
}

.archive-row + .archive-row {
  border-top: 1px solid rgba(var(--ink-rgb), 0.065);
}

.archive-row:hover {
  background: var(--hover-bg);
}

.archive-row-check {
  display: grid;
  width: 23px;
  height: 23px;
  place-items: center;
  color: var(--ok);
  background: var(--ok-soft);
  border: 1px solid rgba(var(--ink-rgb), 0.07);
  border-radius: 50%;
}

.archive-row-check svg {
  width: 12px;
  height: 12px;
}

.archive-row .status-pill {
  justify-self: start;
}

.archive-mobile-meta {
  display: none;
}

.archive-restore {
  display: inline-flex;
  gap: 5px;
  align-items: center;
  justify-content: center;
  height: 30px;
  padding: 0 10px;
  color: var(--green);
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  background: var(--green-soft);
  border: 1px solid rgba(var(--accent-rgb), 0.12);
  border-radius: 8px;
  transition:
    color 160ms ease,
    background 160ms ease,
    border-color 160ms ease;
}

.archive-restore svg {
  width: 12px;
  height: 12px;
}

.archive-restore:hover {
  color: #fff;
  background: var(--green);
  border-color: var(--green);
}

/* 归档行标题：可点击打开只读详情 */
.task-name-button {
  display: inline-block;
  max-width: 100%;
  padding: 0;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-align: left;
  cursor: pointer;
  background: none;
  border: 0;
}

.task-name-button:hover {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: rgba(var(--accent-rgb), 0.35);
  text-underline-offset: 3px;
}

.task-name-button:focus-visible {
  outline: 2px solid rgba(var(--accent-rgb), 0.45);
  outline-offset: 3px;
  border-radius: 4px;
}

/* -------------------------------------------------------------------------- */
/* Archive detail (readonly)                                                  */
/* -------------------------------------------------------------------------- */

.modal.archive-detail {
  display: flex;
  flex-direction: column;
  width: min(768px, 100%);
}

.archive-detail-header {
  display: flex;
  flex: 0 0 auto;
  gap: 18px;
  align-items: flex-start;
  justify-content: space-between;
  padding: 26px 30px 20px;
  border-bottom: 1px solid var(--line);
}

.archive-detail-heading {
  min-width: 0;
}

.archive-detail-heading h2 {
  margin: 7px 0 0;
  font-size: 24px;
  font-weight: 640;
  letter-spacing: -0.03em;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.archive-detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
  margin-top: 9px;
  color: var(--muted);
  font-size: 10.5px;
}

.archive-detail-body {
  flex: 1;
  min-height: 0;
  padding: 20px 30px 24px;
  overflow-y: auto;
}

.archive-detail-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px 18px;
  padding: 16px 18px;
  background: var(--control-bg);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.archive-fact {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.archive-fact .detail-label {
  margin-bottom: 0;
}

.archive-fact .status-pill,
.archive-fact .priority-label {
  align-self: flex-start;
}

.archive-fact-value {
  color: var(--ink);
  font-size: 12px;
  font-weight: 560;
  font-variant-numeric: tabular-nums;
}

.archive-fact-note {
  color: var(--muted-2);
  font-size: 9.5px;
}

.archive-detail-section {
  margin-top: 20px;
}

.archive-section-head {
  display: flex;
  gap: 10px;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 9px;
}

.archive-section-head .detail-label {
  margin-bottom: 0;
}

.archive-section-count {
  color: var(--muted-2);
  font-size: 9.5px;
  font-variant-numeric: tabular-nums;
}

.archive-subtasks {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--line);
}

.archive-subtask {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 9px 2px;
  border-bottom: 1px solid rgba(var(--ink-rgb), 0.05);
}

.archive-subtask-mark {
  display: grid;
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
  place-items: center;
  color: transparent;
  background: transparent;
  border: 1px solid rgba(var(--ink-rgb), 0.2);
  border-radius: 5px;
}

.archive-subtask-mark svg {
  width: 10px;
  height: 10px;
}

.archive-subtask.is-done .archive-subtask-mark {
  color: #fff;
  background: var(--green);
  border-color: var(--green);
}

.archive-subtask-label {
  flex: 1;
  min-width: 0;
  color: var(--ink-soft);
  font-size: 11.5px;
  line-height: 1.55;
}

.archive-subtask:not(.is-done) .archive-subtask-label {
  color: var(--muted);
}

.archive-subtask-state {
  flex: 0 0 auto;
  color: var(--muted-2);
  font-size: 9px;
  letter-spacing: 0.04em;
}

.archive-subtask-empty {
  padding: 9px 2px;
  color: var(--muted-2);
  font-size: 10.5px;
}

.detail-copy.is-empty {
  color: var(--muted-2);
}

.archive-detail-footer {
  display: flex;
  flex: 0 0 auto;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
  padding: 15px 30px 19px;
  background: var(--footer-bg);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.archive-detail-footer .button {
  min-width: 96px;
}

.pager {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding: 15px 2px 2px;
}

.pager-summary {
  color: var(--muted);
  font-size: 10.5px;
  font-variant-numeric: tabular-nums;
}

.pager-controls {
  display: flex;
  gap: 5px;
  align-items: center;
}

.pager-step,
.pager-page {
  height: 32px;
  padding: 0 11px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  background: var(--control-bg);
  border: 1px solid var(--line);
  border-radius: 9px;
  transition:
    color 160ms ease,
    background 160ms ease,
    border-color 160ms ease;
}

.pager-page {
  min-width: 32px;
  padding: 0;
}

.pager-step:hover:not(:disabled),
.pager-page:hover:not(.active) {
  color: var(--green);
  background: var(--control-bg-strong);
  border-color: rgba(var(--accent-rgb), 0.35);
}

.pager-page.active {
  color: #fff;
  background: var(--green);
  border-color: var(--green);
}

.pager-step:disabled {
  cursor: not-allowed;
  opacity: 0.38;
}

.pager-gap {
  padding: 0 2px;
  color: var(--muted-2);
  font-size: 11px;
}

/* -------------------------------------------------------------------------- */
/* Empty / loading / error                                                    */
/* -------------------------------------------------------------------------- */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 66px 26px;
  text-align: center;
  background: var(--card-bg-soft);
  border: 1px dashed rgba(var(--ink-rgb), 0.16);
  border-radius: var(--radius-lg);
}

.empty-state-icon {
  display: grid;
  width: 52px;
  height: 52px;
  margin-bottom: 16px;
  place-items: center;
  color: var(--green);
  background: var(--green-soft);
  border-radius: 16px;
}

.empty-state-icon svg {
  width: 23px;
  height: 23px;
}

.empty-state h3 {
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 630;
}

.empty-state p {
  max-width: 380px;
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.7;
}

.loading-view {
  padding-top: 8px;
}

.skeleton {
  position: relative;
  overflow: hidden;
  background: rgba(var(--ink-rgb), 0.06);
  border-radius: 10px;
}

.skeleton::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(90deg, transparent, var(--shimmer), transparent);
  transform: translateX(-100%);
  animation: shimmer 1.45s infinite;
}

.skeleton-title {
  width: 34%;
  height: 42px;
  margin-bottom: 13px;
}

.skeleton-subtitle {
  width: 52%;
  height: 15px;
  margin-bottom: 36px;
}

.skeleton-hero {
  height: 250px;
  margin-bottom: 30px;
  border-radius: var(--radius-xl);
}

.skeleton-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 30px;
}

.skeleton-panel {
  height: 410px;
  border-radius: var(--radius-lg);
}

.error-view {
  display: grid;
  min-height: 55vh;
  place-items: center;
}

.error-card {
  max-width: 430px;
  padding: 35px;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

.error-card .empty-state-icon {
  margin: 0 auto 17px;
  color: var(--coral);
  background: var(--coral-soft);
}

.error-card h2 {
  margin: 0 0 8px;
  font-size: 18px;
}

.error-card p {
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 11.5px;
}

/* -------------------------------------------------------------------------- */
/* Drawer                                                                     */
/* -------------------------------------------------------------------------- */

.overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  justify-content: flex-end;
  background: var(--overlay-bg);
  backdrop-filter: blur(3px);
  animation: fadeIn 180ms ease;
}

.overlay.centered {
  align-items: center;
  justify-content: center;
  padding: clamp(18px, 4vh, 44px) clamp(18px, 4vw, 48px);
}

.overlay.task-overlay {
  background: var(--overlay-bg);
  backdrop-filter: blur(5px);
}

.task-dialog {
  display: flex;
  flex-direction: column;
  width: min(1060px, 100%);
  max-height: 100%;
  overflow: hidden;
  background:
    radial-gradient(circle at 88% -12%, var(--dialog-glow), transparent 24rem),
    var(--dialog-bg);
  border: 1px solid var(--dialog-border);
  border-radius: 24px;
  box-shadow: var(--shadow-lg);
  animation: modalIn 240ms var(--ease);
}

#task-form {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
}

.task-dialog-header {
  display: flex;
  flex: 0 0 auto;
  gap: 18px;
  align-items: flex-start;
  justify-content: space-between;
  padding: 26px 34px 20px;
  border-bottom: 1px solid var(--line);
}

.task-dialog-kicker {
  color: var(--green);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.task-dialog-header h2 {
  margin: 6px 0 0;
  font-size: 26px;
  font-weight: 640;
  letter-spacing: -0.035em;
  line-height: 1.15;
}

.task-dialog-hint {
  margin: 7px 0 0;
  color: var(--muted-2);
  font-size: 10px;
  letter-spacing: 0.01em;
}

.dialog-close {
  display: grid;
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  padding: 0;
  place-items: center;
  color: var(--muted);
  cursor: pointer;
  background: var(--control-bg);
  border: 1px solid var(--line);
  border-radius: 11px;
}

.dialog-close:hover {
  color: var(--ink);
  background: var(--field-bg);
}

.dialog-close svg {
  width: 17px;
  height: 17px;
}

.dialog-close,
.drawer-close {
  transition:
    color 150ms ease,
    background 150ms ease;
}

.drawer-close {
  display: grid;
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  padding: 0;
  place-items: center;
  color: var(--muted);
  cursor: pointer;
  background: var(--control-bg);
  border: 1px solid var(--line);
  border-radius: 11px;
}

.drawer-close:hover {
  color: var(--ink);
  background: var(--field-bg);
}

.drawer-close svg {
  width: 17px;
  height: 17px;
}

.task-dialog-body {
  flex: 1;
  min-height: 0;
  padding: 22px 34px 26px;
  overflow-y: auto;
}

.task-form-lead {
  margin-bottom: 20px;
}

.task-form-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(0, 0.98fr);
  gap: 26px 34px;
  align-items: stretch;
}

.task-form-col {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
}

.task-form-col + .task-form-col {
  padding-left: 34px;
  border-left: 1px solid var(--line);
}

.task-form-col > .field + .field,
.task-form-col > .field-row + .field,
.task-form-col > .field + .field-row {
  margin-top: 0;
}

.task-form-col .field-textarea {
  min-height: 118px;
}

/* 右列只保留「任务说明」，让它撑满与左列等高，弹窗版面更平衡 */
.task-form-col:last-child > .field {
  display: flex;
  flex: 1;
  flex-direction: column;
}

.task-form-col:last-child > .field .field-textarea {
  flex: 1;
}

.task-subtask-block {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.task-subtask-block .form-section-title {
  margin-bottom: 12px;
}

.form-section + .form-section {
  padding-top: 24px;
  margin-top: 25px;
  border-top: 1px solid var(--line);
}

.form-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.form-section-title h3 {
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.form-section-title span {
  color: var(--muted-2);
  font-size: 9.5px;
}

.field {
  display: block;
}

.field + .field,
.field-row + .field,
.field + .field-row {
  margin-top: 15px;
}

.field-label {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-bottom: 7px;
  color: var(--ink-soft);
  font-size: 10.5px;
  font-weight: 600;
}

.field-label small {
  color: var(--muted-2);
  font-size: 9px;
  font-weight: 400;
}

.field-hint {
  display: block;
  margin-top: 6px;
  color: var(--muted-2);
  font-size: 9.5px;
  line-height: 1.5;
  letter-spacing: 0.01em;
  transition: color 160ms ease;
}

.field-hint:not(:empty) {
  color: var(--accent-strong, var(--muted));
}

.field-input,
.field-textarea,
.field-select {
  width: 100%;
  color: var(--ink);
  font-size: 12px;
  background: var(--control-bg);
  border: 1px solid rgba(var(--ink-rgb), 0.12);
  border-radius: 10px;
  outline: 0;
  transition:
    background 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.field-input,
.field-select {
  height: 42px;
  padding: 0 12px;
}

.field-input.title-input {
  height: 50px;
  padding: 0 15px;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.015em;
}

.field-textarea {
  min-height: 94px;
  padding: 11px 12px;
  line-height: 1.65;
  resize: vertical;
}

.field-input::placeholder,
.field-textarea::placeholder {
  color: var(--muted-2);
}

.field-input:focus,
.field-textarea:focus,
.field-select:focus {
  background: var(--field-bg);
  border-color: rgba(var(--accent-rgb), 0.36);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.07);
}

.field-select {
  padding-right: 32px;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='m6.5 9.25 5.5 5.5 5.5-5.5' stroke='%238090a6' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  appearance: none;
}

.field-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 13px;
}

.field-row.three {
  grid-template-columns: 1.15fr 0.85fr 0.85fr;
}

.field-row .field + .field {
  margin-top: 0;
}

.date-field-wrap {
  position: relative;
}

.date-field-wrap svg {
  position: absolute;
  top: 50%;
  right: 12px;
  width: 14px;
  height: 14px;
  color: var(--muted-2);
  pointer-events: none;
  transform: translateY(-50%);
}

.date-field-wrap .field-input {
  padding-right: 34px;
  font-variant-numeric: tabular-nums;
}

.date-field-wrap .field-input::-webkit-calendar-picker-indicator {
  opacity: 0;
}

.has-show-picker .date-field-wrap .field-input {
  cursor: pointer;
}

.has-show-picker .date-field-wrap .field-input::-webkit-calendar-picker-indicator {
  display: none;
}

.date-field-wrap .field-input:hover {
  border-color: rgba(var(--ink-rgb), 0.24);
}

.helper-copy {
  margin: 7px 0 0;
  color: var(--muted-2);
  font-size: 9.5px;
  line-height: 1.55;
}

.drawer-subtasks {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.drawer-subtask-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.drawer-subtask-check {
  display: grid;
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  padding: 0;
  place-items: center;
  color: transparent;
  cursor: pointer;
  background: var(--control-bg);
  border: 1px solid rgba(var(--ink-rgb), 0.16);
  border-radius: 6px;
}

.drawer-subtask-check svg {
  width: 12px;
  height: 12px;
}

.drawer-subtask-check[aria-pressed="true"] {
  color: #fff;
  background: var(--green);
  border-color: var(--green);
}

.drawer-subtask-input {
  min-width: 0;
  flex: 1;
  height: 37px;
  padding: 0 10px;
  color: var(--ink);
  font-size: 11px;
  background: var(--control-bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: 0;
}

.drawer-subtask-input:focus {
  background: var(--field-bg);
  border-color: rgba(var(--accent-rgb), 0.3);
}

/* 子任务截止日期：紧凑日期输入，未填写时低调，填了才突出 */
.drawer-subtask-date {
  flex: 0 0 108px;
  width: 108px;
  height: 37px;
  padding: 0 6px;
  color: var(--muted-2);
  font-family: inherit;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  background: transparent;
  border: 1px dashed rgba(var(--ink-rgb), 0.16);
  border-radius: 8px;
  outline: 0;
  transition:
    color 160ms ease,
    background 160ms ease,
    border-color 160ms ease;
}

.drawer-subtask-date:hover {
  color: var(--ink-soft);
  border-color: rgba(var(--ink-rgb), 0.28);
}

.drawer-subtask-date.has-value {
  color: var(--ink);
  background: var(--control-bg);
  border-style: solid;
  border-color: var(--line);
}

.drawer-subtask-date:focus {
  background: var(--field-bg);
  border-color: rgba(var(--accent-rgb), 0.3);
}

.drawer-subtask-date::-webkit-calendar-picker-indicator {
  opacity: 0.5;
  cursor: pointer;
}

.drawer-subtask-date:not(.has-value)::-webkit-datetime-edit {
  color: var(--muted-2);
}

.remove-subtask {
  display: grid;
  flex: 0 0 31px;
  width: 31px;
  height: 31px;
  padding: 0;
  place-items: center;
  color: var(--muted-2);
  cursor: pointer;
  background: transparent;
  border: 0;
  border-radius: 7px;
}

.remove-subtask:hover {
  color: var(--coral);
  background: var(--coral-soft);
}

.remove-subtask svg {
  width: 13px;
  height: 13px;
}

.add-subtask-button {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  align-self: flex-start;
  margin-top: 9px;
  padding: 0;
  color: var(--green);
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  background: transparent;
  border: 0;
}

.add-subtask-button svg {
  width: 13px;
  height: 13px;
}

.task-dialog-footer {
  display: flex;
  flex: 0 0 auto;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
  padding: 16px 34px 20px;
  background: var(--footer-bg);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.task-dialog-footer .button {
  min-width: 106px;
}

.dialog-footer-note {
  margin-right: auto;
  color: var(--muted-2);
  font-size: 9.5px;
}

/* -------------------------------------------------------------------------- */
/* AI 识别设置弹窗                                                              */
/* -------------------------------------------------------------------------- */

.ai-dialog {
  width: min(620px, calc(100vw - 48px));
}

.ai-key-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.ai-key-row .field-input {
  flex: 1;
  min-width: 0;
}

.ai-key-toggle {
  flex: 0 0 auto;
  min-width: 58px;
  height: 38px;
  padding: 0 12px;
  font-size: 12px;
  border: 1px solid var(--line);
}

.ai-test-result {
  margin-top: 14px;
  padding: 9px 12px;
  font-size: 12px;
  line-height: 1.55;
  border-left: 2px solid var(--line-strong);
  border-radius: 0 6px 6px 0;
}

.ai-test-result.is-busy {
  color: var(--muted);
  background: var(--surface-2);
}

.ai-test-result.is-ok {
  color: var(--ok);
  background: rgba(31, 122, 82, 0.08);
  border-left-color: var(--ok);
}

.ai-test-result.is-fail {
  color: var(--coral);
  background: var(--coral-soft);
  border-left-color: var(--coral);
}

.ai-dialog .task-dialog-footer {
  justify-content: space-between;
}

.ai-dialog .task-dialog-footer .button {
  min-width: 0;
}

.ai-dialog .task-dialog-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-left: auto;
}

.ai-dialog .task-dialog-footnote {
  color: var(--muted-2);
  font-size: 10.5px;
}

.ai-dialog .task-dialog-footnote code {
  padding: 1px 4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10px;
  color: var(--muted);
  background: rgba(var(--ink-rgb), 0.05);
  border-radius: 3px;
}

/* -------------------------------------------------------------------------- */
/* Modal                                                                      */
/* -------------------------------------------------------------------------- */

.modal {
  width: min(680px, 100%);
  max-height: calc(100vh - 48px);
  overflow: hidden;
  background: var(--dialog-bg);
  border: 1px solid var(--dialog-border);
  border-radius: 22px;
  box-shadow: var(--shadow-lg);
  animation: modalIn 220ms var(--ease);
}

.modal.small {
  width: min(430px, 100%);
}

.modal-header {
  display: flex;
  gap: 15px;
  align-items: flex-start;
  justify-content: space-between;
  padding: 24px 26px 18px;
  border-bottom: 1px solid var(--line);
}

.modal-kicker {
  color: var(--green);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.modal-header h2 {
  margin: 6px 0 0;
  font-size: 23px;
  font-weight: 640;
  letter-spacing: -0.035em;
}

.modal-header p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 10.5px;
}

.modal-body {
  padding: 22px 26px;
  overflow-y: auto;
}

.report-textarea {
  width: 100%;
  min-height: 390px;
  max-height: 55vh;
  padding: 20px;
  color: var(--ink-soft);
  font-family: "SFMono-Regular", "Cascadia Code", "Consolas", "Microsoft YaHei", monospace;
  font-size: 11.5px;
  line-height: 1.9;
  resize: vertical;
  background: var(--field-bg);
  border: 1px solid var(--line);
  border-radius: 13px;
  outline: 0;
}

.report-textarea:focus {
  background: var(--field-bg);
  border-color: rgba(var(--accent-rgb), 0.3);
}

.modal-footer {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  padding: 17px 26px 21px;
  border-top: 1px solid var(--line);
}

.modal-footer-right {
  display: flex;
  gap: 9px;
  align-items: center;
}

.modal-note {
  display: flex;
  gap: 7px;
  align-items: center;
  color: var(--muted-2);
  font-size: 9.5px;
}

.modal-note svg {
  width: 13px;
  height: 13px;
  color: var(--gold);
}

.confirm-icon {
  display: grid;
  width: 48px;
  height: 48px;
  margin-bottom: 17px;
  place-items: center;
  color: var(--coral);
  background: var(--coral-soft);
  border-radius: 14px;
}

.confirm-icon svg {
  width: 22px;
  height: 22px;
}

.confirm-body {
  padding: 26px;
}

.confirm-body h2 {
  margin: 0 0 7px;
  font-size: 21px;
  font-weight: 640;
  letter-spacing: -0.03em;
}

.confirm-body p {
  margin: 0;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.65;
}

.confirm-target {
  padding: 11px 13px;
  margin-top: 15px;
  color: var(--ink-soft);
  font-size: 11px;
  background: var(--control-bg);
  border: 1px solid var(--line);
  border-radius: 9px;
}

.confirm-icon.rename-icon {
  color: var(--action-edit);
  background: var(--green-soft);
}

.rename-field {
  display: flex;
  gap: 0;
  align-items: center;
  margin-top: 16px;
  background: var(--control-bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  transition:
    border-color 150ms var(--ease),
    box-shadow 150ms var(--ease);
}

.rename-field:focus-within {
  border-color: rgba(var(--accent-rgb), 0.45);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.1);
}

.rename-input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 11px 4px 11px 13px;
  font-size: 13px;
  font-weight: 560;
  color: var(--ink);
  background: transparent;
  border: none;
  outline: none;
}

.rename-ext {
  flex: 0 0 auto;
  padding: 11px 13px 11px 0;
  font-size: 12px;
  color: var(--muted);
}

.confirm-actions {
  display: flex;
  gap: 9px;
  justify-content: flex-end;
  padding: 16px 26px 22px;
  border-top: 1px solid var(--line);
}

/* -------------------------------------------------------------------------- */
/* Toast                                                                      */
/* -------------------------------------------------------------------------- */

.toast-root {
  position: fixed;
  top: 22px;
  right: 24px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 9px;
  pointer-events: none;
}

.toast {
  display: flex;
  gap: 10px;
  align-items: center;
  min-width: 245px;
  max-width: 370px;
  padding: 12px 15px;
  color: #f6f9ff;
  font-size: 11px;
  background: rgba(11, 37, 69, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 11px;
  box-shadow: 0 16px 45px rgba(10, 23, 17, 0.22);
  backdrop-filter: blur(10px);
  pointer-events: auto;
  animation: toastIn 260ms var(--ease);
}

.toast.leaving {
  animation: toastOut 180ms ease forwards;
}

.toast-icon {
  display: grid;
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  place-items: center;
  color: var(--gold-bright);
  background: rgba(216, 185, 121, 0.1);
  border-radius: 7px;
}

.toast-icon svg {
  width: 12px;
  height: 12px;
}

.toast.error .toast-icon {
  color: #f1b3a5;
  background: rgba(182, 94, 72, 0.16);
}

/* -------------------------------------------------------------------------- */
/* Responsive                                                                 */
/* -------------------------------------------------------------------------- */

@media (max-width: 1180px) {
  .task-list-header,
  .task-item-row {
    grid-template-columns: 34px minmax(0, 1fr) 100px 130px 84px 38px;
    gap: 10px;
  }

  .archive-table .task-list-header,
  .archive-row {
    grid-template-columns: 34px minmax(0, 1fr) 74px 122px 78px 96px;
    gap: 10px;
  }
}

@media (max-width: 1020px) {
  :root {
    --sidebar-width: 220px;
  }

  .sidebar {
    padding-right: 15px;
    padding-left: 15px;
  }

  .skeleton-grid {
    grid-template-columns: 1fr;
  }

}

@media (max-width: 820px) {
  :root {
    --sidebar-width: 246px;
  }

  .app-shell {
    display: block;
  }

  .sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: var(--sidebar-width);
    transform: translateX(-102%);
    transition: transform 260ms var(--ease);
  }

  body.nav-open .sidebar {
    transform: translateX(0);
  }

  .mobile-backdrop {
    position: fixed;
    inset: 0;
    z-index: 35;
    display: none;
    cursor: pointer;
    background: rgba(10, 22, 17, 0.32);
    backdrop-filter: blur(2px);
  }

  body.nav-open .mobile-backdrop {
    display: block;
  }

  .mobile-close {
    position: absolute;
    top: 16px;
    right: 14px;
    display: grid;
    width: 30px;
    height: 30px;
    padding: 0;
    place-items: center;
    color: var(--side-text);
    cursor: pointer;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 8px;
  }

  .mobile-close svg {
    width: 14px;
    height: 14px;
  }

  .menu-button {
    display: grid;
  }

  .topbar {
    min-height: 70px;
    padding: 14px 22px;
  }

  .today-range,
  .today-now,
  .today-city {
    display: none;
  }

  .topbar-right .today-chip {
    padding: 7px 11px;
    font-size: 11px;
  }

  .view-root {
    padding: 27px 22px 62px;
  }

  .task-list-header {
    display: none;
  }

  .task-item-row {
    grid-template-columns: 32px minmax(0, 1fr) 34px;
    gap: 11px;
    padding: 15px 17px;
  }

  .archive-row {
    grid-template-columns: 26px minmax(0, 1fr) auto;
    gap: 10px;
    padding: 15px 17px;
  }

  .archive-row .status-pill,
  .archive-row .task-period,
  .archive-row .task-progress {
    display: none;
  }

  .archive-mobile-meta {
    display: inline-flex;
    gap: 6px;
    align-items: center;
  }

  .archive-row-check {
    width: 20px;
    height: 20px;
  }

  .task-period,
  .task-progress,
  .task-status-select {
    display: none;
  }

  .task-mobile-meta {
    display: inline-flex;
    flex-basis: 100%;
    gap: 7px;
    align-items: center;
    margin-top: 1px;
    color: var(--muted);
    font-size: 10px;
  }

  .task-expand {
    padding: 0 17px 18px 60px;
  }

  .task-detail-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .task-stats-strip {
    grid-template-columns: repeat(2, 1fr);
  }

  .task-stat:nth-child(3) {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .task-stat:nth-child(4) {
    border-top: 1px solid var(--line);
  }

  .task-stat:nth-child(5) {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .list-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .filter-tabs {
    overflow-x: auto;
    scrollbar-width: none;
  }

  .filter-tabs::-webkit-scrollbar {
    display: none;
  }

  .filter-tab {
    flex: 0 0 auto;
  }

  .search-box {
    width: 100%;
  }

  .page-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .page-head-actions {
    width: 100%;
    padding-top: 4px;
  }

  .page-head-actions .button {
    flex: 1;
  }
}

@media (max-width: 980px) {
  .task-form-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
  }

  .task-form-col + .task-form-col {
    padding-top: 20px;
    padding-left: 0;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .task-form-col .field-textarea {
    min-height: 96px;
  }
}

@media (max-width: 700px) {
  /* 窄屏：标题允许换行，说明最多占满一行，避免长标题被压成一两个字宽 */
  .report-task-title-row {
    flex-wrap: wrap;
    align-items: center;
  }

  .report-task h3 {
    overflow: visible;
    white-space: normal;
    text-overflow: clip;
    overflow-wrap: anywhere;
  }

  .report-task-note.is-inline {
    max-width: 100%;
  }

  .overlay.task-overlay {
    padding: 0;
  }

  .task-dialog {
    width: 100%;
    height: 100%;
    max-height: 100%;
    border: 0;
    border-radius: 0;
  }
}

@media (max-width: 600px) {
  .topbar-path {
    display: none;
  }

  .topbar-title {
    margin-top: 0;
    font-size: 14px;
  }

  .topbar-right {
    gap: 8px;
  }

  .topbar-right .today-chip {
    display: none;
  }

  .topbar .button span {
    display: none;
  }

  .topbar .button {
    width: 40px;
    min-width: 40px;
    padding: 0;
  }

  .page-head h1 {
    font-size: 32px;
  }

  .range-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .preset-group,
  .date-range-control {
    width: 100%;
  }

  .preset-button {
    flex: 1;
  }

  .date-range-control {
    justify-content: center;
  }

  .date-range-control input {
    width: 118px;
  }

  .report-task {
    grid-template-columns: 26px minmax(0, 1fr);
    padding: 16px 17px;
  }

  .report-task-side {
    grid-column: 2;
    justify-content: flex-start;
    margin-top: 4px;
  }

  .report-task-side .status-pill {
    display: none;
  }

  .pager {
    flex-direction: column;
    gap: 9px;
    align-items: stretch;
  }

  .pager-summary {
    order: 2;
    text-align: center;
  }

  .pager-controls {
    justify-content: center;
  }

  .task-expand {
    padding-left: 17px;
  }

  .task-detail-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .field-row,
  .field-row.three {
    grid-template-columns: 1fr;
  }

  .field-row .field + .field {
    margin-top: 15px;
  }

  .task-dialog-header,
  .task-dialog-body,
  .task-dialog-footer {
    padding-right: 21px;
    padding-left: 21px;
  }

  .task-dialog-header h2 {
    font-size: 22px;
  }

  .modal-header,
  .modal-body,
  .modal-footer {
    padding-right: 20px;
    padding-left: 20px;
  }

  .modal-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .modal-footer-right {
    justify-content: flex-end;
  }

  .modal-note {
    padding-bottom: 4px;
  }

  .report-textarea {
    min-height: 330px;
    padding: 15px;
  }

  .toast-root {
    right: 14px;
    left: 14px;
  }

  .toast {
    min-width: 0;
    max-width: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* 归档只读详情：窄屏收紧内边距，保持内容可读 */
@media (max-width: 700px) {
  .archive-detail-heading h2 {
    font-size: 21px;
  }

  .archive-detail-header {
    padding: 22px 20px 16px;
  }

  .archive-detail-body {
    padding: 16px 20px 20px;
  }

  .archive-detail-footer {
    padding: 14px 20px 16px;
  }

  .archive-detail-facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 16px;
  }
}

@media (max-width: 420px) {
  .archive-detail-footer {
    flex-wrap: wrap;
  }

  .archive-detail-footer .dialog-footer-note {
    flex-basis: 100%;
    margin: 0;
  }

  .archive-detail-footer .button {
    flex: 1;
    min-width: 0;
  }
}

/* -------------------------------------------------------------------------- */
/* Motion                                                                     */
/* -------------------------------------------------------------------------- */

@keyframes reveal {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideIn {
  from {
    transform: translateX(30px);
  }
  to {
    transform: translateX(0);
  }
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes toastOut {
  to {
    opacity: 0;
    transform: translateY(-6px) scale(0.98);
  }
}

@keyframes shimmer {
  to {
    transform: translateX(100%);
  }
}

/* -------------------------------------------------------------------------- */
/* Attachments · 附件区与在线预览（v1.47）                                     */
/* -------------------------------------------------------------------------- */

.attachment-panel {
  margin-top: 16px;
  padding: 14px 16px 10px;
  background: rgba(var(--ink-rgb), 0.022);
  border: 1px solid transparent;
  border-radius: 14px;
  transition:
    background 180ms var(--ease),
    border-color 180ms var(--ease);
}

.attachment-panel.is-dragging {
  background: rgba(var(--accent-rgb), 0.07);
  border-color: rgba(var(--accent-rgb), 0.4);
  border-style: dashed;
}

.attachment-panel.is-readonly {
  padding: 0;
  background: transparent;
  border: none;
}

.attachment-panel-head {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.attachment-panel-head .detail-label {
  margin-bottom: 0;
}

.attachment-panel-tools {
  display: flex;
  gap: 8px;
  align-items: center;
}

.attachment-upload {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  padding: 6px 12px;
  font-size: 11px;
  font-weight: 620;
  color: var(--green);
  cursor: pointer;
  background: var(--green-soft);
  border: 1px solid rgba(var(--accent-rgb), 0.18);
  border-radius: 8px;
  transition:
    background 160ms var(--ease),
    border-color 160ms var(--ease);
}

.attachment-upload svg {
  width: 13px;
  height: 13px;
}

.attachment-upload:hover:not(:disabled) {
  background: rgba(var(--accent-rgb), 0.15);
  border-color: rgba(var(--accent-rgb), 0.32);
}

.attachment-upload:disabled {
  cursor: progress;
  opacity: 0.72;
}

.attachment-upload .preview-spinner {
  width: 12px;
  height: 12px;
}

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

.attachment-row {
  display: flex;
  gap: 11px;
  align-items: center;
  padding: 7px 6px;
  border-radius: 9px;
  transition: background 160ms var(--ease);
}

.attachment-row:hover {
  background: rgba(var(--ink-rgb), 0.035);
}

.attachment-badge {
  display: grid;
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.02em;
  color: #fff;
  background: #6e7d92;
  border-radius: 8px;
  place-items: center;
}

.attachment-badge.large {
  flex-basis: 42px;
  width: 42px;
  height: 42px;
  font-size: 10.5px;
  border-radius: 11px;
}

.attachment-badge.word {
  background: #2f6fb5;
}

.attachment-badge.excel {
  background: #1f7a55;
}

.attachment-badge.ppt {
  background: #c2622a;
}

.attachment-badge.pdf {
  background: #b83a2c;
}

.attachment-badge.mind {
  background: #6b4fbb;
}

.attachment-badge.image {
  background: #1c7f8c;
}

.attachment-badge.video {
  background: #8a4b8f;
}

.attachment-badge.text,
.attachment-badge.file {
  background: #6e7d92;
}

.attachment-info {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.attachment-name {
  overflow: hidden;
  font-size: 12.5px;
  font-weight: 560;
  color: var(--ink);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-meta {
  font-size: 10.5px;
  color: var(--muted);
}

.attachment-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 2px;
  align-items: center;
}

.attachment-action {
  display: inline-flex;
  gap: 5px;
  align-items: center;
  padding: 5px 9px;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  cursor: pointer;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 7px;
  transition:
    color 150ms var(--ease),
    background 150ms var(--ease);
}

.attachment-action svg {
  width: 12px;
  height: 12px;
}

.attachment-action:hover {
  color: var(--green);
  background: var(--green-soft);
}

.attachment-icon {
  display: grid;
  width: 26px;
  height: 26px;
  padding: 0;
  color: var(--muted);
  cursor: pointer;
  background: transparent;
  border: none;
  border-radius: 7px;
  transition:
    color 150ms var(--ease),
    background 150ms var(--ease);
  place-items: center;
}

.attachment-icon svg {
  width: 13px;
  height: 13px;
}

.attachment-icon:hover {
  color: var(--action-delete);
  background: var(--coral-soft);
}

.attachment-icon-rename:hover {
  color: var(--action-edit, var(--green));
  background: var(--green-soft);
}

.attachment-empty {
  padding: 10px 4px 12px;
  font-size: 11.5px;
  line-height: 1.65;
  color: var(--muted);
}

/* 预览弹窗 ---------------------------------------------------------------- */

.modal.attachment-detail {
  display: flex;
  flex-direction: column;
  width: min(1040px, 100%);
  max-height: calc(100vh - 44px);
}

.attachment-detail-header {
  display: flex;
  flex: 0 0 auto;
  gap: 14px;
  align-items: flex-start;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--line);
}

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

.attachment-detail-heading h2 {
  margin: 5px 0 4px;
  overflow-wrap: anywhere;
  font-size: 19px;
  font-weight: 640;
  letter-spacing: -0.02em;
  line-height: 1.3;
}

.attachment-detail-meta {
  font-size: 11px;
  color: var(--muted);
}

.attachment-detail-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
  align-items: center;
}

.attachment-detail-actions .button {
  padding: 7px 13px;
  font-size: 11.5px;
}

.attachment-preview-body {
  flex: 1 1 auto;
  min-height: 220px;
  overflow: auto;
  background: var(--surface-soft);
}

.attachment-detail-footer {
  display: flex;
  flex: 0 0 auto;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  border-top: 1px solid var(--line);
}

.attachment-detail-task {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  min-width: 0;
  font-size: 11px;
  color: var(--muted);
}

.attachment-detail-task svg {
  flex: 0 0 auto;
  width: 13px;
  height: 13px;
}

.attachment-detail-task span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Word 预览 --------------------------------------------------------------- */

.doc-preview {
  max-width: 820px;
  padding: 30px 36px;
  margin: 18px auto;
  background: var(--dialog-bg);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
}

.doc-heading {
  margin: 20px 0 8px;
  font-weight: 650;
  line-height: 1.4;
  color: var(--ink);
}

.doc-heading:first-child {
  margin-top: 0;
}

.doc-heading.lvl-1 {
  font-size: 20px;
}

.doc-heading.lvl-2 {
  font-size: 17px;
}

.doc-heading.lvl-3 {
  font-size: 15px;
}

.doc-heading.lvl-4 {
  font-size: 13.5px;
}

.doc-para {
  margin: 0 0 9px;
  font-size: 12.5px;
  line-height: 1.85;
  color: var(--ink-soft);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.doc-para.is-list {
  position: relative;
  padding-left: 15px;
}

.doc-para.is-list::before {
  position: absolute;
  left: 2px;
  color: var(--green);
  content: "•";
}

.doc-space {
  height: 8px;
}

.doc-table-wrap {
  margin: 12px 0;
  overflow-x: auto;
}

.doc-table {
  width: 100%;
  font-size: 12px;
  border-collapse: collapse;
}

.doc-table td {
  padding: 7px 10px;
  color: var(--ink-soft);
  vertical-align: top;
  border: 1px solid var(--line-strong);
}

/* Excel 预览 -------------------------------------------------------------- */

.sheet-tabs {
  display: flex;
  gap: 6px;
  padding: 12px 16px 0;
  overflow-x: auto;
}

.sheet-tab {
  padding: 6px 12px;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
  cursor: pointer;
  background: var(--control-bg);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.sheet-tab.active {
  color: var(--green);
  cursor: default;
  background: var(--green-soft);
  border-color: rgba(var(--accent-rgb), 0.22);
}

.sheet-scroll {
  padding: 12px 16px 0;
  overflow-x: auto;
}

.sheet-table {
  min-width: 100%;
  font-size: 11.5px;
  background: var(--dialog-bg);
  border-spacing: 0;
  border-collapse: separate;
}

.sheet-table th,
.sheet-table td {
  max-width: 320px;
  padding: 6px 10px;
  overflow: hidden;
  color: var(--ink-soft);
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.sheet-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  font-weight: 650;
  color: var(--ink);
  background: var(--surface-soft);
}

.sheet-table tbody tr:nth-child(even) td {
  background: rgba(var(--ink-rgb), 0.02);
}

/* PPT 预览 ---------------------------------------------------------------- */

.slide-list {
  display: grid;
  gap: 12px;
  padding: 18px;
}

.slide-card {
  display: flex;
  gap: 14px;
  padding: 16px 18px;
  background: var(--dialog-bg);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
}

.slide-index {
  flex: 0 0 auto;
  font-family: var(--font-display);
  font-size: 18px;
  letter-spacing: 0.04em;
  color: var(--gold);
}

.slide-content h4 {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 650;
  line-height: 1.4;
  color: var(--ink);
}

.slide-content ul {
  padding-left: 18px;
  margin: 0;
}

.slide-content li {
  font-size: 12px;
  line-height: 1.75;
  color: var(--ink-soft);
}

/* XMind 预览 -------------------------------------------------------------- */

.outline-preview {
  display: grid;
  gap: 16px;
  padding: 18px;
}

.outline-sheet {
  padding: 18px 22px;
  background: var(--dialog-bg);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
}

.outline-sheet-title {
  margin-bottom: 12px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--green);
  text-transform: uppercase;
}

.outline-tree,
.outline-tree ul {
  padding-left: 18px;
  margin: 0;
  list-style: none;
}

.outline-tree {
  padding-left: 0;
}

.outline-tree li {
  position: relative;
  padding: 3px 0 3px 15px;
}

.outline-tree li::before {
  position: absolute;
  top: 11px;
  left: 0;
  width: 5px;
  height: 5px;
  content: "";
  background: var(--gold);
  border-radius: 50%;
}

.outline-title {
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--ink-soft);
}

.outline-tree > li > .outline-title {
  font-size: 14px;
  font-weight: 650;
  color: var(--ink);
}

/* 文本 / 图片 / PDF / 兜底 ------------------------------------------------- */

.text-preview {
  padding: 20px 24px;
  margin: 0;
  overflow-wrap: anywhere;
  font-family: "Cascadia Mono", "Consolas", "SFMono-Regular", monospace;
  font-size: 12px;
  line-height: 1.75;
  color: var(--ink-soft);
  white-space: pre-wrap;
}

.preview-image-wrap {
  display: grid;
  min-height: 260px;
  padding: 20px;
  place-items: center;
}

.preview-image {
  max-width: 100%;
  max-height: calc(100vh - 260px);
  background: #fff;
  border-radius: 10px;
  box-shadow: var(--shadow-md);
}

.preview-video-wrap {
  display: grid;
  min-height: 260px;
  padding: 20px;
  place-items: center;
}

.preview-video {
  width: auto;
  max-width: 100%;
  max-height: calc(100vh - 260px);
  background: #000;
  border-radius: 10px;
  box-shadow: var(--shadow-md);
}

.preview-pdf {
  display: block;
  width: 100%;
  height: min(72vh, 760px);
  background: var(--surface);
  border: none;
}

.preview-loading {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
  padding: 70px 20px;
  font-size: 12px;
  color: var(--muted);
}

.preview-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(var(--accent-rgb), 0.22);
  border-top-color: var(--green);
  border-radius: 50%;
  animation: attachmentSpin 720ms linear infinite;
}

@keyframes attachmentSpin {
  to {
    transform: rotate(360deg);
  }
}

.preview-fallback {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
  padding: 64px 24px;
  text-align: center;
}

.preview-fallback-icon {
  display: grid;
  width: 52px;
  height: 52px;
  color: var(--muted);
  background: var(--neutral-soft);
  border-radius: 14px;
  place-items: center;
}

.preview-fallback-icon svg {
  width: 22px;
  height: 22px;
}

.preview-fallback p {
  max-width: 420px;
  margin: 0;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--muted);
}

.preview-note {
  padding: 10px 16px 14px;
  font-size: 10.5px;
  color: var(--muted);
}


/* 图片缩略图（v1.50） ------------------------------------------------------ */

.attachment-gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-start;
  padding: 4px 0 8px;
}

.attachment-thumb {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  gap: 5px;
  width: 84px;
  margin: 0;
}

.attachment-thumb-frame {
  position: relative;
  width: 84px;
  height: 84px;
  overflow: hidden;
  background: rgba(var(--ink-rgb), 0.04);
  border: 1px solid var(--line);
  border-radius: 11px;
  transition:
    transform 180ms var(--ease),
    box-shadow 180ms var(--ease),
    border-color 180ms var(--ease);
}

.attachment-thumb-name {
  overflow: hidden;
  font-size: 10.5px;
  line-height: 1.35;
  color: var(--muted);
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-thumb-name[data-action] {
  cursor: pointer;
  border-radius: 4px;
  transition:
    color 150ms var(--ease),
    background 150ms var(--ease);
}

.attachment-thumb-name[data-action]:hover {
  color: var(--green);
  background: var(--green-soft);
}

.attachment-thumb-frame:hover {
  border-color: rgba(var(--accent-rgb), 0.26);
  box-shadow: 0 8px 20px rgba(15, 32, 60, 0.12);
  transform: translateY(-1px);
}

.attachment-thumb-hit {
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  cursor: zoom-in;
  background: transparent;
  border: none;
}

.attachment-thumb-hit img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.attachment-thumb-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  display: grid;
  width: 20px;
  height: 20px;
  padding: 0;
  color: #fff;
  cursor: pointer;
  background: rgba(15, 27, 45, 0.62);
  border: none;
  border-radius: 50%;
  opacity: 0;
  transition:
    opacity 150ms var(--ease),
    background 150ms var(--ease);
  place-items: center;
}

.attachment-thumb-remove svg {
  width: 11px;
  height: 11px;
}

.attachment-thumb-frame:hover .attachment-thumb-remove,
.attachment-thumb-remove:focus-visible {
  opacity: 1;
}

.attachment-thumb-remove:hover {
  background: var(--action-delete);
}

/* 工作台汇报内容里的附件条 ------------------------------------------------ */

.report-attachments {
  margin-top: 10px;
}

.report-attachments .attachment-panel-head {
  display: none;
}

.report-attachments .attachment-panel {
  margin-top: 0;
  padding: 0;
  background: transparent;
  border: none;
}

.report-attachments .attachment-gallery {
  gap: 8px;
  padding: 0 0 6px;
}

.report-attachments .attachment-thumb {
  width: 68px;
}

.report-attachments .attachment-thumb-frame {
  width: 68px;
  height: 68px;
  border-radius: 9px;
}

.report-attachments .attachment-thumb-name {
  font-size: 10px;
}

.report-attachments .attachment-row {
  padding: 5px 4px;
}

.report-attachments .attachment-list {
  gap: 0;
}

.report-attachments .attachment-empty {
  display: none;
}

/* 图片灯箱（v1.50） -------------------------------------------------------- */

.overlay.image-viewer {
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  padding: 0;
  background: rgba(7, 14, 26, 0.94);
  backdrop-filter: blur(6px);
}

.image-viewer-bar {
  display: flex;
  flex: 0 0 auto;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  padding: 14px 22px;
  color: rgba(255, 255, 255, 0.86);
}

.image-viewer-heading {
  display: flex;
  gap: 12px;
  align-items: baseline;
  min-width: 0;
}

.image-viewer-name {
  overflow: hidden;
  font-size: 13.5px;
  font-weight: 560;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.image-viewer-count {
  flex: 0 0 auto;
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
  color: rgba(255, 255, 255, 0.55);
}

.image-viewer-bar-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 6px;
  align-items: center;
}

.image-viewer-icon {
  display: grid;
  width: 34px;
  height: 34px;
  color: rgba(255, 255, 255, 0.82);
  text-decoration: none;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.08);
  border: none;
  border-radius: 9px;
  transition:
    background 160ms var(--ease),
    color 160ms var(--ease);
  place-items: center;
}

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

.image-viewer-icon:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.16);
}

.image-viewer-stage {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  touch-action: none;
}

.image-viewer-stage.is-zoomed {
  cursor: grab;
}

.image-viewer-stage.is-panning {
  cursor: grabbing;
}

.image-viewer-img {
  position: absolute;
  top: 50%;
  left: 50%;
  width: auto;
  height: auto;
  max-width: calc(100% - 180px);
  max-height: calc(100% - 16px);
  object-fit: contain;
  user-select: none;
  border-radius: 6px;
  transition: transform 180ms var(--ease);
  transform-origin: center center;
  will-change: transform;
}

.image-viewer-stage.is-panning .image-viewer-img {
  transition: none;
}

.image-viewer-nav {
  position: absolute;
  top: 50%;
  display: grid;
  width: 46px;
  height: 46px;
  padding: 0;
  color: rgba(255, 255, 255, 0.9);
  cursor: pointer;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 50%;
  transform: translateY(-50%);
  transition:
    background 160ms var(--ease),
    transform 160ms var(--ease);
  place-items: center;
}

.image-viewer-nav svg {
  width: 20px;
  height: 20px;
}

.image-viewer-nav.prev {
  left: 18px;
}

.image-viewer-nav.prev svg {
  transform: rotate(180deg);
}

.image-viewer-nav.next {
  right: 18px;
}

.image-viewer-nav:hover {
  background: rgba(255, 255, 255, 0.2);
}

.image-viewer-tools {
  display: flex;
  flex: 0 0 auto;
  gap: 6px;
  align-items: center;
  justify-content: center;
  padding: 16px 20px 22px;
}

.image-viewer-tool {
  display: grid;
  min-width: 34px;
  height: 34px;
  padding: 0 10px;
  font-size: 15px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.86);
  cursor: pointer;
  background: rgba(255, 255, 255, 0.08);
  border: none;
  border-radius: 9px;
  transition:
    background 160ms var(--ease),
    color 160ms var(--ease);
  place-items: center;
}

.image-viewer-tool.wide {
  padding: 0 14px;
  font-size: 12px;
  font-weight: 560;
}

.image-viewer-tool:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.18);
}

.image-viewer-zoom {
  min-width: 52px;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: rgba(255, 255, 255, 0.7);
  text-align: center;
}

.image-viewer-divider {
  width: 1px;
  height: 18px;
  margin: 0 4px;
  background: rgba(255, 255, 255, 0.16);
}

/* 多图对比（v1.52） -------------------------------------------------------- */

.attachment-thumb-compare {
  position: absolute;
  top: 4px;
  left: 4px;
  display: grid;
  width: 19px;
  height: 19px;
  padding: 0;
  color: #fff;
  cursor: pointer;
  background: rgba(15, 27, 45, 0.52);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 6px;
  opacity: 0.62;
  transition:
    opacity 150ms var(--ease),
    background 150ms var(--ease),
    transform 150ms var(--ease);
  place-items: center;
}

.attachment-thumb-compare svg {
  width: 10px;
  height: 10px;
  fill: currentColor;
}

.attachment-thumb-frame:hover .attachment-thumb-compare,
.attachment-thumb-compare:focus-visible,
.attachment-thumb.is-selected .attachment-thumb-compare {
  opacity: 1;
}

.attachment-thumb-compare:hover {
  background: rgba(15, 27, 45, 0.86);
  transform: scale(1.06);
}

.attachment-thumb-compare-num {
  display: none;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
}

.attachment-thumb.is-selected .attachment-thumb-compare {
  background: var(--green);
  border-color: rgba(255, 255, 255, 0.9);
}

.attachment-thumb.is-selected .attachment-thumb-compare svg {
  display: none;
}

.attachment-thumb.is-selected .attachment-thumb-compare-num {
  display: block;
}

.attachment-thumb.is-selected .attachment-thumb-frame {
  border-color: rgba(var(--accent-rgb), 0.55);
  box-shadow:
    0 0 0 2px rgba(var(--accent-rgb), 0.2),
    0 8px 20px rgba(15, 32, 60, 0.12);
}

.attachment-thumb.is-selected .attachment-thumb-name {
  color: var(--green);
  font-weight: 600;
}

/* 已选对比的浮动条 -------------------------------------------------------- */

#compare-tray-root {
  position: fixed;
  bottom: 22px;
  left: 50%;
  z-index: 90;
  transform: translateX(-50%);
  pointer-events: none;
}

#compare-tray-root:empty {
  display: none;
}

.compare-tray {
  display: flex;
  gap: 13px;
  align-items: center;
  padding: 9px 12px 9px 16px;
  color: rgba(255, 255, 255, 0.92);
  pointer-events: auto;
  background: linear-gradient(150deg, #123a63, #0b2545);
  border: 1px solid rgba(216, 185, 121, 0.32);
  border-radius: 16px;
  box-shadow: 0 20px 48px rgba(8, 20, 40, 0.34);
  animation: compareTrayIn 220ms var(--ease);
}

@keyframes compareTrayIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.compare-tray-label {
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.6);
  white-space: nowrap;
}

.compare-tray-label b {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
}

.compare-tray-thumbs {
  display: flex;
  gap: 6px;
  align-items: center;
}

.compare-tray-thumb {
  position: relative;
  display: block;
  width: 34px;
  height: 34px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 7px;
}

.compare-tray-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.compare-tray-thumb b {
  position: absolute;
  bottom: 0;
  left: 0;
  padding: 0 3px;
  font-size: 9px;
  line-height: 13px;
  color: #fff;
  background: rgba(11, 37, 69, 0.82);
  border-radius: 0 5px 0 0;
}

.compare-tray-go {
  height: 32px;
  padding: 0 14px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 640;
  color: #21180a;
  cursor: pointer;
  background: linear-gradient(135deg, #e3c88e, #c5a15f);
  border: none;
  border-radius: 9px;
  transition: filter 160ms var(--ease);
}

.compare-tray-go:hover:not(:disabled) {
  filter: brightness(1.06);
}

.compare-tray-go:disabled {
  color: rgba(255, 255, 255, 0.55);
  cursor: default;
  background: rgba(255, 255, 255, 0.12);
}

.compare-tray-clear {
  display: grid;
  width: 28px;
  height: 28px;
  padding: 0;
  color: rgba(255, 255, 255, 0.66);
  cursor: pointer;
  background: transparent;
  border: none;
  border-radius: 8px;
  transition:
    color 160ms var(--ease),
    background 160ms var(--ease);
  place-items: center;
}

.compare-tray-clear:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}

.compare-tray-clear svg {
  width: 13px;
  height: 13px;
}

/* 对比灯箱 ---------------------------------------------------------------- */

.overlay.compare-viewer {
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  padding: 0;
  background: rgba(7, 14, 26, 0.96);
  backdrop-filter: blur(6px);
}

.compare-bar {
  display: flex;
  flex: 0 0 auto;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  color: rgba(255, 255, 255, 0.88);
}

.compare-heading {
  display: flex;
  gap: 10px;
  align-items: baseline;
  min-width: 0;
}

.compare-kicker {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: rgba(216, 185, 121, 0.92);
  text-transform: uppercase;
}

.compare-title {
  font-size: 13.5px;
  font-weight: 600;
}

.compare-count {
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
  color: rgba(255, 255, 255, 0.5);
}

.compare-bar-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
  align-items: center;
}

.compare-chip {
  height: 32px;
  padding: 0 12px;
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.82);
  cursor: pointer;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 9px;
  transition:
    background 160ms var(--ease),
    color 160ms var(--ease);
}

.compare-chip:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.16);
}

.compare-chip.is-on {
  color: #21180a;
  background: linear-gradient(135deg, #e3c88e, #c5a15f);
  border-color: transparent;
}

.compare-body {
  display: grid;
  flex: 1 1 auto;
  gap: 10px;
  min-height: 0;
  padding: 0 18px;
}

.compare-body[data-layout="row"] {
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
}

.compare-body[data-layout="grid"] {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.compare-body[data-layout="grid"][data-count="2"] {
  grid-template-rows: minmax(0, 1fr);
}

.compare-body[data-layout="grid"][data-count="3"],
.compare-body[data-layout="grid"][data-count="4"] {
  grid-template-rows: repeat(2, minmax(0, 1fr));
}

.compare-pane {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  margin: 0;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  transition:
    border-color 160ms var(--ease),
    box-shadow 160ms var(--ease);
}

.compare-pane.is-active {
  border-color: rgba(216, 185, 121, 0.55);
  box-shadow: 0 0 0 1px rgba(216, 185, 121, 0.22);
}

.compare-stage {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  touch-action: none;
}

.compare-stage.is-zoomed {
  cursor: grab;
}

.compare-stage.is-panning {
  cursor: grabbing;
}

.compare-img {
  position: absolute;
  top: 50%;
  left: 50%;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  user-select: none;
  border-radius: 4px;
  transition: transform 160ms var(--ease);
  transform-origin: center center;
  will-change: transform;
}

.compare-stage.is-panning .compare-img {
  transition: none;
}

.compare-caption {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
  align-items: center;
  padding: 7px 10px;
  color: rgba(255, 255, 255, 0.72);
  background: rgba(255, 255, 255, 0.04);
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.compare-index {
  flex: 0 0 auto;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: rgba(216, 185, 121, 0.9);
}

.compare-name {
  flex: 1 1 auto;
  overflow: hidden;
  font-size: 11.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compare-download {
  display: grid;
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  color: rgba(255, 255, 255, 0.6);
  border-radius: 6px;
  transition:
    color 160ms var(--ease),
    background 160ms var(--ease);
  place-items: center;
}

.compare-download:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}

.compare-download svg {
  width: 13px;
  height: 13px;
}

.compare-tools {
  display: flex;
  flex: 0 0 auto;
  gap: 6px;
  align-items: center;
  justify-content: center;
  padding: 14px 20px 20px;
}

.compare-zoom {
  min-width: 52px;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: rgba(255, 255, 255, 0.7);
  text-align: center;
}

.compare-hint {
  margin-left: 10px;
  font-size: 10.5px;
  color: rgba(255, 255, 255, 0.34);
}

@media (max-width: 700px) {
  .attachment-panel {
    padding: 12px 12px 8px;
  }

  .attachment-thumb {
    width: 70px;
  }

  .attachment-thumb-frame {
    width: 70px;
    height: 70px;
  }

  .report-attachments .attachment-thumb {
    width: 60px;
  }

  .report-attachments .attachment-thumb-frame {
    width: 60px;
    height: 60px;
  }

  .image-viewer-bar {
    padding: 10px 14px;
  }

  .image-viewer-img {
    max-width: calc(100% - 24px);
    max-height: calc(100% - 8px);
  }

  .image-viewer-nav {
    width: 38px;
    height: 38px;
  }

  .image-viewer-nav.prev {
    left: 8px;
  }

  .image-viewer-nav.next {
    right: 8px;
  }

  .image-viewer-tools {
    padding: 12px 14px 18px;
  }

  .attachment-action span {
    display: none;
  }

  .attachment-action {
    padding: 6px;
  }

  .attachment-upload span {
    display: none;
  }

  .attachment-upload {
    padding: 7px;
  }

  .modal.attachment-detail {
    width: 100%;
    max-height: calc(100vh - 24px);
  }

  .attachment-detail-header {
    flex-wrap: wrap;
    padding: 16px 18px 14px;
  }

  .attachment-detail-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .attachment-detail-footer {
    padding: 10px 18px;
  }

  .doc-preview {
    padding: 20px 18px;
    margin: 12px;
  }

  .preview-image {
    max-height: 58vh;
  }

  .preview-video {
    max-height: 58vh;
  }

  .preview-pdf {
    height: 64vh;
  }

  .slide-list,
  .outline-preview {
    padding: 12px;
  }
}

@media (max-width: 420px) {
  .attachment-badge {
    flex-basis: 26px;
    width: 26px;
    height: 26px;
    font-size: 8px;
    border-radius: 7px;
  }

  .attachment-name {
    font-size: 12px;
  }

  .attachment-detail-heading h2 {
    font-size: 16px;
  }
}

/* -------------------------------------------------------------------------- */
/* 多图对比 · 窄屏适配（v1.52）                                                */
/* -------------------------------------------------------------------------- */

@media (max-width: 980px) {
  .compare-body[data-layout="row"] {
    grid-auto-flow: row;
    grid-auto-columns: auto;
    grid-auto-rows: minmax(0, 1fr);
  }

  .compare-body[data-layout="grid"],
  .compare-body[data-layout="grid"][data-count="2"],
  .compare-body[data-layout="grid"][data-count="3"],
  .compare-body[data-layout="grid"][data-count="4"] {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: none;
    grid-auto-rows: minmax(0, 1fr);
  }

  .compare-bar {
    flex-wrap: wrap;
    gap: 10px;
    padding: 10px 14px;
  }

  .compare-hint {
    display: none;
  }

  .compare-body {
    padding: 0 12px;
  }

  .compare-tools {
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 12px 12px;
  }
}

@media (max-width: 700px) {
  .compare-title {
    font-size: 12.5px;
  }

  .compare-chip {
    height: 28px;
    padding: 0 9px;
    font-size: 10.5px;
  }

  .compare-caption {
    padding: 6px 8px;
  }

  .compare-name {
    font-size: 10.5px;
  }

  #compare-tray-root {
    right: 10px;
    bottom: 12px;
    left: 10px;
    transform: none;
  }

  .compare-tray {
    width: 100%;
  }
}

/* 子任务截止日期：文字占满剩余宽度，日期标签贴右对齐 */
.report-subtask-label,
.subtask-label {
  flex: 1;
  min-width: 0;
}

.subtask-due,
.report-subtask-due {
  margin-top: 1px;
}

.archive-subtask-due {
  margin-top: 0;
}

@media (max-width: 760px) {
  .drawer-subtask-date {
    flex: 0 0 96px;
    width: 96px;
  }
}

/* -------------------------------------------------------------------------- */
/* OKR 目标                                                                    */
/* -------------------------------------------------------------------------- */

.okr-stats {
  grid-template-columns: repeat(4, 1fr);
}

.task-stat-value.is-quiet {
  color: var(--muted-2);
}

.task-stat-value.is-warn {
  color: var(--gold);
}

.okr-quarter-picker {
  display: flex;
  gap: 8px;
  align-items: center;
  height: 40px;
  padding: 0 12px;
  color: var(--muted);
  background: var(--control-bg);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.okr-quarter-picker > svg {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
}

.okr-quarter-picker .field-select {
  width: auto;
  height: 30px;
  padding: 0 4px;
  font-size: 12.5px;
  font-weight: 650;
  color: var(--ink);
  background: transparent;
  border: none;
}

.okr-quarter-range {
  padding-left: 9px;
  font-size: 11px;
  color: var(--muted-2);
  border-left: 1px solid var(--line);
}

.okr-toolbar {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  margin: 4px 0 16px;
}

.okr-toolbar-note {
  color: var(--muted);
  font-size: 11.5px;
}

.okr-toolbar-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}

.okr-text-button {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  min-height: 32px;
  padding: 0 10px;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 9px;
  transition:
    color 160ms ease,
    background 160ms ease,
    border-color 160ms ease;
}

.okr-text-button svg {
  width: 14px;
  height: 14px;
}

.okr-text-button:hover {
  color: var(--ink);
  background: var(--control-bg);
  border-color: var(--line);
}

.okr-text-button.danger:hover {
  color: var(--coral);
  background: var(--coral-soft);
  border-color: transparent;
}

.okr-objective-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.okr-objective {
  overflow: hidden;
  background: var(--card-bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease;
}

.okr-objective:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-sm);
}

.okr-objective-head {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) 190px 34px;
  gap: 14px;
  align-items: center;
  padding: 16px 18px;
}

.okr-index {
  font-family: var(--font-display);
  font-size: 20px;
  color: var(--gold);
  letter-spacing: 0.02em;
}

.okr-objective-copy h3 {
  margin: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 16.5px;
  font-weight: 640;
  letter-spacing: -0.01em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.okr-objective-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
  margin-top: 6px;
  color: var(--muted);
  font-size: 11px;
}

.okr-chip {
  padding: 2px 8px;
  color: var(--green);
  font-size: 10.5px;
  font-weight: 650;
  background: var(--green-soft);
  border-radius: 999px;
}

.okr-weight.warn {
  color: var(--gold);
  font-weight: 650;
}

.okr-weight-note {
  color: var(--gold);
  font-size: 10.5px;
}

.okr-objective-progress {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
}

.okr-objective-progress strong {
  min-width: 34px;
  color: var(--ink);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.okr-bar {
  display: block;
  position: relative;
  width: 110px;
  height: 6px;
  overflow: hidden;
  background: rgba(var(--ink-rgb), 0.08);
  border-radius: 999px;
}

.okr-bar > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--green), var(--blue));
  border-radius: 999px;
  transition: width 380ms var(--ease);
}

.okr-bar.small {
  width: 86px;
  height: 5px;
}

.okr-toggle {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  color: var(--muted);
  cursor: pointer;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 9px;
  transition:
    color 160ms ease,
    background 160ms ease,
    transform 220ms var(--ease);
}

.okr-toggle svg {
  width: 15px;
  height: 15px;
}

.okr-toggle:hover {
  color: var(--ink);
  background: var(--control-bg);
}

.okr-objective.collapsed .okr-toggle {
  transform: rotate(-90deg);
}

.okr-objective.collapsed .okr-objective-body {
  display: none;
}

.okr-objective-body {
  border-top: 1px solid var(--line);
}

.okr-kr-head,
.okr-kr-row {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) 62px 172px 72px;
  gap: 14px;
  align-items: center;
  padding: 11px 18px;
}

.okr-kr-head {
  padding-top: 9px;
  padding-bottom: 9px;
  color: var(--muted-2);
  font-size: 9.5px;
  font-weight: 650;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: var(--surface-soft);
}

/* 表头「KR」列与左侧 KR 编号统一为深蓝 */
.okr-kr-head > span:first-child {
  color: var(--kr-ink);
}

.okr-kr-row + .okr-kr-row {
  border-top: 1px solid var(--line);
}

.okr-kr-row:hover {
  background: var(--card-bg-hover);
}

.okr-kr-index {
  align-self: start;
  margin-top: 2px;
  color: var(--kr-ink);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  font-variant-numeric: tabular-nums;
}

.okr-kr-title {
  margin: 0;
  color: var(--ink);
  font-size: 13px;
  font-weight: 550;
  line-height: 1.5;
}

.okr-kr-note {
  display: -webkit-box;
  margin: 3px 0 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.55;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.okr-kr-link {
  margin: 4px 0 0;
  color: var(--muted-2);
  font-size: 10.5px;
}

.okr-kr-weight {
  color: var(--muted);
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
}

.okr-kr-progress {
  display: flex;
  gap: 8px;
  align-items: center;
}

.okr-percent {
  min-width: 42px;
  padding: 3px 6px;
  color: var(--green);
  font-size: 11.5px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  background: var(--green-soft);
  border: none;
  border-radius: 7px;
  transition: background 160ms ease;
}

.okr-percent:hover {
  background: rgba(var(--accent-rgb), 0.18);
}

.okr-kr-actions {
  display: flex;
  gap: 2px;
  justify-content: flex-end;
  opacity: 0.55;
  transition: opacity 160ms ease;
}

.okr-kr-row:hover .okr-kr-actions {
  opacity: 1;
}

.okr-icon-button {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  color: var(--muted);
  cursor: pointer;
  background: transparent;
  border: none;
  border-radius: 8px;
  transition:
    color 150ms ease,
    background 150ms ease;
}

.okr-icon-button svg {
  width: 14px;
  height: 14px;
}

.okr-icon-button:hover {
  color: var(--ink);
  background: var(--control-bg);
}

.okr-icon-button.danger:hover {
  color: var(--coral);
  background: var(--coral-soft);
}

.okr-kr-empty {
  padding: 18px;
  color: var(--muted);
  font-size: 12px;
}

.okr-objective-footer {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding: 10px 18px;
  border-top: 1px solid var(--line);
}

.okr-add-kr {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  color: var(--green);
  font-size: 11.5px;
  font-weight: 650;
  cursor: pointer;
  background: transparent;
  border: 1px dashed rgba(var(--accent-rgb), 0.34);
  border-radius: 9px;
  transition:
    background 160ms ease,
    border-color 160ms ease;
}

.okr-add-kr svg {
  width: 13px;
  height: 13px;
}

.okr-add-kr:hover {
  background: var(--green-soft);
  border-color: rgba(var(--accent-rgb), 0.5);
}

.okr-objective-actions {
  display: flex;
  gap: 4px;
}

.okr-empty {
  padding: 56px 24px;
}

/* OKR 弹窗 */
.okr-dialog {
  width: min(680px, calc(100vw - 48px));
}

.okr-form-body {
  display: grid;
  gap: 14px;
}

.okr-input-suffix {
  display: flex;
  align-items: center;
  background: var(--field-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.okr-input-suffix:focus-within {
  border-color: rgba(var(--accent-rgb), 0.45);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.1);
}

.okr-input-suffix .field-input {
  width: 100%;
  border: none;
  box-shadow: none;
  background: transparent;
}

.okr-input-suffix .field-input:focus {
  box-shadow: none;
}

.okr-input-suffix > span {
  padding: 0 12px 0 2px;
  color: var(--muted);
  font-size: 12px;
}

.okr-static-value {
  min-height: 40px;
  margin: 0;
  padding: 11px 12px;
  color: var(--ink-soft);
  font-size: 12.5px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.okr-progress-echo {
  margin-left: 6px;
  color: var(--green);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.okr-range {
  width: 100%;
  margin: 10px 0 8px;
  accent-color: var(--green);
}

.okr-quick-row {
  display: flex;
  gap: 5px;
}

.okr-quick {
  flex: 1;
  min-height: 27px;
  color: var(--muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  background: var(--control-bg);
  border: 1px solid var(--line);
  border-radius: 7px;
  transition:
    color 150ms ease,
    background 150ms ease,
    border-color 150ms ease;
}

.okr-quick:hover {
  color: var(--green);
  background: var(--green-soft);
  border-color: rgba(var(--accent-rgb), 0.3);
}

/* 自动进度：由关联任务实时计算，只读展示 */
.okr-percent.is-auto {
  color: var(--accent);
  background: rgba(var(--accent-rgb), 0.1);
}

.okr-auto-progress {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
  padding: 9px 11px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.okr-auto-progress p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 12px;
}

.okr-auto-mark {
  flex-shrink: 0;
  padding: 2px 7px;
  color: var(--accent);
  font-size: 10.5px;
  font-weight: 650;
  letter-spacing: 0.04em;
  background: rgba(var(--accent-rgb), 0.12);
  border-radius: 999px;
}

.okr-auto-tip {
  margin: 7px 0 0;
  color: var(--muted-2);
  font-size: 11px;
}

/* -------------------------------------------------------------------------- */
/* 速记                                                                        */
/* -------------------------------------------------------------------------- */

.note-capture {
  margin-bottom: 18px;
  padding: 14px 16px 12px;
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease;
}

.note-capture:focus-within {
  border-color: rgba(var(--accent-rgb), 0.35);
  box-shadow: 0 0 0 4px rgba(var(--accent-rgb), 0.06);
}

.note-capture-box textarea {
  display: block;
  width: 100%;
  min-height: 54px;
  padding: 4px 0;
  color: var(--ink);
  font-family: inherit;
  font-size: 14.5px;
  line-height: 1.7;
  resize: vertical;
  background: transparent;
  border: none;
  outline: none;
}

.note-capture-box textarea::placeholder {
  color: var(--muted-2);
}

.note-type-hint {
  display: block;
  margin-top: 2px;
  color: var(--muted-2);
  font-size: 11px;
}

/* 速记归类：手动改 / 新增自定义归类 */
.note-type-field {
  margin-top: 14px;
}

.note-type-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 2px;
}

.note-type-option {
  display: inline-flex;
  gap: 5px;
  align-items: center;
  padding: 6px 12px;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  transition: border-color 150ms ease, color 150ms ease, background 150ms ease;
}

.note-type-option svg {
  width: 11px;
  height: 11px;
}

.note-type-option:hover {
  border-color: var(--line-strong);
}

.note-type-option.active {
  font-weight: 700;
  border-color: currentColor;
}

.note-type-option.active::before {
  width: 5px;
  height: 5px;
  content: "";
  background: currentColor;
  border-radius: 50%;
}

.note-type-option.is-add {
  color: var(--muted-2);
  background: transparent;
  border-style: dashed;
}

.note-type-option.is-add:hover {
  color: var(--ink);
  border-color: var(--line-strong);
}

.note-type-option-wrap {
  position: relative;
  display: inline-flex;
}

.note-type-option-remove {
  position: absolute;
  top: -5px;
  right: -5px;
  display: grid;
  place-items: center;
  width: 15px;
  height: 15px;
  padding: 0;
  color: var(--muted-2);
  cursor: pointer;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 50%;
  opacity: 0;
  transition: opacity 140ms ease, color 140ms ease, border-color 140ms ease;
}

.note-type-option-wrap:hover .note-type-option-remove {
  opacity: 1;
}

.note-type-option-remove:hover {
  color: #b4423a;
  border-color: #b4423a;
}

.note-type-option-remove svg {
  width: 9px;
  height: 9px;
}

.note-type-add {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.note-type-add[hidden] {
  display: none;
}

.note-type-add .field-input {
  flex: 1;
}

.note-type-confirm {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  padding: 10px 12px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.55;
  background: rgba(180, 66, 58, 0.06);
  border: 1px solid rgba(180, 66, 58, 0.18);
  border-radius: var(--radius-sm);
}

.note-type-confirm[hidden] {
  display: none;
}

.note-type-confirm-actions {
  display: flex;
  gap: 6px;
}

.note-type-confirm-actions .button {
  padding: 5px 12px;
  font-size: 11.5px;
}

.note-capture-footer {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.note-capture-tip {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  color: var(--muted);
  font-size: 11px;
}

.note-capture-tip svg {
  width: 13px;
  height: 13px;
  color: var(--gold);
}

.note-toolbar {
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.note-count {
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.note-list-shell {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.note-list {
  overflow: hidden;
  background: var(--card-bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.note-row {
  display: grid;
  grid-template-columns: 3px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: flex-start;
  padding: 13px 16px;
  transition: background 160ms ease;
}

.note-row + .note-row {
  border-top: 1px solid var(--line);
}

.note-row:hover {
  background: var(--card-bg-hover);
}

.note-row.pinned {
  background: rgba(181, 139, 77, 0.05);
}

.note-type-bar {
  width: 3px;
  height: auto;
  min-height: 30px;
  align-self: stretch;
  border-radius: 999px;
}

.note-content {
  margin: 0;
  color: var(--ink);
  font-size: 13.5px;
  line-height: 1.68;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.note-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-top: 7px;
  color: var(--muted-2);
  font-size: 10.5px;
}

.note-type-chip {
  padding: 2px 8px;
  font-size: 10px;
  font-weight: 650;
  border-radius: 999px;
}

.note-flag {
  display: inline-flex;
  gap: 3px;
  align-items: center;
}

.note-flag svg {
  width: 11px;
  height: 11px;
}

.note-flag.pinned {
  color: var(--gold);
}

.note-actions {
  display: flex;
  gap: 2px;
  align-items: center;
  opacity: 0.5;
  transition: opacity 160ms ease;
}

.note-row:hover .note-actions {
  opacity: 1;
}

.note-icon-button {
  display: grid;
  place-items: center;
  width: 29px;
  height: 29px;
  color: var(--muted);
  cursor: pointer;
  background: transparent;
  border: none;
  border-radius: 8px;
  transition:
    color 150ms ease,
    background 150ms ease;
}

.note-icon-button svg {
  width: 14px;
  height: 14px;
}

.note-icon-button:hover {
  color: var(--ink);
  background: var(--control-bg);
}

.note-icon-button.active {
  color: var(--gold);
}

.note-icon-button.danger:hover {
  color: var(--coral);
  background: var(--coral-soft);
}

.note-edit-area {
  min-height: 150px;
  line-height: 1.7;
}

/*
 * 编辑速记弹窗：识图结果动辄几十行，按原来 680×150 的窗口只能看到六七行，
 * 滚动条一拖就迷路。这里把弹窗放大到接近整屏，并让文本框吃掉剩余高度。
 */
.modal.note-edit-dialog {
  display: flex;
  flex-direction: column;
  width: min(940px, calc(100vw - 40px));
  max-height: calc(100vh - 40px);
}

.note-edit-dialog > form {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
}

.note-edit-dialog .modal-body {
  display: grid;
  flex: 1;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 16px;
  min-height: 0;
}

.note-edit-dialog .modal-body > .field:first-child {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 0;
}

.note-edit-dialog .modal-body > .field + .field {
  margin-top: 0;
}

.modal.note-edit-dialog .note-edit-area {
  height: 100%;
  min-height: clamp(300px, 52vh, 640px);
  max-height: none;
  font-size: 12.5px;
  line-height: 1.85;
}

.notes-empty {
  padding: 48px 24px;
}

/* 类型色调 */
.tone-gold {
  color: #9a6f2f;
  background: rgba(181, 139, 77, 0.14);
}

.note-type-bar.tone-gold {
  background: #b58b4d;
}

.tone-blue {
  color: #35668f;
  background: rgba(83, 119, 156, 0.14);
}

.note-type-bar.tone-blue {
  background: #53779c;
}

.tone-violet {
  color: #6a5a9c;
  background: rgba(122, 107, 168, 0.14);
}

.note-type-bar.tone-violet {
  background: #7a6ba8;
}

.tone-green {
  color: #2f6c58;
  background: rgba(47, 108, 88, 0.13);
}

.note-type-bar.tone-green {
  background: #2f6c58;
}

.tone-slate {
  color: #5f6f86;
  background: rgba(95, 111, 134, 0.12);
}

.note-type-bar.tone-slate {
  background: #8a97a8;
}

/* 任务表单里的归属 KR */
.task-kr-field {
  margin-top: 12px;
}

.task-kr-empty {
  margin: 0;
  padding: 10px 12px;
  color: var(--muted-2);
  font-size: 11.5px;
  line-height: 1.6;
  background: var(--surface-soft);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-sm);
}

@media (max-width: 1000px) {
  .okr-objective-head {
    grid-template-columns: 34px minmax(0, 1fr) 34px;
  }

  .okr-objective-progress {
    grid-column: 2 / 3;
    justify-content: flex-start;
    margin-top: 8px;
  }

  .okr-toggle {
    grid-column: 3 / 4;
    grid-row: 1 / 2;
  }

  .okr-kr-head,
  .okr-kr-row {
    grid-template-columns: 40px minmax(0, 1fr) 54px 138px 66px;
    gap: 10px;
  }
}

@media (max-width: 760px) {
  .okr-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .task-stat:nth-child(3) {
    border-left: none;
    border-top: 1px solid var(--line);
  }

  .task-stat:nth-child(4) {
    border-top: 1px solid var(--line);
  }

  .okr-toolbar,
  .note-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .okr-kr-head {
    display: none;
  }

  .okr-kr-row {
    grid-template-columns: auto minmax(0, 1fr) auto;
    row-gap: 8px;
  }

  .okr-kr-index {
    grid-column: 1 / 2;
    grid-row: 1 / 2;
    margin-top: 2px;
  }

  .okr-kr-main {
    grid-column: 2 / 3;
  }

  .okr-kr-weight {
    display: none;
  }

  .okr-kr-progress {
    grid-column: 2 / 3;
    grid-row: 2 / 3;
  }

  .okr-kr-actions {
    grid-column: 3 / 4;
    grid-row: 1 / 3;
    align-self: center;
  }

  .note-row {
    grid-template-columns: 3px minmax(0, 1fr);
  }

  .note-actions {
    grid-column: 2 / 3;
    justify-content: flex-end;
    opacity: 1;
  }

  .note-capture-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .note-capture-footer .button {
    justify-content: center;
  }
}

/* -------------------------------------------------------------------------- */
/* v1.59 · 子任务独立附件 + 图片粘贴上传                                        */
/* -------------------------------------------------------------------------- */

.subtask-block,
.report-subtask-block,
.archive-subtask-block {
  display: flex;
  flex-direction: column;
}

.subtask-attach {
  display: inline-flex;
  flex: 0 0 auto;
  gap: 3px;
  align-items: center;
  align-self: center;
  padding: 2px 5px;
  font-size: 10px;
  font-weight: 650;
  color: var(--muted-2);
  cursor: pointer;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  opacity: 0.55;
  transition:
    color 150ms var(--ease),
    background 150ms var(--ease),
    opacity 150ms var(--ease);
}

.subtask-attach svg {
  width: 12px;
  height: 12px;
}

.subtask-attach:hover {
  color: var(--green);
  background: var(--green-soft);
  opacity: 1;
}

.subtask-attach.has-files,
.subtask-attach[aria-expanded="true"] {
  color: var(--green);
  background: var(--green-soft);
  opacity: 1;
}

.subtask-attach b {
  font-size: 9.5px;
  font-weight: 750;
}

.subtask-attach-panel {
  margin: 2px 0 6px 26px;
}

.subtask-attach-panel[hidden] {
  display: none;
}

.attachment-panel.is-subtask {
  margin-top: 4px;
  padding: 8px 10px 6px;
  background: rgba(var(--ink-rgb), 0.03);
  border-radius: 11px;
}

.attachment-panel.is-subtask.is-readonly {
  padding: 0;
  background: transparent;
}

.subtask-attach-panel .attachment-panel-head {
  margin-bottom: 6px;
}

.attachment-panel.is-compact .attachment-gallery {
  gap: 7px;
  padding: 2px 0 4px;
}

.attachment-panel.is-compact .attachment-empty {
  padding: 6px 2px 8px;
  font-size: 10.5px;
}

.report-attachments.is-subtask {
  margin: 0 0 2px 20px;
}

/* -------------------------------------------------------------------------- */
/* AI 小助手：图片转文字                                                       */
/* -------------------------------------------------------------------------- */

.assistant-view {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding-bottom: 44px;
}

.assistant-drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 26px 20px;
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--radius-lg);
  background: var(--surface-soft);
  cursor: pointer;
  outline: none;
  transition:
    border-color 0.18s var(--ease),
    background 0.18s var(--ease);
}

.assistant-drop:hover,
.assistant-drop:focus-visible,
.assistant-drop.is-dragging {
  border-color: var(--green);
  background: var(--green-soft);
}

.assistant-drop-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface);
  color: var(--green);
}

.assistant-drop-icon svg {
  width: 18px;
  height: 18px;
}

.assistant-drop-title {
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
}

.assistant-drop-hint {
  color: var(--muted);
  font-size: 11.5px;
}

/* 识别引擎切换：自动 / AI / 本地 */
.assistant-engine {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  margin-top: 10px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 99px;
}

.assistant-engine-btn {
  min-width: 46px;
  padding: 4px 12px;
  color: var(--muted);
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 600;
  background: transparent;
  border: 0;
  border-radius: 99px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.assistant-engine-btn:hover {
  color: var(--ink);
}

.assistant-engine-btn.is-on {
  color: #fff;
  background: var(--navy);
}

.assistant-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2px;
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 650;
}

.assistant-summary-meta {
  color: var(--muted);
  font-weight: 500;
}

.assistant-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.assistant-row {
  display: flex;
  gap: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.assistant-thumb {
  flex: 0 0 auto;
  width: 108px;
  height: 108px;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
  cursor: zoom-in;
  transition:
    border-color 0.18s var(--ease),
    box-shadow 0.18s var(--ease);
}

.assistant-thumb:hover {
  border-color: var(--green);
  box-shadow: 0 8px 20px rgba(var(--accent-rgb), 0.18);
}

.assistant-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.assistant-main {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.assistant-row-head {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 26px;
}

.assistant-name {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.assistant-status {
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.assistant-status.is-done {
  color: var(--ok);
}

.assistant-status.is-warn {
  color: var(--coral);
}

.assistant-status.is-busy {
  color: var(--blue);
}

/* 识别引擎小标签：AI / 本地 */
.assistant-engine-tag {
  flex: 0 0 auto;
  padding: 1px 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  border: 1px solid transparent;
  border-radius: 4px;
}

.assistant-engine-tag.is-ai {
  color: var(--navy);
  background: rgba(181, 139, 77, 0.14);
  border-color: rgba(181, 139, 77, 0.34);
}

.assistant-engine-tag.is-local {
  color: var(--muted);
  background: var(--surface-2);
  border-color: var(--line);
}

/* 引擎降级提示，例如在线失败改用本地 */
.assistant-warn {
  margin-bottom: 8px;
  padding: 6px 10px;
  color: #8a5b12;
  font-size: 11.5px;
  line-height: 1.5;
  background: rgba(181, 139, 77, 0.1);
  border-left: 2px solid rgba(181, 139, 77, 0.55);
  border-radius: 0 6px 6px 0;
}

.assistant-row-actions {
  display: flex;
  gap: 6px;
  margin-left: auto;
}

.mini-button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 26px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-soft);
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition:
    border-color 0.16s var(--ease),
    background 0.16s var(--ease),
    color 0.16s var(--ease);
}

.mini-button svg {
  width: 13px;
  height: 13px;
}

.mini-button:hover {
  border-color: var(--green);
  background: var(--green-soft);
  color: var(--green);
}

.mini-button.danger:hover {
  border-color: var(--action-delete);
  background: var(--coral-soft);
  color: var(--action-delete);
}

.assistant-text {
  width: 100%;
  min-height: 96px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.7;
  resize: vertical;
  outline: none;
  transition:
    border-color 0.16s var(--ease),
    background 0.16s var(--ease),
    box-shadow 0.16s var(--ease);
}

.assistant-text:focus {
  border-color: var(--green);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.1);
}

.assistant-text[readonly] {
  color: var(--muted);
}

.assistant-zoom-overlay {
  align-items: center;
  justify-content: center;
}

.assistant-zoom-figure {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: min(1400px, 100%);
  max-height: 100%;
  margin: 0;
}

.assistant-zoom-figure img {
  max-width: 100%;
  max-height: calc(100vh - 170px);
  border-radius: var(--radius-md);
  background: #0b1018;
  box-shadow: var(--shadow-lg);
  object-fit: contain;
}

.assistant-zoom-figure figcaption {
  color: #f4f7fb;
  font-size: 12.5px;
  text-align: center;
  opacity: 0.85;
}

.assistant-zoom-close {
  position: absolute;
  top: 18px;
  right: 20px;
  color: #f4f7fb;
  border-color: rgba(255, 255, 255, 0.32);
  background: rgba(12, 24, 42, 0.55);
}

.assistant-zoom-close:hover {
  background: rgba(12, 24, 42, 0.82);
}

@media (max-width: 720px) {
  .assistant-row {
    flex-direction: column;
  }

  .assistant-thumb {
    width: 100%;
    height: 160px;
  }
}

/* ==========================================================================
   登录 / 账号 / 用户管理
   ========================================================================== */

body.auth-locked .app-shell,
body.auth-locked .mobile-backdrop {
  display: none !important;
}

body.auth-locked {
  overflow: auto;
}

#auth-root:empty {
  display: none;
}

.auth-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 40px 24px;
  background:
    radial-gradient(1100px 640px at 8% -12%, var(--page-glow-1), transparent 70%),
    radial-gradient(900px 560px at 112% 112%, var(--page-glow-2), transparent 65%),
    var(--paper);
}

.auth-card {
  width: min(980px, 100%);
  display: grid;
  grid-template-columns: 1.02fr 1fr;
  min-height: 580px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.auth-aside {
  position: relative;
  padding: 46px 42px;
  display: flex;
  flex-direction: column;
  background: linear-gradient(158deg, var(--sidebar-a), var(--sidebar-b) 52%, var(--sidebar-c));
  color: var(--side-text-strong);
  overflow: hidden;
}

.auth-aside::before,
.auth-aside::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.auth-aside::before {
  width: 420px;
  height: 420px;
  right: -180px;
  top: -160px;
  background: radial-gradient(circle, var(--sidebar-glow-1), transparent 68%);
}

.auth-aside::after {
  width: 460px;
  height: 460px;
  left: -190px;
  bottom: -220px;
  background: radial-gradient(circle, var(--sidebar-glow-2), transparent 70%);
}

.auth-logo {
  position: relative;
  display: flex;
  gap: 12px;
  align-items: center;
}

.auth-logo-text {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.34em;
  color: var(--side-text-strong);
}

.auth-aside h1 {
  position: relative;
  margin: auto 0 0;
  font-family: var(--font-display);
  font-size: clamp(34px, 3.4vw, 46px);
  line-height: 1.22;
  letter-spacing: 0.01em;
  color: #fff;
}

.auth-aside-copy {
  position: relative;
  margin: 16px 0 0;
  font-size: 12.5px;
  letter-spacing: 0.16em;
  color: var(--side-text-dim);
}

.auth-aside-line {
  position: relative;
  width: 46px;
  height: 2px;
  margin: 26px 0 22px;
  background: var(--gold);
}

.auth-aside-foot {
  position: relative;
  display: flex;
  gap: 8px;
  align-items: center;
  margin: 0;
  font-size: 11px;
  color: var(--side-text-faint);
}

.auth-aside-foot svg {
  width: 14px;
  height: 14px;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 54px 48px;
  justify-content: center;
}

.auth-form-head {
  margin-bottom: 8px;
}

.auth-eyebrow {
  display: inline-block;
  padding-bottom: 8px;
  color: var(--gold);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.auth-form-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 600;
  color: var(--ink);
}

.auth-form-head p {
  margin: 10px 0 0;
  font-size: 12px;
  line-height: 1.7;
  color: var(--muted);
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.auth-field > span {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--muted-2);
  text-transform: uppercase;
}

.auth-field .field-input {
  height: 46px;
  padding: 0 14px;
  font-size: 14px;
}

.auth-error {
  padding: 10px 13px;
  border-left: 3px solid var(--coral);
  border-radius: 8px;
  background: var(--coral-soft);
  color: var(--coral);
  font-size: 12px;
  line-height: 1.6;
}

.auth-error[hidden] {
  display: none;
}

.auth-submit {
  height: 48px;
  margin-top: 6px;
  font-size: 14px;
  letter-spacing: 0.06em;
}

.auth-tip {
  margin: 0;
  font-size: 11px;
  line-height: 1.7;
  color: var(--muted-2);
}

@media (max-width: 860px) {
  .auth-card {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .auth-aside {
    padding: 34px 30px 40px;
  }

  .auth-aside h1 {
    margin-top: 30px;
    font-size: 30px;
  }

  .auth-form {
    padding: 34px 28px 38px;
  }
}

/* ------------------------------ 账号入口 ------------------------------ */

.account-button {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  height: 34px;
  padding: 0 12px 0 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--control-bg-strong);
  color: var(--ink);
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
  transition: border-color 160ms var(--ease), background 160ms var(--ease);
}

.account-button:hover {
  border-color: var(--line-strong);
  background: var(--surface);
}

.account-avatar {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border-radius: 50%;
  background: var(--forest);
  color: var(--gold-bright);
  font-size: 11px;
  font-weight: 700;
}

.account-name {
  max-width: 96px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 1080px) {
  .account-name {
    display: none;
  }

  .account-button {
    padding-right: 4px;
  }
}

.account-modal {
  width: min(460px, 100%);
}

.account-actions {
  display: flex;
  flex-direction: column;
}

.account-action {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 17px 26px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 150ms var(--ease);
}

.account-action:last-child {
  border-bottom: 0;
}

.account-action:hover {
  background: var(--surface-soft);
}

.account-action svg {
  width: 17px;
  height: 17px;
  color: var(--green);
}

.account-action span {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.account-action strong {
  font-size: 13px;
  font-weight: 650;
}

.account-action small {
  color: var(--muted-2);
  font-size: 11px;
}

.account-action.is-danger svg,
.account-action.is-danger strong {
  color: var(--coral);
}

/* ------------------------------ 用户管理 ------------------------------ */

.users-modal {
  width: min(840px, 100%);
}

.users-body {
  max-height: min(66vh, 620px);
  overflow: auto;
  padding: 6px 26px 22px;
}

.users-list {
  display: flex;
  flex-direction: column;
}

.user-row {
  display: flex;
  gap: 13px;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.user-row.is-off {
  opacity: 0.55;
}

.user-avatar {
  display: grid;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  background: var(--green-soft);
  color: var(--green);
  font-size: 13px;
  font-weight: 700;
}

.user-main {
  flex: 1;
  min-width: 0;
}

.user-name {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 13.5px;
  font-weight: 650;
  color: var(--ink);
}

.user-tag {
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--gold-soft);
  color: var(--gold);
  font-size: 9.5px;
  font-weight: 700;
}

.user-meta {
  margin-top: 3px;
  color: var(--muted-2);
  font-size: 11px;
}

.user-buttons {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.button-mini {
  height: 29px;
  padding: 0 11px;
  border-radius: 8px;
  font-size: 11.5px;
}

.user-new-form {
  margin-top: 18px;
  padding: 18px 18px 16px;
  border: 1px dashed var(--line-strong);
  border-radius: 14px;
  background: var(--surface-soft);
}

.user-new-title {
  margin-bottom: 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--muted-2);
  text-transform: uppercase;
}

.user-new-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.user-new-foot {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-top: 14px;
}

.user-new-hint {
  color: var(--muted-2);
  font-size: 11px;
}

@media (max-width: 640px) {
  .user-new-grid {
    grid-template-columns: 1fr;
  }

  .user-new-foot {
    align-items: stretch;
    flex-direction: column;
  }

  .user-row {
    flex-wrap: wrap;
  }
}

.narrow-modal {
  width: min(440px, 100%);
}

.stack-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px 26px 0;
}

/* ---------------- 团队只读视图 ---------------- */
.team-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 16px;
}

.team-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  transition:
    color 160ms ease,
    background 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.team-chip:hover {
  background: var(--surface-soft);
  border-color: var(--line-strong);
}

.team-chip.is-active {
  color: #fff;
  background: var(--forest);
  border-color: var(--forest);
  box-shadow: 0 8px 20px rgba(11, 37, 69, 0.18);
}

.team-chip-avatar {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  color: var(--forest);
  font-size: 11px;
  font-weight: 700;
  background: var(--green-soft);
  border-radius: 50%;
}

.team-chip.is-active .team-chip-avatar {
  color: #fff;
  background: rgba(255, 255, 255, 0.2);
}

.team-chip em {
  padding: 1px 6px;
  color: var(--muted);
  font-size: 10.5px;
  font-style: normal;
  font-weight: 600;
  background: var(--surface-soft);
  border-radius: 999px;
}

.team-chip.is-active em {
  color: rgba(255, 255, 255, 0.88);
  background: rgba(255, 255, 255, 0.16);
}

.readonly-tag {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 7px;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 600;
  vertical-align: middle;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
}

.task-status-static {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 26px;
  padding: 0 12px;
  font-size: 10.5px;
  font-weight: 650;
  background: var(--neutral-soft);
  border-radius: 999px;
}

.task-status-static.completed {
  color: var(--ok);
  background: var(--ok-soft);
}

.task-status-static.progress {
  color: var(--info);
  background: var(--info-soft);
}

.task-status-static.planned {
  color: var(--neutral);
  background: var(--neutral-soft);
}

.task-status-static.deferred {
  color: var(--coral);
  background: var(--coral-soft);
}

.task-check.is-static,
.subtask-check.is-static {
  cursor: default;
  pointer-events: none;
}

.task-check.is-static:hover,
.subtask-check.is-static:hover {
  color: var(--muted-2);
  border-color: rgba(var(--ink-rgb), 0.19);
  transform: none;
}

.task-item.is-readonly .subtask-label {
  cursor: default;
}

.user-role {
  flex: 0 0 auto;
}

.user-role-select {
  min-width: 116px;
  height: 30px;
  font-size: 12px;
}

/* ==========================================================================
   消息通知 · 顶部滚动条 + 管理页
   ========================================================================== */

.stage-header {
  position: sticky;
  top: 0;
  z-index: 30;
}

.stage-header .topbar {
  position: static;
  top: auto;
}

.notice-strip-host:empty {
  display: none;
}

.notice-strip {
  display: flex;
  align-items: center;
  gap: 0;
  height: 46px;
  overflow: hidden;
  color: #ffffff;
  background: linear-gradient(90deg, #0b2545 0%, #123a63 58%, #0b2545 100%);
  border-bottom: 1px solid rgba(216, 185, 121, 0.26);
}

.notice-tag {
  display: inline-flex;
  flex: 0 0 auto;
  gap: 7px;
  align-items: center;
  height: 100%;
  padding: 0 16px 0 clamp(24px, 4vw, 58px);
  color: #d6b676;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.22em;
  background: rgba(0, 0, 0, 0.16);
}

.notice-viewport {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
}

.notice-track {
  display: flex;
  width: max-content;
}

.notice-track.is-running {
  animation: noticeScroll var(--notice-duration, 20s) linear infinite;
}

/* 逐条播放模式：每条只播一次，播完停在左侧外，等下一跳再换下一条 */
.notice-track.is-seq.is-running {
  animation-iteration-count: 1;
  animation-fill-mode: forwards;
}

/* 从右向左：起点在视口右侧外，终点是内容完全越过左侧边界，然后重新从右侧进入 */
@keyframes noticeScroll {
  from {
    transform: translateX(var(--notice-from, 100%));
  }
  to {
    transform: translateX(var(--notice-to, 0px));
  }
}

.notice-group {
  display: flex;
  flex: 0 0 auto;
  gap: 64px;
  align-items: center;
  padding-right: 64px;
  white-space: nowrap;
}

.notice-text {
  color: rgba(255, 255, 255, 0.95);
  font-size: 13px;
  line-height: 1.5;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

/* 管理页 ---------------------------------------------------------------- */

.notices-view {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.notice-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
}

.notice-list {
  overflow: hidden;
  background: var(--card-bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.notice-row {
  display: grid;
  grid-template-columns: 3px minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 14px 18px;
  transition: background 160ms ease;
}

.notice-row + .notice-row {
  border-top: 1px solid var(--line);
}

.notice-row:hover {
  background: var(--card-bg-hover);
}

.notice-row-bar {
  width: 3px;
  height: 100%;
  min-height: 34px;
  background: var(--line-strong);
  border-radius: 999px;
}

.notice-row.tone-live .notice-row-bar {
  background: #17724f;
}

.notice-row.tone-paused .notice-row-bar {
  background: var(--gold);
}

.notice-row.tone-scheduled .notice-row-bar {
  background: var(--blue);
}

.notice-row.tone-expired .notice-row-bar,
.notice-row.tone-draft .notice-row-bar {
  background: rgba(var(--ink-rgb), 0.22);
}

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

.notice-row-text {
  margin: 0;
  color: var(--ink);
  font-size: 13.5px;
  line-height: 1.62;
  overflow-wrap: anywhere;
}

.notice-row-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-top: 7px;
  color: var(--muted-2);
  font-size: 10.5px;
}

.notice-state {
  padding: 2px 8px;
  font-size: 10px;
  font-weight: 650;
  border-radius: 999px;
}

.notice-state.tone-live {
  color: #17724f;
  background: rgba(23, 114, 79, 0.1);
}

.notice-state.tone-paused {
  color: var(--gold);
  background: var(--gold-soft);
}

.notice-state.tone-scheduled {
  color: var(--blue);
  background: var(--blue-soft);
}

.notice-state.tone-expired,
.notice-state.tone-draft {
  color: var(--muted);
  background: rgba(var(--ink-rgb), 0.06);
}

.notice-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}

.notices-empty {
  padding: 44px 20px;
}

/* 新建 / 编辑弹窗 ------------------------------------------------------- */

.modal.notice-modal {
  width: min(720px, 100%);
}

.notice-form-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.notice-textarea {
  min-height: 106px;
}

.notice-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-items: start;
}

/* 并排的两个时间字段必须齐平：清掉 .field + .field 的纵向间距 */
.notice-form-grid > .field + .field {
  margin-top: 0;
}

.notice-form-grid .field-input {
  min-width: 0;
}

.notice-speed-row {
  display: flex;
  gap: 14px;
  align-items: center;
}

.notice-speed-row input[type="range"] {
  flex: 1 1 auto;
  accent-color: #0b2545;
}

.notice-speed-value {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 11.5px;
  white-space: nowrap;
}

.notice-preview {
  display: flex;
  align-items: center;
  height: 44px;
  overflow: hidden;
  background: linear-gradient(90deg, #0b2545 0%, #123a63 58%, #0b2545 100%);
  border-radius: 10px;
}

.notice-preview .notice-tag {
  padding: 0 12px 0 14px;
  background: rgba(0, 0, 0, 0.16);
}

.notice-preview .notice-viewport {
  padding-right: 10px;
}

@media (max-width: 760px) {
  .notice-tag {
    padding-left: 18px;
  }

  .notice-row {
    grid-template-columns: 3px minmax(0, 1fr);
  }

  .notice-row-actions {
    grid-column: 2;
    justify-content: flex-start;
  }

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