/* NSSM website — shared stylesheet (English & Chinese pages) */

:root {
  --bg: #f6f8fa;
  --surface: #ffffff;
  --text: #1f2430;
  --muted: #57606a;
  --accent: #1f6feb;
  --accent-dark: #1a5cc8;
  --accent-soft: #eaf1fd;
  --border: #d8dee4;
  --code-bg: #0f172a;
  --code-text: #e2e8f0;
  --inline-code-bg: #eff1f3;
  --note-bg: #eef5ff;
  --warn-bg: #fff8e6;
  --warn-border: #e3b341;
  --radius: 10px;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Microsoft YaHei",
    "PingFang SC", "Hiragino Sans GB", sans-serif;
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
}

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 20px;
}

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover { text-decoration: underline; }

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--border);
}

.site-header .container {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 20px;
  padding-top: 10px;
  padding-bottom: 10px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text);
}
.brand:hover { text-decoration: none; }

.brand .logo {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  background: var(--accent);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.05rem;
  flex: none;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin-left: auto;
}

.site-nav a {
  color: var(--muted);
  font-size: 0.95rem;
  padding: 4px 2px;
}
.site-nav a:hover {
  color: var(--accent);
  text-decoration: none;
}

.lang-switch {
  font-size: 0.9rem;
  padding: 3px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  white-space: nowrap;
}
.lang-switch:hover {
  border-color: var(--accent);
  color: var(--accent);
  text-decoration: none;
}

/* ---------- Hero ---------- */

.hero {
  background: linear-gradient(135deg, #16306b 0%, #1f6feb 100%);
  color: #fff;
  padding: 64px 0 56px;
}

.hero h1 {
  margin: 0 0 6px;
  font-size: 2.5rem;
  letter-spacing: -0.5px;
}

.hero .tagline {
  font-size: 1.25rem;
  margin: 0 0 14px;
  opacity: 0.95;
}

.hero .sub {
  max-width: 46em;
  margin: 0 0 26px;
  opacity: 0.9;
}

.hero .badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 28px;
}

.badge {
  display: inline-block;
  font-size: 0.82rem;
  padding: 3px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.35);
}

.hero .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.btn {
  display: inline-block;
  padding: 10px 22px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 1rem;
  transition: background 0.15s ease;
}
.btn:hover { text-decoration: none; }

.btn-primary {
  background: #fff;
  color: var(--accent-dark);
}
.btn-primary:hover { background: #e8f0fe; }

.btn-ghost {
  border: 1px solid rgba(255, 255, 255, 0.6);
  color: #fff;
}
.btn-ghost:hover { background: rgba(255, 255, 255, 0.12); }

/* ---------- Sections ---------- */

section {
  padding: 52px 0 30px;
  scroll-margin-top: 70px;
}

section h2 {
  font-size: 1.7rem;
  margin: 0 0 8px;
  letter-spacing: -0.3px;
}

section .section-lead {
  color: var(--muted);
  max-width: 52em;
  margin: 0 0 28px;
}

/* ---------- Cards ---------- */

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
}

.card h3 {
  margin: 0 0 8px;
  font-size: 1.05rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.93rem;
}

.card .icon {
  flex: none;
  width: 20px;
  height: 20px;
  color: var(--accent);
}

/* ---------- Code ---------- */

pre {
  background: var(--code-bg);
  color: var(--code-text);
  border-radius: 8px;
  padding: 16px 18px;
  overflow-x: auto;
  font-size: 0.9rem;
  line-height: 1.55;
  margin: 14px 0;
}

code {
  font-family: Consolas, "Courier New", "Microsoft YaHei", monospace;
}

p code, li code, td code, h3 code, .card code, summary code {
  background: var(--inline-code-bg);
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 0.88em;
}

pre .cmt { color: #94a3b8; }
pre .prg { color: #7dd3fc; font-weight: 600; }

/* ---------- Tables ---------- */

.table-scroll {
  overflow-x: auto;
  margin: 14px 0;
}

table {
  border-collapse: collapse;
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.92rem;
}

th, td {
  text-align: left;
  padding: 9px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

th {
  background: #f2f4f8;
  font-weight: 600;
  white-space: nowrap;
}

tbody tr:last-child td { border-bottom: none; }

td code { white-space: nowrap; }

/* ---------- Notes ---------- */

.note {
  background: var(--note-bg);
  border-left: 4px solid var(--accent);
  border-radius: 0 8px 8px 0;
  padding: 12px 16px;
  margin: 16px 0;
  font-size: 0.95rem;
}

.warn {
  background: var(--warn-bg);
  border-left: 4px solid var(--warn-border);
  border-radius: 0 8px 8px 0;
  padding: 12px 16px;
  margin: 16px 0;
  font-size: 0.95rem;
}

/* ---------- Details ---------- */

details {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 18px;
  margin: 14px 0;
}

details summary {
  cursor: pointer;
  font-weight: 600;
}

details[open] summary { margin-bottom: 10px; }

/* ---------- Steps ---------- */

.steps {
  counter-reset: step;
  list-style: none;
  padding: 0;
  margin: 0 0 20px;
}

.steps > li {
  counter-increment: step;
  position: relative;
  padding-left: 46px;
  margin-bottom: 22px;
}

.steps > li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 2px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
}

.steps h3 {
  margin: 4px 0 4px;
  font-size: 1.05rem;
}

.steps p {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 0.95rem;
}

/* ---------- FAQ ---------- */

.faq-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 20px;
  margin-bottom: 12px;
}

.faq-item h3 {
  margin: 0 0 6px;
  font-size: 1rem;
}

.faq-item p, .faq-item li {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 0.95rem;
}

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 30px 0 40px;
  margin-top: 40px;
  color: var(--muted);
  font-size: 0.9rem;
}

.site-footer .cols {
  display: flex;
  flex-wrap: wrap;
  gap: 24px 60px;
}

.site-footer h4 {
  margin: 0 0 8px;
  color: var(--text);
  font-size: 0.95rem;
}

.site-footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-footer li { margin-bottom: 4px; }

.site-footer .fineprint {
  margin-top: 24px;
  border-top: 1px solid var(--border);
  padding-top: 14px;
}

/* ---------- Responsive ---------- */

@media (max-width: 640px) {
  .hero h1 { font-size: 1.9rem; }
  .hero .tagline { font-size: 1.1rem; }
  section h2 { font-size: 1.45rem; }
  .site-nav { margin-left: 0; }
}
