/* 还有一棵树 - 典雅设计与交互样式 */

@layer base {
  body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
  }
}

.font-serif-title {
  font-family: "Noto Serif SC", "Source Han Serif SC", STSong, "Songti SC", Georgia, serif;
}

.font-siyuan-song,
.font-siyuan-zhengti {
  font-family: "Noto Serif SC", "Source Han Serif SC", "Source Han Serif CN", "Songti SC", STSong, SimSun, serif;
}

/* 历史密度热力阵列 (Historical Density Matrix) 单元格定制 */
.calendar-density-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}

.calendar-density-cell {
  aspect-ratio: 1 / 1;
  min-height: 58px;
  border-radius: 0.75rem;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding: 0.4rem 0.25rem 0.35rem;
  user-select: none;
  border-width: 1px;
}

@media (min-width: 640px) {
  .calendar-density-cell {
    min-height: 68px;
    padding: 0.5rem 0.35rem 0.4rem;
  }
}

.calendar-density-cell:hover {
  transform: translateY(-1.5px);
  box-shadow: 0 4px 12px -2px rgba(0, 0, 0, 0.08);
}

.dark .calendar-density-cell:hover {
  box-shadow: 0 4px 12px -2px rgba(0, 0, 0, 0.4);
}

.calendar-density-cell.is-other-month {
  opacity: 0.28;
  border-color: transparent !important;
  background-color: transparent !important;
  pointer-events: none;
}

/* 编年刻度条与热点峰值图 (Linear Timeline with Hotspots) */
.linear-timeline-wrapper {
  position: relative;
  width: 100%;
  overflow-x: auto;
  scrollbar-width: none; /* 隐藏原生滚动条，下方只保留一条纯净专属滑动条 */
  -ms-overflow-style: none;
}
.linear-timeline-wrapper::-webkit-scrollbar {
  display: none;
}

.linear-pulse-track {
  position: relative;
  display: flex;
  min-width: 2920px;
  height: 235px;
  padding-bottom: 52px; /* 为基准线下方的刻度数字与带状阴影预留空间 */
  align-items: flex-end;
}

/* 贯穿全年的极细水平基准线 */
.linear-pulse-baseline {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 50px;
  height: 2px;
  background-color: #cbd5e1;
  z-index: 5;
}
.dark .linear-pulse-baseline {
  background-color: #3f3f46;
}

/* 每日竖向时间柱槽 (全年 365/366 天连续延展) */
.pulse-day-slot {
  flex: 1 0 8px;
  min-width: 8px;
  height: 100%;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  cursor: pointer;
  transition: all 0.2s ease;
}

/* 跨年历史过渡衔接槽 (Year Bridge Slots) */
.pulse-bridge-slot {
  flex: 0 0 24px !important;
  min-width: 24px !important;
  opacity: 0.52;
  transition: all 0.2s ease;
}
.pulse-bridge-slot:hover {
  opacity: 0.95;
}
.pulse-bridge-slot .pulse-tick-mark {
  background-color: #94a3b8;
}
.dark .pulse-bridge-slot .pulse-tick-mark {
  background-color: #52525b;
}

/* 纪元年界立柱 (Year Boundary Divider) */
.pulse-year-boundary-divider {
  position: relative;
  z-index: 15;
}

/* 月份交界大刻度与月份标识 */
.pulse-month-divider {
  position: absolute;
  bottom: 45px;
  left: 0;
  width: 2px;
  height: 18px;
  background-color: #1b4332;
  z-index: 7;
}
.dark .pulse-month-divider {
  background-color: #4e8265;
}

.pulse-month-badge {
  position: absolute;
  bottom: 23px;
  left: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 10px;
  font-weight: 700;
  color: #1b4332;
  white-space: nowrap;
  z-index: 7;
  padding: 1px 3px;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 3px;
  border: 1px solid rgba(27, 67, 50, 0.35);
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}
.dark .pulse-month-badge {
  color: #4e8265;
  background: rgba(24, 24, 27, 0.95);
  border-color: rgba(78, 130, 101, 0.35);
}

/* 静谧日：仅保留基准线处的极细刻度与数字 */
.pulse-tick-mark {
  position: absolute;
  bottom: 47px;
  width: 1px;
  height: 8px;
  background-color: #94a3b8;
  z-index: 6;
  transition: all 0.15s ease;
}
.dark .pulse-tick-mark {
  background-color: #52525b;
}

.pulse-day-slot:hover .pulse-tick-mark {
  height: 14px;
  background-color: #1b4332;
}
.dark .pulse-day-slot:hover .pulse-tick-mark {
  background-color: #4e8265;
}

/* 基准线下方：日期数字 */
.pulse-day-num {
  position: absolute;
  bottom: 26px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 11px;
  font-weight: 500;
  color: #64748b;
  transition: all 0.15s ease;
}
.dark .pulse-day-num {
  color: #a1a1aa;
}

.pulse-day-slot:hover .pulse-day-num,
.pulse-day-slot.is-active .pulse-day-num {
  color: #1b4332;
  font-weight: 700;
}
.dark .pulse-day-slot:hover .pulse-day-num,
.dark .pulse-day-slot.is-active .pulse-day-num {
  color: #4e8265;
}

/* 实质性转折日：基准线上方拔起的垂直热点线 (Needle/Spike) */
.pulse-needle-line {
  position: absolute;
  bottom: 50px;
  width: 2px;
  border-radius: 9999px;
  z-index: 10;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  background: linear-gradient(to top, rgba(71, 85, 105, 0.85), rgba(148, 163, 184, 0.4));
}

.pulse-needle-line.spike-unresolved {
  background: linear-gradient(to top, rgba(82, 82, 91, 0.85), rgba(161, 161, 170, 0.4));
}

.pulse-needle-line.spike-disputed {
  background: linear-gradient(to top, rgba(113, 113, 122, 0.85), rgba(180, 180, 190, 0.4));
}

.pulse-day-slot:hover .pulse-needle-line,
.pulse-day-slot.is-active .pulse-needle-line {
  width: 3px;
  filter: drop-shadow(0 0 6px rgba(100, 116, 139, 0.5));
}

.pulse-day-slot.is-active .pulse-needle-line.spike-unresolved {
  filter: drop-shadow(0 0 6px rgba(113, 113, 122, 0.5));
}

/* 热点尖端几何节点 */
.pulse-needle-node {
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 14px;
  height: 14px;
  border-radius: 9999px;
  border: 2px solid #ffffff;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.1), 0 2px 4px rgba(0, 0, 0, 0.15);
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 12;
}
.dark .pulse-needle-node {
  border-color: #18181b;
}

.pulse-day-slot:hover .pulse-needle-node,
.pulse-day-slot.is-active .pulse-needle-node {
  transform: translateX(-50%) scale(1.35);
  box-shadow: 0 0 0 4px rgba(27, 67, 50, 0.3), 0 4px 10px rgba(0, 0, 0, 0.2);
}
.dark .pulse-day-slot:hover .pulse-needle-node,
.dark .pulse-day-slot.is-active .pulse-needle-node {
  box-shadow: 0 0 0 4px rgba(78, 130, 101, 0.35), 0 4px 10px rgba(0, 0, 0, 0.4);
}

/* 热点顶部悬浮信息药丸 */
.pulse-needle-tag {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  padding: 0.32rem 0.7rem;
  border-radius: 9999px;
  font-size: 12.5px;
  font-weight: 500;
  box-shadow: 0 4px 14px -2px rgba(0, 0, 0, 0.15);
  z-index: 20;
  pointer-events: auto;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  background-color: #ffffff;
  color: #0f172a;
  border: 1.5px solid #cbd5e1;
  display: flex;
  align-items: center;
  gap: 6px;
}

.dark .pulse-needle-tag {
  background-color: #27272a;
  color: #f4f4f5;
  border-color: #52525b;
  box-shadow: 0 4px 18px -2px rgba(0, 0, 0, 0.65);
}

.pulse-day-slot:hover .pulse-needle-tag,
.pulse-day-slot.is-active .pulse-needle-tag {
  z-index: 35;
  transform: translateX(-50%) scale(1.06);
  border-color: #475569;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.dark .pulse-day-slot:hover .pulse-needle-tag,
.dark .pulse-day-slot.is-active .pulse-needle-tag {
  border-color: #a1a1aa;
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.75);
}

/* 基准线下方：12个月连续时代底色带 (Monthly Background Ribbons) */
.pulse-span-bar-wrapper {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 2px;
  height: 22px;
  display: flex;
  align-items: center;
  gap: 2px;
  z-index: 8;
  padding: 0 2px;
}

.pulse-month-ribbon {
  height: 100%;
  border-radius: 4px;
  background-color: rgba(241, 245, 249, 0.85);
  border: 1px dashed rgba(203, 213, 225, 0.9);
  display: flex;
  align-items: center;
  padding: 0 0.35rem;
  font-size: 10px;
  color: #64748b;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: all 0.2s ease;
}
.dark .pulse-month-ribbon {
  background-color: rgba(39, 39, 42, 0.6);
  border-color: rgba(63, 63, 70, 0.8);
  color: #a1a1aa;
}

.pulse-month-ribbon:hover,
.pulse-month-ribbon.is-active {
  background-color: rgba(241, 245, 249, 0.95);
  border-color: #475569;
  border-style: solid;
  color: #1e293b;
  font-weight: 600;
}
.dark .pulse-month-ribbon:hover,
.dark .pulse-month-ribbon.is-active {
  background-color: rgba(63, 63, 70, 0.6);
  border-color: #a1a1aa;
  border-style: solid;
  color: #f4f4f5;
}

.pulse-span-bar {
  width: 100%;
  height: 100%;
  border-radius: 0.5rem;
  background-color: rgba(241, 245, 249, 0.85);
  border: 1px dashed rgba(203, 213, 225, 0.9);
  display: flex;
  align-items: center;
  padding: 0 0.75rem;
  font-size: 11px;
  color: #64748b;
  cursor: pointer;
  transition: all 0.2s ease;
}
.dark .pulse-span-bar {
  background-color: rgba(39, 39, 42, 0.5);
  border-color: rgba(63, 63, 70, 0.8);
  color: #a1a1aa;
}

.pulse-span-bar:hover,
.pulse-span-bar.is-active {
  background-color: rgba(241, 245, 249, 0.95);
  border-color: #475569;
  border-style: solid;
  color: #1e293b;
}
.dark .pulse-span-bar:hover,
.dark .pulse-span-bar.is-active {
  background-color: rgba(63, 63, 70, 0.5);
  border-color: #a1a1aa;
  border-style: solid;
  color: #f4f4f5;
}

/* 时间轴交互式单滚动条 (Single Clean Timeline Scrubber) */

/* 时间轴交互式滑块 (Timeline Scrubber Slider) */
.timeline-scrubber-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 24px;
  background: transparent !important;
  outline: none;
  cursor: pointer;
  margin: 0;
  padding: 0;
}

.dark .timeline-scrubber-slider {
  background: transparent !important;
}

.timeline-scrubber-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 10px;
  height: 16px;
  border-radius: 3px;
  background: #334155;
  border: 1.5px solid #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
}

.dark .timeline-scrubber-slider::-webkit-slider-thumb {
  background: #e4e4e7;
  border-color: #18181b;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}

.timeline-scrubber-slider::-webkit-slider-thumb:hover,
.timeline-scrubber-slider:active::-webkit-slider-thumb {
  transform: scale(1.15);
  background: #0f172a;
}

.dark .timeline-scrubber-slider::-webkit-slider-thumb:hover,
.dark .timeline-scrubber-slider:active::-webkit-slider-thumb {
  background: #ffffff;
}

.timeline-scrubber-slider::-moz-range-thumb {
  width: 10px;
  height: 16px;
  border-radius: 3px;
  background: #334155;
  border: 1.5px solid #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  cursor: pointer;
}

.dark .timeline-scrubber-slider::-moz-range-thumb {
  background: #e4e4e7;
  border-color: #18181b;
}

/* 时间线节点与引线 */
.timeline-item:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 24px;
  bottom: -8px;
  left: 11px;
  width: 2px;
  background-color: #e5e7eb;
}

.dark .timeline-item:not(:last-child)::after {
  background-color: #27272a;
}

/* 右侧案卷看板专属纵向滚动条美化 */
#docket-board-container {
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
}
.dark #docket-board-container {
  scrollbar-color: #52525b transparent;
}
#docket-board-container::-webkit-scrollbar {
  width: 6px;
}
#docket-board-container::-webkit-scrollbar-track {
  background: transparent;
}
#docket-board-container::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 9999px;
}
.dark #docket-board-container::-webkit-scrollbar-thumb {
  background: #52525b;
}
#docket-board-container::-webkit-scrollbar-thumb:hover {
  background: #3d6d53;
}

/* 优雅滚动条 */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 3px;
}

.dark ::-webkit-scrollbar-thumb {
  background: #3f3f46;
}

::-webkit-scrollbar-thumb:hover {
  background: #9ca3af;
}

/* 多方视角舆论回响与时代留声墙 */
.perspective-quote-card {
  position: relative;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.perspective-quote-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px -2px rgba(0, 0, 0, 0.06);
}

.perspective-quote-official {
  border-left: 3px solid #2563eb !important;
}
.dark .perspective-quote-official {
  border-left-color: #3b82f6 !important;
}

.perspective-quote-netizen {
  border-left: 3px solid #1b4332 !important;
}
.dark .perspective-quote-netizen {
  border-left-color: #4e8265 !important;
}

.perspective-quote-overseas {
  border-left: 3px solid #9333ea !important;
}
.dark .perspective-quote-overseas {
  border-left-color: #a855f7 !important;
}

.perspective-quote-text {
  font-family: 'Noto Serif SC', 'Source Han Serif SC', STSong, SimSun, serif;
  line-height: 1.68;
}

/* 存证快照卡片与操作按钮暗黑模式深度适配 */
.snapshot-source-item {
  background-color: #f8fafc; /* slate-50 */
  border: 1px solid #e2e8f0; /* slate-200 */
}
.dark .snapshot-source-item {
  background-color: #1a1a1e !important; /* 稳健炭黑背景 */
  border-color: #2e2e34 !important; /* 沉着边框 */
}

.snapshot-source-title {
  color: #1e293b; /* slate-800 */
}
.dark .snapshot-source-title {
  color: #f4f4f5 !important; /* zinc-100 纯净清晰白字 */
}

.snapshot-action-btn {
  background-color: #f1f5f9;
  color: #1e293b;
  border: 1px solid #cbd5e1;
}
.dark .snapshot-action-btn {
  background-color: #27272a !important;
  color: #e4e4e7 !important;
  border-color: #3f3f46 !important;
}
.snapshot-action-btn:hover {
  background-color: #e2e8f0;
}
.dark .snapshot-action-btn:hover {
  background-color: #38383e !important;
  color: #ffffff !important;
}

/* 扩展暗黑模式色板兼容 */
.dark .dark\:bg-zinc-850,
.dark .dark\:bg-zinc-850\/90,
.dark .dark\:bg-zinc-850\/80,
.dark .dark\:bg-zinc-850\/60,
.dark .dark\:bg-zinc-850\/50,
.dark .dark\:bg-zinc-850\/40 {
  background-color: #1f1f23 !important;
}
.dark .dark\:border-zinc-750 {
  border-color: #383842 !important;
}

/* 打印与离线保存 */
@media print {
  header, nav, #calendar-control-bar, .no-print, #day-detail-drawer-backdrop, #spotlight-search-modal {
    display: none !important;
  }
  body {
    background: #ffffff !important;
    color: #000000 !important;
  }
}

/* Spotlight 全局聚光灯检索样式与交互动效 */
#spotlight-search-modal:not(.hidden) > div:last-child > div {
  animation: spotlightPopIn 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes spotlightPopIn {
  from {
    opacity: 0;
    transform: scale(0.975) translateY(-8px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.spotlight-result-item {
  transition: all 0.12s ease;
}

.spotlight-result-item.is-selected {
  background-color: #f1f5f9;
  border-color: #1b4332 !important;
  box-shadow: 0 0 0 1px #1b4332;
}

.dark .spotlight-result-item.is-selected {
  background-color: #27272a !important;
  border-color: #4e8265 !important;
  box-shadow: 0 0 0 1px #4e8265;
}

.spotlight-highlight {
  background-color: rgba(27, 67, 50, 0.15);
  color: #1b4332;
  padding: 0.05em 0.25em;
  border-radius: 0.25rem;
  font-weight: 600;
}

.dark .spotlight-highlight {
  background-color: rgba(78, 130, 101, 0.25);
  color: #8eb69b;
}

