:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --border: #e3e6eb;
  --text: #1d2433;
  --text-muted: #5b6573;
  --accent: #1f4ed8;
  --accent-soft: #e7edff;
  --tag-bg: #eef2f7;
  --shadow: 0 1px 2px rgba(20,30,55,0.04), 0 4px 12px rgba(20,30,55,0.06);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Noto Sans JP", "Yu Gothic UI", "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.7;
}

.container {
  max-width: 920px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */
.site-header {
  background: linear-gradient(135deg, #1f4ed8 0%, #2a72e6 100%);
  color: #fff;
  padding: 36px 0 28px;
}
.site-title {
  font-size: 26px;
  margin: 0 0 6px;
  letter-spacing: 0.02em;
}
.site-subtitle {
  margin: 0 0 6px;
  opacity: 0.9;
  font-size: 14px;
}
.site-policy {
  margin: 0 0 12px;
  font-size: 12px;
  opacity: 0.85;
  line-height: 1.6;
}
.site-policy strong {
  background: rgba(255,255,255,0.15);
  padding: 1px 6px;
  border-radius: 4px;
}
.updated {
  margin: 0;
  font-size: 12px;
  opacity: 0.85;
}

/* 更新ボタン */
.update-box {
  margin-top: 14px;
}
.update-btn {
  background: rgba(255,255,255,0.95);
  color: var(--accent);
  border: none;
  padding: 9px 18px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
}
.update-btn:hover:not(:disabled) { background: #fff; }
.update-btn:disabled { opacity: 0.65; cursor: default; }
.update-form {
  display: inline-flex;
  gap: 6px;
  margin-top: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.update-form input {
  padding: 8px 10px;
  border: none;
  border-radius: 6px;
  font-size: 13px;
}
.update-go,
.update-cancel {
  border: none;
  border-radius: 6px;
  padding: 8px 13px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.update-go { background: #fff; color: var(--accent); }
.update-cancel { background: rgba(255,255,255,0.22); color: #fff; }
.update-msg {
  margin: 10px 0 0;
  font-size: 12px;
  padding: 7px 11px;
  border-radius: 6px;
  display: inline-block;
  line-height: 1.6;
}
.update-msg.is-running { background: rgba(255,255,255,0.18); color: #fff; }
.update-msg.is-done    { background: #e6f4ea; color: #137333; }
.update-msg.is-error   { background: #fde8e8; color: #c5221f; }

/* Tabs */
.tabs {
  display: flex;
  gap: 4px;
  margin-top: -16px;
  background: var(--surface);
  border-radius: 12px;
  padding: 6px;
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 10;
}
.tab {
  flex: 1;
  background: transparent;
  border: none;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.tab:hover {
  color: var(--text);
}
.tab.is-active {
  background: var(--accent-soft);
  color: var(--accent);
}

/* News list */
.news-list {
  display: grid;
  gap: 14px;
  margin: 24px 0 40px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px 22px;
  box-shadow: var(--shadow);
}
.card-header {
  margin-bottom: 10px;
}
.card-title {
  font-size: 17px;
  margin: 0 0 6px;
  line-height: 1.5;
}
.card-meta {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.card-date::before {
  content: "📅 ";
}
.tag {
  display: inline-block;
  background: var(--tag-bg);
  color: var(--text-muted);
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  margin-right: 4px;
}
.card-summary {
  margin: 8px 0 14px;
  color: var(--text);
}
.card-sources {
  border-top: 1px dashed var(--border);
  padding-top: 12px;
}
.primary-source {
  display: block;
  font-size: 13px;
  margin-bottom: 6px;
}
.primary-source::before {
  content: "📰 主要ソース: ";
  color: var(--text-muted);
  font-weight: 400;
}
.primary-source a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}
.primary-source a:hover {
  text-decoration: underline;
}

.tier {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
  vertical-align: middle;
  line-height: 1.6;
}
.tier-primary {
  background: #e6f4ea;
  color: #137333;
  border: 1px solid #c8e6c9;
}
.tier-major {
  background: #fff4e5;
  color: #9c5b00;
  border: 1px solid #ffd9a8;
}
.other-sources {
  font-size: 12px;
  margin-top: 4px;
}
.other-sources summary {
  cursor: pointer;
  color: var(--text-muted);
  user-select: none;
}
.other-sources summary:hover {
  color: var(--accent);
}
.other-sources ul {
  margin: 8px 0 0;
  padding-left: 20px;
}
.other-sources li {
  margin: 4px 0;
}
.other-sources a {
  color: var(--accent);
  text-decoration: none;
}
.other-sources a:hover {
  text-decoration: underline;
}
.publisher {
  color: var(--text-muted);
  font-size: 11px;
  margin-left: 6px;
}

.empty {
  text-align: center;
  color: var(--text-muted);
  padding: 60px 20px;
}

/* Footer */
.site-footer {
  background: #1d2433;
  color: #b8bfcc;
  font-size: 12px;
  padding: 24px 0;
  text-align: center;
}
.site-footer p {
  margin: 4px 0;
}
.site-footer code {
  background: rgba(255,255,255,0.08);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 11px;
}

/* Mobile */
@media (max-width: 600px) {
  .site-title { font-size: 22px; }
  .tab { font-size: 13px; padding: 10px 8px; }
  .card { padding: 16px; }
}
