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

/* ===== Design tokens ===== */
:root {
  --bg:           #f8f8f7;
  --surface:      #ffffff;
  --text:         #111827;
  --muted:        #6b7280;
  --border:       #e5e7eb;
  --accent:       #2563eb;

  --ai-fg:        #6d28d9;
  --ai-bg:        #ede9fe;
  --sec-fg:       #b91c1c;
  --sec-bg:       #fee2e2;
  --other-fg:     #0369a1;
  --other-bg:     #e0f2fe;
  --finance-fg:   #047857;
  --finance-bg:   #d1fae5;

  --radius:       8px;
  --max-w:        760px;
}

/* ===== Base ===== */
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "Hiragino Sans", "Noto Sans JP", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.75;
  font-size: 16px;
}

a { color: var(--accent); }

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

.header-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.site-name {
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.back {
  font-size: 0.85rem;
  color: var(--muted);
  text-decoration: none;
}
.back:hover { color: var(--accent); }

/* ===== Main ===== */
main {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 32px 20px 64px;
}

/* ===== Footer ===== */
footer {
  text-align: center;
  padding: 20px;
  color: var(--muted);
  font-size: 0.8rem;
  border-top: 1px solid var(--border);
}
footer a { color: var(--muted); text-decoration: none; }

/* ===== Top index ===== */
.top-index h1 {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 28px;
}

.date-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.date-list li a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.date-list li a:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.08);
}

.date-list time {
  font-weight: 700;
  font-size: 1rem;
}

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

/* ===== Daily index ===== */
.daily-index h1 {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 28px;
}

.daily-index h2 {
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  border-bottom: 2px solid var(--border);
  padding-bottom: 6px;
  margin: 36px 0 16px;
}

.daily-index h3 {
  font-size: 1rem;
  font-weight: 600;
  margin: 20px 0 4px;
  line-height: 1.4;
}

.daily-index h3 a {
  color: var(--text);
  text-decoration: none;
}
.daily-index h3 a:hover {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.daily-index p {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 4px;
}

.daily-index hr {
  display: none;
}

/* ===== Article page ===== */
article h1 {
  font-size: 1.45rem;
  font-weight: 800;
  line-height: 1.35;
  letter-spacing: -0.02em;
  margin-bottom: 14px;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 28px;
  font-size: 0.85rem;
}

.article-meta time { color: var(--muted); }

.source-link {
  color: var(--accent);
  text-decoration: none;
}
.source-link:hover { text-decoration: underline; }

/* ===== Genre badges ===== */
.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 99px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.badge-ai       { color: var(--ai-fg);    background: var(--ai-bg); }
.badge-security { color: var(--sec-fg);   background: var(--sec-bg); }
.badge-other    { color: var(--other-fg); background: var(--other-bg); }
.badge-finance  { color: var(--finance-fg); background: var(--finance-bg); }

/* ===== Article body ===== */
.body { line-height: 1.8; }

.body h2 {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 28px 0 10px;
  padding-left: 10px;
  border-left: 3px solid var(--accent);
}

.body p { margin-bottom: 14px; }

.body a { text-underline-offset: 2px; }

.body table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 0.9rem;
  display: block;
  overflow-x: auto;
}

.body th,
.body td {
  padding: 8px 14px;
  border: 1px solid var(--border);
  text-align: left;
  white-space: nowrap;
}

.body th { background: var(--bg); font-weight: 600; }

.body hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 28px 0;
}

/* ===== Responsive ===== */
@media (max-width: 600px) {
  body { font-size: 15px; }
  main { padding: 20px 16px 48px; }
  .top-index h1 { font-size: 1.4rem; }
  .daily-index h1 { font-size: 1.2rem; }
  article h1 { font-size: 1.2rem; }
  .date-list li a { padding: 14px 16px; }
}
