/* DailyFeed — 旧デザインを踏襲したダークテーマ（Workers Assets で配信）
   旧配色: 背景 #3b3b3b / 本文 #e3e3e3,#aaa / アクセント #c8f164(ライム),#f1c864(黄) */

:root {
  --fg: #ececec;
  --fg-muted: #9aa0a6;
  --bg: #1c1d20;
  --bg-soft: #26282c;
  --bg-elevated: #303236;
  --border: #3a3d42;
  --accent: #c8f164;        /* ライムグリーン（旧リンク色） */
  --accent-hover: #d8ff84;
  --accent-2: #f1c864;      /* 黄（旧見出しアクセント） */
  --accent-soft: rgba(200, 241, 100, 0.14);
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
  --radius: 8px;
  --maxw: 900px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  /* コンテンツが短くてもフッターを画面下端に留める（sticky footer） */
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: system-ui, -apple-system, "Hiragino Kaku Gothic ProN",
    "Hiragino Sans", Meiryo, sans-serif;
  color: var(--fg);
  background: var(--bg);
  line-height: 1.7;
  font-size: 16px;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); text-decoration: underline; }

/* ---- レイアウト ---- */
.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 20px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: saturate(160%) blur(12px);
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  border-bottom: 1px solid var(--border);
}
.site-header .container {
  display: flex;
  align-items: center;
  gap: 16px;
  height: 64px;
}
.site-title {
  font-size: 1.2rem;
  font-weight: 800;
  margin: 0;
  letter-spacing: -0.02em;
}
.site-title a {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--fg);
}
.site-title a:hover { text-decoration: none; color: var(--fg); }
.site-logo {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  font-size: 1rem;
  font-weight: 900;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #1c1d20;
  box-shadow: 0 4px 14px var(--accent-soft);
}
.site-nav { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.site-nav a {
  color: var(--fg-muted);
  padding: 8px 14px;
  border-radius: 9px;
  font-size: 0.92rem;
  font-weight: 600;
}
.site-nav a:hover {
  text-decoration: none;
  color: var(--fg);
  background: var(--bg-soft);
}

main { flex: 1 0 auto; padding: 32px 0 64px; }

.site-footer {
  background: var(--bg-soft);
  border-top: 1px solid var(--border);
  color: var(--fg-muted);
  font-size: 0.875rem;
  padding: 24px 0;
}
.site-footer .footer-links { margin-top: 8px; }
.site-footer .footer-links a + a { margin-left: 16px; }

/* ---- 見出し・テキスト ---- */
h1, h2, h3 { line-height: 1.3; letter-spacing: -0.02em; color: var(--fg); }
h2 {
  font-size: 1.2rem;
  margin: 32px 0 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
h3 { font-size: 1.08rem; font-weight: 700; margin: 26px 0 10px; }
.muted { color: var(--fg-muted); }
.stats { color: var(--fg-muted); font-size: 0.9rem; }
/* 本文中の長いURLリンク（フィード詳細の元フィード/デイリーRSS等）を折り返す */
.muted, .feed-create p { overflow-wrap: anywhere; word-break: break-word; }

/* ---- フィード作成フォーム ---- */
.feed-create {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
  margin-bottom: 28px;
}
.feed-create form { display: flex; gap: 10px; flex-wrap: wrap; margin: 0; }
.feed-create input[type="url"],
.search-form input[type="search"],
input[type="url"], input[type="password"], input[type="search"] {
  flex: 1 1 240px;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 1rem;
  background: var(--bg-elevated);
  color: var(--fg);
}
.feed-create input::placeholder,
.search-form input::placeholder,
input::placeholder { color: var(--fg-muted); }
.feed-create input:focus,
.search-form input:focus,
input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

button, .btn {
  padding: 11px 22px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #1c1d20;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.12s ease, filter 0.12s ease;
}
button:hover, .btn:hover { filter: brightness(1.06); transform: translateY(-1px); }

/* ---- フィード統計（詳細ページ） ---- */
.feed-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  margin: 0 0 28px;
}
.feed-stats > div {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 16px;
}
.feed-stats dt {
  color: var(--fg-muted);
  font-size: 0.78rem;
  margin: 0 0 4px;
}
.feed-stats dd {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--accent-2);
  line-height: 1.2;
}
.feed-stats dd .unit { font-size: 0.85rem; font-weight: 400; color: var(--fg-muted); }

/* ---- 検索フォーム ---- */
.search-form { display: flex; gap: 10px; margin-bottom: 24px; }

/* ---- リスト（フィード・記事） ---- */
.list { list-style: none; padding: 0; margin: 0; }
.list li {
  border-bottom: 1px solid var(--border);
}
.list li:last-child { border-bottom: none; }
.list a {
  display: block;
  padding: 13px 10px;
  margin: 0 -10px;
  border-radius: 10px;
  color: var(--fg);
}
.list a:hover { text-decoration: none; background: var(--bg-soft); }
.list a, .list .meta { overflow-wrap: anywhere; word-break: break-word; }
.list .meta { color: var(--fg-muted); font-size: 0.82rem; margin-top: 2px; }
/* meta が a の外（li 直下）にあるケース用 */
.list li > .meta { display: inline; padding: 0 10px 11px; }

/* ---- カード状のおすすめ ---- */
.feed-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr));
  gap: 14px;
  list-style: none;
  padding: 0;
  margin: 0;
}
.feed-grid li {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px 18px;
  transition: transform 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease;
}
.feed-grid li:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--accent) 50%, var(--border));
  box-shadow: var(--shadow);
}

/* ---- ページャ・日付ナビ ---- */
.pager, .day-nav {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 24px;
}
.day-nav { color: var(--fg-muted); }
.pager a, .day-nav a {
  padding: 9px 16px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-soft);
  font-weight: 600;
  font-size: 0.9rem;
  transition: border-color 0.12s ease, background 0.12s ease;
}
.pager a:hover, .day-nav a:hover {
  text-decoration: none;
  background: var(--bg-elevated);
  border-color: color-mix(in srgb, var(--accent) 50%, var(--border));
}

/* ---- お知らせ ---- */
.news { list-style: none; padding: 0; margin: 0; }
.news li { padding: 6px 0; font-size: 0.92rem; overflow-wrap: anywhere; word-break: break-word; }
.news .date { color: var(--fg-muted); margin-right: 8px; }

/* ---- 管理画面 ---- */
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
.admin-table th, .admin-table td {
  border-bottom: 1px solid var(--border);
  padding: 8px 6px;
  text-align: left;
  vertical-align: top;
}
.admin-table th { color: var(--fg-muted); font-weight: 600; }
.admin-actions { white-space: nowrap; }
.admin-actions button,
.admin-actions .admin-link {
  display: inline-block;
  padding: 5px 10px;
  font-size: 0.78rem;
  font-weight: 600;
  margin: 0 2px 2px 0;
  background: var(--bg-elevated);
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: 8px;
  text-decoration: none;
  transform: none;
}
.admin-actions button:hover,
.admin-actions .admin-link:hover {
  background: var(--accent);
  color: #1c1d20;
  filter: none;
  transform: none;
}
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  margin-right: 3px;
}
.badge.spam { background: #7a2e2e; color: #fdd; }
.badge.slow { background: #6b5a2e; color: #fec; }
.badge.del  { background: #555; color: #ccc; }

@media (max-width: 480px) {
  body { font-size: 15px; }
  main { padding: 24px 0 48px; }
}

/* ============================================================
   トップページ（モダン版）。body.home のときだけ適用。
   ヘッダー/フッターは共通レイアウトを流用しつつ、本文を全幅で構成する。
   ============================================================ */
body.home main { padding: 0 0 16px; }
.home-container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}

/* ヒーロー */
.hero {
  position: relative;
  overflow: hidden;
  padding: 80px 0 60px;
  text-align: center;
}
.hero::before {
  content: "";
  position: absolute;
  inset: -40% 0 auto 0;
  height: 520px;
  background: radial-gradient(680px 320px at 50% -10%, var(--accent-soft), transparent 70%);
  pointer-events: none;
}
.hero > .home-container { position: relative; }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--fg-muted);
  background: var(--bg-soft);
  border: 1px solid var(--border);
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 26px;
}
.eyebrow .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.hero h1 {
  font-size: clamp(2rem, 5.2vw, 3.4rem);
  line-height: 1.18;
  letter-spacing: -0.03em;
  margin: 0 0 18px;
  font-weight: 800;
}
.hero h1 .grad {
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero .lead {
  font-size: clamp(1rem, 2.2vw, 1.18rem);
  color: var(--fg-muted);
  max-width: 560px;
  margin: 0 auto 36px;
}

/* ヒーロー内の作成フォーム（ピル型） */
.hero-create {
  display: flex;
  gap: 10px;
  max-width: 560px;
  margin: 0 auto;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px;
  box-shadow: var(--shadow);
}
.hero-create input {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--fg);
  font-size: 1rem;
  padding: 0 16px;
  min-width: 0;
}
.hero-create:focus-within { border-color: var(--accent); }
.hero-create input:focus { outline: none; box-shadow: none; }
.hero-create input::placeholder { color: var(--fg-muted); }
.hero-create button {
  flex: none;
  border: none;
  cursor: pointer;
  border-radius: 999px;
  padding: 12px 24px;
  font-size: 0.98rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #1c1d20;
  white-space: nowrap;
  transition: transform 0.12s ease, filter 0.12s ease;
}
.hero-create button:hover { filter: brightness(1.06); transform: translateY(-1px); }
.hero-meta {
  margin-top: 22px;
  font-size: 0.88rem;
  color: var(--fg-muted);
}
.hero-meta strong { color: var(--fg); }
.hero-meta a { font-weight: 600; }

/* セクション */
.home-section { padding: 28px 0; }
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}
.section-head h2 {
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0;
  padding: 0;
  border: none;
}
.section-head .more { font-size: 0.88rem; font-weight: 600; color: var(--fg-muted); }
.section-head .more:hover { color: var(--accent); }

/* おすすめフィード（カードグリッド） */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr));
  gap: 14px;
  list-style: none;
  padding: 0;
  margin: 0;
}
.card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px 18px;
  color: var(--fg);
  transition: transform 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease;
}
.card:hover {
  text-decoration: none;
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--accent) 50%, var(--border));
  box-shadow: var(--shadow);
}
.card .avatar {
  flex: none;
  width: 42px;
  height: 42px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  font-size: 1.1rem;
  font-weight: 800;
  background: var(--accent-soft);
  color: var(--accent);
}
.card .body { flex: 1; min-width: 0; }
.card .name,
.card .sub { display: block; }
.card .name {
  font-weight: 700;
  font-size: 0.98rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card .sub { font-size: 0.8rem; color: var(--fg-muted); margin-top: 2px; }

/* 2カラム（最近のフィード / お知らせ） */
.grid2 {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 28px;
  align-items: start;
}
/* grid アイテムは既定 min-width:auto（min-content）のため、中の linklist が
   縮まずトラックを押し広げる。0 にして ellipsis を効かせ、横あふれを防ぐ。 */
.grid2 > div { min-width: 0; }
@media (max-width: 760px) {
  .grid2 { grid-template-columns: 1fr; gap: 8px; }
}

/* リンクリスト（番号付き） */
.linklist { list-style: none; padding: 0; margin: 0; }
.linklist li { border-bottom: 1px solid var(--border); }
.linklist li:last-child { border-bottom: none; }
.linklist a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 6px;
  color: var(--fg);
  border-radius: 8px;
  min-width: 0;
  overflow: hidden;
}
.linklist a:hover { text-decoration: none; background: var(--bg-soft); }
.linklist .idx {
  flex: none;
  width: 24px;
  font-variant-numeric: tabular-nums;
  font-size: 0.82rem;
  color: var(--fg-muted);
  text-align: right;
}
.linklist .label {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.95rem;
}

/* お知らせパネル */
.panel {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px 22px;
}
.panel .news { }
.panel .news li { padding: 10px 0; border-bottom: 1px dashed var(--border); }
.panel .news li:last-child { border-bottom: none; }
.panel .news .date { display: block; margin: 0 0 2px; font-size: 0.76rem; }

/* 使い方 3ステップ */
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
@media (max-width: 680px) { .steps { grid-template-columns: 1fr; } }
.step {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
}
.step .n {
  width: 30px; height: 30px;
  border-radius: 9px;
  display: grid; place-items: center;
  font-weight: 800;
  background: var(--accent-soft);
  color: var(--accent);
  margin-bottom: 12px;
}
.step h3 { margin: 0 0 6px; font-size: 1rem; }
.step p { margin: 0; font-size: 0.9rem; color: var(--fg-muted); }

@media (max-width: 480px) {
  .hero { padding: 56px 0 44px; }
  .hero-create { border-radius: 16px; flex-wrap: wrap; background: transparent; border: none; box-shadow: none; padding: 0; }
  .hero-create input {
    border: 1px solid var(--border);
    background: var(--bg-soft);
    border-radius: 12px;
    padding: 14px 16px;
    box-shadow: var(--shadow);
  }
  .hero-create input:focus { border-color: var(--accent); }
  .hero-create button { width: 100%; }
}
