/*
 * Shared stylesheet for all blog article pages under frontend/zh-CN/blog/articles/.
 * All 5 article pages use this exact same template, so styling lives here once
 * instead of being duplicated inline in every article's <head>.
 */
:root {
  --bg: #f7f5f2; --bg-card: #ffffff; --bg-soft: #eef6f4;
  --ink: #16202e; --ink-soft: #5c6b7a;
  --accent: #2d9c8a; --accent-light: #d4f0eb; --accent-dark: #1f7a6c;
  --warm: #e8a87c; --warm-light: #fdf0e8; --line: #e2e6ea;
  --shadow: 0 4px 24px rgba(22, 32, 46, 0.06);
  --shadow-lg: 0 24px 64px rgba(22, 32, 46, 0.12);
  --font-display: 'Outfit', 'Noto Sans SC', sans-serif;
  --font-body: 'Noto Sans SC', sans-serif;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: var(--font-body); background: var(--bg); color: var(--ink); line-height: 1.6; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
body.menu-open { overflow: hidden; height: 100vh; }
a { color: inherit; text-decoration: none; }
.container { width: min(760px, 92vw); margin: 0 auto; }
.wide-container { width: min(1180px, 92vw); margin: 0 auto; }

/* Nav (shared) */
.nav-wrap { position: fixed; top: 20px; left: 0; right: 0; z-index: 100; display: flex; justify-content: center; padding: 0 4vw; pointer-events: none; }
.nav-pill { pointer-events: auto; display: flex; align-items: center; gap: 8px; background: rgba(255,255,255,0.78); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border: 1px solid rgba(255,255,255,0.9); box-shadow: 0 8px 32px rgba(22,32,46,0.1); border-radius: 999px; padding: 8px 10px 8px 18px; width: min(920px, 100%); justify-content: space-between; }
.logo { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 700; font-size: 1.2rem; letter-spacing: -0.02em; flex-shrink: 0; }
.logo-mark { width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.logo-mark img { width: 100%; height: 100%; object-fit: contain; display: block; }
.nav-links { display: flex; align-items: center; gap: 2px; list-style: none; }
.nav-links a { font-size: 0.86rem; font-weight: 500; color: var(--ink-soft); padding: 8px 14px; border-radius: 999px; transition: all 0.2s; }
.nav-links a:hover { color: var(--accent-dark); background: var(--accent-light); }
.nav-links a.active { color: #fff; background: var(--ink); }
.nav-right { display: flex; align-items: center; gap: 8px; }
.lang-chip { display: flex; align-items: center; gap: 6px; font-size: 0.8rem; color: var(--ink-soft); padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); cursor: pointer; background: #fff; }
.lang-chip i { color: var(--accent); }

.lang-switch { position: relative; }

.lang-chip { cursor: pointer; border: none; font-family: inherit; transition: border-color 0.2s, color 0.2s; }
.lang-chip:hover { border-color: var(--accent); color: var(--accent-dark); }

.lang-caret { font-size: 0.6rem; margin-left: 2px; color: var(--ink-soft); transition: transform 0.2s; }
.lang-switch.open .lang-caret { transform: rotate(180deg); }

.lang-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 200px;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 8px;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
  z-index: 120;
}

.lang-switch.open .lang-dropdown { opacity: 1; visibility: visible; transform: translateY(0); }

.lang-option {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: none;
  background: none;
  font-family: var(--font-body);
  font-size: 0.86rem;
  font-weight: 500;
  color: var(--ink);
  cursor: pointer;
  transition: background 0.15s;
  text-align: left;
}

.lang-option:hover:not(:disabled) { background: var(--accent-light); }
.lang-option:disabled { color: var(--ink-soft); cursor: not-allowed; opacity: 0.7; }

.lang-flag { font-size: 1rem; line-height: 1; flex-shrink: 0; }
.lang-option-name { flex: 1; }
.lang-check { color: var(--accent); font-size: 0.8rem; flex-shrink: 0; }

.lang-soon {
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--ink-soft);
  background: var(--bg);
  border: 1px solid var(--line);
  padding: 2px 8px;
  border-radius: 999px;
  flex-shrink: 0;
  white-space: nowrap;
}

.nav-gh { width: 36px; height: 36px; border-radius: 50%; background: var(--ink); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 1rem; transition: transform 0.2s, background 0.2s; }
.nav-gh:hover { transform: rotate(-8deg) scale(1.08); background: var(--accent-dark); }
.menu-toggle { display: none; align-items: center; justify-content: center; width: 36px; height: 36px; flex-shrink: 0; background: none; border: none; font-size: 1.1rem; color: var(--ink); cursor: pointer; padding: 0; }
.mobile-menu { display: none; }

@media (max-width: 1080px) {
  .nav-links { display: none; }
  .menu-toggle { display: flex; }
  .mobile-menu.open { display: flex; position: fixed; top: 86px; left: 4vw; right: 4vw; z-index: 99; flex-direction: column; gap: 4px; background: rgba(255,255,255,0.96); backdrop-filter: blur(16px); border: 1px solid var(--line); border-radius: 20px; padding: 14px; box-shadow: var(--shadow-lg); list-style: none; }
  .mobile-menu a { display: block; padding: 12px 18px; border-radius: 12px; font-weight: 500; color: var(--ink); }
  .mobile-menu a:hover, .mobile-menu a.active { background: var(--accent-light); color: var(--accent-dark); }
}

.btn-major { display: inline-flex; align-items: center; gap: 12px; padding: 14px 28px; border-radius: 999px; background: var(--ink); color: #fff; font-size: 0.95rem; font-weight: 600; transition: all 0.25s; border: none; cursor: pointer; }
.btn-major .arr { width: 26px; height: 26px; border-radius: 50%; background: var(--accent); display: inline-flex; align-items: center; justify-content: center; font-size: 0.7rem; transition: transform 0.25s; }
.btn-major:hover { background: var(--accent-dark); transform: translateY(-3px); box-shadow: 0 12px 28px rgba(31,122,108,0.35); }
.btn-major:hover .arr { transform: translateX(3px); background: rgba(255,255,255,0.22); }
.btn-ghost { display: inline-flex; align-items: center; gap: 8px; padding: 13px 24px; border-radius: 999px; border: 1.5px solid var(--ink); color: var(--ink); font-size: 0.92rem; font-weight: 600; transition: all 0.25s; background: transparent; }
.btn-ghost:hover { background: var(--ink); color: #fff; transform: translateY(-3px); }

/* Article header */
.article-hero { padding: 130px 0 36px; }
.breadcrumb { display: flex; align-items: center; gap: 8px; font-size: 0.82rem; color: var(--ink-soft); margin-bottom: 24px; flex-wrap: wrap; }
.breadcrumb a:hover { color: var(--accent-dark); }
.breadcrumb i { font-size: 0.68rem; }

.a-cat-badge { display: inline-flex; align-items: center; gap: 8px; font-size: 0.74rem; font-weight: 700; letter-spacing: 0.1em; color: var(--accent-dark); background: var(--accent-light); padding: 6px 14px; border-radius: 999px; margin-bottom: 18px; text-transform: uppercase; }

.article-hero h1 { font-family: var(--font-display); font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 800; letter-spacing: -0.03em; line-height: 1.25; margin-bottom: 20px; }

.article-meta-row { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; font-size: 0.85rem; color: var(--ink-soft); padding-bottom: 28px; border-bottom: 1px solid var(--line); }
.article-meta-row .author { display: flex; align-items: center; gap: 10px; }
.author-avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--ink); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 0.85rem; }

/* Article body */
.article-body { padding: 36px 0 20px; font-size: 1rem; }
.article-body p { color: var(--ink-soft); line-height: 1.9; margin-bottom: 20px; font-size: 0.98rem; }
.article-body h2 { font-family: var(--font-display); font-size: 1.5rem; font-weight: 700; letter-spacing: -0.02em; margin: 40px 0 16px; }
.article-body h3 { font-size: 1.12rem; font-weight: 700; margin: 28px 0 12px; }
.article-body ul, .article-body ol { margin: 0 0 20px; padding-left: 1.3em; color: var(--ink-soft); line-height: 1.85; }
.article-body li + li { margin-top: 6px; }
.article-body li strong { color: var(--ink); }
.article-body strong { color: var(--ink); }

code { font-family: 'Outfit', ui-monospace, monospace; font-size: 0.84em; font-weight: 600; color: var(--accent-dark); background: var(--accent-light); padding: 1px 7px; border-radius: 6px; white-space: nowrap; }

.code-block { background: #1d2836; border-radius: 16px; padding: 22px 24px; font-family: 'Outfit', ui-monospace, monospace; font-size: 0.82rem; line-height: 1.85; color: #b8c6d4; overflow-x: auto; margin: 20px 0; box-shadow: var(--shadow); }
.code-block .c-cmt { color: #5a6b7d; }
.code-block .c-key { color: #7fd8c4; }
.code-block .c-str { color: #e8b075; }
.code-block .c-val { color: #e8eef4; }
.code-block .c-num { color: #9ecbff; }

.param-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; margin: 16px 0 24px; }
.param-table th, .param-table td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; line-height: 1.55; }
.param-table th { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; color: var(--ink-soft); background: var(--bg); }
.param-table td:first-child { font-family: var(--font-display); font-weight: 600; color: var(--ink); white-space: nowrap; }
.param-table td:last-child { color: var(--ink-soft); }

.callout { display: flex; gap: 12px; align-items: flex-start; padding: 16px 18px; border-radius: 14px; background: var(--bg-card); border: 1px dashed var(--line); margin: 20px 0; font-size: 0.9rem; color: var(--ink-soft); line-height: 1.7; }
.callout i { color: var(--accent); margin-top: 3px; flex-shrink: 0; }
.callout.warn { background: var(--warm-light); border-color: #f0d4bc; }
.callout.warn i { color: #c47a3a; }

.article-footer { padding: 24px 0 8px; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 12px; border-top: 1px solid var(--line); }
.tag-row { display: flex; gap: 8px; flex-wrap: wrap; }
.tag { font-size: 0.76rem; font-weight: 600; padding: 5px 12px; border-radius: 999px; background: var(--bg-card); border: 1px solid var(--line); color: var(--ink-soft); }

.back-link { display: inline-flex; align-items: center; gap: 8px; font-size: 0.86rem; font-weight: 600; color: var(--ink-soft); }
.back-link:hover { color: var(--accent-dark); }

/* Related */
.related-section { padding: 48px 0 96px; }
.related-section h2 { font-family: var(--font-display); font-size: 1.4rem; font-weight: 700; margin-bottom: 24px; letter-spacing: -0.02em; }
.related-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 18px; }
.related-card { display: flex; flex-direction: column; background: var(--bg-card); border: 1px solid var(--line); border-radius: 20px; padding: 22px; transition: border-color 0.2s, transform 0.2s; }
.related-card:hover { border-color: var(--accent); transform: translateY(-3px); }
.related-card .r-icon { width: 40px; height: 40px; border-radius: 12px; background: var(--accent-light); color: var(--accent-dark); display: flex; align-items: center; justify-content: center; font-size: 1rem; margin-bottom: 14px; }
.related-card h4 { font-size: 0.98rem; font-weight: 700; margin-bottom: 8px; line-height: 1.4; }
.related-card p { font-size: 0.84rem; color: var(--ink-soft); line-height: 1.6; }

/* Prev / next pager */
.pager-section { padding: 8px 0 0; }
.pager-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 18px; }
.pager-card {
  display: flex; flex-direction: column; gap: 8px;
  padding: 20px 22px; border: 1px solid var(--line); border-radius: 18px;
  background: var(--bg-card); transition: border-color 0.2s, transform 0.2s;
  text-decoration: none;
}
.pager-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.pager-card.next { text-align: right; align-items: flex-end; }
.pager-label { font-size: 0.74rem; font-weight: 700; letter-spacing: 0.06em; color: var(--accent-dark); text-transform: uppercase; display: flex; align-items: center; gap: 6px; }
.pager-card.next .pager-label { flex-direction: row-reverse; }
.pager-title { font-size: 0.92rem; font-weight: 700; color: var(--ink); line-height: 1.45; }
.pager-empty { visibility: hidden; border: none; }

.cta-band { background: linear-gradient(135deg, #1f2a38 0%, #2a3a4d 100%); border-radius: 28px; padding: 44px 40px; display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; color: #dce4ec; margin-top: 48px; }
.cta-band h3 { font-family: var(--font-display); font-size: clamp(1.3rem, 2.5vw, 1.7rem); font-weight: 700; color: #fff; margin-bottom: 8px; }
.cta-band p { font-size: 0.9rem; max-width: 380px; line-height: 1.7; }
.cta-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.cta-band .btn-major { background: #fff; color: #1f2a38; }
.cta-band .btn-major:hover { background: var(--accent-light); color: var(--accent-dark); }
.cta-band .btn-major .arr { background: var(--accent); color: #fff; }
.cta-band .btn-ghost { border-color: rgba(255,255,255,0.5); color: #fff; }
.cta-band .btn-ghost:hover { background: #fff; color: #1f2a38; }

/* Footer */
.footer { background: var(--bg-card); border-top: 1px solid var(--line); padding: 72px 0 0; overflow: hidden; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1.2fr; gap: 40px; margin-bottom: 56px; }
.footer .logo { margin-bottom: 14px; }
.footer-desc { font-size: 0.88rem; line-height: 1.7; max-width: 280px; color: var(--ink-soft); }
.footer h4 { font-size: 0.82rem; font-weight: 600; letter-spacing: 0.14em; color: var(--ink-soft); margin-bottom: 18px; }
.footer-links { list-style: none; display: flex; flex-direction: column; gap: 11px; }
.footer-links a { font-size: 0.9rem; color: var(--ink); transition: color 0.2s; }
.footer-links a:hover { color: var(--accent-dark); }
.footer-lang { display: flex; flex-wrap: wrap; gap: 8px; }
.footer-lang a { padding: 5px 12px; border-radius: 999px; font-size: 0.78rem; border: 1px solid var(--line); color: var(--ink-soft); cursor: pointer; }
.footer-lang a.active { background: var(--ink); border-color: var(--ink); color: #fff; }
.footer-bottom { border-top: 1px solid var(--line); padding: 22px 0; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; font-size: 0.8rem; color: var(--ink-soft); }
.footer-wordmark { font-family: var(--font-display); font-size: clamp(5rem, 16vw, 13rem); font-weight: 800; letter-spacing: -0.04em; line-height: 0.9; text-align: center; color: transparent; -webkit-text-stroke: 1.5px var(--line); user-select: none; margin-bottom: -0.18em; pointer-events: none; }

/* Inline download CTA card */
.download-card {
  display: flex;
  align-items: center;
  gap: 22px;
  background: linear-gradient(135deg, var(--accent-dark) 0%, var(--accent) 100%);
  border-radius: 22px;
  padding: 30px 32px;
  margin: 40px 0 4px;
  color: #fff;
  flex-wrap: wrap;
  text-decoration: none;
  transition: transform 0.25s, box-shadow 0.25s;
}
.download-card:hover { transform: translateY(-3px); box-shadow: 0 20px 44px rgba(31,122,108,0.32); }
.download-card .dc-icon {
  width: 54px; height: 54px; border-radius: 16px;
  background: rgba(255,255,255,0.2);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; flex-shrink: 0;
}
.download-card .dc-text { flex: 1; min-width: 220px; }
.download-card .dc-text h3 { font-family: var(--font-display); font-size: 1.15rem; font-weight: 700; margin-bottom: 6px; color: #fff; }
.download-card .dc-text p { font-size: 0.86rem; color: rgba(255,255,255,0.88); margin: 0; line-height: 1.65; }
.download-card .dc-btn {
  display: inline-flex; align-items: center; gap: 10px;
  background: #fff; color: var(--accent-dark);
  font-size: 0.88rem; font-weight: 700;
  padding: 12px 22px; border-radius: 999px;
  flex-shrink: 0; white-space: nowrap;
}

/* Floating download widget */
.float-download {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--ink);
  color: #fff;
  padding: 12px 18px 12px 14px;
  border-radius: 999px;
  box-shadow: 0 14px 34px rgba(22,32,46,0.3);
  text-decoration: none;
  transition: transform 0.25s, background 0.25s;
}
.float-download:hover { transform: translateY(-3px); background: var(--accent-dark); }
.float-download .fd-icon {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.86rem; flex-shrink: 0;
}
.float-download .fd-text { font-size: 0.84rem; font-weight: 600; white-space: nowrap; }
.float-download .fd-close {
  width: 20px; height: 20px; border-radius: 50%;
  background: rgba(255,255,255,0.15);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.62rem; color: #fff; margin-left: 2px; flex-shrink: 0;
}
.float-download .fd-close:hover { background: rgba(255,255,255,0.3); }

@media (max-width: 640px) {
  .lang-chip-text,
  .lang-caret {
    display: none;
  }

  .lang-chip {
    width: 36px;
    height: 36px;
    padding: 0;
    justify-content: center;
    border-radius: 50%;
    background: var(--ink);
    border-color: var(--ink);
  }

  .lang-chip i {
    color: #fff;
  }

  .lang-dropdown {
    right: -8px;
  }
  .related-grid { grid-template-columns: 1fr; }
  .pager-grid { grid-template-columns: 1fr; }
  .pager-card.next { text-align: left; align-items: flex-start; }
  .pager-card.next .pager-label { flex-direction: row; }
  .footer-grid { grid-template-columns: 1fr; }
  .cta-band { flex-direction: column; text-align: center; }
  .cta-band p { margin: 0 auto; }
  .cta-actions { justify-content: center; }
  .param-table { display: block; overflow-x: auto; }
  .download-card { padding: 24px; }
  .float-download .fd-text { display: none; }
  .float-download { padding: 12px; }
}
