/* cesar.cc.cd · shared design system (v4.1 luminous unified shell)
   Tokens, light hairline site bar, inline concept drawer, and active recall primitives.
   Every class is prefixed cc- so it drops cleanly into report pages without colliding. */
:root {
  --cc-paper: #ffffff;
  --cc-paper-2: #f5f7f6;
  --cc-card: #ffffff;
  --cc-ink: #16181a;
  --cc-ink-2: #464e54;
  --cc-muted: #7c858b;
  --cc-rule: #e4e8e6;
  --cc-rule-2: #eff1f3;
  --cc-gold: #c27a1c;
  --cc-b1: #b4612a;
  --cc-b2: #1f6e5c;
  --cc-b3: #8b3a4b;
  --cc-signal: #c84b28;
  --cc-blue: #2c5d88;
  --cc-green: #1f6e5c;
  --cc-focus: #1f6e5c;
  --cc-serif: "Songti SC", "STSong", "Noto Serif CJK SC", "Noto Serif SC", "Source Han Serif SC", Georgia, serif;
  --cc-sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
  --cc-mono: "SF Mono", ui-monospace, Menlo, Consolas, monospace;
  --cc-radius: 10px;
  --cc-bar-h: 50px;
}

/* ---------- Unified Luminous Hairline Site Bar (report & utility pages) ---------- */
.cc-bar {
  position: sticky;
  top: 0;
  z-index: 50;
  font-family: var(--cc-sans);
  font-size: 13.5px;
  line-height: 1.4;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(10px);
  color: var(--cc-ink);
  border-bottom: 1px solid var(--cc-rule-2);
  -webkit-font-smoothing: antialiased;
}
.cc-bar * { box-sizing: border-box; }
.cc-bar-in {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 32px;
  min-height: var(--cc-bar-h);
}
.cc-brand {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  color: var(--cc-ink);
  text-decoration: none;
  padding: 6px 0;
}
.cc-brand b {
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic;
  font-weight: 400;
  font-size: 20px;
  letter-spacing: 0.01em;
}
.cc-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.cc-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 11px;
  border-radius: 6px;
  color: #525a60;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.14s ease, background 0.14s ease;
}
.cc-nav a:hover {
  background: #f5f7f6;
  color: var(--cc-ink);
}
.cc-nav a[aria-current="page"] {
  color: var(--cc-green);
  font-weight: 600;
  box-shadow: inset 0 -2px 0 var(--cc-green);
  border-radius: 0;
}
.cc-nav .cc-sep {
  width: 1px;
  height: 14px;
  background: var(--cc-rule);
  margin: 0 6px;
}
.cc-menu {
  display: none;
  position: relative;
}
.cc-menu > summary {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 8px;
  color: var(--cc-ink);
  background: #ffffff;
  border: 1px solid var(--cc-rule);
  font-weight: 500;
}
.cc-menu > summary::-webkit-details-marker { display: none; }
.cc-menu > summary::before {
  content: "";
  width: 14px;
  height: 9px;
  border-top: 1.8px solid currentColor;
  border-bottom: 1.8px solid currentColor;
  background: linear-gradient(currentColor, currentColor) center/100% 1.8px no-repeat;
}
.cc-menu[open] > summary {
  background: #f5f7f6;
}
.cc-menu .cc-nav {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  flex-direction: column;
  align-items: stretch;
  min-width: 210px;
  padding: 6px;
  background: #ffffff;
  border: 1px solid var(--cc-rule);
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(22, 24, 26, 0.1);
}
.cc-menu .cc-nav a {
  color: var(--cc-ink);
  min-height: 40px;
  padding: 0 12px;
}
.cc-menu .cc-nav a:hover {
  background: #f5f7f6;
}
.cc-menu .cc-nav a[aria-current="page"] {
  box-shadow: inset 3px 0 0 var(--cc-green);
  border-radius: 4px;
}
.cc-menu .cc-nav .cc-sep {
  width: auto;
  height: 1px;
  background: var(--cc-rule-2);
  margin: 4px;
}
.cc-bar a:focus-visible,
.cc-bar summary:focus-visible {
  outline: 2px solid var(--cc-green);
  outline-offset: 2px;
}
@media (max-width: 860px) {
  .cc-bar-in { padding: 0 16px; }
  .cc-bar-in > .cc-nav { display: none; }
  .cc-menu { display: block; }
}
@media print { .cc-bar { display: none; } }

/* ---------- Primitives ---------- */
.cc-page {
  margin: 0;
  background: var(--cc-paper);
  color: var(--cc-ink);
  font-family: var(--cc-sans);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
.cc-page *, .cc-page *::before, .cc-page *::after { box-sizing: border-box; }
:where(.cc-page) a {
  color: inherit;
  text-underline-offset: 0.22em;
  text-decoration-thickness: 1px;
}
.cc-page :focus-visible {
  outline: 2px solid var(--cc-focus);
  outline-offset: 2px;
}
.cc-skip {
  position: absolute;
  left: 12px;
  top: 0;
  transform: translateY(-140%);
  background: #ffffff;
  color: var(--cc-ink);
  padding: 10px 14px;
  border-radius: 0 0 8px 8px;
  border: 1px solid var(--cc-rule);
  z-index: 100;
}
.cc-skip:focus { transform: none; }
.cc-serif { font-family: var(--cc-serif); }
.cc-eyebrow {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cc-muted);
  font-weight: 600;
}
.cc-sr {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- Inline Concept Drawer (#cc-drawer) ---------- */
.cc-drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(22, 24, 26, 0.26);
  backdrop-filter: blur(2px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
}
.cc-drawer-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}
.cc-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 95;
  width: min(440px, 92vw);
  background: #ffffff;
  color: var(--cc-ink);
  border-left: 1px solid var(--cc-rule);
  box-shadow: -12px 0 36px rgba(22, 24, 26, 0.12);
  transform: translateX(104%);
  transition: transform 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
  display: flex;
  flex-direction: column;
}
.cc-drawer.is-open { transform: translateX(0); }
.cc-drawer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--cc-rule-2);
  background: #f8faf9;
}
.cc-drawer-head h2 {
  margin: 4px 0 2px;
  font-family: var(--cc-serif);
  font-size: 21px;
  font-weight: 600;
  line-height: 1.28;
  color: var(--cc-ink);
}
.cc-drawer-close {
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--cc-rule);
  background: #ffffff;
  color: #525a60;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.cc-drawer-close:hover {
  border-color: var(--cc-ink);
  color: var(--cc-ink);
}
.cc-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 18px 20px 28px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.cc-drawer-box {
  background: #f7f9f8;
  border: 1px solid #e6ebe9;
  border-left: 3px solid var(--cc-green);
  border-radius: 0 8px 8px 0;
  padding: 12px 14px;
  font-size: 14.5px;
  line-height: 1.68;
  color: #2c3135;
}
.cc-drawer-box b {
  display: block;
  font-size: 12px;
  color: var(--cc-muted);
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}
.cc-drawer-sec {
  font-size: 12px;
  font-weight: 700;
  color: var(--cc-muted);
  margin: 4px 0 -6px;
  letter-spacing: 0.04em;
}
.cc-drawer-bridge {
  margin-top: 4px;
  padding: 12px 14px;
  border-radius: 8px;
  background: #eef6f4;
  border: 1px solid #cde0da;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.cc-drawer-bridge span {
  font-size: 13px;
  color: #2c3135;
}
.cc-drawer-bridge a {
  font-size: 13px;
  font-weight: 600;
  color: var(--cc-green);
  text-decoration: none;
  background: #ffffff;
  padding: 5px 11px;
  border-radius: 6px;
  border: 1px solid #cde0da;
}
.cc-drawer-bridge a:hover {
  border-color: var(--cc-green);
}

@media (max-width: 680px) {
  .cc-drawer {
    top: auto;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-height: 82dvh;
    border-left: 0;
    border-top: 1px solid var(--cc-rule);
    border-radius: 14px 14px 0 0;
    transform: translateY(104%);
  }
  .cc-drawer.is-open { transform: translateY(0); }
}

/* ---------- 30-Second Active Recall Mode (.is-recall-mode & [data-recall]) ---------- */
.cc-recall-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 99px;
  border: 1px solid var(--cc-rule);
  background: #ffffff;
  color: #525a60;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.14s, border-color 0.14s, color 0.14s;
}
.cc-recall-btn:hover {
  border-color: var(--cc-ink);
  color: var(--cc-ink);
}
.cc-recall-btn[aria-pressed="true"] {
  background: var(--cc-green);
  color: #ffffff;
  border-color: var(--cc-green);
  font-weight: 600;
}
.is-recall-mode [data-recall]:not(.is-revealed) {
  position: relative;
  cursor: pointer;
  user-select: none;
  background: #f2f5f4 !important;
  border-color: #d5dfdc !important;
  transition: filter 0.15s;
}
.is-recall-mode [data-recall]:not(.is-revealed) > * {
  filter: blur(6px);
  opacity: 0.22;
  pointer-events: none;
  transition: filter 0.18s, opacity 0.18s;
}
.is-recall-mode [data-recall]:not(.is-revealed)::after {
  content: "先想一秒 · 点击显影";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 600;
  color: #1f6e5c;
  letter-spacing: 0.02em;
  background: rgba(245, 247, 246, 0.72);
  border-radius: inherit;
}
.is-recall-mode [data-recall].is-revealed {
  cursor: pointer;
  box-shadow: inset 0 0 0 1.5px var(--cc-green);
}

/* Keep injected .cc-bar harmonious with native sticky bars & anchor offsets on /cnfin/ and /fstart/ */
.cc-bar ~ .chapter-nav {
  top: var(--cc-bar-h);
}
@media (min-width: 1051px) {
  .cc-bar ~ .chapter-nav {
    grid-template-columns: repeat(9, minmax(0, 1fr));
  }
}
.cc-bar ~ .page-shell .overview,
.cc-bar ~ .page-shell .report-section {
  scroll-margin-top: 136px;
}
.cc-bar ~ .page-header,
.cc-bar ~ * .page-header {
  top: var(--cc-bar-h);
}
.cc-bar ~ .context-return {
  top: 62px;
}

@media (prefers-reduced-motion: reduce) {
  .cc-page *, .cc-page *::before, .cc-page *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
