:root {
  --bg: #05060a;
  --bg-soft: #0b0e17;
  --panel: rgba(18, 22, 34, 0.72);
  --panel-solid: #11151f;
  --border: rgba(120, 140, 190, 0.16);
  --border-strong: rgba(120, 140, 190, 0.32);
  --text: #e7ecf6;
  --text-dim: #93a0bb;
  --text-faint: #5f6c88;
  --accent: #4f8bff;
  --accent-2: #7c5cff;
  --accent-3: #22d3ee;
  --good: #34d399;
  --warn: #fbbf24;
  --radius: 16px;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  --font: "Inter", "Segoe UI", -apple-system, BlinkMacSystemFont, "PingFang SC",
    "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.aurora {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(60vw 60vw at 12% -10%, rgba(79, 139, 255, 0.16), transparent 60%),
    radial-gradient(50vw 50vw at 95% 0%, rgba(124, 92, 255, 0.14), transparent 60%),
    radial-gradient(45vw 45vw at 60% 110%, rgba(34, 211, 238, 0.10), transparent 60%),
    var(--bg);
}

/* ---------------- Topbar ---------------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px clamp(16px, 4vw, 48px);
  backdrop-filter: blur(14px);
  background: rgba(5, 6, 10, 0.6);
  border-bottom: 1px solid var(--border);
}

.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.brand-mark {
  color: var(--accent);
  font-size: 20px;
  text-shadow: 0 0 16px rgba(79, 139, 255, 0.7);
}
.brand-name { letter-spacing: 0.3px; font-size: 18px; }

.topnav { display: flex; align-items: center; gap: 16px; }

.lang-toggle {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--panel-solid);
}
.lang-btn {
  border: 0;
  background: transparent;
  color: var(--text-dim);
  padding: 5px 14px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.18s ease;
}
.lang-btn.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  box-shadow: 0 6px 18px rgba(79, 139, 255, 0.4);
}

/* ---------------- Page / hero ---------------- */
.page { max-width: 1180px; margin: 0 auto; padding: 0 clamp(16px, 4vw, 48px) 80px; }

.hero {
  padding: clamp(40px, 8vw, 90px) 0 34px;
  display: block;
}
.hero-left { min-width: 0; }
.hero-kicker {
  margin: 0 0 14px;
  color: var(--accent-3);
  font-size: 13px;
  letter-spacing: 2px;
  text-transform: uppercase;
}
.hero-title {
  margin: 0;
  font-size: clamp(34px, 7vw, 64px);
  font-weight: 800;
  line-height: 1.05;
  background: linear-gradient(120deg, #fff 20%, #9db6ff 60%, #7c5cff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-meta { margin: 18px 0 0; color: var(--text-faint); font-size: 13px; }

/* filter navigation */
.filter-nav {
  margin-top: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  width: min(100%, 860px);
  max-width: 100%;
  padding: 9px;
  border: 1px solid rgba(120, 140, 190, 0.18);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(79, 139, 255, 0.10), rgba(124, 92, 255, 0.08)),
    rgba(10, 13, 23, 0.58);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 18px 45px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(12px);
}
.filter-nav[hidden] { display: none; }
.filter-chip,
.pager-btn {
  border: 1px solid rgba(120, 140, 190, 0.18);
  cursor: pointer;
  border-radius: 999px;
  padding: 9px 16px;
  font-size: 12px;
  font-weight: 700;
  color: #cdd8f5;
  background: rgba(255, 255, 255, 0.05);
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}
.filter-chip.active,
.filter-chip:hover,
.pager-btn:hover:not(:disabled) {
  color: #fff;
  border-color: rgba(79, 139, 255, 0.45);
  background: linear-gradient(135deg, rgba(79, 139, 255, 0.28), rgba(124, 92, 255, 0.20));
  transform: translateY(-1px);
}
.date-filter,
.search-box {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 38px;
  padding: 0 16px;
  border: 1px solid rgba(120, 140, 190, 0.12);
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.025)),
    rgba(5, 7, 14, 0.34);
  color: var(--text-faint);
  font-size: 12px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.date-filter {
  cursor: pointer;
  min-width: 170px;
}
.date-filter strong {
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
}
.date-filter:hover {
  border-color: rgba(79, 139, 255, 0.38);
  background: rgba(79, 139, 255, 0.10);
}
.native-date-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.date-filter input,
.search-box input {
  border: 0;
  outline: none;
  background: transparent;
  color: var(--text);
  font: inherit;
}
.search-box {
  flex: 1 1 280px;
  max-width: 460px;
  min-width: 320px;
  height: 42px;
  margin-left: auto;
}
.search-box:focus-within {
  border-color: rgba(79, 139, 255, 0.48);
  background:
    linear-gradient(180deg, rgba(79, 139, 255, 0.09), rgba(255, 255, 255, 0.025)),
    rgba(5, 7, 14, 0.42);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 0 0 3px rgba(79, 139, 255, 0.08);
}
.search-icon {
  color: var(--accent-3);
  font-size: 17px;
  line-height: 1;
  opacity: 0.82;
}
.search-box input {
  width: 100%;
  min-width: 0;
}
.search-box input::placeholder { color: var(--text-faint); }

/* ---------------- Feed ---------------- */
.feed {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 22px;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: #f3e6c8;
  border: 1px solid rgba(132, 100, 54, 0.22);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.24);
}
.card:hover {
  transform: translateY(-4px);
  border-color: rgba(132, 100, 54, 0.38);
  box-shadow: 0 24px 62px rgba(0, 0, 0, 0.32);
}

.card-cover {
  position: relative;
  aspect-ratio: 16 / 9;
  background-size: cover;
  background-position: center;
  overflow: hidden;
}
.card-cover.placeholder { background: linear-gradient(135deg, #1a2036, #2a1e46 55%, #103042); }
.card-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(5, 6, 10, 0.85));
}
.card-rank {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
  font-size: 12px;
  font-weight: 700;
  color: #cdd8f5;
  background: rgba(5, 6, 10, 0.55);
  border: 1px solid var(--border-strong);
  padding: 3px 9px;
  border-radius: 999px;
  backdrop-filter: blur(4px);
}
.score-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  font-size: 12px;
  font-weight: 800;
  color: #05060a;
  background: linear-gradient(135deg, var(--accent-3), var(--good));
  padding: 3px 9px;
  border-radius: 999px;
}

.card-body {
  padding: 18px 20px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
  background:
    linear-gradient(180deg, rgba(255, 252, 238, 0.96), rgba(241, 226, 195, 0.96)),
    #f3e6c8;
}
.card-title {
  margin: 0;
  color: #211a12;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.42;
  letter-spacing: -0.01em;
}
.card-summary {
  margin: 0;
  color: #594c3a;
  font-size: 14px;
  line-height: 1.75;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-foot { margin-top: auto; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.tag {
  font-size: 11px;
  color: #6f5b3d;
  border: 1px solid rgba(132, 100, 54, 0.18);
  border-radius: 999px;
  padding: 3px 9px;
  background: rgba(120, 90, 45, 0.08);
}
.card-source { font-size: 11px; color: #8a7556; margin-left: auto; }
.card-time {
  width: 100%;
  margin-top: 6px;
  font-size: 11px;
  color: #8a7556;
}

.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin: 28px 0 0;
}
.pager[hidden] { display: none; }
.pager-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  transform: none;
}
.pager-info {
  color: var(--text-faint);
  font-size: 13px;
}

/* ---------------- Empty ---------------- */
.empty { text-align: center; padding: 90px 0; color: var(--text-dim); }
.empty-icon { font-size: 42px; margin-bottom: 12px; }

/* ---------------- Footer ---------------- */
.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px clamp(16px, 4vw, 48px) 40px;
  color: var(--text-faint);
  font-size: 13px;
  border-top: 1px solid var(--border);
}
.admin-link { color: var(--text-faint); text-decoration: none; }
.admin-link:hover { color: var(--accent); }

/* ---------------- Reader overlay (centered modal) ---------------- */
.reader {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(16px, 4vh, 48px) clamp(12px, 4vw, 40px);
}
.reader[hidden] { display: none; }
.reader-backdrop { position: absolute; inset: 0; background: rgba(2, 3, 6, 0.72); backdrop-filter: blur(6px); }
.reader-panel {
  position: relative;
  width: min(860px, 100%);
  max-height: 100%;
  background: var(--bg-soft);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: popIn 0.24s ease;
}
@keyframes popIn { from { transform: translateY(16px) scale(0.98); opacity: 0; } to { transform: translateY(0) scale(1); opacity: 1; } }

.reader-close {
  position: absolute;
  top: 14px;
  right: 16px;
  z-index: 3;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  background: rgba(5, 6, 10, 0.6);
  color: var(--text);
  cursor: pointer;
  font-size: 15px;
}
.reader-close:hover { background: var(--accent); color: #fff; }

.reader-scroll { overflow-y: auto; height: 100%; }
.reader-cover { aspect-ratio: 21 / 9; background-size: cover; background-position: center; }
.reader-cover.placeholder { background: linear-gradient(135deg, #1a2036, #2a1e46 55%, #103042); }

.reader-body-wrap { padding: 26px clamp(20px, 4vw, 44px) 70px; max-width: 720px; }
.reader-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.reader-title { margin: 0 0 12px; font-size: clamp(24px, 4vw, 34px); line-height: 1.25; font-weight: 800; }
.reader-sub { color: var(--text-faint); font-size: 13px; margin-bottom: 22px; }

.reader-content { color: #d7deee; font-size: 16.5px; line-height: 1.85; }
.reader-content p { margin: 0 0 18px; }
.reader-content ul { margin: 0 0 18px; padding-left: 22px; }
.reader-content li { margin-bottom: 8px; }
.reader-content a { color: var(--accent); }
.reader-content strong { color: #fff; }

.reader-extra { margin-top: 26px; display: flex; flex-direction: column; gap: 18px; }
.extra-block {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  background: var(--panel);
}
.extra-block h4 { margin: 0 0 8px; font-size: 13px; color: var(--accent-3); letter-spacing: 0.5px; text-transform: uppercase; }
.extra-block p { margin: 0; color: var(--text-dim); font-size: 14.5px; }

.reader-sources { margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--border); }
.reader-sources h4 { margin: 0 0 10px; font-size: 13px; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.5px; }
.source-item { display: block; color: var(--accent); text-decoration: none; font-size: 14px; margin-bottom: 8px; word-break: break-all; }
.source-item:hover { text-decoration: underline; }
.source-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  padding: 9px 15px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: linear-gradient(135deg, rgba(79, 139, 255, 0.14), rgba(124, 92, 255, 0.14));
  color: #cdd8f5;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
}
.source-primary:hover { border-color: var(--accent); }

/* ---------------- Standalone article page ---------------- */
.article-page {
  width: min(920px, calc(100% - 32px));
  margin: 0 auto;
  padding: 38px clamp(18px, 4vw, 56px) 78px;
  background:
    linear-gradient(180deg, rgba(255, 252, 238, 0.98), rgba(245, 231, 200, 0.98)),
    #f5e7c8;
  color: #272119;
  border: 1px solid rgba(132, 100, 54, 0.28);
  border-radius: 26px;
  box-shadow:
    0 28px 80px rgba(0, 0, 0, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.65);
  margin-top: 34px;
  margin-bottom: 74px;
}
.article-back {
  display: inline-flex;
  margin-bottom: 26px;
  color: #6f5b3d;
  text-decoration: none;
  font-size: 15px;
  font-weight: 700;
}
.article-back:hover { color: #3b5dcc; }
.article-page-cover {
  width: 100%;
  max-height: 380px;
  object-fit: cover;
  border-radius: 18px;
  border: 1px solid rgba(132, 100, 54, 0.22);
  box-shadow: 0 18px 42px rgba(90, 62, 20, 0.22);
  margin-bottom: 30px;
}
.article-page-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}
.article-page-tags span {
  font-size: 12px;
  color: #745f40;
  border: 1px solid rgba(132, 100, 54, 0.20);
  border-radius: 999px;
  padding: 4px 11px;
  background: rgba(120, 90, 45, 0.08);
}
.article-page h1 {
  margin: 0 0 20px;
  font-size: clamp(30px, 5vw, 46px);
  line-height: 1.22;
  letter-spacing: -0.02em;
  color: #211a12;
}
.article-page-meta {
  margin: 0 0 38px;
  color: #7a684c;
  font-size: 14px;
  letter-spacing: 0.02em;
}
.article-page-body {
  color: #2f281f;
  font-size: 18px;
  line-height: 2.05;
  letter-spacing: 0.015em;
  max-width: 760px;
}
.article-page-body p {
  margin: 0 0 28px;
  text-align: justify;
}
.article-page-body ul,
.article-page-body ol {
  margin: 0 0 28px;
  padding-left: 1.5em;
}
.article-page-body li { margin-bottom: 10px; }
.article-page-body a { color: #244bb8; }
.article-page-body strong { color: #15100b; }
.article-page-links {
  margin-top: 44px;
  padding-top: 28px;
  border-top: 1px solid rgba(132, 100, 54, 0.22);
}
.article-page-links h2 {
  margin: 20px 0 14px;
  color: #7a684c;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.article-page-links > a:not(.source-primary) {
  display: block;
  color: #244bb8;
  text-decoration: none;
  margin-bottom: 10px;
  word-break: break-all;
}
.article-page-links > a:hover { text-decoration: underline; }
.article-page .source-primary {
  color: #1f2a44;
  border-color: rgba(132, 100, 54, 0.24);
  background: rgba(120, 90, 45, 0.10);
}

@media (max-width: 560px) {
  .topnav { gap: 10px; }
  .filter-nav {
    width: 100%;
    border-radius: 18px;
  }
  .date-filter { flex: 1; min-width: 0; }
  .search-box { width: 100%; }
}
