/*
 * Zhiyong public-site system
 *
 * The homepage uses this same visual language as a small editorial product:
 * warm paper, ink, rules, restrained color, and evidence before decoration.
 * Page-specific styles may add layout, but should not reintroduce gradients,
 * glow, pill-heavy navigation, or oversized dashboard cards.
 */
:root {
  --zy-paper: #f4f1ea;
  --zy-surface: #fbfaf7;
  --zy-surface-soft: #ebe8df;
  --zy-ink: #1d2930;
  --zy-muted: #68716e;
  --zy-rule: #d4d0c7;
  --zy-red: #a94f3b;
  --zy-red-soft: #f3e6df;
  --zy-blue: #285a72;
  --zy-green: #2f6d5a;
  --zy-focus: #d6e56e;
}

body.zhiyong-site,
body.zhiyong-site main {
  background: var(--zy-paper);
  color: var(--zy-ink);
}

body.zhiyong-site {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}

body.zhiyong-site a {
  color: inherit;
}

body.zhiyong-site a:hover {
  color: var(--zy-red);
}

body.zhiyong-site :is(a, button, input, select, textarea):focus-visible {
  outline: 3px solid var(--zy-focus);
  outline-offset: 3px;
}

/* Shared public header variants */
body.zhiyong-site :is(.site-header, .topbar, .header, .top) {
  border-bottom: 1px solid var(--zy-rule);
  background: transparent;
  box-shadow: none;
}

body.zhiyong-site :is(.brand, .site-brand) {
  color: var(--zy-ink);
  letter-spacing: -0.035em;
}

body.zhiyong-site :is(.brand-mark, .mark) {
  width: 31px;
  height: 31px;
  border-radius: 4px;
  background: var(--zy-ink) !important;
  color: transparent !important;
  box-shadow: none !important;
  position: relative;
  overflow: hidden;
}

body.zhiyong-site :is(.brand-mark, .mark)::after {
  content: "";
  position: absolute;
  inset: 7px;
  border: 1px solid rgba(214, 229, 110, 0.85);
  border-radius: 50%;
}

body.zhiyong-site :is(.site-nav, .nav, .topnav) {
  gap: 18px;
  color: var(--zy-muted);
}

body.zhiyong-site :is(.site-nav, .nav, .topnav) a {
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--zy-muted);
  padding: 8px 0;
  font-weight: 650;
}

body.zhiyong-site :is(.site-nav, .nav, .topnav) a:hover,
body.zhiyong-site :is(.site-nav, .nav, .topnav) a[aria-current="page"] {
  color: var(--zy-ink);
  box-shadow: inset 0 -2px 0 var(--zy-red);
}

body.zhiyong-site :is(.header-action, .locale, .locale-link) {
  border: 1px solid var(--zy-rule);
  border-radius: 3px;
  background: var(--zy-surface);
  color: var(--zy-ink);
  box-shadow: none;
}

body.zhiyong-site :is(.header-action, .locale, .locale-link):hover {
  border-color: var(--zy-red);
  color: var(--zy-red);
}

/* Buttons, labels and repeated cards */
body.zhiyong-site :is(.button, .action, .header-action) {
  border-radius: 3px;
  box-shadow: none;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}

body.zhiyong-site :is(.button.primary, .action.primary) {
  border-color: var(--zy-ink);
  background: var(--zy-ink);
  color: var(--zy-surface);
}

body.zhiyong-site :is(.button.primary, .action.primary):hover {
  border-color: var(--zy-red);
  background: var(--zy-red);
  color: #fff;
  transform: none;
}

body.zhiyong-site :is(.eyebrow, .section-kicker) {
  color: var(--zy-red);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

body.zhiyong-site :is(.eyebrow, .section-kicker)::before {
  width: 22px;
  height: 1px;
  border-radius: 0;
  background: var(--zy-red);
  box-shadow: none;
}

body.zhiyong-site :is(.tag, .badge, .pill, .filter, .thread-badge, .feedback-kind) {
  border-radius: 3px;
  background: var(--zy-surface-soft);
  color: var(--zy-muted);
  border-color: var(--zy-rule);
  box-shadow: none;
}

body.zhiyong-site :is(.tag-primary, .filter.active, .thread-badge.agent, .feedback-kind.agent) {
  border-color: var(--zy-blue);
  background: var(--zy-blue);
  color: #fff;
}

body.zhiyong-site :is(.section, .card, .panel, .notice, .feature, .feature-aside,
  .side-card, .thread-panel, .thread-side-card, .community, .source-card,
  .hero-main, .score, .email-card, .guide, main) {
  border-radius: 4px;
  box-shadow: none;
  background-image: none;
}

body.zhiyong-site :is(.section, .card, .panel, .notice, .feature, .feature-aside,
  .side-card, .thread-panel, .thread-side-card, .community, .source-card,
  .hero-main, .email-card, .guide) {
  border-color: var(--zy-rule);
}

body.zhiyong-site :is(.section, .card, .panel, .thread-panel, .thread-side-card) {
  background: var(--zy-surface);
}

body.zhiyong-site :is(.feature, .community, .form-section, .notice) {
  background: var(--zy-surface-soft);
}

body.zhiyong-site :is(.feature, .community) {
  border-left: 3px solid var(--zy-red);
}

body.zhiyong-site :is(.section h2, .card h2, .panel h2, .thread-panel h2) {
  letter-spacing: -0.04em;
}

/* Forms and feedback */
body.zhiyong-site :is(input, select, textarea) {
  border-color: var(--zy-rule);
  border-radius: 3px;
  background: var(--zy-surface);
  color: var(--zy-ink);
  box-shadow: none;
}

body.zhiyong-site :is(input, select, textarea):focus {
  border-color: var(--zy-blue);
  outline: 2px solid rgba(40, 90, 114, 0.16);
}

body.zhiyong-site :is(.breadcrumbs, .thread-context, .summary, .lede,
  .section > p, .source-line, .email-note, .micro, .footer, .post-meta,
  .archive-side, .composer-hint, .status) {
  color: var(--zy-muted);
}

body.zhiyong-site :is(.thread-toolbar, .thread-item, .feedback-item, .article-header,
  .article-footer, .footer, .archive-item, .discovery) {
  border-color: var(--zy-rule);
}

body.zhiyong-site :is(.thread-sort, .thread-sort button[aria-selected="true"]) {
  border-radius: 3px;
  background: var(--zy-surface-soft);
  box-shadow: none;
}

body.zhiyong-site :is(.thread-sort button[aria-selected="true"]) {
  color: var(--zy-ink);
}

/* Insight reading surface: publication first, dashboard second */
body.zhiyong-site .article-body {
  color: var(--zy-ink);
}

body.zhiyong-site .judgment {
  border-left-color: var(--zy-red);
  border-radius: 0 3px 3px 0;
  background: var(--zy-red-soft);
}

body.zhiyong-site .judgment small,
body.zhiyong-site .source-link,
body.zhiyong-site .route-card a,
body.zhiyong-site .source-links a {
  color: var(--zy-red);
}

body.zhiyong-site :is(.article-figure img, .evidence-table, .evidence-panel,
  .route-card, .metric, .flow-step) {
  border-radius: 3px;
  box-shadow: none;
}

body.zhiyong-site .evidence-panel {
  background: var(--zy-surface-soft);
  border-color: var(--zy-rule);
}

body.zhiyong-site .evidence-kicker,
body.zhiyong-site .flow-step small {
  color: var(--zy-blue);
}

/* Make the system readable on narrow screens without recreating a card wall. */
@media (max-width: 760px) {
  body.zhiyong-site :is(.site-header, .topbar, .header, .top) {
    gap: 14px;
  }

  body.zhiyong-site :is(.site-nav, .nav, .topnav) {
    gap: 10px;
  }

  body.zhiyong-site :is(.site-nav a, .nav a, .topnav a) {
    font-size: 13px;
  }
}

@media (max-width: 560px) {
  body.zhiyong-site :is(.site-nav, .nav, .topnav) {
    gap: 8px;
  }

  body.zhiyong-site :is(.site-nav a, .nav a, .topnav a) {
    padding: 6px 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.zhiyong-site *,
  body.zhiyong-site *::before,
  body.zhiyong-site *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

/* Insight indexes are legacy single-file documents whose local stylesheet
   follows the head. These high-specificity rules keep the public publication
   surface on the same system while the generator is being migrated. */
body:not(.home-redesign) {
  background: var(--zy-paper) !important;
  color: var(--zy-ink) !important;
}

body:not(.home-redesign) :is(.topbar, .site-header, .header) {
  background: transparent !important;
  border-color: var(--zy-rule) !important;
  box-shadow: none !important;
}

body:not(.home-redesign) :is(.button, .action, .header-action) {
  border-radius: 3px !important;
  box-shadow: none !important;
}

body:not(.home-redesign) :is(.feature, .feature-aside, .section, .card, .panel,
  .side-card, .thread-panel, .thread-side-card, .community, .hero-main,
  .score, .email-card, .guide, .evidence-panel, .evidence-table, .route-card,
  .metric, .flow-step) {
  border-radius: 4px !important;
  box-shadow: none !important;
}

body:not(.home-redesign) :is(.feature, .community, .evidence-panel, .notice) {
  background-image: none !important;
}

body:not(.home-redesign) :is(.filter, .tag, .badge, .pill, .thread-badge,
  .feedback-kind, .source-links a) {
  border-radius: 3px !important;
}

body:not(.home-redesign) :is(.eyebrow, .section-kicker, .judgment small,
  .source-link, .source-links a, .route-card a) {
  color: var(--zy-red) !important;
}
