/* MarkFlow AI 正式宣传官网样式：温润纸感 · 品牌原生（零外部依赖、严格遵循 CSP 与减动效规范） */
:root {
  --bg-page: #f7f4ef;
  --bg-wash:
    radial-gradient(circle at 10% 6%, rgba(232, 226, 255, 0.92) 0%, rgba(247, 244, 239, 0.45) 42%, transparent 70%),
    radial-gradient(circle at 88% 14%, rgba(223, 239, 255, 0.78) 0%, rgba(247, 244, 239, 0) 54%);
  --bg-surface: rgba(255, 255, 255, 0.88);
  --bg-card: #ffffff;
  --bg-subtle: rgba(236, 232, 225, 0.78);
  --bg-subtle-hover: rgba(229, 224, 215, 0.92);
  --text-main: #1c1926;
  --text-secondary: #534e63;
  --text-muted: #7c768e;
  --border-subtle: rgba(30, 26, 46, 0.09);
  --border-strong: rgba(30, 26, 46, 0.17);
  --accent: #5b5bd6;
  --accent-hover: #4949c2;
  --accent-soft: rgba(91, 91, 214, 0.11);
  --accent-border: rgba(91, 91, 214, 0.34);
  --success: #12805c;
  --success-soft: rgba(18, 128, 92, 0.11);
  --success-border: rgba(18, 128, 92, 0.28);
  --warn: #b45309;
  --warn-soft: rgba(217, 119, 6, 0.12);
  --ai-violet: #6d28d9;
  --ai-violet-soft: rgba(139, 92, 246, 0.12);
  --mark-bg: rgba(245, 185, 66, 0.36);
  --dot-indigo: #5b5bd6;
  --dot-emerald: #12805c;
  --dot-violet: #7c3aed;
  --dot-amber: #d97706;
  --shadow-nav: 0 10px 30px -14px rgba(34, 28, 66, 0.16);
  --shadow-card: 0 20px 48px -20px rgba(38, 30, 74, 0.15), 0 0 0 1px var(--border-subtle);
  --shadow-popup: 0 26px 56px -18px rgba(45, 36, 82, 0.2), 0 0 0 1px var(--border-subtle);
  --shadow-btn: 0 8px 20px -6px rgba(91, 91, 214, 0.44), inset 0 1px 0 rgba(255, 255, 255, 0.26);
  --radius-xl: 22px;
  --radius-lg: 18px;
  --radius-md: 13px;
  --radius-sm: 10px;
  --ease-spring: cubic-bezier(0.22, 1, 0.36, 1);
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-page);
  background-image: var(--bg-wash);
  background-attachment: fixed;
  color: var(--text-main);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  max-width: 100%;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font-family: inherit;
}

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

.skip-link {
  position: absolute;
  left: -9999px;
  top: 12px;
  z-index: 120;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--accent);
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
}

.skip-link:focus {
  left: 16px;
}

.container {
  width: 100%;
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 24px;
}

.icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  display: inline-block;
}

.icon-lg {
  width: 20px;
  height: 20px;
}

/* ==================== 悬浮胶囊导航 & 移动抽屉 ==================== */
.site-header {
  position: sticky;
  top: 14px;
  z-index: 50;
  padding: 0 24px;
}

.nav-pill {
  max-width: 1140px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 9px 16px;
  background: rgba(255, 255, 255, 0.84);
  backdrop-filter: blur(18px);
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  box-shadow: var(--shadow-nav);
}

.nav-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.01em;
}

.nav-brand img {
  width: 28px;
  height: 28px;
  border-radius: 8px;
}

.nav-badge {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 2px 9px;
  border-radius: 999px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-link {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  padding: 6px 12px;
  border-radius: 999px;
  transition: color 160ms var(--ease-spring), background-color 160ms var(--ease-spring);
}

.nav-link:hover {
  color: var(--text-main);
  background: var(--bg-subtle);
}

.nav-link.is-active {
  color: var(--accent);
  background: var(--accent-soft);
  font-weight: 600;
}

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

.lang-btn {
  border: 1px solid var(--border-strong);
  background: var(--bg-card);
  color: var(--text-main);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: background-color 160ms var(--ease-spring), border-color 160ms var(--ease-spring);
}

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

.nav-cta-mini {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--accent);
  color: #ffffff;
  font-size: 12px;
  font-weight: 600;
  transition: background-color 160ms var(--ease-spring);
}

.nav-cta-mini:hover {
  background: var(--accent-hover);
}

.menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--bg-card);
  color: var(--text-main);
  cursor: pointer;
}

.mobile-drawer {
  max-width: 1140px;
  margin: 8px auto 0;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(18px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mobile-drawer[hidden] {
  display: none;
}

.mobile-drawer a {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
}

.mobile-drawer a:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

/* ==================== Hero 首屏 ==================== */
.hero {
  padding: 64px 0 44px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.02fr 0.98fr;
  gap: 42px;
  align-items: center;
}

.hero-grid > * {
  min-width: 0;
  max-width: 100%;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  padding: 5px 12px;
  border-radius: 999px;
  margin-bottom: 18px;
}

.hero h1 {
  font-size: clamp(32px, 4vw, 48px);
  line-height: 1.16;
  letter-spacing: -0.025em;
  margin-bottom: 18px;
}

.hero-desc {
  font-size: 16px;
  color: var(--text-secondary);
  margin-bottom: 26px;
  max-width: 530px;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 26px;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: #ffffff;
  font-weight: 600;
  font-size: 14px;
  box-shadow: var(--shadow-btn);
  transition: background-color 180ms var(--ease-spring), transform 180ms var(--ease-spring);
}

.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  color: var(--text-main);
  border: 1px solid var(--border-strong);
  font-weight: 600;
  font-size: 14px;
  transition: border-color 180ms var(--ease-spring), background-color 180ms var(--ease-spring);
}

.btn-secondary:hover {
  border-color: var(--accent);
  background: var(--bg-surface);
}

.edge-soon-pill {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: 1px dashed var(--border-strong);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
}

.hero-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  padding-top: 22px;
  border-top: 1px solid var(--border-subtle);
}

.metric-val {
  display: block;
  font-size: 20px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text-main);
}

.metric-lbl {
  font-size: 12px;
  color: var(--text-muted);
}

/* ==================== 像素还原的 Alt + B 浮窗模拟器 ==================== */
.popup-stage {
  background: var(--bg-surface);
  backdrop-filter: blur(22px);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-popup);
  padding: 16px;
  min-width: 0;
  max-width: 100%;
}

.popup-stage-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}

.sim-sample-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.sim-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

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

.sim-chip {
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  padding: 5px 10px;
  border-radius: 999px;
  cursor: pointer;
  transition: background-color 160ms var(--ease-spring), border-color 160ms var(--ease-spring), color 160ms var(--ease-spring);
}

.sim-chip:hover:not(:disabled) {
  border-color: var(--accent-border);
  color: var(--text-main);
}

.sim-chip.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

.sim-chip:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.tour-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  cursor: pointer;
  transition: border-color 160ms var(--ease-spring), color 160ms var(--ease-spring), background-color 160ms var(--ease-spring);
}

.tour-btn:hover {
  border-color: var(--accent-border);
  color: var(--accent);
}

.tour-btn.is-playing {
  background: var(--accent-soft);
  border-color: var(--accent-border);
  color: var(--accent);
}

.popup-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 14px;
}

.popup-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 12px;
}

.popup-head-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.popup-mini-logo {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  flex-shrink: 0;
}

.mode-tabs {
  display: inline-flex;
  background: var(--bg-subtle);
  padding: 3px;
  border-radius: 10px;
  gap: 3px;
}

.mode-tab {
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  padding: 5px 11px;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 160ms var(--ease-spring), color 160ms var(--ease-spring);
}

.mode-tab.is-active {
  background: var(--bg-card);
  color: var(--text-main);
  box-shadow: 0 2px 6px rgba(30, 26, 46, 0.08);
}

.sim-source-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

.sim-source-badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.sim-source-badge.is-ai {
  background: var(--ai-violet-soft);
  color: var(--ai-violet);
}

.sim-source-badge.is-rule {
  background: var(--success-soft);
  color: var(--success);
}

.sim-source-badge.is-memory {
  background: var(--accent-soft);
  color: var(--accent);
}

.sim-site-card {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-subtle);
  border-radius: var(--radius-sm);
  padding: 9px 11px;
  margin-bottom: 12px;
}

.site-monogram {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  flex-shrink: 0;
}

.sim-site-meta {
  min-width: 0;
  flex: 1;
}

.sim-site-host {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
}

.sim-site-url {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.field-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.field-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

.field-subhint {
  font-size: 11px;
  color: var(--accent);
  font-weight: 600;
}

.field-input {
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--bg-card);
  color: var(--text-main);
  font-size: 13px;
  margin-bottom: 12px;
  transition: border-color 180ms var(--ease-spring), background-color 180ms var(--ease-spring);
}

.field-input.is-refining {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.folder-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 14px;
}

.folder-pill-left {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.folder-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--dot-indigo);
  flex-shrink: 0;
}

.folder-dot.is-rule {
  background: var(--dot-emerald);
}

.folder-dot.is-memory {
  background: var(--dot-violet);
}

.sim-save-btn {
  width: 100%;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: #ffffff;
  font-weight: 600;
  font-size: 13px;
  padding: 10px 14px;
  cursor: pointer;
  box-shadow: var(--shadow-btn);
  transition: background-color 160ms var(--ease-spring);
}

.sim-save-btn:hover {
  background: var(--accent-hover);
}

.sim-result-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 248px;
  overflow-y: auto;
}

.sim-result-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color 140ms var(--ease-spring), border-color 140ms var(--ease-spring);
}

.sim-result-item:hover,
.sim-result-item.is-selected {
  background: var(--accent-soft);
  border-color: var(--accent-border);
}

.sim-result-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.sim-result-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.sim-result-title {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sim-result-meta {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sim-result-kbd {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  padding: 2px 6px;
  border-radius: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
}

.sim-search-empty {
  text-align: center;
  padding: 24px 12px;
  font-size: 13px;
  color: var(--text-muted);
}

mark {
  background: var(--mark-bg);
  color: inherit;
  border-radius: 3px;
  padding: 0 2px;
}

.sim-hint-foot {
  margin-top: 10px;
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
}

.sim-toast {
  margin-top: 10px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: var(--success-soft);
  color: var(--success);
  font-size: 12px;
  font-weight: 600;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 200ms var(--ease-spring), transform 200ms var(--ease-spring);
  pointer-events: none;
}

.sim-toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ==================== 快捷键速查带 & 4 大卖点卡 ==================== */
.shortcut-strip {
  margin: 8px 0 28px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.shortcut-items {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.shortcut-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
}

.kbd-key {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 7px;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  box-shadow: 0 2px 0 var(--border-subtle);
  color: var(--text-main);
}

.pillars-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.pillar-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 18px;
  box-shadow: 0 8px 24px -16px rgba(38, 30, 74, 0.14);
}

.pillar-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}

.pillar-card h3 {
  font-size: 15px;
  margin-bottom: 6px;
}

.pillar-card p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.55;
}

/* ==================== 章节通用 ==================== */
.section {
  padding: 52px 0;
}

.section-head {
  max-width: 740px;
  margin-bottom: 26px;
}

.section-kicker {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
}

.section-title {
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.24;
  letter-spacing: -0.02em;
  margin-bottom: 10px;
}

.section-desc {
  font-size: 15px;
  color: var(--text-secondary);
}

.editorial-card {
  width: 100%;
  max-width: 100%;
  background: var(--bg-surface);
  backdrop-filter: blur(18px);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
  padding: 26px;
}

/* ==================== 智能整理与 5 规则/5 风格 ==================== */
.reorg-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.reorg-phase-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.reorg-phase-tabs {
  display: inline-flex;
  background: var(--bg-subtle);
  padding: 4px;
  border-radius: 12px;
  gap: 4px;
}

.reorg-phase-btn {
  border: none;
  background: transparent;
  padding: 8px 14px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
}

.reorg-phase-btn.is-active {
  background: var(--bg-card);
  color: var(--accent);
  box-shadow: 0 2px 8px rgba(30, 26, 46, 0.08);
}

.reorg-controls-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.reorg-style-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.reorg-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.reorg-stat-box {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}

.reorg-stat-box span {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
}

.reorg-stat-box strong {
  font-size: 16px;
  font-variant-numeric: tabular-nums;
  color: var(--text-main);
}

.reorg-messy-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.reorg-messy-item {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}

.reorg-messy-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.reorg-messy-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
}

.reorg-warn-tag {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 600;
  color: var(--warn);
  background: var(--warn-soft);
  padding: 2px 7px;
  border-radius: 6px;
}

.reorg-messy-meta {
  font-size: 12px;
  color: var(--text-muted);
}

.reorg-tree {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.reorg-animate-in {
  animation: fadeSlideUp 320ms var(--ease-spring) both;
}

@keyframes fadeSlideUp {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.reorg-folder-card {
  background: var(--bg-card);
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-md);
  padding: 16px;
}

.reorg-folder-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-subtle);
}

.reorg-folder-slash {
  color: var(--text-muted);
}

.reorg-folder-child {
  color: var(--accent);
}

.reorg-clean-items {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.reorg-clean-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.reorg-tier {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--success);
  background: var(--success-soft);
  padding: 1px 6px;
  border-radius: 5px;
  flex-shrink: 0;
}

.reorg-clean-title {
  font-weight: 500;
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.reorg-clean-domain {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.reorg-backup-banner {
  margin-top: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--success-soft);
  border: 1px solid var(--success-border);
  color: var(--success);
  font-size: 12px;
  font-weight: 600;
}

/* ==================== 0ms 规则实验室 ==================== */
.rule-presets-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}

.rule-grid {
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
  gap: 20px;
  align-items: stretch;
}

.rule-input-last {
  margin-bottom: 0;
}

.rule-result-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
}

.rule-status-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.rule-status-badge {
  display: inline-flex;
  font-size: 12px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 999px;
}

.rule-status-badge.is-hit {
  background: var(--success-soft);
  color: var(--success);
}

.rule-status-badge.is-miss {
  background: var(--warn-soft);
  color: var(--warn);
}

.rule-latency {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
}

.rule-url-preview {
  font-family: var(--font-mono);
  font-size: 12px;
  background: var(--bg-subtle);
  border-radius: 8px;
  padding: 9px 11px;
  word-break: break-all;
  color: var(--text-secondary);
}

.rule-hit-mark {
  background: var(--success-soft);
  color: var(--success);
  font-weight: 700;
  padding: 1px 3px;
  border-radius: 4px;
}

.rule-target-box {
  background: var(--bg-subtle);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}

.rule-target-box span {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.rule-target-box strong {
  font-size: 15px;
}

.rule-fragment {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--success);
}

/* ==================== 实景画廊 + 灯箱 ==================== */
.gallery-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.gallery-tab {
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  color: var(--text-secondary);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 160ms var(--ease-spring), color 160ms var(--ease-spring), border-color 160ms var(--ease-spring);
}

.gallery-tab.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

.gallery-stage {
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  background: #ece8e0;
}

.gallery-chrome {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.9);
  border-bottom: 1px solid var(--border-subtle);
}

.gallery-dots {
  display: inline-flex;
  gap: 6px;
}

.gallery-dots span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--border-strong);
}

.gallery-filename {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
}

.gallery-zoom-btn {
  display: block;
  width: 100%;
  border: none;
  background: transparent;
  cursor: zoom-in;
  padding: 0;
}

.gallery-img {
  display: block;
  width: 100%;
  height: auto;
  transition: opacity 220ms var(--ease-spring);
}

.gallery-img.is-fading {
  opacity: 0.45;
}

.gallery-caption-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 16px;
  background: var(--bg-card);
  border-top: 1px solid var(--border-subtle);
  font-size: 13px;
  color: var(--text-secondary);
}

.gallery-zoom-hint {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--accent);
  font-weight: 600;
}

/* ==================== 服务商表格 ==================== */
.provider-table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.provider-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.provider-table th,
.provider-table td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-subtle);
}

.provider-table th {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
}

.prov-name-cell {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  font-weight: 700;
}

.prov-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
}

.prov-badge.is-local {
  background: var(--success-soft);
  color: var(--success);
}

.prov-proto-tag {
  font-size: 11px;
  background: var(--bg-subtle);
  padding: 3px 8px;
  border-radius: 6px;
  white-space: nowrap;
}

.provider-table code {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent);
}

/* ==================== 隐私与安装 ==================== */
.four-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 34px;
}

.three-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.install-heading {
  font-size: 20px;
  margin-bottom: 14px;
}

.info-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 20px;
}

.info-card h3 {
  font-size: 16px;
  margin-bottom: 8px;
}

.info-card p {
  font-size: 14px;
  color: var(--text-secondary);
}

.cta-band {
  margin-top: 38px;
  background: linear-gradient(135deg, rgba(91, 91, 214, 0.1) 0%, rgba(18, 128, 92, 0.08) 100%);
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-xl);
  padding: 28px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.cta-band h3 {
  font-size: 22px;
  margin-bottom: 6px;
}

.cta-band p {
  font-size: 14px;
  color: var(--text-secondary);
  max-width: 560px;
}

.cta-band-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* ==================== 页脚 ==================== */
.site-footer {
  padding: 38px 0 54px;
  border-top: 1px solid var(--border-subtle);
  margin-top: 40px;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-size: 13px;
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}

.footer-links a:hover {
  color: var(--accent);
}

/* ==================== 灯箱 ==================== */
.mf-lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.mf-lightbox[hidden] {
  display: none;
}

.mf-lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(18, 16, 28, 0.74);
  backdrop-filter: blur(6px);
}

.mf-lightbox-dialog {
  position: relative;
  z-index: 1;
  max-width: 1080px;
  width: 100%;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
}

.mf-lightbox-img {
  width: 100%;
  height: auto;
  border-radius: 10px;
  display: block;
}

.mf-lightbox-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
}

.mf-lightbox-cap {
  font-size: 13px;
  color: var(--text-secondary);
}

.mf-lightbox-nav {
  display: inline-flex;
  gap: 8px;
}

.mf-lightbox-nav button,
.mf-lightbox-close {
  border: 1px solid var(--border-strong);
  background: var(--bg-card);
  color: var(--text-main);
  border-radius: 999px;
  cursor: pointer;
}

.mf-lightbox-nav button {
  padding: 5px 11px;
  font-size: 12px;
  font-weight: 600;
}

.mf-lightbox-close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 34px;
  height: 34px;
  font-size: 20px;
}

/* ==================== 隐私页 & 404 页专用 ==================== */
.doc-shell {
  padding: 36px 20px 64px;
}

.doc-card {
  max-width: 840px;
  margin: 0 auto;
  background: var(--bg-surface);
  backdrop-filter: blur(18px);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
  padding: 34px;
}

.doc-topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 24px;
}

.doc-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.doc-card h1 {
  font-size: 28px;
  line-height: 1.24;
  margin-bottom: 8px;
}

.doc-meta {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 18px;
}

.doc-intro {
  font-size: 15px;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.doc-card h2 {
  font-size: 18px;
  margin: 24px 0 10px;
}

.doc-card p,
.doc-card li {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.doc-card ul {
  padding-left: 20px;
}

.perm-table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0 18px;
  font-size: 13px;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.perm-table th,
.perm-table td {
  text-align: left;
  padding: 11px 13px;
  border: 1px solid var(--border-subtle);
  vertical-align: top;
}

.perm-table th {
  background: var(--bg-subtle);
  color: var(--text-main);
}

.perm-col-narrow {
  width: 28%;
}

.perm-table code {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent);
}

.ext-link {
  color: var(--accent);
  font-weight: 600;
}

.ext-link:hover {
  text-decoration: underline;
}

.notfound-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.notfound-card {
  max-width: 520px;
  width: 100%;
  text-align: center;
  background: var(--bg-surface);
  backdrop-filter: blur(18px);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
  padding: 36px 28px;
}

.notfound-code {
  font-family: var(--font-mono);
  font-size: 42px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 8px;
}

.notfound-card h1 {
  font-size: 22px;
  margin-bottom: 10px;
}

.notfound-card p {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 22px;
}

.notfound-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

/* ==================== 克制滚动入场 ==================== */
.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 480ms var(--ease-spring), transform 480ms var(--ease-spring);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .btn-primary:hover {
    transform: none;
  }
  .reorg-animate-in {
    animation: none;
  }
  .gallery-img {
    transition: none;
  }
}

@media (max-width: 960px) {
  .site-header {
    padding: 0 12px;
  }
  .container {
    padding: 0 16px;
  }
  .nav-links,
  .nav-cta-mini,
  .nav-badge {
    display: none;
  }
  .menu-btn {
    display: inline-flex;
  }
  .hero {
    padding: 36px 0 28px;
  }
  .hero-grid,
  .pillars-grid,
  .rule-grid,
  .reorg-messy-list,
  .reorg-tree,
  .four-grid,
  .three-grid,
  .reorg-stats {
    grid-template-columns: 1fr;
  }
  .editorial-card,
  .doc-card {
    padding: 18px;
  }
}

@media (max-width: 540px) {
  .hero h1 {
    font-size: 28px;
  }
  .hero-metrics {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .popup-head {
    flex-wrap: wrap;
  }
}
