/* ============================================================
   CNBuidHub — 宝蓝主题（Royal Blue）响应式样式
   ============================================================ */
:root {
    --royal:        #0033A0;   /* 宝蓝主色 */
    --royal-dark:   #001f66;
    --royal-deep:   #001242;
    --royal-light:  #2a55c4;
    --royal-soft:   #eef2ff;
    --accent:       #f5b301;   /* 点缀金 */
    --bg:           #f6f8ff;
    --surface:      #ffffff;
    --text:         #17223b;
    --text-muted:   #5b6b8c;
    --line:         #dbe3f5;
    --radius:       14px;
    --shadow:       0 10px 30px rgba(0, 51, 160, .12);
    --shadow-sm:    0 4px 14px rgba(0, 51, 160, .10);
    --max-w:        1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: "PingFang SC", "Microsoft YaHei", -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.65;
}
img { max-width: 100%; }
a { color: var(--royal); text-decoration: none; }
a:hover { color: var(--royal-light); }

.container { max-width: var(--max-w); margin: 0 auto; padding: 0 20px; }
.skip-link { position: absolute; left: -9999px; }

/* ---------------- 顶部导航 ---------------- */
.site-header {
    background: linear-gradient(135deg, var(--royal-deep) 0%, var(--royal) 60%, var(--royal-light) 100%);
    color: #fff;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}
.header-inner { display: flex; align-items: center; gap: 18px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; }
.brand-logo {
    width: 38px; height: 38px; border-radius: 10px;
    background: rgba(255, 255, 255, .16);
    border: 1px solid rgba(255, 255, 255, .35);
    display: inline-flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 20px;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-size: 17px; letter-spacing: .5px; }
.brand-text small { font-size: 11px; opacity: .75; }

.main-nav { display: flex; align-items: center; gap: 4px; margin-left: 8px; flex: 1; }
.main-nav a {
    color: rgba(255, 255, 255, .85);
    padding: 7px 12px; border-radius: 8px; font-size: 14.5px; white-space: nowrap;
}
.main-nav a:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.main-nav a.active { background: rgba(255, 255, 255, .18); color: #fff; font-weight: 600; }
.main-nav a.ai-link { color: #ffe08a; font-weight: 600; }

.header-actions { display: flex; align-items: center; gap: 8px; }
.lang-switch {
    color: #fff; border: 1px solid rgba(255, 255, 255, .45);
    padding: 5px 10px; border-radius: 999px; font-size: 13px;
}
.lang-switch:hover { background: rgba(255, 255, 255, .15); color: #fff; }

.nav-toggle { display: none; background: none; border: 0; cursor: pointer; padding: 8px; }
.nav-toggle span { display: block; width: 22px; height: 2.5px; background: #fff; margin: 4px 0; border-radius: 2px; transition: .25s; }

/* ---------------- 按钮 ---------------- */
.btn {
    display: inline-block; padding: 10px 22px; border-radius: 10px;
    font-size: 14.5px; font-weight: 600; border: 1px solid transparent;
    cursor: pointer; transition: .2s; text-align: center;
}
.btn-primary { background: var(--accent); color: #1d1600; }
.btn-primary:hover { background: #ffc821; color: #1d1600; }
.btn-royal { background: var(--royal); color: #fff; }
.btn-royal:hover { background: var(--royal-light); color: #fff; }
.btn-outline { border-color: rgba(255,255,255,.55); color: #fff; }
.btn-outline:hover { background: rgba(255,255,255,.14); color: #fff; }
.btn-outline-royal { border-color: var(--royal); color: var(--royal); background: transparent; }
.btn-outline-royal:hover { background: var(--royal-soft); color: var(--royal); }
.btn-ghost { color: rgba(255,255,255,.8); }
.btn-ghost:hover { color: #fff; }
.btn-sm { padding: 6px 14px; font-size: 13.5px; }
.btn-lg { padding: 13px 30px; font-size: 16px; }
.btn-block { display: block; width: 100%; }

/* ---------------- Flash 提示 ---------------- */
.flash-wrap { margin-top: 14px; }
.flash { padding: 11px 16px; border-radius: 10px; margin: 6px 0; font-size: 14.5px; box-shadow: var(--shadow-sm); }
.flash-ok { background: #e8f7ee; color: #14663a; border: 1px solid #bfe8d0; }
.flash-error { background: #fdecec; color: #8f1f1f; border: 1px solid #f3c1c1; }

/* ---------------- Hero ---------------- */
.hero {
    background: linear-gradient(160deg, var(--royal-deep) 0%, var(--royal) 55%, #1d49c8 100%);
    color: #fff; padding: 72px 0 84px;
    position: relative; overflow: hidden;
}
.hero::after {
    content: ""; position: absolute; inset: 0;
    background: radial-gradient(600px 300px at 85% 20%, rgba(245, 179, 1, .18), transparent 60%),
                radial-gradient(500px 260px at 10% 90%, rgba(42, 85, 196, .5), transparent 60%);
    pointer-events: none;
}
.hero .container { position: relative; z-index: 1; }
.hero-title { font-size: clamp(28px, 4.6vw, 46px); margin: 0 0 14px; font-weight: 800; line-height: 1.25; }
.hero-sub { font-size: clamp(15px, 1.6vw, 18px); opacity: .92; max-width: 760px; margin: 0 0 26px; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-stats { display: flex; gap: clamp(18px, 4vw, 56px); margin-top: 44px; flex-wrap: wrap; }
.hero-stat b { font-size: clamp(22px, 3vw, 34px); display: block; color: #ffd66b; }
.hero-stat span { font-size: 13.5px; opacity: .85; }

/* AI 快捷搜索条 */
.ai-quick {
    margin: -40px auto 0; position: relative; z-index: 5;
    background: var(--surface); border-radius: var(--radius);
    box-shadow: var(--shadow); padding: 16px;
    display: flex; gap: 10px; flex-wrap: wrap; align-items: center;
    max-width: 860px;
}
.ai-quick input[type="text"] { flex: 1; min-width: 220px; }

/* ---------------- 区块 ---------------- */
.section { padding: 46px 0 20px; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 14px; margin-bottom: 22px; }
.section-head h2 { margin: 0; font-size: clamp(20px, 2.6vw, 27px); }
.section-head p { margin: 4px 0 0; color: var(--text-muted); font-size: 14.5px; }

.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.card {
    background: var(--surface); border-radius: var(--radius);
    box-shadow: var(--shadow-sm); padding: 22px;
    border: 1px solid var(--line);
    transition: .2s;
}
.card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.card h3 { margin: 0 0 8px; font-size: 17px; }
.card p { margin: 0; color: var(--text-muted); font-size: 14.5px; }
.card .card-link { margin-top: 12px; display: inline-block; font-weight: 600; font-size: 14px; }

.feature-icon {
    width: 46px; height: 46px; border-radius: 12px; margin-bottom: 14px;
    background: var(--royal-soft); color: var(--royal);
    display: flex; align-items: center; justify-content: center; font-size: 22px;
}

/* 品类 */
.cat-tile {
    background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--radius); padding: 18px; text-align: center;
    transition: .2s; box-shadow: var(--shadow-sm);
}
.cat-tile:hover { border-color: var(--royal); transform: translateY(-2px); box-shadow: var(--shadow); }
.cat-tile .ico { font-size: 26px; }
.cat-tile b { display: block; margin-top: 8px; font-size: 15.5px; }
.cat-tile small { color: var(--text-muted); font-size: 12.5px; }

/* 供应商/产品卡片 */
.entity-card { display: flex; flex-direction: column; }
.entity-card .head { display: flex; justify-content: space-between; align-items: start; gap: 10px; }
.entity-card .meta { color: var(--text-muted); font-size: 13.5px; margin-top: 6px; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.badge {
    font-size: 12px; padding: 3px 10px; border-radius: 999px;
    background: var(--royal-soft); color: var(--royal); border: 1px solid #ccd8ff;
}
.badge.gold { background: #fff6dc; color: #8a6400; border-color: #f0d890; }
.badge.green { background: #e8f7ee; color: #14663a; border-color: #bfe8d0; }
.score-pill {
    font-size: 12.5px; font-weight: 700; color: #fff;
    background: linear-gradient(135deg, var(--royal), var(--royal-light));
    padding: 4px 12px; border-radius: 999px; white-space: nowrap;
}
.score-pill.high { background: linear-gradient(135deg, #b07d00, var(--accent)); }

/* 步骤 */
.steps { counter-reset: step; display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.step { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow-sm); }
.step h3 { margin: 10px 0 6px; font-size: 16.5px; }

/* ---------------- 表单 ---------------- */
input[type="text"], input[type="email"], input[type="password"], input[type="url"],
select, textarea {
    width: 100%; padding: 11px 14px; border: 1.5px solid var(--line);
    border-radius: 10px; font-size: 15px; font-family: inherit;
    background: #fff; color: var(--text); transition: .2s;
}
input:focus, select:focus, textarea:focus {
    outline: none; border-color: var(--royal);
    box-shadow: 0 0 0 3px rgba(0, 51, 160, .12);
}
textarea { min-height: 120px; resize: vertical; }
label { font-size: 14px; font-weight: 600; display: inline-block; margin: 14px 0 6px; color: var(--text); }
.form-card { max-width: 480px; margin: 40px auto; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-actions { margin-top: 20px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.form-note { color: var(--text-muted); font-size: 13px; margin-top: 10px; }
.hint { color: var(--text-muted); font-size: 12.5px; margin-top: 4px; }

/* 搜索/筛选条 */
.filter-bar {
    background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--radius); padding: 14px; margin-bottom: 22px;
    box-shadow: var(--shadow-sm);
    display: flex; gap: 10px; flex-wrap: wrap; align-items: center;
}
.filter-bar input[type="text"] { flex: 1; min-width: 200px; }
.filter-bar select { width: auto; min-width: 150px; }

/* ---------------- 表格 ---------------- */
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
table.table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 640px; }
.table th, .table td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th { background: var(--royal-soft); color: var(--royal-dark); font-size: 13px; white-space: nowrap; }
.table tr:last-child td { border-bottom: 0; }
.table tr:hover td { background: #f7f9ff; }

/* ---------------- 分页 ---------------- */
.pagination { display: flex; gap: 6px; margin: 26px 0; flex-wrap: wrap; }
.pagination a, .pagination span {
    padding: 7px 13px; border-radius: 8px; font-size: 14px;
    border: 1px solid var(--line); background: #fff; color: var(--text);
}
.pagination .current { background: var(--royal); border-color: var(--royal); color: #fff; font-weight: 600; }

/* ---------------- 详情页 ---------------- */
.page-head { padding: 38px 0 6px; }
.page-head h1 { margin: 0 0 8px; font-size: clamp(24px, 3.4vw, 34px); }
.page-head p { color: var(--text-muted); margin: 0; max-width: 780px; }
.detail-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 22px; align-items: start; margin: 24px 0 50px; }
.detail-side { position: sticky; top: 84px; }
.kv { margin: 6px 0; font-size: 14.5px; }
.kv b { color: var(--text-muted); font-weight: 600; margin-right: 6px; }
.article-body { font-size: 15.5px; line-height: 1.9; }
.article-body h2 { font-size: 20px; margin-top: 26px; }

/* AI 页 */
.ai-panel { background: linear-gradient(150deg, var(--royal-deep), var(--royal) 70%); color: #fff; border-radius: var(--radius); padding: 34px; box-shadow: var(--shadow); margin: 28px 0; position: relative; overflow: hidden; }
.ai-panel::after { content: "✦"; position: absolute; right: -20px; top: -30px; font-size: 200px; opacity: .06; }
.ai-panel h1 { margin: 0 0 8px; }
.ai-panel p { opacity: .9; margin: 0 0 18px; }
.ai-panel textarea { background: rgba(255,255,255,.96); }
.ai-panel label { color: #dbe4ff; }
.ai-examples { margin-top: 12px; font-size: 13.5px; opacity: .9; }
.ai-examples a { color: #ffd66b; margin-right: 8px; }
.ai-summary-card { background: #fff9e8; border: 1px solid #f0d890; border-radius: var(--radius); padding: 18px 22px; margin: 20px 0; }
.ai-summary-card h3 { margin: 0 0 8px; color: #7a5b00; font-size: 15.5px; }
.ai-engine-tag { display: inline-block; font-size: 12px; background: var(--royal-soft); color: var(--royal); padding: 3px 10px; border-radius: 999px; border: 1px solid #ccd8ff; }

/* 页脚 */
.site-footer { background: var(--royal-deep); color: #c7d3f5; margin-top: 60px; padding: 46px 0 0; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 26px; padding-bottom: 30px; }
.footer-brand .brand-logo { background: rgba(255,255,255,.12); }
.footer-col h4 { color: #fff; font-size: 14.5px; margin: 0 0 12px; }
.footer-col a { display: block; color: #c7d3f5; font-size: 13.5px; padding: 3px 0; }
.footer-col a:hover { color: #fff; }
.footer-tagline { font-size: 13.5px; opacity: .8; max-width: 300px; }
.footer-bottom {
    display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px;
    border-top: 1px solid rgba(255,255,255,.14);
    padding: 16px 20px; font-size: 12.5px; opacity: .75;
}

/* 响应式 */
@media (max-width: 960px) {
    .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .steps { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .detail-grid { grid-template-columns: 1fr; }
    .detail-side { position: static; }
}
@media (max-width: 720px) {
    .nav-toggle { display: block; margin-left: auto; }
    .header-inner { flex-wrap: wrap; height: auto; padding: 10px 0; }
    .main-nav {
        display: none; flex-basis: 100%; flex-direction: column;
        align-items: stretch; padding: 8px 0 12px; gap: 2px;
    }
    .main-nav.open { display: flex; }
    .main-nav a { padding: 11px 14px; }
    .header-actions { margin-left: 0; order: 3; flex-basis: 100%; padding-bottom: 10px; justify-content: flex-start; }
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; }
    .hero { padding: 46px 0 66px; }
    .ai-panel { padding: 24px 18px; }
}

/* 打印 */
@media print { .site-header, .site-footer, .filter-bar, .ai-quick { display: none; } }

/* ---------------- 企业 / 工厂档案 ---------------- */
.stat-strip {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px;
    margin: 18px 0 6px;
}
.stat-item {
    background: linear-gradient(140deg, var(--royal) 0%, var(--royal-light) 100%);
    color: #fff; border-radius: 12px; padding: 14px 16px;
    box-shadow: var(--shadow-sm);
}
.stat-item b { display: block; font-size: clamp(17px, 2vw, 21px); line-height: 1.3; }
.stat-item span { font-size: 12.5px; opacity: .82; }

.fact-list { margin: 8px 0 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 0 26px; }
.fact-row { display: flex; gap: 10px; padding: 7px 0; border-bottom: 1px dashed var(--line); font-size: 14.5px; }
.fact-row dt { flex: 0 0 100px; color: var(--text-muted); font-weight: 600; }
.fact-row dd { margin: 0; flex: 1; color: var(--text); }

.sub-block { margin-top: 16px; }
.sub-block:first-of-type { margin-top: 6px; }
.sub-block h4 { margin: 0 0 6px; font-size: 14.5px; color: var(--royal-dark); }
.sub-block p { margin: 0; color: var(--text); font-size: 14.5px; }

.check-list { margin: 6px 0 0; padding-left: 0; list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: 4px 18px; }
.check-list li { position: relative; padding-left: 22px; font-size: 14.5px; }
.check-list li::before {
    content: "✓"; position: absolute; left: 0; top: 0;
    color: var(--royal); font-weight: 700;
}

.case-list { margin: 8px 0 0; padding-left: 0; list-style: none; }
.case-list li {
    position: relative; padding: 9px 0 9px 26px;
    border-bottom: 1px dashed var(--line); font-size: 14.5px;
}
.case-list li:last-child { border-bottom: 0; }
.case-list li::before {
    content: "◆"; position: absolute; left: 4px; top: 9px;
    color: var(--accent); font-size: 11px;
}

.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 12px; }
.gallery img { width: 100%; height: 130px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); }

.contact-list { margin-top: 6px; }
.contact-list > div {
    display: flex; gap: 10px; padding: 7px 0;
    border-bottom: 1px dashed var(--line); font-size: 13.8px;
}
.contact-list > div:last-child { border-bottom: 0; }
.contact-list span { flex: 0 0 74px; color: var(--text-muted); }
.contact-list b { font-weight: 600; word-break: break-word; }

@media (max-width: 960px) {
    .stat-strip { grid-template-columns: repeat(2, 1fr); }
    .fact-list { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
    .check-list { grid-template-columns: 1fr; }
    .gallery { grid-template-columns: repeat(2, 1fr); }
}
