/* === 仙草谷 PRD Shared Styles === */
:root {
  --primary: #2d5a27;
  --primary-light: #4a8c3f;
  --accent: #c8a84e;
  --accent-light: #e8d5a3;
  --bg: #faf8f2;
  --bg-card: #ffffff;
  --text: #2c2420;
  --text-secondary: #5c5048;
  --border: #e0d8c8;
  --danger: #c0392b;
  --info: #2980b9;
  --success: #27ae60;
  --warning: #f39c12;
  --spirit: #8e44ad;
  --herb: #16a085;
  --shadow: 0 2px 12px rgba(0,0,0,0.06);
  --radius: 10px;
  --font: 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', system-ui, -apple-system, sans-serif;
  --mono: 'SF Mono', 'Cascadia Code', 'Consolas', monospace;
}

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

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  min-height: 100vh;
}

/* === Navigation === */
.topnav {
  background: linear-gradient(135deg, var(--primary), #1a3d15);
  color: #fff;
  padding: 0 24px;
  display: flex;
  align-items: center;
  height: 56px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 16px rgba(0,0,0,0.15);
}
.topnav .logo {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  white-space: nowrap;
}
.topnav .logo span { color: var(--accent); }
.topnav nav {
  margin-left: auto;
  display: flex;
  gap: 4px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.topnav nav a {
  color: rgba(255,255,255,0.78);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.85rem;
  white-space: nowrap;
  transition: all 0.2s;
}
.topnav nav a:hover,
.topnav nav a.active {
  color: #fff;
  background: rgba(255,255,255,0.12);
}

/* === Layout === */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 24px 80px;
}

/* === Hero === */
.hero {
  background: linear-gradient(160deg, #1a3d15 0%, #2d5a27 40%, #4a8c3f 100%);
  color: #fff;
  padding: 56px 24px 48px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 40px;
  background: linear-gradient(to top, var(--bg), transparent);
}
.hero h1 {
  font-size: 2.6rem;
  font-weight: 800;
  letter-spacing: 2px;
  margin-bottom: 8px;
}
.hero h1 span { color: var(--accent); }
.hero .subtitle {
  font-size: 1.15rem;
  opacity: 0.85;
  margin-bottom: 16px;
}
.hero .oneliner {
  display: inline-block;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 24px;
  padding: 8px 24px;
  font-size: 1.05rem;
  backdrop-filter: blur(4px);
}

/* === Cards === */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 32px;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
}
.card h2 {
  font-size: 1.4rem;
  color: var(--primary);
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--accent-light);
  display: flex;
  align-items: center;
  gap: 10px;
}
.card h2 .icon { font-size: 1.5rem; }
.card h3 {
  font-size: 1.1rem;
  color: var(--primary-light);
  margin: 20px 0 10px;
}
.card h4 {
  font-size: 1rem;
  color: var(--text-secondary);
  margin: 14px 0 8px;
}

/* === Grid === */
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }

/* === Tables === */
.table-wrap { overflow-x: auto; margin: 16px 0; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}
th {
  background: var(--primary);
  color: #fff;
  padding: 10px 14px;
  text-align: left;
  font-weight: 600;
}
td {
  padding: 9px 14px;
  border-bottom: 1px solid var(--border);
}
tr:nth-child(even) td { background: #fdfbf5; }
tr:hover td { background: #f7f3e8; }

/* === Tags & Badges === */
.tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.3px;
}
.tag-n { background: #e0e0e0; color: #555; }
.tag-r { background: #d5f5e3; color: #1e8449; }
.tag-sr { background: #d6eaf8; color: #2471a3; }
.tag-ssr { background: #e8daef; color: #7d3c98; }
.tag-ur { background: #fdebd0; color: #b9770e; }
.tag-sp { background: linear-gradient(135deg, #ff6b6b, #ffd93d, #6bcb77); color: #fff; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
}
.badge-primary { background: var(--primary); color: #fff; }
.badge-accent { background: var(--accent); color: #fff; }
.badge-info { background: var(--info); color: #fff; }
.badge-warn { background: var(--warning); color: #fff; }
.badge-spirit { background: var(--spirit); color: #fff; }
.badge-herb { background: var(--herb); color: #fff; }

/* === Flow / Pipeline === */
.flow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 16px;
  background: #f9f6ee;
  border-radius: var(--radius);
  margin: 14px 0;
  font-size: 0.9rem;
}
.flow .node {
  background: var(--primary);
  color: #fff;
  padding: 6px 14px;
  border-radius: 6px;
  font-weight: 600;
  white-space: nowrap;
}
.flow .arrow { color: var(--accent); font-weight: 700; font-size: 1.1rem; }

.flow-vert {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 16px;
}
.flow-vert .node {
  background: var(--primary);
  color: #fff;
  padding: 6px 18px;
  border-radius: 6px;
  font-weight: 600;
}
.flow-vert .arrow { color: var(--accent); font-size: 1.3rem; }

/* === Architecture diagram === */
.arch {
  background: #1e1e2e;
  color: #cdd6f4;
  border-radius: var(--radius);
  padding: 20px 24px;
  font-family: var(--mono);
  font-size: 0.85rem;
  line-height: 1.6;
  overflow-x: auto;
  margin: 14px 0;
  white-space: pre;
}

/* === Callout === */
.callout {
  border-left: 4px solid var(--info);
  background: #eaf2f8;
  padding: 14px 18px;
  border-radius: 0 var(--radius) var(--radius) 0;
  margin: 16px 0;
  font-size: 0.92rem;
}
.callout.warn {
  border-left-color: var(--warning);
  background: #fef9e7;
}
.callout.success {
  border-left-color: var(--success);
  background: #eafaf1;
}
.callout.danger {
  border-left-color: var(--danger);
  background: #fdedec;
}

/* === TOC === */
.toc {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 28px;
  margin-bottom: 28px;
}
.toc h3 { margin-top: 0; color: var(--primary); }
.toc ol { columns: 2; column-gap: 32px; }
.toc li { margin: 4px 0; }
.toc a { color: var(--primary-light); text-decoration: none; }
.toc a:hover { text-decoration: underline; }

/* === KPI cards === */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  margin: 16px 0;
}
.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  text-align: center;
  box-shadow: var(--shadow);
}
.kpi-card .value {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--primary);
}
.kpi-card .label {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* === Footer === */
.footer {
  text-align: center;
  padding: 32px 24px;
  color: var(--text-secondary);
  font-size: 0.82rem;
  border-top: 1px solid var(--border);
  margin-top: 48px;
}
.footer a { color: var(--primary-light); }

/* === Responsive === */
@media (max-width: 768px) {
  .hero h1 { font-size: 1.8rem; }
  .container { padding: 20px 14px 60px; }
  .card { padding: 18px 16px; }
  .toc ol { columns: 1; }
  .topnav { padding: 0 12px; }
  .topnav nav a { font-size: 0.78rem; padding: 4px 8px; }
  .flow { font-size: 0.8rem; gap: 4px; }
  .flow .node { padding: 4px 10px; }
}

/* === Print === */
@media print {
  .topnav { position: static; }
  .card { break-inside: avoid; box-shadow: none; }
  body { background: #fff; }
}

/* === Season Roadmap === */
.timeline {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin: 16px 0;
}
.timeline-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
  border-top: 4px solid var(--accent);
}
.timeline-item .season { font-weight: 800; color: var(--primary); font-size: 1.1rem; }
.timeline-item .theme { color: var(--accent); font-weight: 600; margin: 4px 0; }
.timeline-item .content { font-size: 0.82rem; color: var(--text-secondary); }

/* === Domain model diagram === */
.domain-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
  margin: 16px 0;
}
.domain-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 16px;
}
.domain-card h4 { color: var(--primary); margin: 0 0 6px; }
.domain-card ul { list-style: none; font-size: 0.85rem; color: var(--text-secondary); }
.domain-card li::before { content: '▸ '; color: var(--accent); }

/* === Entity table compact === */
.entity-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px;
  margin: 14px 0;
}
.entity-item {
  background: #faf8f2;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 12px 14px;
}
.entity-item .name { font-weight: 700; color: var(--primary); }
.entity-item .fields { font-size: 0.82rem; color: var(--text-secondary); margin-top: 4px; }
