:root {
  --bg: #faf9fc;
  --surface: #ffffff;
  --border: #e8e5f0;
  --text: #2b2640;
  --muted: #6f6a85;
  --primary: #4c3e9e;
  --primary-dark: #3a2f7d;
  --primary-light: #eceafa;
  --analyst: #7c6fd9;   --analyst-bg: #f1eefc;
  --diplomat: #3e9b6e;  --diplomat-bg: #e9f6f0;
  --sentinel: #3e7cb1;  --sentinel-bg: #eaf3f9;
  --explorer: #d9962e;  --explorer-bg: #fbf3e6;
  --radius: 16px;
  --shadow: 0 2px 12px rgba(60, 50, 120, 0.07);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.75;
  font-size: 16px;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
.container { max-width: 1080px; margin: 0 auto; padding: 0 20px; }

/* Nav */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,0.92); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 62px; }
.brand { font-weight: 700; font-size: 19px; color: var(--primary); display: flex; align-items: center; gap: 8px; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 28px; height: 28px; border-radius: 8px; background: var(--primary); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; }
.nav-links { display: flex; gap: 26px; list-style: none; }
.nav-right { display: flex; align-items: center; gap: 26px; }
.nav-links a { color: var(--text); font-size: 15px; font-weight: 500; }
.nav-links a:hover { color: var(--primary); text-decoration: none; }
.nav-cta { background: var(--primary); color: #fff !important; padding: 8px 18px; border-radius: 999px; }
.nav-cta:hover { background: var(--primary-dark); text-decoration: none !important; }
/* 移动端汉堡菜单按钮（桌面隐藏） */
.nav-toggle { display: none; flex-direction: column; justify-content: center; gap: 5px; width: 44px; height: 40px; padding: 9px 10px; background: transparent; border: 1px solid var(--border); border-radius: 10px; cursor: pointer; }
.nav-toggle:hover { border-color: var(--primary); }
.nav-toggle-bar { display: block; height: 2px; width: 100%; border-radius: 2px; background: var(--text); transition: transform .22s ease, opacity .22s ease; }
.nav.nav-open .nav-toggle-bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav.nav-open .nav-toggle-bar:nth-child(2) { opacity: 0; }
.nav.nav-open .nav-toggle-bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Hero */
.hero { padding: 72px 0 56px; text-align: center; }
.hero h1 { font-size: 38px; line-height: 1.3; margin-bottom: 16px; }
.hero p.sub { font-size: 17px; color: var(--muted); max-width: 640px; margin: 0 auto 30px; }
.btn {
  display: inline-block; padding: 14px 34px; border-radius: 999px;
  font-size: 17px; font-weight: 600; cursor: pointer; border: none;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); text-decoration: none; }
.btn-ghost { background: var(--surface); color: var(--primary); border: 1.5px solid var(--primary); margin-left: 12px; }
.btn-ghost:hover { background: var(--primary-light); text-decoration: none; }
.hero-note { margin-top: 18px; font-size: 13px; color: var(--muted); }

/* Sections */
section.block { padding: 48px 0; }
.sec-head { text-align: center; margin-bottom: 36px; }
.sec-head h2 { font-size: 28px; margin-bottom: 10px; }
.sec-head p { color: var(--muted); font-size: 15px; }

/* Dimension cards */
.dim-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.dim-card { background: var(--surface); border-radius: var(--radius); padding: 26px 22px; box-shadow: var(--shadow); text-align: center; }
.dim-card .pair { font-size: 22px; font-weight: 700; color: var(--primary); letter-spacing: 2px; }
.dim-card h3 { font-size: 17px; margin: 8px 0 6px; }
.dim-card p { font-size: 13.5px; color: var(--muted); }

/* Type grid */
.role-group { margin-bottom: 34px; }
.role-title { font-size: 19px; font-weight: 700; margin-bottom: 6px; display: flex; align-items: center; gap: 10px; }
.role-dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }
.role-desc { font-size: 13.5px; color: var(--muted); margin-bottom: 14px; }
.type-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.type-card {
  display: block; border-radius: var(--radius); padding: 22px 18px;
  box-shadow: var(--shadow); color: var(--text); background: var(--surface);
  border-top: 5px solid var(--card-color, var(--primary));
  transition: transform .15s ease;
}
.type-card:hover { transform: translateY(-4px); text-decoration: none; }
.type-card .code { font-size: 21px; font-weight: 700; color: var(--card-color); }
.type-card .name { font-size: 15px; font-weight: 600; margin: 2px 0 6px; }
.type-card .desc { font-size: 12.5px; color: var(--muted); line-height: 1.6; }

/* Features */
.feat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.feat-card { background: var(--surface); border-radius: var(--radius); padding: 28px 24px; box-shadow: var(--shadow); }
.feat-card h3 { font-size: 17px; margin-bottom: 8px; }
.feat-card p { font-size: 14px; color: var(--muted); }
.feat-num { width: 40px; height: 40px; border-radius: 12px; background: var(--primary-light); color: var(--primary); font-weight: 700; display: flex; align-items: center; justify-content: center; margin-bottom: 14px; }

/* FAQ */
.faq-item { background: var(--surface); border-radius: 12px; padding: 20px 24px; margin-bottom: 12px; box-shadow: var(--shadow); }
.faq-item h3 { font-size: 16px; margin-bottom: 8px; }
.faq-item p { font-size: 14px; color: var(--muted); }

/* Article links */
.article-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.article-card { background: var(--surface); border-radius: var(--radius); padding: 22px 24px; box-shadow: var(--shadow); display: block; color: var(--text); }
.article-card:hover { text-decoration: none; transform: translateY(-3px); transition: transform .15s; }
.article-card h3 { font-size: 16px; color: var(--primary); }
.article-card p { font-size: 13.5px; color: var(--muted); margin-top: 6px; }

/* Breadcrumb */
.crumbs { font-size: 13px; color: var(--muted); padding: 18px 0 0; }
.crumbs a { color: var(--muted); }

/* Type page */
.type-hero { display: flex; gap: 30px; align-items: center; padding: 44px 0 30px; flex-wrap: wrap; }
.type-badge {
  width: 128px; height: 128px; border-radius: 32px; flex-shrink: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: var(--card-bg, var(--primary-light)); color: var(--card-color, var(--primary));
}
.type-badge .code { font-size: 30px; font-weight: 700; }
.type-badge .en { font-size: 12px; margin-top: 2px; opacity: .8; }
.type-hero h1 { font-size: 32px; }
.type-hero .tagline { color: var(--muted); font-size: 16px; margin-top: 4px; }
.role-chip { display: inline-block; padding: 3px 14px; border-radius: 999px; font-size: 13px; font-weight: 600; background: var(--card-bg, var(--primary-light)); color: var(--card-color, var(--primary)); margin-top: 10px; }
.facts { display: flex; gap: 14px; flex-wrap: wrap; margin: 26px 0; }
.fact { background: var(--surface); border-radius: 12px; padding: 14px 20px; box-shadow: var(--shadow); min-width: 150px; }
.fact b { display: block; font-size: 15px; color: var(--primary); }
.fact span { font-size: 12.5px; color: var(--muted); }
.letters { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 24px 0; }
.letter-card { background: var(--surface); border-radius: 12px; padding: 18px; text-align: center; box-shadow: var(--shadow); }
.letter-card b { font-size: 20px; color: var(--primary); display: block; }
.letter-card span { font-size: 12.5px; color: var(--muted); }
h2.sec { font-size: 24px; margin: 40px 0 16px; padding-bottom: 8px; border-bottom: 2px solid var(--primary-light); }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.list-card { background: var(--surface); border-radius: var(--radius); padding: 24px 26px; box-shadow: var(--shadow); }
.list-card h3 { font-size: 17px; margin-bottom: 12px; }
.list-card ul { list-style: none; }
.list-card li { padding: 7px 0 7px 24px; position: relative; font-size: 14.5px; border-bottom: 1px dashed var(--border); }
.list-card li:last-child { border-bottom: none; }
.list-card li::before { content: ""; position: absolute; left: 4px; top: 15px; width: 7px; height: 7px; border-radius: 50%; background: var(--card-color, var(--primary)); }
.tag-row { display: flex; flex-wrap: wrap; gap: 10px; }
.tag { background: var(--primary-light); color: var(--primary); border-radius: 999px; padding: 6px 16px; font-size: 13.5px; font-weight: 500; }
.rel-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 14px; }
.rel-card { background: var(--surface); border-radius: 12px; padding: 18px; text-align: center; box-shadow: var(--shadow); color: var(--text); }
.rel-card:hover { text-decoration: none; transform: translateY(-3px); transition: transform .15s; }
.rel-card .code { font-weight: 700; color: var(--card-color, var(--primary)); font-size: 17px; }
.rel-card .name { font-size: 13px; color: var(--muted); }

/* Test page */
.quiz-wrap { max-width: 720px; margin: 0 auto; padding: 40px 20px 60px; }
.progress-bar { height: 8px; background: var(--primary-light); border-radius: 999px; overflow: hidden; margin-bottom: 8px; }
.progress-fill { height: 100%; background: var(--primary); border-radius: 999px; transition: width .25s ease; width: 0; }
.progress-text { font-size: 13px; color: var(--muted); text-align: right; margin-bottom: 20px; }
.q-card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 32px 30px; }
.q-num { font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.q-text { font-size: 20px; font-weight: 600; margin-bottom: 26px; }
.scale { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; align-items: center; }
.scale button {
  aspect-ratio: 1; border-radius: 50%; border: 2px solid var(--border);
  background: var(--surface); cursor: pointer; transition: all .12s;
}
.scale button:hover { border-color: var(--primary); transform: scale(1.1); }
.scale button.sel { background: var(--primary); border-color: var(--primary); }
.scale-labels { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-top: 10px; }
.result-card { background: var(--surface); border-radius: 20px; box-shadow: var(--shadow); padding: 44px 36px; text-align: center; }
.result-card .code { font-size: 44px; font-weight: 700; }
.result-card .name { font-size: 20px; margin: 6px 0 14px; }
.dim-bar { margin: 18px auto; max-width: 460px; }
.dim-bar .lbl { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); }
.dim-bar .track { height: 10px; background: var(--primary-light); border-radius: 999px; overflow: hidden; margin: 4px 0 12px; }
.dim-bar .fill { height: 100%; background: var(--primary); border-radius: 999px; }

/* Tables */
.table-wrap { overflow-x: auto; margin: 20px 0; }
table.cmp { width: 100%; border-collapse: collapse; background: var(--surface); box-shadow: var(--shadow); border-radius: 12px; overflow: hidden; font-size: 14px; }
.cmp th, .cmp td { padding: 12px 14px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.cmp th { background: var(--primary-light); color: var(--primary-dark); font-weight: 600; white-space: nowrap; }
.cmp tr:last-child td { border-bottom: none; }
.cmp td b { color: var(--primary); }

/* Guide long-form */
.guide-meta { font-size: 13px; color: var(--muted); margin-bottom: 26px; padding-bottom: 14px; border-bottom: 1px solid var(--border); }

/* Quizzes */
.opt-list { display: flex; flex-direction: column; gap: 10px; }
.opt-list button { text-align: left; padding: 14px 18px; border-radius: 12px; border: 1.5px solid var(--border); background: var(--surface); cursor: pointer; font-size: 15px; color: var(--text); font-family: inherit; transition: all .12s; }
.opt-list button:hover { border-color: var(--primary); background: var(--primary-light); }
.quiz-hero { text-align: center; padding: 46px 0 10px; }
.quiz-hero h1 { font-size: 30px; margin-bottom: 10px; }
.quiz-hero p { color: var(--muted); }

/* Footer */
footer { background: #241f3d; color: #cfcbe4; margin-top: 60px; padding: 44px 0 28px; }
.foot-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 30px; margin-bottom: 28px; }
.foot-grid h4 { color: #fff; font-size: 15px; margin-bottom: 12px; }
.foot-grid ul { list-style: none; }
.foot-grid li { margin-bottom: 8px; font-size: 13.5px; }
.foot-grid a { color: #cfcbe4; }
.foot-grid a:hover { color: #fff; }
.foot-bottom { border-top: 1px solid #3a3460; padding-top: 20px; font-size: 12.5px; color: #948fae; }

/* Trust/simple pages */
.page { padding: 36px 0 60px; max-width: 800px; margin: 0 auto; }
.page h1 { font-size: 30px; margin: 14px 0 24px; }
.page h2 { font-size: 20px; margin: 26px 0 10px; }
.page p, .page li { font-size: 15px; color: #46415c; }

/* Hub page */
.hub-intro { max-width: 760px; color: var(--muted); margin: 0 auto 30px; text-align: center; }

@media (max-width: 860px) {
  .dim-grid, .type-grid, .rel-grid, .letters { grid-template-columns: repeat(2, 1fr); }
  .feat-grid { grid-template-columns: 1fr; }
  .article-list, .two-col { grid-template-columns: 1fr; }
  .hero h1 { font-size: 28px; }
  /* 移动端导航：汉堡按钮 + 下拉菜单（替代此前"直接隐藏链接"的做法） */
  .nav-toggle { display: inline-flex; }
  .nav-links {
    position: absolute; left: 0; right: 0; top: 100%;
    display: none; flex-direction: column; gap: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 14px 28px rgba(60, 50, 120, 0.12);
    list-style: none; padding: 4px 0;
  }
  .nav.nav-open .nav-links { display: flex; }
  .nav-links li { display: block; }
  .nav-links li > a { display: block; padding: 13px 24px; font-size: 15px; }
  .nav-links li + li { border-top: 1px solid var(--border); }
  /* 主 CTA 常驻顶部栏，不进下拉菜单 */
  .nav-right { gap: 10px; }
  .nav-cta { padding: 8px 16px; font-size: 14px; }
  .type-hero h1 { font-size: 26px; }
  .scale { gap: 6px; }
  .q-text { font-size: 17px; }
  /* 移动端 CTA 按钮：块级堆叠居中，修复双按钮换行时重叠 */
  .btn {
    display: block;
    width: fit-content;
    max-width: 100%;
    margin: 0 auto 12px !important;
    white-space: normal;
  }
}
