/* ============================================================
 * HyTdb 疏水标签降解剂数据库管理系统 V1.0
 * 模块：css/style.css
 * 职责：前台全站样式（深墨绿配琥珀金点缀的科学数据库风格）
 * 版权：本文件为原创实现，著作权归权利人所有。
 * 第三方：开源组件统一存放于 vendor/，许可证见
 *         vendor/THIRD-PARTY-LICENSES.txt。
 * ============================================================ */

@font-face {
  font-family: "Noto Serif";
  src: url("../vendor/fonts/noto-serif-400.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Noto Serif";
  src: url("../vendor/fonts/noto-serif-700.woff2") format("woff2");
  font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Noto Sans";
  src: url("../vendor/fonts/noto-sans-400.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Noto Sans";
  src: url("../vendor/fonts/noto-sans-600.woff2") format("woff2");
  font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Noto Sans Mono";
  src: url("../vendor/fonts/noto-sans-mono-400.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}

:root {
  --ink: #12312e;
  --ink-2: #1d4a45;
  --teal: #167782;
  --teal-dark: #0e5a63;
  --amber: #d9a441;
  --amber-soft: #f4e3bd;
  --bg: #f7f5ef;
  --paper: #fffdf8;
  --line: #e3ddd0;
  --text: #2b2b26;
  --muted: #7a7568;
  --danger: #b4452f;
  --radius: 10px;
  --shadow: 0 2px 10px rgba(18, 49, 46, .08), 0 12px 32px rgba(18, 49, 46, .10);
  --serif: "Noto Serif", "Noto Serif SC", Georgia, "Songti SC", "SimSun", serif;
  --sans: "Noto Sans", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  --mono: "Noto Sans Mono", "Noto Sans SC", "Cascadia Code", Consolas, "Courier New", monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  font-family: var(--sans);
  color: var(--text);
  background: var(--bg);
  line-height: 1.65;
  font-size: 15px;
}
a { color: var(--teal); text-decoration: none; }
a:hover { color: var(--teal-dark); }
.container { max-width: 1180px; margin: 0 auto; padding: 0 24px; }

/* ---------- 顶部导航 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 100;
  background: var(--ink);
  color: #fff;
  box-shadow: 0 2px 12px rgba(0,0,0,.25);
}
.topbar .container { display: flex; align-items: center; height: 60px; gap: 28px; }
.brand {
  font-family: var(--serif);
  font-size: 22px; font-weight: 700; letter-spacing: .5px;
  color: #fff; display: flex; align-items: center; gap: 10px;
}
.brand .dot { width: 12px; height: 12px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 0 4px rgba(217,164,65,.25); }
.brand em { font-style: normal; color: var(--amber); }
.nav { display: flex; gap: 4px; margin-left: auto; }
.nav a {
  color: #cfe3e0; padding: 8px 16px; border-radius: 6px;
  font-size: 14.5px; transition: background .15s, color .15s;
}
.nav a:hover { background: rgba(255,255,255,.10); color: #fff; }
.nav a.active { background: var(--teal); color: #fff; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 430px;
  display: flex; align-items: center;
  overflow: hidden;
  background: var(--ink) url("https://trae-api-cn.mchost.guru/api/ide/v1/text_to_image?prompt=dark%20green%20scientific%20research%20banner%20background%2C%20glowing%20molecular%20structures%20and%20hexagonal%20benzene%20rings%20connected%20by%20chemical%20bonds%2C%20subtle%20protein%20ribbon%20silhouette%2C%20laboratory%20bokeh%20lights%2C%20deep%20teal%20with%20warm%20amber%20accents%2C%20wide%20composition%2C%20professional%20pharmaceutical%20atmosphere%2C%20high%20detail%20digital%20art&image_size=landscape_16_9") center / cover no-repeat;
}
.hero::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(12,36,34,.60), rgba(12,36,34,.86));
  pointer-events: none;
}
.hero .container { position: relative; z-index: 2; width: 100%; }
.hero-title {
  font-family: var(--serif);
  color: #fff; font-size: 42px; line-height: 1.2;
  text-align: center; margin-bottom: 6px;
  text-shadow: 0 2px 18px rgba(0,0,0,.45);
}
.hero-sub { color: #cfe3e0; text-align: center; font-size: 15.5px; margin-bottom: 30px; }

/* 搜索框 */
.search-wrap { max-width: 860px; margin: 0 auto; }
.search-bar {
  display: flex; background: var(--paper);
  border-radius: 999px;
  box-shadow: 0 10px 40px rgba(0,0,0,.35);
  border: 2px solid rgba(217,164,65,.55);
}
/* 自定义下拉（搜索类型） */
.cs-select { position: relative; }
.cs-trigger {
  border: none; outline: none; cursor: pointer;
  background: transparent; color: var(--ink);
  padding: 0 16px 0 22px; font-size: 14.5px; font-family: var(--sans);
  border-radius: 999px 0 0 999px;
  border-right: 1px solid var(--line);
  display: flex; align-items: center; gap: 9px; white-space: nowrap;
  margin: -2px 0 -2px -2px; /* 覆盖容器描边，消除边缘溢出 */
  transition: background .15s;
}
.cs-trigger:hover, .cs-select.open .cs-trigger { background: rgba(18,49,46,.06); }
.cs-trigger svg { transition: transform .2s; color: var(--amber); }
.cs-select.open .cs-trigger svg { transform: rotate(180deg); }
.cs-menu {
  position: absolute; top: calc(100% + 12px); left: 8px; z-index: 60;
  min-width: calc(100% + 28px); width: max-content;
  background: var(--paper); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 16px 44px rgba(10,25,23,.28);
  padding: 6px;
  opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: opacity .16s, transform .16s, visibility .16s;
}
.cs-select.open .cs-menu { opacity: 1; visibility: visible; transform: none; }
.cs-option {
  display: flex; align-items: center;
  padding: 9px 16px; border-radius: 8px;
  font-size: 14px; color: var(--text); cursor: pointer; white-space: nowrap;
}
.cs-option:hover { background: #eef4f3; }
.cs-option.selected { color: var(--teal-dark); font-weight: 600; background: rgba(22,119,130,.09); }
.cs-option.selected::after {
  content: "✓"; margin-left: auto; padding-left: 18px;
  color: var(--teal); font-weight: 700;
}
.search-bar input {
  flex: 1; border: none; outline: none;
  padding: 15px 20px; font-size: 15.5px; background: transparent;
  font-family: var(--sans); min-width: 0;
}
.search-bar button {
  border: none; cursor: pointer;
  background: var(--teal); color: #fff;
  padding: 0 24px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 0 999px 999px 0;
  margin: -2px -2px -2px 0; /* 覆盖容器描边，消除边缘溢出 */
  transition: background .15s;
}
.search-bar button svg { display: block; }
.search-bar button:hover { background: var(--teal-dark); }
.search-actions { display: flex; justify-content: center; gap: 14px; margin-top: 18px; }
.btn-draw {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,.12); color: #fff;
  border: 1.5px solid rgba(255,255,255,.65);
  padding: 10px 26px; border-radius: 999px;
  font-size: 14.5px; cursor: pointer; backdrop-filter: blur(4px);
  transition: background .15s, transform .15s;
}
.btn-draw:hover { background: rgba(255,255,255,.25); transform: translateY(-1px); }

/* ---------- 统计条 ---------- */
.stats {
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}
.stats .container { display: flex; justify-content: center; gap: 90px; padding: 26px 24px; flex-wrap: wrap; }
.stat-item { text-align: center; }
.stat-num { font-family: var(--serif); font-size: 38px; font-weight: 700; color: var(--teal); line-height: 1.1; }
.stat-label { color: var(--muted); font-size: 13.5px; letter-spacing: .4px; margin-top: 2px; }

/* ---------- 区块通用 ---------- */
.section { padding: 46px 0; }
.section-title {
  font-family: var(--serif);
  font-size: 27px; color: var(--ink);
  margin-bottom: 6px; display: flex; align-items: center; gap: 12px;
}
.section-title::before { content: ""; width: 6px; height: 26px; background: var(--amber); border-radius: 3px; }
.section-desc { color: var(--muted); margin-bottom: 24px; max-width: 760px; }

/* ---------- 化合物结构缩略图 / 单元格（tr.cmp-card 是数据表里的一行） ---------- */
.cmp-struct {
  background: #fff;
  display: flex; align-items: center; justify-content: center;
}
.cmp-name { font-family: var(--serif); font-size: 19px; font-weight: 700; color: var(--ink); }
.cmp-id { font-size: 12px; color: var(--muted); font-family: var(--mono); }
.cmp-row { font-size: 13.8px; }
.cmp-row .k { color: var(--muted); white-space: nowrap; }
.cmp-row .v { color: var(--text); word-break: break-word; }
.tag-chip {
  display: inline-block; background: var(--amber-soft); color: #7a5410;
  border-radius: 999px; padding: 1px 10px; font-size: 12.5px;
}
.poi-chip {
  display: inline-block; background: #dcefef; color: var(--teal-dark);
  border-radius: 999px; padding: 1px 10px; font-size: 12.5px;
  white-space: nowrap;   /* 列较窄时 chip 内文字不折行 */
}
/* 一个化合物有多个 POI 时并排显示：POI 格用 flex + nowrap，
   列宽交给 chip 内容撑开，多个 chip 始终排在同一行、间距一致，不再上下堆叠 */
.cmp-row .v .poi-chip { margin: 0 4px 2px 0; }
.cmp-row.cmp-poi .v { display: flex; flex-wrap: nowrap; gap: 6px; align-items: center; }
.cmp-row.cmp-poi .v .poi-chip { margin: 0; }

/* ---------- 页脚 ---------- */
.footer {
  background: var(--ink); color: #9fbdb9;
  padding: 44px 0 0; margin-top: 40px; font-size: 13.5px;
}
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1.3fr; gap: 44px; padding-bottom: 32px; }
.footer h4 {
  color: #fff; font-family: var(--serif); font-size: 15.5px;
  margin-bottom: 14px; letter-spacing: .3px;
}
.footer p { max-width: 380px; }
.footer ul { list-style: none; }
.footer ul li { margin-bottom: 9px; }
.footer a { color: #cfe3e0; }
.footer a:hover { color: #fff; }
.footer-brand { font-family: var(--serif); font-size: 21px; color: #fff; margin-bottom: 10px; }
.footer-brand em { font-style: normal; color: var(--amber); }
.contact-item { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 10px; }
.contact-item svg { flex: none; margin-top: 3px; color: var(--amber); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.12); padding: 15px 0; font-size: 12.5px; color: #7fa8a2; }

/* ---------- Ketcher 弹窗（结构搜索） ---------- */
.kmodal-mask {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(10, 25, 23, .62);
  display: none; align-items: center; justify-content: center;
  backdrop-filter: blur(3px);
}
.kmodal-mask.open { display: flex; }
.kmodal {
  background: #2e3436; border-radius: 14px;
  width: min(1020px, 94vw);
  box-shadow: 0 30px 80px rgba(0,0,0,.5);
  overflow: hidden;
}
.kmodal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px; color: #fff;
}
.kmodal-head h3 { font-family: var(--serif); font-size: 18px; font-weight: 600; }
.kmodal-close {
  background: none; border: none; color: #aab3b5; font-size: 26px;
  cursor: pointer; line-height: 1; padding: 0 4px;
}
.kmodal-close:hover { color: #fff; }
.kmodal-frame-wrap { background: #fff; height: min(560px, 62vh); }
.kmodal-frame-wrap iframe { width: 100%; height: 100%; border: none; display: block; }
.kmodal-foot {
  padding: 14px 20px; display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
}
.kmodal-foot .match-group { display: flex; gap: 16px; color: #d7dcdd; font-size: 14px; align-items: center; }
.kmodal-foot .match-group label { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.kmodal-foot .match-group input { accent-color: var(--teal); }
.kmodal-foot .spacer { flex: 1; }
.kmodal-foot .hint { color: #8b9597; font-size: 12.5px; width: 100%; }
.btn {
  border: none; cursor: pointer; border-radius: 8px;
  padding: 10px 26px; font-size: 14.5px; font-weight: 600;
  transition: filter .15s, transform .1s;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--teal); color: #fff; }
.btn-primary:hover { filter: brightness(1.1); }
.btn-ghost { background: transparent; color: #d7dcdd; border: 1px solid #5a6467; }
.btn-ghost:hover { border-color: #9fb3b5; color: #fff; }

/* ---------- 结果提示条 ---------- */
.result-note {
  display: none; margin-bottom: 18px; padding: 12px 18px;
  background: var(--amber-soft); border: 1px solid #e3cf9d;
  border-radius: 8px; font-size: 14px; color: #6b4e12;
}
.result-note.show { display: flex; align-items: center; gap: 14px; }
.result-note button { margin-left: auto; background: none; border: 1px solid #b99a55; color: #6b4e12; border-radius: 6px; padding: 3px 12px; cursor: pointer; font-size: 13px; }

/* ---------- 详情页 ---------- */
.detail-head { padding: 40px 0 10px; }
.detail-head h1 { font-family: var(--serif); font-size: 36px; color: var(--ink); }
.detail-head .sub { color: var(--muted); font-family: var(--mono); font-size: 13.5px; margin-top: 4px; }
.panel {
  background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 26px 28px; margin-bottom: 26px;
  box-shadow: 0 1px 4px rgba(18,49,46,.05);
}
.panel h2 {
  font-family: var(--serif); font-size: 21px; color: var(--ink);
  margin-bottom: 18px; padding-bottom: 10px; border-bottom: 2px solid var(--amber);
  display: flex; align-items: center; gap: 10px;
}
.panel h3 { font-size: 16px; color: var(--ink-2); margin: 18px 0 10px; }
.kv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 8px 26px; }
.kv { display: flex; gap: 10px; font-size: 14px; padding: 6px 0; border-bottom: 1px dashed #ece6d8; }
.kv .k { color: var(--muted); min-width: 130px; }
.kv .v { word-break: break-all; font-family: var(--mono); font-size: 13px; }
.kv .v.text { font-family: var(--sans); font-size: 14px; }
.struct-flex { display: flex; gap: 26px; flex-wrap: wrap; align-items: flex-start; }
.struct-box {
  background: #fff; border: 1px solid var(--line); border-radius: 8px;
  padding: 12px; text-align: center; min-width: 240px;
}
.struct-box .cap { font-size: 13px; color: var(--muted); margin-top: 8px; }
.struct-box svg { max-width: 100%; height: auto; }
.subentry {
  border: 1px solid var(--line); border-radius: 8px;
  padding: 16px 18px; margin-bottom: 14px; background: #fbfaf5;
}
.subentry .seq {
  font-family: var(--mono); font-size: 12px; word-break: break-all;
  background: #fff; border: 1px solid var(--line); border-radius: 6px;
  padding: 10px 12px; max-height: 110px; overflow: auto; color: #555;
}
table.data-table { width: 100%; border-collapse: collapse; font-size: 13.5px; margin-top: 6px; }
table.data-table th, table.data-table td {
  border: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top;
}
table.data-table th { background: #efe9db; color: var(--ink); font-weight: 600; }
/* 表格滚动容器：窄屏下宽表（如 11 列 PK 表）内部横向滚动，不撑破页面 */
.table-scroll { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.viewer3d {
  width: 100%; height: 420px; position: relative;
  border: 1px solid var(--line); border-radius: 8px; background: #101d1b;
  margin-top: 8px;
}
.viewer3d .loading3d {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: #7fa8a2; font-size: 14px; z-index: 0;
}
.radar-wrap { max-width: 420px; margin: 0 auto; }
.remark-box {
  background: #fbf6ea; border: 1px dashed #d9c389; border-radius: 8px;
  padding: 14px 18px; font-size: 14px; color: #6b5a2e;
}
.badge-ok { color: #1c7a4d; font-weight: 600; }
.badge-warn { color: var(--danger); font-weight: 600; }

/* ---------- 静态页面 ---------- */
.prose { max-width: 860px; }
.prose h3 { font-family: var(--serif); color: var(--ink); font-size: 19px; margin: 26px 0 10px; }
.prose p, .prose li { color: var(--text); font-size: 15px; }
.prose ul { padding-left: 22px; }
.prose code { background: #efe9db; padding: 1px 6px; border-radius: 4px; font-family: var(--mono); font-size: 13px; }

.btane {
    background: transparent !important;
    color: #4c4c4c !important;
    padding-top: 20px !important;
}

/* ---------- 在线表单 ---------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 22px; }
.form-field { display: flex; flex-direction: column; gap: 6px; }
.form-field.full { grid-column: 1 / -1; }
.form-field label { font-size: 13.5px; font-weight: 600; color: var(--ink-2); }
.form-field label .req { color: var(--danger); margin-left: 2px; }
.form-field input, .form-field select, .form-field textarea {
  border: 1px solid var(--line); border-radius: 8px;
  padding: 10px 14px; font-size: 14.5px; font-family: var(--sans);
  background: #fff; color: var(--text); outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.form-field input:focus, .form-field select:focus, .form-field textarea:focus {
  border-color: var(--teal); box-shadow: 0 0 0 3px rgba(22,119,130,.12);
}
.form-field textarea { resize: vertical; min-height: 110px; }
.form-msg { display: none; padding: 12px 16px; border-radius: 8px; font-size: 14px; margin-top: 14px; }
.form-msg.ok { display: block; background: #e3f2ea; color: #1c7a4d; border: 1px solid #bfe0cd; }
.form-msg.err { display: block; background: #fbe9e4; color: var(--danger); border: 1px solid #f0c5b8; }

/* ---------- About / Help 美化 ---------- */
.page-hero {
  background: linear-gradient(135deg, var(--ink) 0%, var(--ink-2) 60%, var(--teal-dark) 100%);
  color: #fff; padding: 56px 0 46px; position: relative; overflow: hidden;
}
.page-hero::before {
  content: ""; position: absolute; right: -80px; top: -80px;
  width: 320px; height: 320px; border-radius: 50%;
  background: radial-gradient(circle, rgba(217,164,65,.25), transparent 70%);
}
.page-hero::after {
  content: ""; position: absolute; left: 8%; bottom: -120px;
  width: 260px; height: 260px; border-radius: 50%;
  background: radial-gradient(circle, rgba(79,179,191,.22), transparent 70%);
}
.page-hero h1 { font-family: var(--serif); font-size: 36px; position: relative; z-index: 1; }
.page-hero p { color: #b9d4d0; margin-top: 8px; max-width: 640px; position: relative; z-index: 1; }
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; margin: 26px 0; }
.feature-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px 20px; transition: transform .18s, box-shadow .18s;
}
.feature-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.feature-icon {
  width: 44px; height: 44px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--teal), var(--teal-dark));
  color: #fff; margin-bottom: 12px;
}
.feature-card h4 { font-family: var(--serif); font-size: 16.5px; color: var(--ink); margin-bottom: 6px; }
.feature-card p { font-size: 13.8px; color: var(--muted); }
.faq-item { border: 1px solid var(--line); border-radius: 8px; margin-bottom: 12px; overflow: hidden; background: #fff; }
.faq-q {
  width: 100%; text-align: left; background: none; border: none; cursor: pointer;
  padding: 15px 20px; font-size: 15px; font-weight: 600; color: var(--ink);
  display: flex; justify-content: space-between; align-items: center; font-family: var(--sans);
}
.faq-q::after { content: "+"; font-size: 20px; color: var(--teal); transition: transform .2s; }
.faq-item.open .faq-q::after { transform: rotate(45deg); }
.faq-a { display: none; padding: 0 20px 16px; font-size: 14px; color: var(--text); }
.faq-item.open .faq-a { display: block; }
.faq-a ul { padding-left: 20px; }

/* ---------- 图文混排（About 页） ---------- */
.media-row { display: flex; gap: 44px; align-items: center; margin: 40px 0; }
.media-row.reverse { flex-direction: row-reverse; }
.media-img {
  flex: 0 0 42%; border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); border: 1px solid var(--line);
}
.media-img img { width: 100%; display: block; }
.media-text { flex: 1; }
.media-text h3 { font-family: var(--serif); font-size: 23px; color: var(--ink); margin-bottom: 10px; }
.media-text p { color: var(--text); font-size: 15px; margin-bottom: 8px; }
.tech-strip { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.tech-chip {
  background: var(--paper); border: 1px solid var(--line); border-radius: 999px;
  padding: 4px 16px; font-size: 13px; color: var(--ink-2); font-family: var(--mono);
}

/* ---------- 首页 Featured 3D 分子 ---------- */
.mol3d-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.mol3d-card {
  background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
  transition: transform .18s, box-shadow .18s;
}
.mol3d-card:hover { transform: translateY(-3px); }
.mini3d {
  position: relative; height: 240px; cursor: grab;
  background: radial-gradient(circle at 50% 42%, #ffffff 0%, #eef4f2 100%);
}
.mini3d:active { cursor: grabbing; }
.mol3d-info {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 12px 16px; border-top: 1px solid var(--line);
}
.mol3d-name { font-family: var(--serif); font-size: 16.5px; font-weight: 700; color: var(--ink); }
.mol3d-formula { font-family: var(--mono); font-size: 13px; color: var(--muted); }

/* ---------- 首页 About 左右布局 + 浮动图 ---------- */
.about-split { display: flex; align-items: center; gap: 56px; }
.about-text { flex: 1.15; }
.about-text .section-desc { margin-bottom: 0; }
.about-fig { flex: 1; }
.about-fig img {
  width: 100%; display: block;
  border-radius: 14px; box-shadow: 0 18px 50px rgba(18,49,46,.22);
  animation: floaty 5.5s ease-in-out infinite;
}
@keyframes floaty {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-14px); }
}

/* ---------- 右下角悬浮按钮 ---------- */
.float-btns {
  position: fixed; right: 22px; bottom: 26px; z-index: 90;
  display: flex; flex-direction: column; gap: 10px;
}
.float-btn {
  width: 46px; height: 46px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--paper); color: var(--ink-2);
  border: 1px solid var(--line); box-shadow: var(--shadow);
  cursor: pointer; text-decoration: none; padding: 0;
  transition: background .18s, color .18s, transform .18s, opacity .25s, visibility .25s;
}
.float-btn:hover { background: var(--teal); color: #fff; border-color: var(--teal); transform: translateY(-3px); }
.float-btn.btn-top { opacity: 0; visibility: hidden; transform: translateY(8px); }
.float-btn.btn-top.show { opacity: 1; visibility: visible; transform: none; }

/* ---------- 首页 News 新闻（一排 3 个卡片，含图，可点击进详情） ---------- */
.news-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.news-card {
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  text-decoration: none; color: inherit;
  transition: transform .2s, box-shadow .2s, border-color .2s;
}
.news-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--amber); }
.news-thumb { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: var(--ink); }
.news-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .45s ease; }
.news-card:hover .news-thumb img { transform: scale(1.06); }
.news-badge {
  position: absolute; left: 12px; top: 12px;
  background: rgba(18,49,46,.82); color: #fff;
  border-radius: 999px; padding: 2px 12px; font-size: 11.5px; letter-spacing: .4px;
  backdrop-filter: blur(4px);
}
.news-info { padding: 16px 18px 18px; display: flex; flex-direction: column; flex: 1; }
.news-meta { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.news-cat {
  background: var(--amber-soft); color: #7a5410;
  border-radius: 999px; padding: 1px 10px; font-size: 11.5px; font-weight: 600;
}
.news-date { font-size: 12px; color: var(--muted); font-family: var(--mono); }
.news-info h4 {
  font-family: var(--serif); font-size: 16.5px; line-height: 1.4;
  color: var(--ink); margin-bottom: 8px;
}
.news-info p { font-size: 13.5px; color: var(--muted); flex: 1; }
.news-more { margin-top: 12px; font-size: 13.5px; font-weight: 600; color: var(--teal); }
.news-card:hover .news-more { color: var(--amber); }

/* ---------- Browse 筛选页 ---------- */
.browse-layout { display: flex; gap: 26px; align-items: flex-start; }
.facet-panel {
  flex: 0 0 264px; position: sticky; top: 76px;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 20px 20px; max-height: calc(100vh - 96px); overflow: auto;
}
.facet-panel h3 { font-family: var(--serif); font-size: 16.5px; color: var(--ink); margin-bottom: 4px; }
.facet-group { border-bottom: 1px dashed var(--line); padding: 12px 0; }
.facet-group:last-of-type { border-bottom: none; }
.facet-title { font-size: 13px; font-weight: 600; color: var(--muted); letter-spacing: .5px; text-transform: uppercase; margin-bottom: 8px; }
.facet-list { display: flex; flex-direction: column; gap: 2px; }
.facet-opt { display: flex; align-items: center; gap: 8px; font-size: 14px; padding: 5px 0; cursor: pointer; color: var(--text); }
.facet-opt input { accent-color: var(--teal); cursor: pointer; }
.facet-opt .cnt { margin-left: auto; color: var(--muted); font-size: 12.5px; font-family: var(--mono); }
.facet-clear {
  width: 100%; margin-top: 12px; padding: 8px; cursor: pointer;
  background: none; border: 1px solid var(--line); border-radius: 8px;
  color: var(--ink-2); font-size: 13.5px; font-family: var(--sans);
}
.facet-clear:hover { border-color: var(--teal); color: var(--teal); }
.browse-main { flex: 1; min-width: 0; }
.browse-toolbar {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 18px; margin-bottom: 18px; font-size: 14px;
}
.browse-toolbar .count { color: var(--muted); }
.browse-toolbar .count strong { color: var(--teal); font-size: 16px; }
.browse-toolbar .spacer { flex: 1; }
/* 浏览页关键词搜索框：与首页搜索联动，关键词写在 URL 的 ?q= 里 */
#browse-search {
  flex: 1 1 220px; min-width: 180px; max-width: 320px;
  padding: 7px 12px; border: 1px solid var(--line); border-radius: 8px;
  font-family: var(--sans); font-size: 13.5px; color: var(--ink); background: var(--paper);
}
#browse-search:focus { outline: none; border-color: var(--teal); }
.btn-outline {
  border: 1.5px solid var(--teal); color: var(--teal); background: transparent;
  border-radius: 8px; padding: 7px 16px; font-size: 13.5px; font-weight: 600; cursor: pointer;
  font-family: var(--sans); transition: background .15s, color .15s;
}
.btn-outline:hover { background: var(--teal); color: #fff; }
.btn-outline:disabled { opacity: .45; cursor: not-allowed; }
.btn-outline:disabled:hover { background: transparent; color: var(--teal); }

/* ---------- 化合物数据表（浏览页 / 首页搜索结果） ---------- */
/* 固定高度 + 双轴滚动：这样列标题（吸顶）、纵向滚动条和横向滚动条能同屏出现，
   不用先滚到底再滚回去看表头。 */
.cmp-table-wrap {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  max-height: 68vh; overflow: auto;
}
table.cmp-table { margin-top: 0; min-width: 1180px; }
table.cmp-table th, table.cmp-table td { vertical-align: middle; padding: 9px 12px; }
table.cmp-table thead th {
  font-size: 12.5px; white-space: nowrap;
  position: sticky; top: 0; z-index: 3;
  background: var(--paper); box-shadow: inset 0 -1px 0 var(--line);
}
table.cmp-table thead th.sortable { cursor: pointer; user-select: none; }
table.cmp-table thead th.sortable:hover { background: #e5ddc9; }
.cmp-table th.sortable::after { content: "↕"; margin-left: 5px; opacity: .3; font-size: 11px; }
.cmp-table th[aria-sort="ascending"]::after { content: "↑"; margin-left: 5px; font-size: 11px; color: var(--teal); }
.cmp-table th[aria-sort="descending"]::after { content: "↓"; margin-left: 5px; font-size: 11px; color: var(--teal); }
table.cmp-table tbody tr:hover { background: #fbf8f1; }
table.cmp-table tbody tr.is-selected { background: #e9f5f5; }
.cmp-table .col-sel { width: 42px; text-align: center; }
.cmp-table .col-sel input { width: 16px; height: 16px; accent-color: var(--teal); cursor: pointer; }
.cmp-table .col-struct { width: 170px; }
.cmp-table .cmp-struct { height: auto; border: 0; padding: 0; }
/* 不给 svg 加 max-width —— 否则结构列会被自动布局压窄、SVG 被拉扁 */
.cmp-table .cmp-struct svg { width: 138px; height: 82px; }
.cmp-table .cmp-id { font-family: var(--mono); font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.cmp-table .col-name a { text-decoration: none; }
.cmp-table .col-name .cmp-name { font-family: var(--sans); font-size: 14px; font-weight: 600; }
.cmp-table .col-name a:hover .cmp-name { color: var(--teal); }
/* 列标题已经写明含义，单元格里只显示值；隐藏的 .k 标签留给 CSV / SDF 导出解析 */
/* 注意：td 上带着 .cmp-row 类（导出/活性清洗都解析它），必须保持 table-cell，不能 block */
.cmp-table td.cmp-row { font-size: 13.5px; }
.cmp-table .cmp-row .k { display: none; }
.cmp-table .col-detail { white-space: nowrap; }
.cmp-table .btn-detail {
  display: inline-block; border: 1.5px solid var(--teal); color: var(--teal);
  border-radius: 6px; padding: 4px 12px; font-size: 12.5px; font-weight: 600; text-decoration: none;
}
.cmp-table .btn-detail:hover { background: var(--teal); color: #fff; }
.score-chip {
  display: inline-block; margin-left: 6px; background: #dcefef; color: var(--teal-dark);
  border-radius: 999px; padding: 1px 9px; font-size: 12px; font-family: var(--mono);
}

.sel-count { color: var(--muted); font-size: 13.5px; }
.sel-count strong { color: var(--teal); }

/* ---------- 首页：Compound Browser 卡片条 ----------
   注意：浏览页的数据表行也带着 .cmp-card 类，所以卡片布局必须作用域到
   .card-strip，不能写裸 .cmp-card，否则会把 <tr> 变成 flex 容器、表格塌掉。 */
.card-strip {
  display: flex; gap: 22px; overflow-x: auto; padding: 4px 4px 16px;
  scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch;
}
.card-strip .cmp-card,
.card-grid .cmp-card {
  display: flex; flex-direction: column;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: 0 1px 4px rgba(18,49,46,.06);
  transition: transform .18s, box-shadow .18s;
}
.card-strip .cmp-card { flex: 0 0 320px; scroll-snap-align: start; }
.card-strip .cmp-card:hover, .card-grid .cmp-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.card-strip::-webkit-scrollbar { height: 8px; }
.card-strip::-webkit-scrollbar-thumb { background: #d8d2c4; border-radius: 999px; }
.card-strip::-webkit-scrollbar-track { background: transparent; }

.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 22px; }
/* .card-grid 声明了 display:grid，会盖掉 [hidden] 的 display:none，需要显式还原 */
.card-grid[hidden] { display: none; }
.card-strip .cmp-struct,
.card-grid .cmp-struct { height: 190px; border-bottom: 1px solid var(--line); padding: 8px; }
.cmp-body { padding: 16px 18px 18px; flex: 1; display: flex; flex-direction: column; gap: 8px; }
.cmp-link { margin-top: auto; padding-top: 10px; font-size: 13.5px; font-weight: 600; }
.cmp-link.is-demo { color: var(--muted); font-weight: 500; opacity: .7; }
.card-strip .cmp-row,
.card-grid .cmp-row { display: flex; gap: 8px; }

/* 卡片视图（浏览页）—— 右上角勾选框 */
.card-grid .cmp-card { position: relative; }
.card-grid .cmp-card.is-selected { outline: 2px solid var(--teal); outline-offset: -2px; }
.card-sel {
  position: absolute; top: 10px; right: 10px; z-index: 2;
  background: var(--paper); border: 1px solid var(--line); border-radius: 6px;
  padding: 3px 6px; line-height: 0;
}
.card-sel input { width: 16px; height: 16px; accent-color: var(--teal); cursor: pointer; margin: 0; }

/* 浏览页：下载范围提示 */
.dl-hint { color: var(--muted); font-size: 12.5px; margin: 8px 0 12px; }
.btn-detail.is-demo { opacity: .45; cursor: default; }

/* ---------- 首页：年发文量柱状图（整宽） + 横向发展历程 ---------- */
.year-chart-wrap { position: relative; height: 300px; }
.sub-title {
  font-family: var(--serif); font-size: 19px; color: var(--ink);
  margin: 34px 0 6px; padding-left: 12px; border-left: 4px solid var(--amber);
}
.timeline-scroll { overflow-x: auto; padding-bottom: 10px; }
.timeline-scroll::-webkit-scrollbar { height: 8px; }
.timeline-scroll::-webkit-scrollbar-thumb { background: #d8d2c4; border-radius: 999px; }
.timeline-scroll::-webkit-scrollbar-track { background: transparent; }
/* 横向时间轴：一条贯穿的渐变轴线 + 每个节点一个圆点，窄屏横向滚动 */
.timeline-h {
  position: relative; display: flex; gap: 24px; list-style: none;
  width: max-content; min-width: 100%; padding: 30px 4px 8px;
}
.timeline-h::before {
  content: ""; position: absolute; left: 6px; right: 6px; top: 36px; height: 2px;
  background: linear-gradient(90deg, var(--amber), var(--teal)); border-radius: 2px;
}
/* 4 个节点在桌面宽度下正好铺满一行（4×262 + 3×24 < 1132），更窄再横向滚动 */
.timeline-h .tl-item { position: relative; flex: 0 0 262px; padding-top: 26px; }
.timeline-h .tl-item::before {
  content: ""; position: absolute; left: 2px; top: 0;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--paper); border: 3px solid var(--teal);
  box-shadow: 0 0 0 4px rgba(22,119,130,.12);
}
.timeline-h .tl-year { font-family: var(--serif); font-size: 20px; font-weight: 700; color: var(--teal); line-height: 1.2; }
.timeline-h .tl-title { font-family: var(--serif); font-size: 16.5px; color: var(--ink); margin: 2px 0 5px; }
.timeline-h .tl-text { font-size: 13.5px; color: var(--muted); margin: 0; }
.timeline-h .tl-ref { display: inline-block; margin-top: 6px; font-size: 12px; font-family: var(--mono); }

/* ---------- 首页：Compound Browser 区块标题 ---------- */
.section-title.with-link { justify-content: flex-start; }
.section-title .title-link {
  margin-left: auto; font-family: var(--sans); font-size: 14px; font-weight: 600;
  color: var(--teal); white-space: nowrap;
}
.section-title .title-link:hover { color: var(--amber); }

/* ---------- 筛选条件总览页（filters.html） ---------- */
.filters-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; }
.filter-card {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 20px 20px; box-shadow: 0 1px 4px rgba(18,49,46,.06);
}
.filter-card h3 { font-family: var(--serif); font-size: 17px; color: var(--ink); margin-bottom: 4px; }
.filter-card .filter-hint { font-size: 12.5px; color: var(--muted); margin-bottom: 12px; }
.filter-opts { display: flex; flex-wrap: wrap; gap: 8px; }
.filter-opt {
  display: inline-flex; align-items: center; gap: 7px; cursor: pointer;
  border: 1px solid var(--line); background: #fff; border-radius: 999px;
  padding: 6px 14px; font-size: 13.5px; color: var(--text);
  transition: border-color .15s, background .15s, color .15s;
}
.filter-opt:hover { border-color: var(--teal); }
.filter-opt input { accent-color: var(--teal); cursor: pointer; margin: 0; }
.filter-opt.on { border-color: var(--teal); background: rgba(22,119,130,.08); color: var(--teal-dark); font-weight: 600; }
.filter-opt .cnt { color: var(--muted); font-family: var(--mono); font-size: 12px; }
.filter-opt.on .cnt { color: var(--teal); }
.filters-bar {
  position: sticky; top: 60px; z-index: 20;
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 18px; margin-bottom: 22px; box-shadow: var(--shadow);
}
.filters-bar .grow { flex: 1; }
.chip-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(22,119,130,.10); color: var(--teal-dark);
  border-radius: 999px; padding: 4px 12px; font-size: 13px;
}
.chip button { background: none; border: none; cursor: pointer; color: inherit; font-size: 15px; line-height: 1; padding: 0; }
.chip-row .none { color: var(--muted); font-size: 13.5px; }

/* ---------- 详情页：左侧悬浮结构栏（只放最终 HyT 结构） ---------- */
/* 结构栏独立为最左侧窄栏并吸顶，正文在右侧，不再横跨整页遮挡内容 */
.detail-layout { display: flex; gap: 26px; align-items: flex-start; }
.struct-rail {
  position: sticky; top: 76px; z-index: 5;
  flex: 0 0 258px; width: 258px;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px; box-shadow: var(--shadow);
}
.struct-rail .rail-box {
  background: #fff; border: 1px solid var(--line); border-radius: 8px;
  padding: 8px; text-align: center;
}
.struct-rail .rail-box .cap {
  font-family: var(--serif); font-size: 14px; color: var(--ink);
  margin-top: 6px; word-break: break-word;
}
.struct-rail .rail-box svg { max-width: 100%; max-height: 190px; height: auto; }
.detail-main { min-width: 0; flex: 1 1 auto; }

/* ---------- 详情页：组成部分（原结构 / 连接子 / 疏水标签）一行 ---------- */
.parts-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 18px; }
.part-box {
  background: #fff; border: 1px solid var(--line); border-radius: 8px;
  padding: 8px; text-align: center; min-width: 0;
}
.part-box .cap { font-size: 12px; color: var(--muted); margin-top: 4px; line-height: 1.35; }
.part-box svg { max-width: 100%; max-height: 150px; height: auto; }
/* 空结构占位（如未报道的 linker）也保持统一高度 */
.part-box { min-height: 176px; display: flex; flex-direction: column; justify-content: center; }
.panel h2 + .tag-panel { margin-top: 0; }

/* ---------- 详情页：基本性质 / RO5 分栏 ---------- */
.kv-grid-3 { grid-template-columns: repeat(3, 1fr); }
.kv-grid-4 { grid-template-columns: repeat(4, 1fr); }
.kv-grid-1 { grid-template-columns: 1fr; }
/* 四列时每格较窄：标签按内容占宽，不再硬留 130px，数值就不会被挤到折行 */
.kv-grid-4 .kv { gap: 8px; }
.kv-grid-4 .kv .k { min-width: 0; flex: 0 0 auto; }
.kv-grid-4 .kv .v { word-break: normal; white-space: nowrap; }
.ro5-layout { display: flex; gap: 26px; align-items: center; flex-wrap: wrap; }
.ro5-layout .kv-grid { flex: 1 1 340px; min-width: 280px; }
.ro5-layout .radar-wrap { flex: 1 1 320px; max-width: 420px; margin: 0; }

/* 详情页标签疏水性面板 */
.tag-panel {
  background: linear-gradient(135deg, #fdf8ec, #fbf3df);
  border: 1px solid #e8d5a8; border-radius: var(--radius);
  padding: 20px 24px; margin-top: 22px;
}
.tag-panel h3 { font-family: var(--serif); font-size: 17px; color: var(--ink); margin: 0 0 14px; }
.tag-panel-grid { display: flex; gap: 24px; align-items: center; flex-wrap: wrap; }
.tag-panel .tag-struct {
  background: #fff; border: 1px solid #e8d5a8; border-radius: 8px; padding: 10px; text-align: center;
}
.tag-panel .tag-kv { flex: 1; min-width: 240px; }
.tag-clogp-bar { height: 8px; border-radius: 999px; background: #eee4cd; margin-top: 6px; overflow: hidden; }
.tag-clogp-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--teal), var(--amber)); border-radius: 999px; }

/* 详情页下载条 */
.detail-dl { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }

/* ---------- 新闻详情页 ---------- */
.article-wrap { max-width: 820px; margin: 0 auto; }
.article-head { padding: 34px 0 22px; }
.article-head h1 {
  font-family: var(--serif); font-size: 32px; line-height: 1.3;
  color: var(--ink); margin-bottom: 14px;
}
.article-meta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.article-hero { margin-bottom: 26px; }
.article-hero img { width: 100%; border-radius: 14px; display: block; box-shadow: var(--shadow); }
.article-body { font-size: 15.5px; line-height: 1.85; color: var(--text); }
.article-body p { margin-bottom: 16px; }
.article-body h2 {
  font-family: var(--serif); font-size: 21px; color: var(--ink);
  margin: 30px 0 12px; padding-left: 12px; border-left: 4px solid var(--amber);
}
.article-body ul { margin: 0 0 16px 22px; }
.article-body li { margin-bottom: 7px; }
.article-quote {
  background: var(--paper); border-left: 4px solid var(--teal);
  border-radius: 0 8px 8px 0; padding: 14px 20px; margin: 20px 0;
  font-style: italic; color: var(--ink-2);
}
.article-back {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 30px;
  color: var(--teal); font-weight: 600; font-size: 14px; text-decoration: none;
}
.article-back:hover { color: var(--amber); }

/* ============================================================
 * 响应式（Adaptive / Mobile）
 * 断点：1024px 平板 · 760px 手机 · 480px 小屏手机
 * ============================================================ */

/* ---------- 平板 ---------- */
@media (max-width: 1024px) {
  .stats .container { gap: 56px; }
  .footer-grid { gap: 32px; }
  .browse-layout, .detail-layout { gap: 20px; }
  .facet-panel { flex: 0 0 232px; }
  .struct-rail { top: 70px; }
  .news-grid { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
  .card-grid { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
  .about-split { gap: 36px; }
  .media-row { gap: 30px; }
  .viewer3d { height: 360px; }
}

/* ---------- 手机 ---------- */
@media (max-width: 760px) {
  .container { padding: 0 16px; }

  /* 顶部导航：单行 + 可横向滑动，保持 54px 不占用过多竖屏空间 */
  .topbar .container { height: 54px; gap: 10px; padding: 0 14px; }
  .brand { flex: none; font-size: 18px; gap: 8px; letter-spacing: 0; }
  .brand .dot { width: 10px; height: 10px; box-shadow: 0 0 0 3px rgba(217,164,65,.25); }
  .nav {
    margin-left: auto; gap: 2px; min-width: 0;
    overflow-x: auto; -webkit-overflow-scrolling: touch;
    scrollbar-width: none; padding: 2px 0 4px;
  }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { flex: 0 0 auto; padding: 6px 12px; font-size: 13px; }

  /* Hero + 搜索栏：竖向堆叠 */
  .hero { min-height: 0; padding: 44px 0 40px; }
  .hero-title { font-size: 28px; }
  .hero-sub { font-size: 14px; margin-bottom: 22px; }
  .search-wrap { max-width: 100%; }
  .search-bar { flex-direction: column; border-radius: 14px; }
  .cs-select { width: 100%; }
  /* .btane 上带有 padding-top:20px !important，需用更高特异性 + !important 覆盖 */
  .search-bar .btane {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    width: 100%; cursor: pointer; font-family: var(--sans); font-size: 14px;
    border: none; outline: none;
    border-bottom: 1px solid var(--line);
    border-radius: 12px 12px 0 0;
    padding: 13px 16px !important;
    margin: -2px -2px 0 -2px;
  }
  .search-bar .cs-menu { top: calc(100% + 4px); left: 0; min-width: 100%; }
  .search-bar input { width: 100%; padding: 13px 16px; font-size: 15px; }
  .search-bar button { padding: 13px; border-radius: 0 0 12px 12px; margin: 0 -2px -2px -2px; }
  .search-actions { margin-top: 14px; }
  .btn-draw { padding: 10px 22px; font-size: 14px; }

  /* 统计条 */
  .stats .container { gap: 20px 34px; padding: 20px 16px; }
  .stat-num { font-size: 30px; }
  .stat-label { font-size: 12.5px; }

  /* 区块 */
  .section { padding: 32px 0; }
  .section-title { font-size: 21px; gap: 10px; }
  .section-title::before { width: 5px; height: 21px; }
  .section-desc { font-size: 14.5px; margin-bottom: 18px; }

  /* 化合物数据表 */
  .cmp-table .col-struct { width: 128px; }
  .cmp-table .cmp-struct svg { width: 110px; height: 66px; }

  /* 首页 Compound Browser 卡片条 */
  .card-grid { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
  .card-strip { gap: 16px; padding-bottom: 12px; }
  .card-strip .cmp-card { flex: 0 0 280px; }
  .card-strip .cmp-struct { height: 160px; }
  .cmp-body { padding: 14px 15px 16px; }
  .cmp-name { font-size: 17.5px; }
  .timeline-h .tl-item { flex: 0 0 230px; }

  /* 页脚 */
  .footer { padding: 32px 0 0; margin-top: 30px; }
  .footer-grid { grid-template-columns: 1fr; gap: 26px; padding-bottom: 24px; }

  /* Ketcher 弹窗：全屏铺满 */
  .kmodal-mask { align-items: stretch; }
  .kmodal { width: 100%; border-radius: 0; display: flex; flex-direction: column; }
  .kmodal-head { padding: 12px 16px; }
  .kmodal-head h3 { font-size: 16px; }
  .kmodal-frame-wrap { flex: 1; height: auto; min-height: 0; }
  .kmodal-foot { padding: 12px 16px; gap: 12px; }
  .kmodal-foot .match-group { gap: 12px; flex-wrap: wrap; font-size: 13.5px; }
  .kmodal-foot .btn { padding: 9px 18px; font-size: 14px; }

  /* 搜索结果提示条 */
  .result-note.show { flex-direction: column; align-items: flex-start; gap: 8px; }
  .result-note button { margin-left: 0; }

  /* 详情页 */
  .detail-head { padding: 26px 0 8px; }
  .detail-head h1 { font-size: 26px; }
  .panel { padding: 20px 16px; margin-bottom: 18px; }
  .panel h2 { font-size: 18px; margin-bottom: 14px; }
  .panel h3 { font-size: 15px; margin: 14px 0 8px; }
  .kv-grid { grid-template-columns: 1fr; gap: 6px; }
  .kv .k { min-width: 108px; }
  .struct-flex { gap: 18px; }
  /* 覆盖 HTML 内联的 flex:1;min-width:280px / 300px */
  .struct-flex > div { flex: 1 1 100% !important; min-width: 0 !important; }
  .struct-box { min-width: 0; width: 100%; }
  .subentry { padding: 14px 14px; }
  .viewer3d { height: 280px; }
  .radar-wrap { max-width: 100%; }
  .tag-panel { padding: 16px; }
  .tag-panel-grid { gap: 16px; }
  .tag-panel .tag-struct { width: 100%; }
  .tag-panel .tag-kv { min-width: 0; flex: 1 1 100%; }
  .detail-dl { gap: 8px; }
  .detail-dl .btn, .detail-dl .btn-outline { flex: 1 1 44%; }

  /* 静态页 / 文章页 */
  .page-hero { padding: 34px 0 28px; }
  .page-hero h1 { font-size: 26px; }
  .page-hero p { font-size: 14.5px; }
  .feature-grid { grid-template-columns: 1fr; gap: 14px; margin: 20px 0; }
  .feature-card { padding: 18px 16px; }
  .faq-q { padding: 14px 16px; font-size: 14.5px; }
  .faq-a { padding: 0 16px 14px; }
  .prose h3 { font-size: 17.5px; }
  .form-grid { grid-template-columns: 1fr; gap: 14px; }
  .media-row, .media-row.reverse { flex-direction: column; gap: 20px; margin: 28px 0; }
  .media-img { flex: none; width: 100%; }
  .media-text h3 { font-size: 20px; }
  .about-split { flex-direction: column; gap: 28px; }
  .about-fig img { animation: none; }
  .mol3d-grid { grid-template-columns: 1fr; }
  .mini3d { height: 210px; }

  /* Browse 筛选页：改单列，align-items 必须 stretch，
     否则窄屏下 flex 项按 max-content 收缩，宽表会把整页撑破 */
  .browse-layout { flex-direction: column; align-items: stretch; gap: 18px; }
  .facet-panel { position: static; flex: none; width: 100%; max-height: none; }
  .browse-main, .detail-main { flex: none; width: 100%; max-width: 100%; min-width: 0; }
  .facet-panel { padding: 16px; }
  .facet-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0 14px; }
  .browse-toolbar { padding: 12px 14px; gap: 10px; }

  /* 时间线 / 筛选总览页 */
  .section-title.with-link { flex-wrap: wrap; gap: 8px 12px; }
  .section-title .title-link { margin-left: 0; width: 100%; }
  .timeline { padding-left: 26px; }
  .timeline::before { left: 6px; }
  .tl-item::before { left: -27px; width: 12px; height: 12px; }
  .filters-grid { grid-template-columns: 1fr; gap: 14px; }
  .filters-bar { position: static; }

  /* 详情页结构栏：手机端取消悬浮改为静态单列，结构图放大保证可读 */
  .detail-layout { flex-direction: column; align-items: stretch; gap: 18px; }
  .struct-rail {
    position: static; flex: none; width: 100%; max-height: none;
    padding: 12px; margin-bottom: 0;
  }
  .struct-rail .rail-box { margin-bottom: 12px; }
  .struct-rail .rail-box svg { max-height: 170px; }
  .parts-row { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; }
  .part-box svg { max-height: 120px; }
  .ro5-layout { flex-direction: column; align-items: stretch; gap: 16px; }
  .ro5-layout .kv-grid, .ro5-layout .radar-wrap { flex: none; width: 100%; max-width: 100%; }

  /* News */
  .news-grid { grid-template-columns: 1fr; gap: 18px; }
  .article-head { padding: 24px 0 18px; }
  .article-head h1 { font-size: 24px; }
  .article-body { font-size: 15px; line-height: 1.8; }
  .article-body h2 { font-size: 19px; margin: 24px 0 10px; }
  .article-quote { padding: 12px 16px; }

  /* 右下角悬浮按钮 */
  .float-btns { right: 14px; bottom: 16px; gap: 8px; }
  .float-btn { width: 42px; height: 42px; }
}

/* ---------- 小屏手机 ---------- */
@media (max-width: 480px) {
  .container { padding: 0 14px; }
  .hero { padding: 36px 0 34px; }
  .hero-title { font-size: 24px; }
  .hero-sub { font-size: 13.5px; }
  .stat-num { font-size: 26px; }
  .section-title { font-size: 19px; }
  .section-title::before { height: 19px; }
  .panel { padding: 16px 13px; }
  .kv .k { min-width: 92px; font-size: 12.5px; }
  .kv .v { font-size: 12.5px; }
  .viewer3d { height: 240px; }
  /* 覆盖 download.html 内联的 minmax(320px,1fr) */
  .feature-grid { grid-template-columns: 1fr !important; }
  .browse-toolbar .count { flex: 1 1 100%; }
  .browse-toolbar .spacer { display: none; }
  .browse-toolbar .btn-outline, .browse-toolbar > .btn { flex: 1 1 auto; }
  table.data-table { font-size: 12.5px; }
  table.data-table th, table.data-table td { padding: 6px 8px; }
  .card-grid { grid-template-columns: 1fr; }
  .card-strip .cmp-card { flex: 0 0 250px; }
  .article-head h1 { font-size: 21px; }
  .tag-panel h3 { font-size: 15.5px; }
  .float-btns { right: 10px; bottom: 12px; }
  .float-btn { width: 38px; height: 38px; }
}



