/* CHIC COI 证书查询站 · 主题样式（Bootstrap 3 之上） */
:root {
    --navy: #153c7d;
    --navy-dark: #0c2755;
    --navy-deep: #081c40;
    --red: #d3401e;
    --ink: #26364d;
    --muted: #6c7b90;
    --line: #dfe6f0;
    --bg: #f3f6fb;
    --green: #1f8a5b;
}

html, body { min-height: 100%; }
body {
    background: var(--bg);
    color: var(--ink);
    font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}
body.lang-en { font-family: "Segoe UI", Helvetica, Arial, sans-serif; }
body.lang-ar, body.rtl { font-family: Tahoma, "Segoe UI", Arial, sans-serif; font-size: 15px; }
a { color: var(--navy); }
a:hover, a:focus { color: var(--red); text-decoration: none; }

/* ---------------- 顶部工具条 ---------------- */
.topbar { background: var(--navy-deep); color: #cbd8ee; font-size: 12px; }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; min-height: 36px; }
.topbar-note { display: inline-flex; align-items: center; gap: 8px; letter-spacing: .2px; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: #3ecf8e; display: inline-block; box-shadow: 0 0 0 3px rgba(62,207,142,.18); }
.lang-switch { display: inline-flex; align-items: center; gap: 4px; }
.lang-caption { color: #8fa6c8; margin-inline-end: 8px; }
.lang-btn {
    color: #cbd8ee; padding: 3px 10px; border: 1px solid transparent; border-radius: 3px;
    font-size: 12px; line-height: 1.6; transition: all .15s;
}
.lang-btn:hover { color: #fff; border-color: rgba(255,255,255,.25); background: rgba(255,255,255,.07); }
.lang-btn.active { color: #fff; background: var(--red); border-color: var(--red); font-weight: 600; }

/* ---------------- 机构头部 ---------------- */
.site-header { background: #fff; border-bottom: 1px solid var(--line); box-shadow: 0 1px 6px rgba(12,39,85,.05); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 18px 15px; }
.brand-block { display: flex; align-items: center; gap: 16px; min-width: 0; }
.brand-logo { width: 78px; height: 78px; object-fit: contain; flex: none; }
.brand-cn { font-size: 21px; font-weight: 700; color: var(--navy-dark); letter-spacing: 1px; line-height: 1.35; }
.brand-en { font-size: 11px; letter-spacing: .6px; color: var(--muted); text-transform: uppercase; margin-top: 4px; direction: ltr; unicode-bidi: embed; display: inline-block; }
.marks-block { display: flex; align-items: center; gap: 18px; flex: none; }
.mark-item { display: flex; align-items: center; gap: 10px; max-width: 230px; }
.mark-logo { object-fit: contain; }
.mark-goeic { width: 54px; height: 54px; }
.mark-egac { width: 116px; height: 58px; }
.mark-caption { font-size: 11px; line-height: 1.4; color: var(--muted); }
.mark-sep { width: 1px; height: 46px; background: var(--line); }

/* ---------------- 主视觉 ---------------- */
.hero {
    background: linear-gradient(115deg, var(--navy-deep) 0%, var(--navy) 58%, #20559e 100%);
    color: #fff; padding: 34px 0 76px; position: relative; overflow: hidden;
}
.hero::after {
    content: ""; position: absolute; inset-inline-end: -120px; top: -140px;
    width: 430px; height: 430px; border-radius: 50%;
    border: 60px solid rgba(255,255,255,.045);
}
.hero-copy { position: relative; z-index: 1; }
.hero-eyebrow { font-size: 11px; letter-spacing: 2.4px; color: #8fb4ec; text-transform: uppercase; margin-bottom: 8px; }
.hero h1 { font-size: 31px; font-weight: 700; margin: 0 0 6px; letter-spacing: 1px; }
.hero p { margin: 0; color: #c9daf3; font-size: 15px; }

/* ---------------- 查询卡片 ---------------- */
.main-wrap { position: relative; }
.search-card {
    background: #fff; border: 1px solid var(--line); border-radius: 6px;
    box-shadow: 0 12px 34px rgba(12,39,85,.11);
    margin-top: -46px; position: relative; z-index: 3; margin-bottom: 28px;
}
.card-head { display: flex; align-items: center; gap: 14px; padding: 22px 28px 16px; border-bottom: 1px solid #eef2f8; }
.card-icon {
    width: 42px; height: 42px; border-radius: 6px; flex: none;
    background: #eaf0fb; color: var(--navy); display: flex; align-items: center; justify-content: center;
}
.card-head h2 { font-size: 19px; margin: 0; color: var(--navy-dark); font-weight: 700; }
.card-head p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.search-form { padding: 22px 28px 24px; }
.control-label { display: block; font-weight: 600; color: var(--navy-dark); margin-bottom: 8px; font-size: 13px; }
.input-row { display: flex; gap: 10px; flex-wrap: wrap; }
.cert-input {
    flex: 1 1 300px; height: 46px; border-radius: 4px; border: 1px solid #ccd7e7;
    font-size: 15px; letter-spacing: .4px; box-shadow: none; min-width: 200px;
    font-family: Consolas, "Courier New", monospace; direction: ltr; text-align: left;
}
.cert-input:focus { border-color: var(--navy); box-shadow: 0 0 0 3px rgba(21,60,125,.10); }
.btn-search, .btn-download {
    background: var(--red); color: #fff; border: 1px solid var(--red);
    border-radius: 4px; padding: 0 26px; height: 46px; font-size: 15px; font-weight: 600;
    transition: all .15s;
}
.btn-search:hover, .btn-download:hover { background: #b93518; border-color: #b93518; color: #fff; }
.btn-clear { height: 46px; line-height: 32px; padding: 0 18px; border: 1px solid #ccd7e7; color: var(--muted); border-radius: 4px; }
.btn-clear:hover { background: #f6f8fc; color: var(--navy); }
.search-tip { margin: 10px 0 0; color: var(--muted); font-size: 12px; }
.form-alert { margin: 14px 0 0; padding: 10px 14px; }

/* ---------------- 结果区 ---------------- */
.result-panel {
    background: #fff; border: 1px solid var(--line); border-radius: 6px;
    box-shadow: 0 4px 18px rgba(12,39,85,.06); margin-bottom: 22px; padding: 24px 28px;
}
.result-ok { border-top: 4px solid var(--green); }
.result-danger { border-top: 4px solid var(--red); }
.result-warning { border-top: 4px solid #d99b1c; }
.result-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.result-status { margin-bottom: 10px; }
.status-badge {
    display: inline-block; background: #fdecea; color: #b93518; border: 1px solid #f6c8be;
    border-radius: 3px; padding: 4px 12px; font-size: 12px; font-weight: 600; letter-spacing: .3px;
}
.status-ok { background: #e8f6ef; color: #16724a; border-color: #bce2cf; }
.result-panel h2 { font-size: 22px; margin: 10px 0 4px; color: var(--navy-dark); font-weight: 700; }
.result-desc { color: var(--muted); margin: 0; font-size: 13px; }
.result-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.result-actions .btn { height: 40px; line-height: 26px; font-size: 13px; padding: 0 16px; }
.dl-icon { font-size: 16px; margin-inline-end: 4px; }
.btn-download.disabled { opacity: .65; pointer-events: none; }
.looked-up { margin: 16px 0; color: var(--muted); font-size: 13px; }
.looked-up code { background: #f2f5fa; color: var(--navy-dark); padding: 3px 8px; font-size: 13px; }
.btn-back { margin-top: 4px; }
.certno-bar {
    margin-top: 20px; padding: 14px 18px; background: #f4f8fd;
    border: 1px dashed #c5d5ec; border-radius: 4px;
    display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
}
.certno-label { color: var(--muted); font-size: 12px; display: block; margin-bottom: 2px; }
.certno-value {
    font-size: 20px; font-weight: 700; color: var(--navy-dark); letter-spacing: 1px;
    font-family: Consolas, "Courier New", monospace; direction: ltr; unicode-bidi: embed;
}
.btn-copy { background: #fff; border: 1px solid #ccd7e7; color: var(--navy); border-radius: 3px; padding: 6px 14px; font-size: 12px; }
.btn-copy:hover { background: #eaf0fb; }
.download-tip { margin: 10px 0 0; color: var(--muted); font-size: 12px; }

/* ---------------- 字段分组 ---------------- */
.field-panel { border: 1px solid var(--line); border-radius: 5px; box-shadow: none; margin-bottom: 18px; }
.field-panel > .panel-heading {
    background: #f8fafd; color: var(--navy-dark); font-weight: 700; font-size: 15px;
    border-bottom: 1px solid var(--line); padding: 12px 18px;
    display: flex; align-items: center; gap: 9px;
}
.panel-bar { width: 3px; height: 16px; background: var(--red); border-radius: 2px; display: inline-block; flex: none; }
.field-panel > .panel-body { padding: 4px 18px 16px; }
.field-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 26px; margin: 0; }
.field-cell { padding: 11px 0; border-bottom: 1px dashed #e9eef6; min-width: 0; }
.field-cell dt { font-size: 12px; color: var(--muted); font-weight: 400; margin-bottom: 3px; }
.field-cell dd {
    font-size: 13px; color: var(--ink); font-weight: 600; word-break: break-word;
    margin: 0; direction: ltr; unicode-bidi: plaintext;
}
.internal-warning { color: #a9721b; background: #fff8e8; border: 1px solid #f2dfae; padding: 8px 12px; border-radius: 3px; font-size: 12px; margin: 14px 0 4px; }
.count-pill { background: var(--navy); color: #fff; border-radius: 20px; font-size: 11px; padding: 2px 9px; margin-inline-start: 4px; }
.no-products { color: var(--muted); margin: 14px 0 4px; }
.products-table { font-size: 12px; margin: 14px 0 0; background: #fff; }
.products-table th { background: #f2f6fc; color: var(--navy-dark); white-space: nowrap; font-size: 12px; }
.products-table td { word-break: break-word; direction: ltr; unicode-bidi: plaintext; }
.data-note { color: var(--muted); font-size: 12px; padding: 4px 2px 26px; }

/* ---------------- 说明 / 资质 ---------------- */
.help-section { padding: 10px 0 22px; }
.help-section h3, .accred-section h3 { font-size: 18px; color: var(--navy-dark); font-weight: 700; margin: 12px 0 18px; }
.help-step { background: #fff; border: 1px solid var(--line); border-radius: 5px; padding: 18px 20px; height: 100%; display: flex; gap: 14px; align-items: flex-start; }
.step-no { font-size: 22px; font-weight: 700; color: #c9d7ea; font-family: Consolas, monospace; flex: none; }
.help-step p { margin: 0; color: #4c5c72; font-size: 13px; }
.accred-section { background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 8px 26px 22px; margin-bottom: 34px; }
.accred-grid { display: flex; flex-wrap: wrap; gap: 18px; }
.accred-item {
    flex: 1 1 220px; display: flex; align-items: center; gap: 14px;
    border: 1px solid #edf1f7; border-radius: 4px; padding: 12px 16px; min-width: 210px;
}
.accred-item img { width: 58px; height: 58px; object-fit: contain; flex: none; }
.accred-item span { font-size: 12px; color: var(--muted); line-height: 1.5; }
.accred-note { color: #8b98aa; font-size: 11px; margin: 18px 0 0; }

/* ---------------- 页脚 ---------------- */
.site-footer { background: var(--navy-deep); color: #b8c9e3; padding: 30px 0 18px; }
.footer-main { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.footer-brand { display: flex; align-items: center; gap: 12px; }
.footer-brand img { width: 46px; height: 46px; object-fit: contain; background: #fff; border-radius: 50%; padding: 2px; }
.footer-brand strong { color: #fff; font-size: 15px; letter-spacing: .5px; }
.footer-text { text-align: end; font-size: 12px; }
.footer-text p { margin: 0 0 3px; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.10); margin-top: 22px; padding-top: 14px; display: flex; justify-content: space-between; font-size: 11px; color: #829abf; flex-wrap: wrap; gap: 8px; }

/* ---------------- 阿拉伯语 RTL ---------------- */
[dir="rtl"] { text-align: right; }
[dir="rtl"] .row > [class*="col-"] { float: right; }
[dir="rtl"] .footer-text { text-align: left; }
[dir="rtl"] .hero::after { inset-inline-end: auto; inset-inline-start: -120px; }
[dir="rtl"] .hero h1, [dir="rtl"] .brand-cn { letter-spacing: 0; }
[dir="rtl"] .cert-input, [dir="rtl"] .certno-value, [dir="rtl"] .field-cell dd,
[dir="rtl"] .products-table td { text-align: right; }
[dir="rtl"] .looked-up code, [dir="rtl"] .certno-value { direction: ltr; display: inline-block; }
[dir="rtl"] .lang-caption { margin-inline-end: 0; margin-inline-start: 8px; }
[dir="rtl"] .btn-print, [dir="rtl"] .btn-back { direction: rtl; }

/* ---------------- 响应式 ---------------- */
@media (max-width: 991px) {
    .field-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .header-inner { flex-wrap: wrap; }
    .marks-block { width: 100%; justify-content: flex-start; }
}
@media (max-width: 640px) {
    .field-grid { grid-template-columns: 1fr; }
    .brand-cn { font-size: 17px; }
    .brand-logo { width: 62px; height: 62px; }
    .marks-block { gap: 10px; }
    .mark-caption { display: none; }
    .hero { padding: 26px 0 68px; }
    .hero h1 { font-size: 23px; }
    .card-head, .search-form, .result-panel { padding-left: 16px; padding-right: 16px; }
    .btn-search, .btn-download { flex: 1 1 100%; }
    .certno-value { font-size: 16px; }
    .accred-section { padding-left: 16px; padding-right: 16px; }
}

/* ---------------- 打印 ---------------- */
@media print {
    body { background: #fff; }
    .topbar, .site-header, .hero, .search-card, .help-section, .accred-section,
    .site-footer, .result-actions, .btn-copy, .btn-print, .btn-back, .download-tip { display: none !important; }
    .main-wrap { margin-top: 0; }
    .result-panel, .field-panel { box-shadow: none; break-inside: avoid; }
    .field-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
