/* 泰商查 · 设计系统（自写，配色沿用深蓝/正蓝/青绿家族） */
/* Noto Sans SC 由 index.html 的 #webfont 非阻塞加载（不在本文件内引入：Google 不可达时会阻塞首屏、整页白屏） */

:root {
  --navy: #102d50;
  --blue: #1764db;
  --teal: #008776;
  --ink: #192c44;
  --muted: #7b8796;
  --line: #e6ebf1;
  --bg: #f5f7fa;
  --gold: #b8924a;
  --green: #0a7a43;
  --red: #c0392b;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
[hidden] { display: none !important; }
body { font-family: 'Noto Sans SC', system-ui, sans-serif; color: var(--ink); background: var(--bg); font-size: 15px; line-height: 1.6; }
a { color: var(--blue); text-decoration: none; }
button { font: inherit; cursor: pointer; }
img { max-width: 100%; }

/* 头部 */
header { display: flex; align-items: center; gap: 28px; padding: 14px 4vw; background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 30; }
.brand { display: flex; align-items: baseline; gap: 8px; color: var(--navy); }
.brand-mark { display: inline-flex; width: 34px; height: 34px; border-radius: 8px; background: var(--navy); color: #f3d58b; font-weight: 900; align-items: center; justify-content: center; font-size: 18px; }
.brand b { font-size: 21px; letter-spacing: 1px; }
.brand small { color: var(--muted); font-size: 10px; }
nav { display: flex; gap: 22px; flex: 1; }
nav a { color: var(--ink); font-weight: 500; padding: 6px 2px; border-bottom: 2px solid transparent; }
nav a.active { color: var(--blue); border-color: var(--blue); }
.header-account { display: flex; gap: 8px; }
/* 手机宽度：页头换行，导航单独一行横向滚动（否则 375px 设备整页按 583px 排版） */
@media (max-width: 760px) { header { flex-wrap: wrap; gap: 6px 12px; padding: 10px 16px; } .brand small { display: none; } .header-account { margin-left: auto; } .header-account .btn { padding: 6px 10px; } nav { order: 3; flex: 1 0 100%; gap: 16px; overflow-x: auto; white-space: nowrap; scrollbar-width: none; } }
/* 加载态：渲染超过 150ms 才加（app.js render）；不禁用点击，DBD 实时回查最长要等 25 秒 */
body.loading #app { opacity: .55; transition: opacity .15s; }
/* 慢渲染都是在等官方实时接口：给一句文字说明（官方慢时可能要几十秒） */
body.loading::after { content: '正在查询官方系统，请稍候…官方较慢时可能需要几十秒'; position: fixed; top: 10px; left: 50%; transform: translateX(-50%); z-index: 101; max-width: calc(100vw - 32px); padding: 5px 14px; border-radius: 999px; background: var(--blue); color: #fff; font-size: 13px; box-shadow: 0 2px 8px rgba(0,0,0,.15); }
body.loading::before { content: ''; position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 100; background: linear-gradient(90deg, transparent, var(--blue), transparent) no-repeat; background-size: 50% 100%; animation: loadbar 1s linear infinite; }
@keyframes loadbar { from { background-position: -100% 0; } to { background-position: 200% 0; } }

/* 按钮/表单 */
.btn { display: inline-flex; align-items: center; gap: 6px; background: var(--blue); color: #fff; border: 1px solid var(--blue); border-radius: 8px; padding: 8px 16px; font-weight: 500; }
.btn:hover { filter: brightness(1.05); }
.btn.outline { background: #fff; color: var(--blue); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.link { color: var(--blue); }
input, select, textarea { font: inherit; padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; width: 100%; background: #fff; }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(23,100,219,.25); border-color: var(--blue); }
.form label { display: block; margin-bottom: 12px; font-size: 13px; color: var(--ink); }
.form input, .form select, .form textarea { margin-top: 5px; }
.form-error { color: var(--red); font-size: 13px; min-height: 18px; margin: 8px 0; }
.check { display: flex !important; gap: 8px; align-items: flex-start; }
.check input { width: auto; margin-top: 4px; }

/* 布局 */
.container { max-width: 1120px; margin: 0 auto; padding: 26px 4vw 60px; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: 12px; }
.padded { padding: 22px; }
.content-grid { display: grid; grid-template-columns: 1fr 320px; gap: 22px; align-items: start; }
@media (max-width: 900px) { .content-grid { grid-template-columns: 1fr; } }
.breadcrumb { font-size: 13px; color: var(--muted); margin-bottom: 14px; }
.page-title h1 { color: var(--navy); font-size: 26px; margin: 4px 0 6px; }
.page-title p { color: var(--muted); }
.sectionhead { display: flex; justify-content: space-between; align-items: end; gap: 12px; margin: 26px 0 14px; }
/* 标题里带用户查询词：超长不带空格的词（a×160、mode=reg 的长数字串）允许任意处断行，不把页面撑出横向滚动 */
.sectionhead h2 { color: var(--navy); font-size: 20px; overflow-wrap: anywhere; }
.sectionhead p { color: var(--muted); font-size: 13px; }
.eyebrow { color: var(--blue); font-size: 12px; letter-spacing: 2px; font-weight: 700; }
.muted { color: var(--muted); }
.small, small { font-size: 12.5px; }
.empty { text-align: center; padding: 46px 20px; color: var(--muted); }
.empty h3 { color: var(--ink); margin: 10px 0 6px; }
.errornote { background: #fdf0ee; border: 1px solid #f2cfc7; color: #a0442f; border-radius: 10px; padding: 12px 16px; margin: 12px 0; }
.notice { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; background: #eef4ff; border: 1px solid #cfe0fb; border-radius: 10px; padding: 10px 14px; margin: 12px 0; font-size: 13.5px; }

/* 标签 */
.tag { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; padding: 2px 8px; border-radius: 20px; background: #e8f0fe; color: #1d4fa8; font-weight: 500; }
.tag.gray { background: #eef1f5; color: #5b6878; }
.tag.green { background: #e6f6ee; color: var(--green); }
.tag.gold { background: #fbf1dc; color: #8a5a00; }

/* 首页 hero */
.hero { background: linear-gradient(160deg, var(--navy) 0%, #1d4fa8 70%, var(--blue) 100%); color: #fff; padding: 52px 4vw 40px; text-align: center; }
.hero .eyebrow { color: #9fc0ef; }
.hero h1 { font-size: 34px; margin: 10px 0 6px; letter-spacing: 2px; }
.hero .sub { color: #c9d6ea; margin-bottom: 26px; }
.searchbox { display: flex; max-width: 720px; margin: 0 auto; background: #fff; border-radius: 12px; padding: 6px; gap: 6px; box-shadow: 0 8px 30px rgba(6,22,48,.25); }
.searchbox input { border: 0; flex: 1; font-size: 15px; }
.searchbox .btn { border-radius: 9px; }
.hero-bottom { display: flex; gap: 34px; justify-content: center; margin-top: 30px; flex-wrap: wrap; font-size: 13px; color: #c9d6ea; }
.hero-bottom b { color: #fff; margin-right: 6px; }
.hero-hint { margin-top: 14px; font-size: 13px; color: #c9d6ea; }
.hero-hint a { color: #f3d58b; }
/* 搜索框里的输入框 / 下拉：min-width:0 防止手机宽度下被内在宽度撑出横向滚动 */
.searchbox input { min-width: 0; }
.searchbox select { width: auto; flex: none; border: 0; background: #f5f7fa; }
@media (max-width: 520px) { .searchbox[data-go="fda"] { flex-wrap: wrap; } .searchbox[data-go="fda"] select { flex: 1 0 100%; } }
/* 首页 TISI / FDA 入口卡片 */
.entry-grid .service-card .searchbox { margin-top: 14px; box-shadow: none; border: 1px solid var(--line); max-width: none; }
.home-consult { margin-top: 30px; }
.cat-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 10px; }
.chip-btn { padding: 4px 12px; font-size: 12.5px; }
.small-btn { padding: 3px 10px; font-size: 12.5px; margin-left: auto; }
.form-title { color: var(--navy); font-size: 18px; margin-bottom: 12px; overflow-wrap: anywhere; }
.form-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
@media (max-width: 600px) { .form-2col { grid-template-columns: 1fr; } }
.btnrow.center { justify-content: center; margin-top: 12px; }
.sectionhead.first { margin-top: 0; }

.company-tags { margin-top: 8px; display: flex; gap: 6px; flex-wrap: wrap; }

/* 侧栏 */
.aside { display: flex; flex-direction: column; gap: 16px; }
.sidecard { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 20px; }
.mini-label { font-size: 10.5px; letter-spacing: 2px; color: var(--gold); font-weight: 700; }
.sidecard h3 { font-size: 17px; margin: 6px 0; }
.sidecard p { font-size: 13px; color: inherit; opacity: .85; }
.service-list { display: flex; flex-direction: column; margin: 10px 0; }
.service-list a { display: flex; justify-content: space-between; padding: 9px 2px; border-bottom: 1px dashed var(--line); color: var(--ink); font-size: 14px; }
.service-list span { display: flex; gap: 8px; align-items: center; }

.result-search { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.result-search .searchbox { box-shadow: none; border: 1px solid var(--line); }

/* 分页 */
.pager { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: center; margin: 22px 0; font-size: 13.5px; }
.pg-num, .pg-btn { min-width: 32px; text-align: center; padding: 6px 10px; border: 1px solid var(--line); background: #fff; border-radius: 8px; color: var(--ink); }
.pg-num.current { background: var(--blue); color: #fff; border-color: var(--blue); }
.pg-btn.disabled { opacity: .45; }
.pg-jump { display: inline-flex; gap: 6px; align-items: center; color: var(--muted); }
.pg-jump input { width: 70px; }
.pager-note { text-align: center; color: var(--muted); font-size: 13px; margin: 10px 0; }

/* 详情页 */
.profile-header { padding: 0; overflow: hidden; }
.detail-hero { display: flex; gap: 18px; padding: 24px; border-bottom: 1px solid var(--line); justify-content: space-between; align-items: flex-start; }
.profile-title h1 { color: var(--navy); font-size: 24px; overflow-wrap: anywhere; }
.company-th { color: var(--muted); font-size: 14px; }
.profile-overline { font-size: 11px; letter-spacing: 2px; color: var(--muted); display: flex; gap: 8px; align-items: center; }
.profile-actions { display: flex; gap: 10px; flex-wrap: wrap; padding: 16px 24px 0; }
.profile-foot { display: flex; gap: 6px 18px; flex-wrap: wrap; align-items: center; padding: 12px 24px; background: #f8fafd; color: var(--muted); font-size: 12.5px; margin-top: 14px; }
.detail-body { margin-top: 18px; padding: 22px; }
.overview-section { margin-top: 24px; }
.registration-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.registration-cell { background: #fff; padding: 12px 16px; }
.registration-cell.wide { grid-column: 1 / -1; }
.registration-cell span { display: block; font-size: 12px; color: var(--muted); }
.registration-cell strong { font-weight: 500; color: var(--ink); overflow-wrap: anywhere; }
@media (max-width: 700px) { .registration-grid { grid-template-columns: 1fr; } }
.tablewrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 13.5px; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
thead th { color: var(--muted); font-weight: 500; background: #f8fafd; white-space: nowrap; }
tbody th { font-weight: 500; color: var(--muted); white-space: nowrap; }
.source-note { color: var(--muted); font-size: 12.5px; margin-top: 12px; overflow-wrap: anywhere; }
td.wrap { max-width: 280px; overflow-wrap: anywhere; }
.std-card { margin-top: 16px; border-left: 4px solid var(--blue); }
.std-card h2 { color: var(--navy); }
.poster-stage { text-align: center; }
.poster-img { border: 1px solid var(--line); border-radius: 8px; }
.address-card { background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--blue); border-radius: 10px; padding: 14px 18px; }
.address-card strong { display: block; font-weight: 600; overflow-wrap: anywhere; }
.address-card span { color: var(--muted); font-size: 13px; }

/* 底部 banner */
.bottom-banner { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; background: linear-gradient(140deg, var(--navy), #1d4fa8); color: #fff; border-radius: 14px; padding: 26px 30px; margin: 30px 0 0; }
.bottom-banner h3 { color: #fff; }
.bottom-banner p { color: #c9d6ea; font-size: 13.5px; }
.bottom-banner .btn { background: #f3d58b; color: var(--navy); border-color: #f3d58b; }
.home-ad { border: 1px dashed var(--gold); border-radius: 12px; padding: 18px; background: #fffdf6; }
.ad-heading { display: flex; justify-content: space-between; font-size: 10.5px; letter-spacing: 1.5px; color: var(--gold); font-weight: 700; }
.home-ad h3 { color: var(--navy); margin: 8px 0 4px; }
.home-ad p { font-size: 13px; color: var(--muted); }
.ad-link { font-weight: 600; display: inline-flex; gap: 6px; margin-top: 10px; }

/* 指南卡片 */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; margin: 22px 0; }
.plan { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 22px; }
.plan h2 { color: var(--navy); font-size: 19px; margin: 8px 0; }
.plan:hover { border-color: var(--blue); }

/* 文本页 */
.text-page { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 34px; max-width: 860px; }
.text-page h1 { color: var(--navy); margin: 8px 0 12px; }
.text-page h2 { color: var(--navy); font-size: 18px; margin: 22px 0 8px; }
.text-page p { margin: 8px 0; }

/* 服务 */
.services-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; margin: 20px 0; }
.service-card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 20px; }
.service-card h3 { color: var(--navy); margin: 8px 0; }
.service-card p { font-size: 13.5px; color: var(--muted); }
.contact-layout { display: grid; grid-template-columns: 1fr 420px; gap: 22px; align-items: start; }
@media (max-width: 900px) { .contact-layout { grid-template-columns: 1fr; } }
.consult-topics > div { display: flex; gap: 12px; padding: 10px 0; }
.topic-icon { width: 38px; height: 38px; border-radius: 10px; background: #e8f0fe; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }

/* 后台通用 */
.account-title { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; }
.btnrow { display: flex; gap: 10px; flex-wrap: wrap; }

/* 管理后台 */
.admin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; margin: 16px 0; }
.admin-card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 18px; color: var(--ink); }
.admin-card:hover { border-color: var(--blue); }
.admin-card h3 { color: var(--navy); margin: 6px 0 4px; }
.admin-card p { font-size: 12.5px; color: var(--muted); }
.guide-row { padding: 8px 0; border-bottom: 1px dashed var(--line); display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.guide-new { margin-top: 12px; }

/* 弹窗/Toast */
dialog#modal { border: 0; border-radius: 14px; padding: 0; width: min(560px, 92vw); box-shadow: 0 18px 60px rgba(6,22,48,.35); }
dialog#modal::backdrop { background: rgba(6,22,48,.45); }
#modalbody { padding: 26px; max-height: 80vh; overflow-y: auto; }
#modalbody h2 { color: var(--navy); margin: 6px 0 10px; }
#modalbody .eyebrow { margin-bottom: 4px; }
#modal .close { position: absolute; top: 10px; right: 14px; border: 0; background: none; font-size: 22px; color: var(--muted); }
#toast { display: none; position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%); background: var(--navy); color: #fff; padding: 11px 22px; border-radius: 10px; z-index: 99; box-shadow: 0 10px 30px rgba(6,22,48,.4); font-size: 14px; }

/* 页脚 */
footer { padding: 26px 4vw 34px; color: var(--muted); font-size: 13px; text-align: center; border-top: 1px solid var(--line); background: #fff; }
footer div { display: flex; gap: 8px 18px; justify-content: center; flex-wrap: wrap; margin: 8px 0; }

/* 打印报告 */
.report-page { background: #fff; }
.report-toolbar { max-width: 900px; margin: 20px auto; display: flex; gap: 12px; align-items: center; padding: 0 4vw; flex-wrap: wrap; }
.report-sheet { max-width: 900px; margin: 0 auto; padding: 46px 50px; background: #fff; min-height: 100vh; }
.report-brand { color: var(--navy); font-size: 20px; }
.report-head { display: flex; justify-content: space-between; border-bottom: 3px solid var(--navy); padding-bottom: 14px; margin-bottom: 20px; }
.report-kicker { color: var(--muted); font-size: 12px; letter-spacing: 1.5px; }
.report-meta { text-align: right; color: var(--muted); font-size: 12.5px; display: flex; flex-direction: column; }
.report-sheet h1 { color: var(--navy); font-size: 26px; }
.report-sub { color: var(--muted); }
.report-badges { margin: 10px 0 4px; font-size: 13.5px; }
.report-sheet h2 { color: var(--navy); font-size: 17px; margin: 22px 0 8px; border-left: 4px solid var(--gold); padding-left: 10px; }
.report-kv { width: 100%; }
.report-kv th { width: 160px; }
.report-kv td { overflow-wrap: anywhere; }
.report-note { color: var(--muted); font-size: 12px; margin-top: 24px; border-top: 1px solid var(--line); padding-top: 12px; }
@media print {
  .no-print { display: none !important; }
  body { background: #fff; }
  .report-sheet { padding: 0; }
  .print-mode header, .print-mode footer, .print-mode #toast { display: none !important; }
}
@media (max-width: 600px) { .report-sheet { padding: 24px 16px; } .report-head { flex-direction: column; gap: 6px; } .report-meta { text-align: left; } .report-kv th { width: 96px; white-space: normal; } }
/* 完善业务轮：名称找注册号、核验提示与延伸核查、线索管理 */
.name-help { margin: 12px 0; }
.name-help p { margin-bottom: 8px; }
.steps { margin: 8px 0 14px 20px; color: var(--ink); font-size: 14px; }
.steps li { margin: 4px 0; }
.dd-hints { list-style: none; margin: 0 0 8px; padding: 0; }
.dd-hints li { border-radius: 10px; padding: 10px 14px 10px 36px; margin: 8px 0; font-size: 14px; position: relative; overflow-wrap: anywhere; }
.dd-hints li::before { position: absolute; left: 14px; top: 10px; font-weight: 700; }
.dd-warn { background: #fdf0ee; border: 1px solid #f2cfc7; color: #a0442f; }
.dd-warn::before { content: '!'; }
.dd-info { background: #fbf6ea; border: 1px solid #ecdcb5; color: #7a5a1c; }
.dd-info::before { content: 'i'; }
.dd-ok { background: #edf7f1; border: 1px solid #c9e6d5; color: var(--green); }
.dd-ok::before { content: '✓'; }
.dd-links { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.dd-link { display: block; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; background: #fff; }
.dd-link b { display: block; color: var(--navy); margin-bottom: 4px; }
.dd-link span { display: block; color: var(--muted); font-size: 12.5px; overflow-wrap: anywhere; }
.dd-link:hover { border-color: var(--blue); }
.report-hints { margin: 6px 0 12px 20px; font-size: 13px; }
.report-hints li { margin: 3px 0; }
.lead-search { margin: 12px 0; max-width: 640px; }
.lead-table td { vertical-align: top; }
.lead-table .wrap { margin-top: 4px; max-width: 360px; white-space: pre-wrap; overflow-wrap: anywhere; }
.lead-table select, .lead-table textarea { width: 100%; min-width: 120px; font: inherit; font-size: 13px; }
.lead-note-save { margin-top: 4px; }
/* 一键全查：认证与许可、按名称找持证企业 */
.certs-box { margin-top: 4px; }
.certs-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.certs-box, .certs-part { min-width: 0; }
.certs-part { border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; background: #fff; margin: 10px 0; }
.certs-part h3 { color: var(--navy); font-size: 15.5px; margin-bottom: 8px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.certs-part table { font-size: 13px; }
.certs-part td small { overflow-wrap: anywhere; }
.vat-facts { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; margin-bottom: 8px; font-size: 14px; }
.kv-mini { width: 100%; font-size: 13px; }
.kv-mini th { width: 7.5em; text-align: left; color: var(--muted); font-weight: 500; vertical-align: top; padding: 4px 8px 4px 0; }
.kv-mini td { overflow-wrap: anywhere; padding: 4px 0; }
details.more { margin-top: 8px; }
details.more summary { cursor: pointer; color: var(--blue); font-size: 13px; }
.name-hits { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 10px; }
.name-hit { display: block; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; background: #fff; color: var(--ink); }
.name-hit:hover { border-color: var(--blue); }
.name-hit b { display: block; color: var(--navy); overflow-wrap: anywhere; }
.name-hit span { display: block; font-size: 12.5px; color: var(--muted); margin-top: 3px; overflow-wrap: anywhere; }
.name-hit span.link { color: var(--blue); }
