/* =====================================================================
   庆阳苹果地理标志证明商标授权查询系统 - 前台样式
   风格：庄重、清晰、政务公信力（绛红 + 金 + 米白）
   布局：移动端优先，桌面端渐进增强
   ===================================================================== */
:root {
  --red: #8c1f28;          /* 政务绛红 */
  --red-dark: #6e161e;
  --gold: #c9a86a;         /* 描金 */
  --ink: #2b2b2b;
  --ink-2: #5c5c5c;
  --bg: #f7f5f0;
  --card: #ffffff;
  --line: #e4ded2;
  --ok: #1b7a3d;
  --warn: #b26a00;
  --err: #a02020;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg); color: var(--ink); line-height: 1.65;
  min-height: 100dvh; display: flex; flex-direction: column;
}
a { color: var(--red); text-decoration: none; }
img { max-width: 100%; }

/* ---------- 顶部 ---------- */
.site-header { background: var(--red); color: #fff; text-align: center; padding: 26px 16px 22px; }
.site-header .emblem {
  width: 54px; height: 54px; margin: 0 auto 10px; border: 2px solid var(--gold);
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-family: KaiTi, STKaiti, serif; font-size: 20px; color: var(--gold); background: rgba(0,0,0,.12);
}
.site-header h1 {
  font-size: clamp(18px, 4.2vw, 28px); font-family: "Songti SC", SimSun, serif;
  letter-spacing: 2px; font-weight: 700;
}
.site-header .sub { margin-top: 6px; font-size: 13px; color: rgba(255,255,255,.85); letter-spacing: 4px; }
.site-header .notice-bar {
  margin-top: 14px; font-size: 12px; color: #ffe9c9; background: rgba(0,0,0,.18);
  display: inline-block; padding: 3px 14px; border-radius: 2px;
}

/* ---------- 查询区 ---------- */
.search-wrap { background: linear-gradient(180deg, #fff 0%, var(--bg) 100%); padding: 26px 16px 30px; }
.search-box { max-width: 680px; margin: 0 auto; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 22px 18px; box-shadow: 0 4px 16px rgba(60,40,20,.06); }
.search-box h2 { font-size: 16px; color: var(--red); text-align: center; margin-bottom: 4px; font-family: "Songti SC", SimSun, serif; letter-spacing: 2px; }
.search-box .tip { text-align: center; font-size: 12px; color: var(--ink-2); margin-bottom: 16px; }
.type-switch { display: flex; border: 1px solid var(--red); border-radius: 6px; overflow: hidden; margin-bottom: 12px; }
.type-switch button { flex: 1; padding: 9px 0; border: 0; background: #fff; color: var(--red); font-size: 14px; cursor: pointer; }
.type-switch button.on { background: var(--red); color: #fff; }
.search-row { display: flex; gap: 8px; }
.search-row input[type=text] {
  flex: 1; min-width: 0; padding: 11px 12px; font-size: 15px; border: 1px solid var(--line);
  border-radius: 6px; outline: none;
}
.search-row input[type=text]:focus { border-color: var(--red); box-shadow: 0 0 0 2px rgba(140,31,40,.12); }
.search-row button {
  padding: 11px 22px; background: var(--red); color: #fff; border: 0; border-radius: 6px;
  font-size: 15px; cursor: pointer; white-space: nowrap;
}
.search-row button:active { background: var(--red-dark); }

/* ---------- 结果区 ---------- */
.results { max-width: 680px; margin: 0 auto; padding: 0 16px 40px; width: 100%; }
.results h3 { font-size: 15px; color: var(--ink-2); font-weight: normal; margin: 18px 2px 12px; }
.cert-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  padding: 18px 16px; margin-bottom: 16px; position: relative; overflow: hidden;
}
.cert-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--red); }
.cert-card .head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 12px; }
.cert-card .company { font-size: 17px; font-weight: 700; color: var(--ink); }
.cert-card .cert-no { font-size: 12.5px; color: var(--ink-2); margin-top: 3px; }
.badge { flex-shrink: 0; padding: 3px 10px; border-radius: 3px; font-size: 12.5px; color: #fff; letter-spacing: 1px; }
.st-active   { background: var(--ok); }
.st-expiring { background: var(--warn); }
.st-expired  { background: #9e9e9e; }
.st-revoked  { background: var(--err); }
.st-pending  { background: var(--gold); color: #4a3a10; }
.cert-card .body { display: flex; gap: 14px; align-items: flex-start; }
.cert-card .logo { width: 84px; flex-shrink: 0; border: 1px solid var(--line); border-radius: 6px; padding: 4px; background: #fff; }
.cert-card .logo img { display: block; width: 100%; }
.kv { font-size: 13.5px; color: var(--ink-2); }
.kv b { color: var(--ink); font-weight: 600; }
.kv p + p { margin-top: 4px; }
.cert-card .foot { display: flex; gap: 10px; margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line); flex-wrap: wrap; align-items: center; }
.cert-card .foot a, .cert-card .foot button {
  font-size: 13px; color: var(--red); border: 1px solid var(--red); background: #fff;
  padding: 5px 12px; border-radius: 4px; cursor: pointer;
}
.cert-card .qr-thumb { margin-left: auto; text-align: center; font-size: 11px; color: var(--ink-2); }
.cert-card .qr-thumb img { width: 64px; height: 64px; display: block; border: 1px solid var(--line); }
.empty { text-align: center; color: var(--ink-2); padding: 40px 0; font-size: 14px; }
.empty .icon { font-size: 40px; display: block; margin-bottom: 10px; color: var(--gold); }

/* ---------- 防伪提示 ---------- */
.verify-tips { max-width: 680px; margin: 0 auto 40px; padding: 0 16px; }
.verify-tips .tip-box { background: #fdf8ef; border: 1px solid var(--gold); border-radius: 8px; padding: 14px 16px; font-size: 13px; color: #6b5a3e; }
.verify-tips .tip-box b { color: var(--red); }
.verify-tips ul { margin: 6px 0 0 18px; }
.verify-tips li { margin-top: 4px; }

/* ---------- 详情/验真页 ---------- */
.detail-wrap { max-width: 720px; margin: 0 auto; padding: 24px 16px 48px; width: 100%; }
.detail-card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 26px 20px; }
.detail-card .top { display: flex; gap: 16px; align-items: center; border-bottom: 1px solid var(--line); padding-bottom: 16px; margin-bottom: 16px; }
.detail-card .top .logo { width: 96px; flex-shrink: 0; }
.detail-card .top h2 { font-size: 19px; }
.detail-card .top .no { font-size: 13px; color: var(--ink-2); margin-top: 4px; }
.detail-card .top .badge { margin-top: 8px; display: inline-block; }
.dl { display: grid; grid-template-columns: 1fr; gap: 0; }
.dl .row { display: flex; padding: 9px 0; border-bottom: 1px dashed #efe9dd; font-size: 14px; }
.dl .row:last-child { border-bottom: 0; }
.dl dt { width: 118px; flex-shrink: 0; color: var(--ink-2); }
.dl dd { flex: 1; color: var(--ink); font-weight: 500; word-break: break-all; }
.qr-block { text-align: center; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.qr-block img { width: 150px; height: 150px; border: 1px solid var(--line); border-radius: 6px; padding: 6px; background: #fff; }
.qr-block p { font-size: 12.5px; color: var(--ink-2); margin-top: 8px; }
.actions { text-align: center; margin-top: 20px; }
.actions a, .actions button {
  display: inline-block; margin: 4px; padding: 9px 22px; border-radius: 5px; font-size: 14px;
  background: var(--red); color: #fff; border: 0; cursor: pointer;
}
.actions .ghost { background: #fff; color: var(--red); border: 1px solid var(--red); }

/* ---------- 页脚 ---------- */
.site-footer { margin-top: auto; background: #3a3a3a; color: #b9b9b9; text-align: center; padding: 22px 16px; font-size: 12px; line-height: 2; }
.site-footer a { color: #d8c9a5; }

/* ---------- 桌面端增强 ---------- */
@media (min-width: 640px) {
  .search-wrap { padding: 40px 16px 36px; }
  .dl { grid-template-columns: 1fr 1fr; column-gap: 28px; }
  .dl .row { border-bottom: 1px dashed #efe9dd; }
  .cert-card { padding: 22px 22px 22px 24px; }
  .cert-card .logo { width: 104px; }
}
@media print {
  .no-print { display: none !important; }
  body { background: #fff; }
}
