/* ==========================================================================
   日报 · 样式
   1 设计变量  2 基础  3 通用组件  4 顶栏  5 日历  6 当日面板  7 报告
   8 提示/对话框  9 响应式  10 打印 / 减弱动效
   ========================================================================== */

/* ---------- 1. 设计变量 ---------- */
:root {
  color-scheme: light;
  --font: system-ui, -apple-system, "Segoe UI", "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei UI", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", Consolas, monospace;

  --bg: #f2f3fb;
  --surface: rgba(255, 255, 255, 0.84);
  --surface-solid: #ffffff;
  --surface-2: #f1f3fa;
  --surface-3: #e5e8f4;
  --border: rgba(35, 45, 110, 0.09);
  --border-strong: rgba(35, 45, 110, 0.18);

  --text: #151a33;
  --text-2: #475072;
  --text-3: #8a91b0;

  --accent: #6366f1;
  --accent-ink: #4f46e5;
  --accent-soft: rgba(99, 102, 241, 0.1);
  --accent-ring: rgba(99, 102, 241, 0.32);
  --grad: linear-gradient(135deg, #6366f1 0%, #8b5cf6 55%, #b36bf5 100%);

  --ok: #10b981;
  --ok-ink: #059669;
  --ok-soft: rgba(16, 185, 129, 0.13);
  --warn: #f59e0b;
  --warn-ink: #c2710c;
  --warn-soft: rgba(245, 158, 11, 0.15);
  --danger: #ef4444;
  --danger-soft: rgba(239, 68, 68, 0.11);
  --weekend: #e0507a;
  /* 法定假期(休)/ 调休上班(班) */
  --off-solid: #e0507a;
  --off-ink: #cf3f69;
  --off-soft: rgba(224, 80, 122, 0.075);
  --work-solid: #0284c7;
  --work-ink: #0369a1;
  --work-soft: rgba(2, 132, 199, 0.075);

  --ink-bg: #151a33;
  --ink-fg: #ffffff;
  --ink-action: #a5b4fc;

  --shadow-1: 0 1px 2px rgba(25, 30, 80, 0.06);
  --shadow-2: 0 14px 34px -16px rgba(40, 50, 130, 0.25), 0 2px 6px rgba(40, 50, 130, 0.05);
  --shadow-pop: 0 24px 60px -16px rgba(30, 40, 120, 0.4);

  --glow-1: rgba(99, 102, 241, 0.2);
  --glow-2: rgba(236, 72, 153, 0.12);
  --glow-3: rgba(14, 165, 233, 0.13);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b0d19;
  --surface: rgba(25, 28, 48, 0.78);
  --surface-solid: #181b2f;
  --surface-2: #20243b;
  --surface-3: #2c3150;
  --border: rgba(165, 175, 255, 0.1);
  --border-strong: rgba(165, 175, 255, 0.22);

  --text: #eceefb;
  --text-2: #b6bbd8;
  --text-3: #7e85a9;

  --accent: #8189f8;
  --accent-ink: #a9b4ff;
  --accent-soft: rgba(129, 137, 248, 0.15);
  --accent-ring: rgba(129, 137, 248, 0.42);

  --ok: #34d399;
  --ok-ink: #5eead4;
  --ok-soft: rgba(52, 211, 153, 0.15);
  --warn: #fbbf24;
  --warn-ink: #fcd34d;
  --warn-soft: rgba(251, 191, 36, 0.15);
  --danger-soft: rgba(248, 113, 113, 0.15);
  --weekend: #f472a0;
  --off-ink: #f58db0;
  --off-soft: rgba(244, 114, 160, 0.11);
  --work-ink: #7dd3fc;
  --work-soft: rgba(56, 189, 248, 0.11);

  --ink-bg: #eceefb;
  --ink-fg: #151a33;
  --ink-action: #4f46e5;

  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-2: 0 14px 34px -16px rgba(0, 0, 0, 0.7), 0 2px 6px rgba(0, 0, 0, 0.25);
  --shadow-pop: 0 24px 60px -16px rgba(0, 0, 0, 0.8);

  --glow-1: rgba(99, 102, 241, 0.22);
  --glow-2: rgba(236, 72, 153, 0.1);
  --glow-3: rgba(14, 165, 233, 0.1);
}

/* ---------- 2. 基础 ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scrollbar-width: thin;
  scrollbar-color: var(--surface-3) transparent;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

/* 背景光晕 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(760px 460px at 6% -6%, var(--glow-1), transparent 62%),
    radial-gradient(640px 420px at 100% 2%, var(--glow-2), transparent 62%),
    radial-gradient(760px 520px at 62% 112%, var(--glow-3), transparent 62%);
}

body.no-scroll {
  overflow: hidden;
}

button,
input,
textarea {
  font: inherit;
  color: inherit;
}

button {
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

[hidden] {
  display: none !important;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

* {
  scrollbar-width: thin;
  scrollbar-color: var(--surface-3) transparent;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

/* 图标:跟随父元素字号 */
.ico,
[data-icon] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
}

.ico svg,
[data-icon] svg {
  width: 1.15em;
  height: 1.15em;
}

main {
  max-width: 1500px;
  margin: 0 auto;
  padding: 24px clamp(14px, 3vw, 32px) 56px;
  transition: opacity 0.3s ease;
}

body.loading main {
  opacity: 0;
}

.view {
  animation: view-in 0.35s ease backwards;
}

/* ---------- 3. 通用组件 ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: var(--shadow-2);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  backdrop-filter: blur(16px) saturate(140%);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 18px;
  border-radius: 13px;
  font-size: 14px;
  font-weight: 650;
  white-space: nowrap;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.btn:active:not(:disabled) {
  transform: scale(0.97);
}

.btn-sm {
  height: 34px;
  padding: 0 14px;
  border-radius: 11px;
  font-size: 13.5px;
}

.btn-primary {
  color: #fff;
  background: var(--grad);
  box-shadow: 0 8px 20px -8px rgba(99, 102, 241, 0.75), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.btn-primary:hover:not(:disabled) {
  box-shadow: 0 10px 26px -8px rgba(99, 102, 241, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  filter: brightness(1.05);
}

.btn-ghost {
  color: var(--text-2);
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.btn-ghost:hover:not(:disabled) {
  color: var(--text);
  border-color: var(--border-strong);
}

.btn-danger {
  color: #fff;
  background: linear-gradient(135deg, #f87171, #ef4444);
  box-shadow: 0 8px 20px -8px rgba(239, 68, 68, 0.7);
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: 12px;
  font-size: 17px;
  color: var(--text-2);
  transition: background 0.15s ease, color 0.15s ease;
}

.icon-btn:hover {
  color: var(--text);
  background: var(--surface-2);
}

/* 分段控件 */
.seg {
  display: inline-flex;
  gap: 2px;
  padding: 4px;
  border-radius: 15px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.seg-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 16px;
  border-radius: 11px;
  font-size: 14px;
  font-weight: 650;
  color: var(--text-3);
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.seg-btn:hover {
  color: var(--text);
}

.seg-btn.active {
  color: var(--text);
  background: var(--surface-solid);
  box-shadow: var(--shadow-1), 0 4px 12px -6px rgba(40, 50, 130, 0.3);
}

.seg-btn.active [data-icon] {
  color: var(--accent);
}

.seg-sm .seg-btn {
  height: 30px;
  padding: 0 14px;
  font-size: 13px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

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

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

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

.badge {
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-2);
  background: var(--surface-2);
}

.badge.today {
  color: #fff;
  background: var(--grad);
}

/* 日详情里的"休 · 国庆节" / "班 · 国庆节调休" */
.badge.hol {
  color: #fff;
  background: var(--off-solid);
}

.badge.hol.work {
  background: var(--work-solid);
}

.tag {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 650;
  white-space: nowrap;
  color: hsl(var(--h) 55% 34%);
  background: hsl(var(--h) 90% 94%);
}

:root[data-theme="dark"] .tag {
  color: hsl(var(--h) 85% 80%);
  background: hsl(var(--h) 42% 23%);
}

kbd {
  padding: 1px 6px;
  border: 1px solid var(--border-strong);
  border-bottom-width: 2px;
  border-radius: 6px;
  font-family: var(--mono);
  font-size: 11px;
  white-space: nowrap;
  background: var(--surface-2);
}

code {
  padding: 1px 6px;
  border-radius: 6px;
  font-family: var(--mono);
  font-size: 11.5px;
  white-space: nowrap;
  color: var(--accent-ink);
  background: var(--accent-soft);
}

.link-btn {
  font-size: 12.5px;
  font-weight: 650;
  color: var(--accent-ink);
  border-radius: 8px;
  padding: 2px 8px;
}

.link-btn:hover {
  background: var(--accent-soft);
}

/* ---------- 4. 顶栏 ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 18px;
  height: 66px;
  padding: 0 clamp(14px, 3vw, 32px);
  background: color-mix(in srgb, var(--bg) 70%, transparent);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  backdrop-filter: blur(18px) saturate(160%);
  border-bottom: 1px solid var(--border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  color: #fff;
  background: var(--grad);
  box-shadow: 0 8px 18px -6px rgba(99, 102, 241, 0.75), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.brand-mark svg {
  width: 21px;
  height: 21px;
  stroke-width: 2.2;
}

.brand-name {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.brand-name small {
  margin-left: 6px;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.04em;
  color: var(--text-3);
}

.topbar-spacer {
  flex: 1;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  padding: 0 13px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-2);
  background: var(--surface-2);
  border: 1px solid var(--border);
  white-space: nowrap;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 3px var(--ok-soft);
  transition: background 0.2s ease;
}

.status[data-mode="local"] .status-dot {
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.status[data-state="saving"] .status-dot {
  background: var(--warn);
  box-shadow: 0 0 0 3px var(--warn-soft);
  animation: pulse 0.9s ease-in-out infinite;
}

.status[data-state="error"] {
  color: var(--danger);
}

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

.menu-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.user-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 12px 0 5px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.user-btn:hover {
  border-color: var(--border-strong);
  background: var(--surface-solid);
  box-shadow: var(--shadow-1);
}

.user-avatar {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  flex: none;
  border-radius: 50%;
  font-size: 12.5px;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, hsl(var(--h, 243) 78% 58%), hsl(calc(var(--h, 243) + 32) 78% 50%));
  box-shadow: 0 2px 6px -1px hsla(var(--h, 243) 70% 45% / 0.45);
}

.user-name {
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

.menu {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  z-index: 70;
  min-width: 274px;
  padding: 8px;
  border-radius: 18px;
  background: var(--surface-solid);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-pop);
  animation: pop-in 0.18s ease;
}

.menu-user-head {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 8px 10px 10px;
}

.menu-user-head .user-avatar {
  width: 34px;
  height: 34px;
  font-size: 15px;
}

.menu-user-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.menu-user-info b {
  font-size: 14.5px;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.menu-user-info span {
  font-size: 11.5px;
  color: var(--text-3);
}

.menu-divider {
  height: 1px;
  margin: 6px 4px;
  background: var(--border);
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 10px 12px;
  border-radius: 11px;
  font-size: 14px;
  text-align: left;
}

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

.menu-item.danger {
  color: var(--danger);
}

.menu-item.danger:hover {
  background: var(--danger-soft);
}

.menu-note {
  margin-top: 6px;
  padding: 10px 12px 6px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  line-height: 1.55;
  color: var(--text-3);
}

/* ---------- 5. 日历 ---------- */
.view-calendar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 396px;
  gap: 22px;
  align-items: start;
}

.cal-card {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 116px);
  padding: 22px 22px 20px;
}

.cal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px 20px;
  margin-bottom: 18px;
}

.cal-title-wrap {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
}

.cal-title {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-left: -10px;
  padding: 2px 10px;
  border-radius: 14px;
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.25;
  transition: background 0.15s ease;
}

.cal-title:hover {
  background: var(--surface-2);
}

.cal-title .yr {
  font-size: 22px;
  font-weight: 650;
  color: var(--text-3);
}

.cal-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.cal-head-right {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.cal-weekdays,
.cal-grid {
  display: grid;
  grid-template-columns: 40px repeat(7, minmax(0, 1fr));
  gap: 8px;
}

.cal-weekdays {
  margin-bottom: 8px;
}

.cal-weekdays span {
  text-align: center;
  font-size: 12.5px;
  font-weight: 650;
  letter-spacing: 0.06em;
  color: var(--text-3);
}

.cal-weekdays .weekend {
  color: var(--weekend);
  opacity: 0.85;
}

.cal-grid {
  flex: 1;
  grid-template-rows: repeat(var(--rows, 6), minmax(104px, 1fr));
  /* 格子里显示多少内容取决于日历自身的宽度(窗口宽度相同时,双栏和单栏的日历宽度差很多),
     所以用容器查询而不是窗口媒体查询,见 .day-dots 后面的 @container cal */
  container: cal / inline-size;
}

/* 周序号:点击直接查看该周周报 */
.wk {
  align-self: start;
  justify-self: center;
  width: 32px;
  height: 32px;
  margin-top: 7px;
  border-radius: 11px;
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text-3);
  transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.wk:hover {
  color: var(--accent-ink);
  background: var(--accent-soft);
  transform: scale(1.06);
}

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

.day {
  --tint: linear-gradient(transparent, transparent); /* 假期 / 调休日的淡淡底色,见下面两条 */
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  padding: 8px 9px 8px;
  border: 1px solid var(--border);
  border-radius: 16px;
  text-align: left;
  background: var(--tint), color-mix(in srgb, var(--surface-solid) 62%, transparent);
  transition: background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.day.hol-off {
  --tint: linear-gradient(var(--off-soft), var(--off-soft));
}

.day.hol-work {
  --tint: linear-gradient(var(--work-soft), var(--work-soft));
}

.day:hover {
  background: var(--tint), var(--surface-solid);
  border-color: var(--border-strong);
  box-shadow: 0 10px 22px -14px rgba(40, 50, 130, 0.45);
  transform: translateY(-1px);
}

.day.out {
  background: transparent;
  border-color: transparent;
  opacity: 0.5;
}

.day.out:hover {
  opacity: 0.85;
  background: var(--surface-solid);
}

.day.today {
  border-color: var(--accent-ring);
  background: linear-gradient(165deg, var(--accent-soft), transparent 75%), color-mix(in srgb, var(--surface-solid) 70%, transparent);
}

.day.selected {
  border-color: var(--accent);
  background: linear-gradient(165deg, var(--accent-soft), transparent 90%), var(--surface-solid);
  box-shadow: 0 0 0 3px var(--accent-soft), 0 12px 26px -14px rgba(99, 102, 241, 0.65);
}

.day:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.day-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  min-height: 28px;
}

/* 日期数字 + 右上角的"休 / 班"角标(角标不占排版宽度,只在右边留一点空) */
.day-lead {
  position: relative;
  display: flex;
  flex: none;
}

.day-lead.tagged {
  margin-right: 6px;
}

.hol-tag {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 16px;
  height: 16px;
  border-radius: 6px;
  font-size: 10px;
  font-style: normal;
  font-weight: 800;
  line-height: 1;
  color: #fff;
  background: var(--off-solid);
}

.hol-tag.work {
  background: var(--work-solid);
}

.day-lead > .hol-tag {
  position: absolute;
  top: -3px;
  left: calc(100% - 4px); /* 角标 + 外圈要和两位数的最后一位留出缝隙,不能压住数字 */
  box-shadow: 0 0 0 1.5px var(--surface-solid);
  pointer-events: none;
}

.day-num {
  display: grid;
  place-items: center;
  min-width: 28px;
  height: 28px;
  padding: 0 4px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}

.day.weekend .day-num,
.day.hol-off .day-num {
  color: var(--weekend);
}

.day.hol-work .day-num {
  color: var(--work-ink);
}

.day.today .day-num {
  color: #fff;
  background: var(--grad);
  box-shadow: 0 6px 14px -4px rgba(99, 102, 241, 0.8);
}

.day-flags {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

/* 当天是节日时,日期下面的一行节日名(只有节日当天才有) */
.hol-name {
  min-width: 0;
  margin-top: -2px;
  overflow: hidden;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--off-ink);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.flag-note {
  display: inline-flex;
  font-size: 13px;
  color: var(--text-3);
}

.pill {
  display: inline-flex;
  align-items: center;
  min-width: 0; /* 万一实在放不下(比如事项数是三位数)宁可截断,也不要压到隔壁格子上 */
  height: 20px;
  padding: 0 8px;
  overflow: hidden;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.pill.ok {
  color: #fff;
  background: linear-gradient(135deg, #34d399, #10b981);
  box-shadow: 0 4px 10px -4px rgba(16, 185, 129, 0.8);
}

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

.pill.none {
  color: var(--text-3);
  background: var(--surface-2);
}

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

.pv {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  font-size: 12px;
  line-height: 1.4;
  color: var(--text-2);
}

.pv-dot {
  flex: none;
  width: 7px;
  height: 7px;
  border: 1.5px solid var(--text-3);
  border-radius: 50%;
}

.pv.done .pv-dot {
  border-color: var(--ok);
  background: var(--ok);
}

.pv.done .pv-text {
  color: var(--text-3);
  text-decoration: line-through;
  text-decoration-color: color-mix(in srgb, var(--text-3) 60%, transparent);
}

.pv-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pv-note {
  color: var(--text-3);
  font-style: italic;
}

.pv-note .ico {
  font-size: 12px;
}

.pv-more {
  padding-left: 14px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-3);
}

.day-dots {
  display: none;
  flex-wrap: wrap;
  gap: 3px;
}

.day-dots i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--surface-3);
  border: 1.5px solid var(--text-3);
}

.day-dots i.on {
  background: var(--ok);
  border-color: var(--ok);
}

/* 按日历自身宽度分三档(格子宽度 ≈ (日历宽度 - 104px) / 7):
     ≥ 812px  格子 ≥ 101px  完整:日期 + 角标 + 有记录图标 + 进度 + 3 条事项预览
     700–811  格子 85–100px 中等:去掉有记录图标,进度胶囊压窄
     < 700px  格子 < 85px   紧凑:只留日期 + 角标 + 进度小圆点(手机、窄窗口) */
@container cal (max-width: 811px) {
  .day {
    padding-right: 7px;
    padding-left: 7px;
  }

  .flag-note {
    display: none;
  }

  .pill {
    padding: 0 5px;
    font-size: 10px;
  }

  .day-lead > .hol-tag {
    width: 14px;
    height: 14px;
    border-radius: 5px;
    font-size: 9px;
  }
}

@container cal (max-width: 699px) {
  .day {
    align-items: center;
    padding: 9px 2px 6px; /* 上边多留一点,给右上角的角标腾地方,不压住数字 */
    border-radius: 12px;
  }

  .day-flags,
  .day-items,
  .hol-name {
    display: none;
  }

  .day-top {
    justify-content: center;
  }

  /* 格子太窄,数字旁边放不下角标:改贴在格子自己的右上角(整体在数字墨迹的上方) */
  .day-lead {
    position: static;
  }

  .day-lead.tagged {
    margin-right: 0;
  }

  .day-lead > .hol-tag {
    top: 2px;
    right: 2px;
    left: auto;
    width: 13px;
    height: 13px;
    border-radius: 5px;
    font-size: 9px;
    box-shadow: 0 0 0 1px var(--surface-solid);
  }

  .day-dots {
    display: flex;
    justify-content: center;
  }
}

/* 日历下方的图例 */
.cal-legend {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px dashed var(--border-strong);
  font-size: 12.5px;
  color: var(--text-3);
}

.cal-legend:empty {
  display: none;
}

.lg-keys {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 18px;
}

.lg-key {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.lg-src {
  margin-left: auto;
  font-size: 12px;
}

.lg-plans {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--text-2);
}

.lg-plans b {
  margin-right: 2px;
  font-weight: 750;
  color: var(--text);
}

.lg-work {
  color: var(--work-ink);
}

.lg-nw {
  white-space: nowrap; /* "10/10（周六）上班" 不要被拆成两行 */
}

.lg-note {
  display: flex;
  align-items: center;
  gap: 8px;
  line-height: 1.5;
}

.lg-note .ico {
  flex: none;
  font-size: 15px;
}

/* ---------- 6. 当日面板 ---------- */
.day-panel {
  position: sticky;
  top: 88px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: calc(100vh - 110px);
  padding: 22px;
  overflow-y: auto;
}

.dp-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.dp-date {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.dp-day {
  font-size: 56px;
  font-weight: 850;
  line-height: 1;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.dp-month {
  font-size: 13px;
  font-weight: 650;
  color: var(--text-3);
}

.dp-week {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  font-size: 19px;
  font-weight: 750;
}

.dp-nav {
  display: flex;
  align-items: center;
  gap: 2px;
}

.dp-close {
  display: none;
}

.dp-progress-text {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 650;
  color: var(--text-2);
}

.bar {
  height: 9px;
  overflow: hidden;
  border-radius: 99px;
  background: var(--surface-3);
}

.bar > i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--grad);
  transition: width 0.5s cubic-bezier(0.2, 0.8, 0.2, 1), background 0.3s ease;
}

.bar.full > i {
  background: linear-gradient(90deg, #34d399, #10b981);
}

.dp-add {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 6px 6px 14px;
  border: 1px solid var(--border);
  border-radius: 17px;
  background: var(--surface-2);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.dp-add:focus-within {
  border-color: var(--accent);
  background: var(--surface-solid);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.dp-add-icon {
  font-size: 18px;
  color: var(--text-3);
}

.dp-add input {
  flex: 1;
  min-width: 0;
  padding: 9px 0;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 14.5px;
}

.dp-add input::placeholder {
  color: var(--text-3);
}

.dp-hint {
  margin-top: -8px;
  font-size: 12px;
  line-height: 1.9;
  color: var(--text-3);
}

.dp-todos.enter {
  animation: fade-up 0.32s ease backwards;
}

.dp-empty {
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 26px 12px 20px;
  text-align: center;
  font-size: 13px;
  color: var(--text-3);
}

.dp-empty b {
  margin-top: 8px;
  font-size: 15px;
  color: var(--text-2);
}

.dp-empty-art {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 18px;
  font-size: 24px;
  color: var(--accent-ink);
  background: var(--accent-soft);
}

.tsec + .tsec {
  margin-top: 14px;
}

.tsec-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
  padding: 0 4px;
}

.tsec-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 750;
  letter-spacing: 0.04em;
  color: var(--text-3);
}

.tsec-title b {
  padding: 0 7px;
  border-radius: 999px;
  font-size: 11.5px;
  color: var(--text-2);
  background: var(--surface-2);
}

.todo-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.todo {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 9px 8px 9px 6px;
  border-radius: 13px;
  transition: background 0.15s ease;
}

.todo:hover,
.todo:focus-within {
  background: var(--surface-2);
}

.check {
  display: grid;
  place-items: center;
  flex: none;
  width: 22px;
  height: 22px;
  margin-top: 1px;
  border: 2px solid var(--border-strong);
  border-radius: 50%;
  font-size: 12px;
  color: #fff;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}

.check .ico {
  opacity: 0;
  transform: scale(0.4);
  transition: opacity 0.18s ease, transform 0.22s cubic-bezier(0.3, 1.6, 0.5, 1);
}

.check:hover {
  border-color: var(--ok);
}

.check:active {
  transform: scale(0.88);
}

.todo.done .check {
  border-color: transparent;
  background: linear-gradient(135deg, #34d399, #10b981);
  box-shadow: 0 4px 10px -3px rgba(16, 185, 129, 0.7);
}

.todo.done .check .ico {
  opacity: 1;
  transform: none;
}

.todo-body {
  display: flex;
  flex: 1;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 9px;
  min-width: 0;
  padding-top: 1px;
}

.todo-text {
  font-size: 14.5px;
  line-height: 1.55;
  word-break: break-word;
  border-radius: 6px;
  cursor: text;
}

.todo.done .todo-text {
  color: var(--text-3);
  text-decoration: line-through;
  text-decoration-color: color-mix(in srgb, var(--text-3) 55%, transparent);
}

.todo-edit {
  flex: 1;
  min-width: 0;
  padding: 3px 9px;
  border: 1px solid var(--accent);
  border-radius: 9px;
  outline: 0;
  background: var(--surface-solid);
  box-shadow: 0 0 0 3px var(--accent-soft);
  font-size: 14.5px;
}

.todo-actions {
  display: flex;
  gap: 2px;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.todo:hover .todo-actions,
.todo:focus-within .todo-actions {
  opacity: 1;
}

.mini {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 9px;
  font-size: 14px;
  color: var(--text-3);
  transition: background 0.15s ease, color 0.15s ease;
}

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

.mini.danger:hover {
  color: var(--danger);
  background: var(--danger-soft);
}

.dp-note {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 4px;
}

.dp-note-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.dp-note-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  font-weight: 750;
  letter-spacing: 0.04em;
  color: var(--text-3);
}

.dp-note-stat {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}

.dp-note-tools {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.note-tool-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 27px;
  padding: 0 10px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 650;
  color: var(--text-2);
  background: var(--surface-2);
  border: 1px solid var(--border);
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.note-tool-btn:hover {
  color: var(--accent-ink);
  border-color: var(--accent);
  background: var(--accent-soft);
}

.note-tool-btn [data-icon] {
  font-size: 13.5px;
  color: var(--accent);
}

.note-editor {
  width: 100%;
  min-height: 150px;
  max-height: 440px;
  overflow-y: auto;
  padding: 13px 15px;
  border: 1px solid var(--border);
  border-radius: 16px;
  outline: 0;
  background: var(--surface-2);
  font-size: 14.5px;
  line-height: 1.75;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
  cursor: text;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.note-editor:empty::before {
  content: attr(data-placeholder);
  color: var(--text-3);
  white-space: pre-wrap;
  pointer-events: none;
}

.note-editor:focus {
  border-color: var(--accent);
  background: var(--surface-solid);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.note-editor.drag-over {
  border-color: var(--accent);
  border-style: dashed;
  background: color-mix(in srgb, var(--accent-soft) 50%, var(--surface-solid));
}

.note-line {
  min-height: 1.75em;
}

.note-img {
  display: block;
  max-width: 100%;
  max-height: 360px;
  width: auto;
  height: auto;
  margin: 8px 0;
  border-radius: 12px;
  border: 1px solid var(--border-strong);
  background: var(--surface-solid);
  box-shadow: var(--shadow-1);
  cursor: zoom-in;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.note-img:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-2);
}

.note-uploading {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 10px;
  font-size: 12.5px;
  font-weight: 650;
  color: var(--accent-ink);
  background: var(--accent-soft);
}

/* ---------- 大屏长文编辑弹窗 ---------- */
.note-dialog {
  width: min(980px, calc(100vw - 24px));
  height: min(88vh, 880px);
  max-height: min(88vh, 880px);
  margin: auto;
  overflow: hidden;
}

.note-dialog[open] {
  display: flex;
  flex-direction: column;
}

.nd-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 16px 22px 13px;
  background: var(--surface-solid);
  border-bottom: 1px solid var(--border);
}

.nd-date-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nd-date-info {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.nd-date-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.nd-date-badges {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.nd-head-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nd-stat {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}

.nd-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 22px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}

.nd-tool {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 31px;
  padding: 0 12px;
  border-radius: 9px;
  font-size: 12.5px;
  font-weight: 650;
  color: var(--text-2);
  background: var(--surface-solid);
  border: 1px solid var(--border);
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.nd-tool:hover {
  color: var(--text);
  border-color: var(--border-strong);
}

.nd-tool.primary {
  color: var(--accent-ink);
  background: var(--accent-soft);
  border-color: color-mix(in srgb, var(--accent) 30%, transparent);
}

.nd-tool.primary:hover {
  border-color: var(--accent);
}

.nd-sep {
  width: 1px;
  height: 18px;
  background: var(--border-strong);
}

.nd-hint {
  margin-left: auto;
  font-size: 12px;
  color: var(--text-3);
}

.nd-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 20px 24px 24px;
  background: var(--surface-solid);
  overflow: hidden;
}

.nd-body .note-editor {
  flex: 1;
  min-height: 0;
  max-height: none;
  padding: 24px 28px;
  font-size: 15.5px;
  line-height: 1.85;
  border-radius: 18px;
}

.nd-body .note-img {
  max-height: 540px;
  margin: 12px 0;
}

/* ---------- 图片高清预览 Lightbox ---------- */
.img-dialog {
  width: min(1120px, calc(100vw - 24px));
  max-height: calc(100vh - 28px);
  margin: auto;
  background: var(--surface-solid);
  overflow: hidden;
}

.img-dialog[open] {
  display: flex;
  flex-direction: column;
}

.id-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
}

.id-title {
  font-size: 14.5px;
  font-weight: 750;
}

.id-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.id-stage {
  display: grid;
  place-items: center;
  padding: 18px;
  max-height: calc(100vh - 100px);
  overflow: auto;
  background: var(--surface-2);
}

#id-img {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 140px);
  border-radius: 12px;
  box-shadow: var(--shadow-2);
}

.sheet-backdrop {
  display: none;
}

/* ---------- 7. 报告 ---------- */
.view-report {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 1140px;
  margin: 0 auto;
}

.rp-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px 26px;
  padding: 15px 20px;
}

.rp-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip-btn {
  height: 34px;
  padding: 0 15px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 650;
  color: var(--text-2);
  background: var(--surface-2);
  transition: all 0.18s ease;
}

.chip-btn:hover {
  color: var(--text);
  border-color: var(--border-strong);
}

.chip-btn.active {
  color: #fff;
  border-color: transparent;
  background: var(--grad);
  box-shadow: 0 8px 18px -8px rgba(99, 102, 241, 0.9);
}

.rp-range {
  display: flex;
  align-items: center;
  gap: 8px;
}

.rp-arrow {
  color: var(--text-3);
}

.date-field {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  height: 40px;
  padding: 0 13px;
  border: 1px solid var(--border);
  border-radius: 13px;
  font-size: 13px;
  font-weight: 650;
  color: var(--text-3);
  background: var(--surface-2);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.date-field:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.date-field input {
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 14px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.rp-overview {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 20px;
}

.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.stat {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  padding: 17px 18px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow-1);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}

.stat-ico {
  display: grid;
  place-items: center;
  flex: none;
  width: 46px;
  height: 46px;
  border-radius: 15px;
  font-size: 21px;
}

.tone-ok .stat-ico {
  color: var(--ok-ink);
  background: var(--ok-soft);
}

.tone-warn .stat-ico {
  color: var(--warn-ink);
  background: var(--warn-soft);
}

.tone-accent .stat-ico {
  color: var(--accent-ink);
  background: var(--accent-soft);
}

.stat-label {
  font-size: 12.5px;
  font-weight: 650;
  color: var(--text-3);
}

.stat-value {
  font-size: 32px;
  font-weight: 850;
  line-height: 1.1;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.stat-sub {
  font-size: 12px;
  color: var(--text-3);
}

.ring-wrap {
  position: relative;
  flex: none;
  width: 66px;
  height: 66px;
}

.ring {
  display: block;
  width: 100%;
  height: 100%;
}

.ring-bg {
  fill: none;
  stroke: var(--surface-3);
  stroke-width: 7;
}

.ring-fg {
  fill: none;
  stroke-width: 7;
  stroke-linecap: round;
}

.ring-text {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 15px;
  font-weight: 850;
  font-variant-numeric: tabular-nums;
}

.chart-card {
  display: flex;
  flex-direction: column;
  padding: 17px 22px 15px;
}

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

.chart-title {
  font-size: 14px;
  font-weight: 750;
}

.legend {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-3);
}

.lg {
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-left: 8px;
  border-radius: 3px;
}

.lg:first-child {
  margin-left: 0;
}

.lg.done {
  background: var(--accent);
}

.lg.pending {
  background: color-mix(in srgb, var(--warn) 60%, transparent);
}

.chart {
  display: flex;
  gap: 9px;
  height: 128px;
}

.chart.dense {
  gap: 2px;
}

.col {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.col-bar {
  position: relative;
  flex: 1;
  width: 100%;
}

.stack {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  max-width: 38px;
  min-height: 6px;
  margin: 0 auto;
  overflow: hidden;
  border-radius: 9px;
  transition: height 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.chart.dense .stack {
  border-radius: 3px;
}

.seg-done {
  background: var(--grad);
}

.seg-pending {
  background: color-mix(in srgb, var(--warn) 55%, transparent);
}

.stub {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  max-width: 38px;
  height: 4px;
  margin: 0 auto;
  border-radius: 4px;
  background: var(--surface-3);
}

.col-label {
  font-size: 12px;
  font-weight: 650;
  color: var(--text-3);
}

.col.today .col-label {
  font-weight: 850;
  color: var(--accent-ink);
}

.axis {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
  color: var(--text-3);
}

.rp-paper {
  padding: 30px 36px 38px;
}

.rp-paper-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--border);
}

.rp-paper-head h2 {
  margin: 0;
  font-size: 28px;
  font-weight: 850;
  letter-spacing: -0.02em;
}

.rp-paper-head p {
  margin: 5px 0 0;
  font-size: 14px;
  color: var(--text-3);
}

.rp-actions {
  display: flex;
  gap: 10px;
}

.rp-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 18px 0 4px;
}

.toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 13px;
  border: 1px dashed var(--border-strong);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 650;
  color: var(--text-3);
  transition: all 0.18s ease;
}

.toggle [data-icon] {
  display: none;
}

.toggle[aria-pressed="true"] {
  color: var(--accent-ink);
  border-style: solid;
  border-color: transparent;
  background: var(--accent-soft);
}

.toggle[aria-pressed="true"] [data-icon] {
  display: inline-flex;
}

.rsec {
  margin-top: 28px;
}

.rsec-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 800;
}

.rsec-title em {
  padding: 2px 11px;
  border-radius: 999px;
  font-size: 12.5px;
  font-style: normal;
  font-weight: 750;
  color: var(--text-2);
  background: var(--surface-2);
}

.rsec-ico {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 11px;
  font-size: 17px;
}

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

.rsec-pending .rsec-ico {
  color: var(--warn-ink);
  background: var(--warn-soft);
}

.rsec-notes .rsec-ico {
  color: var(--accent-ink);
  background: var(--accent-soft);
}

.rgroup + .rgroup {
  margin-top: 8px;
}

.rgroup-head {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 16px 0 2px;
  font-size: 14px;
}

.rgroup-head b {
  font-size: 15.5px;
}

.rgroup-head .wd {
  font-weight: 650;
  color: var(--text-3);
}

.rgroup-head .untagged {
  font-weight: 650;
  color: var(--text-3);
}

.rgroup-count {
  margin-left: auto;
  font-size: 12px;
  color: var(--text-3);
}

.rlist {
  margin: 0;
  padding: 0;
  list-style: none;
}

.ritem {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) auto;
  align-items: start;
  gap: 13px;
  padding: 11px 4px;
  border-bottom: 1px dashed var(--border);
}

.ritem:last-child {
  border-bottom: 0;
}

.ridx {
  display: grid;
  place-items: center;
  min-width: 26px;
  height: 26px;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--accent-ink);
  background: var(--accent-soft);
}

.ridx.pend {
  width: 18px;
  height: 18px;
  min-width: 0;
  margin: 4px;
  border: 2px solid var(--warn);
  border-radius: 50%;
  background: transparent;
}

.rtext {
  padding-top: 2px;
  line-height: 1.65;
  word-break: break-word;
}

.rmeta {
  display: flex;
  align-items: center;
  gap: 9px;
  padding-top: 4px;
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  color: var(--text-3);
  white-space: nowrap;
}

.rdate {
  -webkit-user-select: none;
  user-select: none;
}

.rempty {
  margin: 4px 0 0;
  padding: 14px 16px;
  border-radius: 14px;
  color: var(--text-3);
  background: var(--surface-2);
}

.rnotes {
  display: grid;
  gap: 12px;
}

.rnote {
  padding: 15px 20px;
  border-left: 3px solid var(--accent);
  border-radius: 6px 16px 16px 6px;
  background: var(--surface-2);
}

.rnote-date {
  margin-bottom: 5px;
  font-size: 12.5px;
  font-weight: 750;
  color: var(--accent-ink);
}

.rnote-text {
  line-height: 1.75;
  color: var(--text-2);
  white-space: pre-wrap;
  word-break: break-word;
}

.rnote-line.empty {
  height: 0.75em;
}

.rnote-img {
  display: block;
  max-width: min(100%, 640px);
  max-height: 380px;
  margin: 10px 0;
  border-radius: 12px;
  border: 1px solid var(--border-strong);
  background: var(--surface-solid);
  box-shadow: var(--shadow-1);
  cursor: zoom-in;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.rnote-img:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-2);
}

.empty {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 64px 16px 48px;
  text-align: center;
}

.empty-art {
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  border-radius: 26px;
  font-size: 34px;
  color: var(--accent-ink);
  background: var(--accent-soft);
}

.empty h4 {
  margin: 12px 0 0;
  font-size: 18px;
}

.empty p {
  margin: 0 0 14px;
  color: var(--text-3);
}

/* ---------- 8. 提示条 / 对话框 ---------- */
.toasts {
  position: fixed;
  left: 50%;
  bottom: 26px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  transform: translateX(-50%);
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 18px;
  border-radius: 15px;
  font-size: 14px;
  font-weight: 550;
  color: var(--ink-fg);
  background: var(--ink-bg);
  box-shadow: var(--shadow-pop);
  pointer-events: auto;
  animation: toast-in 0.3s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}

.toast.out {
  animation: toast-out 0.26s ease forwards;
}

.toast-danger {
  color: #fff;
  background: #dc2626;
}

.toast-warn {
  color: #3b2300;
  background: #fbbf24;
}

.toast-action {
  padding: 3px 8px;
  border-radius: 8px;
  font-weight: 800;
  color: var(--ink-action);
}

.toast-action:hover {
  background: rgba(127, 127, 255, 0.18);
}

.dialog {
  width: min(430px, calc(100vw - 32px));
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 24px;
  color: var(--text);
  background: var(--surface-solid);
  box-shadow: var(--shadow-pop);
}

.dialog::backdrop {
  background: rgba(10, 12, 30, 0.52);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}

.dialog[open] {
  animation: pop-in 0.22s ease;
}

.dialog form {
  padding: 26px 26px 22px;
}

.dialog h3 {
  margin: 0 0 8px;
  font-size: 19px;
}

.dialog p {
  margin: 0 0 22px;
  line-height: 1.7;
  color: var(--text-2);
}

.dialog-list {
  margin: -8px 0 18px;
  padding: 12px 16px 12px 32px;
  border-radius: 14px;
  font-size: 13.5px;
  line-height: 1.75;
  color: var(--text-2);
  background: var(--surface-2);
}

.dialog-list b {
  color: var(--text);
}

.dialog .dialog-foot {
  margin: -6px 0 20px;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--text-3);
}

.dialog-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

/* ---------- 全局搜索（查哪天干的） ---------- */
.search-btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  height: 36px;
  padding: 0 10px 0 13px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 550;
  color: var(--text-3);
  background: var(--surface-2);
  border: 1px solid var(--border);
  transition: border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.search-btn:hover {
  color: var(--text);
  border-color: var(--border-strong);
  background: var(--surface-solid);
  box-shadow: var(--shadow-1);
}

.search-btn [data-icon] {
  color: var(--accent);
  font-size: 15px;
}

.search-btn-text {
  padding-right: 4px;
  white-space: nowrap;
}

.search-dialog {
  width: min(680px, calc(100vw - 24px));
  max-height: min(78vh, 720px);
  margin: min(9vh, 72px) auto auto;
  overflow: hidden;
}

.search-dialog[open] {
  display: flex;
  flex-direction: column;
}

.s-head {
  padding: 16px 18px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-solid);
}

.s-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 46px;
  padding: 0 10px 0 14px;
  border-radius: 14px;
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.s-input-wrap:focus-within {
  background: var(--surface-solid);
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.s-icon {
  display: inline-grid;
  place-items: center;
  font-size: 18px;
  color: var(--accent);
}

#search-input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  outline: 0;
  font-size: 15px;
  color: var(--text);
  background: transparent;
}

#search-input::placeholder {
  color: var(--text-3);
}

#search-input::-webkit-search-cancel-button {
  display: none;
}

.s-clear {
  width: 30px;
  height: 30px;
  border-radius: 9px;
}

.s-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 11px;
}

.s-meta {
  flex: 1;
  min-width: 120px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}

.s-close kbd {
  margin-left: 4px;
}

.s-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px 18px 18px;
}

.s-sec + .s-sec {
  margin-top: 18px;
}

.s-sec-title {
  margin-bottom: 9px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text-3);
}

.s-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.s-tag-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px 3px 4px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.s-tag-btn:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.s-tag-cnt {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}

.s-groups,
.s-recent-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.s-group {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface-2);
  overflow: hidden;
}

.s-date-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 10px 14px;
  text-align: left;
  background: color-mix(in srgb, var(--accent-soft) 45%, var(--surface-solid));
  border-bottom: 1px solid var(--border);
  transition: background 0.15s ease;
}

.s-date-head:hover {
  background: color-mix(in srgb, var(--accent-soft) 80%, var(--surface-solid));
}

.s-date-left {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.s-date-left .ico {
  color: var(--accent);
  font-size: 16px;
}

.s-date-main {
  font-size: 14.5px;
  font-weight: 800;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.s-date-wk {
  margin-left: 6px;
  font-size: 13px;
  font-weight: 650;
  color: var(--accent-ink);
}

.s-jump-hint {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 650;
  color: var(--accent-ink);
  white-space: nowrap;
}

.s-items {
  display: flex;
  flex-direction: column;
  padding: 5px;
  gap: 3px;
}

.s-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 11px;
  border-radius: 11px;
  text-align: left;
  color: var(--text);
  background: transparent;
  transition: background 0.12s ease;
}

.s-item:hover,
.s-item.active {
  background: var(--surface-solid);
  box-shadow: var(--shadow-1);
}

.s-item.active {
  outline: 1.5px solid color-mix(in srgb, var(--accent) 55%, transparent);
}

.s-status {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  flex: none;
  border-radius: 7px;
  font-size: 13px;
}

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

.s-status.pending {
  color: var(--warn-ink);
  background: var(--warn-soft);
}

.s-status.note {
  color: var(--accent-ink);
  background: var(--accent-soft);
}

.s-text {
  flex: 1;
  min-width: 0;
  font-size: 14px;
  line-height: 1.5;
  word-break: break-word;
}

.s-note-prefix {
  font-weight: 700;
  color: var(--text-3);
}

.s-item-date {
  flex: none;
  padding: 2px 8px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 650;
  color: var(--text-2);
  background: var(--surface-2);
  font-variant-numeric: tabular-nums;
}

mark.s-hl {
  padding: 0 3px;
  border-radius: 5px;
  font-weight: 750;
  color: var(--accent-ink);
  background: color-mix(in srgb, var(--warn) 36%, var(--accent-soft));
}

.s-recent-item {
  flex-direction: column;
  align-items: stretch;
  gap: 5px;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-2);
}

.s-recent-top {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.s-recent-stat {
  margin-left: auto;
  font-size: 12px;
  font-weight: 650;
  color: var(--text-3);
}

.s-recent-preview {
  font-size: 13px;
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.s-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 38px 16px;
  text-align: center;
  color: var(--text-3);
}

.s-empty b {
  font-size: 15px;
  color: var(--text);
}

.s-empty span {
  max-width: 340px;
  font-size: 13px;
  line-height: 1.6;
}

.flash-target {
  animation: target-flash 1.4s ease;
}

@keyframes target-flash {
  0%,
  35% {
    box-shadow: 0 0 0 3px var(--accent), 0 0 18px rgba(99, 102, 241, 0.45);
  }
  100% {
    box-shadow: none;
  }
}

/* ---------- 账号登录 / 注册 / 修改密码弹窗 ---------- */
.auth-dialog {
  width: min(440px, calc(100vw - 28px));
}

.auth-dialog::backdrop {
  background: rgba(10, 12, 30, 0.62);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 26px 26px 24px;
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 13px;
}

.auth-brand .brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  flex: none;
}

.auth-brand h3 {
  margin: 0 0 3px;
  font-size: 20px;
}

.auth-form .auth-sub {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-3);
}

.auth-legacy-tip {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 11px 13px;
  border-radius: 13px;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--accent-ink);
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
}

.auth-legacy-tip [data-icon] {
  margin-top: 2px;
  font-size: 15px;
  color: var(--accent);
}

.auth-tabs {
  width: 100%;
}

.auth-tabs .seg-btn {
  flex: 1;
  justify-content: center;
}

.auth-fields {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.auth-field > span {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-2);
}

.auth-field input {
  width: 100%;
  height: 42px;
  padding: 0 13px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  outline: 0;
  font-size: 14.5px;
  background: var(--surface-2);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.auth-field input:focus {
  border-color: var(--accent);
  background: var(--surface-solid);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.auth-error {
  padding: 10px 13px;
  border-radius: 11px;
  font-size: 13px;
  font-weight: 650;
  color: var(--danger);
  background: var(--danger-soft);
}

.auth-submit {
  width: 100%;
  height: 42px;
  margin-top: 2px;
  font-size: 15px;
}

/* ---------- 动画 ---------- */
@keyframes view-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes pop-in {
  from {
    opacity: 0;
    transform: translateY(-6px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes toast-out {
  to {
    opacity: 0;
    transform: translateY(10px) scale(0.96);
  }
}

@keyframes pulse {
  50% {
    opacity: 0.35;
  }
}

/* ---------- 9. 响应式 ---------- */
/* 窗口 ≤ 1100px 时,右侧常驻面板会把日历挤得只剩 50~80px 一格,
   不如让日历占满整行,把当日面板收成底部抽屉(JS 里的 SHEET_QUERY 要和这里保持一致) */
@media (max-width: 1100px) {
  .view-calendar {
    grid-template-columns: 1fr;
  }

  .cal-card {
    min-height: 0;
  }

  /* 当日面板变成底部抽屉 */
  .day-panel {
    position: fixed;
    inset: auto 0 0 0;
    z-index: 60;
    max-height: 90vh;
    padding-bottom: max(22px, env(safe-area-inset-bottom));
    border-radius: 26px 26px 0 0;
    background: var(--surface-solid);
    box-shadow: var(--shadow-pop);
    transform: translateY(105%);
    transition: transform 0.36s cubic-bezier(0.2, 0.85, 0.25, 1);
    visibility: hidden;
  }

  .sheet-open .day-panel {
    transform: none;
    visibility: visible;
  }

  .dp-close {
    display: inline-grid;
  }

  .sheet-backdrop {
    position: fixed;
    inset: 0;
    z-index: 55;
    display: block;
    background: rgba(10, 12, 30, 0.5);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
  }

  .sheet-open .sheet-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  .rp-overview {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .brand-name,
  .status,
  .search-btn-text,
  .search-btn-kbd,
  .user-name {
    display: none;
  }

  .user-btn {
    padding: 0 5px;
  }

  .search-btn {
    justify-content: center;
    width: 38px;
    height: 38px;
    padding: 0;
    border-radius: 12px;
  }

  .s-item-date,
  .s-jump-hint,
  .nd-hint {
    display: none;
  }

  .nd-body {
    padding: 12px 14px 16px;
  }

  .nd-body .note-editor {
    padding: 14px 16px;
  }

  .topbar {
    gap: 12px;
  }

  .cal-card {
    padding: 16px 12px 14px;
  }

  .cal-title {
    font-size: 26px;
  }

  .cal-head-right .chips {
    display: none;
  }

  .cal-weekdays,
  .cal-grid {
    grid-template-columns: 28px repeat(7, minmax(0, 1fr));
    gap: 4px;
  }

  .cal-grid {
    grid-template-rows: repeat(var(--rows, 6), minmax(62px, 1fr));
  }

  .wk {
    width: 26px;
    height: 26px;
    font-size: 11px;
  }

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

  .rp-paper {
    padding: 22px 16px 28px;
  }

  .ritem {
    grid-template-columns: 26px minmax(0, 1fr);
  }

  .rmeta {
    grid-column: 2;
    padding-top: 0;
  }

  .rp-range {
    flex-wrap: wrap;
  }
}

/* 320px 这种很窄的屏:顶栏的几个按钮挤不下,收紧间距避免页面出现横向滚动条 */
@media (max-width: 400px) {
  .topbar {
    gap: 6px;
    padding: 0 10px;
  }

  #nav .seg-btn {
    padding: 0 11px;
  }
}

/* ---------- 10. 打印 / 减弱动效 ---------- */
@media print {
  body::before,
  .topbar,
  .rp-toolbar,
  .rp-overview,
  .rp-actions,
  .rp-controls,
  .toasts {
    display: none !important;
  }

  .card {
    border: 0;
    box-shadow: none;
    background: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  .view-calendar {
    display: none !important;
  }
}

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