/* Article Typography & Elements */
.single-page,
.section-page {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 1rem;
}

.article-header,
.section-header {
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--color-border);
}

.article-header h1,
.section-header h1 {
  font-size: 2.25rem;
  font-weight: 900;
  line-height: 1.3;
  color: #0f172a;
  letter-spacing: -0.02em;
  margin-bottom: 0.8rem;
}

.article-header .lead,
.section-header .lead {
  font-size: 1.15rem;
  color: #475569;
  line-height: 1.8;
  margin-bottom: 1rem;
}

.article-meta,
.section-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

/* Article Content Body */
.article-content {
  font-size: 17px;
  line-height: 1.85;
  color: #1e293b;
}

.article-content h2 {
  font-size: 1.7rem;
  font-weight: 800;
  color: #0f172a;
  margin: 3.2rem 0 1.25rem;
  padding: 0.2rem 0 0.2rem 0.85rem;
  border-left: 5px solid var(--color-primary);
  line-height: 1.35;
  letter-spacing: -0.01em;
}

.article-content h3 {
  font-size: 1.35rem;
  font-weight: 750;
  color: #1e293b;
  margin: 2.2rem 0 0.9rem;
  line-height: 1.4;
}

.article-content h4 {
  font-size: 1.12rem;
  font-weight: 700;
  color: #334155;
  margin: 1.6rem 0 0.6rem;
}

.article-content p {
  margin-bottom: 1.4rem;
}

.article-content ul,
.article-content ol {
  margin: 1rem 0 1.5rem 1.5rem;
}

.article-content li {
  margin-bottom: 0.5rem;
}

.article-content blockquote {
  border-left: 4px solid var(--color-primary);
  background: #f0f7ff;
  padding: 1.1rem 1.4rem;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  margin: 1.75rem 0;
  color: #1e3a8a;
  font-style: normal;
  font-size: 0.98rem;
  line-height: 1.75;
}

.article-content blockquote p:last-child {
  margin-bottom: 0;
}

/* Inline Code */
.article-content code {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  padding: 0.18rem 0.45rem;
  border-radius: 4px;
  font-family: var(--font-mono, "JetBrains Mono", Consolas, monospace);
  font-size: 0.88em;
  color: #1d4ed8;
  font-weight: 600;
}

/* Code Block Container (Dark Terminal Styling) */
.article-content .highlight,
.article-content pre {
  background: #0d1117 !important;
  color: #e6edf3 !important;
  border-radius: 10px;
  margin: 2rem 0;
  border: 1px solid #30363d;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  position: relative;
  overflow: hidden;
}

/* macOS Style Terminal Header Bar */
.article-content .highlight::before,
.article-content pre::before {
  content: "●  ●  ●   TERMINAL / ARCHITECTURE";
  display: block;
  background: #161b22;
  color: #8b949e;
  font-size: 0.72rem;
  font-family: var(--font-mono, monospace);
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 0.5rem 1rem;
  border-bottom: 1px solid #30363d;
}

.article-content .highlight pre {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  margin: 0 !important;
  padding: 1.25rem 1.5rem !important;
  overflow-x: auto;
}

.article-content .highlight pre::before {
  display: none !important;
}

.article-content pre code,
.article-content .highlight code,
.article-content .highlight span {
  background: transparent !important;
  border: none !important;
  color: #e6edf3 !important;
  font-family: var(--font-mono, "JetBrains Mono", Consolas, monospace) !important;
  font-size: 0.88rem !important;
  line-height: 1.7 !important;
  font-weight: 400 !important;
  text-shadow: none !important;
}

/* Scrollbar for code blocks */
.article-content pre::-webkit-scrollbar,
.article-content .highlight pre::-webkit-scrollbar {
  height: 8px;
}
.article-content pre::-webkit-scrollbar-track,
.article-content .highlight pre::-webkit-scrollbar-track {
  background: #161b22;
}
.article-content pre::-webkit-scrollbar-thumb,
.article-content .highlight pre::-webkit-scrollbar-thumb {
  background: #30363d;
  border-radius: 4px;
}

/* ========================================================= */
/* Responsive Table Container & Styling (Image 2 Solution)   */
/* ========================================================= */
.table-responsive-wrapper {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 2.2rem 0;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
  position: relative;
}

.table-responsive-wrapper::after {
  content: "💡 提示：表格支持横向平移拖动，首列已自动锁定";
  display: block;
  text-align: right;
  padding: 0.4rem 0.85rem;
  font-size: 0.75rem;
  color: #94a3b8;
  background: #f8fafc;
  border-top: 1px solid #f1f5f9;
}

.article-content table {
  width: 100%;
  min-width: 860px;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.88rem;
  line-height: 1.5;
  margin: 0;
  background: #ffffff;
}

.article-content th {
  background: #f8fafc;
  color: #1e293b;
  font-weight: 750;
  padding: 0.9rem 1.1rem;
  text-align: left;
  border-bottom: 2px solid #cbd5e1;
  border-right: 1px solid #f1f5f9;
  white-space: nowrap;
  font-size: 0.86rem;
  letter-spacing: 0.02em;
}

.article-content th:last-child {
  border-right: none;
}

.article-content td {
  padding: 0.85rem 1.1rem;
  border-bottom: 1px solid #f1f5f9;
  border-right: 1px solid #f8fafc;
  color: #334155;
  vertical-align: middle;
  white-space: nowrap;
  background: #ffffff;
}

.article-content td:last-child {
  border-right: none;
}

.article-content tr:last-child td {
  border-bottom: none;
}

.article-content tr:nth-child(even) td {
  background: #fafcff;
}

.article-content tr:hover td {
  background: #f0f7ff;
}

/* Sticky First Column for Context Preservation */
.article-content td:first-child,
.article-content th:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
  background: #ffffff;
  font-weight: 750;
  color: var(--color-primary, #2563eb);
  box-shadow: 2px 0 6px rgba(0, 0, 0, 0.04);
  min-width: 130px;
}

.article-content th:first-child {
  background: #f8fafc;
  z-index: 3;
}

.article-content tr:hover td:first-child {
  background: #eff6ff;
}

.article-content td:first-child a {
  color: var(--color-primary, #2563eb);
  text-decoration: none;
  font-weight: 750;
}
.article-content td:first-child a:hover {
  text-decoration: underline;
}

/* Callout Cards */
.callout {
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius-md);
  margin: 1.75rem 0;
  border-left: 4px solid;
}

.callout-info {
  background: #eff6ff;
  border-color: #3b82f6;
  color: #1e3a8a;
}

.callout-warning {
  background: #fffbeb;
  border-color: #f59e0b;
  color: #92400e;
}

.callout-success {
  background: #ecfdf5;
  border-color: #10b981;
  color: #065f46;
}

/* Article Footer */
.article-footer {
  margin-top: 3.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--color-border);
}

.article-notice {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-bottom: 2rem;
}

.article-notice h4 {
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
  color: #1e293b;
}

.article-notice p {
  font-size: 0.85rem;
  color: #64748b;
  line-height: 1.6;
  margin-bottom: 0;
}

.article-nav-links {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.btn-back,
.btn-search {
  display: inline-flex;
  align-items: center;
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  font-size: 0.9rem;
  font-weight: 600;
  background: white;
  color: var(--color-text);
  transition: all 0.15s ease;
}

.btn-back:hover,
.btn-search:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background: var(--color-bg-subtle);
}

.speedtest-figure {
  margin: 2rem 0;
  text-align: center;
  background: #f8fafc;
  padding: 1rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
}

.speedtest-figure img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-md);
  border: 1px solid #cbd5e1;
  box-shadow: var(--shadow-md);
  display: inline-block;
}

.speedtest-figure figcaption {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-top: 0.75rem;
  line-height: 1.6;
}

.mermaid {
  margin: 2rem 0;
  text-align: center;
  background: #f8fafc;
  padding: 1.5rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
}
