/* 食品标准与法规 H5 */
:root {
  --green: #1B9A6A;
  --green-light: #E8F7F0;
  --green-bg: #F2FBF6;
  --orange: #E68A00;
  --blue: #4A6CF7;
  --red: #D9534F;
  --ink: #1F2D3D;
  --ink-2: #4A5A6E;
  --ink-3: #A8B2C1;
  --line: #EDF1F5;
  --bg: #F5F7FA;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  padding-bottom: calc(64px + env(safe-area-inset-bottom));
}

a { text-decoration: none; color: inherit; }

/* ===== 底部导航 ===== */
#tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  display: flex;
  background: #fff;
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
#tabbar a {
  flex: 1; text-align: center; padding: 8px 0 6px;
  font-size: 11px; color: #8A94A6;
}
#tabbar a .ti { display: block; font-size: 20px; margin-bottom: 2px; }
#tabbar a.on { color: var(--green); }

/* ===== 通用 ===== */
.page { padding: 14px 14px 24px; }
.card {
  background: #fff; border-radius: 12px; padding: 16px;
  margin-bottom: 12px;
  box-shadow: 0 1px 6px rgba(31,45,61,.05);
}
.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 10px;
  background: #fff; border-bottom: 1px solid var(--line);
  padding: 12px 14px;
}
.topbar .back { font-size: 20px; color: var(--ink); line-height: 1; padding: 2px 6px 2px 0; }
.topbar .title { font-size: 16px; font-weight: 600; flex: 1; }

.badge {
  display: inline-block; padding: 2px 8px; border-radius: 6px;
  font-size: 11px; line-height: 1.5;
}
.b-current { background: var(--green-light); color: var(--green); }
.b-upcoming { background: #FFF4E5; color: var(--orange); }
.b-draft { background: #EDF1FF; color: var(--blue); }
.b-deprecated { background: #FDECEC; color: var(--red); }
.b-cat { background: #F0F3F7; color: var(--ink-2); }

.block-title { font-size: 15px; font-weight: 600; margin-bottom: 8px; }
.block-text { font-size: 13px; color: var(--ink-2); line-height: 1.7; }

/* ===== 首页 ===== */
.hero {
  background: linear-gradient(135deg, #1B9A6A, #23B57F);
  color: #fff; border-radius: 14px; padding: 20px 16px;
  margin-bottom: 12px;
}
.hero h1 { font-size: 20px; }
.hero p { font-size: 12px; opacity: .9; margin-top: 6px; line-height: 1.6; }

.searchbar {
  display: flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,.18); border-radius: 20px;
  padding: 9px 14px; margin-top: 14px; color: rgba(255,255,255,.85);
  font-size: 13px;
}

.cats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.cat {
  text-align: center; background: #fff; border-radius: 12px;
  padding: 12px 2px;
  box-shadow: 0 1px 6px rgba(31,45,61,.05);
}
.cat .ci { font-size: 24px; }
.cat .cn { font-size: 11px; color: var(--ink-2); margin-top: 4px; }

.sec-head { display: flex; align-items: center; justify-content: space-between; margin: 16px 2px 10px; }
.sec-head .st { font-size: 16px; font-weight: 700; }
.sec-head .more { font-size: 12px; color: var(--green); }

.item {
  display: flex; align-items: flex-start; justify-content: space-between;
  background: #fff; border-radius: 12px; padding: 13px 14px; margin-bottom: 10px;
  box-shadow: 0 1px 6px rgba(31,45,61,.05);
}
.item .l { flex: 1; min-width: 0; }
.item .code { font-size: 14px; font-weight: 700; }
.item .name { font-size: 12px; color: var(--ink-2); margin-top: 3px; line-height: 1.5; }
.item .meta { margin-top: 6px; display: flex; gap: 6px; flex-wrap: wrap; }
.item .r { flex-shrink: 0; margin-left: 10px; text-align: center; }
.item .dl { font-size: 20px; font-weight: 700; color: var(--orange); }
.item .dl-t { font-size: 10px; color: var(--ink-3); }

.news-card .nt { font-size: 13.5px; font-weight: 600; line-height: 1.5; }
.news-card .ns { font-size: 11px; color: var(--ink-3); margin-top: 6px; }
.news-card .nsum { font-size: 12px; color: var(--ink-2); margin-top: 6px; line-height: 1.6; }

/* ===== 列表页 ===== */
.filters { position: sticky; top: 47px; z-index: 30; background: var(--bg); padding-bottom: 10px; }
.search-input {
  width: 100%; border: none; outline: none;
  background: #fff; border-radius: 10px;
  padding: 10px 14px; font-size: 14px;
  box-shadow: 0 1px 6px rgba(31,45,61,.05);
}
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 10px 2px 2px; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex-shrink: 0; font-size: 12px; color: var(--ink-2);
  background: #fff; padding: 6px 14px; border-radius: 16px;
}
.chip.on { background: var(--green); color: #fff; }
.count { font-size: 11px; color: var(--ink-3); margin: 4px 2px 10px; }

/* ===== 详情页 ===== */
.head-card {
  background: linear-gradient(135deg, #1B9A6A, #23B57F);
  color: #fff; border-radius: 14px; padding: 18px 16px; margin-bottom: 12px;
}
.head-card .badges { display: flex; gap: 8px; margin-bottom: 10px; }
.head-card .badge { background: rgba(255,255,255,.2); color: #fff; }
.head-card .code { font-size: 20px; font-weight: 700; line-height: 1.3; }
.head-card .name { font-size: 14px; margin-top: 6px; line-height: 1.5; opacity: .95; }
.countdown {
  display: flex; align-items: center; gap: 10px;
  background: rgba(255,255,255,.18); border-radius: 10px;
  padding: 10px 12px; margin-top: 12px;
}
.countdown .num { font-size: 22px; font-weight: 700; }
.countdown .txt { font-size: 12px; opacity: .95; }

.info-row { display: flex; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.info-row:last-child { border-bottom: none; }
.info-label { width: 76px; color: var(--ink-3); flex-shrink: 0; }
.info-value { flex: 1; color: var(--ink); line-height: 1.55; }

.point-item { display: flex; margin-bottom: 10px; }
.point-item:last-child { margin-bottom: 0; }
.point-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); margin-top: 8px; margin-right: 10px; flex-shrink: 0; }
.point-text { flex: 1; font-size: 13px; color: var(--ink-2); line-height: 1.7; }

.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag { font-size: 11px; color: var(--green); background: var(--green-light); padding: 3px 10px; border-radius: 6px; }

.fulltext-btn {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--green); color: #fff; border-radius: 10px;
  padding: 12px; font-size: 14px; font-weight: 600; text-align: center;
}
.fulltext-btn.ghost { background: var(--green-light); color: var(--green); }
.link-line { font-size: 11px; color: var(--ink-3); word-break: break-all; margin-top: 8px; line-height: 1.5; }

.disclaimer { font-size: 11px; color: var(--ink-3); text-align: center; padding: 16px 20px 8px; line-height: 1.6; }

/* ===== 原文阅读页 ===== */
.tp-hero { background: linear-gradient(135deg, #1B9A6A, #23B57F); color: #fff; padding: 18px 16px; }
.tp-hero .code { font-size: 18px; font-weight: 700; }
.tp-hero .name { font-size: 13px; margin-top: 6px; opacity: .95; line-height: 1.5; }
.tp-hero .note { font-size: 11px; margin-top: 8px; opacity: .85; }

.tp-toolbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 10px;
  background: #fff; padding: 10px 14px; border-bottom: 1px solid var(--line);
}
.tp-toolbar .chips { flex: 1; padding: 0; }
.tp-font { display: flex; gap: 6px; flex-shrink: 0; }
.tp-font button {
  border: none; background: var(--green-light); color: var(--green);
  font-size: 12px; font-weight: 600; padding: 6px 10px; border-radius: 6px;
}

.tp-sec { padding: 16px 14px 0; }
.tp-sec-title {
  font-size: 15px; font-weight: 700;
  padding-bottom: 8px; border-bottom: 1px solid #E4E9F0;
}
.tp-article {
  background: #fff; border-radius: 10px; padding: 14px 16px; margin: 12px 0;
  box-shadow: 0 1px 6px rgba(31,45,61,.04);
  cursor: pointer;
}
.tp-art-no { font-size: 12px; color: var(--green); font-weight: 600; margin-bottom: 6px; }
.tp-art-text { color: #33475C; line-height: 1.8; }
.tp-hint { font-size: 10px; color: #C2CBD6; text-align: right; margin-top: 8px; }

/* ===== Toast ===== */
#toast {
  position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%);
  background: rgba(31,45,61,.85); color: #fff;
  font-size: 12px; padding: 8px 16px; border-radius: 8px;
  opacity: 0; pointer-events: none; transition: opacity .25s; z-index: 99;
  max-width: 80vw; text-align: center;
}
#toast.show { opacity: 1; }

.empty { text-align: center; padding: 60px 0; color: var(--ink-3); font-size: 13px; }
