/* 客户经营大脑 Wiki — pure B&W (Codex / OpenAI-docs inspired) */

:root {
  --bg: #ffffff;
  --bg-soft: #fafafa;
  --ink: #000000;
  --ink-soft: #1a1a1a;
  --muted: #666666;
  --muted-2: #888888;
  --line: rgba(0, 0, 0, 0.12);
  --line-strong: rgba(0, 0, 0, 0.22);
  --fill: #000000;
  --fill-fg: #ffffff;
  --code-bg: #f5f5f5;
  --radius: 12px;
  --radius-pill: 999px;
  --max: 40rem;
  --sidebar: 14rem;
  --top: 3.5rem;
  --sans: "PingFang SC", "Hiragino Sans GB", "Noto Sans SC",
    "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "SF Mono", ui-monospace, Menlo, Consolas, monospace;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 4px 16px rgba(0, 0, 0, 0.04);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.75;
  letter-spacing: -0.01em;
  color: var(--ink-soft);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  text-decoration-color: rgba(0, 0, 0, 0.28);
}
a:hover {
  text-decoration-color: var(--ink);
}

/* Topbar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--top);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 0 1.25rem;
  border-bottom: 1px solid var(--line);
  font-family: var(--sans);
}
.topbar .logo {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: -0.02em;
  color: var(--ink);
  white-space: nowrap;
  text-decoration: none;
}
.topbar .logo:hover { opacity: 0.7; text-decoration: none; }
.topbar .logo-mark {
  width: 28px;
  height: 28px;
  display: block;
  flex-shrink: 0;
  border-radius: 50%;
}
.topbar .logo-text { font-weight: 600; }
.topbar nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.1rem 1rem;
  font-size: 0.82rem;
  flex: 1;
  min-width: 0;
  color: var(--muted);
}
.topbar nav a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 450;
}
.topbar nav a:hover,
.topbar nav a.active {
  color: var(--ink);
  text-decoration: none;
}
.topbar .btn-task {
  background: var(--fill);
  color: var(--fill-fg) !important;
  padding: 0.4rem 0.95rem;
  border: none;
  border-radius: var(--radius-pill);
  font-size: 0.8rem;
  font-weight: 500;
  font-family: var(--sans);
  white-space: nowrap;
  text-decoration: none !important;
}
.topbar .btn-task:hover { opacity: 0.85; }

@media (max-width: 520px) {
  .topbar .logo-text { display: none; }
}

/* Layout */
.layout {
  display: grid;
  grid-template-columns: var(--sidebar) 1fr;
  max-width: 68rem;
  margin: 0 auto;
  min-height: calc(100vh - var(--top) - 5rem);
}
.layout.no-side { grid-template-columns: 1fr; }
.sidebar {
  position: sticky;
  top: var(--top);
  align-self: start;
  max-height: calc(100vh - var(--top));
  overflow-y: auto;
  padding: 1.75rem 1rem 2.5rem 1.25rem;
  font-size: 0.8rem;
  line-height: 1.5;
  border-right: 1px solid var(--line);
  background: var(--bg);
}
.sidebar h3 {
  margin: 1.35rem 0 0.4rem;
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted-2);
  font-weight: 500;
}
.sidebar h3:first-child { margin-top: 0; }
.sidebar ul { list-style: none; margin: 0; padding: 0; }
.sidebar li { margin: 0.08rem 0; }
.sidebar a {
  color: var(--ink-soft);
  display: block;
  padding: 0.28rem 0.4rem;
  border-radius: 6px;
  text-decoration: none;
}
.sidebar a:hover,
.sidebar a.active {
  background: var(--bg-soft);
  color: var(--ink);
  text-decoration: none;
}

.main {
  padding: 2.25rem 2rem 4rem;
  max-width: calc(var(--max) + 4rem);
}
.main.wide { max-width: 48rem; }
.prose { max-width: var(--max); }

/* Type */
h1, h2, h3, h4 {
  font-family: var(--sans);
  line-height: 1.25;
  color: var(--ink);
  font-weight: 600;
  letter-spacing: -0.03em;
}
h1 {
  font-size: 2rem;
  margin: 0 0 1rem;
  font-weight: 600;
  letter-spacing: -0.035em;
}
h2 {
  font-size: 1.25rem;
  margin: 2.5rem 0 0.85rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--line);
  font-weight: 600;
}
h3 { font-size: 1.05rem; margin: 1.75rem 0 0.5rem; font-weight: 600; }
h4 { font-size: 0.95rem; margin: 1.25rem 0 0.4rem; font-weight: 600; }
p { margin: 0.85rem 0; }
.prose p { max-width: 42em; }
ul, ol { margin: 0.65rem 0; padding-left: 1.35rem; }
li { margin: 0.35rem 0; }
hr {
  border: none;
  border-top: 1px solid var(--line);
  margin: 2.25rem 0;
}

blockquote {
  margin: 1.35rem 0;
  padding: 0.15rem 0 0.15rem 1rem;
  border-left: 2px solid var(--ink);
  background: transparent;
  color: var(--muted);
  border-radius: 0;
}
blockquote p:first-child { margin-top: 0; }
blockquote p:last-child { margin-bottom: 0; }

code {
  font-family: var(--mono);
  font-size: 0.86em;
  background: var(--code-bg);
  padding: 0.1em 0.35em;
  border-radius: 4px;
  color: var(--ink);
}
pre {
  background: var(--ink);
  color: #f5f5f5;
  padding: 1.1rem 1.2rem;
  border-radius: var(--radius);
  overflow-x: auto;
  font-size: 0.82rem;
  line-height: 1.6;
  font-family: var(--mono);
}
pre code { background: none; padding: 0; color: inherit; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  margin: 1.25rem 0;
  background: transparent;
  line-height: 1.5;
}
th, td {
  text-align: left;
  padding: 0.65rem 0.55rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
th {
  background: transparent;
  color: var(--muted);
  font-weight: 500;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--line-strong);
}
tr:last-child td { border-bottom: 1px solid var(--line); }

.meta-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.9rem;
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 1.35rem;
}
.badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 500;
  padding: 0.15rem 0.55rem;
  border-radius: var(--radius-pill);
  background: var(--bg-soft);
  color: var(--muted);
  border: 1px solid var(--line);
}
.badge.accent { background: var(--ink); color: #fff; border-color: var(--ink); }
.badge.layer { background: transparent; }

/* Home */
.hero {
  background: transparent;
  color: var(--ink);
  border-radius: 0;
  padding: 1.75rem 0 1.5rem;
  margin-bottom: 0.25rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
}
.hero h1 {
  color: var(--ink);
  font-size: 2.35rem;
  margin: 0 0 0.75rem;
  font-weight: 600;
  letter-spacing: -0.04em;
}
.hero .sub {
  color: var(--muted);
  font-size: 1.05rem;
  margin: 0;
  font-weight: 400;
  line-height: 1.7;
  max-width: 36em;
}
.agent-note {
  margin-top: 1.15rem;
  padding: 0;
  background: transparent;
  font-size: 0.8rem;
  color: var(--muted-2);
  line-height: 1.6;
}
.agent-note code {
  background: var(--code-bg);
  color: var(--ink-soft);
}

.section-label {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-2);
  margin: 0 0 0.45rem;
  font-weight: 500;
}

.state-card {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 1.75rem 0;
  margin-bottom: 0.25rem;
  box-shadow: none;
  border-bottom: 1px solid var(--line);
}
.state-card h2 {
  margin: 0 0 1.1rem;
  border: none;
  font-size: 1.2rem;
  padding: 0;
}
.state-card .dot { display: none; }
.state-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  gap: 1rem 1.25rem;
  margin-bottom: 1.15rem;
}
.state-item {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.9rem 1rem;
  box-shadow: var(--shadow);
}
.state-item .label {
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 500;
  letter-spacing: 0.04em;
}
.state-item .value {
  font-weight: 560;
  margin-top: 0.3rem;
  font-size: 0.95rem;
  color: var(--ink);
  line-height: 1.45;
}
.dont-list {
  margin: 0.5rem 0 0;
  padding-left: 1.2rem;
  font-size: 0.95rem;
  color: var(--ink-soft);
}
.dont-list li { margin: 0.3rem 0; }

.originals-cta {
  border: 1px solid var(--line) !important;
  border-radius: var(--radius) !important;
  padding: 1.35rem 1.35rem !important;
  margin: 1.35rem 0 1.5rem !important;
  background: var(--bg) !important;
  box-shadow: var(--shadow);
}
.originals-cta h2 { margin-top: 0.2rem !important; border: none !important; padding: 0 !important; }

.entry-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
  margin: 1rem 0 1.5rem;
}
.entry {
  display: block;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.15rem 1.25rem;
  text-decoration: none !important;
  color: inherit;
  box-shadow: var(--shadow);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.entry:hover {
  border-color: var(--line-strong);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}
.entry .num {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.entry h3 {
  margin: 0.35rem 0 0.3rem;
  font-size: 1.08rem;
  color: var(--ink);
  letter-spacing: -0.02em;
}
.entry p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.6;
}

/* Cards list */
.card-list { display: flex; flex-direction: column; gap: 0.65rem; }
.card {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.05rem 1.15rem;
  display: block;
  text-decoration: none !important;
  color: inherit;
  box-shadow: var(--shadow);
}
.card:hover { border-color: var(--line-strong); }
.card h3 { margin: 0 0 0.3rem; font-size: 1.02rem; color: var(--ink); }
.card p { margin: 0; font-size: 0.88rem; color: var(--muted); line-height: 1.6; }
.claim-card { border-left: 2px solid var(--ink); }

/* Tasks */
.task-grid { display: grid; grid-template-columns: 1fr; gap: 0.85rem; }
.task-card {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.35rem 1.35rem;
  box-shadow: var(--shadow);
}
.task-card h3 { margin: 0 0 0.45rem; font-size: 1.05rem; }
.task-card .desc { font-size: 0.92rem; color: var(--muted); margin: 0 0 0.9rem; }
.prompt-box {
  background: var(--code-bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.95rem 1rem;
  font-size: 0.8rem;
  font-family: var(--mono);
  white-space: pre-wrap;
  line-height: 1.55;
  max-height: 220px;
  overflow-y: auto;
  margin-bottom: 0.9rem;
}
.task-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: center;
}
.btn {
  appearance: none;
  border: none;
  cursor: pointer;
  font-family: var(--sans);
  font-size: 0.82rem;
  font-weight: 500;
  padding: 0.5rem 1.05rem;
  border-radius: var(--radius-pill);
  background: var(--fill);
  color: var(--fill-fg);
  letter-spacing: -0.01em;
}
.btn:hover { opacity: 0.88; filter: none; }
.btn.accent { background: var(--fill); }
.btn.ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line-strong);
}
.btn.ghost:hover { background: var(--bg-soft); }
.copy-ok { font-size: 0.78rem; color: var(--muted); display: none; }
.copy-ok.show { display: inline; }

.grok-cta {
  background: transparent;
  color: var(--ink);
  border-radius: var(--radius);
  padding: 1.25rem 1.25rem;
  margin: 0.75rem 0 1.35rem;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.grok-cta a { color: var(--ink); font-weight: 500; }
.grok-cta p { margin: 0.35rem 0; color: var(--muted); font-size: 0.92rem; }

.group {
  margin: 1.5rem 0;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.15rem 1.25rem;
  box-shadow: var(--shadow);
}
.group h3 { margin: 0 0 0.75rem; font-size: 1.02rem; border: none; padding: 0; }
.group ul { margin: 0; padding-left: 1.2rem; }

.site-footer {
  border-top: 1px solid var(--line);
  padding: 1.75rem 1.5rem 2.5rem;
  text-align: center;
  font-size: 0.78rem;
  color: var(--muted);
  background: var(--bg);
  line-height: 1.7;
}
.site-footer strong { color: var(--ink-soft); font-weight: 500; }

.crumb {
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 1rem;
}
.crumb a { color: var(--muted); text-decoration: none; }
.crumb a:hover { color: var(--ink); }

.lede {
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.75;
  margin: 0 0 1.15rem;
}

.toc {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  margin: 1.15rem 0 1.5rem;
  font-size: 0.88rem;
  box-shadow: var(--shadow);
}
.toc strong {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.toc ul { margin: 0; padding-left: 1.1rem; }

.dl-bar { margin: 1.15rem 0 1.35rem; }
.dl-bar .btn {
  display: inline-block;
  background: var(--fill);
  color: var(--fill-fg) !important;
  padding: 0.55rem 1.15rem;
  border-radius: var(--radius-pill);
  font-weight: 500;
  text-decoration: none !important;
}
.page-gallery { display: flex; flex-direction: column; gap: 1.5rem; margin: 1.5rem 0 2.25rem; }
.page-fig {
  margin: 0;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.page-fig figcaption {
  padding: 0.55rem 1rem;
  font-size: 0.75rem;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  background: var(--bg-soft);
  letter-spacing: 0.02em;
}
.page-fig img { display: block; width: 100%; height: auto; background: #fff; }

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .topbar nav { display: none; }
  .main { padding: 1.5rem 1.1rem 3rem; }
  body { font-size: 16px; }
  h1 { font-size: 1.65rem; }
  .hero h1 { font-size: 1.85rem; }
}

@media print {
  .topbar, .sidebar, .btn, .task-actions, .site-footer .hide-print { display: none !important; }
  body { background: #fff; color: #000; font-size: 11pt; }
  .main { max-width: 100%; padding: 0; }
  a { color: #000; text-decoration: underline; }
  .state-card, .hero, .task-card, .card, .entry { box-shadow: none; }
}
