/* ============================================================
   赫曦检测 HeXi Detection — 主样式表
   精神活性药物科普网站
   ============================================================ */

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary:      #1B4F72;
  --primary-dark: #143D5C;
  --primary-light:#2E86C1;
  --accent:       #17A589;
  --accent-dark:  #0E7C63;
  --accent-light: #48C9B0;
  --warning:      #F39C12;
  --danger:       #E74C3C;
  --bg:           #F8FAFC;
  --bg-white:     #FFFFFF;
  --text:         #2C3E50;
  --text-light:   #5D6D7E;
  --text-muted:   #95A5A6;
  --border:       #DEE2E6;
  --border-light: #EBEDEF;
  --shadow-sm:    0 1px 3px rgba(0,0,0,.06);
  --shadow:       0 2px 12px rgba(0,0,0,.08);
  --shadow-lg:    0 8px 30px rgba(0,0,0,.12);
  --radius:       8px;
  --radius-lg:    16px;
  --transition:   0.25s ease;
  --max-width:    1200px;
  --header-h:     70px;
}

html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
               "Microsoft YaHei", "Helvetica Neue", sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
  min-height: 100vh;
}

a { color: var(--primary-light); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--accent); }
ul { list-style: none; }
img { max-width: 100%; display: block; }
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 24px; }

/* ── Typography ── */
h1, h2, h3, h4 { line-height: 1.3; color: var(--primary-dark); }
h1 { font-size: 2.4rem; font-weight: 800; letter-spacing: -.02em; }
h2 { font-size: 1.8rem; font-weight: 700; }
h3 { font-size: 1.25rem; font-weight: 600; }
.section-title {
  text-align: center; margin-bottom: 8px;
}
.section-subtitle {
  text-align: center; color: var(--text-light); margin-bottom: 48px; font-size: 1.05rem;
}

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 24px; border-radius: 6px; font-size: .95rem; font-weight: 600;
  cursor: pointer; border: none; transition: var(--transition);
  text-decoration: none; white-space: nowrap;
}
.btn-primary    { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); color: #fff; transform: translateY(-1px); box-shadow: var(--shadow); }
.btn-accent     { background: var(--accent); color: #fff; }
.btn-accent:hover  { background: var(--accent-dark); color: #fff; transform: translateY(-1px); box-shadow: var(--shadow); }
.btn-outline    { background: transparent; border: 2px solid var(--primary); color: var(--primary); }
.btn-outline:hover { background: var(--primary); color: #fff; }
.btn-lg         { padding: 14px 36px; font-size: 1.05rem; border-radius: 8px; }
.btn-sm         { padding: 6px 16px; font-size: .85rem; }

/* ── Header / Navigation ── */
.header {
  position: sticky; top: 0; z-index: 1000;
  background: rgba(255,255,255,.95); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-light); height: var(--header-h);
}
.header .container { display: flex; align-items: center; justify-content: space-between; height: 100%; }
.logo { display: flex; align-items: center; gap: 10px; font-size: 1.3rem; font-weight: 800; color: var(--primary-dark); }
.logo-icon {
  width: 40px; height: 40px; border-radius: 10px;
  display: block; flex-shrink: 0;
}
.nav { display: flex; align-items: center; gap: 4px; }
.nav a {
  color: var(--text); padding: 8px 16px; border-radius: 6px; font-weight: 500;
  font-size: .93rem; transition: var(--transition);
}
.nav a:hover, .nav a.active { background: var(--primary); color: #fff; }
.nav a.nav-accent { background: var(--accent); color: #fff; }
.nav a.nav-accent:hover { background: var(--accent-dark); }
/* 语言切换（v2.26：中/EN，置于导航末尾） */
.lang-switch {
  display: inline-flex; align-items: center; gap: 6px;
  margin-left: 12px; padding-left: 14px; border-left: 1px solid var(--border);
  font-size: .8rem; user-select: none; white-space: nowrap;
}
.lang-opt { cursor: pointer; color: var(--text-muted); transition: color .18s; font-weight: 500; }
.lang-opt:hover { color: var(--primary); }
.lang-opt.active { color: var(--primary); font-weight: 700; }
.lang-sep { color: var(--border); }
/* 消息未读角标（用户中心链接右下角） */
.nav-msg-badge {
  position: absolute; right: -6px; bottom: -4px;
  min-width: 16px; height: 16px; padding: 0 3px; box-sizing: border-box;
  background: #E74C3C; color: #fff;
  border-radius: 9px; border: 1.5px solid #fff;
  font-size: .68rem; line-height: 13px; font-weight: 700;
  text-align: center; pointer-events: none;
}
.menu-toggle { display: none; background: none; border: none; font-size: 1.6rem; cursor: pointer; color: var(--text); }

/* ── Hero ── */
.hero {
  background: linear-gradient(135deg, #0D3B5E 0%, #1B4F72 40%, #1A6B52 100%);
  color: #fff; padding: 80px 0 100px; position: relative; overflow: hidden;
}
/* 首页实景图：左侧深色蒙层保证主标题与 CTA 的对比度。 */
body[data-page="index"] .hero {
  background-image:
    linear-gradient(90deg, rgba(8,35,57,.96) 0%, rgba(13,59,94,.88) 42%, rgba(18,92,79,.58) 100%),
    url('../images/hero-home.png');
  background-size: cover;
  background-position: center;
}
.hero::before {
  content: ''; position: absolute; top: -60px; right: -120px;
  width: 500px; height: 500px; border-radius: 50%;
  background: rgba(255,255,255,.04);
}
.hero::after {
  content: ''; position: absolute; bottom: -80px; left: -80px;
  width: 350px; height: 350px; border-radius: 50%;
  background: rgba(255,255,255,.03);
}
.hero .container { position: relative; z-index: 1; }
.hero h1 { font-size: 2.8rem; font-weight: 800; color: #fff; margin-bottom: 20px; line-height: 1.25; }
.hero p  { font-size: 1.15rem; opacity: .85; max-width: 620px; margin-bottom: 36px; line-height: 1.8; }
.hero-btns { display: flex; gap: 16px; flex-wrap: wrap; }
.hero-btns .btn { font-size: 1rem; padding: 14px 32px; }
.hero-btns .btn-outline { border-color: rgba(255,255,255,.6); color: #fff; }
.hero-btns .btn-outline:hover { background: rgba(255,255,255,.15); border-color: #fff; }
.hero-btns .btn-accent { box-shadow: 0 4px 16px rgba(23,165,137,.4); }

/* ── Stats Bar ── */
.stats-bar {
  background: #fff; border-bottom: 1px solid var(--border-light);
  padding: 0; box-shadow: var(--shadow-sm);
}
.stats-bar .container { display: flex; justify-content: space-around; }
.stat-item {
  text-align: center; padding: 28px 20px; flex: 1;
  border-right: 1px solid var(--border-light);
}
.stat-item:last-child { border-right: none; }
.stat-number { font-size: 2.2rem; font-weight: 800; color: var(--primary); }
.stat-label  { font-size: .9rem; color: var(--text-light); margin-top: 4px; }

/* ── Section ── */
.section { padding: 72px 0; }
.section-gray { background: #F0F3F5; }

/* ── Cards ── */
.card-grid { display: grid; gap: 24px; }
.card-grid-2 { grid-template-columns: repeat(2, 1fr); }
.card-grid-3 { grid-template-columns: repeat(3, 1fr); }
.card-grid-4 { grid-template-columns: repeat(4, 1fr); }

.card {
  background: #fff; border-radius: var(--radius-lg); padding: 32px;
  box-shadow: var(--shadow-sm); transition: var(--transition);
  border: 1px solid var(--border-light);
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.card-icon {
  width: 56px; height: 56px; border-radius: 14px; display: flex;
  align-items: center; justify-content: center; font-size: 1.4rem;
  font-weight: 700; margin-bottom: 20px;
}
.card-icon.blue   { background: #E8F4FD; color: var(--primary-light); }
.card-icon.green  { background: #E8F8F5; color: var(--accent); }
.card-icon.orange { background: #FEF5E7; color: var(--warning); }
.card-icon.red    { background: #FDEDEC; color: var(--danger); }
.function-icon { display: block; width: 34px; height: 34px; flex-shrink: 0; }

/* contact info icon */
.ci-icon {
  width: 36px; height: 36px; border-radius: 8px; display: flex;
  align-items: center; justify-content: center; font-size: .85rem;
  font-weight: 700; background: rgba(255,255,255,.15); color: #fff;
  flex-shrink: 0; margin-top: 2px;
}

/* team avatar */
.team-avatar {
  width: 80px; height: 80px; border-radius: 50%; background: linear-gradient(135deg, #E8F4FD, #D5E8F0);
  margin: 0 auto 16px; display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem; font-weight: 700; color: var(--primary-light);
}
.card h3 { margin-bottom: 10px; }
.card p  { color: var(--text-light); font-size: .93rem; line-height: 1.7; }
.card .btn { margin-top: 16px; }

/* ── News Section ── */
.news-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 24px; }
.news-card {
  background: #fff; border-radius: var(--radius-lg); overflow: hidden;
  box-shadow: var(--shadow-sm); border: 1px solid var(--border-light);
}
.news-card-header {
  padding: 16px 24px; border-bottom: 1px solid var(--border-light);
  font-weight: 700; font-size: 1.05rem; display: flex; align-items: center; gap: 8px;
}
.news-list { padding: 8px 0; }
.news-item {
  display: flex; justify-content: space-between; align-items: flex-start;
  padding: 14px 24px; border-bottom: 1px solid var(--border-light);
  transition: var(--transition);
}
.news-item:last-child { border-bottom: none; }
.news-item:hover { background: var(--bg); }
.news-item .news-date {
  font-size: .82rem; color: var(--text-muted); white-space: nowrap; margin-left: 12px;
}
.news-item a { color: var(--text); font-size: .93rem; }
.news-item a:hover { color: var(--primary-light); }
.news-more { padding: 14px 24px; text-align: center; border-top: 1px solid var(--border-light); }

/* ── Partners ── */
.partners { display: flex; justify-content: center; align-items: center; gap: 48px; flex-wrap: wrap; }
.partner-placeholder {
  width: 130px; height: 50px; background: #E9ECEF; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); font-size: .82rem; font-weight: 500;
}

/* ── Footer ── */
.footer {
  background: var(--primary-dark); color: rgba(255,255,255,.7); padding: 56px 0 0;
}
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px; }
.footer h4 { color: #fff; font-size: 1rem; margin-bottom: 20px; }
.footer a  { color: rgba(255,255,255,.6); font-size: .9rem; }
.footer a:hover { color: #fff; }
.footer li { margin-bottom: 10px; }
.footer-about p { font-size: .9rem; margin-bottom: 16px; line-height: 1.8; }
/* 页脚公益副标（v2.25：宣传名低调呈现，法定公司名保留） */
.footer-tagline {
  font-size: .78rem; letter-spacing: .14em; color: rgba(255,255,255,.45);
  margin: -12px 0 16px;
}
.footer-bottom {
  margin-top: 40px; padding: 20px 0; border-top: 1px solid rgba(255,255,255,.1);
  text-align: center; font-size: .85rem; color: rgba(255,255,255,.4);
}

/* ── Page Banner (inner pages) ── */
.page-banner {
  background: linear-gradient(135deg, #0D3B5E 0%, #1B4F72 40%, #1A6B52 100%);
  color: #fff; padding: 60px 0; text-align: center;
}
/* 内容页首屏实景图：中心重点压暗，兼顾中英文标题可读性。 */
body[data-page="science"] .page-banner {
  background-image:
    linear-gradient(135deg, rgba(8,35,57,.78), rgba(13,59,94,.72) 50%, rgba(18,92,79,.68)),
    url('../images/hero-science.png');
  background-size: cover;
  background-position: center;
}
body[data-page="science"] .article-card-link {
  display: block;
  color: inherit;
}
body[data-page="science"] .article-card-link:hover { color: inherit; }
body[data-page="ai"] .page-banner {
  background-image:
    linear-gradient(90deg, rgba(8,35,57,.38), rgba(13,59,94,.80) 34%, rgba(13,59,94,.80) 66%, rgba(18,92,79,.34)),
    url('../images/hero-consultation-v2.png');
  background-size: cover;
  background-position: center;
}
/* 关于、联系与用户中心：中央深色安全区承载标题，边缘保留实景人物。 */
body[data-page="about"] .page-banner,
body[data-page="contact"] .page-banner,
body[data-page="user"] .page-banner {
  background-size: cover;
  background-repeat: no-repeat;
}
body[data-page="about"] .page-banner {
  background-image:
    linear-gradient(90deg, rgba(8,35,57,.46), rgba(13,59,94,.82) 32%, rgba(13,59,94,.82) 68%, rgba(18,92,79,.42)),
    url('../images/hero-about-v1.png');
  background-position: center 56%;
}
body[data-page="contact"] .page-banner {
  background-image:
    linear-gradient(90deg, rgba(8,35,57,.40), rgba(13,59,94,.80) 31%, rgba(13,59,94,.78) 67%, rgba(18,92,79,.36)),
    url('../images/hero-contact-v1.png');
  background-position: center 66%;
}
body[data-page="user"] .page-banner {
  background-image:
    linear-gradient(90deg, rgba(8,35,57,.40), rgba(13,59,94,.82) 32%, rgba(13,59,94,.82) 68%, rgba(18,92,79,.40)),
    url('../images/hero-user-v3.png');
  background-position: center 63%;
}
@media (max-width: 768px) {
  body[data-page="contact"] .page-banner,
  body[data-page="user"] .page-banner {
    background-size: cover, auto 108%;
    background-position: center, center bottom;
  }
}
.page-banner h1 { color: #fff; margin-bottom: 10px; }
.page-banner p  { opacity: .8; font-size: 1.05rem; }
.breadcrumb { font-size: .9rem; opacity: .7; margin-bottom: 8px; }
.breadcrumb a { color: rgba(255,255,255,.8); }
.breadcrumb span { margin: 0 6px; }

/* ── Tab Navigation (for 科普中心 / 服务大厅) ── */
.tab-nav {
  display: flex; gap: 0; border-bottom: 2px solid var(--border);
  margin-bottom: 40px; overflow-x: auto;
}
.tab-nav button {
  padding: 14px 28px; border: none; background: none; cursor: pointer;
  font-size: .95rem; font-weight: 600; color: var(--text-light);
  border-bottom: 2px solid transparent; margin-bottom: -2px;
  transition: var(--transition); white-space: nowrap;
}
.tab-nav button:hover { color: var(--primary); }
.tab-nav button.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── Encyclopedia / Knowledge Cards ── */
.substance-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 20px; }
.substance-card {
  background: #fff; border-radius: var(--radius); padding: 24px;
  box-shadow: var(--shadow-sm); border: 1px solid var(--border-light);
  transition: var(--transition); cursor: pointer;
}
.substance-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.substance-card .tag {
  display: inline-block; padding: 3px 10px; border-radius: 20px;
  font-size: .75rem; font-weight: 600; margin-bottom: 12px;
}
.tag-nps         { background: #FDEDEC; color: #C0392B; }
.tag-opioid      { background: #FEF5E7; color: #D68910; }
.tag-stim        { background: #E8F4FD; color: #2471A3; }
.tag-sedative    { background: #E8F8F5; color: #0E7C63; }
.tag-hallucinogen { background: #F4ECF7; color: #7D3C98; }
.tag-other       { background: #EAECEE; color: #5D6D7E; }
.substance-card h3 { font-size: 1.05rem; margin-bottom: 8px; }
.substance-card p  { font-size: .85rem; color: var(--text-light); }

/* ── Video Cards ── */
.video-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 24px; }
.video-card {
  background: #fff; border-radius: var(--radius-lg); overflow: hidden;
  box-shadow: var(--shadow-sm); transition: var(--transition); border: 1px solid var(--border-light);
}
.video-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.video-thumb {
  height: 180px; background: linear-gradient(135deg, #1B4F72, #2E86C1);
  display: flex; align-items: center; justify-content: center; position: relative;
}
.video-thumb .play-icon {
  width: 54px; height: 54px; border-radius: 50%; background: rgba(255,255,255,.9);
  display: flex; align-items: center; justify-content: center; font-size: 1.4rem;
  color: var(--primary); box-shadow: 0 4px 16px rgba(0,0,0,.2);
}
.video-thumb .duration {
  position: absolute; bottom: 10px; right: 10px; background: rgba(0,0,0,.7);
  color: #fff; padding: 2px 8px; border-radius: 4px; font-size: .78rem;
}
.video-card-body { padding: 20px; }
.video-card-body h3 { font-size: 1rem; margin-bottom: 6px; }
.video-card-body .meta { font-size: .82rem; color: var(--text-muted); }

/* ── 收藏按钮（v2.18：文章/视频通用，纯文字+边框，不用 emoji 图标）── */
.fav-btn {
  display: inline-block; padding: 4px 14px; border: 1px solid var(--border);
  border-radius: 16px; background: #fff; color: var(--text-muted);
  font-size: .8rem; cursor: pointer; font-family: inherit; line-height: 1.4;
  transition: var(--transition); white-space: nowrap;
}
.fav-btn:hover { border-color: var(--primary-light); color: var(--primary); }
.fav-btn.on { background: #E8F8F5; border-color: var(--primary-light); color: var(--primary); }
.fav-row { display: flex; justify-content: flex-end; margin-top: 10px; }
/* 列表型文章卡：日期与收藏按钮同行，右对齐 */
.news-meta-row { display: flex; align-items: center; gap: 12px; white-space: nowrap; margin-left: 12px; }
.news-meta-row .news-date { margin-left: 0; }

/* ── Video（v2.17：封面 + CSS 三角播放图标，不用 emoji/字符图标）── */
.video-thumb.has-cover { background-size: cover; background-position: center; }
.play-tri {
  width: 0; height: 0;
  border-style: solid;
  border-width: 8px 0 8px 14px;
  border-color: transparent transparent transparent var(--primary);
  margin-left: 4px;
}
.video-modal-player { margin: 6px 0 12px; }
.video-modal-player video { width: 100%; max-height: 60vh; background: #000; border-radius: 8px; display: block; }
.video-modal-player iframe { width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: 8px; display: block; background: #000; }

/* ── 视频播放弹窗（v2.17：id 作用域，index.html 与 science.html 共用，不与文章弹窗 .modal 冲突）── */
#video-modal-overlay {
  display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,.45); z-index: 2000;
  justify-content: center; align-items: center;
}
#video-modal-overlay.show { display: flex; }
#video-modal-content {
  background: #fff; border-radius: 12px; padding: 32px;
  max-width: 720px; width: 90%; max-height: 80vh; overflow-y: auto;
  box-shadow: 0 8px 40px rgba(0,0,0,.2);
}
#video-modal-content .close-btn {
  float: right; background: none; border: none; font-size: 1.5rem;
  cursor: pointer; color: #95A5A6; line-height: 1;
}
#video-modal-content h3 { margin-bottom: 14px; }

/* ── Service Cards ── */
.service-card {
  background: #fff; border-radius: var(--radius-lg); padding: 36px;
  box-shadow: var(--shadow-sm); border: 1px solid var(--border-light);
  transition: var(--transition);
}
.service-card:hover { box-shadow: var(--shadow); }
.service-card .icon { font-size: 2.4rem; margin-bottom: 16px; }
.service-card h3 { margin-bottom: 10px; }
.service-card p  { color: var(--text-light); margin-bottom: 20px; }

/* ── Product Table ── */
.product-table-wrap { overflow-x: auto; margin-top: 32px; }
.product-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); }
.product-table th { background: var(--primary); color: #fff; padding: 14px 16px; text-align: left; font-size: .9rem; }
.product-table td { padding: 14px 16px; border-bottom: 1px solid var(--border-light); font-size: .9rem; }
.product-table tr:hover td { background: var(--bg); }
.product-table .highlight { color: var(--accent); font-weight: 700; }

/* ── Form ── */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.form-grid .full { grid-column: 1 / -1; }
.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-weight: 600; margin-bottom: 6px; font-size: .9rem; }
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%; padding: 12px 16px; border: 1px solid var(--border);
  border-radius: 6px; font-size: .93rem; font-family: inherit;
  transition: var(--transition); background: #fff;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none; border-color: var(--primary-light); box-shadow: 0 0 0 3px rgba(46,134,193,.12);
}
.form-group textarea { resize: vertical; min-height: 120px; }

/* form validation states */
.required { color: var(--danger); font-weight: 400; }
.form-error { display: none; color: var(--danger); font-size: .82rem; margin-top: 4px; }
.form-group.error .form-error { display: block; }
.form-group.error input,
.form-group.error select,
.form-group.error textarea { border-color: var(--danger); }
.form-meta { display: block; text-align: right; font-size: .8rem; color: var(--text-muted); margin-top: 4px; }
.char-count.over { color: var(--danger); font-weight: 600; }

/* form submit button states */
.btn:disabled { opacity: .65; cursor: not-allowed; transform: none !important; box-shadow: none !important; }
.btn .spinner { display: none; width: 18px; height: 18px; border: 2px solid rgba(255,255,255,.3); border-top-color: #fff; border-radius: 50%; animation: spin .6s linear infinite; margin-right: 4px; }
.btn.loading .spinner { display: inline-block; }
.btn.loading .btn-text { opacity: .7; }

@keyframes spin { to { transform: rotate(360deg); } }

/* form result message */
#form-message {
  padding: 14px 18px; border-radius: 6px; font-size: .93rem; font-weight: 500;
}
#form-message.success { background: #E8F8F5; color: #0E7C63; border: 1px solid #A3E4D7; }
#form-message.error   { background: #FDEDEC; color: #C0392B; border: 1px solid #F5B7B1; }

/* ── Contact Layout ── */
.contact-layout { display: grid; grid-template-columns: 3fr 2fr; gap: 40px; }
.contact-info-card {
  background: var(--primary-dark); color: #fff; border-radius: var(--radius-lg);
  padding: 40px;
}
.contact-info-card h3 { color: #fff; margin-bottom: 24px; }
.contact-info-item { display: flex; gap: 14px; margin-bottom: 20px; align-items: flex-start; }
.contact-info-item .ci-text { font-size: .93rem; opacity: .9; }

/* ── About ── */
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; }
.about-img-placeholder {
  background: linear-gradient(135deg, #E8F4FD, #E8F8F5); border-radius: var(--radius-lg);
  height: 360px; display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); font-size: 1rem;
}
.timeline { position: relative; padding-left: 30px; }
.timeline::before {
  content: ''; position: absolute; left: 8px; top: 0; bottom: 0;
  width: 3px; background: var(--border);
}
.timeline-item { margin-bottom: 28px; position: relative; }
.timeline-item::before {
  content: ''; position: absolute; left: -26px; top: 6px;
  width: 14px; height: 14px; border-radius: 50%; background: var(--accent);
  border: 3px solid #fff; box-shadow: 0 0 0 2px var(--accent);
}
.timeline-year { font-weight: 800; color: var(--accent); font-size: .9rem; margin-bottom: 4px; }

.team-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 28px; }
.team-card {
  background: #fff; border-radius: var(--radius-lg); padding: 28px;
  text-align: center; box-shadow: var(--shadow-sm); border: 1px solid var(--border-light);
  transition: var(--transition);
}
.team-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.team-card h3 { margin-bottom: 4px; }
.team-card .role { font-size: .85rem; color: var(--accent); font-weight: 600; margin-bottom: 8px; }
.team-card .bio  { font-size: .85rem; color: var(--text-light); }

/* ── Page Banner tabs sub-nav ── */
.subpage-tabs { display: flex; gap: 8px; justify-content: center; margin-top: 24px; flex-wrap: wrap; }
.subpage-tabs a {
  padding: 8px 20px; border-radius: 20px; background: rgba(255,255,255,.15);
  color: #fff; font-size: .9rem; font-weight: 500; transition: var(--transition);
}
.subpage-tabs a:hover, .subpage-tabs a.active { background: rgba(255,255,255,.25); }

/* ── Assessment ── */
.assessment-block {
  background: #fff; border-radius: var(--radius-lg); padding: 40px;
  box-shadow: var(--shadow); border: 1px solid var(--border-light); max-width: 720px; margin: 0 auto;
}
.quiz-progress { height: 6px; background: var(--border-light); border-radius: 3px; margin-bottom: 32px; }
.quiz-progress-bar { height: 100%; background: var(--accent); border-radius: 3px; transition: width .4s; }
.quiz-question { font-size: 1.2rem; font-weight: 600; margin-bottom: 24px; }
.quiz-options { display: flex; flex-direction: column; gap: 12px; }
.quiz-option {
  padding: 16px 20px; border: 2px solid var(--border); border-radius: var(--radius);
  cursor: pointer; font-size: .95rem; transition: var(--transition);
}
.quiz-option:hover { border-color: var(--primary-light); background: #F0F7FB; }
.quiz-option.selected { border-color: var(--primary); background: #E8F4FD; }
.quiz-option:disabled { cursor: default; opacity: .7; }

/* ── Assessment AI 流式结果 ── */
.assessment-loading { text-align: center; padding: 40px 20px; color: var(--text-light); }
.assessment-loading .spinner { width: 36px; height: 36px; margin: 0 auto 16px; border: 3px solid var(--border-light); border-top-color: var(--accent); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.assessment-result { margin-top: 24px; }
.assessment-result h3 { font-size: 1.1rem; margin-bottom: 4px; }
.assessment-result .bubble-stack { display: flex; flex-direction: column; gap: 8px; margin: 16px 0 20px; align-items: flex-start; }
.assessment-result .chat-bubble { max-width: 100%; background: #F0F3F5; color: var(--text); border-radius: 16px; border-bottom-left-radius: 4px; padding: 12px 18px; font-size: .93rem; line-height: 1.7; animation: msgIn .3s ease-out; }
.assessment-result .chat-bubble p { margin: 0 0 8px; }
.assessment-result .chat-bubble p:last-child { margin-bottom: 0; }
.assessment-result .chat-bubble ul, .assessment-result .chat-bubble ol { margin: 4px 0 10px; padding-left: 20px; }
.assessment-result .chat-bubble li { margin: 3px 0; }
.assessment-result .typing-dots { display: flex; gap: 4px; padding: 4px 0; }
.assessment-result .typing-dots span { width: 7px; height: 7px; border-radius: 50%; background: var(--text-muted); animation: bounce 1.2s infinite; }
.assessment-result .typing-dots span:nth-child(2) { animation-delay: .2s; }
.assessment-result .typing-dots span:nth-child(3) { animation-delay: .4s; }
@keyframes bounce { 0%, 60%, 100% { transform: translateY(0); } 30% { transform: translateY(-8px); } }
@keyframes msgIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.assessment-result .chat-bubble.error { background: #FEF5E7; color: #D68910; }
.assessment-result .actions { display: flex; gap: 12px; }
.login-prompt { text-align: center; padding: 32px 20px; }
.login-prompt p { color: var(--text-light); margin-bottom: 20px; line-height: 1.8; }

/* ── Home Test Flow ── */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-bottom: 40px; }
.step {
  text-align: center; padding: 28px 16px; background: #fff; border-radius: var(--radius);
  box-shadow: var(--shadow-sm); border: 1px solid var(--border-light); position: relative;
}
.step-num {
  width: 40px; height: 40px; border-radius: 50%; background: var(--primary);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-weight: 800; margin: 0 auto 12px;
}
.step h4 { font-size: .95rem; margin-bottom: 6px; }
.step p  { font-size: .82rem; color: var(--text-light); }

/* ── AI Chat Placeholder ── */
.chat-placeholder {
  background: #fff; border-radius: var(--radius-lg); box-shadow: var(--shadow);
  border: 1px solid var(--border-light); max-width: 760px; margin: 0 auto; overflow: hidden;
}
.chat-header {
  padding: 16px 24px; background: var(--primary); color: #fff;
  display: flex; align-items: center; gap: 10px; font-weight: 600;
}
.chat-body {
  padding: 32px; min-height: 300px; display: flex;
  flex-direction: column; align-items: center; justify-content: center; text-align: center;
}
.chat-body .icon { font-size: 3rem; margin-bottom: 16px; opacity: .5; }
.chat-body h3 { margin-bottom: 8px; }
.chat-body p  { color: var(--text-light); margin-bottom: 20px; max-width: 440px; }
.chat-suggestions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.chat-suggestion {
  padding: 8px 18px; border: 1px solid var(--border); border-radius: 20px;
  font-size: .85rem; cursor: pointer; transition: var(--transition); background: #fff;
}
.chat-suggestion:hover { border-color: var(--primary-light); color: var(--primary); background: #F0F7FB; }

/* ── Responsive ── */
@media (max-width: 1024px) {
  .card-grid-4 { grid-template-columns: repeat(2, 1fr); }
  .steps       { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  h1 { font-size: 1.8rem; }
  h2 { font-size: 1.4rem; }
  .hero { padding: 48px 0 60px; }
  .hero h1 { font-size: 2rem; }
  .hero p  { font-size: 1rem; }
  .card-grid-2, .card-grid-3, .card-grid-4 { grid-template-columns: 1fr; }
  .steps       { grid-template-columns: 1fr 1fr; }
  .news-grid   { grid-template-columns: 1fr; }
  .contact-layout { grid-template-columns: 1fr; }
  .about-grid  { grid-template-columns: 1fr; }
  .form-grid   { grid-template-columns: 1fr; }
  .substance-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
  .video-grid  { grid-template-columns: 1fr; }

  .menu-toggle { display: block; }
  .nav {
    display: none; position: absolute; top: var(--header-h); left: 0; right: 0;
    background: #fff; flex-direction: column; padding: 8px 16px 16px;
    border-bottom: 1px solid var(--border-light); box-shadow: var(--shadow);
  }
  .nav.open { display: flex; }
  .nav a { width: 100%; padding: 12px 16px; }
  .stats-bar .container { flex-wrap: wrap; }
  .stat-item { flex: 1 1 50%; border-bottom: 1px solid var(--border-light); }
  .stat-item:nth-child(3) { border-bottom: none; }
  .stat-item:nth-child(4) { border-bottom: none; }
  .stat-number { font-size: 1.6rem; }
  .partners { gap: 24px; }
  .footer-grid { grid-template-columns: 1fr; }
}

/* ── Page Sidebar（侧边栏） ── */

/* 侧边栏面板 —— 窄条设计，不压缩主内容区 */
.sidebar {
  position: fixed;
  top: calc(var(--header-h) + 20px);
  right: 8px;
  width: 170px;
  max-height: calc(100vh - var(--header-h) - 40px);
  overflow-y: auto;
  z-index: 900;
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-light);
  padding: 12px 8px;
  transform: translateX(calc(100% + 20px));
  opacity: 0;
  pointer-events: none;
  transition: transform 0.35s cubic-bezier(0.22, 0.61, 0.36, 1),
              opacity 0.3s ease;
}

.sidebar.visible {
  transform: translateX(0);
  opacity: 1;
  pointer-events: auto;
}

/* 侧边栏标题 */
.sidebar-heading {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  padding: 2px 6px 10px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--border-light);
}

/* 导航项列表 */
.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 8px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text);
  transition: background 0.2s, color 0.2s;
  position: relative;
  text-decoration: none;
}

.sidebar-item:hover {
  background: #F0F7FB;
  color: var(--primary);
}

.sidebar-item.active {
  background: #E8F4FD;
  color: var(--primary);
  font-weight: 600;
}

/* 激活指示圆点 */
.sidebar-item .sidebar-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--border);
  flex-shrink: 0;
  transition: background 0.3s, transform 0.3s;
}

.sidebar-item.active .sidebar-dot {
  background: var(--primary-light);
  transform: scale(1.4);
}

/* 悬浮提示 tooltip */
.sidebar-item .sidebar-tooltip {
  position: absolute;
  right: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%);
  background: var(--primary-dark);
  color: #fff;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 400;
  line-height: 1.6;
  white-space: normal;
  width: 210px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  z-index: 10;
  box-shadow: var(--shadow);
}

/* tooltip 箭头 */
.sidebar-item .sidebar-tooltip::after {
  content: '';
  position: absolute;
  left: 100%;
  top: 50%;
  transform: translateY(-50%);
  border: 6px solid transparent;
  border-left-color: var(--primary-dark);
}

.sidebar-item:hover .sidebar-tooltip {
  opacity: 1;
}

/* 侧边栏滚动条 */
.sidebar::-webkit-scrollbar {
  width: 4px;
}

.sidebar::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

/* 窄屏隐藏侧边栏 */
@media (max-width: 1399px) {
  .sidebar {
    display: none !important;
  }
}

/* ── 动效：鼠标拖尾 ── */
.trail-container { position: fixed; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; z-index: 9999; }
.trail-dot {
  position: absolute; border-radius: 50%;
  background: radial-gradient(circle, var(--accent) 0%, var(--primary-light) 60%, transparent 100%);
  filter: blur(0.5px);
}

/* ── 动效：滚动揭示 ── */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s cubic-bezier(.22,.61,.36,1), transform 0.7s cubic-bezier(.22,.61,.36,1);
}
.reveal.revealed { opacity: 1; transform: translateY(0); }

@media (max-width: 480px) {
  .container { padding: 0 16px; }
  .hero h1 { font-size: 1.6rem; }
  .steps   { grid-template-columns: 1fr; }
  .stat-item { flex: 1 1 100%; border-right: none; border-bottom: 1px solid var(--border-light); }
  .tab-nav button { padding: 10px 16px; font-size: .85rem; }
  .subpage-tabs a { padding: 6px 14px; font-size: .82rem; }
}

/* ── 字母头像可选配色（v2.14，顶栏/用户中心通用）──
   仅提供背景渐变，尺寸/圆角/文字由各使用处内联或自有类控制 */
.avatar-style-0 { background: linear-gradient(135deg, #1B4F72, #17A589); }
.avatar-style-1 { background: linear-gradient(135deg, #154360, #2E86C1); }
.avatar-style-2 { background: linear-gradient(135deg, #145A32, #52BE80); }
.avatar-style-3 { background: linear-gradient(135deg, #6C3483, #BB8FCE); }
.avatar-style-4 { background: linear-gradient(135deg, #7B241C, #E74C3C); }
.avatar-style-5 { background: linear-gradient(135deg, #935116, #F39C12); }
.avatar-style-6 { background: linear-gradient(135deg, #1B2631, #5D6D7E); }
.avatar-style-7 { background: linear-gradient(135deg, #0E6251, #1ABC9C); }

/* ════════════════════════════════════════════════════════
   服务大厅 v2.27：全屏入口导航 + 原位面板切换
   ──────────────────────────────────────────────────────── */
/* 全屏绿色首屏（桌面覆盖整视口高，移动端弹性适配） */
.sv-hall {
  height: calc(100vh - var(--header-h));
  height: calc(100svh - var(--header-h));
  height: calc(100dvh - var(--header-h));
  min-height: 0;
  display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(1200px 500px at 85% -10%, rgba(255,255,255,.09), transparent 60%),
    radial-gradient(900px 420px at -10% 110%, rgba(255,255,255,.06), transparent 55%),
    linear-gradient(135deg, #0D3B5E 0%, #1B4F72 40%, #1A6B52 100%);
  color: #fff; position: relative; overflow: hidden;
  padding: clamp(20px, 5vh, 56px) 0 clamp(20px, 6vh, 72px);
}
body[data-page="services"] .sv-hall {
  background-color: #0b314d;
  background-image:
    radial-gradient(1200px 500px at 85% -10%, rgba(255,255,255,.08), transparent 60%),
    linear-gradient(90deg, rgba(8,35,57,.50), rgba(13,59,94,.84) 30%, rgba(13,59,94,.84) 70%, rgba(18,92,79,.46)),
    url('../images/hero-services-v3.png');
  background-size: auto, cover, cover;
  background-position: center;
  background-repeat: no-repeat;
}
.sv-hall::before, .sv-hall::after {
  content: ''; position: absolute; border-radius: 50%; pointer-events: none;
}
.sv-hall::before { width: 420px; height: 420px; top: -160px; right: -120px; background: rgba(255,255,255,.05); }
.sv-hall::after  { width: 300px; height: 300px; bottom: -120px; left: -90px;  background: rgba(255,255,255,.04); }
.sv-hall-inner { width: 100%; max-width: var(--max-width); margin: 0 auto; padding: 0 24px; position: relative; z-index: 1; }

.sv-hall-head { text-align: center; margin-bottom: clamp(16px, 3.5vh, 44px); }
.sv-hall-eyebrow {
  display: inline-block; font-size: .82rem; font-weight: 600; letter-spacing: .12em;
  color: rgba(255,255,255,.75); text-transform: uppercase;
  padding: 4px 16px; border: 1px solid rgba(255,255,255,.28); border-radius: 999px;
  margin-bottom: 18px; background: rgba(255,255,255,.07);
}
.sv-hall h1 { font-size: 3rem; font-weight: 800; color: #fff; letter-spacing: -.01em; margin-bottom: 12px; }
.sv-hall-sub { font-size: 1.15rem; opacity: .85; }

/* 服务大卡网格：桌面 3 列（3×2 正好铺满一屏） */
.sv-hall-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px;
  max-width: 1120px; margin: 0 auto;
}
.sv-card {
  display: flex; align-items: flex-start; gap: 18px;
  background: rgba(255,255,255,.96); color: var(--text);
  border-radius: 20px; padding: 28px 26px; text-decoration: none;
  box-shadow: 0 10px 34px rgba(6, 44, 36, .25);
  transition: transform .25s ease, box-shadow .25s ease;
  position: relative;
}
.sv-card:hover { transform: translateY(-6px); box-shadow: 0 18px 44px rgba(6, 44, 36, .35); }
.sv-card-icon {
  width: 58px; height: 58px; border-radius: 16px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 1.5rem; font-weight: 800;
}
.sv-card-body { display: flex; flex-direction: column; gap: 8px; min-width: 0; flex: 1; }
.sv-card-name { font-size: 1.3rem; font-weight: 800; color: var(--primary-dark); }
.sv-card-desc { font-size: .88rem; color: var(--text-light); line-height: 1.65; }
.sv-card-go {
  position: absolute; right: 20px; top: 50%; transform: translateY(-50%);
  font-size: 1.4rem; color: var(--accent); opacity: .6;
  transition: transform .25s ease, opacity .25s ease;
}
.sv-card:hover .sv-card-go { transform: translate(4px, -50%); opacity: 1; }
.sv-card.active { outline: 3px solid var(--accent-light); outline-offset: 2px; }

.sv-hall-scroll {
  width: max-content; max-width: 100%; margin: clamp(12px, 3vh, 40px) auto 0;
  padding: 8px 18px; border: 1px solid rgba(255,255,255,.34); border-radius: 999px;
  background: rgba(255,255,255,.13); box-shadow: 0 8px 24px rgba(4,35,50,.22);
  backdrop-filter: blur(8px); text-align: center;
  font-size: .92rem; font-weight: 700; letter-spacing: .04em; color: #fff;
  animation: svBounce 2s infinite;
}
@keyframes svBounce { 0%,100% { transform: translateY(0); } 50% { transform: translateY(6px); } }

/* 服务内容切换条（吸顶于导航栏下，便于对号入座后横向切换） */
.sv-contentbar {
  position: sticky; top: var(--header-h); z-index: 950;
  background: rgba(255,255,255,.92); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-light); box-shadow: var(--shadow-sm);
}
.sv-contentbar-in {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  padding-top: 10px; padding-bottom: 10px; overflow-x: auto;
}
.sv-cb-item {
  flex-shrink: 0; padding: 7px 18px; border-radius: 999px;
  font-size: .88rem; font-weight: 600; color: var(--text-light);
  border: 1px solid var(--border); background: #fff; transition: var(--transition);
}
.sv-cb-item:hover { color: var(--primary); border-color: var(--primary-light); }
.sv-cb-item.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.sv-cb-top {
  margin-left: auto; flex-shrink: 0; padding: 7px 14px; font-size: .82rem;
  color: var(--accent-dark); font-weight: 600; border-radius: 999px;
}
.sv-cb-top:hover { background: #E8F8F5; }

/* 服务内容面板：默认仅激活项显示，其余隐藏 */
.sv-panel { display: none; scroll-margin-top: calc(var(--header-h) + 76px); }
.sv-panel.active { display: block; }
/* 面板切换后强制可见：隐藏面板内的 reveal 元素未触发滚动揭示，直接呈现避免空白 */
.sv-panel.active .reveal,
.sv-panel.active .card, .sv-panel.active .service-card,
.sv-panel.active .card-grid > *, .sv-panel.active .step,
.sv-panel.active .section-title, .sv-panel.active .section-subtitle,
.sv-panel.active .product-table-wrap { opacity: 1 !important; transform: none !important; }

/* 桌面 1080p 内 3×2 卡铺满；较小桌面让卡自适应行高 */
@media (max-width: 1100px) {
  .sv-card { padding: 22px 18px; }
  .sv-card-name { font-size: 1.12rem; }
  .sv-card-icon { width: 50px; height: 50px; font-size: 1.25rem; }
  .sv-card-desc { font-size: .8rem; }
  .sv-hall h1 { font-size: 2.4rem; }
}
/* 平板/竖屏：2 列 */
@media (max-width: 820px) {
  .sv-hall { padding: clamp(12px, 3vh, 32px) 0; }
  .sv-hall-inner { padding: 0 16px; }
  .sv-hall-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; }
  .sv-card { padding: 18px 16px; gap: 14px; }
  .sv-card-icon { width: 44px; height: 44px; font-size: 1.1rem; border-radius: 12px; }
  .sv-card-name { font-size: 1rem; }
  .sv-card-desc { font-size: .76rem; }
  .sv-card-go { display: none; }
  .sv-hall-head { margin-bottom: 26px; }
  .sv-hall-eyebrow { font-size: .7rem; margin-bottom: 12px; }
  .sv-hall h1 { font-size: 1.9rem; margin-bottom: 8px; }
  .sv-hall-sub { font-size: .9rem; }
  .sv-hall-scroll { margin-top: 24px; font-size: .78rem; }
}
/* 手机窄屏：2 列小卡保持入口感（desc 限两行） */
@media (max-width: 480px) {
  .sv-card-desc { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .sv-card { border-radius: 14px; }
  .sv-contentbar-in { flex-wrap: nowrap; }
}

@media (prefers-reduced-motion: reduce) {
  .sv-hall-scroll { animation: none; }
}

/* 低视口（小笔记本、横屏手机）：压缩装饰留白，确保六个入口始终完整落在首屏内。 */
@media (max-height: 760px) {
  .sv-hall { padding-top: 14px; padding-bottom: 14px; }
  .sv-hall-head { margin-bottom: 14px; }
  .sv-hall-eyebrow { margin-bottom: 8px; padding-top: 2px; padding-bottom: 2px; }
  .sv-hall h1 { font-size: 2rem; margin-bottom: 4px; }
  .sv-hall-sub { font-size: .88rem; line-height: 1.4; }
  .sv-hall-grid { gap: 12px; }
  .sv-card { padding: 14px 16px; gap: 12px; border-radius: 14px; }
  .sv-card-icon { width: 42px; height: 42px; border-radius: 11px; font-size: 1.05rem; }
  .sv-card-body { gap: 2px; }
  .sv-card-name { font-size: 1rem; }
  .sv-card-desc { font-size: .75rem; line-height: 1.35; }
  .sv-hall-scroll { margin-top: 10px; font-size: .72rem; }
}

/* 横屏窄设备改回 3×2；隐藏说明文字，为触控入口保留足够尺寸。 */
@media (max-width: 1024px) and (max-height: 520px) {
  .sv-hall-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .sv-hall-head { margin-bottom: 8px; }
  .sv-hall-eyebrow { display: none; }
  .sv-hall h1 { font-size: 1.45rem; }
  .sv-hall-sub { font-size: .76rem; }
  .sv-card { min-height: 58px; padding: 8px 10px; align-items: center; }
  .sv-card-icon { width: 36px; height: 36px; font-size: .9rem; }
  .sv-card-desc { display: none; }
  .sv-hall-scroll { display: none; }
}

/* 极窄手机进一步收紧列间距，避免英文服务名撑破卡片。 */
@media (max-width: 360px) {
  .sv-hall-inner { padding: 0 10px; }
  .sv-hall-grid { gap: 8px; }
  .sv-card { padding-left: 10px; padding-right: 10px; gap: 8px; }
  .sv-card-icon { width: 36px; height: 36px; font-size: .9rem; }
  .sv-card-name { font-size: .9rem; }
}
