:root {
  --bg: #f5f7f3;
  --surface: #ffffff;
  --surface-soft: #eef4ee;
  --ink: #18221f;
  --muted: #66736d;
  --line: #dbe3dc;
  --line-strong: #c5d1c8;
  --accent: #227459;
  --accent-strong: #155f49;
  --accent-soft: #e3f1eb;
  --blue: #2f6690;
  --amber: #a86710;
  --red: #b84a3f;
  --red-soft: #f7e6e3;
  --yellow-soft: #fff4db;
  --blue-soft: #e6f0f7;
  --shadow: 0 18px 40px rgba(30, 48, 38, 0.08);

  /* ===== 设计令牌：字号 =====
     全站字号统一为下面 8 级，新增样式一律引用变量，不要再写裸数值。
     ctl  界面基准（16px）：导航按钮、表单控件、主操作按钮、图标符号，
          同时用作 body 的继承基准（此前 body 未设字号，全靠浏览器默认 16px）。
     2xs  仅用于固定尺寸的徽章/角标（14~17px 圆形或胶囊）与时间轴条内文字
     xs   微标、时间戳、极小说明
     sm   标签、次要信息
     base 正文、表格、KR 名称
     md   小标题
     lg   卡片标题
     xl   区块标题
     2xl  页面大标题、KPI 大数字 */
  --fs-ctl: 16px;
  --fs-2xs: 10px;
  --fs-sm: 12px;
  --fs-base: 13px;
  --fs-md: 16px;
  --fs-lg: 18px;
  --fs-xl: 22px;
  --fs-2xl: 28px;

  /* ===== 设计令牌：字重（三级）=====
     normal 正文 / medium 轻度强调 / bold 标题与关键数字 */
  --fw-normal: 400;
  --fw-medium: 600;
  --fw-bold: 700;

  /* ===== 设计令牌：字体族 ===== */
  --font-sans: Inter, "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  --font-mono: Consolas, "Courier New", monospace;

  /* 反白文字（用于深色/品牌色底上的文字与工具提示） */
  --text-inverse: #ffffff;

  font-family: var(--font-sans);
}

* {
  box-sizing: border-box;
}

html {
  color: var(--ink);
  background: var(--bg);
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  font-size: var(--fs-ctl);
  background:
    linear-gradient(90deg, rgba(34, 116, 89, 0.05), transparent 36%),
    var(--bg);
}

body.is-locked .app-shell {
  filter: blur(3px);
  pointer-events: none;
  user-select: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  min-height: 100vh;
}

.login-screen {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  place-items: center;
  padding: 22px;
  background: rgba(245, 247, 243, 0.92);
  backdrop-filter: blur(10px);
}

.login-screen.is-visible {
  display: grid;
}

.login-card {
  display: grid;
  width: min(420px, 100%);
  gap: 16px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.login-brand {
  padding: 0 0 8px;
}

.remember-login {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: max-content;
  color: var(--muted);
  font-size: var(--fs-base);
  cursor: pointer;
}

.remember-login input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--accent);
}

.login-error {
  min-height: 20px;
  margin: 0;
  color: var(--red);
  font-size: var(--fs-base);
}

.card-system-entry {
  position: fixed;
  right: 24px;
  bottom: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 18px;
  border: 1px solid rgba(22, 163, 74, 0.28);
  border-radius: 8px;
  background: #16a34a;
  color: var(--text-inverse);
  font-size: var(--fs-base);
  font-weight: var(--fw-medium);
  text-decoration: none;
  box-shadow: 0 14px 30px rgba(22, 163, 74, 0.2);
}

.card-system-entry:hover {
  background: #15803d;
}

.icp-footer {
  position: fixed;
  right: 0;
  bottom: 10px;
  left: 0;
  /* 必须高于登录遮罩(.login-screen z-index:50)，否则未登录时备案号被完全遮住。 */
  z-index: 60;
  display: flex;
  justify-content: center;
  padding: 0 16px;
  pointer-events: none;
  font-size: var(--fs-sm);
}

.icp-footer a {
  color: var(--muted);
  pointer-events: auto;
  text-decoration: none;
}

.icp-footer a:hover {
  color: var(--accent-strong);
  text-decoration: underline;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 24px 18px;
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(16px);
}

.brand-block {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 6px 6px 26px;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface-soft);
}

.brand-mark span {
  width: 18px;
  height: 18px;
  border: 5px solid var(--accent);
  border-top-color: var(--blue);
  border-radius: 50%;
}

.brand-block h1,
.brand-block p,
.topbar h2,
.topbar p,
.section-head h3,
.section-head p {
  margin: 0;
}

.brand-block h1 {
  font-size: var(--fs-lg);
  line-height: 1.2;
}

.brand-block p {
  margin-top: 4px;
  color: var(--muted);
  font-size: var(--fs-sm);
}

.nav-list {
  display: grid;
  gap: 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  text-align: left;
}

.nav-item:hover {
  color: var(--ink);
  background: rgba(34, 116, 89, 0.07);
}

.nav-item.is-active {
  color: var(--accent-strong);
  border-color: var(--line-strong);
  background: var(--accent-soft);
  font-weight: var(--fw-medium);
}

.nav-section-break {
  height: 8px;
  border-bottom: 1px solid var(--line);
}

.nav-icon {
  display: inline-grid;
  width: 22px;
  place-items: center;
  color: currentColor;
}

.sidebar-footer {
  display: grid;
  gap: 8px;
  margin-top: auto;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.sidebar-card-system-link {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--ink);
  background: var(--surface-soft);
  text-decoration: none;
}

.sidebar-card-system-link:hover {
  border-color: var(--line-strong);
  background: var(--accent-soft);
}

.server-nav-item {
  width: 100%;
  color: var(--ink);
  background: var(--surface-soft);
}

.settings-nav-item {
  width: 100%;
  color: var(--ink);
  background: var(--surface-soft);
}

.user-panel {
  display: grid;
  gap: 3px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.user-panel strong {
  font-size: var(--fs-base);
}

.user-panel span {
  color: var(--muted);
  font-size: var(--fs-sm);
}

.main {
  width: 100%;
  max-width: 1480px;
  margin: 0 auto;
  padding: 28px;
}

/* 取消 1480px 限宽，让下列页面与推进周期一样用满整宽，
   左右边距统一由 .main 的 28px 内边距决定（窄屏再按各断点收敛）。 */
body.is-objectives-view .main,
body.is-timeline-view .main,
body.is-dashboard-view .main,
body.is-review-view .main,
body.is-fixed-tasks-view .main,
body.is-documents-view .main,
body.is-files-view .main {
  max-width: none;
}

body.is-objectives-view .topbar {
  width: min(100%, 1716px);
  padding-left: 236px;
}

body.is-timeline-view .topbar,
#timelineView {
  width: min(100%, 1840px);
}

.topbar {
  display: flex;
  gap: 18px;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
  margin-bottom: 14px;
}

.topbar h2 {
  margin-top: 4px;
  font-size: var(--fs-xl);
  line-height: 1.16;
}

.topbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.eyebrow {
  color: var(--accent-strong);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  letter-spacing: 0;
}

.view {
  display: none;
}

.view.is-visible {
  display: grid;
  gap: 18px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.metric-card,
.panel,
.objective-card,
.action-card,
.checkin-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.metric-card {
  min-height: 126px;
  padding: 18px;
  box-shadow: var(--shadow);
}

.metric-card p {
  margin: 0;
  color: var(--muted);
  font-size: var(--fs-base);
}

.metric-card strong {
  display: block;
  margin-top: 14px;
  font-size: var(--fs-2xl);
  line-height: 1;
}

.metric-card span {
  display: block;
  margin-top: 12px;
  color: var(--muted);
  font-size: var(--fs-sm);
}

.server-resource-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.server-resource-grid > .empty-state {
  grid-column: 1 / -1;
}

.server-resource-panel {
  min-width: 0;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.server-resource-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.server-resource-head p,
.server-resource-meta {
  margin: 0;
  color: var(--muted);
  font-size: var(--fs-sm);
}

.server-resource-head h4 {
  margin: 5px 0 0;
  font-size: var(--fs-lg);
}

.server-resource-head > strong {
  flex: 0 0 auto;
  color: var(--accent-strong);
  font-size: var(--fs-2xl);
  line-height: 1;
  text-align: right;
}

.server-resource-head > strong span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: var(--fs-sm);
  font-weight: var(--fw-normal);
}

.server-resource-track {
  width: 100%;
  height: 12px;
  margin-top: 22px;
  overflow: hidden;
  border-radius: 999px;
  background: #e7ece8;
}

.server-resource-used {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 220ms ease;
}

.server-resource-panel[data-resource="disk"] .server-resource-used {
  background: var(--blue);
}

.server-resource-panel[data-resource="disk"] .server-resource-head > strong {
  color: var(--blue);
}

.server-resource-values {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 20px;
}

.server-resource-values > div {
  min-width: 0;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.server-resource-values span {
  display: block;
  color: var(--muted);
  font-size: var(--fs-sm);
}

.server-resource-values strong {
  display: block;
  margin-top: 6px;
  overflow-wrap: anywhere;
  font-size: var(--fs-lg);
}

.server-resource-meta {
  margin-top: 18px;
  overflow-wrap: anywhere;
}

.settings-save-state {
  color: var(--muted);
  font-size: var(--fs-sm);
}

.settings-workspace {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 18px;
  min-height: 560px;
}

.settings-section-nav {
  display: grid;
  align-content: start;
  gap: 6px;
  min-width: 0;
  padding-right: 18px;
  border-right: 1px solid var(--line);
}

.settings-section-nav button {
  display: grid;
  gap: 4px;
  min-height: 58px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  text-align: left;
}

.settings-section-nav button:hover,
.settings-section-nav button.is-active {
  border-color: var(--line-strong);
  color: var(--ink);
  background: var(--surface-soft);
}

.settings-section-nav button.is-active {
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
}

.settings-section-nav strong,
.settings-section-nav span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settings-section-nav strong {
  font-size: var(--fs-base);
}

.settings-section-nav span {
  font-size: var(--fs-sm);
}

.settings-detail-panel {
  min-width: 0;
  padding: 22px;
}

.settings-detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.settings-detail-head h3 {
  font-size: var(--fs-lg);
  margin-top: 4px;
}

.settings-status {
  flex: 0 0 auto;
  padding: 5px 8px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  color: var(--muted);
  background: var(--surface-soft);
  font-size: var(--fs-sm);
}

.settings-status.is-ready {
  border-color: rgba(34, 116, 89, 0.28);
  color: var(--accent-strong);
  background: var(--accent-soft);
}

.settings-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.settings-form-grid label,
.settings-test-row label,
.reminder-time-field {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.settings-toggle-row,
.reminder-enable {
  display: flex;
  align-items: center;
  gap: 10px;
}

.settings-toggle-row {
  margin-top: 18px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.settings-toggle-row input,
.reminder-enable input {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.settings-toggle-row span,
.reminder-enable span {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.settings-toggle-row small,
.reminder-enable small {
  overflow: hidden;
  color: var(--muted);
  font-size: var(--fs-sm);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settings-form-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 16px;
}

.settings-test-row {
  display: grid;
  grid-template-columns: minmax(220px, 420px) auto;
  gap: 10px;
  align-items: end;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.reminder-rule-list {
  border-top: 1px solid var(--line);
}

.reminder-rule-row {
  display: grid;
  grid-template-columns: minmax(250px, 1fr) 150px auto;
  gap: 16px;
  align-items: end;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

.reminder-rule-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  justify-content: flex-end;
}

.reminder-rule-actions button {
  flex: 0 0 auto;
  white-space: nowrap;
}

.reminder-rule-actions span {
  color: var(--muted);
  font-size: var(--fs-sm);
}

.reminder-template-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.reminder-template-toolbar button {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  color: var(--accent-strong);
  background: var(--surface);
  font-weight: var(--fw-medium);
}

.reminder-template-body {
  min-height: 260px;
  resize: vertical;
}

.content-split {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
  gap: 18px;
}

.panel {
  padding: 18px;
}

.section-head {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.section-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-end;
  justify-content: flex-end;
}

.objective-toolbar {
  align-items: center;
}

.segmented {
  display: inline-flex;
  min-height: 38px;
  padding: 3px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface-soft);
}

.segment {
  min-width: 72px;
  padding: 0 11px;
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  font-size: var(--fs-base);
  font-weight: var(--fw-medium);
}

.segment[data-objective-scope="history"] {
  min-width: 112px;
}

.segment.is-active {
  color: var(--accent-strong);
  background: var(--surface);
  box-shadow: 0 1px 4px rgba(30, 48, 38, 0.08);
}

.filter-inline {
  width: min(260px, 100%);
}

.filter-inline.small {
  width: 160px;
}

.section-head h3 {
  margin-top: 4px;
  font-size: var(--fs-lg);
}

.compact-head {
  margin-bottom: 12px;
}

.page-head {
  padding-bottom: 4px;
  border-bottom: 1px solid var(--line);
}

.primary-button,
.ghost-button,
.text-button,
.icon-button {
  min-height: 38px;
  border-radius: 8px;
  transition:
    background 160ms ease,
    border-color 160ms ease,
    color 160ms ease,
    transform 160ms ease;
}

.primary-button {
  padding: 0 15px;
  border: 1px solid var(--accent-strong);
  color: var(--text-inverse);
  background: var(--accent);
  font-weight: var(--fw-medium);
}

.primary-button:hover {
  background: var(--accent-strong);
}

.ghost-button {
  padding: 0 13px;
  border: 1px solid var(--line-strong);
  color: var(--ink);
  background: var(--surface);
}

.ghost-button:hover {
  border-color: var(--accent);
  color: var(--accent-strong);
  background: var(--accent-soft);
}

.text-button {
  min-height: 32px;
  padding: 0;
  border: 0;
  color: var(--accent-strong);
  background: transparent;
  text-align: left;
  font-weight: var(--fw-medium);
}

.icon-button {
  display: inline-grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid var(--line-strong);
  color: var(--ink);
  background: var(--surface);
  /* 原为 --fs-lg(18px)，比同一行的按钮文字(13px)高出 5px，符号显得抢眼；
     收到界面基准 16px，与 38px 的控件高度比例更协调。 */
  font-size: var(--fs-ctl);
  line-height: 1;
}

.icon-button:hover {
  border-color: var(--accent);
  color: var(--accent-strong);
  background: var(--accent-soft);
}

.file-button {
  position: relative;
  overflow: hidden;
}

.file-button input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.control {
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
  outline: none;
}

.control:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(34, 116, 89, 0.14);
}

.control[readonly] {
  color: var(--muted);
  background: #f3f6f4;
  cursor: not-allowed;
}

.textarea {
  min-height: 96px;
  resize: vertical;
  line-height: 1.55;
}

.report-output {
  min-height: 360px;
  white-space: pre-wrap;
}

.report-toolbar {
  display: grid;
  grid-template-columns: minmax(180px, 220px) minmax(0, 1fr);
  gap: 12px;
  align-items: end;
}

.report-hint {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: var(--surface-soft);
  font-size: var(--fs-base);
  line-height: 1.5;
}

.field-label {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
}

.field-head {
  display: grid;
  gap: 4px;
}

.objective-list,
.checkin-list,
.risk-list {
  display: grid;
  gap: 12px;
}

#objectivesView.is-visible {
  width: min(100%, 1716px);
  grid-template-columns: 220px minmax(0, 1480px);
  column-gap: 16px;
  row-gap: 18px;
  align-items: start;
}

#objectivesView .page-head,
#objectivesView #objectiveList {
  grid-column: 2;
  min-width: 0;
}

.objective-outline {
  position: sticky;
  top: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  height: calc(100vh - 134px);
  min-height: 620px;
  max-height: 100vh;
  grid-column: 1;
  grid-row: 1 / span 2;
  gap: 0;
  align-content: start;
  padding: 0 12px 0 0;
  overflow: hidden;
  border-right: 1px solid var(--line-strong);
  background: transparent;
}

.objective-outline-head {
  display: flex;
  min-height: 42px;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 8px 8px;
  border-bottom: 1px solid var(--line);
}

.objective-outline-head h4,
.objective-outline-empty {
  margin: 0;
}

.objective-outline-head h4 {
  font-size: var(--fs-base);
}

.objective-outline-head > span {
  display: inline-grid;
  min-width: 24px;
  min-height: 24px;
  place-items: center;
  padding: 0 6px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  color: var(--accent-strong);
  background: var(--accent-soft);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
}

.objective-outline-list {
  display: grid;
  grid-auto-flow: row;
  gap: 2px;
  align-content: start;
  overflow-y: auto;
  padding: 8px 2px 8px 0;
  scrollbar-gutter: stable;
}

.objective-outline-item {
  display: grid;
  width: 100%;
  min-height: 50px;
  grid-template-columns: 18px 32px minmax(0, 1fr) 34px;
  gap: 7px;
  align-items: start;
  padding: 8px 7px;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--ink);
  background: transparent;
  text-align: left;
}

.objective-outline-item:hover,
.objective-outline-item:focus-visible {
  border-color: var(--line-strong);
  background: var(--surface-soft);
  outline: none;
}

.objective-outline-item.is-active {
  border-color: rgba(34, 116, 89, 0.18);
  color: var(--accent-strong);
  background: var(--accent-soft);
  box-shadow: inset 3px 0 0 var(--accent);
}

.objective-outline-item > .drag-handle {
  margin-top: 1px;
  opacity: 0.42;
}

.objective-outline-item:hover > .drag-handle,
.objective-outline-item:focus-visible > .drag-handle,
.objective-outline-item.is-active > .drag-handle {
  opacity: 1;
}

.drag-handle {
  display: inline-grid;
  flex: 0 0 18px;
  width: 18px;
  min-height: 24px;
  place-items: center;
  border-radius: 4px;
  color: var(--muted);
  cursor: grab;
  font-size: var(--fs-base);
  font-weight: var(--fw-bold);
  line-height: 1;
  user-select: none;
}

.drag-handle:hover {
  color: var(--accent-strong);
  background: var(--accent-soft);
}

.drag-handle:active {
  cursor: grabbing;
}

.drag-handle.is-disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.objective-outline-item.is-drag-over,
.kr-row.is-drag-over {
  border-color: var(--accent);
  box-shadow: inset 0 3px 0 var(--accent);
}

.objective-outline-index,
.objective-outline-progress {
  padding-top: 3px;
  color: var(--muted);
  font-size: var(--fs-2xs);
  font-weight: var(--fw-medium);
  white-space: nowrap;
}

.objective-outline-index {
  color: var(--accent-strong);
}

.objective-outline-progress {
  text-align: right;
}

.objective-outline-title {
  display: -webkit-box;
  min-width: 0;
  overflow: hidden;
  font-size: var(--fs-sm);
  line-height: 1.4;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.objective-outline-empty {
  padding: 12px 4px;
  color: var(--muted);
  font-size: var(--fs-sm);
  line-height: 1.5;
}

.objective-card {
  display: grid;
  gap: 16px;
  padding: 16px;
}

.objective-card--full {
  gap: 0;
  padding: 0;
  overflow: hidden;
  border-color: var(--line-strong);
  /* 按需求去掉 OKR 卡片投影，改用边框区分卡片边界。 */
  scroll-margin-top: 18px;
}

#objectiveList {
  gap: 18px;
}

.objective-card.compact-item {
  gap: 12px;
}

.objective-summary {
  display: grid;
  gap: 16px;
}

.objective-card--full .objective-summary {
  padding: 18px;
}

.objective-card.compact-item .objective-summary {
  gap: 12px;
}

.objective-boundary {
  display: flex;
  min-height: 42px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 18px;
  border-bottom: 1px solid var(--line);
  background: #f3f8f4;
  color: var(--muted);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
}

.objective-boundary > div {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.objective-boundary-main {
  flex: 1 1 auto;
  min-width: 0;
}

.objective-kr-filter.segmented {
  flex: 0 0 auto;
  min-height: 28px;
  padding: 2px;
  border-color: #c7d8cc;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.62);
}

.objective-kr-filter .segment {
  display: inline-flex;
  min-width: 0;
  min-height: 24px;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 0 7px;
  border-radius: 4px;
  font-size: var(--fs-sm);
  white-space: nowrap;
}

.objective-kr-filter .segment > span {
  display: inline-flex;
  min-width: 16px;
  height: 16px;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border-radius: 8px;
  color: var(--muted);
  background: #e5ece7;
  font-size: var(--fs-2xs);
  line-height: 1;
}

.objective-kr-filter .segment.is-active > span {
  color: var(--accent-strong);
  background: var(--accent-soft);
}

.objective-boundary-meta {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.schedule-range {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 5px;
  color: var(--muted);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
}

.schedule-range > span {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  padding: 0 7px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  white-space: nowrap;
}

.objective-index {
  display: inline-flex;
  min-width: 34px;
  min-height: 24px;
  align-items: center;
  justify-content: center;
  padding: 0 7px;
  border: 1px solid #86b99a;
  border-radius: 6px;
  background: #ffffff;
  color: var(--accent-strong);
  font-size: var(--fs-sm);
  line-height: 1;
}

.objective-boundary-label {
  color: var(--ink);
}

.objective-kr-section {
  display: grid;
  gap: 12px;
  padding: 14px 18px 18px;
  border-top: 1px solid var(--line);
  background: #fcfdfc;
}

.objective-kr-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.objective-kr-head h5 {
  margin: 0;
  color: var(--ink);
  font-size: var(--fs-base);
}

.objective-kr-head span {
  color: var(--muted);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
}

.objective-head,
.kr-row,
.action-head,
.checkin-head,
.risk-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  justify-content: space-between;
}

.objective-title {
  display: flex;
  flex: 1 1 auto;
  gap: 10px;
  align-items: flex-start;
  min-width: 0;
}

.objective-title > div {
  flex: 1 1 auto;
  min-width: 0;
}

.status-dot {
  flex: 0 0 auto;
  width: 10px;
  height: 10px;
  margin-top: 7px;
  border-radius: 50%;
  background: var(--accent);
}

.status-dot.at-risk {
  background: var(--amber);
}

.status-dot.blocked {
  background: var(--red);
}

.status-dot.done {
  background: var(--blue);
}

.objective-title h4,
.action-card h4,
.checkin-card h4 {
  margin: 0;
  font-size: var(--fs-md);
  line-height: 1.4;
}

.objective-title p,
.action-card p,
.checkin-card p,
.risk-item p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: var(--fs-base);
  line-height: 1.45;
}

.meta-row {
  display: flex;
  flex: 1 1 auto;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  min-width: 220px;
}

.objective-meta-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 46%);
  gap: 14px;
  align-items: center;
  margin-top: 8px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: var(--surface-soft);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  white-space: nowrap;
}

.tag.green {
  color: var(--accent-strong);
  background: var(--accent-soft);
}

.tag.amber {
  color: var(--amber);
  background: var(--yellow-soft);
}

.tag.red {
  color: var(--red);
  background: var(--red-soft);
}

.tag.blue {
  color: var(--blue);
  background: var(--blue-soft);
}

.objective-files {
  display: flex;
  flex-wrap: nowrap;
  gap: 5px;
  justify-content: flex-end;
  margin-left: auto;
  width: 100%;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
}

.objective-file-chip {
  display: inline-flex;
  flex: 0 1 128px;
  min-width: 42px;
  max-width: 128px;
  min-height: 30px;
  align-items: center;
  gap: 4px;
  padding: 4px 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: #fbfcfb;
  font-size: var(--fs-sm);
}

.objective-file-chip a {
  flex: 1 1 auto;
  min-width: 0;
  max-width: none;
  overflow: hidden;
  color: var(--accent-strong);
  font-weight: var(--fw-medium);
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.objective-file-chip a:hover {
  text-decoration: underline;
}

.file-chip-meta {
  display: none;
}

.file-chip-delete {
  flex: 0 0 auto;
  min-height: 22px;
  padding: 0 5px;
  border: 1px solid rgba(184, 74, 63, 0.35);
  border-radius: 6px;
  color: var(--red);
  background: var(--red-soft);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
}

.progress-track {
  width: 100%;
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #e7ece8;
}

.progress-bar {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 220ms ease;
}

.progress-bar.low {
  background: var(--amber);
}

.progress-bar.mid {
  background: var(--amber);
}

.progress-line {
  display: grid;
  gap: 8px;
}

.progress-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: var(--fs-sm);
}

.kr-list {
  display: grid;
  gap: 8px;
}

.kr-row {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.kr-row.is-deleted {
  border-style: dashed;
  border-color: #c8ced0;
  background: #f5f6f6;
}

.kr-row.is-deleted .kr-main {
  opacity: 0.68;
}

.kr-row > .drag-handle {
  margin-top: 1px;
}

.kr-main {
  flex: 1;
  min-width: 0;
}

.kr-row-tools {
  display: flex;
  flex: 0 0 auto;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
}

.kr-schedule-range {
  justify-content: flex-end;
}

.kr-main h5 {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0 0 8px;
  font-size: var(--fs-base);
  line-height: 1.4;
}

.kr-number {
  display: inline-flex;
  flex: 0 0 auto;
  min-width: 38px;
  min-height: 22px;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  color: var(--accent-strong);
  background: var(--accent-soft);
  font-size: var(--fs-sm);
}

.kr-values {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: var(--fs-sm);
}

.kr-task-editor {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.kr-task-list {
  display: grid;
  gap: 8px;
}

.kr-task-row {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
}

.kr-task-check {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.kr-task-row.is-done .kr-task-input {
  color: var(--muted);
  text-decoration: line-through;
  background: #f3f6f4;
}

.kr-task-summary {
  display: grid;
  gap: 7px;
  margin-top: 10px;
  color: var(--muted);
  font-size: var(--fs-sm);
}

.kr-task-summary > div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.kr-task-chip {
  display: inline-flex;
  max-width: 100%;
  padding: 4px 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  overflow-wrap: anywhere;
}

.kr-task-chip.is-done {
  color: var(--muted);
  text-decoration: line-through;
  background: var(--surface-soft);
}

.mini-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.mini-button {
  min-height: 28px;
  padding: 0 9px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  color: var(--muted);
  background: var(--surface);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
}

.pin-button {
  min-width: 30px;
  padding: 0 6px;
  color: var(--muted);
  font-size: var(--fs-md);
  line-height: 1;
}

.pin-button.is-pinned {
  border-color: rgba(195, 122, 24, 0.4);
  color: var(--amber);
  background: var(--yellow-soft);
}

.bottom-button {
  min-width: 30px;
  padding: 0 6px;
  color: var(--muted);
  font-size: var(--fs-md);
  line-height: 1;
}

.bottom-button.is-bottomed {
  border-color: rgba(68, 104, 156, 0.4);
  color: var(--blue);
  background: #eaf1fb;
}

.mini-button:hover {
  color: var(--accent-strong);
  border-color: var(--accent);
}

.mini-button.primary {
  color: var(--accent-strong);
  border-color: var(--accent);
  background: var(--accent-soft);
}

.mini-button.mini-danger {
  color: var(--red);
  border-color: rgba(184, 74, 63, 0.42);
  background: var(--red-soft);
}

.mini-button.mini-danger:hover {
  color: var(--red);
  border-color: var(--red);
}

.timeline-panel {
  min-width: 0;
  padding: 0;
  overflow: hidden;
}

/* 推进周期页：压缩纵向留白，让时间轴模块上下各扩展一些。 */
body.is-timeline-view .main {
  padding-top: 16px;
  padding-bottom: 12px;
}

#timelineView .timeline-page-head {
  margin-bottom: 8px;
}

.timeline-summary {
  display: flex;
  min-height: 46px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 7px 14px;
  border-bottom: 1px solid var(--line);
}

.timeline-summary > div,
.timeline-legend {
  display: flex;
  align-items: center;
  gap: 8px;
}

.timeline-summary span {
  color: var(--muted);
  font-size: var(--fs-sm);
}

.timeline-legend span {
  display: inline-grid;
  min-width: 26px;
  min-height: 24px;
  place-items: center;
  padding: 0 7px;
  border-radius: 6px;
  background: var(--surface-soft);
  font-weight: var(--fw-medium);
}

.timeline-legend .objective {
  color: var(--accent-strong);
  background: var(--accent-soft);
}

.timeline-legend .kr {
  color: var(--blue);
  background: #eaf2ff;
}

.timeline-scroll {
  min-width: 0;
  min-height: 360px;
  max-height: calc(100vh - 245px);
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.timeline-scroll:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.timeline-table {
  --timeline-day-width: 38px;
  width: max-content;
  min-width: 100%;
}

.timeline-line {
  display: grid;
  min-height: 52px;
  grid-template-columns: 300px var(--timeline-track-width);
}

.timeline-header-line {
  position: sticky;
  top: 0;
  z-index: 6;
  min-height: 52px;
}

.timeline-row-label {
  position: sticky;
  left: 0;
  z-index: 3;
  display: grid;
  min-width: 0;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  padding: 8px 12px;
  border-right: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line);
  background: #ffffff;
}

.timeline-row-label > span {
  display: inline-grid;
  min-height: 25px;
  place-items: center;
  padding: 0 6px;
  border-radius: 6px;
  color: var(--accent-strong);
  background: var(--accent-soft);
  font-size: var(--fs-sm);
  font-weight: var(--fw-bold);
}

.timeline-line--kr .timeline-row-label > span {
  color: var(--blue);
  background: #eaf2ff;
}

.timeline-row-label > div {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.timeline-row-label strong,
.timeline-row-label small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.timeline-row-label strong {
  font-size: var(--fs-sm);
}

.timeline-row-label small {
  color: var(--muted);
  font-size: var(--fs-2xs);
}

.timeline-row-label--head {
  z-index: 8;
  background: #f7faf7;
}

.timeline-row-label--head strong,
.timeline-row-label--head small {
  grid-column: 1 / -1;
}

.timeline-axis {
  display: flex;
  width: var(--timeline-track-width);
  border-bottom: 1px solid var(--line-strong);
  background: #f7faf7;
}

.timeline-day {
  display: grid;
  flex: 0 0 var(--timeline-day-width);
  min-width: 0;
  place-items: center;
  align-content: center;
  border-right: 1px solid var(--line);
  color: var(--muted);
}

.timeline-day small {
  min-height: 14px;
  font-size: var(--fs-2xs);
}

.timeline-day strong {
  font-size: var(--fs-sm);
}

.timeline-day.is-weekend {
  background: #f2f5f3;
}

.timeline-day.is-today {
  color: var(--red);
  background: var(--red-soft);
}

.timeline-track {
  position: relative;
  width: var(--timeline-track-width);
  min-height: 52px;
  border-bottom: 1px solid var(--line);
  background-image: repeating-linear-gradient(
    to right,
    transparent 0,
    transparent calc(var(--timeline-day-width) - 1px),
    var(--line) calc(var(--timeline-day-width) - 1px),
    var(--line) var(--timeline-day-width)
  );
  cursor: crosshair;
  touch-action: none;
  user-select: none;
}

body.is-readonly .timeline-track {
  cursor: default;
}

.timeline-selection-preview {
  position: absolute;
  z-index: 3;
  top: 5px;
  display: none;
  height: 38px;
  border: 2px solid var(--accent);
  border-radius: 6px;
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  pointer-events: none;
}

.timeline-track.is-selecting .timeline-selection-preview {
  display: block;
}

.timeline-track.is-selecting .timeline-bar {
  opacity: 0.45;
}

body.is-selecting-timeline-range,
body.is-selecting-timeline-range * {
  cursor: crosshair !important;
  user-select: none !important;
}

.timeline-bar {
  position: absolute;
  top: 13px;
  height: 26px;
  overflow: hidden;
  border: 1px solid #6ea987;
  border-radius: 6px;
  background: #dceee3;
  box-shadow: 0 2px 5px rgba(38, 91, 61, 0.12);
}

.timeline-line--kr .timeline-bar {
  top: 16px;
  height: 20px;
  border-color: #7ca5dd;
  background: #dfeaff;
}

.timeline-bar > span {
  position: absolute;
  inset: 0 auto 0 0;
  background: var(--accent);
  opacity: 0.32;
}

.timeline-line--kr .timeline-bar > span {
  background: #4d7fc3;
}

.timeline-bar strong {
  position: relative;
  z-index: 1;
  display: grid;
  height: 100%;
  place-items: center;
  padding: 0 6px;
  overflow: hidden;
  color: var(--accent-strong);
  font-size: var(--fs-2xs);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.timeline-line--kr .timeline-bar strong {
  color: var(--blue);
}

.board {
  display: grid;
  grid-template-columns: repeat(4, minmax(210px, 1fr));
  gap: 14px;
  align-items: start;
}

.board-column {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.62);
}

.board-column h4 {
  display: flex;
  justify-content: space-between;
  margin: 0 0 2px;
  color: var(--muted);
  font-size: var(--fs-base);
}

.action-card,
.checkin-card {
  padding: 13px;
}

.action-card {
  display: grid;
  gap: 12px;
}

.action-card.is-overdue {
  border-color: rgba(184, 74, 63, 0.45);
  background: #fffafa;
}

.risk-item {
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.risk-item strong {
  font-size: var(--fs-base);
}

.commerce-table-wrap {
  width: 100%;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  font-size: var(--fs-base);
}

.data-table th,
.data-table td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

.data-table th {
  color: var(--muted);
  font-size: var(--fs-sm);
}

.data-table td strong {
  display: block;
  margin-bottom: 3px;
}

.review-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.review-metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.review-metric-grid .metric-card {
  min-height: 112px;
  padding: 15px;
}

.review-metric-grid .metric-card strong {
  font-size: var(--fs-2xl);
}

.review-analysis-panel {
  margin-bottom: 16px;
}

.review-kr-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.review-kr-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.review-kr-head {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  justify-content: space-between;
}

.review-kr-head h4 {
  margin: 0 0 5px;
  font-size: var(--fs-md);
  line-height: 1.45;
}

.review-kr-head p,
.review-kr-note {
  margin: 0;
  color: var(--muted);
  font-size: var(--fs-base);
  line-height: 1.55;
}

.review-kr-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.review-kr-facts span {
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: var(--surface);
  font-size: var(--fs-sm);
}

.fixed-task-toolbar {
  align-items: center;
}

.fixed-task-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.fixed-task-summary-item {
  display: flex;
  min-height: 58px;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.fixed-task-summary-item span {
  color: var(--muted);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
}

.fixed-task-summary-item strong {
  color: var(--ink);
  font-size: var(--fs-2xl);
}

.fixed-task-list {
  display: grid;
  gap: 8px;
}

.fixed-task-row {
  display: flex;
  gap: 18px;
  align-items: center;
  justify-content: space-between;
  min-height: 92px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.fixed-task-main {
  display: grid;
  flex: 1 1 auto;
  min-width: 0;
  gap: 8px;
}

.fixed-task-title-line {
  display: flex;
  min-width: 0;
  gap: 10px;
  align-items: center;
}

.fixed-task-title-line h4 {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  font-size: var(--fs-md);
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fixed-task-status {
  flex: 0 0 auto;
  padding: 4px 7px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  color: var(--muted);
  background: var(--surface);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
}

.fixed-task-status.todo {
  border-color: rgba(195, 122, 24, 0.28);
  color: var(--amber);
  background: var(--yellow-soft);
}

.fixed-task-status.done {
  border-color: rgba(34, 116, 89, 0.25);
  color: var(--accent-strong);
  background: var(--accent-soft);
}

.fixed-task-status.archived {
  color: var(--muted);
  background: var(--surface-soft);
}

.fixed-task-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  color: var(--muted);
  font-size: var(--fs-sm);
}

.fixed-task-note {
  margin: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: var(--fs-sm);
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fixed-task-actions {
  flex: 0 0 auto;
}

.danger-button {
  color: var(--red);
}

.danger-button:hover {
  border-color: var(--red);
  color: var(--red);
  background: var(--red-soft);
}

.form-span-full {
  grid-column: 1 / -1;
}

.modal.fixed-task-editor-modal {
  width: min(1800px, calc(100vw - 48px));
  max-width: none;
}

.fixed-task-editor-card {
  height: min(1000px, calc(100vh - 40px));
  max-height: calc(100vh - 40px);
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
}

.form-grid.fixed-task-form-grid {
  min-height: 0;
  grid-template-columns:
    minmax(260px, 1.35fr)
    minmax(180px, 0.8fr)
    minmax(180px, 0.8fr)
    minmax(460px, 1.7fr);
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px 14px;
  align-items: start;
  overflow-y: auto;
}

.fixed-task-form-grid > label,
.fixed-task-frequency {
  min-width: 0;
}

.fixed-task-frequency {
  display: grid;
  grid-column: 2 / -1;
  gap: 7px;
}

.fixed-task-frequency-tabs {
  width: 100%;
}

.fixed-task-frequency-tabs .segment {
  flex: 1 1 0;
  min-width: 0;
  white-space: nowrap;
}

@media (min-width: 781px) {
  .fixed-task-frequency-tabs {
    width: max-content;
    max-width: 100%;
    /* 频率由 7 个增至 9 个，781~1100px 区间放不下一行时换行，避免横向溢出。 */
    flex-wrap: wrap;
  }

  .fixed-task-frequency-tabs .segment {
    flex: 0 0 76px;
    width: 76px;
  }
}

.fixed-task-frequency-detail {
  display: grid;
  gap: 7px;
  grid-template-columns: 110px 88px minmax(0, 1fr);
  align-items: center;
  padding-top: 5px;
}

.fixed-task-frequency-detail--pair {
  grid-template-columns: 110px 88px 110px 88px;
}

.fixed-task-frequency-detail[hidden] {
  display: none;
}

.fixed-task-frequency-detail .field-label {
  margin: 0;
}

.fixed-task-frequency-detail .control {
  width: 88px;
  max-width: 88px;
}

.fixed-task-frequency-detail .field-help {
  grid-column: 1 / -1;
}

.fixed-task-frequency-detail--multi {
  grid-template-columns: 110px minmax(0, 1fr);
  align-items: start;
}

.fixed-task-choice-group {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.fixed-task-monthday-group {
  display: grid;
  grid-template-columns: repeat(16, 32px);
  gap: 4px;
}

.fixed-task-choice {
  display: inline-grid;
  width: 32px;
  height: 30px;
  min-width: 32px;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  color: var(--muted);
  background: var(--surface);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  line-height: 1;
  cursor: pointer;
}

.fixed-task-choice:hover {
  border-color: var(--accent);
  color: var(--accent-strong);
}

.fixed-task-choice.is-active {
  border-color: var(--accent);
  color: var(--accent-strong);
  background: var(--accent-soft);
}

.fixed-task-choice:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

/* 该月已有选中日期时，月份按钮加一个角标提示，避免用户忘了哪些月选过。 */
.fixed-task-annual-month-group .fixed-task-choice {
  position: relative;
  width: auto;
  min-width: 44px;
  padding: 0 8px;
}

.fixed-task-annual-month-group .fixed-task-choice.has-selection::after {
  content: "";
  position: absolute;
  top: 3px;
  right: 3px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
}

/* 季度参数区：三段「标签 + 控件」并排，比 --pair 多一组。 */
.fixed-task-frequency-detail--triple {
  grid-template-columns: 100px 84px 110px 108px 92px 72px;
}

/* 年度参数区：纵向堆叠（月份行 / 日期行 / 汇总行），不套用横向标签栅格。 */
.fixed-task-frequency-detail--annual {
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 8px;
}

.fixed-task-annual-block {
  display: grid;
  gap: 5px;
}

.fixed-task-annual-day-group {
  display: grid;
  grid-template-columns: repeat(16, 32px);
  gap: 4px;
}

.fixed-task-annual-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.fixed-task-annual-summary {
  margin: 0;
  color: var(--ink);
  font-size: var(--fs-sm);
  line-height: 1.6;
}

.fixed-task-annual-summary.is-empty {
  color: var(--muted);
}

.fixed-task-note-field {
  display: grid;
  min-height: 0;
  grid-template-rows: auto minmax(0, 1fr);
  align-self: stretch;
}

.fixed-task-note-field .textarea {
  height: 100%;
  min-height: 390px;
  resize: none;
}

@media (min-width: 781px) and (max-width: 1180px) {
  .form-grid.fixed-task-form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: auto auto minmax(0, 1fr);
  }

  .fixed-task-frequency {
    grid-column: 1 / -1;
  }
}

.field-help {
  color: var(--muted);
  font-size: var(--fs-sm);
  line-height: 1.45;
}

.fixed-task-log-modal {
  width: min(920px, calc(100vw - 24px));
}

.fixed-task-log-card {
  max-height: calc(100vh - 36px);
  grid-template-rows: auto auto minmax(220px, 1fr);
  overflow: hidden;
}

.fixed-task-log-editor {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.fixed-task-log-editor label {
  display: grid;
  gap: 7px;
}

.fixed-task-log-editor .primary-button {
  min-height: 42px;
}

.fixed-task-log-history {
  display: grid;
  min-height: 0;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
  padding-top: 4px;
  border-top: 1px solid var(--line);
}

.fixed-task-log-history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.fixed-task-log-history-head h4 {
  margin: 0;
  font-size: var(--fs-base);
}

.fixed-task-log-history-head span {
  color: var(--muted);
  font-size: var(--fs-sm);
}

.fixed-task-log-list {
  display: grid;
  min-height: 0;
  gap: 8px;
  align-content: start;
  overflow-y: auto;
}

.fixed-task-log-item {
  display: grid;
  gap: 7px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.fixed-task-log-item > div {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}

.fixed-task-log-item span {
  color: var(--muted);
  font-size: var(--fs-sm);
}

.fixed-task-log-item p {
  margin: 0;
  color: var(--ink);
  font-size: var(--fs-sm);
  line-height: 1.5;
  white-space: pre-wrap;
}

.fixed-task-skip-item {
  border-color: rgba(195, 122, 24, 0.22);
  background: var(--yellow-soft);
}

.fixed-task-skip-item .ghost-button {
  justify-self: start;
  min-height: 28px;
  padding: 0 9px;
}

.modal {
  width: min(720px, calc(100vw - 24px));
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
}

.modal::backdrop {
  background: rgba(17, 25, 22, 0.38);
  backdrop-filter: blur(3px);
}

.modal-card {
  display: grid;
  gap: 16px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.modal-card.small {
  width: min(520px, calc(100vw - 24px));
}

.memo-modal {
  width: min(1040px, calc(100vw - 24px));
}

.memo-card {
  min-height: min(760px, calc(100vh - 36px));
  grid-template-rows: auto auto minmax(420px, 1fr);
}

.modal-head {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.modal-head h3 {
  font-size: var(--fs-lg);
  margin: 4px 0 0;
}

.memo-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.memo-toolbar button {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  color: var(--ink);
  background: var(--surface);
  font-size: var(--fs-base);
  font-weight: var(--fw-medium);
}

.memo-toolbar button:hover {
  border-color: var(--accent);
  color: var(--accent-strong);
}

/* 激活态样式统一在 .document-editor-toolbar 规则块中定义（两处共用）。 */

.memo-editor {
  min-height: 420px;
  padding: 18px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  line-height: 1.7;
  outline: none;
  overflow-y: auto;
}

.memo-editor:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(34, 116, 89, 0.14);
}

.memo-editor h3,
.memo-editor h4,
.memo-editor p {
  margin: 0 0 10px;
}

.memo-editor ul,
.memo-editor ol {
  margin: 0 0 10px 24px;
}

.memo-check-row {
  display: flex;
  align-items: center;
  min-height: 30px;
  margin: 0 0 8px;
}

.memo-check-row label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.memo-check-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.memo-check-row input[type="checkbox"]:checked + span {
  color: var(--muted);
  text-decoration: line-through;
}

.document-toolbar {
  display: grid;
  /* 5 个控件：搜索 / 分类 / 排序 / 状态 / 导入。
     搜索占宽一些，其余按内容收缩，最后一列固定给导入按钮。 */
  grid-template-columns: minmax(200px, 1.4fr) minmax(160px, 0.9fr) minmax(130px, 0.7fr) auto auto;
  gap: 12px;
  align-items: end;
}

.file-upload-button {
  gap: 7px;
  cursor: pointer;
}

.file-upload-button input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
}

.files-workspace {
  display: grid;
  grid-template-columns: minmax(380px, 0.88fr) minmax(0, 1.65fr);
  gap: 14px;
  min-height: min(690px, calc(100vh - 280px));
}

.files-upload-panel,
.files-list-panel {
  display: flex;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  overflow: hidden;
}

.files-upload-panel .compact-head,
.files-list-panel .compact-head {
  flex: 0 0 auto;
}

.files-count {
  display: inline-flex;
  min-width: 24px;
  height: 22px;
  align-items: center;
  justify-content: center;
  margin-left: 5px;
  padding: 0 6px;
  border-radius: 11px;
  color: var(--accent-strong);
  background: var(--accent-soft);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  vertical-align: 2px;
}

.files-queue-status {
  color: var(--muted);
  font-size: var(--fs-sm);
}

.files-upload-list,
.files-list {
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: thin;
}

.file-upload-row,
.user-file-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px 82px;
  align-items: center;
  gap: 14px;
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
}

.file-row-main {
  display: grid;
  min-width: 0;
  gap: 5px;
}

.file-row-main strong {
  overflow: hidden;
  color: var(--ink);
  font-size: var(--fs-base);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-row-main span {
  color: var(--muted);
  font-size: var(--fs-sm);
}

.file-progress-track {
  height: 7px;
  overflow: hidden;
  border-radius: 4px;
  background: var(--line);
}

.file-progress-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 160ms ease;
}

.file-upload-status {
  color: var(--muted);
  font-size: var(--fs-sm);
  text-align: right;
  white-space: nowrap;
}

.file-upload-row.done .file-upload-status {
  color: var(--accent-strong);
}

.file-upload-row.failed .file-upload-status,
.file-upload-row.too-large .file-upload-status {
  color: var(--red);
}

.file-upload-row.failed .file-progress-track span,
.file-upload-row.too-large .file-progress-track span {
  background: var(--danger, #b04444);
}

.user-file-row {
  grid-template-columns: minmax(0, 1fr) auto;
}

.file-row-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.danger-button {
  color: var(--red);
}

body.is-files-view .main {
  max-width: none;
}

body.is-files-view .topbar {
  min-height: 44px;
  margin-bottom: 14px;
}

body.is-files-view .topbar > div:first-child {
  display: flex;
  min-width: 0;
  align-items: baseline;
  gap: 12px;
}

body.is-files-view .topbar > div:first-child .eyebrow {
  order: 2;
  margin: 0;
  white-space: nowrap;
}

body.is-files-view .topbar > div:first-child h2 {
  order: 1;
  margin: 0;
}

body.is-files-view #filesView {
  gap: 14px;
}

.document-topbar-new {
  display: none;
}

body.is-documents-view .main {
  max-width: none;
}

body.is-documents-view .topbar {
  min-height: 44px;
  margin-bottom: 14px;
}

body.is-documents-view .topbar > div:first-child {
  display: flex;
  min-width: 0;
  align-items: baseline;
  gap: 12px;
}

body.is-documents-view .topbar > div:first-child .eyebrow {
  order: 2;
  margin: 0;
  white-space: nowrap;
}

body.is-documents-view .topbar > div:first-child h2 {
  order: 1;
  margin: 0;
}

body.is-documents-view .document-topbar-new {
  display: inline-flex;
}

body.is-documents-view #documentsView > .document-toolbar {
  margin-top: 0;
}

.document-toolbar label,
.document-scope-wrap,
.document-category-filter,
.document-import-wrap {
  display: grid;
  gap: 6px;
  min-width: 0;
}

/* Markdown 导入：按钮与其它筛选控件同一行，高度对齐。
   用 justify-items: start + 固定宽度，避免 grid 把按钮拉满整列。 */
.document-import-wrap {
  justify-items: start;
}

.document-import-wrap .ghost-button {
  width: auto;
  min-width: 0;
  min-height: 38px;
  padding: 0 14px;
  font-size: var(--fs-base);
  white-space: nowrap;
}

.document-category-control {
  display: flex;
  gap: 6px;
  min-width: 0;
}

.document-category-control .control {
  min-width: 0;
  flex: 1;
}

.document-category-control .icon-button {
  flex: 0 0 38px;
  min-height: 38px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.document-scope-wrap .segmented {
  min-height: 38px;
}

.document-workspace {
  display: grid;
  grid-template-columns: minmax(260px, 0.82fr) minmax(190px, 0.5fr) minmax(0, 2fr);
  gap: 12px;
  height: min(720px, calc(100vh - 250px));
  min-height: 520px;
}

.document-list-panel,
.document-outline-panel,
.document-preview-panel {
  min-width: 0;
  min-height: 0;
}

.document-list-panel,
.document-outline-panel {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.document-list-panel .compact-head {
  flex: 0 0 auto;
}

.document-list,
.document-outline {
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: thin;
}

.document-outline-head {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.document-outline-head h3 {
  margin: 4px 0 0;
  font-size: var(--fs-md);
}

.document-outline-head .eyebrow {
  margin: 0;
}

.document-depth-control {
  min-width: 62px;
}

.document-depth-control .control {
  min-height: 32px;
  padding: 0 7px;
  font-size: var(--fs-sm);
}

.document-outline {
  display: grid;
  align-content: start;
  gap: 2px;
  padding-top: 10px;
}

.document-outline-item {
  min-width: 0;
  padding: 7px 8px;
  border: 0;
  border-left: 2px solid transparent;
  color: var(--muted);
  background: transparent;
  font-size: var(--fs-base);
  line-height: 1.35;
  overflow: hidden;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.document-outline-item:hover {
  border-left-color: var(--accent);
  color: var(--accent-strong);
  background: var(--accent-soft);
}

.document-outline-item.level-2 { padding-left: 16px; }
.document-outline-item.level-3 { padding-left: 24px; }
.document-outline-item.level-4 { padding-left: 32px; }
.document-outline-item.level-5 { padding-left: 40px; }

.document-category-list {
  display: grid;
  gap: 8px;
  max-height: min(420px, 55vh);
  overflow-y: auto;
}

.document-category-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 7px;
  align-items: center;
}

.document-category-row .control {
  min-width: 0;
}

.document-count {
  color: var(--muted);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
}

.document-list {
  display: grid;
  gap: 8px;
}

.document-list-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.document-list-item.is-selected {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.document-select {
  display: grid;
  min-width: 0;
  gap: 5px;
  padding: 0;
  border: 0;
  color: var(--ink);
  background: transparent;
  text-align: left;
}

.document-list-title {
  overflow: hidden;
  font-weight: var(--fw-medium);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.document-list-meta,
.document-list-summary,
.document-preview-head p {
  color: var(--muted);
  font-size: var(--fs-sm);
}

.document-list-summary {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.document-list-tags,
.document-preview-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.document-list-tags .tag,
.document-preview-tags .tag {
  padding: 2px 6px;
  font-size: var(--fs-sm);
}

.document-list-actions {
  align-self: center;
}

.document-preview-panel {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  overflow: hidden;
}

.document-preview-head {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  justify-content: space-between;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.document-preview-head h3 {
  margin: 10px 0 4px;
  font-size: var(--fs-xl);
}

.document-preview-head p,
.document-preview-summary {
  margin: 0;
}

.document-preview-summary {
  margin-top: 16px;
  padding: 12px 14px;
  border-left: 3px solid var(--accent);
  color: var(--muted);
  background: var(--surface-soft);
  line-height: 1.6;
}

.document-preview-content {
  min-height: 0;
  padding-top: 20px;
  line-height: 1.75;
  overflow-wrap: anywhere;
  overflow-y: auto;
  scrollbar-width: thin;
}

.document-preview-content h1,
.document-preview-content h2,
.document-preview-content h3,
.document-preview-content h4,
.document-preview-content h5,
.document-preview-content p {
  margin: 0 0 12px;
  scroll-margin-top: 12px;
}

.document-preview-content ul,
.document-preview-content ol {
  margin: 0 0 12px 24px;
}

.document-preview-content a {
  color: var(--accent-strong);
}

.document-modal {
  width: calc(100vw - 24px);
  max-width: none;
}

.document-card {
  min-height: min(900px, calc(100vh - 28px));
  max-height: calc(100vh - 28px);
  grid-template-rows: auto auto minmax(0, 1fr) auto;
}

.document-editor-layout {
  display: grid;
  grid-template-columns: minmax(190px, 0.38fr) minmax(0, 1.62fr);
  gap: 12px;
  min-height: 0;
}

.document-editor-outline-panel {
  min-width: 0;
  min-height: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  overflow: hidden;
}

.document-editor-outline-panel .document-outline {
  max-height: 100%;
}

.document-editor-pane {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-width: 0;
  min-height: 0;
  gap: 8px;
}

.document-editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.document-editor-toolbar button {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  color: var(--ink);
  background: var(--surface);
  font-size: var(--fs-base);
  font-weight: var(--fw-medium);
}

.document-editor-toolbar button:hover {
  border-color: var(--accent);
  color: var(--accent-strong);
}

/* 工具栏按钮激活态：光标所在位置已应用该格式时高亮，与 Word / Notion 一致。
   由 app.js 的 syncRichTextToolbarState 通过 .is-active + aria-pressed 同步。 */
.document-editor-toolbar button.is-active,
.memo-toolbar button.is-active {
  border-color: var(--accent);
  color: var(--accent-strong);
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px rgba(34, 116, 89, 0.28);
}

.document-editor-toolbar button.is-active:hover,
.memo-toolbar button.is-active:hover {
  background: var(--accent-soft);
}

.document-block-level,
.document-color-control {
  min-height: 32px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  color: var(--ink);
  background: var(--surface);
  font-size: var(--fs-base);
  font-weight: var(--fw-medium);
}

.document-block-level {
  padding: 0 8px;
}

.document-color-control {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  padding: 0 7px;
}

.document-color-control input {
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.document-editor-scroll {
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: thin;
}

.document-editor {
  min-height: 600px;
  padding: 18px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  line-height: 1.7;
  outline: none;
  overflow-y: auto;
}

.document-editor:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(34, 116, 89, 0.14);
}

.document-editor h1,
.document-editor h2,
.document-editor h3,
.document-editor h4,
.document-editor h5,
.document-editor p {
  margin: 0 0 10px;
  scroll-margin-top: 12px;
}

.document-editor ul,
.document-editor ol {
  margin: 0 0 10px 24px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.form-grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding-top: 4px;
}

.danger {
  margin-right: auto;
  color: var(--red);
}

.danger:hover {
  border-color: var(--red);
  color: var(--red);
  background: var(--red-soft);
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 10;
  max-width: min(380px, calc(100vw - 44px));
  padding: 12px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  color: var(--ink);
  background: var(--surface);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.empty-state {
  padding: 22px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.54);
  text-align: center;
}

body[data-theme="blue"] {
  --bg: #f3f7fb;
  --surface-soft: #e8f0f7;
  --accent: #2f6690;
  --accent-strong: #1f5278;
  --accent-soft: #deedf7;
}

body[data-theme="amber"] {
  --bg: #fffaf2;
  --surface-soft: #fff1dc;
  --accent: #b36b18;
  --accent-strong: #8e4f0b;
  --accent-soft: #ffebc8;
}

body[data-theme="rose"] {
  --bg: #fff6f7;
  --surface-soft: #fbe9ec;
  --accent: #b5485d;
  --accent-strong: #913447;
  --accent-soft: #f8dfe5;
}

body[data-theme="teal"] {
  --bg: #f2f9f8;
  --surface-soft: #e4f2f0;
  --accent: #1c7a72;
  --accent-strong: #135f59;
  --accent-soft: #dcf0ee;
}

body[data-theme="cyan"] {
  --bg: #f2fafc;
  --surface-soft: #e2f3f8;
  --accent: #12809e;
  --accent-strong: #0b647c;
  --accent-soft: #d9eff7;
}

body[data-theme="azure"] {
  --bg: #f3f8ff;
  --surface-soft: #e5eeff;
  --accent: #2563c9;
  --accent-strong: #1a4ba1;
  --accent-soft: #dde9fd;
}

body[data-theme="indigo"] {
  --bg: #f5f5fc;
  --surface-soft: #e9e9f8;
  --accent: #4d55b8;
  --accent-strong: #383f96;
  --accent-soft: #e2e3f7;
}

body[data-theme="violet"] {
  --bg: #f8f6fd;
  --surface-soft: #eee9fa;
  --accent: #6f4fbe;
  --accent-strong: #563a9b;
  --accent-soft: #e9e1f8;
}

body[data-theme="purple"] {
  --bg: #faf6fc;
  --surface-soft: #f2e8f8;
  --accent: #8a3fa8;
  --accent-strong: #6c2e86;
  --accent-soft: #efdff7;
}

body[data-theme="magenta"] {
  --bg: #fcf5fa;
  --surface-soft: #f8e6f2;
  --accent: #a8357f;
  --accent-strong: #862663;
  --accent-soft: #f6dcee;
}

body[data-theme="pink"] {
  --bg: #fdf5f8;
  --surface-soft: #fbe7ef;
  --accent: #bf3f74;
  --accent-strong: #9c2c5b;
  --accent-soft: #f9dde8;
}

body[data-theme="coral"] {
  --bg: #fef7f4;
  --surface-soft: #fdeae2;
  --accent: #c05a3c;
  --accent-strong: #9c4227;
  --accent-soft: #fbded3;
}

body[data-theme="crimson"] {
  --bg: #fdf5f5;
  --surface-soft: #fbe6e6;
  --accent: #b3303a;
  --accent-strong: #8e2029;
  --accent-soft: #f9dcdd;
}

body[data-theme="brown"] {
  --bg: #faf7f3;
  --surface-soft: #f3ece2;
  --accent: #7d5a3c;
  --accent-strong: #5f422a;
  --accent-soft: #efe4d6;
}

body[data-theme="olive"] {
  --bg: #f8f8f0;
  --surface-soft: #eeeeda;
  --accent: #6b7434;
  --accent-strong: #525a24;
  --accent-soft: #e8e9d2;
}

body[data-theme="lime"] {
  --bg: #f8fbf1;
  --surface-soft: #eef5dc;
  --accent: #5b8a1f;
  --accent-strong: #446b12;
  --accent-soft: #e6f1d2;
}

body[data-theme="emerald"] {
  --bg: #f1faf6;
  --surface-soft: #e0f4ea;
  --accent: #128a5f;
  --accent-strong: #0a6c49;
  --accent-soft: #d7f0e4;
}

body[data-theme="slate"] {
  --bg: #f6f7f9;
  --surface-soft: #eceef2;
  --accent: #4a5568;
  --accent-strong: #353e4d;
  --accent-soft: #e3e7ed;
}

body[data-theme="steel"] {
  --bg: #f5f7f8;
  --surface-soft: #e8edef;
  --accent: #3f6b78;
  --accent-strong: #2c515c;
  --accent-soft: #dde8ec;
}

body[data-theme] {
  background: var(--bg);
}

.app-shell {
  grid-template-columns: 220px minmax(0, 1fr);
}

body.is-objectives-view .main {
  max-width: none;
}

body.is-objectives-view .topbar {
  width: min(100%, 1920px);
  padding-left: 216px;
}

#objectivesView.is-visible {
  width: min(100%, 1920px);
  grid-template-columns: 200px minmax(0, 1fr);
  grid-template-rows: auto auto minmax(0, 1fr);
  column-gap: 18px;
  row-gap: 14px;
  align-items: start;
}

#objectivesView .page-head,
#objectivesView .objective-filter-row,
#objectivesView #objectiveList {
  grid-column: 2;
  min-width: 0;
}

#objectivesView .page-head {
  grid-row: 1;
  margin-bottom: 0;
  padding: 0 0 10px;
  border-bottom: 1px solid var(--line);
}

#objectivesView .objective-filter-row {
  grid-row: 2;
}

#objectivesView #objectiveList {
  grid-row: 3;
}

.objective-outline-toggle {
  display: none;
}

.objective-outline {
  grid-column: 1;
  grid-row: 1 / span 3;
  width: 200px;
  min-height: 0;
  height: calc(100vh - 118px);
  max-height: calc(100vh - 118px);
  padding-right: 12px;
  top: 0;
}

.objective-outline-head > div {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
}

.objective-outline-head > div > span {
  display: inline-grid;
  min-width: 24px;
  min-height: 24px;
  place-items: center;
  padding: 0 6px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  color: var(--accent-strong);
  background: var(--accent-soft);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
}

.objective-outline-close {
  display: none;
}

.objective-cycle-meta {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: var(--fs-base);
  white-space: nowrap;
}

.objective-filter-row {
  display: flex;
  min-height: 44px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 0;
  margin: 0 0 14px;
}

.objective-stat-line {
  display: flex;
  flex: 1 1 auto;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  color: var(--muted);
  font-size: var(--fs-base);
  white-space: nowrap;
}

.objective-stat-line span {
  display: inline-flex;
  gap: 5px;
  align-items: center;
}

.objective-stat-line strong {
  color: var(--ink);
  font-size: var(--fs-base);
}

.objective-toolbar {
  flex: 0 0 auto;
  flex-wrap: nowrap;
}

.objective-toolbar .filter-inline.small {
  width: 150px;
}

.objective-card--full .objective-summary {
  padding: 15px 18px 14px;
}

/* 原此处给 OKR 卡片加了 0 6px 18px 投影，已按需求去掉。 */

.objective-boundary {
  min-height: 40px;
  padding: 6px 18px;
  background: var(--surface-soft);
}

.objective-boundary-main {
  gap: 8px;
}

.objective-boundary-count {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  white-space: nowrap;
}

.objective-title h4 {
  font-size: var(--fs-md);
  line-height: 1.35;
}

.objective-title p {
  margin-top: 4px;
  font-size: var(--fs-base);
}

.objective-meta-line {
  display: block;
  margin-top: 8px;
}

.objective-context {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.objective-actions {
  display: grid;
  flex: 0 0 auto;
  justify-content: end;
  align-items: center;
}

.objective-actions > .file-action {
  grid-column: 1;
  grid-row: 1;
}

.objective-actions > [data-edit-objective] {
  grid-column: 2;
  grid-row: 1;
}

.objective-actions > [data-complete-objective],
.objective-actions > [data-restore-objective],
.objective-actions > [data-unhide-objective] {
  grid-column: 3;
  grid-row: 1;
}

.objective-actions > [data-open-objective-memo] {
  grid-column: 1;
  grid-row: 2;
}

.objective-actions > [data-copy-objective] {
  grid-column: 2;
  grid-row: 2;
}

.objective-actions > [data-add-kr] {
  grid-column: 3;
  grid-row: 2;
}

.objective-actions > [data-delete-objective] {
  grid-column: 4;
  grid-row: 2;
}

.kr-actions {
  display: grid;
  justify-content: end;
  align-items: center;
}

.objective-progress-row,
.kr-progress-row {
  display: grid;
  gap: 20px;
  align-items: center;
}

.objective-progress-row {
  grid-template-columns: minmax(0, 1fr) minmax(250px, auto);
  margin-top: 12px;
}

.objective-progress-row > .progress-line {
  width: min(100%, 50%);
  min-width: 300px;
}

.objective-schedule-range,
.kr-inline-meta {
  justify-content: flex-end;
}

.objective-progress-row .schedule-range {
  min-width: 250px;
}

.progress-label strong {
  color: var(--ink);
  font-size: var(--fs-base);
}

/* KR 进度条只有一个百分比数字，.progress-label 的 space-between 会把它顶到最左边；
   O 进度条有「平均完成度 + 百分比」两个子元素，百分比落在最右边。
   宽屏（>1360px）时 KR 是纵向布局：数字在上、进度条在下，此时让数字撑满整行右对齐，
   与 O 进度条的百分比位置一致。
   注意：≤1360px 时 .kr-completion-cell 变成三列横向布局（52px 数字列 + 进度条 + 小任务数），
   数字列本身就固定在进度条左侧，属于该布局的既定位置，不适用此规则。 */
@media (min-width: 1361px) {
  .kr-completion-cell .progress-label .kr-progress-value {
    flex: 1 1 auto;
    text-align: right;
  }
}

/* KR 进度条只有一个百分比数字，.progress-label 的 space-between 会把它顶到最左边；
   O 进度条有「平均完成度 + 百分比」两个子元素，百分比落在最右边。
   宽屏（>1360px）时 KR 是纵向布局：数字在上、进度条在下，此时让数字撑满整行右对齐，
   与 O 进度条的百分比位置一致。
   注意：≤1360px 时 .kr-completion-cell 变成三列横向布局（52px 数字列 + 进度条 + 小任务数），
   数字列本身就固定在进度条左侧，属于该布局的既定位置，不适用此规则。 */
@media (min-width: 1361px) {
  .kr-completion-cell .progress-label .kr-progress-value {
    flex: 1 1 auto;
    text-align: right;
  }
}

.action-badge {
  display: inline-grid;
  min-width: 17px;
  height: 17px;
  margin-left: 4px;
  place-items: center;
  border-radius: 50%;
  color: var(--text-inverse);
  background: var(--red);
  font-size: var(--fs-2xs);
  line-height: 1;
}

.action-menu-popover {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 20;
  display: grid;
  min-width: 104px;
  gap: 4px;
  padding: 6px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 12px 28px rgba(30, 48, 38, 0.14);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
  transition: opacity 140ms ease, transform 140ms ease;
}

.action-menu-popover .mini-button {
  width: 100%;
  text-align: left;
}

.kr-row {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
}

.kr-main {
  min-width: 0;
}

.kr-main h5 {
  margin-bottom: 7px;
}

.kr-progress-row {
  grid-template-columns: minmax(0, 1fr) minmax(250px, auto);
}

.kr-inline-meta {
  display: flex;
  min-width: 250px;
  gap: 8px;
  align-items: center;
}

.kr-task-count {
  color: var(--muted);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  white-space: nowrap;
}

/* 完成时间徽章（2.19）：KR 行、O 卡片头部共用。
   旧数据补记的完成时间用虚线边框 + 次要色区分，避免和真实完成时间混淆。 */
.completion-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 8px;
  border: 1px solid var(--accent-soft);
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  line-height: 1.6;
  white-space: nowrap;
}

.completion-badge small {
  color: var(--muted);
  font-size: inherit;
  font-weight: var(--fw-normal);
}

.completion-badge.is-backfilled {
  border-style: dashed;
  border-color: var(--line);
  background: transparent;
  color: var(--muted);
}

.kr-row-tools {
  align-self: center;
}

.kr-task-summary {
  margin-top: 8px;
}

.kr-task-items {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  min-width: 0;
  overflow: hidden;
}

.kr-task-chip {
  flex: 0 1 auto;
  min-width: 0;
  max-width: 240px;
  overflow: hidden;
  padding: 4px 7px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--muted);
  background: var(--surface);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  text-overflow: ellipsis;
  white-space: nowrap;
}

button.kr-task-chip {
  cursor: pointer;
}

button.kr-task-chip:hover {
  border-color: var(--accent);
  color: var(--accent-strong);
}

.objective-files-modal {
  width: min(980px, calc(100vw - 24px));
}

.objective-files-card {
  min-height: min(680px, calc(100vh - 36px));
  grid-template-rows: auto auto minmax(280px, 1fr) auto;
}

/* OKR 操作弹窗统一尺寸：参考管理 OKR 文件弹窗 980×680，
   宽 +50% → 1470px，高 +30% → 884px；超出视口时按视口收缩。 */
.modal.okr-action-modal {
  width: min(1470px, calc(100vw - 24px));
  max-width: none;
}

.okr-action-card {
  width: 100%;
  height: min(884px, calc(100vh - 36px));
  min-height: 0;
  max-height: calc(100vh - 36px);
  overflow-y: auto;
}

.objective-files-manager-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: var(--fs-base);
}

.objective-files-upload {
  width: fit-content;
  cursor: pointer;
}

.objective-file-manager-list {
  display: grid;
  min-height: 0;
  gap: 8px;
  align-content: start;
  overflow-y: auto;
  padding: 2px;
}

.objective-file-manager-row {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.objective-file-manager-main {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.objective-file-manager-main a {
  overflow: hidden;
  color: var(--accent-strong);
  font-weight: var(--fw-medium);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.objective-file-manager-main span {
  color: var(--muted);
  font-size: var(--fs-sm);
}

.theme-options {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.theme-option {
  display: grid;
  gap: 10px;
  min-height: 112px;
  align-content: center;
  justify-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--surface);
}

.theme-option:hover,
.theme-option.is-active {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.theme-option.is-active {
  box-shadow: inset 0 0 0 2px var(--accent);
}

.theme-swatch {
  width: 38px;
  height: 38px;
  border-radius: 50%;
}

.theme-swatch-green { background: #227459; }
.theme-swatch-blue { background: #2f6690; }
.theme-swatch-amber { background: #b36b18; }
.theme-swatch-rose { background: #b5485d; }
.theme-swatch-teal { background: #1c7a72; }
.theme-swatch-cyan { background: #12809e; }
.theme-swatch-azure { background: #2563c9; }
.theme-swatch-indigo { background: #4d55b8; }
.theme-swatch-violet { background: #6f4fbe; }
.theme-swatch-purple { background: #8a3fa8; }
.theme-swatch-magenta { background: #a8357f; }
.theme-swatch-pink { background: #bf3f74; }
.theme-swatch-coral { background: #c05a3c; }
.theme-swatch-crimson { background: #b3303a; }
.theme-swatch-brown { background: #7d5a3c; }
.theme-swatch-olive { background: #6b7434; }
.theme-swatch-lime { background: #5b8a1f; }
.theme-swatch-emerald { background: #128a5f; }
.theme-swatch-slate { background: #4a5568; }
.theme-swatch-steel { background: #3f6b78; }

@media (max-width: 1180px) {
  #objectivesView.is-visible {
    grid-template-columns: minmax(0, 1fr);
  }

  #objectivesView .page-head,
  #objectivesView .objective-filter-row,
  #objectivesView #objectiveList {
    grid-column: 1;
  }

  #objectivesView .page-head { grid-row: 2; }
  #objectivesView .objective-filter-row { grid-row: 3; }
  #objectivesView #objectiveList { grid-row: 4; }

  .objective-outline-toggle {
    display: inline-flex;
    grid-column: 1;
    grid-row: 1;
    width: fit-content;
    min-height: 34px;
    align-items: center;
    gap: 7px;
    padding: 0 10px;
    font-size: var(--fs-base);
  }

  .objective-outline {
    position: fixed;
    top: 18px;
    bottom: 18px;
    left: 220px;
    z-index: 40;
    display: grid;
    width: min(300px, calc(100vw - 250px));
    height: auto;
    max-height: none;
    padding: 12px;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    background: var(--surface);
    /* 按需求去掉目标目录面板投影。 */
    opacity: 0;
    pointer-events: none;
    transform: translateX(-110%);
    transition: opacity 160ms ease, transform 160ms ease;
  }

  body.is-objective-outline-open .objective-outline {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(0);
  }

  .objective-outline-close {
    display: inline-grid;
    width: 30px;
    height: 30px;
    min-height: 30px;
  }

  body.is-objective-outline-open::after {
    position: fixed;
    inset: 0;
    z-index: 30;
    background: rgba(17, 25, 22, 0.2);
    content: "";
  }

  .objective-filter-row {
    align-items: flex-start;
  }
}

@media (max-width: 780px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  body.is-objectives-view .topbar {
    padding-left: 0;
  }

  .objective-stat-line {
    gap: 10px;
    overflow: hidden;
    font-size: var(--fs-sm);
  }

  .objective-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .objective-progress-row .schedule-range,
  .kr-inline-meta {
    min-width: 0;
    justify-content: flex-start;
  }

  .kr-row {
    grid-template-columns: 18px minmax(0, 1fr);
  }

  .kr-row-tools {
    grid-column: 2;
    grid-row: 2;
    width: 100%;
  }

  .objective-files-manager-head,
  .objective-file-manager-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .objective-files-upload,
  .objective-file-manager-row .mini-button {
    width: 100%;
  }
}

/* 固定任务顶栏：将统计、筛选和新增入口并入全局页面顶栏。 */
body:not(.is-fixed-tasks-view) .fixed-task-summary,
body:not(.is-fixed-tasks-view) .fixed-task-toolbar {
  display: none;
}

body.is-fixed-tasks-view .topbar {
  align-items: center;
  gap: 18px;
  min-height: 44px;
  margin-bottom: 14px;
}

body.is-fixed-tasks-view .topbar > div:first-child h2 {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

body.is-fixed-tasks-view .topbar > div:first-child {
  min-width: 0;
  flex: 0 0 auto;
}

/* 固定任务顶栏：统计、筛选、新增与导入导出统一垂直居中，并整体靠左起排。
   此前 .topbar-actions 用 flex-end、统计项用 baseline、工具组用 flex-end，
   三套对齐基准并存，导致统计项整体比其它元素低约 9.5px。 */
body.is-fixed-tasks-view .topbar-actions {
  min-width: 0;
  flex: 1 1 auto;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
}

body.is-fixed-tasks-view .data-transfer-actions {
  order: 3;
  align-self: center;
  flex: 0 0 auto;
}

/* 统计项改为纯文字：去掉外框、圆角和底色，整组靠左。
   基础规则 .fixed-task-summary-item 带 1px 边框 + 8px 圆角 + 白底，
   固定任务视图此前只覆盖了 border-right，四周边框和圆角仍在，视觉上像个圈。 */
body.is-fixed-tasks-view .fixed-task-summary {
  display: flex;
  min-width: 0;
  flex: 1 1 auto;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-start;
  gap: 20px;
  margin: 0;
  white-space: nowrap;
}

body.is-fixed-tasks-view .fixed-task-summary-item {
  display: inline-flex;
  min-height: 0;
  align-items: center;
  gap: 5px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font-size: var(--fs-base);
  white-space: nowrap;
}

body.is-fixed-tasks-view .fixed-task-summary-item > span {
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
}

body.is-fixed-tasks-view .fixed-task-summary-item strong {
  margin: 0;
  color: var(--ink);
  font-size: var(--fs-base);
  line-height: 1;
}

body.is-fixed-tasks-view .fixed-task-toolbar {
  display: flex;
  min-width: 0;
  order: 2;
  flex: 0 0 auto;
  flex-wrap: nowrap;
  align-items: center;
  gap: 7px;
}

#fixedTasksView .fixed-task-sort-button {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 0;
  border: 0;
  color: inherit;
  background: transparent;
  font: inherit;
  line-height: inherit;
  cursor: pointer;
}

#fixedTasksView .fixed-task-sort-button:hover,
#fixedTasksView .fixed-task-sort-button.is-active {
  color: var(--accent-strong);
}

#fixedTasksView .fixed-task-sort-icon {
  color: var(--muted);
  font-size: 10px;
  line-height: 1;
}

#fixedTasksView .fixed-task-sort-button.is-active .fixed-task-sort-icon {
  color: var(--accent);
}

#fixedTasksView .fixed-task-sort-button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.fixed-task-sort-mobile {
  display: none;
  position: relative;
}

.fixed-task-sort-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 80;
  display: grid;
  width: 190px;
  gap: 2px;
  padding: 6px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 10px 24px rgba(25, 42, 32, 0.14);
}

.fixed-task-sort-menu[hidden] {
  display: none;
}

.fixed-task-sort-menu button {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 8px;
  border: 0;
  border-radius: 6px;
  color: var(--ink);
  background: transparent;
  font-size: var(--fs-base);
  text-align: left;
  cursor: pointer;
}

.fixed-task-sort-menu button:hover,
.fixed-task-sort-menu button.is-active {
  color: var(--accent-strong);
  background: var(--accent-soft);
}

@media (max-width: 1220px) {
  .fixed-task-sort-mobile {
    display: flex;
    align-items: center;
  }
}

@media (max-width: 780px) {
  .fixed-task-sort-mobile {
    width: 100%;
    justify-content: flex-end;
  }
}

body.is-fixed-tasks-view .fixed-task-toolbar .segmented {
  height: 38px;
  min-height: 38px;
  align-items: center;
}

body.is-fixed-tasks-view .fixed-task-toolbar .segment {
  min-width: 0;
  padding: 0 9px;
  font-size: var(--fs-base);
  white-space: nowrap;
}

body.is-fixed-tasks-view .fixed-task-toolbar .primary-button {
  min-height: 38px;
  padding: 0 11px;
  font-size: var(--fs-base);
  white-space: nowrap;
}

body.is-fixed-tasks-view #fixedTasksView {
  gap: 10px;
}

@media (max-width: 1360px) {
  body.is-fixed-tasks-view .topbar-actions {
    flex-wrap: wrap;
  }

  body.is-fixed-tasks-view .fixed-task-summary {
    flex: 1 1 100%;
    justify-content: flex-start;
  }

  body.is-fixed-tasks-view .fixed-task-toolbar {
    margin-left: auto;
  }

  body.is-fixed-tasks-view .data-transfer-actions {
    order: 3;
  }
}

@media (max-width: 780px) {
  body.is-fixed-tasks-view .topbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 7px;
  }

  body.is-fixed-tasks-view .topbar > div:first-child {
    display: flex;
    min-width: 0;
    align-items: baseline;
    gap: 8px;
  }

  body.is-fixed-tasks-view .topbar > div:first-child .eyebrow {
    display: block;
    margin: 0;
    font-size: var(--fs-2xs);
    white-space: nowrap;
  }

  body.is-fixed-tasks-view .topbar-actions {
    width: 100%;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 6px;
  }

  body.is-fixed-tasks-view .data-transfer-actions {
    order: 3;
    margin-left: auto;
  }

  body.is-fixed-tasks-view .fixed-task-summary {
    width: 100%;
    flex: 1 1 100%;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 5px 0;
  }

  body.is-fixed-tasks-view .fixed-task-summary-item {
    flex: 1 1 42%;
    padding: 0 5px;
    font-size: var(--fs-base);
  }

  body.is-fixed-tasks-view .fixed-task-summary-item strong {
    font-size: var(--fs-md);
  }

  body.is-fixed-tasks-view .fixed-task-toolbar {
    width: 100%;
    flex: 1 1 100%;
    flex-wrap: wrap;
    margin-left: 0;
  }

  body.is-fixed-tasks-view .fixed-task-toolbar .segmented {
    max-width: 100%;
    overflow-x: auto;
  }

  body.is-fixed-tasks-view .fixed-task-toolbar .segment {
    padding: 0 7px;
    font-size: var(--fs-base);
  }

  body.is-fixed-tasks-view .fixed-task-toolbar .primary-button {
    font-size: var(--fs-base);
  }
}

/* OKR 行内图标操作：中文提示同时支持鼠标悬停和键盘聚焦。 */
#objectivesView .icon-action {
  position: relative;
  display: inline-grid;
  width: 36px;
  min-width: 36px;
  height: 36px;
  min-height: 36px;
  flex: 0 0 36px;
  place-items: center;
  padding: 0;
  color: var(--muted);
}

/* O/KR 的行内操作统一为白底图标，主操作不再用浅绿底突出。 */
#objectivesView .icon-action.primary {
  color: var(--muted);
  border-color: var(--line-strong);
  background: var(--surface);
}

#objectivesView .icon-action.primary:hover,
#objectivesView .icon-action.primary:focus-visible {
  color: var(--accent-strong);
  border-color: var(--accent);
  background: var(--surface);
}

#objectivesView .icon-action svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

#objectivesView .icon-action:hover,
#objectivesView .icon-action:focus-visible {
  color: var(--accent-strong);
}

#objectivesView .icon-action.danger-button,
#objectivesView .icon-action.danger-button:hover,
#objectivesView .icon-action.danger-button:focus-visible {
  color: var(--red);
}

#objectivesView .icon-action.danger-button:hover,
#objectivesView .icon-action.danger-button:focus-visible {
  border-color: var(--red);
  background: var(--red-soft);
}

#objectivesView .icon-action[data-tooltip]::after {
  position: absolute;
  top: calc(100% + 7px);
  left: 50%;
  z-index: 60;
  width: max-content;
  max-width: min(220px, 70vw);
  padding: 5px 8px;
  border-radius: 6px;
  color: var(--text-inverse);
  background: #26332e;
  content: attr(data-tooltip);
  font-size: var(--fs-sm);
  font-weight: var(--fw-normal);
  line-height: 1.35;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -2px);
  transition: opacity 120ms ease, transform 120ms ease;
  white-space: nowrap;
}

#objectivesView .icon-action:hover::after,
#objectivesView .icon-action:focus-visible::after {
  opacity: 1;
  transform: translate(-50%, 0);
}

#objectivesView .icon-action:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

#objectivesView .icon-action:disabled,
#objectivesView .icon-action[aria-disabled="true"] {
  opacity: 0.45;
  cursor: not-allowed;
}

#objectivesView .icon-action:disabled::after,
#objectivesView .icon-action[aria-disabled="true"]::after {
  display: none;
}

@media (max-width: 780px) {
  #objectivesView .icon-action {
    width: 40px;
    min-width: 40px;
    height: 40px;
    min-height: 40px;
    flex-basis: 40px;
  }
}

/* 宽屏 KR 信息列对齐参考图；较窄视口改为带字段名的纵向信息块。 */
#objectivesView .kr-table-head {
  display: none;
}

@media (min-width: 1361px) {
  #objectivesView .kr-table-head {
    display: grid;
    /* 与 .kr-row 的 6 轨对应（首列 18px 拖动列由 padding-left 40px 让位）：
       关键结果 | 负责人·权重 | 起止日期 | 完成度 | 操作 */
    grid-template-columns: minmax(170px, 1.55fr) 150px 190px minmax(110px, 1fr) 204px;
    gap: 8px;
    align-items: center;
    padding: 0 13px 8px 41px;
    border-bottom: 1px solid var(--line);
    color: var(--muted);
    font-size: var(--fs-sm);
  }

  /* 列：拖动 | KR 名称 | 负责人·权重（合并） | 时间范围 | 完成度 | 操作 */
  #objectivesView .kr-row {
    grid-template-columns: 18px minmax(170px, 1.55fr) 150px 190px minmax(110px, 1fr) 204px;
    gap: 8px;
    align-items: center;
  }

  #objectivesView .kr-main h5 {
    margin: 0;
  }

  /* 负责人与权重合并为一个视觉单元：「陈明 · 权重 30%」 */
  #objectivesView .kr-owner-cell {
    overflow-wrap: anywhere;
    color: var(--ink);
    font-size: var(--fs-base);
    font-weight: var(--fw-normal);
  }

  #objectivesView .kr-inline-meta,
  #objectivesView .kr-row-tools .kr-inline-meta {
    min-width: 0;
    justify-content: flex-start;
  }

  #objectivesView .kr-schedule-range {
    display: grid;
    gap: 2px;
    justify-content: start;
    font-size: var(--fs-sm);
  }

  #objectivesView .kr-completion-cell {
    min-width: 0;
  }

  #objectivesView .kr-completion-cell .progress-label {
    margin-bottom: 5px;
  }

  #objectivesView .kr-completion-cell .progress-label strong {
    font-size: var(--fs-sm);
  }

  #objectivesView .kr-completion-cell .kr-task-count {
    display: block;
    margin-top: 4px;
    font-size: var(--fs-2xs);
  }

  #objectivesView .kr-actions {
    justify-content: flex-end;
    margin-right: -13px;
  }
}

@media (max-width: 1360px) {
  #objectivesView .kr-row {
    grid-template-columns: 18px minmax(0, 1fr);
    align-items: start;
  }

  #objectivesView .kr-owner-cell,
  #objectivesView .kr-inline-meta,
  #objectivesView .kr-completion-cell,
  #objectivesView .kr-actions {
    grid-column: 2;
  }

  /* 负责人与权重已合并进 .kr-owner-cell，不再加「负责人：」前缀，避免出现
     「负责人：陈明 · 权重 30%」的重复感；合并后的内容本身已自解释。 */

  #objectivesView .kr-completion-cell {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
  }

  #objectivesView .kr-completion-cell .progress-label {
    margin: 0;
  }

  #objectivesView .kr-completion-cell .kr-task-count {
    color: var(--muted);
    font-size: var(--fs-sm);
  }

  #objectivesView .kr-completion-cell .completion-badge {
    font-size: var(--fs-sm);
  }
}

@media (max-width: 780px) {
  #objectivesView .kr-row {
    grid-template-columns: minmax(0, 1fr);
    padding-left: 38px;
  }

  #objectivesView .kr-owner-cell,
  #objectivesView .kr-inline-meta,
  #objectivesView .kr-completion-cell,
  #objectivesView .kr-actions {
    grid-column: 1;
  }

  #objectivesView .kr-completion-cell {
    grid-template-columns: 44px minmax(0, 1fr);
  }

  #objectivesView .kr-completion-cell .kr-task-count {
    grid-column: 2;
  }

  /* 窄屏下完成时间徽章独占一行，避免和进度条挤在同一格换行错位。 */
  #objectivesView .kr-completion-cell .completion-badge {
    grid-column: 1 / -1;
    justify-self: start;
    margin-top: 4px;
  }
}


@media (min-width: 1361px) {
  body.is-objectives-view .topbar {
    min-height: 36px;
    margin-bottom: 10px;
    justify-content: flex-end;
  }

  body.is-objectives-view .topbar > div:first-child {
    display: none;
  }

  .objective-outline {
    position: fixed;
    left: var(--objective-outline-left, 0px);
    top: 12px;
    height: calc(100vh - 24px);
    min-height: 0;
    max-height: calc(100vh - 24px);
    align-self: start;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    /* 按需求去掉目标目录面板投影。 */
  }

  .objective-outline-list {
    max-height: calc(100vh - 108px);
  }
}

@media (max-width: 780px) {
  body.is-objectives-view .topbar {
    display: none;
  }

  .objective-actions .mini-button {
    min-width: 0;
    padding-right: 8px;
    padding-left: 8px;
  }
}

.mobile-tabbar,
.mobile-more-sheet {
  display: none;
}

@media (max-width: 1360px) {
  body.is-objectives-view .main {
    max-width: 1480px;
  }

  body.is-timeline-view .main {
    max-width: 1480px;
  }

  body.is-objectives-view .topbar {
    width: 100%;
    padding-left: 0;
  }

  body.is-timeline-view .topbar,
  #timelineView {
    width: 100%;
  }

  #objectivesView.is-visible {
    width: 100%;
    grid-template-columns: minmax(0, 1fr);
  }

  #objectivesView .page-head,
  #objectivesView #objectiveList {
    grid-column: 1;
  }

  .objective-outline {
    display: none;
  }
}

@media (max-width: 1120px) {
  .metric-grid,
  .review-metric-grid,
  .review-kr-list,
  .board {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .content-split,
  .review-grid,
  .document-workspace {
    grid-template-columns: 1fr;
  }

  .document-workspace {
    height: auto;
    min-height: 0;
  }

  .document-list-panel,
  .document-outline-panel {
    max-height: 300px;
  }

  .document-preview-panel {
    height: 620px;
  }

  .reminder-rule-row {
    grid-template-columns: minmax(0, 1fr) 150px;
  }

  .reminder-rule-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }
}

@media (max-width: 780px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    padding: 16px;
  }

  .nav-list {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    overflow-x: auto;
  }

  .nav-item {
    justify-content: center;
    min-width: 88px;
    padding: 0 8px;
    font-size: var(--fs-base);
  }

  .nav-icon {
    display: none;
  }

  .sidebar-footer {
    margin-top: 14px;
  }

  .main {
    padding: 18px 14px 28px;
  }

  .icp-footer {
    bottom: calc(72px + env(safe-area-inset-bottom));
  }

  .topbar,
  .section-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar-actions {
    justify-content: flex-start;
  }

  .metric-grid,
  .review-metric-grid,
  .review-kr-list,
  .board,
  .form-grid,
  .form-grid.three,
  .report-toolbar {
    grid-template-columns: 1fr;
  }

  .objective-head,
  .kr-row,
  .action-head,
  .checkin-head {
    flex-direction: column;
  }

  .objective-meta-line {
    align-items: flex-start;
    grid-template-columns: 1fr;
  }

  .objective-files {
    justify-content: flex-start;
    margin-left: 0;
    width: 100%;
    max-width: 100%;
  }

  .mini-actions {
    justify-content: flex-start;
  }

  .kr-row {
    position: relative;
  }

  .kr-row > .drag-handle {
    position: absolute;
    top: 14px;
    left: 14px;
  }

  .kr-row .kr-main {
    width: 100%;
    padding-left: 26px;
  }

  .kr-row-tools {
    width: 100%;
    align-items: flex-start;
    flex-direction: column;
  }

  .kr-schedule-range {
    padding-left: 26px;
    justify-content: flex-start;
  }
}

@media (max-width: 780px) {
  body {
    padding-bottom: 86px;
    background: #f1f5f2;
  }

  .app-shell {
    display: block;
    min-height: auto;
  }

  .sidebar {
    display: none;
  }

  .main {
    max-width: none;
    padding: 0 14px 26px;
  }

  .topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    align-items: center;
    flex-direction: row;
    min-height: 62px;
    margin: 0 -14px 14px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
    background: rgba(245, 247, 243, 0.94);
    backdrop-filter: blur(14px);
  }

  .topbar h2 {
    font-size: var(--fs-xl);
  }

  .topbar .eyebrow {
    display: none;
  }

  .topbar-actions {
    flex: 0 0 auto;
  }

  .topbar-actions .icon-button,
  .topbar-actions .file-button {
    display: none;
  }

  .topbar-actions .primary-button {
    min-height: 40px;
    padding: 0 12px;
    font-size: var(--fs-base);
  }

  .view {
    gap: 14px;
  }

  .page-head {
    padding-bottom: 12px;
  }

  .page-head .eyebrow {
    display: none;
  }

  .section-head {
    gap: 10px;
  }

  .section-head h3 {
    font-size: var(--fs-lg);
  }

  .section-actions,
  .objective-toolbar,
  .document-toolbar {
    width: 100%;
    align-items: stretch;
    justify-content: stretch;
  }

  .document-toolbar {
    grid-template-columns: 1fr 1fr;
  }

  .document-search {
    grid-column: 1 / -1;
  }

  .document-scope-wrap .segmented {
    width: 100%;
  }

  /* 窄屏两列布局下，导入按钮铺满自己那一格。 */
  .document-import-wrap .ghost-button {
    width: 100%;
    justify-content: center;
  }

  .document-scope-wrap .segment {
    flex: 1;
  }

  .objective-toolbar .segment {
    flex: 0 0 auto;
  }

  .objective-toolbar .filter-inline {
    width: 100%;
  }

  .metric-grid,
  .review-metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .server-resource-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .server-resource-panel {
    padding: 18px 14px;
  }

  .server-resource-head h4 {
    font-size: var(--fs-lg);
  }

  .server-resource-head > strong {
    font-size: var(--fs-2xl);
  }

  .server-resource-values {
    gap: 8px;
    margin-top: 17px;
  }

  .server-resource-values strong {
    font-size: var(--fs-md);
  }

  .settings-workspace {
    grid-template-columns: 1fr;
    gap: 12px;
    min-height: 0;
  }

  .settings-section-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 0 0 12px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .settings-section-nav button {
    min-height: 52px;
  }

  .settings-detail-panel {
    padding: 14px;
  }

  .settings-form-grid,
  .settings-test-row,
  .reminder-rule-row {
    grid-template-columns: 1fr;
  }

  .settings-test-row {
    align-items: stretch;
  }

  .settings-test-row button {
    width: 100%;
  }

  .reminder-rule-row {
    gap: 12px;
  }

  .reminder-rule-actions {
    display: grid;
    grid-column: 1;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .reminder-rule-actions button {
    width: 100%;
    min-width: 0;
  }

  .reminder-rule-actions .primary-button {
    grid-column: 1 / -1;
  }

  .settings-toggle-row small,
  .reminder-enable small {
    white-space: normal;
  }

  .metric-card {
    min-height: 108px;
    padding: 14px;
  }

  .metric-card strong {
    margin-top: 12px;
    font-size: var(--fs-2xl);
  }

  .metric-card span {
    margin-top: 9px;
  }

  .panel,
  .objective-card,
  .kr-row,
  .action-card,
  .checkin-card {
    padding: 14px;
  }

  .objective-card {
    gap: 13px;
  }

  .objective-card--full {
    gap: 0;
  }

  .objective-card--full .objective-summary {
    gap: 14px;
    padding: 14px;
  }

  .objective-boundary {
    min-height: 40px;
    align-items: flex-start;
    flex-wrap: wrap;
    padding: 8px 14px;
  }

  .objective-boundary-main {
    width: 100%;
    flex-wrap: wrap;
  }

  .objective-kr-filter.segmented {
    order: 3;
    width: 100%;
    margin-top: 2px;
  }

  .objective-kr-filter .segment {
    flex: 1 1 25%;
    min-height: 30px;
    padding: 0 4px;
    font-size: var(--fs-sm);
  }

  .objective-boundary-meta {
    width: 100%;
    max-width: 100%;
    justify-content: flex-start;
  }

  .objective-kr-section {
    gap: 10px;
    padding: 13px 14px 14px;
  }

  .objective-title h4,
  .action-card h4,
  .checkin-card h4 {
    font-size: var(--fs-md);
  }

  .mini-actions {
    display: grid;
    width: 100%;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .mini-button {
    min-height: 34px;
    padding: 0 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .objective-files {
    padding-bottom: 2px;
  }

  .board {
    grid-template-columns: 1fr;
  }

  .timeline-toolbar .segmented,
  .timeline-toolbar .filter-inline {
    width: 100%;
  }

  .timeline-summary {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .timeline-scroll {
    min-height: 420px;
    max-height: calc(100vh - 260px);
  }

  .timeline-line {
    grid-template-columns: 210px var(--timeline-track-width);
  }

  .timeline-row-label {
    grid-template-columns: 48px minmax(0, 1fr);
    padding: 8px 10px;
  }

  .board-column {
    padding: 10px;
  }

  .commerce-table-wrap {
    margin: 0 -14px;
    padding: 0 14px;
  }

  .data-table {
    min-width: 680px;
  }

  .modal {
    width: 100%;
    max-width: none;
    max-height: 90vh;
    margin: auto 0 0;
    border-radius: 16px 16px 0 0;
  }

  .modal-card,
  .memo-card,
  .document-card {
    max-height: 88vh;
    overflow-y: auto;
    padding: 18px 16px calc(18px + env(safe-area-inset-bottom));
  }

  .memo-card {
    min-height: 72vh;
    grid-template-rows: auto auto minmax(300px, 1fr);
  }

  .document-card {
    min-height: 76vh;
    grid-template-rows: auto auto minmax(0, 1fr) auto;
  }

  .memo-editor {
    min-height: 300px;
  }

  .document-editor {
    min-height: 360px;
  }

  .document-editor-layout {
    grid-template-columns: 1fr;
  }

  .document-editor-outline-panel {
    max-height: 190px;
  }

  .document-editor-scroll {
    min-height: 300px;
  }

  .document-preview-head {
    display: grid;
  }

  .document-list-item {
    grid-template-columns: minmax(0, 1fr);
  }

  .document-list-actions {
    justify-content: flex-start;
  }

  .document-category-row {
    grid-template-columns: minmax(0, 1fr) auto auto;
  }

  .mobile-tabbar {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 60;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    min-height: calc(66px + env(safe-area-inset-bottom));
    padding: 7px 6px calc(7px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 -8px 24px rgba(30, 48, 38, 0.08);
    backdrop-filter: blur(14px);
  }

  .mobile-tab-button {
    display: grid;
    gap: 3px;
    place-items: center;
    min-width: 0;
    min-height: 50px;
    border: 0;
    border-radius: 8px;
    color: var(--muted);
    background: transparent;
    font-size: var(--fs-sm);
    font-weight: var(--fw-medium);
  }

  .mobile-tab-button > span:first-child {
    font-size: var(--fs-lg);
    line-height: 1;
  }

  .mobile-tab-button.is-active {
    color: var(--accent-strong);
    background: var(--accent-soft);
  }

  .mobile-more-sheet {
    position: fixed;
    inset: 0;
    z-index: 70;
    display: block;
    pointer-events: none;
  }

  .mobile-sheet-backdrop {
    position: absolute;
    inset: 0;
    width: 100%;
    border: 0;
    background: rgba(17, 25, 22, 0.38);
    opacity: 0;
    transition: opacity 180ms ease;
  }

  .mobile-sheet-panel {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    display: grid;
    gap: 14px;
    max-height: min(78vh, 640px);
    padding: 12px 16px calc(18px + env(safe-area-inset-bottom));
    overflow-y: auto;
    border-radius: 18px 18px 0 0;
    background: var(--surface);
    box-shadow: 0 -18px 44px rgba(24, 34, 31, 0.18);
    transform: translateY(105%);
    transition: transform 220ms ease;
  }

  body.is-mobile-menu-open {
    overflow: hidden;
  }

  body.is-mobile-menu-open .mobile-more-sheet {
    pointer-events: auto;
  }

  body.is-mobile-menu-open .mobile-sheet-backdrop {
    opacity: 1;
  }

  body.is-mobile-menu-open .mobile-sheet-panel {
    transform: translateY(0);
  }

  .mobile-sheet-handle {
    width: 42px;
    height: 4px;
    margin: 0 auto -4px;
    border-radius: 4px;
    background: var(--line-strong);
  }

  .mobile-sheet-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .mobile-sheet-head h3,
  .mobile-sheet-head p {
    margin: 0;
  }

  .mobile-sheet-head h3 {
    margin-top: 3px;
    font-size: var(--fs-lg);
  }

  .mobile-sheet-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 9px;
  }

  .mobile-sheet-grid button,
  .mobile-sheet-upload {
    display: grid;
    gap: 5px;
    min-height: 74px;
    padding: 10px 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--ink);
    background: #fbfcfb;
    font-size: var(--fs-sm);
    font-weight: var(--fw-medium);
    text-align: center;
  }

  .mobile-sheet-grid button > span,
  .mobile-sheet-upload > span {
    color: var(--accent-strong);
    font-size: var(--fs-lg);
    line-height: 1;
  }

  .mobile-sheet-upload {
    position: relative;
    cursor: pointer;
  }

  .mobile-sheet-upload input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
  }

  .mobile-account {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
  }

  .mobile-account > div:first-child {
    display: grid;
    gap: 3px;
    min-width: 0;
  }

  .mobile-account strong {
    overflow: hidden;
    font-size: var(--fs-base);
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-account span {
    color: var(--muted);
    font-size: var(--fs-sm);
  }

  .mobile-account-actions {
    display: flex;
    flex: 0 0 auto;
    gap: 12px;
  }

  .mobile-account-actions .text-button {
    min-height: 32px;
    font-size: var(--fs-base);
  }

  .toast {
    right: 14px;
    bottom: calc(78px + env(safe-area-inset-bottom));
    left: 14px;
    max-width: none;
  }
}

@media (max-width: 780px) {
  .fixed-task-toolbar .segmented {
    width: 100%;
    overflow-x: auto;
  }

  .fixed-task-toolbar .segment {
    flex: 1 0 auto;
  }

  .fixed-task-toolbar .primary-button {
    width: 100%;
  }

  .fixed-task-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .fixed-task-summary-item {
    min-height: 54px;
    padding: 10px 12px;
  }

  .fixed-task-summary-item strong {
    font-size: var(--fs-xl);
  }

  .fixed-task-row {
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
    padding: 14px;
  }

  .fixed-task-title-line {
    align-items: flex-start;
  }

  .fixed-task-title-line h4,
  .fixed-task-note {
    white-space: normal;
  }

  .fixed-task-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .fixed-task-frequency-tabs {
    display: grid;
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .fixed-task-frequency-tabs .segment {
    min-height: 36px;
  }

  .modal.fixed-task-editor-modal {
    width: 100%;
  }

  .fixed-task-editor-card {
    height: 88vh;
    min-height: 0;
    max-height: 88vh;
    grid-template-rows: auto minmax(0, 1fr) auto;
    overflow: hidden;
  }

  .form-grid.fixed-task-form-grid {
    min-height: 0;
    grid-template-columns: 1fr;
    grid-template-rows: none;
    align-content: start;
    overflow-y: auto;
    padding-right: 2px;
  }

  .fixed-task-frequency {
    grid-column: 1 / -1;
  }

  .fixed-task-frequency-detail,
  .fixed-task-frequency-detail--pair,
  .fixed-task-frequency-detail--multi {
    grid-template-columns: 1fr;
  }

  .fixed-task-frequency-detail .field-help {
    grid-column: 1;
  }

  .fixed-task-frequency-detail .control {
    width: 100%;
    max-width: none;
  }

  .fixed-task-monthday-group {
    grid-template-columns: repeat(7, minmax(0, 1fr));
  }

  .fixed-task-monthday-group .fixed-task-choice {
    width: auto;
    min-width: 0;
  }

  /* 年度选择器窄屏：月份组按 6 列网格换行，日期组按 8 列，避免横向溢出。 */
  .fixed-task-annual-block {
    min-width: 0;
  }

  .fixed-task-annual-month-group {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    max-width: 100%;
  }

  .fixed-task-annual-month-group .fixed-task-choice {
    width: auto;
    min-width: 0;
  }

  .fixed-task-annual-day-group {
    grid-template-columns: repeat(8, minmax(0, 1fr));
    max-width: 100%;
  }

  .fixed-task-annual-day-group .fixed-task-choice {
    width: auto;
    min-width: 0;
  }

  .fixed-task-annual-footer {
    justify-content: flex-start;
  }

  #fixedTasksView .fixed-task-frequency-cell {
    overflow: visible;
    white-space: normal;
    text-overflow: clip;
  }

  .fixed-task-note-field .textarea {
    height: auto;
    min-height: 330px;
    resize: vertical;
  }

  .fixed-task-log-card {
    max-height: calc(100vh - 20px);
    grid-template-rows: auto auto minmax(180px, 1fr);
    padding: 16px;
  }

  .fixed-task-log-editor {
    grid-template-columns: 1fr;
  }

  .fixed-task-log-editor .primary-button {
    width: 100%;
  }

  .fixed-task-log-item > div {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }

  .mobile-tab-button {
    font-size: var(--fs-2xs);
  }
}

.data-transfer-actions,
.objective-page-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.data-transfer-actions {
  flex: 0 0 auto;
  flex-wrap: nowrap;
}

.objective-page-actions {
  flex: 0 0 auto;
  justify-content: flex-end;
}

#objectiveDataTransferSlot {
  display: flex;
  min-width: 0;
}

body.is-documents-view .main {
  max-width: none;
}

body.is-documents-view .topbar {
  min-height: 48px;
  margin-bottom: 10px;
  gap: 12px;
}

body.is-documents-view .topbar h2 {
  font-size: var(--fs-xl);
}

body.is-documents-view .topbar-actions {
  flex-wrap: nowrap;
}

body.is-documents-view #documentsView {
  gap: 10px;
}

.document-modal-head {
  min-height: 30px;
  justify-content: flex-end;
  padding-bottom: 4px;
}

.document-form-grid {
  grid-template-columns: minmax(0, 1.65fr) minmax(160px, 0.75fr) minmax(220px, 1fr);
  gap: 8px 10px;
}

.document-form-grid > label {
  min-width: 0;
}

.document-form-grid .field-label {
  margin-bottom: 4px;
}

.document-form-grid .control {
  min-height: 36px;
}

.document-form-grid .document-summary-field {
  grid-column: 1 / -1;
}

.document-form-grid .document-summary-field .textarea {
  min-height: 54px;
  max-height: 76px;
}

body.is-objectives-view .main {
  padding-top: 12px;
}

body.is-timeline-view .main {
  padding-top: 12px;
}

body.is-objectives-view .topbar,
body.is-timeline-view .topbar {
  display: none;
}

body.is-objectives-view #objectivesView.is-visible {
  margin-top: 0;
}

#timelineView .timeline-page-head {
  min-height: 44px;
  margin-bottom: 14px;
  padding: 0;
  border-bottom: 0;
  flex-wrap: nowrap;
}

.timeline-page-title {
  display: flex;
  min-width: 0;
  flex: 1 1 auto;
  align-items: baseline;
  gap: 10px;
}

.timeline-page-title h3 {
  flex: 0 0 auto;
  margin: 0;
}

.timeline-cycle-meta {
  overflow: hidden;
  color: var(--muted);
  font-size: var(--fs-base);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.timeline-toolbar {
  flex: 0 0 auto;
  flex-wrap: nowrap;
  gap: 8px;
}

.timeline-toolbar .segmented,
.timeline-toolbar .filter-inline,
#timelineDataTransferSlot,
#timelineDataTransferSlot .data-transfer-actions {
  flex: 0 0 auto;
}

#timelineDataTransferSlot,
#timelineDataTransferSlot .data-transfer-actions {
  display: flex;
}

/* 文档页原先在 ≥781px 时把左右内边距清零，导致内容贴到窗口边缘；
   这里不再清零，让文档页与其它页面一样继承 .main 的内边距。 */

@media (max-width: 780px) {
  .objective-page-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .objective-page-actions .data-transfer-actions {
    display: none;
  }

  .document-form-grid {
    grid-template-columns: 1fr;
  }

  .document-form-grid .document-summary-field {
    grid-column: 1;
  }

  .files-workspace {
    grid-template-columns: 1fr;
  }

  .file-upload-row,
  .user-file-row {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 9px;
  }

  .file-upload-row .file-progress-track,
  .file-upload-row .file-upload-status {
    grid-column: 1 / -1;
  }

  .file-upload-row .file-upload-status {
    text-align: left;
  }

  .user-file-row .file-row-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }
}

@media (max-width: 1360px) {
  #timelineView .timeline-page-head {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .timeline-toolbar {
    width: 100%;
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  #objectivesView.is-visible {
    grid-template-columns: minmax(0, 1fr);
  }

  #objectivesView .page-head,
  #objectivesView .objective-filter-row,
  #objectivesView #objectiveList {
    grid-column: 1;
  }

  #objectivesView .page-head { grid-row: 2; }
  #objectivesView .objective-filter-row { grid-row: 3; }
  #objectivesView #objectiveList { grid-row: 4; }

  .objective-outline-toggle {
    display: inline-flex;
    grid-column: 1;
    grid-row: 1;
    width: fit-content;
    min-height: 34px;
    align-items: center;
    gap: 7px;
    padding: 0 10px;
    font-size: var(--fs-base);
  }

  .objective-outline {
    position: fixed;
    top: 18px;
    bottom: 18px;
    left: 220px;
    z-index: 40;
    display: grid;
    width: min(300px, calc(100vw - 250px));
    height: auto;
    max-height: none;
    padding: 12px;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    background: var(--surface);
    /* 按需求去掉目标目录面板投影。 */
    opacity: 0;
    pointer-events: none;
    transform: translateX(-110%);
    transition: opacity 160ms ease, transform 160ms ease;
  }

  body.is-objective-outline-open .objective-outline {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(0);
  }

  .objective-outline-close {
    display: inline-grid;
    width: 30px;
    height: 30px;
    min-height: 30px;
  }

  body.is-objective-outline-open::after {
    position: fixed;
    inset: 0;
    z-index: 30;
    background: rgba(17, 25, 22, 0.2);
    content: "";
  }
}

@media (max-width: 780px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  body.is-objectives-view .topbar {
    padding-left: 0;
  }

  .objective-outline {
    top: 12px;
    right: 12px;
    bottom: 86px;
    left: 12px;
    width: auto;
  }

  .objective-filter-row {
    display: grid;
    gap: 10px;
  }

  .timeline-page-title {
    width: 100%;
    flex-wrap: wrap;
    gap: 4px 8px;
  }

  .timeline-cycle-meta {
    flex-basis: 100%;
  }

  #timelineDataTransferSlot {
    display: none;
  }

  .objective-stat-line {
    gap: 10px;
    overflow: hidden;
    font-size: var(--fs-sm);
  }

  .objective-stat-line strong {
    font-size: var(--fs-md);
  }

  .objective-toolbar {
    width: 100%;
    flex-wrap: wrap;
  }

  .objective-toolbar .segmented {
    width: 100%;
    overflow-x: auto;
  }

  .objective-toolbar .filter-inline.small {
    width: 100%;
  }

  .objective-head {
    flex-direction: column;
  }

  .objective-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .objective-progress-row,
  .kr-progress-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .objective-progress-row > .progress-line {
    width: 100%;
    min-width: 0;
  }

  .objective-progress-row .schedule-range,
  .kr-inline-meta {
    min-width: 0;
    justify-content: flex-start;
  }

  .kr-row {
    grid-template-columns: 18px minmax(0, 1fr);
  }

  .kr-row-tools {
    grid-column: 2;
    grid-row: 2;
    width: 100%;
  }

  .theme-options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .objective-files-manager-head,
  .objective-file-manager-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .objective-files-upload,
  .objective-file-manager-row .mini-button {
    width: 100%;
  }
}

@media (max-width: 780px) {
  .main .view > .panel,
  #dashboardView .content-split > .panel {
    padding: 14px;
  }

  #objectiveList {
    gap: 12px;
  }

  .objective-card--full .objective-summary {
    padding: 14px;
  }

  .objective-kr-section {
    padding: 12px;
  }

  .objective-stat-line {
    overflow: visible;
    white-space: normal;
  }

  .objective-stat-line span {
    white-space: nowrap;
  }

  .objective-actions {
    display: grid;
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-flow: row;
    gap: 6px;
    justify-content: stretch;
  }

  body .objective-actions > .file-action,
  body .objective-actions > [data-edit-objective],
  body .objective-actions > [data-complete-objective],
  body .objective-actions > [data-restore-objective],
  body .objective-actions > [data-unhide-objective],
  body .objective-actions > [data-open-objective-memo],
  body .objective-actions > [data-copy-objective],
  body .objective-actions > [data-add-kr],
  body .objective-actions > [data-delete-objective] {
    grid-column: auto;
    grid-row: auto;
    min-width: 0;
  }

  .objective-actions .mini-button {
    min-height: 38px;
    padding-right: 8px;
    padding-left: 8px;
  }
}

/* 2026-10-19 手机端排版修复：登录隔离、页面宽度、KR 网格、底栏与页脚。
   仅覆盖手机断点，桌面布局保持原样。 */
.app-shell[hidden] {
  display: none !important;
}

.panel,
.view,
.main {
  min-width: 0;
}

@media (max-width: 1120px) {
  .content-split {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 780px) {
  body {
    display: flex;
    min-height: 100vh;
    flex-direction: column;
    padding-bottom: calc(86px + env(safe-area-inset-bottom));
  }

  body.is-locked {
    padding-bottom: 0;
  }

  body.is-locked .mobile-tabbar,
  body.is-locked .mobile-more-sheet {
    display: none !important;
  }

  .app-shell {
    order: 1;
  }

  /* 备案号改为文档流页脚，避免固定悬浮在卡片和按钮上。 */
  .icp-footer {
    position: static;
    order: 2;
    margin-top: auto;
    padding: 10px 16px 0;
    background: transparent;
  }

  /* 未登录时登录遮罩是全屏 fixed，文档流页脚会被遮住，这里单独固定到遮罩之上。 */
  body.is-locked .icp-footer {
    position: fixed;
    right: 0;
    bottom: calc(12px + env(safe-area-inset-bottom));
    left: 0;
    z-index: 60;
    margin-top: 0;
    padding: 0 16px;
  }

  .login-screen {
    align-items: stretch;
    overflow-y: auto;
    padding: max(18px, env(safe-area-inset-top)) 14px
      calc(120px + env(safe-area-inset-bottom));
  }

  .login-card {
    margin-block: auto;
  }

  .login-screen .card-system-entry {
    right: 14px;
    bottom: calc(16px + env(safe-area-inset-bottom));
    min-height: 40px;
    padding: 0 14px;
    font-size: var(--fs-base);
  }

  .login-screen .card-system-entry ~ .card-system-entry {
    bottom: calc(66px + env(safe-area-inset-bottom));
  }

  /* 拖动手柄已绝对定位，KR 行改为单列，主内容整行展开。 */
  .kr-row {
    grid-template-columns: minmax(0, 1fr);
    padding-left: 38px;
    align-items: start;
  }

  .kr-main {
    grid-column: 1;
  }

  .kr-row-tools {
    grid-column: 1;
    grid-row: 2;
    width: 100%;
    justify-content: flex-start;
  }

  .kr-actions {
    width: 100%;
    grid-template-columns: repeat(auto-fit, minmax(46px, 1fr));
    grid-template-rows: auto;
    justify-content: stretch;
    gap: 6px;
  }

  .kr-actions .mini-button {
    min-width: 0;
    min-height: 40px;
    padding: 0 4px;
    font-size: var(--fs-sm);
  }

  .kr-inline-meta {
    width: 100%;
    min-width: 0;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 5px;
  }

  .kr-schedule-range {
    padding-left: 0;
    gap: 4px;
    justify-content: flex-start;
  }

  .kr-schedule-range > span {
    min-height: 22px;
    padding: 0 5px;
    font-size: var(--fs-2xs);
  }

  /* O 操作区由 2 列 4 行改为 3 列，删除独占最后一行。 */
  .objective-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  body .objective-actions > [data-delete-objective] {
    grid-column: 1 / -1;
    grid-row: auto;
  }

  .objective-actions .mini-button {
    min-height: 40px;
    font-size: var(--fs-sm);
  }

  .segment {
    min-height: 34px;
  }

  .objective-kr-filter .segment {
    min-height: 32px;
    font-size: var(--fs-sm);
  }

  .mobile-tab-button {
    font-size: var(--fs-sm);
  }

  .modal,
  .modal-card,
  .memo-card,
  .document-card {
    max-height: 90dvh;
  }

  .modal-card,
  .memo-card,
  .document-card {
    max-height: 88dvh;
  }
}

/* OKR 页面 P4：左侧导航底部收纳（返回发卡系统/电商管理合并成一个
   “切换系统”折叠项），目标目录默认收成窄轨、悬停/点击展开。
   只加新样式和新增的收纳/展开结构，不改 nav-item、user-panel 等已有选择器。
   仅追加覆盖，放在文件末尾；删除本块即可回到上一版布局。 */
.sidebar-switch-system {
  position: relative;
}

.sidebar-switch-system > summary {
  list-style: none;
  cursor: pointer;
}

.sidebar-switch-system > summary::-webkit-details-marker {
  display: none;
}

.sidebar-switch-system[open] > summary {
  color: var(--accent-strong);
  background: var(--accent-soft);
}

.sidebar-switch-system > .sidebar-card-system-link {
  min-height: 36px;
  margin-top: 4px;
  padding-left: 32px;
  font-size: var(--fs-base);
}

.sidebar-divider {
  margin: 2px 0;
  border-top: 1px solid var(--line);
}

.sidebar-user-actions {
  display: flex;
  gap: 14px;
  align-items: center;
}

/* 目标目录默认收成约 56px 窄轨，只显示“目标”文字 + O 序号；悬停或点击 « / » 展开
   成完整列表（O 序号、标题、进度、拖动手柄）。1361px 及以上固定在视口左侧，
   目录内部独立滚动；1360px 以下仍使用抽屉模式（setObjectiveOutlineOpen）。 */
.objective-outline-pin {
  display: none;
}

@media (min-width: 1361px) {
  .objective-outline-pin {
    display: inline-grid;
    width: 26px;
    height: 26px;
    min-height: 26px;
    font-size: var(--fs-base);
  }

  /* 收起态和展开态共用固定的视口位置。悬停/聚焦只改变宽度，
     不改变目录的顶部和左侧位置，右侧 O 内容继续使用原网格列。 */
  body.is-objective-outline-collapsed #objectivesView.is-visible {
    grid-template-columns: 56px minmax(0, 1fr);
  }

  body.is-objective-outline-collapsed .objective-outline {
    width: 56px;
    overflow: hidden;
  }

  body.is-objective-outline-collapsed .objective-outline:hover,
  body.is-objective-outline-collapsed .objective-outline:focus-within {
    z-index: 25;
    width: 240px;
    overflow: visible;
    /* 按需求去掉目标目录面板投影。 */
  }

  /* 收起时隐藏拖动手柄、完整标题、进度和头部“目标目录”字样，
     用一个固定的“目标”文字标签代替，只留 O 序号可辨认。 */
  body.is-objective-outline-collapsed .objective-outline-head > div:first-child h4,
  body.is-objective-outline-collapsed .objective-outline-head > div:first-child > span,
  body.is-objective-outline-collapsed .objective-outline-item .drag-handle,
  body.is-objective-outline-collapsed .objective-outline-title,
  body.is-objective-outline-collapsed .objective-outline-progress {
    display: none;
  }

  body.is-objective-outline-collapsed .objective-outline-head::before {
    color: var(--muted);
    font-size: var(--fs-base);
    font-weight: var(--fw-medium);
    content: "目标";
  }

  body.is-objective-outline-collapsed .objective-outline:hover .objective-outline-head > div:first-child h4,
  body.is-objective-outline-collapsed .objective-outline:hover .objective-outline-head > div:first-child > span,
  body.is-objective-outline-collapsed .objective-outline:hover .objective-outline-item .drag-handle,
  body.is-objective-outline-collapsed .objective-outline:hover .objective-outline-title,
  body.is-objective-outline-collapsed .objective-outline:hover .objective-outline-progress,
  body.is-objective-outline-collapsed .objective-outline:focus-within .objective-outline-head > div:first-child h4,
  body.is-objective-outline-collapsed .objective-outline:focus-within .objective-outline-head > div:first-child > span,
  body.is-objective-outline-collapsed .objective-outline:focus-within .objective-outline-item .drag-handle,
  body.is-objective-outline-collapsed .objective-outline:focus-within .objective-outline-title,
  body.is-objective-outline-collapsed .objective-outline:focus-within .objective-outline-progress {
    display: revert;
  }

  body.is-objective-outline-collapsed .objective-outline:hover .objective-outline-head::before,
  body.is-objective-outline-collapsed .objective-outline:focus-within .objective-outline-head::before {
    content: none;
  }
}

/* OKR 页面 P3：顶部“目标与关键结果”标题 + 日期跨度 + 统计 + 筛选 + 新增目标
   合并成一行工具栏（侧栏周期选择已随周期管理功能移除）。
   原来的 .page-head 已从 HTML 中删除，这里把三行网格收成两行，
   并取消宽屏下隐藏顶栏标题的规则，让标题只出现一次。
   仅追加覆盖，放在文件末尾；删除本块即可回到上一版布局。 */
body.is-objectives-view .topbar > div:first-child {
  display: block;
}

#objectivesView.is-visible {
  grid-template-rows: auto minmax(0, 1fr);
}

#objectivesView .objective-filter-row {
  grid-row: 1;
}

#objectivesView #objectiveList {
  grid-row: 2;
}

.objective-filter-row {
  flex-wrap: wrap;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.objective-cycle-meta {
  flex: 0 0 auto;
  margin: 0;
  padding-right: 14px;
  border-right: 1px solid var(--line);
}

.objective-toolbar {
  flex-wrap: wrap;
}

.objective-page-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
  align-items: center;
  margin-left: auto;
}

@media (max-width: 1180px) {
  #objectivesView.is-visible {
    grid-template-rows: auto auto minmax(0, 1fr);
  }

  #objectivesView .objective-outline-toggle {
    grid-row: 1;
  }

  #objectivesView .objective-filter-row {
    grid-row: 2;
  }

  #objectivesView #objectiveList {
    grid-row: 3;
  }
}

@media (max-width: 780px) {
  /* 手机端顶栏仍保持隐藏（2026-10-19 已修复的横向溢出问题），
     标题只在桌面/平板顶栏出现一次，手机端由底部“OKR”标签代替。 */
  .objective-cycle-meta {
    padding-right: 0;
    border-right: 0;
  }

  .objective-page-actions {
    width: 100%;
    margin-left: 0;
  }
}

/* OKR 页面 P2：删除边界条里的“目标”字样和重复的 KR 计数，
   O 序号移入标题行；非风险状态标签不再显示“正常”，负责人与信心合并一行展示。
   仅追加覆盖，放在文件末尾；删除本块即可回到上一版布局。 */
.objective-boundary {
  justify-content: flex-start;
}

.objective-title > .objective-index {
  flex: 0 0 auto;
  margin-top: 2px;
}

/* OKR 页面 P1：O 和 KR 的低频操作收进 ⋯ 菜单。
   仅追加覆盖，放在文件末尾；删除本块即可回到上一版布局。 */
.objective-actions,
.kr-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  align-items: center;
  justify-content: flex-end;
}

.action-menu {
  position: relative;
  flex: 0 0 auto;
}

.action-menu > summary {
  list-style: none;
}

.action-menu > summary::-webkit-details-marker {
  display: none;
}

.action-menu-toggle {
  display: inline-flex;
  min-width: 30px;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
  font-size: var(--fs-md);
  line-height: 1;
  cursor: pointer;
  user-select: none;
}

.action-menu[open] > .action-menu-toggle {
  border-color: var(--accent);
  color: var(--accent-strong);
  background: var(--accent-soft);
}

.action-menu[open] > .action-menu-popover {
  z-index: 30;
  opacity: 1;
  pointer-events: auto;
  transform: none;
}

/* KR 行靠近卡片底部，菜单向上展开，避免被卡片的 overflow:hidden 裁掉。 */
.kr-actions .action-menu-popover {
  top: auto;
  bottom: calc(100% + 6px);
}

@media (max-width: 780px) {
  .objective-actions,
  .kr-actions {
    width: 100%;
    flex-wrap: wrap;
    justify-content: stretch;
  }

  .objective-actions > .mini-button,
  .kr-actions > .mini-button {
    flex: 1 1 60px;
    min-width: 0;
  }

  .objective-actions > .action-menu,
  .kr-actions > .action-menu {
    flex: 0 0 44px;
  }

  .objective-actions > .action-menu > .action-menu-toggle,
  .kr-actions > .action-menu > .action-menu-toggle {
    width: 100%;
  }
}

/* OKR 页面 P6：工具栏同一水平线、空白收紧、O 与 KR 的进度条对齐。
   全部限定在 #objectivesView 下，不影响看板页复用的 .progress-line。
   仅追加覆盖，放在文件末尾；删除本块并还原 app.js 里 krRow 的日期位置即可回到上一版。 */

/* 阶段 A1/A2：工具栏所有控件统一 36px、垂直居中；“排序”标签与下拉同一行。 */
#objectivesView .objective-filter-row {
  align-items: center;
  min-height: 0;
  padding-top: 0;
  padding-bottom: 8px;
}

#objectivesView .objective-toolbar {
  align-items: center;
}

#objectivesView .objective-toolbar .segmented,
#objectivesView .objective-toolbar .control,
#objectivesView .objective-toolbar .icon-button,
#objectivesView .objective-toolbar .primary-button {
  min-height: 36px;
  height: 36px;
}

#objectivesView .objective-toolbar .segmented {
  align-items: center;
}

#objectivesView .objective-toolbar .segment {
  min-height: 28px;
}

#objectivesView .objective-toolbar .filter-inline.small {
  display: flex;
  width: auto;
  align-items: center;
  gap: 6px;
}

#objectivesView .objective-toolbar .filter-inline.small .field-label {
  margin-bottom: 0;
  white-space: nowrap;
}

#objectivesView .objective-toolbar .filter-inline.small .control {
  width: 130px;
}

#objectivesView .objective-page-actions {
  align-items: center;
}

/* 阶段 A3：收紧上下留白。 */
#objectivesView #objectiveList {
  gap: 12px;
}

#objectivesView .objective-card--full .objective-summary {
  gap: 8px;
  padding: 12px 18px 10px;
}

#objectivesView .objective-meta-line {
  margin-top: 6px;
}

#objectivesView .objective-progress-row {
  margin-top: 0;
}

#objectivesView .objective-kr-section {
  gap: 6px;
  padding: 10px 18px 12px;
}

#objectivesView .kr-list {
  gap: 6px;
}

#objectivesView .kr-row {
  padding: 8px 12px;
}

#objectivesView .kr-main h5 {
  margin-bottom: 4px;
}

/* 阶段 B2：O 与 KR 的进度条等长、起点同一 X、百分比同一列。
   两者的进度行都用“标签列 + 进度条 + 日期/按钮列”，左侧缩进相同。 */
#objectivesView .objective-progress-row,
#objectivesView .kr-progress-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  align-items: center;
}

#objectivesView .objective-progress-row > .progress-line,
#objectivesView .kr-progress-row > .progress-line {
  width: 100%;
  min-width: 0;
  gap: 4px;
}

/* 左缩进 43px = KR 行 1px 边框 + 12px 内边距 + 18px 手柄 + 12px 间距；
   右缩进 13px = KR 行 1px 边框 + 12px 内边距。再让两边的右列同宽，
   O 与 KR 的进度条就起点同 X、终点同 X、百分比在同一列。 */
#objectivesView {
  --okr-side-col: 352px;
}

#objectivesView .objective-progress-row {
  grid-template-columns: minmax(0, 1fr) var(--okr-side-col);
  gap: 12px;
  padding-right: 13px;
  padding-left: 43px;
}

#objectivesView .objective-progress-row .schedule-range {
  min-width: 0;
  justify-content: flex-end;
  align-self: end;
}

/* KR 当前有 6 个直接子项（拖动、KR 主信息、负责人·权重、时间范围、完成度、操作）；
   宽屏恢复 6 轨，与表头字段加拖动手柄对应。
   1360px 以下沿用上方的纵向信息布局，避免较晚的通用规则覆盖响应式断点。 */
@media (min-width: 1361px) {
  #objectivesView .kr-row {
    grid-template-columns: 18px minmax(170px, 1.55fr) 150px 190px minmax(110px, 1fr) 204px;
    gap: 8px;
    align-items: center;
  }
}

#objectivesView .kr-row-tools {
  display: flex;
  flex: 0 0 auto;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
}

#objectivesView .kr-row-tools .kr-inline-meta {
  min-width: 0;
  justify-content: flex-end;
}

#objectivesView .kr-row-tools .kr-schedule-range {
  flex-wrap: nowrap;
  padding-left: 0;
}

/* 1180px 及以下内容区变窄：固定右列会把进度条挤得太短，
   改成 KR 的日期/按钮落到进度条下一行，O 的日期也落到下一行。 */
@media (max-width: 1180px) {
  #objectivesView .kr-row {
    grid-template-columns: 18px minmax(0, 1fr);
    align-items: start;
  }

  #objectivesView .kr-row-tools {
    grid-column: 2;
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  #objectivesView .objective-progress-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
  }

  #objectivesView .objective-progress-row .schedule-range {
    align-self: start;
    justify-content: flex-start;
  }
}

@media (max-width: 780px) {
  /* 上面的 #objectivesView 规则优先级高于手机端原有规则，这里把手机端必须保留的布局补回来。 */
  #objectivesView .kr-row {
    grid-template-columns: minmax(0, 1fr);
    padding-left: 38px;
    align-items: start;
  }

  #objectivesView .objective-card--full .objective-summary {
    padding: 14px;
  }

  #objectivesView .objective-kr-section {
    padding: 12px;
  }

  #objectivesView .objective-progress-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
    padding-right: 0;
    padding-left: 0;
  }

  #objectivesView .objective-progress-row .schedule-range {
    align-self: start;
    justify-content: flex-start;
  }

  #objectivesView .kr-row-tools {
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
  }

  #objectivesView .kr-row-tools .kr-inline-meta {
    justify-content: flex-start;
  }

  #objectivesView .kr-row-tools .kr-schedule-range {
    flex-wrap: wrap;
  }

  #objectivesView .objective-toolbar .filter-inline.small {
    width: 100%;
  }

  #objectivesView .objective-toolbar .filter-inline.small .control {
    flex: 1 1 auto;
    width: auto;
  }
}

/* 图标按钮尺寸在断点覆盖之后再次固定，避免通用移动按钮 padding 挤压图标。 */
#objectivesView .icon-action {
  width: 36px;
  min-width: 36px;
  height: 36px;
  min-height: 36px;
  flex: 0 0 36px;
  padding: 0;
}

@media (max-width: 780px) {
  #objectivesView .icon-action {
    width: 40px;
    min-width: 40px;
    height: 40px;
    min-height: 40px;
    flex-basis: 40px;
    padding: 0;
  }
}

/* OKR O 进度区：状态筛选、起止日期和完成度与 KR 的日期/完成度列对齐。
   KR 已把「负责人 + 权重」合并为一列，宽屏从 7 轨变为 6 轨：
     1 拖动 | 2 KR 名称 | 3 负责人·权重 | 4 时间范围 | 5 完成度 | 6 操作
   因此这里的列号同步左移一位：筛选跨 1-3，日期在第 4 列，进度在第 5 列。 */
#objectivesView .objective-card--full .objective-progress-row {
  position: relative;
  grid-template-columns: 18px minmax(170px, 1.55fr) 150px 190px minmax(110px, 1fr) 204px;
  gap: 8px;
  margin-top: 0;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: transparent;
}

#objectivesView .objective-card--full .objective-summary {
  background: var(--surface-soft);
}

#objectivesView .objective-card--full .objective-progress-row > .objective-boundary {
  grid-column: 1 / 4;
  grid-row: 1;
  min-width: 0;
  min-height: 28px;
  padding: 0;
  border: 0;
  background: transparent;
}

#objectivesView .objective-card--full .objective-progress-row > .objective-boundary .objective-kr-filter {
  width: 100%;
  min-width: 0;
}

#objectivesView .objective-card--full .objective-progress-row > .progress-line {
  grid-column: 5;
  grid-row: 1;
  width: 100%;
  min-width: 0;
}

#objectivesView .objective-card--full .objective-progress-row > .objective-schedule-range {
  grid-column: 4;
  grid-row: 1;
  display: grid;
  min-width: 0;
  gap: 2px;
  align-self: center;
  justify-content: start;
  font-size: var(--fs-sm);
}

#objectivesView .objective-card--full .objective-progress-row > .progress-line .progress-label {
  margin-bottom: 5px;
}

#objectivesView .objective-card--full .objective-progress-row > .progress-line .progress-label strong {
  font-size: var(--fs-sm);
}

@media (max-width: 1360px) {
  #objectivesView .objective-card--full .objective-progress-row {
    grid-template-columns: minmax(0, 1fr) minmax(220px, auto);
  }

  #objectivesView .objective-card--full .objective-progress-row > .objective-boundary {
    grid-column: 1;
  }

  #objectivesView .objective-card--full .objective-progress-row > .progress-line {
    grid-column: 1;
  }

  #objectivesView .objective-card--full .objective-progress-row > .objective-schedule-range {
    grid-column: 2;
    grid-row: 1 / span 2;
    justify-content: end;
  }
}

@media (max-width: 1180px) {
  #objectivesView .objective-card--full .objective-progress-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
  }

  #objectivesView .objective-card--full .objective-progress-row > .objective-boundary,
  #objectivesView .objective-card--full .objective-progress-row > .progress-line,
  #objectivesView .objective-card--full .objective-progress-row > .objective-schedule-range {
    grid-column: 1;
    grid-row: auto;
  }

  #objectivesView .objective-card--full .objective-progress-row > .objective-schedule-range {
    justify-content: flex-start;
  }
}

@media (max-width: 780px) {
  #objectivesView .objective-card--full .objective-progress-row {
    padding: 8px;
  }

  #objectivesView .objective-card--full .objective-progress-row > .objective-boundary .objective-kr-filter {
    width: 100%;
  }
}

/* 固定任务：紧凑标题行、KR 风格字段列与中文图标提示。 */
#fixedTasksView .fixed-task-page-head {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  padding-bottom: 8px;
}

#fixedTasksView .fixed-task-heading {
  display: flex;
  min-width: 0;
  flex: 1 1 auto;
  align-items: baseline;
  gap: 10px;
}

#fixedTasksView .fixed-task-heading h3 {
  flex: 0 0 auto;
  margin: 0;
  font-size: var(--fs-lg);
}

#fixedTasksView .fixed-task-cycle-meta {
  color: var(--muted);
  font-size: var(--fs-sm);
  white-space: nowrap;
}

#fixedTasksView .fixed-task-eyebrow {
  color: var(--muted);
  font-size: var(--fs-2xs);
  letter-spacing: 0.08em;
  white-space: nowrap;
}

#fixedTasksView .fixed-task-toolbar {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: nowrap;
  gap: 8px;
}

#fixedTasksView .fixed-task-summary {
  gap: 8px;
  margin-bottom: 10px;
}

#fixedTasksView .fixed-task-summary-item {
  min-height: 44px;
  padding: 8px 12px;
}

#fixedTasksView .fixed-task-summary-item strong {
  font-size: var(--fs-lg);
}

#fixedTasksView .fixed-task-list-head,
#fixedTasksView .fixed-task-row {
  display: grid;
  /* 频率/时间已拆成「频率」「时间」两列，共 7 列。名称列独占 1fr，
     其余列固定宽度，使「已完成次数」相对表格右边界的位置保持稳定。 */
  grid-template-columns: minmax(150px, 1fr) 84px 80px 80px 176px 84px 240px;
  gap: 10px;
  align-items: center;
}

#fixedTasksView .fixed-task-list-head {
  /* 数据行有 1px 边框，表头原本没有，导致内容盒相差 2px、各列左上错位 1px。
     这里补一条透明边框，让表头和数据行的内容盒完全一致，列才能像素级对齐。 */
  border: 1px solid transparent;
  padding: 0 12px 6px;
  color: var(--muted);
  /* 原为 --fs-xs(11px)，比数据单元格(12px)还小，表头显得局促；统一到 12px。 */
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
}

/* 「已完成次数」列的数据是居中的，表头同步居中；「操作」列按钮靠右，表头同步右对齐。
   拆成 7 列后，已完成次数是第 6 列、操作是第 7 列。 */
#fixedTasksView .fixed-task-list-head > span:nth-child(6) {
  text-align: center;
}

#fixedTasksView .fixed-task-list-head > span:nth-child(7) {
  text-align: right;
}

#fixedTasksView .fixed-task-list {
  gap: 6px;
}

/* 置顶 / 普通 / 置底分组：分割线上方留出半个任务行高的空白。 */
#fixedTasksView .fixed-task-divider {
  height: 29px;
  border-bottom: 1px solid var(--line-strong);
  background: transparent;
}

#fixedTasksView .fixed-task-row {
  min-height: 58px;
  padding: 8px 12px;
  border-radius: 7px;
  gap: 10px;
}

/* 固定任务列表排版对齐 OKR 页面：
   OKR 实测层级为 卡片标题 18px/700、正文 13px/400、标签 12px/700、KR 名称 13px/700、
   负责人 13px/400、数值 12px/700。固定任务原先统一压在 11~13px 且字重偏弱，
   这里把正文提到 13px、名称提到 15px、徽章与备注提到 12px，与 OKR 的观感拉平。 */
#fixedTasksView .fixed-task-cell {
  min-width: 0;
  color: var(--ink);
  font-size: var(--fs-base);
  line-height: 1.4;
  overflow-wrap: anywhere;
}

#fixedTasksView .fixed-task-title-line {
  gap: 7px;
}

#fixedTasksView .fixed-task-title-line h4 {
  font-size: var(--fs-md);
  line-height: 1.4;
}

#fixedTasksView .fixed-task-status {
  padding: 2px 6px;
  font-size: var(--fs-sm);
}

#fixedTasksView .fixed-task-status.overdue {
  border-color: rgba(185, 64, 54, 0.28);
  color: var(--red);
  background: var(--red-soft);
}

/* 结束日期已过且最后一次已完成的多任务，不再继续显示“进行中”。 */
#fixedTasksView .fixed-task-status.ended {
  border-color: var(--line);
  color: var(--muted);
  background: var(--surface-soft);
}

/* 当前应完成日被跳过：保留任务，但不再进入待办。 */
#fixedTasksView .fixed-task-status.skipped {
  border-color: rgba(195, 122, 24, 0.28);
  color: var(--amber);
  background: var(--yellow-soft);
}

#fixedTasksView .fixed-task-note {
  margin-top: 3px;
  color: var(--muted);
  font-size: var(--fs-sm);
}

/* 已完成次数属于关键数值，按 OKR 的做法加粗（OKR 的完成度数字为 700）。 */
#fixedTasksView .fixed-task-count {
  text-align: center;
  white-space: nowrap;
  font-size: var(--fs-base);
  font-weight: var(--fw-bold);
}

#fixedTasksView .fixed-task-frequency-cell {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

#fixedTasksView .fixed-task-actions,
#fixedTasksView .fixed-task-actions .mini-actions {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: flex-end;
}

#fixedTasksView .fixed-task-actions .mini-actions {
  flex-wrap: nowrap;
  gap: 4px;
}

#fixedTasksView .fixed-task-icon-action {
  position: relative;
  display: inline-grid;
  width: 30px;
  min-width: 30px;
  height: 30px;
  min-height: 30px;
  flex: 0 0 30px;
  place-items: center;
  padding: 0;
  color: var(--muted);
}

#fixedTasksView .fixed-task-icon-action svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

#fixedTasksView .fixed-task-icon-action:hover,
#fixedTasksView .fixed-task-icon-action:focus-visible {
  color: var(--accent-strong);
}

/* 置顶/置底的选中态需要明显区别于普通图标：加底色、描边并加粗图标。 */
#fixedTasksView .fixed-task-icon-action.is-active {
  border-color: var(--accent);
  color: var(--accent-strong);
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px rgba(34, 116, 89, 0.16);
}

#fixedTasksView .fixed-task-icon-action.is-active svg {
  stroke-width: 2.4;
}

#fixedTasksView .fixed-task-icon-action.danger-button:hover,
#fixedTasksView .fixed-task-icon-action.danger-button:focus-visible {
  color: var(--red);
}

#fixedTasksView .fixed-task-icon-action[data-tooltip]::after {
  position: absolute;
  top: calc(100% + 6px);
  left: 50%;
  z-index: 60;
  padding: 5px 7px;
  border-radius: 5px;
  color: var(--text-inverse);
  background: #26332e;
  content: attr(data-tooltip);
  font-size: var(--fs-sm);
  font-weight: var(--fw-normal);
  line-height: 1.3;
  pointer-events: none;
  white-space: nowrap;
  opacity: 0;
  transform: translate(-50%, -3px);
  transition: opacity 0.12s ease, transform 0.12s ease;
}

#fixedTasksView .fixed-task-icon-action:hover::after,
#fixedTasksView .fixed-task-icon-action:focus-visible::after {
  opacity: 1;
  transform: translate(-50%, 0);
}

#fixedTasksView .fixed-task-icon-action:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

@media (max-width: 1220px) {
  #fixedTasksView .fixed-task-page-head {
    align-items: flex-start;
    flex-direction: column;
  }

  #fixedTasksView .fixed-task-toolbar {
    width: 100%;
    justify-content: space-between;
  }

  #fixedTasksView .fixed-task-list-head {
    display: none;
  }

  #fixedTasksView .fixed-task-row {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: start;
    gap: 8px 14px;
    padding: 10px 12px;
  }

  #fixedTasksView .fixed-task-cell {
    display: flex;
    align-items: baseline;
    gap: 7px;
  }

  #fixedTasksView .fixed-task-cell::before {
    flex: 0 0 auto;
    color: var(--muted);
    content: attr(data-label);
    font-size: var(--fs-2xs);
    font-weight: var(--fw-medium);
  }

  #fixedTasksView .fixed-task-name,
  #fixedTasksView .fixed-task-actions {
    grid-column: 1 / -1;
  }

  #fixedTasksView .fixed-task-name {
    flex-wrap: wrap;
  }

  #fixedTasksView .fixed-task-name .fixed-task-title-line,
  #fixedTasksView .fixed-task-note {
    width: 100%;
  }

  #fixedTasksView .fixed-task-actions {
    justify-content: flex-start;
  }

  #fixedTasksView .fixed-task-count {
    text-align: left;
  }
}

@media (max-width: 780px) {
  #fixedTasksView .fixed-task-page-head {
    gap: 8px;
  }

  #fixedTasksView .fixed-task-heading {
    flex-wrap: wrap;
    gap: 4px 8px;
  }

  #fixedTasksView .fixed-task-heading h3 {
    font-size: var(--fs-lg);
  }

  #fixedTasksView .fixed-task-cycle-meta {
    width: 100%;
  }

  #fixedTasksView .fixed-task-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  #fixedTasksView .fixed-task-toolbar .segmented {
    width: 100%;
  }

  #fixedTasksView .fixed-task-toolbar .primary-button {
    width: 100%;
  }

  body.is-fixed-tasks-view .topbar-actions .fixed-task-sort-toggle {
    display: inline-flex;
  }

  #fixedTasksView .fixed-task-summary {
    gap: 6px;
  }

  #fixedTasksView .fixed-task-summary-item {
    min-height: 46px;
    padding: 7px 9px;
  }

  #fixedTasksView .fixed-task-summary-item strong {
    font-size: var(--fs-lg);
  }

  #fixedTasksView .fixed-task-row {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 7px 10px;
    padding: 10px;
  }

  #fixedTasksView .fixed-task-name {
    align-items: flex-start;
    flex-direction: column;
  }

  #fixedTasksView .fixed-task-title-line {
    width: 100%;
    align-items: center;
  }

  #fixedTasksView .fixed-task-title-line h4 {
    white-space: normal;
  }

  #fixedTasksView .fixed-task-icon-action {
    width: 40px;
    min-width: 40px;
    height: 40px;
    min-height: 40px;
    flex-basis: 40px;
  }

  #fixedTasksView .fixed-task-actions .mini-actions {
    flex-wrap: wrap;
    justify-content: flex-start;
  }
}

/* ===== 按需求去掉部分页面顶部重复的文字 =====
   看板：删「OKR 管理台」+「经营看板」
   固定任务：删「OKR 管理台」（标题原本就已视觉隐藏）
   复盘：删「OKR 管理台」+「复盘」
   OKR：删日期跨度（#objectiveCycleMeta）
   其它页面（文档/文件/服务器看板/设置）不受影响。
   删除本块即可恢复原样。 */
body.is-dashboard-view #todayText,
body.is-fixed-tasks-view #todayText,
body.is-review-view #todayText {
  display: none;
}

body.is-dashboard-view #viewTitle,
body.is-review-view #viewTitle,
body.is-documents-view #viewTitle,
body.is-files-view #viewTitle {
  display: none;
}

/* 文档 / 文件页顶部的「OKR 管理台」也一并去掉。 */
body.is-documents-view #todayText,
body.is-files-view #todayText {
  display: none;
}

/* 复盘页：去掉「复盘 / 沉淀判断」这组页内标题（操作按钮保留）。 */
#reviewView > .page-head > div:first-child {
  display: none;
}

/* 推进周期页：去掉「推进周期」标题文字，保留右侧的范围说明。 */
.timeline-page-title h3 {
  display: none;
}

body.is-objectives-view #objectiveCycleMeta {
  display: none;
}

/* 左侧文字整块隐藏后，顶栏不再需要 66px 的最小高度，避免出现空白带。 */
body.is-dashboard-view .topbar,
body.is-review-view .topbar {
  min-height: 0;
}

/* 复盘页：导出/导入两个图标移到「保存复盘」右侧同一行。 */
#reviewDataTransferSlot {
  display: flex;
  align-items: center;
}

#reviewDataTransferSlot:empty {
  display: none;
}

/* 复盘页顶栏此时已无任何可见内容（标题与图标都已移走），整条隐藏避免留白。 */
body.is-review-view .topbar {
  display: none;
}

/* 文件页的「上传文件」按钮已从页面头部移到顶栏，排在导出/导入两个图标左侧。
   只在文件页显示；order:-1 保证它始终在最左，不受图标搬运顺序影响。 */
.files-upload-slot {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  order: -1;
}

body:not(.is-files-view) .files-upload-slot {
  display: none;
}

/* ===== 统一六个页面顶部工具栏 =====
   目标：切换页面时顶栏那一行的纵向位置、行高、文字与按钮完全一致。
   - 纵向起点：所有视图统一为 .main 的 28px 上内边距（取消 OKR/推进周期的 12px）
   - 行高：44px，内容垂直居中
   - 下间距：14px
   - 文字：说明文字 13px/常规/次要色；数字 13px/加粗/主色
   - 按钮：38px 高、13px 字、水平垂直居中
   - 分段控件：38px 高，段内文字居中
   删除本块即可回到各页面原有写法。 */

/* 纵向起点统一 */
body.is-objectives-view .main,
body.is-timeline-view .main {
  padding-top: 28px;
}

/* 行高、对齐、间距统一（放在最后，覆盖各视图原有的 min-height / margin / padding） */
body #objectivesView .objective-filter-row,
body #timelineView .timeline-page-head,
body #reviewView > .page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 44px;
  margin: 0 0 14px;
  padding: 0;
  border-bottom: 0;
}

/* 注意：这里不要写 display，否则会覆盖 OKR / 推进周期 / 复盘页原有的 display:none，
   把本该隐藏的顶栏重新显示出来。 */
body[class] .topbar {
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 44px;
  margin: 0 0 14px;
  padding: 0;
}

/* 行内说明文字统一为 13px / 常规 / 次要色 */
body .topbar .eyebrow,
body #objectivesView .objective-stat-line,
body #objectivesView .objective-cycle-meta,
body #timelineView .timeline-cycle-meta,
body #reviewView > .page-head .eyebrow {
  color: var(--muted);
  font-size: var(--fs-base);
  font-weight: var(--fw-normal);
}

/* 行内数字统一为 13px / 加粗 / 主色 */
body #objectivesView .objective-stat-line strong {
  color: var(--ink);
  font-size: var(--fs-base);
  font-weight: var(--fw-bold);
}

/* 行内表单标签（如「纵轴排序」）与其它说明文字统一为 13px / 常规 / 次要色 */
body #timelineView .timeline-page-head .field-label {
  color: var(--muted);
  font-size: var(--fs-base);
  font-weight: var(--fw-normal);
}

/* 固定任务顶栏的统计文字与 OKR 顶栏保持同一写法：13px / 常规 / 次要色 */
body.is-fixed-tasks-view .fixed-task-summary-item > span {
  color: var(--muted);
  font-size: var(--fs-base);
  font-weight: var(--fw-normal);
}

/* 按钮：38px 高、13px 字、文字水平垂直居中 */
body .topbar .primary-button,
body .topbar .ghost-button,
body .topbar .text-button,
body #objectivesView .objective-filter-row .primary-button,
body #objectivesView .objective-filter-row .ghost-button,
body #timelineView .timeline-page-head .primary-button,
body #timelineView .timeline-page-head .ghost-button,
body #reviewView > .page-head .primary-button,
body #reviewView > .page-head .ghost-button,
body.is-fixed-tasks-view .fixed-task-toolbar .primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 38px;
  min-height: 38px;
  padding: 0 14px;
  font-size: var(--fs-base);
  font-weight: var(--fw-medium);
  line-height: 1;
  text-align: center;
  white-space: nowrap;
}

/* 分段控件：38px 高，段内文字居中 */
body .topbar .segmented,
body #objectivesView .objective-filter-row .segmented,
body #timelineView .timeline-page-head .segmented {
  height: 38px;
  min-height: 38px;
  align-items: center;
}

/* 推进周期行内的「纵轴排序」：标签与下拉框改为同一行，避免把整行撑到 64px */
body #timelineView .timeline-page-head .filter-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: auto;
}

body #timelineView .timeline-page-head .filter-inline .field-label {
  margin: 0;
  white-space: nowrap;
}

body #timelineView .timeline-page-head .filter-inline .control {
  height: 38px;
  min-height: 38px;
  padding: 0 10px;
  font-size: var(--fs-base);
}

body #timelineView .timeline-page-head .timeline-toolbar {
  align-items: center;
}

body .topbar .segment,
body #objectivesView .objective-filter-row .segment,
body #timelineView .timeline-page-head .segment {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  font-size: var(--fs-base);
  line-height: 1;
  text-align: center;
  white-space: nowrap;
}
/* ===== 修正：顶栏按钮统一后带来的两个问题 ===== */

/* 1) 「新建文档」按钮只应在文档页出现。
   上面的按钮统一规则用了 body .topbar .primary-button（特异性 0,2,1），
   会盖掉 .document-topbar-new 原本的 display:none，导致看板/固定任务/文件页
   右上角也冒出这个按钮。这里用同等特异性、且位置更靠后的规则把它重新隐藏。 */
body:not(.is-documents-view) .document-topbar-new {
  display: none;
}

/* 2) 复盘页标题块已隐藏，页头只剩按钮组；
   space-between 对单个子元素等同于靠左，这里改为靠右。 */
body #reviewView > .page-head {
  justify-content: flex-end;
}

/* 复盘页：去掉四个指标卡（.metric-card）的投影，改用边框区分模块。 */
#reviewView .metric-card {
  box-shadow: none;
}

/* ===== OKR 页：精简卡片内部的浅色分隔线与盒子 =====
   只保留两处线：
     ① O 卡片最外层边框（.objective-card--full）
     ② 「关键结果」表头下方那条线（.kr-table-head 的 border-bottom）
   其余结构线条一律改为透明（而不是删掉），以保持原有 1px 占位与列对齐。 */
#objectivesView .objective-kr-section {
  border-top-color: transparent;
  background: transparent;
}

/* KR 行：去掉每行的边框与浅底 */
#objectivesView .kr-row {
  border-color: transparent;
  background: transparent;
}

/* 已删除的 KR 仍保留虚线标记，避免丢失状态信息 */
#objectivesView .kr-row.is-deleted {
  border-color: #c8ced0;
  border-style: dashed;
  background: #f5f6f6;
}

/* O 进度条那一行外框去掉 */
#objectivesView .objective-card--full .objective-progress-row {
  border-color: transparent;
  background: transparent;
}

/* 「开始 / 结束」小方框去掉边框与白底，只留文字 */
#objectivesView .schedule-range > span {
  border-color: transparent;
  background: transparent;
}

/* ===== 字重：重新确立 700 的使用范围 =====
   规则：正文 400 / 标签·按钮·卡片标题 600 / 仅区块标题与关键数字 700。
   上面已把裸 700 统一降为 600，这里把需要强调的几处改回 700。 */
.section-head h3 {
  font-weight: var(--fw-bold);
}
.server-resource-values strong {
  font-weight: var(--fw-bold);
}
.files-count {
  font-weight: var(--fw-bold);
}
.objective-boundary-count {
  font-weight: var(--fw-bold);
}

/* 卡片级标题（h4 / h5）统一为中等字重 600。
   浏览器默认给 h4/h5 是 bold(700)，会和“仅区块标题与数字用 700”的规则冲突。 */
h4,
h5 {
  font-weight: var(--fw-medium);
}

/* ===== OKR 卡片：标签移到筛选组右侧，与「负责人 · 权重」列对齐 ===== */
/* 筛选组只占前两列（拖动列 + 名称列），把第三列让给标签 */
body #objectivesView .objective-card--full .objective-progress-row > .objective-boundary {
  grid-column: 1 / 3;
}

/* 标签落在「负责人 · 权重」所在列（第 3 列），左边缘与该列表头对齐 */
body #objectivesView .objective-card--full .objective-progress-row > .objective-meta-line {
  grid-column: 3;
  grid-row: 1;
  min-width: 0;
  margin: 0;
  align-self: center;
  display: block;
}

body #objectivesView .objective-progress-row > .objective-meta-line .objective-context {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

/* 去掉「进行中 / 待开始 / 已完成 / 已删除」这组的外框与底色，变为纯文字 */
body #objectivesView .objective-kr-filter.segmented {
  padding: 0;
  border-color: transparent;
  background: transparent;
}

/* 选中项原本靠白底 + 阴影区分，去掉后改由文字颜色区分 */
body #objectivesView .objective-kr-filter .segment.is-active {
  background: transparent;
  box-shadow: none;
}

/* ===== OKR 页面垂直紧凑化 =====
   仅作用于 OKR 视图（看板复用的紧凑卡片不受影响）。
   逐项收紧卡片间距、内边距、行间距与表头留白。 */
#objectivesView #objectiveList {
  gap: 8px;
}

#objectivesView .objective-card--full .objective-summary {
  gap: 6px;
  /* 左右内边距保持 18px：与 KR 区块同宽，否则两套网格列宽会差 2px，标签对不齐 */
  padding: 8px 18px 6px;
}

#objectivesView .objective-card--full .objective-head {
  gap: 10px;
}

#objectivesView .objective-card--full .objective-title h4 {
  line-height: 1.25;
}

#objectivesView .objective-card--full .objective-title p {
  margin-top: 2px;
}

#objectivesView .objective-card--full .objective-progress-row {
  /* gap 必须与 .kr-row 的 10px 一致，否则两套网格列宽不同、标签会横向错位 */
  gap: 10px;
  padding: 6px 12px;
}

#objectivesView .objective-kr-section {
  gap: 4px;
  padding: 8px 18px 8px;
}

#objectivesView .kr-table-head {
  padding-bottom: 4px;
}

#objectivesView .kr-list {
  gap: 4px;
}

#objectivesView .kr-row {
  padding-top: 5px;
  padding-bottom: 5px;
}

/* 让「进行中 / 待开始 / 已完成 / 已删除」的左边界与「关键结果」表头对齐。
   表头有 41px 左内边距（让位给拖动列），而进度行只有 12px 行内边距，
   实测相差 27px，这里补齐。 */
body #objectivesView .objective-card--full .objective-progress-row > .objective-boundary {
  padding-left: 27px;
}

/* 标签是带 8px 内边距 + 1px 边框的「药丸」，盒左边界虽已与「负责人 · 权重」列对齐，
   但文字会再往右偏 9px，看起来像没对齐。这里整体左移 9px，让文字左边界落到列起点，
   与「负责人 · 权重」表头文字、以及 KR 行里的「老板 · 权重 3」文字处于同一竖线。 */
body #objectivesView .objective-progress-row > .objective-meta-line .objective-context {
  margin-left: -9px;
}

/* ===== 目标目录：压缩左右空白，百分比移到序号下方，让名称列拿到更多宽度 ===== */
/* 1) 面板与列表的左右留白收紧（原来右侧有 12px 面板内边距 + 2px 列表内边距
      + 滚动条预留 17px，合计近 30px 全被浪费）。*/
body.is-objectives-view #objectiveOutline {
  padding: 10px 8px;
}

body.is-objectives-view .objective-outline-list {
  padding: 8px 0;
  scrollbar-gutter: auto;
}

/* 2) 每一项改为三列两行网格：
      列：拖动 16px | 序号+百分比 30px | 名称 1fr
      行：第一行序号 / 第二行百分比，名称跨两行 */
body.is-objectives-view .objective-outline-item {
  grid-template-columns: 16px 30px minmax(0, 1fr);
  grid-template-rows: auto auto;
  gap: 2px 6px;
  padding: 7px 6px;
  align-items: start;
}

body.is-objectives-view .objective-outline-item .drag-handle {
  grid-column: 1;
  grid-row: 1 / span 2;
}

body.is-objectives-view .objective-outline-item .objective-outline-index {
  grid-column: 2;
  grid-row: 1;
  padding-top: 0;
}

body.is-objectives-view .objective-outline-item .objective-outline-progress {
  grid-column: 2;
  grid-row: 2;
  padding-top: 0;
  text-align: left;
}

body.is-objectives-view .objective-outline-item .objective-outline-title {
  grid-column: 3;
  grid-row: 1 / span 2;
}

/* 3) 收起态只有序号可见，改回单列居中；悬停展开时恢复三列 */
body.is-objective-outline-collapsed .objective-outline-item {
  grid-template-columns: minmax(0, 1fr);
  justify-items: center;
  min-width: 0;
}

/* 收起态只剩序号：必须放回第 1 列，否则原“序号在第 2 列”的定位会生成隐式列，
   把条目撑得比面板还宽（实测 71px > 56px）。 */
body.is-objective-outline-collapsed .objective-outline-item .objective-outline-index {
  grid-column: 1;
  grid-row: 1;
}

body.is-objective-outline-collapsed .objective-outline:hover .objective-outline-item,
body.is-objective-outline-collapsed .objective-outline:focus-within .objective-outline-item {
  grid-template-columns: 16px 30px minmax(0, 1fr);
  justify-items: stretch;
}

/* 悬停展开时序号回到第 2 列，与百分比上下叠放 */
body.is-objective-outline-collapsed .objective-outline:hover .objective-outline-item .objective-outline-index,
body.is-objective-outline-collapsed .objective-outline:focus-within .objective-outline-item .objective-outline-index {
  grid-column: 2;
  grid-row: 1;
}

@media (max-width: 780px) {
  .modal.okr-action-modal {
    width: 100%;
    max-width: none;
    max-height: 90vh;
  }

  .okr-action-card {
    height: 88vh;
    min-height: 0;
    max-height: 88vh;
  }
}

@media (min-width: 781px) {
  body.is-timeline-view .main {
    padding-top: 16px;
    padding-bottom: 12px;
  }

  #timelineView.is-visible {
    gap: 10px;
  }

  #timelineView .timeline-page-head {
    margin-bottom: 0;
  }

  .timeline-summary {
    min-height: 46px;
    padding: 7px 14px;
  }

  .timeline-scroll {
    min-height: calc(100vh - 205px);
    max-height: calc(100vh - 185px);
  }

  .timeline-line--kr .timeline-row-label {
    padding-left: 40px;
  }
}

@media (max-width: 780px) {
  .timeline-line--kr .timeline-row-label {
    padding-left: 34px;
  }
}

/* ===== 看板 2.09：周期状态 + 行动指标 + 异常队列 ===== */
#dashboardView.is-visible {
  gap: 14px;
}

.dashboard-cycle-bar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.dashboard-cycle-bar.is-ended {
  border-color: rgba(184, 74, 63, 0.28);
  background: linear-gradient(180deg, var(--red-soft), var(--surface) 70%);
}

.dashboard-cycle-main {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}

.dashboard-cycle-name {
  font-size: var(--fs-lg);
}

.dashboard-cycle-dates {
  color: var(--muted);
  font-size: var(--fs-sm);
}

.dashboard-cycle-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
}

.dashboard-cycle-progress {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 3px;
  background: var(--surface-soft);
}

.dashboard-cycle-progress span {
  display: block;
  height: 100%;
  background: var(--accent);
}

.dashboard-cycle-bar.is-ended .dashboard-cycle-progress span {
  background: var(--red);
}

.dashboard-metrics .metric-card {
  min-width: 0;
}

.dashboard-metrics .metric-card strong {
  overflow-wrap: anywhere;
  font-size: var(--fs-xl);
  line-height: 1.15;
}

@media (max-width: 780px) {
  .dashboard-metrics .metric-card strong {
    font-size: var(--fs-lg);
  }
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
  gap: 14px;
  align-items: start;
}

.dashboard-panel {
  min-width: 0;
  padding: 16px 18px;
}

.dashboard-panel .section-head {
  margin-bottom: 10px;
}

.dashboard-count {
  color: var(--muted);
  font-size: var(--fs-sm);
  white-space: nowrap;
}

.dashboard-objective-list {
  display: grid;
}

.dashboard-objective-row {
  display: grid;
  gap: 7px;
  padding: 11px 0;
  border-top: 1px solid var(--line);
}

.dashboard-objective-row:first-child {
  padding-top: 0;
  border-top: 0;
}

.dashboard-objective-head {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  gap: 10px;
}

.dashboard-objective-code {
  display: inline-grid;
  min-width: 36px;
  min-height: 24px;
  flex: 0 0 auto;
  place-items: center;
  padding: 0 6px;
  border-radius: 5px;
  color: var(--accent-strong);
  background: var(--accent-soft);
  font-size: var(--fs-sm);
  font-weight: var(--fw-bold);
}

.dashboard-objective-title {
  display: grid;
  min-width: 0;
  flex: 1 1 auto;
  gap: 2px;
}

.dashboard-objective-title strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-objective-title small {
  color: var(--muted);
  font-size: var(--fs-sm);
}

.dashboard-objective-stats {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: var(--fs-sm);
}

.dashboard-objective-stats strong {
  color: var(--ink);
}

.dashboard-task-list {
  display: grid;
}

.dashboard-task-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.dashboard-task-row:first-child {
  padding-top: 0;
  border-top: 0;
}

.dashboard-task-main {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.dashboard-task-main strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-task-main small,
.dashboard-task-side small {
  color: var(--muted);
  font-size: var(--fs-sm);
}

.dashboard-task-side {
  display: grid;
  flex: 0 0 auto;
  justify-items: end;
  gap: 3px;
}

.dashboard-task-status {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 6px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  color: var(--muted);
  font-size: var(--fs-2xs);
  font-weight: var(--fw-medium);
  white-space: nowrap;
}

.dashboard-task-status--todo {
  border-color: rgba(195, 122, 24, 0.28);
  color: var(--amber);
  background: var(--yellow-soft);
}

.dashboard-task-status--overdue {
  border-color: rgba(185, 64, 54, 0.28);
  color: var(--red);
  background: var(--red-soft);
}

.dashboard-task-status--done {
  border-color: rgba(34, 116, 89, 0.25);
  color: var(--accent-strong);
  background: var(--accent-soft);
}

.dashboard-risk-list {
  display: grid;
  gap: 7px;
}

.dashboard-risk-row {
  display: grid;
  width: 100%;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  padding: 8px 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: inherit;
  background: var(--surface);
  text-align: left;
  cursor: pointer;
}

.dashboard-risk-row:hover {
  border-color: var(--accent);
}

.dashboard-risk-type {
  display: inline-grid;
  min-height: 24px;
  place-items: center;
  border-radius: 5px;
  font-size: var(--fs-2xs);
  font-weight: var(--fw-bold);
  white-space: nowrap;
}

.dashboard-risk-type--objective {
  color: var(--accent-strong);
  background: var(--accent-soft);
}

.dashboard-risk-type--kr {
  color: var(--blue);
  background: #eaf2ff;
}

.dashboard-risk-type--task {
  color: var(--amber);
  background: var(--yellow-soft);
}

.dashboard-risk-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.dashboard-risk-copy strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-risk-copy small {
  overflow: hidden;
  color: var(--muted);
  font-size: var(--fs-sm);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-risk-owner {
  color: var(--muted);
  font-size: var(--fs-sm);
  white-space: nowrap;
}

.dashboard-kr-health {
  display: grid;
  gap: 8px;
}

.dashboard-kr-health-head {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 2px;
}

.dashboard-kr-health-head strong {
  font-size: var(--fs-2xl);
  line-height: 1;
}

.dashboard-kr-health-head span {
  color: var(--muted);
  font-size: var(--fs-sm);
}

.dashboard-kr-health-row {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) 24px;
  gap: 8px;
  align-items: center;
  font-size: var(--fs-sm);
}

.dashboard-kr-health-label {
  color: var(--muted);
  white-space: nowrap;
}

.dashboard-kr-health-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-soft);
}

.dashboard-kr-health-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.dashboard-kr-health-row.is-zero .dashboard-kr-health-track span {
  background: var(--line-strong);
}

.dashboard-kr-health-row.is-low .dashboard-kr-health-track span {
  background: var(--red);
}

.dashboard-kr-health-row.is-mid .dashboard-kr-health-track span {
  background: var(--amber);
}

.dashboard-kr-health-row.is-done .dashboard-kr-health-track span {
  background: var(--blue);
}

.dashboard-kr-health-row strong {
  text-align: right;
}

@media (max-width: 1120px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 780px) {
  #dashboardView.is-visible {
    gap: 12px;
  }

  .dashboard-cycle-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 12px 14px 16px;
  }

  .dashboard-cycle-main {
    gap: 5px 8px;
  }

  .dashboard-cycle-actions {
    justify-content: flex-start;
  }

  .dashboard-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .dashboard-metrics .metric-card {
    min-height: 104px;
    padding: 14px;
  }

  .dashboard-panel {
    padding: 14px;
  }

  .dashboard-risk-row {
    grid-template-columns: 36px minmax(0, 1fr);
  }

  .dashboard-risk-owner {
    display: none;
  }

  .dashboard-kr-health-row {
    grid-template-columns: 46px minmax(0, 1fr) 20px;
  }
}

/* ===== 复盘 2.10：结论先行 + 分层证据 ===== */
#reviewView.is-visible {
  gap: 14px;
}

.review-cycle-bar {
  margin-bottom: 0;
}

.review-metric-grid {
  margin-bottom: 0;
}

.review-metric-grid .metric-card strong {
  overflow-wrap: anywhere;
  font-size: var(--fs-xl);
  line-height: 1.15;
}

.review-evidence-panel {
  margin-bottom: 0;
}

.review-evidence {
  display: grid;
  gap: 8px;
}

.review-evidence-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.review-evidence-facts span {
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--muted);
  background: var(--surface);
  font-size: var(--fs-sm);
}

.review-evidence-facts strong {
  color: var(--ink);
}

.review-evidence p {
  margin: 0;
  color: var(--muted);
  font-size: var(--fs-sm);
}

.review-analysis-panel {
  margin-bottom: 0;
}

.review-kr-groups {
  display: grid;
  gap: 16px;
}

.review-kr-group {
  display: grid;
  gap: 9px;
}

.review-kr-group-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 7px;
  border-bottom: 1px solid var(--line);
}

.review-kr-group-head h4 {
  margin: 0 0 2px;
  font-size: var(--fs-md);
}

.review-kr-group-head p {
  margin: 0;
  color: var(--muted);
  font-size: var(--fs-sm);
}

.review-kr-group .review-kr-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.review-form-section {
  display: grid;
  gap: 10px;
}

.review-form-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 7px;
  border-bottom: 1px solid var(--line);
}

.review-form-section-head h4 {
  margin: 0;
  font-size: var(--fs-md);
}

.review-form-section-head p {
  margin: 0;
  color: var(--muted);
  font-size: var(--fs-sm);
}

.review-form-section .review-grid {
  margin: 0;
}

@media (max-width: 1120px) {
  .review-kr-group .review-kr-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 780px) {
  #reviewView.is-visible {
    gap: 12px;
  }

  .review-cycle-bar {
    align-items: stretch;
  }

  .review-metric-grid {
    gap: 10px;
  }

  .review-metric-grid .metric-card {
    min-height: 104px;
    padding: 14px;
  }

  .review-metric-grid .metric-card strong {
    font-size: var(--fs-lg);
  }

  .review-kr-group-head,
  .review-form-section-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
  }

  .review-form-section .review-grid {
    grid-template-columns: 1fr;
  }
}

/* ===== 看板 2.14：今日工作台 ===== */
#dashboardView.is-visible {
  gap: 14px;
}

.dashboard-today {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 14px;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.dashboard-today strong {
  font-size: var(--fs-xl);
}

.dashboard-today span {
  color: var(--muted);
  font-size: var(--fs-base);
}

.dashboard-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.dashboard-stat-card {
  display: grid;
  gap: 8px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: inherit;
  background: var(--surface);
  text-align: left;
  cursor: pointer;
}

.dashboard-stat-card:hover,
.dashboard-stat-card[aria-expanded="true"] {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(34, 116, 89, 0.12);
}

.dashboard-stat-label {
  color: var(--muted);
  font-size: var(--fs-base);
}

.dashboard-stat-line {
  color: var(--ink);
  font-size: var(--fs-md);
  line-height: 1.5;
}

.dashboard-stat-line strong {
  font-size: var(--fs-xl);
}

.dashboard-stat-hint {
  color: var(--muted);
  font-size: var(--fs-sm);
}

.dashboard-detail {
  display: grid;
  gap: 16px;
  padding: 16px 18px;
}

.dashboard-detail[hidden] {
  display: none;
}

.dashboard-detail-section {
  display: grid;
  gap: 8px;
}

.dashboard-detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
}

.dashboard-detail-head h4 {
  margin: 0;
  font-size: var(--fs-md);
}

.dashboard-detail-head span {
  color: var(--muted);
  font-size: var(--fs-sm);
}

.dashboard-detail-list {
  display: grid;
}

.dashboard-detail-more {
  margin: 0;
  color: var(--muted);
  font-size: var(--fs-sm);
}

.dashboard-kr-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-top: 1px solid var(--line);
}

.dashboard-kr-row:first-child {
  padding-top: 0;
  border-top: 0;
}

.dashboard-kr-main {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.dashboard-kr-main strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-kr-main small,
.dashboard-kr-side small {
  color: var(--muted);
  font-size: var(--fs-sm);
}

.dashboard-kr-side {
  display: grid;
  flex: 0 0 auto;
  justify-items: end;
  gap: 2px;
}

.dashboard-kr-side strong {
  font-size: var(--fs-md);
}

@media (max-width: 780px) {
  .dashboard-card-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .dashboard-today {
    padding: 12px 14px;
  }

  .dashboard-stat-card {
    padding: 14px;
  }

  .dashboard-detail {
    padding: 14px;
  }
}

.dashboard-task-columns {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.dashboard-task-column {
  display: grid;
  gap: 16px;
  min-width: 0;
}

@media (max-width: 1120px) {
  .dashboard-task-columns {
    grid-template-columns: 1fr;
  }
}

/* ===== 复盘 2.15：周期目录 + 区间统计 =====
   复盘页改为两列：左列是固定的「周期」目录（年 / 月 / 日），右列是统计块与三组正文。
   目录沿用目标目录的视觉语言（浅绿选中态 + 左侧强调条），但不复用其收起/抽屉/拖动逻辑，
   类名全部独立，避免影响 OKR 页。删除本块即可回到单列复盘页。 */
#reviewView.is-visible {
  grid-template-columns: 200px minmax(0, 1fr);
  column-gap: 16px;
  row-gap: 14px;
  align-items: start;
}

#reviewView > .page-head {
  grid-column: 1 / -1;
}

.review-period-outline {
  position: sticky;
  top: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  grid-column: 1;
  grid-row: 2 / span 2;
  gap: 0;
  align-content: start;
  height: calc(100vh - 134px);
  min-height: 420px;
  max-height: 100vh;
  padding: 0 12px 0 0;
  overflow: hidden;
  border-right: 1px solid var(--line-strong);
  background: transparent;
}

.review-period-outline-head {
  display: flex;
  min-height: 42px;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 4px 8px;
  border-bottom: 1px solid var(--line);
}

.review-period-outline-head h4 {
  margin: 0 0 2px;
  font-size: var(--fs-base);
  font-weight: var(--fw-bold);
}

.review-period-outline-head span {
  color: var(--accent-strong);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
}

.review-period-outline-body {
  display: grid;
  gap: 12px;
  align-content: start;
  overflow-y: auto;
  padding: 10px 2px 10px 0;
  scrollbar-gutter: stable;
}

.review-period-group {
  display: grid;
  gap: 6px;
}

.review-period-group-title {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin: 0;
  color: var(--muted);
  font-size: var(--fs-sm);
}

.review-period-group-title span {
  font-size: var(--fs-2xs);
}

.review-period-years,
.review-period-months {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
}

.review-period-days {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 4px;
}

.review-period-chip {
  display: inline-flex;
  min-width: 0;
  min-height: 28px;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--ink);
  background: transparent;
  font-family: inherit;
  font-size: var(--fs-sm);
  white-space: nowrap;
  cursor: pointer;
}

.review-period-chip:hover,
.review-period-chip:focus-visible {
  border-color: var(--line-strong);
  background: var(--surface-soft);
  outline: none;
}

.review-period-chip.is-active {
  border-color: rgba(34, 116, 89, 0.18);
  color: var(--accent-strong);
  background: var(--accent-soft);
  font-weight: var(--fw-medium);
  box-shadow: inset 3px 0 0 var(--accent);
}

.review-period-main {
  display: grid;
  grid-column: 2;
  grid-row: 2 / span 2;
  gap: 14px;
  min-width: 0;
}

.review-period-stats {
  display: grid;
  gap: 10px;
}

.review-period-stats-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.review-period-stats-head h3 {
  margin: 0;
  font-size: var(--fs-lg);
}

/* 两张统计卡并排，与看板 .dashboard-card-grid 一致；1120px 以下改为上下单列。 */
.review-period-rows {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.review-period-row {
  display: grid;
  gap: 6px;
  align-content: start;
  width: 100%;
  margin: 0;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--surface);
  font-family: inherit;
  font-size: var(--fs-base);
  text-align: left;
  cursor: pointer;
}

.review-period-row:hover,
.review-period-row:focus-visible,
.review-period-row.is-open {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(34, 116, 89, 0.12);
  outline: none;
}

.review-period-row-label {
  color: var(--muted);
  font-size: var(--fs-base);
}

.review-period-row-line {
  color: var(--ink);
  font-size: var(--fs-md);
  line-height: 1.5;
}

.review-period-row strong {
  color: var(--accent-strong);
  font-size: var(--fs-xl);
  font-weight: var(--fw-bold);
}

.review-period-row-hint {
  color: var(--muted);
  font-size: var(--fs-sm);
}

.review-period-row.is-open .review-period-row-hint {
  color: var(--accent-strong);
}

.review-period-detail {
  margin-top: 2px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.review-period-detail-note {
  margin: 0;
  color: var(--muted);
  font-size: var(--fs-sm);
}

.review-period-note {
  margin: 0;
  color: var(--muted);
  font-size: var(--fs-sm);
  line-height: 1.5;
}

/* 1361px 及以下：目录收窄，日期改为 7 列，正文仍与目录并排。 */
@media (max-width: 1360px) {
  #reviewView.is-visible {
    grid-template-columns: 168px minmax(0, 1fr);
  }

  .review-period-outline {
    height: calc(100vh - 120px);
    min-height: 360px;
    padding-right: 10px;
  }

  .review-period-days {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .review-period-years,
  .review-period-months {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* 780px 及以下：目录改为统计块上方的横向选择区，不再固定左侧。 */
@media (max-width: 780px) {
  #reviewView.is-visible {
    grid-template-columns: minmax(0, 1fr);
    row-gap: 12px;
  }

  .review-period-outline {
    position: static;
    grid-column: 1;
    grid-row: 2;
    width: auto;
    height: auto;
    min-height: 0;
    max-height: none;
    padding: 0 0 12px;
    overflow: visible;
    border-right: 0;
    border-bottom: 1px solid var(--line-strong);
  }

  .review-period-outline-body {
    gap: 10px;
    max-height: 320px;
    overflow-y: auto;
  }

  .review-period-main {
    grid-column: 1;
    grid-row: 3;
  }

  .review-period-days {
    grid-template-columns: repeat(7, minmax(0, 1fr));
  }

  .review-period-years,
  .review-period-months {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .review-period-chip {
    min-height: 32px;
  }

  .review-period-stats-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .review-period-row {
    padding: 10px;
    gap: 2px 10px;
    font-size: var(--fs-sm);
  }

  .review-period-row strong {
    font-size: var(--fs-md);
  }

  .review-period-row-hint {
    flex-basis: auto;
    margin-left: 0;
  }

  /* 明细里的两栏在手机上改为单列，与看板一致。 */
  .review-period-detail .dashboard-task-columns {
    grid-template-columns: 1fr;
  }
}

/* 1120px 及以下：两张统计卡改为上下单列，与看板卡片断点一致。 */
@media (max-width: 1120px) {
  .review-period-rows {
    grid-template-columns: 1fr;
  }
}

/* ===== 富文本结构样式：表格 / 代码块 / 分割线 =====
   编辑器、预览区、备注弹窗三处共用同一套规则，避免「编辑时正常、预览时乱」。
   表格外层由 sanitizeMemoHtml 套上 .rich-table-wrap，窄屏横向滚动不撑破布局。 */
.document-editor table,
.document-preview-content table,
.memo-editor table {
  width: 100%;
  border-collapse: collapse;
  border-spacing: 0;
  margin: 0 0 12px;
  font-size: var(--fs-base);
}

.document-editor th,
.document-editor td,
.document-preview-content th,
.document-preview-content td,
.memo-editor th,
.memo-editor td {
  padding: 7px 10px;
  border: 1px solid var(--line-strong);
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
}

.document-editor th,
.document-preview-content th,
.memo-editor th {
  background: var(--surface-soft);
  font-weight: var(--fw-medium);
  white-space: nowrap;
}

.document-editor caption,
.document-preview-content caption,
.memo-editor caption {
  padding: 0 0 6px;
  color: var(--muted);
  font-size: var(--fs-sm);
  text-align: left;
}

/* 表格横向滚动容器：列多时只在容器内滚动，不撑宽整页。 */
.rich-table-wrap {
  max-width: 100%;
  margin: 0 0 12px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.rich-table-wrap table {
  margin-bottom: 0;
  min-width: 320px;
}

.document-editor pre,
.document-preview-content pre,
.memo-editor pre {
  margin: 0 0 12px;
  padding: 12px 14px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  line-height: 1.6;
  white-space: pre;
  scrollbar-width: thin;
}

.document-editor code,
.document-preview-content code,
.memo-editor code {
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--surface-soft);
  font-family: var(--font-mono);
  font-size: 0.92em;
}

.document-editor pre code,
.document-preview-content pre code,
.memo-editor pre code {
  padding: 0;
  background: transparent;
  font-size: inherit;
}

.document-editor hr,
.document-preview-content hr,
.memo-editor hr {
  height: 0;
  margin: 16px 0;
  border: 0;
  border-top: 1px solid var(--line-strong);
}

.document-editor blockquote,
.document-preview-content blockquote,
.memo-editor blockquote {
  margin: 0 0 12px;
  padding: 6px 0 6px 12px;
  border-left: 3px solid var(--line-strong);
  color: var(--muted);
}

.document-editor del,
.document-preview-content del,
.memo-editor del {
  color: var(--muted);
}

@media (max-width: 780px) {
  .document-editor th,
  .document-editor td,
  .document-preview-content th,
  .document-preview-content td,
  .memo-editor th,
  .memo-editor td {
    padding: 6px 8px;
  }
}

/* ===== 文档内嵌图片 =====
   图片以 <p><img></p> 的形式插入，保持段落结构；宽度自适应编辑区，
   点击图片可选中（便于删除），拖拽进入编辑区时整块高亮提示可放下。 */
.document-editor img,
.document-preview-content img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  cursor: default;
}

.document-editor p:has(> img),
.document-preview-content p:has(> img) {
  margin: 0 0 12px;
}

/* 上传中的占位提示，上传成功后会被替换成真实图片。 */
.document-image-uploading {
  padding: 10px 12px;
  border: 1px dashed var(--line-strong);
  border-radius: 6px;
  color: var(--muted);
  background: var(--surface-soft);
  font-size: var(--fs-sm);
}

/* 拖拽悬停反馈 */
.document-editor.is-image-drag-over {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 0 3px rgba(34, 116, 89, 0.14);
}

.document-editor.is-image-drag-over::after {
  display: block;
  padding: 8px 0 0;
  color: var(--accent-strong);
  font-size: var(--fs-sm);
  text-align: center;
  content: "松开即可插入图片";
}



