:root {
  color-scheme: light;
  --ink: #152238;
  --muted: #6b7280;
  --line: #e6e9ee;
  --surface: #ffffff;
  --canvas: #f5f7fb;
  --accent: #e05743;
  --accent-soft: #fff0ec;
  --shadow: 0 12px 32px rgba(21, 34, 56, 0.08);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--canvas); color: var(--ink); }
button, input { font: inherit; }
button { cursor: pointer; }

.app-shell { min-height: 100vh; max-width: 760px; margin: 0 auto; background: var(--canvas); }
.topbar { display: flex; justify-content: space-between; align-items: center; padding: 28px 20px 18px; background: var(--surface); border-bottom: 1px solid var(--line); }
.eyebrow, .section-kicker { margin: 0 0 5px; color: var(--accent); font-size: 11px; font-weight: 800; letter-spacing: 0.12em; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: 24px; letter-spacing: -0.03em; }
h2 { margin-bottom: 0; font-size: 27px; letter-spacing: -0.04em; }
.icon-button, .back-button { border: 0; background: transparent; color: var(--ink); }
.icon-button { width: 40px; height: 40px; border-radius: 50%; font-size: 24px; }
.icon-button:hover { background: var(--canvas); }
.page-stack { padding: 24px 20px 104px; }
.view { display: none; }
.view.active { display: block; }
.intro-row { display: flex; justify-content: space-between; align-items: end; margin-bottom: 18px; }
.result-count { color: var(--muted); font-size: 13px; }
.search-box { display: flex; align-items: center; gap: 10px; padding: 0 14px; height: 48px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--muted); }
.search-box input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); }
.status { min-height: 22px; padding: 14px 0 4px; color: var(--muted); font-size: 14px; }
.status.error { color: #b42318; }
.article-list { display: grid; gap: 12px; }
.article-card { padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: 0 6px 18px rgba(21, 34, 56, 0.04); }
.article-open { width: 100%; border: 0; padding: 0; text-align: left; background: transparent; color: inherit; }
.article-meta { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; color: var(--muted); font-size: 12px; }
.tag { padding: 4px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.article-card h3 { margin-bottom: 8px; font-size: 19px; line-height: 1.35; }
.article-card p { margin-bottom: 12px; color: var(--muted); font-size: 14px; line-height: 1.65; }
.card-footer { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 12px; }
.favorite-button { border: 0; background: transparent; color: var(--accent); font-size: 19px; }
.load-more, .primary-button { width: 100%; margin-top: 18px; min-height: 46px; border: 0; border-radius: 13px; background: var(--ink); color: #fff; font-weight: 700; }
.load-more:disabled { opacity: 0.45; cursor: default; }
.back-button { margin-bottom: 18px; padding: 0; color: var(--muted); }
.article-detail { padding: 22px 0 8px; }
.article-detail h2 { margin-bottom: 12px; font-size: 30px; line-height: 1.24; }
.detail-meta { color: var(--muted); font-size: 13px; }
.detail-content { margin-top: 28px; color: #2c3748; font-size: 17px; line-height: 1.9; }
.detail-content p { margin-bottom: 18px; }
.article-image { margin: 0 0 20px; }
.article-image img { display: block; width: 100%; height: auto; max-height: 75vh; object-fit: contain; border-radius: 12px; background: #eef1f5; }
.article-image figcaption { margin-top: 6px; color: var(--muted); font-size: 12px; text-align: center; }
.settings-panel { padding: 20px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.settings-title { margin-bottom: 8px; font-weight: 800; }
.settings-copy { color: var(--muted); font-size: 14px; line-height: 1.65; }
.field-label { display: block; margin: 18px 0 7px; font-size: 13px; font-weight: 700; }
.text-input { width: 100%; min-height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; outline: none; }
.text-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.settings-status { min-height: 20px; margin: 12px 0 0; color: var(--muted); font-size: 13px; }
.bottom-nav { position: fixed; right: 0; bottom: 0; left: 0; display: flex; justify-content: center; gap: 8px; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: rgba(255,255,255,.94); backdrop-filter: blur(16px); }
.nav-item { display: grid; min-width: 92px; gap: 3px; border: 0; border-radius: 12px; padding: 8px 12px; background: transparent; color: var(--muted); }
.nav-item span { font-size: 20px; line-height: 1; }
.nav-item small { font-size: 11px; }
.nav-item.active { background: var(--accent-soft); color: var(--accent); }
.empty-state { padding: 32px 10px; text-align: center; color: var(--muted); }

@media (min-width: 760px) {
  .topbar { border-radius: 0 0 20px 20px; padding-inline: 28px; }
  .page-stack { padding-inline: 28px; }
  .bottom-nav { position: sticky; bottom: 0; margin: 0 auto; max-width: 760px; }
}
