/* 人民日报 · 每日蒸馏 — 移动优先 */

:root {
  --red: #c0392b;
  --red-dark: #96281b;
  --bg: #f6f4f1;
  --card: #ffffff;
  --ink: #26221e;
  --muted: #8a8378;
  --line: #e8e3db;
  --gold: #b8860b;
  --quote-bg: #fdf6e3;
  --shadow: 0 1px 3px rgba(38, 34, 30, 0.08);
  --nav-h: calc(56px + env(safe-area-inset-bottom, 0px));
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #171512;
    --card: #211e1a;
    --ink: #ece7e0;
    --muted: #9b948a;
    --line: #35312b;
    --quote-bg: #2a2418;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  }
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.65;
  -webkit-text-size-adjust: 100%;
}

.app-header {
  background: linear-gradient(135deg, var(--red), var(--red-dark));
  color: #fff;
  padding: 18px 16px 14px;
}
.app-header h1 { margin: 0; font-size: 1.3rem; letter-spacing: 0.5px; }
.app-header .sub { font-weight: 400; opacity: 0.9; font-size: 1.05rem; }
.tagline { margin: 4px 0 0; font-size: 0.78rem; opacity: 0.85; }

main {
  max-width: 760px;
  margin: 0 auto;
  padding: 12px 12px calc(var(--nav-h) + 16px);
}

.view.hidden { display: none; }
.view-title { font-size: 1.05rem; margin: 6px 2px 10px; }

/* 日期导航 */
.date-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 6px 6px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}
.date-nav button {
  min-width: 46px;
  min-height: 44px;
  font-size: 1.5rem;
  border: none;
  background: transparent;
  color: var(--red);
  border-radius: 10px;
  cursor: pointer;
}
.date-nav button:active { background: rgba(192, 57, 43, 0.1); }
.date-nav button:disabled { opacity: 0.25; }
.date-label { text-align: center; }
.date-label #date-text { font-weight: 700; font-size: 1.02rem; }
.date-meta { display: block; font-size: 0.75rem; color: var(--muted); }

/* 状态块 */
.state {
  text-align: center;
  color: var(--muted);
  padding: 40px 16px;
  font-size: 0.92rem;
}
.state.muted { padding: 24px 16px; }
.state.error { color: var(--red); }

/* 当日总览 */
.summary-card {
  background: linear-gradient(135deg, #fff8f0, #fdeeea);
  border: 1px solid #f0d9cf;
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
}
@media (prefers-color-scheme: dark) {
  .summary-card { background: #2b211b; border-color: #4a382f; }
}
.summary-card .label {
  display: inline-block;
  background: var(--red);
  color: #fff;
  font-size: 0.72rem;
  padding: 1px 8px;
  border-radius: 999px;
  margin-bottom: 6px;
}
.summary-card p { margin: 0; font-size: 0.95rem; }

/* 文章卡片 */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}
.badges { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.badge {
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(192, 57, 43, 0.1);
  color: var(--red);
}
.badge.cat { background: rgba(184, 134, 11, 0.12); color: var(--gold); }
.card h3 { margin: 2px 0 4px; font-size: 1.05rem; line-height: 1.45; }
.card h3 a { color: var(--ink); text-decoration: none; }
.card h3 a:active { color: var(--red); }
.card .subtitle { margin: 0 0 8px; font-size: 0.82rem; color: var(--muted); }

.points { margin: 8px 0; padding: 0 0 0 2px; list-style: none; }
.points li {
  position: relative;
  padding-left: 16px;
  margin-bottom: 6px;
  font-size: 0.92rem;
}
.points li::before {
  content: "▸";
  position: absolute;
  left: 0;
  color: var(--red);
}

.framework {
  font-size: 0.86rem;
  color: var(--muted);
  margin: 8px 0;
  padding: 8px 10px;
  background: color-mix(in srgb, var(--line) 45%, transparent);
  border-radius: 8px;
}
.framework .label { color: var(--ink); font-weight: 600; }

.quotes { margin: 10px 0 4px; padding: 0; }
.quotes p {
  margin: 0 0 6px;
  padding: 8px 12px;
  background: var(--quote-bg);
  border-left: 3px solid var(--gold);
  border-radius: 0 8px 8px 0;
  font-size: 0.9rem;
  color: var(--ink);
}

.angles { margin-top: 10px; border-top: 1px dashed var(--line); padding-top: 8px; }
.angles .label { font-size: 0.75rem; color: var(--red); font-weight: 700; }
.angle { margin-top: 6px; font-size: 0.88rem; }
.angle b { color: var(--red); }
.angle span { color: var(--muted); display: block; font-size: 0.84rem; }

/* 历史列表 */
.history-list { display: flex; flex-direction: column; gap: 8px; }
.history-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 13px 16px;
  font-size: 0.95rem;
  cursor: pointer;
  min-height: 48px;
}
.history-item:active { border-color: var(--red); }
.history-item .arrow { color: var(--muted); }
.history-item .cnt { font-size: 0.78rem; color: var(--muted); }

/* 搜索 */
.search-form { display: flex; gap: 8px; margin-bottom: 12px; }
.search-form input {
  flex: 1;
  min-height: 46px;
  padding: 0 14px;
  font-size: 1rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  color: var(--ink);
  outline: none;
}
.search-form input:focus { border-color: var(--red); }
.search-form button {
  min-width: 72px;
  min-height: 46px;
  border: none;
  border-radius: 10px;
  background: var(--red);
  color: #fff;
  font-size: 0.95rem;
  cursor: pointer;
}
.search-hit-date {
  font-size: 0.75rem;
  color: var(--muted);
  margin: 10px 2px 4px;
}
mark { background: #ffe9a8; color: #4a3b00; border-radius: 3px; padding: 0 1px; }

/* 底部 Tab */
.tab-bar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  height: var(--nav-h);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  display: flex;
  background: var(--card);
  border-top: 1px solid var(--line);
  z-index: 50;
}
.tab {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 1.15rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  cursor: pointer;
  min-height: 56px;
}
.tab span { font-size: 0.68rem; }
.tab.active { color: var(--red); font-weight: 600; }
