/* ====== 汇俱产品知识库 - 全局共享样式 ====== */
:root {
  --primary: #1a3c5e;
  --primary-light: #2c5f8a;
  --accent: #c8922b;
  --bg: #f8f9fa;
  --card: #ffffff;
  --text: #2d3436;
  --text-light: #636e72;
  --border: #e0e0e0;
  --shadow: 0 2px 12px rgba(0,0,0,0.08);
  --radius: 8px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; background: var(--bg); color: var(--text); line-height: 1.7; font-size: 15px; }
a { color: var(--primary-light); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ====== Nav ====== */
nav { position: sticky; top: 0; z-index: 100; background: var(--primary); padding: 0; box-shadow: 0 2px 8px rgba(0,0,0,0.15); }
nav .nav-inner { max-width: 1300px; margin: 0 auto; display: flex; flex-wrap: wrap; align-items: center; gap: 0; }
nav a { color: #fff; padding: 14px 16px; font-size: 13.5px; font-weight: 500; display: block; transition: background .2s; white-space: nowrap; }
nav a:hover { background: rgba(255,255,255,0.12); text-decoration: none; }
nav .brand { font-size: 16px; font-weight: 700; letter-spacing: 0.5px; padding: 14px 20px; }
nav .brand small { font-weight: 400; font-size: 12px; opacity: 0.75; margin-left: 6px; }
nav .nav-label {
  display: inline-flex;
  align-items: baseline;
  gap: 7px;
}
nav .nav-label .nav-en {
  color: #d7e6f3;
  font-size: 11.5px;
  font-weight: 500;
}

/* ====== Dropdown Menu ====== */
nav .dropdown { position: relative; display: inline-block; }
nav .dropdown > a { cursor: pointer; }
nav .dropdown-content {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: #1a3c5e;
  min-width: 220px;
  border-radius: 0 0 6px 6px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
  z-index: 200;
  padding: 8px 0;
}
nav .dropdown:hover .dropdown-content { display: block; }
nav .dropdown:hover .dropdown-content.col2 { display: grid; }
nav .dropdown-content a {
  padding: 10px 20px;
  font-size: 13px;
  white-space: nowrap;
  display: block;
  border-left: 3px solid transparent;
}
nav .dropdown-content a:hover {
  background: rgba(255,255,255,0.12);
  border-left-color: #c8922b;
}
nav .dropdown-content .divider {
  border-top: 1px solid rgba(255,255,255,0.15);
  margin: 6px 0;
}
nav .dropdown-content .view-all {
  font-weight: 600;
  color: #ffd88a;
}
nav .dropdown-content.col2 {
  min-width: 500px;
  grid-template-columns: 1fr 1fr;
  padding: 6px;
}
nav .dropdown-content.col2 a {
  padding: 9px 16px;
  font-size: 13px;
}
nav .dropdown-content.col2 .divider,
nav .dropdown-content.col2 .view-all {
  grid-column: 1 / -1;
}
nav .dropdown-content .bilingual {
  display: grid;
  grid-template-columns: minmax(82px, max-content) minmax(110px, 1fr);
  align-items: baseline;
  gap: 12px;
}
nav .dropdown-content .bilingual .en {
  color: #c7d8e8;
  font-size: 11px;
  opacity: 1;
  white-space: nowrap;
  font-weight: 400;
}

/* ====== Layout ====== */
.container { max-width: 1300px; margin: 0 auto; padding: 24px 20px; }
header.hero { background: linear-gradient(135deg, var(--primary), #0f2b44); color: #fff; padding: 28px 24px 24px; text-align: center; }
header.hero h1 { font-size: 1.8rem; margin-bottom: 14px; letter-spacing: 1px; }
header.hero .sub { font-size: 1rem; opacity: 0.85; }
header.hero .en-sub { font-size: 0.9rem; opacity: 0.65; margin-top: 4px; }
.hero-info { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px 24px; text-align: left; max-width: 1200px; margin: 0 auto; font-size: 13.5px; line-height: 1.6; }
.hero-info .hi-item { padding: 6px 0; }
.hero-info .hi-label { font-size: 11px; text-transform: uppercase; letter-spacing: 1.5px; opacity: 0.55; margin-bottom: 3px; }
.hero-info .hi-value { opacity: 0.92; }
.hero-info .hi-value a { color: #ffd88a; }
.hero-info .hi-value a:hover { color: #fff; }
.hero-info .tag-sm { display: inline-block; background: rgba(255,255,255,0.15); padding: 2px 8px; border-radius: 10px; font-size: 11px; margin: 1px 3px 1px 0; }
@media (max-width: 600px) { header.hero { padding: 20px 14px 16px; } header.hero h1 { font-size: 1.3rem; } .hero-info { grid-template-columns: 1fr; font-size: 12.5px; } }

.section { margin: 32px 0; }
.section-title { font-size: 1.5rem; color: var(--primary); border-bottom: 3px solid var(--accent); padding-bottom: 8px; margin-bottom: 20px; display: flex; align-items: baseline; gap: 12px; }
.section-title .en { font-size: 0.85rem; color: var(--text-light); font-weight: 400; }

/* ====== Cards ====== */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; margin-bottom: 20px; border-left: 4px solid var(--primary-light); }
.card h3 { color: var(--primary); margin-bottom: 10px; font-size: 1.15rem; }
.card h3 .en { font-size: 0.85rem; color: var(--text-light); font-weight: 400; }
.card p, .card li { margin-bottom: 6px; }

/* ====== Table ====== */
table { width: 100%; border-collapse: collapse; margin: 12px 0 20px; font-size: 14px; }
th, td { padding: 10px 12px; border: 1px solid var(--border); text-align: left; vertical-align: top; word-break: break-word; overflow-wrap: break-word; }
th { background: var(--primary); color: #fff; font-weight: 600; font-size: 13px; }
tr:nth-child(even) { background: #fafbfc; }
table.compact { font-size: 13px; }
table.compact th, table.compact td { padding: 6px 8px; }

/* ====== Tags ====== */
.tag { display: inline-block; background: #e8f0fe; color: var(--primary-light); padding: 3px 10px; border-radius: 12px; font-size: 12px; font-weight: 600; margin: 2px 4px 2px 0; }
.tag.gold { background: #fef3cd; color: #856404; }
.tag.green { background: #d4edda; color: #155724; }
.tag.red { background: #f8d7da; color: #721c24; }

/* ====== Grid ====== */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
@media (max-width: 900px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

/* ====== TOC ====== */
.toc { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; margin-bottom: 28px; }
.toc h3 { color: var(--primary); margin-bottom: 12px; }
.toc ul { columns: 2; list-style: none; }
.toc li { margin-bottom: 6px; }
.toc a { font-size: 14px; }
@media (max-width: 700px) { .toc ul { columns: 1; } }

/* ====== Company quick card ====== */
.quick-card { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.quick-card .qc-item { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
.quick-card .qc-item h4 { color: var(--primary); font-size: 1rem; margin-bottom: 8px; }

/* ====== Sidebar ====== */
.sidebar {
  position: sticky; top: 56px;
  width: 240px; float: left;
  background: #fff; border-radius: 8px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  padding: 16px; max-height: calc(100vh - 80px);
  overflow-y: auto;
  z-index: 90;
}
.sidebar h4 { color: var(--primary); font-size: 14px; margin-bottom: 10px; padding-bottom: 8px; border-bottom: 2px solid var(--accent); }
.sidebar a { display: block; padding: 6px 10px; font-size: 13px; border-radius: 4px; color: var(--text); }
.sidebar a:hover { background: #e8f0fe; text-decoration: none; color: var(--primary-light); }
.sidebar .sb-group { font-size: 11px; color: var(--text-light); padding: 10px 10px 4px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.main-content { margin-left: 270px; }
@media (max-width: 900px) { .sidebar { display: none; } .main-content { margin-left: 0; } }

/* ====== Product overview cards (index page) ====== */
.product-overview-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(350px, 1fr)); gap: 16px; }
.product-ov-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; border-top: 3px solid var(--accent); transition: transform .15s, box-shadow .15s; }
.product-ov-card:hover { transform: translateY(-2px); box-shadow: 0 4px 18px rgba(0,0,0,0.12); }
.product-ov-card h4 { color: var(--primary); font-size: 1rem; margin-bottom: 6px; }
.product-ov-card h4 .en { font-size: 0.8rem; color: var(--text-light); font-weight: 400; }
.product-ov-card p { font-size: 13px; line-height: 1.5; color: var(--text-light); margin-bottom: 4px; }
.product-ov-card .ov-link { font-size: 12px; font-weight: 600; color: var(--accent); }
@media (max-width: 600px) { .product-overview-grid { grid-template-columns: 1fr; } }

/* ====== Print ====== */
@media print {
  nav { position: static; }
  .sidebar { display: none; }
  .main-content { margin-left: 0; }
  body { font-size: 12px; }
  .card, .qc-item, .product-ov-card { box-shadow: none; border: 1px solid #ccc; break-inside: avoid; }
  .section-title { font-size: 1.2rem; }
  .container { padding: 0; }
}

/* ====== Bilingual marker ====== */
.cn { }
.en { color: #636e72; font-size: 0.92em; }

/* ====== Flow steps ====== */
.flow-steps { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0; }
.flow-step { flex: 1 1 140px; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 10px; text-align: center; border-top: 3px solid var(--accent); min-width: 120px; }
.flow-step .num { font-size: 1.5rem; font-weight: 700; color: var(--accent); }
.flow-step .label { font-size: 13px; margin-top: 4px; }
.flow-step .en-label { font-size: 11px; color: var(--text-light); }

/* ====== Accordion-like ====== */
summary { cursor: pointer; font-weight: 600; padding: 8px 0; color: var(--primary); font-size: 1.05rem; }
summary:hover { color: var(--accent); }
details { margin-bottom: 12px; }

/* ====== Back to top ====== */
.back-top { position: fixed; bottom: 30px; right: 30px; background: var(--accent); color: #fff; width: 44px; height: 44px; border-radius: 50%; text-align: center; line-height: 44px; font-size: 20px; box-shadow: 0 2px 8px rgba(0,0,0,0.2); cursor: pointer; z-index: 99; }

/* ====== Footer ====== */
footer { text-align: center; padding: 30px; background: var(--primary); color: rgba(255,255,255,0.7); font-size: 13px; margin-top: 40px; }

/* ====== Text Overflow Fixes ====== */
/* Code blocks / pre */
pre {
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
  max-width: 100%;
  background: #f4f4f4;
  padding: 12px 16px;
  border-radius: 6px;
  font-size: 13px;
  line-height: 1.6;
  border: 1px solid var(--border);
}
/* Long URLs / emails in cards */
.card a, .hi-value a {
  word-break: break-all;
}
/* Blockquote overflow */
blockquote {
  overflow-wrap: break-word;
  border-left: 3px solid var(--accent);
  padding: 8px 16px;
  margin: 10px 0;
  background: #faf8f3;
  font-size: 14px;
  color: #5a4a2a;
}
/* .hi-value long text */
.hi-value {
  word-break: break-word;
}

/* ====== Nav responsive: hamburger on small screen ====== */
@media (max-width: 900px) {
  nav .nav-inner { flex-direction: column; align-items: stretch; }
  nav .dropdown-content { position: static; box-shadow: none; border-radius: 0; background: rgba(0,0,0,0.2); min-width: auto; }
  nav .dropdown:hover .dropdown-content { display: none; }
  nav .dropdown.open .dropdown-content { display: block; }
}

/* ====== Quick entry blocks (index page) ====== */
.quick-entry-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.qe-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; text-align: center; }
.qe-card h4 { color: var(--primary); margin-bottom: 8px; }
.qe-card p { font-size: 13px; color: var(--text-light); margin-bottom: 10px; }
.qe-card .btn { display: inline-block; background: var(--accent); color: #fff; padding: 8px 20px; border-radius: 20px; font-size: 13px; font-weight: 600; }
.qe-card .btn:hover { background: #a87a1f; text-decoration: none; }
