:root {
  --bg: #f4f6f9;
  --card: #ffffff;
  --ink: #1f2733;
  --muted: #8a94a6;
  --line: #e8ecf2;
  --brand: #e8531a;      /* 柴油橙红 */
  --brand-d: #c63f0c;
  --youhui: #e8531a;     /* 优惠价 醒目 */
  --hanshui: #2f6fed;    /* 含税价 蓝 */
  --ok: #1ea672;
  --shadow: 0 2px 12px rgba(20, 30, 50, .06);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* 顶部 */
.topbar {
  background: linear-gradient(135deg, var(--brand), var(--brand-d));
  color: #fff;
  padding: 18px 16px 16px;
  position: sticky; top: 0; z-index: 10;
  box-shadow: var(--shadow);
}
.topbar .brand { display: flex; align-items: center; gap: 8px; font-size: 18px; font-weight: 700; }
.topbar .brand .dot { font-size: 20px; }
.topbar .sub { font-size: 12px; opacity: .9; margin-top: 2px; }
.topbar .date { font-size: 13px; opacity: .95; margin-top: 6px; }

.wrap { max-width: 720px; margin: 0 auto; padding: 14px 12px 90px; }

/* 地区选择栏 */
.region-bar {
  position: sticky; top: 90px; z-index: 9;
  background: #fff; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 8px; padding: 10px 14px;
}
.region-bar .rl { font-size: 14px; font-weight: 700; color: var(--ink); white-space: nowrap; }
.region-bar select {
  flex: 1; border: 1px solid var(--line); border-radius: 9px; padding: 9px 10px;
  font-size: 15px; background: #fbfcfe; color: var(--ink); max-width: 200px;
}
.region-bar .rh { font-size: 11px; color: var(--muted); }

/* 发改委指导价卡 */
.ndrc-card { background: linear-gradient(135deg,#fff,#fff7f3); border:1px solid #ffd9c7; border-radius:14px; padding:14px; box-shadow: var(--shadow); }
.ndrc-top { display:flex; justify-content:space-between; align-items:center; font-size:13px; color:var(--muted); }
.ndrc-region { font-weight:700; color:var(--ink); font-size:15px; }
.ndrc-main { margin-top:8px; display:flex; align-items:baseline; gap:8px; }
.ndrc-val { font-size:40px; font-weight:800; color:var(--brand); line-height:1; }
.ndrc-unit { font-size:15px; color:var(--brand-d); font-weight:700; }
.ndrc-chg { font-size:16px; font-weight:700; }
.ndrc-chg.up { color:var(--brand); }
.ndrc-chg.down { color:var(--ok); }
.ndrc-chg.flat { color:var(--muted); }
.ndrc-sub { font-size:12px; color:var(--muted); margin-top:6px; }
.compare { margin-top:10px; font-size:14px; color:var(--ink); background:#f4f6f9; border-radius:9px; padding:8px 10px; }
.compare b { color:var(--ink); }
.compare .up { color:var(--brand); }
.compare .down { color:var(--ok); }
.compare-note { font-size:11px; color:var(--muted); margin-top:4px; }

/* 底部转发栏 */
.sharebar {
  position: fixed; left:0; right:0; bottom:0; z-index: 20;
  display:flex; gap:10px; padding:10px 12px calc(10px + env(safe-area-inset-bottom));
  background:#fff; border-top:1px solid var(--line); box-shadow:0 -2px 12px rgba(20,30,50,.06);
}
.sharebar .sbtn {
  flex:1; border:none; border-radius:12px; padding:13px; font-size:15px; font-weight:700; color:#fff;
}
.sharebar .sbtn.copy { background:var(--brand); }
.sharebar .sbtn.poster { background:var(--ok); }
.sharebar .sbtn:active { transform:scale(.98); }

/* 分享图弹层 */
.poster-modal {
  position:fixed; inset:0; z-index:60; background:rgba(0,0,0,.78);
  display:none; align-items:center; justify-content:center; padding:20px;
}
.poster-modal.show { display:flex; }
.poster-inner { max-width:340px; width:100%; text-align:center; }
.poster-tip { color:#ffd9c7; font-size:13px; margin-bottom:10px; }
.poster-inner img { width:100%; border-radius:14px; box-shadow:0 8px 30px rgba(0,0,0,.4); }
.poster-inner .btn { margin-top:14px; max-width:200px; }


.section-title {
  font-size: 14px; font-weight: 700; color: var(--muted);
  margin: 18px 4px 10px; display: flex; align-items: center; gap: 6px;
}
.section-title .bar { width: 3px; height: 14px; background: var(--brand); border-radius: 2px; }

/* 今日报价卡片 */
.grade-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.grade-card {
  background: var(--card); border-radius: 14px; padding: 12px 14px;
  box-shadow: var(--shadow); border: 1px solid var(--line);
}
.grade-card .g-name { font-size: 16px; font-weight: 800; }
.grade-card .g-youhui { margin-top: 8px; }
.grade-card .g-youhui .lbl { font-size: 11px; color: var(--youhui); font-weight: 700; }
.grade-card .g-youhui .val { font-size: 26px; font-weight: 800; color: var(--youhui); line-height: 1.1; }
.grade-card .g-youhui .unit { font-size: 12px; color: var(--muted); font-weight: 600; }
.grade-card .g-hanshui { margin-top: 6px; display: flex; justify-content: space-between; align-items: baseline; }
.grade-card .g-hanshui .lbl { font-size: 11px; color: var(--hanshui); font-weight: 700; }
.grade-card .g-hanshui .val { font-size: 15px; font-weight: 700; color: var(--hanshui); }

/* 历史查询 */
.history-bar {
  display: flex; gap: 8px; align-items: center; background: var(--card);
  border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; box-shadow: var(--shadow);
}
.history-bar button {
  border: none; background: var(--brand); color: #fff; border-radius: 8px;
  width: 38px; height: 38px; font-size: 18px; font-weight: 700;
}
.history-bar button:active { transform: scale(.94); }
.history-bar input[type=date] {
  flex: 1; border: none; font-size: 16px; color: var(--ink); background: transparent;
}
.history-bar .pick { font-size: 12px; color: var(--muted); }

.hist-note { font-size: 12px; color: var(--muted); margin: 8px 4px 0; }
.hist-empty {
  background: var(--card); border: 1px dashed var(--line); border-radius: 12px;
  padding: 24px; text-align: center; color: var(--muted); margin-top: 10px;
}

/* 走势图控件 */
.chart-ctrl { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.chip {
  border: 1px solid var(--line); background: var(--card); color: var(--ink);
  border-radius: 20px; padding: 7px 14px; font-size: 13px; font-weight: 600;
}
.chip.active { background: var(--brand); color: #fff; border-color: var(--brand); }
.chart-card { background: var(--card); border-radius: 14px; padding: 12px; box-shadow: var(--shadow); border: 1px solid var(--line); }
.chart-card svg { width: 100%; height: auto; display: block; }
.chart-legend { display: flex; gap: 14px; justify-content: center; margin-top: 8px; font-size: 12px; color: var(--muted); }
.chart-legend .it { display: flex; align-items: center; gap: 5px; }
.chart-legend .sw { width: 14px; height: 4px; border-radius: 2px; }
.chart-meta { text-align: center; font-size: 12px; color: var(--muted); margin-top: 6px; }

/* 底部说明 */
.foot {
  margin-top: 22px; background: var(--card); border: 1px solid var(--line);
  border-radius: 14px; padding: 14px; box-shadow: var(--shadow); font-size: 13px; color: #4a5566;
}
.foot h4 { margin: 0 0 8px; font-size: 13px; color: var(--ink); }
.foot p { margin: 6px 0; }
.foot .phone {
  display: inline-block; margin-top: 6px; background: var(--ok); color: #fff;
  padding: 8px 16px; border-radius: 10px; font-weight: 700; text-decoration: none; font-size: 15px;
}
.foot .extra { margin-top: 8px; font-weight: 600; color: var(--brand-d); }

/* 后台 */
.admin-box { background: var(--card); border-radius: 14px; padding: 16px; box-shadow: var(--shadow); border: 1px solid var(--line); margin-bottom: 14px; }
.admin-box h3 { margin: 0 0 12px; font-size: 16px; }
.field { margin-bottom: 10px; }
.field label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.field input, .field textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px;
  font-size: 15px; background: #fbfcfe; color: var(--ink);
}
.field textarea { resize: vertical; min-height: 70px; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.btn {
  border: none; border-radius: 10px; padding: 12px 16px; font-size: 15px; font-weight: 700;
  background: var(--brand); color: #fff; width: 100%;
}
.btn:active { transform: scale(.98); }
.btn.ghost { background: #eef1f6; color: var(--ink); }
.btn.danger { background: #e23b3b; }
.btn.sm { width: auto; padding: 7px 12px; font-size: 13px; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th, .table td { padding: 8px 6px; border-bottom: 1px solid var(--line); text-align: right; }
.table th:first-child, .table td:first-child { text-align: left; }
.table th { color: var(--muted); font-weight: 600; }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; }
.login-wrap { max-width: 360px; margin: 60px auto; padding: 0 16px; }
.login-wrap .logo { text-align: center; font-size: 22px; font-weight: 800; color: var(--brand); margin-bottom: 18px; }
.toast {
  position: fixed; left: 50%; bottom: 30px; transform: translateX(-50%);
  background: rgba(31,39,51,.92); color: #fff; padding: 10px 18px; border-radius: 10px;
  font-size: 14px; z-index: 50; opacity: 0; transition: opacity .2s; pointer-events: none;
}
.toast.show { opacity: 1; }
.msg { font-size: 13px; color: var(--muted); margin-top: 8px; }
.err { color: #e23b3b; }
.ok { color: var(--ok); }
.center { text-align: center; }
.muted { color: var(--muted); }
