:root {
  --bg: #f4f5f7;
  --card: #ffffff;
  --line: #e6e8eb;
  --line-soft: #f0f1f3;
  --text: #15171c;
  --muted: #6b7280;
  --faint: #9aa0a8;
  --up: #d92b2b;
  --down: #0f9d58;
  --idle: #5f6673;
  --accent: #185fa5;
  --accent-dark: #0c447c;
  --radius: 16px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.wrap {
  max-width: 440px;
  margin: 0 auto;
  padding: 0 16px 48px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 0 14px;
}

.brand {
  font-size: 17px;
  font-weight: 500;
  letter-spacing: 0.5px;
}
.brand span {
  font-size: 12px;
  font-weight: 400;
  color: var(--faint);
  letter-spacing: 1.2px;
  margin-left: 6px;
  text-transform: uppercase;
}

.iconbtn {
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--muted);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  transition: border-color .15s, color .15s;
}
.iconbtn:active { border-color: var(--accent); color: var(--accent); }
.iconbtn[disabled] { opacity: .5; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 12px;
}

.sec-title {
  font-size: 12px;
  color: var(--faint);
  letter-spacing: 1px;
  margin: 22px 2px 8px;
  font-weight: 400;
}

/* 下次调价 */
.next-head {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 14px;
}
.next-head > div:first-child { min-width: 0; }
.next-label { font-size: 12px; color: var(--faint); letter-spacing: .6px; }
.next-date {
  font-size: 20px;
  font-weight: 500;
  letter-spacing: .2px;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.countdown {
  font-size: 12px;
  color: var(--accent);
  background: #eef4fb;
  border-radius: 999px;
  padding: 4px 12px;
  white-space: nowrap;
  flex: 0 0 auto;
}

.progress {
  height: 6px;
  background: var(--line-soft);
  border-radius: 999px;
  overflow: hidden;
}
.progress > i {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
  transition: width .5s ease;
}
.progress-meta {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
  margin-top: 7px;
}

/* 结论 */
.verdict {
  text-align: center;
  padding: 26px 18px 22px;
  border-radius: var(--radius);
  margin-bottom: 12px;
  border: 1px solid var(--line);
  background: var(--card);
  position: relative;
}
.verdict[data-v="up"] { background: #fdf2f2; border-color: #f5d0d0; }
.verdict[data-v="down"] { background: #eff8f3; border-color: #cfe8db; }
.verdict[data-v="stranded"] { background: #f6f7f9; border-color: var(--line); }

.verdict-word {
  font-size: 13px;
  letter-spacing: 3px;
  color: var(--muted);
  margin-bottom: 8px;
}
.verdict[data-v="up"] .verdict-word { color: var(--up); }
.verdict[data-v="down"] .verdict-word { color: var(--down); }

.verdict-num {
  font-size: 42px;
  font-weight: 500;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  letter-spacing: -1px;
}
.verdict[data-v="up"] .verdict-num { color: var(--up); }
.verdict[data-v="down"] .verdict-num { color: var(--down); }
.verdict[data-v="stranded"] .verdict-num { color: var(--idle); }

.verdict-unit { font-size: 14px; color: var(--muted); margin-left: 6px; font-weight: 400; }

.verdict-desc {
  font-size: 13px;
  color: var(--muted);
  margin-top: 12px;
  line-height: 1.55;
  text-wrap: pretty;
  padding: 0 6px;
}

.conf {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
  margin-top: 14px;
  font-size: 12px;
  color: var(--faint);
}
.conf-bar {
  width: 72px;
  height: 4px;
  background: #e3e5e9;
  border-radius: 999px;
  overflow: hidden;
}
.conf-bar > i { display: block; height: 100%; background: var(--faint); border-radius: 999px; }

/* 双价 */
.quotes { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.quote { padding: 14px 16px; }
.quote-name { font-size: 12px; color: var(--faint); }
.quote-val {
  font-size: 23px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  margin-top: 3px;
  letter-spacing: -.3px;
}
.quote-chg { font-size: 13px; font-variant-numeric: tabular-nums; margin-top: 1px; }
.neg { color: var(--down); }
.pos { color: var(--up); }
.flat { color: var(--muted); }

/* 对照 */
.dual { display: grid; gap: 0; }
.dual-row {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: space-between;
  padding: 11px 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: 14px;
}
.dual-row:last-child { border-bottom: none; }
.dual-key {
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 7px;
  flex: 1 1 auto;
  min-width: 0;
}
.dual-val {
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  flex: 0 0 auto;
  white-space: nowrap;
}

.tag {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 4px;
  letter-spacing: .3px;
  font-weight: 400;
  flex: 0 0 auto;
  white-space: nowrap;
}
.tag.self { background: #eef4fb; color: var(--accent); }
.tag.ext { background: #f4f0fb; color: #6b4fa0; }

.note {
  font-size: 12px;
  color: var(--faint);
  line-height: 1.65;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
}

/* 明细 */
details.card { padding: 0; }
details.card > summary {
  list-style: none;
  padding: 16px 18px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  color: var(--text);
}
details.card > summary::-webkit-details-marker { display: none; }
details.card > summary::after {
  content: '';
  width: 7px; height: 7px;
  border-right: 1.5px solid var(--faint);
  border-bottom: 1.5px solid var(--faint);
  transform: rotate(45deg);
  transition: transform .2s;
  margin-left: auto;
}
details.card[open] > summary::after { transform: rotate(-135deg); }
.detail-body { padding: 0 18px 18px; }

.kv {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  font-size: 13px;
  border-bottom: 1px solid var(--line-soft);
}
.kv:last-child { border-bottom: none; }
.kv > span:first-child { color: var(--muted); flex: 1 1 auto; min-width: 0; }
.kv > span:last-child { font-variant-numeric: tabular-nums; flex: 0 0 auto; white-space: nowrap; }

.formula {
  margin-top: 12px;
  background: #fafbfc;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.8;
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
}
.formula b { color: var(--text); font-weight: 500; }

/* 政策 */
.policy-item {
  display: flex;
  gap: 10px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: 13px;
}
.policy-item:last-child { border-bottom: none; }
.policy-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #d9a13b;
  margin-top: 8px;
  flex: 0 0 auto;
}
.policy-item .t { color: var(--muted); font-size: 12px; }
.policy-item .d { line-height: 1.6; }
.policy-item > div { min-width: 0; }

/* 日历 */
.cal { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.cal-cell {
  text-align: center;
  padding: 9px 3px;
  border-radius: 9px;
  border: 1px solid var(--line-soft);
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.cal-cell.done { color: var(--faint); background: #fafbfc; }
.cal-cell.next { border-color: var(--accent); color: var(--accent); background: #eef4fb; font-weight: 500; }
.cal-cell.now { border-color: var(--idle); color: var(--text); }

/* 原油换算链 */
.conv {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: space-between;
  padding: 2px 0 14px;
}
.conv-seg { text-align: center; flex: 1 1 0; min-width: 0; }
.conv-val {
  font-size: 16px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.2px;
  white-space: nowrap;
}
.conv-unit { font-size: 10px; color: var(--faint); margin-top: 1px; }
.conv-arrow { color: #c3c7cd; font-size: 13px; flex: 0 0 auto; }

/* 油品价格表 */
.fuel-head, .fuel-row {
  display: grid;
  grid-template-columns: 1.45fr 1fr 1.2fr 1fr;
  align-items: center;
  gap: 6px;
  font-size: 13px;
}
.fuel-head {
  color: var(--faint);
  font-size: 11px;
  padding-bottom: 7px;
  border-bottom: 1px solid var(--line-soft);
  letter-spacing: .2px;
}
.fuel-head span:not(:first-child) { text-align: right; }
.fuel-row {
  padding: 10px 0;
  border-bottom: 1px solid var(--line-soft);
  font-variant-numeric: tabular-nums;
}
.fuel-row:last-child { border-bottom: none; }
.fuel-row span:not(:first-child) { text-align: right; }
.fuel-name { color: var(--text); font-size: 13px; }
.fuel-name em {
  display: block;
  font-style: normal;
  font-size: 10px;
  color: var(--faint);
  line-height: 1.3;
}
.fuel-l { font-weight: 500; }
.fuel-t { color: var(--muted); font-size: 12.5px; }
.fuel-n { font-weight: 500; }

.provsel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line-soft);
  margin-bottom: 12px;
}
.provsel label { font-size: 12px; color: var(--faint); flex: 0 0 auto; }
.provsel select {
  flex: 1 1 auto;
  min-width: 0;
  font-family: inherit;
  font-size: 14px;
  color: var(--text);
  background: #fafbfc;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 7px 10px;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%239aa0a8' stroke-width='1.4' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
}

/* 趋势图 */
.chart-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 4px;
}
.chart-title { font-size: 13px; color: var(--text); font-weight: 500; }
.chart-sub { font-size: 11px; color: var(--faint); }
.chart-foot {
  display: flex;
  justify-content: space-between;
  font-size: 10.5px;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
  margin-top: 2px;
}

/* 页脚 */
.foot {
  font-size: 11px;
  color: var(--faint);
  line-height: 1.75;
  padding: 8px 2px 0;
  text-align: center;
}
.foot b { font-weight: 500; color: var(--muted); }

.notice {
  background: #fff9ec;
  border: 1px solid #f2e2be;
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 12px;
  color: #8a6a24;
  line-height: 1.65;
  margin-bottom: 12px;
}

.skeleton {
  background: linear-gradient(90deg, #eef0f2 25%, #f6f7f8 37%, #eef0f2 63%);
  background-size: 400% 100%;
  animation: shimmer 1.3s ease infinite;
  border-radius: 8px;
}
@keyframes shimmer {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}

.stale {
  font-size: 11px;
  color: #a06a1e;
  background: #fff9ec;
  border: 1px solid #f2e2be;
  border-radius: 8px;
  padding: 8px 12px;
  margin-bottom: 12px;
}

@media (prefers-reduced-motion: no-preference) {
  .card, .verdict { animation: fade .35s ease both; }
  @keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
}
