:root {
  --article-max-w: 1200px;
  --article-pad-x-mobile: 18px;
  --article-pad-x-tablet: 24px;
  --article-pad-x-desktop: 32px;
  --article-pad-top-mobile: 70px;
  --article-pad-top-tablet: 96px;
  --article-pad-top-desktop: 120px;
  --article-radius: 16px;
  --article-radius-sm: 12px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}

body.article-page {
  display: block !important;
  flex-direction: initial !important;
  min-height: 100vh;
  margin: 0;
  padding-top: 100px !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  padding-bottom: 0 !important;
  width: 100% !important;
  max-width: 100vw !important;
  overflow-x: hidden !important;
  word-wrap: break-word;
  overflow-wrap: anywhere;
  word-break: break-word;
}

body.article-page *,
body.article-page *::before,
body.article-page *::after {
  min-width: 0;
}

.article-container {
  display: block;
  width: 100%;
  max-width: var(--article-max-w);
  margin: 0 auto;
  padding: 40px var(--article-pad-x-mobile) 60px;
  font-size: 17px;
  line-height: 1.85;
  color: var(--text-slate, #475569);
  word-wrap: break-word;
  overflow-wrap: anywhere;
  word-break: break-word;
  overflow: visible;
}

.article-header {
  margin-bottom: 28px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--glass-border, #e2e8f0);
  max-width: 100%;
}

.article-meta {
  font-size: 0.875rem;
  color: var(--text-muted, #94a3b8);
  margin-bottom: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  line-height: 1.5;
  max-width: 100%;
}

.article-meta > span {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  word-break: break-word;
}

.article-header h1 {
  font-size: 1.7rem;
  line-height: 1.35;
  color: var(--text-primary, #0f172a);
  margin: 0 0 14px;
  font-weight: 800;
  letter-spacing: -0.01em;
  word-wrap: break-word;
  overflow-wrap: anywhere;
  word-break: break-word;
  max-width: 100%;
}

.article-summary {
  font-size: 1.05rem;
  color: var(--text-secondary, #334155);
  margin: 0;
  font-weight: 500;
  line-height: 1.7;
  word-wrap: break-word;
  overflow-wrap: anywhere;
  max-width: 100%;
}

.toc {
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.05), rgba(99, 102, 241, 0.05));
  border: 1px solid rgba(79, 70, 229, 0.15);
  border-radius: var(--article-radius-sm);
  padding: 16px 18px;
  margin: 0 0 32px;
  max-width: 100%;
  word-wrap: break-word;
  overflow-wrap: anywhere;
}

.toc strong {
  display: block;
  color: var(--brand-blue, #4f46e5);
  font-size: 0.9rem;
  margin-bottom: 10px;
  letter-spacing: 0.02em;
  font-weight: 700;
}

.toc ol {
  margin: 0;
  padding-left: 20px;
  font-size: 0.95rem;
  line-height: 1.7;
  max-width: 100%;
}

.toc ol li {
  margin-bottom: 4px;
  word-wrap: break-word;
  overflow-wrap: anywhere;
}

.toc a {
  color: var(--text-secondary, #334155);
  text-decoration: none;
  transition: color 0.2s ease;
  display: inline-block;
  padding: 4px 0;
  min-height: 32px;
  line-height: 1.5;
  word-break: break-word;
}

.toc a:hover,
.toc a:focus-visible {
  color: var(--brand-blue, #4f46e5);
  text-decoration: underline;
}

.article-content {
  width: 100%;
  max-width: 100%;
  word-wrap: break-word;
  overflow-wrap: anywhere;
  word-break: break-word;
  overflow: visible;
}

.article-content > * {
  max-width: 100%;
}

.article-content h2 {
  font-size: 1.4rem;
  line-height: 1.4;
  color: var(--text-primary, #0f172a);
  margin: 36px 0 16px;
  font-weight: 800;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--brand-blue, #4f46e5);
  display: block;
  word-wrap: break-word;
  overflow-wrap: anywhere;
  word-break: break-word;
  scroll-margin-top: 70px;
  max-width: 100%;
}

.article-content h3 {
  font-size: 1.15rem;
  line-height: 1.5;
  color: var(--text-primary, #0f172a);
  margin: 28px 0 12px;
  font-weight: 700;
  scroll-margin-top: 70px;
  word-wrap: break-word;
  overflow-wrap: anywhere;
  max-width: 100%;
}

.article-content p {
  margin: 0 0 16px;
  line-height: 1.85;
  word-wrap: break-word;
  overflow-wrap: anywhere;
  max-width: 100%;
}

.article-content strong {
  color: var(--text-primary, #0f172a);
  font-weight: 700;
}

.article-content em {
  font-style: italic;
}

.article-content a {
  color: var(--brand-blue, #4f46e5);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  word-break: break-all;
  overflow-wrap: anywhere;
}

.article-content a:hover,
.article-content a:focus-visible {
  text-decoration-thickness: 2px;
}

.article-content ul,
.article-content ol {
  margin: 0 0 18px;
  padding-left: 22px;
  line-height: 1.85;
  max-width: 100%;
  word-wrap: break-word;
  overflow-wrap: anywhere;
}

.article-content li {
  margin-bottom: 6px;
  word-wrap: break-word;
  overflow-wrap: anywhere;
  word-break: break-word;
  max-width: 100%;
}

.article-content code {
  background: #f1f5f9;
  color: #be185d;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.9em;
  font-family: 'SF Mono', Consolas, 'Liberation Mono', Menlo, monospace;
  word-break: break-all;
  overflow-wrap: anywhere;
  white-space: normal;
  max-width: 100%;
}

.article-content pre {
  background: #1e293b;
  color: #e2e8f0;
  padding: 14px 16px;
  border-radius: var(--article-radius-sm);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 18px 0;
  font-size: 0.85rem;
  line-height: 1.6;
  max-width: 100%;
  white-space: pre;
  word-wrap: normal;
  word-break: normal;
}

.article-content pre code {
  background: transparent;
  color: inherit;
  padding: 0;
  font-size: inherit;
  word-break: normal;
  white-space: pre;
}

.table-wrapper {
  display: block;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 18px 0;
  border-radius: var(--article-radius-sm);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  background: #fff;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x pan-y;
}

.table-wrapper::after {
  content: '← 左右滑动 →';
  display: block;
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-muted, #94a3b8);
  padding: 6px 0 2px;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0), #fff 30%);
  pointer-events: none;
}

.article-content table {
  width: 100%;
  min-width: 480px;
  border-collapse: collapse;
  background: #fff;
  font-size: 0.9rem;
  margin: 0;
  table-layout: auto;
  word-wrap: break-word;
  overflow-wrap: anywhere;
}

.article-content th,
.article-content td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--glass-border, #e2e8f0);
  word-wrap: break-word;
  overflow-wrap: anywhere;
  word-break: break-word;
  vertical-align: top;
  max-width: 280px;
}

.article-content th {
  background: var(--bg-secondary, #f1f5f9);
  font-weight: 700;
  color: var(--text-primary, #0f172a);
  white-space: nowrap;
}

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

.article-content blockquote {
  border-left: 4px solid var(--brand-blue, #4f46e5);
  margin: 18px 0;
  padding: 8px 0 8px 18px;
  color: var(--text-secondary, #334155);
  font-style: italic;
  background: rgba(79, 70, 229, 0.04);
  border-radius: 0 var(--article-radius-sm) var(--article-radius-sm) 0;
  max-width: 100%;
  word-wrap: break-word;
  overflow-wrap: anywhere;
}

.callout-tool {
  background: linear-gradient(135deg, var(--brand-blue, #4f46e5), #6366f1);
  color: #fff;
  border-radius: var(--article-radius);
  padding: 18px 20px;
  margin: 28px 0;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.7;
  box-shadow: 0 10px 30px rgba(79, 70, 229, 0.2);
  word-wrap: break-word;
  overflow-wrap: anywhere;
  max-width: 100%;
}

.callout-tool a {
  color: #fef3c7;
  text-decoration: underline;
  font-weight: 800;
  text-underline-offset: 2px;
  word-break: break-all;
  overflow-wrap: anywhere;
}

.callout-tool a:hover,
.callout-tool a:focus-visible {
  color: #fff;
}

.callout-tip {
  background: #fef3c7;
  border-left: 4px solid #f59e0b;
  padding: 14px 16px;
  border-radius: 0 var(--article-radius-sm) var(--article-radius-sm) 0;
  margin: 18px 0;
  color: #78350f;
  line-height: 1.75;
  word-wrap: break-word;
  overflow-wrap: anywhere;
  max-width: 100%;
}

.callout-warn {
  background: #fee2e2;
  border-left: 4px solid #ef4444;
  padding: 14px 16px;
  border-radius: 0 var(--article-radius-sm) var(--article-radius-sm) 0;
  margin: 18px 0;
  color: #7f1d1d;
  line-height: 1.75;
  word-wrap: break-word;
  overflow-wrap: anywhere;
  max-width: 100%;
}

.faq-section,
.related-articles {
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--glass-border, #e2e8f0);
  border-radius: var(--article-radius);
  padding: 22px 20px;
  margin-top: 32px;
  max-width: 100%;
  word-wrap: break-word;
  overflow-wrap: anywhere;
}

.faq-section h2,
.related-articles h2 {
  font-size: 1.25rem;
  line-height: 1.4;
  margin: 0 0 14px;
  color: var(--text-primary, #0f172a);
  font-weight: 800;
  border-bottom: none;
  display: block;
  padding: 0;
  max-width: 100%;
}

.faq-item {
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--glass-border, #e2e8f0);
  max-width: 100%;
  word-wrap: break-word;
  overflow-wrap: anywhere;
}

.faq-item:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.faq-item h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary, #0f172a);
  margin: 0 0 8px;
  line-height: 1.5;
  word-wrap: break-word;
  overflow-wrap: anywhere;
  max-width: 100%;
}

.faq-item p {
  margin: 0;
  line-height: 1.75;
  color: var(--text-slate, #475569);
  font-size: 0.95rem;
  word-wrap: break-word;
  overflow-wrap: anywhere;
  max-width: 100%;
}

.related-articles ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  max-width: 100%;
}

.related-articles li {
  max-width: 100%;
  min-width: 0;
}

.related-articles li a {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  max-width: 100%;
  min-width: 0;
  padding: 12px 16px;
  border: 1px solid var(--glass-border, #e2e8f0);
  border-radius: var(--article-radius-sm);
  background: #fff;
  color: var(--text-primary, #0f172a);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.4;
  transition: all 0.2s ease;
  word-wrap: break-word;
  overflow-wrap: anywhere;
  -webkit-tap-highlight-color: rgba(79, 70, 229, 0.1);
}

.related-articles li a > span,
.related-articles li a {
  word-break: break-word;
}

.related-articles li a::before {
  content: '\f0c1';
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  color: var(--brand-blue, #4f46e5);
  font-size: 0.9rem;
  flex-shrink: 0;
}

.related-articles li a:hover,
.related-articles li a:focus-visible {
  background: rgba(79, 70, 229, 0.08);
  border-color: rgba(79, 70, 229, 0.25);
  color: var(--brand-blue, #4f46e5);
}

.related-articles li a:active {
  transform: scale(0.98);
}

.back-to-tool {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 18px;
  padding: 8px 14px;
  background: rgba(79, 70, 229, 0.08);
  color: var(--brand-blue, #4f46e5);
  text-decoration: none;
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 600;
  min-height: 36px;
  max-width: 100%;
  transition: all 0.2s ease;
  word-break: break-word;
}

.back-to-tool::before {
  content: '\f060';
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
}

.back-to-tool:hover,
.back-to-tool:focus-visible {
  background: rgba(79, 70, 229, 0.15);
}

.article-category {
  margin-bottom: 32px;
  max-width: 100%;
}

.article-category h2 {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-primary, #0f172a);
  margin: 0 0 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--brand-blue, #4f46e5);
}

.article-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  max-width: 100%;
}

.article-card {
  display: block;
  padding: 18px 20px;
  border: 1px solid var(--glass-border, #e2e8f0);
  border-radius: var(--article-radius);
  background: #fff;
  text-decoration: none;
  color: inherit;
  transition: all 0.25s ease;
  -webkit-tap-highlight-color: rgba(79, 70, 229, 0.1);
}

.article-card:hover,
.article-card:focus-visible {
  border-color: rgba(79, 70, 229, 0.3);
  box-shadow: 0 4px 16px rgba(79, 70, 229, 0.1);
  transform: translateY(-2px);
}

.article-card:active {
  transform: scale(0.98);
}

.article-card-meta {
  font-size: 0.8rem;
  color: var(--text-muted, #94a3b8);
  margin-bottom: 8px;
}

.article-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary, #0f172a);
  margin: 0 0 8px;
  line-height: 1.45;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.article-card p {
  font-size: 0.9rem;
  color: var(--text-slate, #475569);
  margin: 0 0 10px;
  line-height: 1.65;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.article-card-cta {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--brand-blue, #4f46e5);
}

@media (min-width: 481px) {
  .article-container {
    font-size: 17px;
  }
  .article-header h1 {
    font-size: 1.85rem;
  }
  .article-content h2 {
    font-size: 1.5rem;
  }
  .related-articles ul {
    grid-template-columns: 1fr 1fr;
  }
  .article-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (min-width: 769px) {
  .article-container {
    padding-left: var(--article-pad-x-tablet);
    padding-right: var(--article-pad-x-tablet);
    padding-bottom: 80px;
    font-size: 1.05rem;
    line-height: 1.9;
  }
  .article-header {
    margin-bottom: 40px;
    padding-bottom: 28px;
  }
  .article-header h1 {
    font-size: 2.2rem;
  }
  .article-summary {
    font-size: 1.15rem;
  }
  .toc {
    padding: 20px 24px;
    margin-bottom: 40px;
  }
  .article-content h2 {
    font-size: 1.55rem;
    margin: 48px 0 18px;
    display: inline-block;
  }
  .article-content h3 {
    font-size: 1.2rem;
  }
  .article-content th,
  .article-content td {
    padding: 10px 14px;
  }
  .callout-tool {
    padding: 20px 24px;
    font-size: 1.05rem;
  }
  .faq-section,
  .related-articles {
    padding: 28px 32px;
    margin-top: 40px;
  }
  .faq-section h2,
  .related-articles h2 {
    font-size: 1.35rem;
  }
  .related-articles ul {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }
  .article-grid {
    grid-template-columns: 1fr 1fr 1fr;
  }
}

@media (min-width: 1025px) {
  .article-container {
    padding-left: var(--article-pad-x-desktop);
    padding-right: var(--article-pad-x-desktop);
  }
  .article-grid {
    grid-template-columns: 1fr 1fr 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

@media (hover: none) and (pointer: coarse) {
  .article-content a,
  .toc a,
  .related-articles li a,
  .back-to-tool {
    -webkit-tap-highlight-color: rgba(79, 70, 229, 0.15);
  }
}
