/* ========================================
   AI 深度学习 · 统一设计模板
   Do NOT modify — all pages use this
   ======================================== */

:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-hover: #f1f5f9;
  --border: #e2e8f0;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-tertiary: #94a3b8;
  --accent: #6366f1;
  --accent-hover: #4f46e5;
  --accent-light: #eef2ff;
  --accent-gradient: linear-gradient(135deg, #6366f1, #8b5cf6);
  --code-bg: #0f172a;
  --code-text: #e2e8f0;
  --code-inline-bg: #f1f5f9;
  --callout-bg: #f0fdf4;
  --callout-border: #22c55e;
  --callout-text: #166534;
  --warn-bg: #fefce8;
  --warn-border: #eab308;
  --warn-text: #854d0e;
  --orange-border: #f59e0b;
  --max-width: 760px;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -2px rgba(0,0,0,0.05);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  font-family: 'Inter', 'PingFang SC', 'Microsoft YaHei', system-ui, -apple-system, sans-serif;
  background: var(--bg); color: var(--text-primary); line-height: 1.7; font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

/* --- Navigation --- */
nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,0.92); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border); padding: 0 24px;
}
nav .nav-inner {
  max-width: var(--max-width); margin: 0 auto; display: flex;
  align-items: center; height: 60px; gap: 4px; overflow-x: auto; scrollbar-width: none;
}
nav .nav-inner::-webkit-scrollbar { display: none; }
.nav-brand { font-size: 15px; font-weight: 600; color: var(--accent); white-space: nowrap; margin-right: 8px; flex-shrink: 0; }
.nav-brand span { color: var(--text-primary); }
nav a { font-size: 13px; font-weight: 500; color: var(--text-secondary); text-decoration: none; padding: 6px 10px; border-radius: 6px; white-space: nowrap; transition: all 0.15s; flex-shrink: 0; }
nav a:hover { background: var(--accent-light); color: var(--accent); }

/* --- Layout --- */
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 24px; }

/* --- Article Header --- */
.article-header { padding: 48px 0 32px; text-align: center; }
.article-header .date-badge {
  display: inline-block; font-size: 12px; font-weight: 600; color: var(--accent);
  background: var(--accent-light); padding: 4px 12px; border-radius: 20px;
  margin-bottom: 16px; letter-spacing: 0.3px;
}
.article-header h1 {
  font-size: 32px; font-weight: 700; line-height: 1.3; letter-spacing: -0.5px;
  margin-bottom: 12px;
  background: var(--accent-gradient); -webkit-background-clip: text;
  -webkit-text-fill-color: transparent; background-clip: text;
}
.article-header .subtitle {
  font-size: 16px; color: var(--text-secondary); font-weight: 400;
  max-width: 600px; margin: 0 auto; line-height: 1.6;
}

/* --- Sections --- */
.section { margin-bottom: 40px; }
.section-header {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 20px; padding-bottom: 12px;
  border-bottom: 2px solid var(--accent-light);
}
.section-number {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; background: var(--accent-gradient);
  color: white; font-size: 14px; font-weight: 700;
  border-radius: 10px; flex-shrink: 0;
}
.section-header h2 { font-size: 22px; font-weight: 600; letter-spacing: -0.3px; color: var(--text-primary); }

/* --- Cards --- */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px; margin-bottom: 16px;
  box-shadow: var(--shadow); transition: box-shadow 0.2s;
}
.card:hover { box-shadow: var(--shadow-md); }
.card h3 { font-size: 17px; font-weight: 600; margin-bottom: 10px; color: var(--text-primary); }
.card p { color: var(--text-secondary); line-height: 1.7; margin-bottom: 8px; }
.card p:last-child { margin-bottom: 0; }
.card ul, .card ol { padding-left: 20px; color: var(--text-secondary); line-height: 1.8; }
.card li { margin-bottom: 6px; }
.card li strong { color: var(--text-primary); }

/* --- Scenario Cards --- */
.scenario-cards { display: grid; gap: 12px; }
.scenario-card {
  background: var(--surface-hover); border-radius: var(--radius-sm);
  padding: 16px; border-left: 3px solid var(--accent);
}
.scenario-card .label { font-size: 12px; font-weight: 600; color: var(--accent); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 4px; }
.scenario-card p { font-size: 15px; color: var(--text-secondary); }

/* --- Callout Boxes --- */
.analogy-box {
  background: var(--warn-bg); border: 1px solid var(--warn-border);
  border-radius: var(--radius-sm); padding: 16px 20px; margin-top: 12px;
}
.analogy-box .label { font-size: 12px; font-weight: 600; color: var(--warn-text); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 4px; }
.analogy-box p { font-size: 15px; color: var(--warn-text); }

/* Green callout */
.callout {
  background: var(--callout-bg); border: 1px solid var(--callout-border);
  border-radius: var(--radius-sm); padding: 16px 20px; margin: 12px 0;
}
.callout strong { color: #15803d; }
.callout p { color: var(--callout-text); font-size: 15px; }

/* Yellow warning callout */
.callout-warn {
  background: var(--warn-bg); border: 1px solid var(--warn-border);
  border-radius: var(--radius-sm); padding: 16px 20px; margin: 12px 0;
}
.callout-warn strong { color: var(--warn-text); }
.callout-warn p { color: var(--warn-text); font-size: 15px; }

/* --- Code --- */
.code-block {
  background: var(--code-bg); border-radius: var(--radius-sm);
  padding: 20px; overflow-x: auto; margin: 12px 0; font-size: 14px; line-height: 1.6;
}
.code-block code { font-family: 'JetBrains Mono', 'Fira Code', monospace; color: var(--code-text); white-space: pre; }
:not(pre) > code {
  background: var(--code-inline-bg); color: var(--text-secondary);
  padding: 2px 6px; border-radius: 4px;
  font-family: 'JetBrains Mono', 'Fira Code', monospace; font-size: 14px;
}

/* --- Blockquote --- */
blockquote {
  background: var(--callout-bg); border-left: 4px solid var(--callout-border);
  padding: 16px 20px; margin: 12px 0;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--callout-text); font-size: 15px;
}

/* --- Steps / Flow --- */
.steps { counter-reset: step; list-style: none; padding: 0; }
.steps li {
  counter-increment: step; position: relative;
  padding: 16px 16px 16px 52px; background: var(--surface-hover);
  border-radius: var(--radius-sm); margin-bottom: 10px; min-height: 60px;
}
.steps li::before {
  content: counter(step); position: absolute; left: 14px; top: 16px;
  width: 26px; height: 26px; background: var(--accent); color: white;
  font-size: 13px; font-weight: 600; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
}
.steps li .step-title { font-weight: 600; font-size: 15px; color: var(--text-primary); display: block; margin-bottom: 2px; }
.steps li .step-desc { font-size: 14px; color: var(--text-secondary); }

/* --- Comparison Tables --- */
.comparison-table { width: 100%; border-collapse: collapse; font-size: 14px; margin: 12px 0; }
.comparison-table th {
  background: var(--accent-light); color: var(--accent); font-weight: 600;
  padding: 12px 16px; text-align: left; border-bottom: 2px solid var(--border); font-size: 13px;
}
.comparison-table td {
  padding: 12px 16px; border-bottom: 1px solid var(--border);
  color: var(--text-secondary); vertical-align: top;
}
.comparison-table tr:last-child td { border-bottom: none; }
.comparison-table td:first-child { font-weight: 500; color: var(--text-primary); white-space: nowrap; }

/* --- Limitation Grid --- */
.limitation-grid { display: grid; gap: 12px; }
.limitation-item {
  background: var(--surface-hover); border-radius: var(--radius-sm);
  padding: 16px; border-left: 3px solid var(--orange-border);
}
.limitation-item .label { font-weight: 600; font-size: 15px; color: var(--text-primary); margin-bottom: 4px; }
.limitation-item p { font-size: 14px; color: var(--text-secondary); }

/* --- Design Decision Grid --- */
.design-grid { display: grid; gap: 14px; margin: 14px 0; }
.design-card {
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 16px; background: var(--surface-hover);
}
.design-card h4 { font-size: 14px; margin: 0 0 4px; color: var(--text-primary); font-weight: 600; }
.design-card .choice { font-size: 13px; color: var(--accent); font-weight: 500; }
.design-card .alt { font-size: 13px; color: var(--text-tertiary); }
.design-card p { margin: 6px 0 0; font-size: 13px; color: var(--text-secondary); }

/* --- Roadmap Step --- */
.roadmap-step {
  padding: 16px 16px 16px 52px; border-left: 3px solid var(--accent);
  margin: 12px 0; background: var(--surface-hover);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  position: relative;
}
.roadmap-step h3 { color: var(--accent); margin: 0 0 4px; font-size: 16px; font-weight: 600; }
.roadmap-step p { font-size: 14px; color: var(--text-secondary); margin: 0; }
.roadmap-step code { font-size: 13px; }

/* --- Flow Step --- */
.flow-step { display: flex; gap: 14px; margin: 14px 0; align-items: flex-start; }
.flow-step .num {
  flex-shrink: 0; width: 28px; height: 28px; border-radius: 50%;
  background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600; margin-top: 2px;
}
.flow-step .content { flex: 1; }
.flow-step .content strong { display: block; font-size: 15px; color: var(--text-primary); margin-bottom: 2px; }
.flow-step .content span { font-size: 14px; color: var(--text-secondary); }

/* --- Architecture Diagram (pre-formatted) --- */
.fig {
  background: var(--surface-hover); border-radius: var(--radius-sm);
  padding: 20px; text-align: center;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 13px; line-height: 1.5; margin: 12px 0;
  white-space: pre; overflow-x: auto; color: var(--text-primary);
}
.fig-label { color: var(--text-tertiary); font-size: 12px; margin-top: -4px; margin-bottom: 12px; text-align: center; }

/* --- Comparison Grid --- */
.comparison { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 14px 0; font-size: 14px; }
.comparison-item {
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 16px; background: var(--surface-hover);
}
.comparison-item h4 { font-size: 14px; margin: 0 0 6px; color: var(--text-primary); }
.comparison-item p { margin: 0; font-size: 13px; color: var(--text-secondary); }

/* --- Resource List --- */
.resource-list { list-style: none; padding: 0; }
.resource-list li {
  padding: 14px 16px; border-left: 3px solid var(--accent);
  background: var(--surface-hover);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0; margin-bottom: 10px;
}
.resource-list li .num { font-size: 12px; font-weight: 600; color: var(--accent); margin-bottom: 2px; }
.resource-list li a { font-weight: 600; font-size: 15px; color: var(--accent); text-decoration: none; display: block; margin-bottom: 2px; }
.resource-list li a:hover { text-decoration: underline; }
.resource-list li .desc { font-size: 13px; color: var(--text-tertiary); }

/* --- History --- */
.history-list { list-style: none; padding: 0; }
.history-list li {
  padding: 12px 14px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); margin-bottom: 8px;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  transition: background 0.15s;
}
.history-list li:hover { background: var(--surface-hover); }
.history-list .date { color: var(--text-tertiary); font-size: 13px; white-space: nowrap; }
.history-list .title { color: var(--text-primary); font-weight: 500; flex: 1; }
.history-list .tag { font-size: 12px; background: var(--accent-light); color: var(--accent); padding: 2px 10px; border-radius: 999px; font-weight: 500; }
.history-list .read-link { color: var(--accent); font-size: 13px; text-decoration: none; margin-left: auto; flex-shrink: 0; }
.history-list .read-link:hover { text-decoration: underline; }

/* --- Footer --- */
footer { margin-top: 48px; padding: 32px 0; border-top: 1px solid var(--border); text-align: center; color: var(--text-tertiary); font-size: 13px; }
footer .update-time { font-weight: 500; color: var(--text-secondary); margin-bottom: 4px; }

/* --- Responsive --- */
@media (max-width: 640px) {
  .container { padding: 0 16px; }
  .article-header h1 { font-size: 24px; }
  .section-header h2 { font-size: 18px; }
  .card { padding: 18px; }
  nav .nav-inner { gap: 2px; }
  nav a { font-size: 12px; padding: 4px 8px; }
  .article-header { padding: 32px 0 24px; }
  .comparison-table { font-size: 13px; }
  .comparison-table th, .comparison-table td { padding: 8px 10px; }
  .comparison { grid-template-columns: 1fr; }
  .design-grid { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .nav-brand { font-size: 13px; }
  .steps li { padding: 14px 14px 14px 46px; }
  .steps li::before { width: 22px; height: 22px; font-size: 11px; left: 12px; top: 14px; }
}
