/* ── Reset & base ────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --text:      #111;
  --muted:     #888;
  --border:    #e8e8e8;
  --accent:    #1a1a1a;
  --read-bg:   #f9f9f9;
  --max-w:     720px;
  --pad:       1rem;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.55;
  color: var(--text);
  background: #fff;
}

a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Header ──────────────────────────────────────────────────────────────── */
header {
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 10;
}

.header-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0.7rem var(--pad);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}

.logout-link {
  font-size: 0.85rem;
  color: var(--muted);
}

/* ── Main wrapper ────────────────────────────────────────────────────────── */
main {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--pad) 3rem;
}

/* ── Page bar (unread count) ─────────────────────────────────────────────── */
.page-bar {
  padding: 0.75rem 0;
  font-size: 0.85rem;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.5rem;
}

/* ── Category section ────────────────────────────────────────────────────── */
.cat-section {
  margin-top: 1.5rem;
}

.cat-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding-bottom: 0.35rem;
  border-bottom: 2px solid var(--text);
  margin-bottom: 0.5rem;
}

.cat-title {
  font-size: 0.95rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.cat-title a:hover { text-decoration: none; opacity: 0.7; }

.cat-more {
  font-size: 0.8rem;
  color: var(--muted);
}

/* ── Article list (shared by index and category page) ────────────────────── */
.article-list {
  list-style: none;
}

.article-row {
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--border);
}

.article-row.read .article-title {
  color: var(--muted);
}

.article-row.read {
  background: var(--read-bg);
  padding-left: 0.4rem;
  margin-left: -0.4rem;
}

.article-title {
  display: block;
  font-size: 0.97rem;
  line-height: 1.4;
  margin-bottom: 0.2rem;
}

.article-title:hover { text-decoration: underline; }

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.78rem;
  color: var(--muted);
}

/* ── Category page header ────────────────────────────────────────────────── */
.cat-page-header {
  padding: 1rem 0 0.75rem;
  border-bottom: 2px solid var(--text);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: baseline;
  gap: 1rem;
}

.cat-page-header h1 {
  font-size: 1.1rem;
  font-weight: 700;
}

.total-count {
  font-size: 0.8rem;
  color: var(--muted);
}

/* ── Pagination ──────────────────────────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem 0;
  font-size: 0.9rem;
}

.page-btn {
  color: var(--text);
  border: 1px solid var(--border);
  padding: 0.3rem 0.75rem;
  border-radius: 4px;
}

.page-btn:hover { background: var(--read-bg); text-decoration: none; }

.page-info { color: var(--muted); }

/* ── Breadcrumb ──────────────────────────────────────────────────────────── */
.breadcrumb {
  padding: 0.75rem 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.breadcrumb-sep { margin: 0 0.3rem; }

/* ── Article full ────────────────────────────────────────────────────────── */
.article-full {
  padding-top: 1rem;
}

.article-h1 {
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 0.75rem;
}

.article-meta--top {
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.source-link {
  color: var(--muted);
  font-size: 0.8rem;
}

.article-body p {
  margin-bottom: 1em;
  font-size: 0.97rem;
  line-height: 1.65;
}

.no-text { color: var(--muted); }

.classifier-note {
  margin-top: 2rem;
  font-size: 0.8rem;
  color: var(--muted);
  border-top: 1px solid var(--border);
  padding-top: 0.75rem;
}

.classifier-note summary { cursor: pointer; }
.classifier-note p { margin-top: 0.4rem; }

/* ── Login page ──────────────────────────────────────────────────────────── */
.login-wrap {
  max-width: 340px;
  margin: 5rem auto;
  text-align: center;
  padding: 0 var(--pad);
}

.login-title {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.login-sub {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 2rem;
}

.google-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.6rem 1.2rem;
  font-size: 0.95rem;
  background: #fff;
  cursor: pointer;
}

.google-btn:hover { background: var(--read-bg); text-decoration: none; }

.login-error {
  margin-top: 1rem;
  font-size: 0.85rem;
  color: #c0392b;
}

/* ── Correction form ─────────────────────────────────────────────────────── */
.correct-section {
  margin-top: 1.25rem;
  font-size: 0.8rem;
  color: var(--muted);
  border-top: 1px solid var(--border);
  padding-top: 0.75rem;
}

.correct-summary {
  cursor: pointer;
  user-select: none;
}

.correct-form {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-top: 0.6rem;
  flex-wrap: wrap;
}

.correct-select {
  flex: 1;
  min-width: 0;
  font-size: 0.85rem;
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #fff;
  color: var(--text);
}

.correct-btn {
  font-size: 0.85rem;
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  white-space: nowrap;
}

.correct-btn:hover { opacity: 0.85; }

/* ── Mobile ──────────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  :root { --pad: 0.85rem; }

  .article-h1 { font-size: 1.15rem; }

  .cat-title { font-size: 0.85rem; }
}
