:root {
  color-scheme: dark;
  --bg: #070b16;
  --surface: rgba(255, 255, 255, 0.045);
  --surface-strong: rgba(255, 255, 255, 0.075);
  --line: rgba(255, 255, 255, 0.09);
  --text: #e8edf7;
  --muted: #8b97ad;
  --faint: #5b677c;
  --accent: #38bdf8;
  --accent-soft: rgba(56, 189, 248, 0.14);
  --radius: 16px;
  --topbar-h: 0px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

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

body {
  min-height: 100dvh;
  margin: 0;
  background:
    radial-gradient(48rem 30rem at 8% -8%, rgba(56, 189, 248, 0.12), transparent 60%),
    radial-gradient(40rem 26rem at 100% 0%, rgba(129, 90, 255, 0.09), transparent 55%),
    var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}



body.sheet-open {
  overflow: hidden;
}

.app {
  width: min(720px, 100%);
  min-height: 100dvh;
  margin: 0 auto;
  padding: 0 16px calc(28px + env(safe-area-inset-bottom));
}

/* ---------- 顶栏 ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  margin: 0 -16px;
  padding: calc(12px + env(safe-area-inset-top)) 16px 8px;
  border-bottom: 1px solid transparent;
  background: rgba(7, 11, 22, 0.78);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}

.topbar::after {
  content: "";
  position: absolute;
  right: 16px;
  bottom: 0;
  left: 16px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line) 18%, var(--line) 82%, transparent);
}

.topbar-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.back,
.icon-btn {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.back:hover,
.back:focus-visible,
.icon-btn:hover,
.icon-btn:focus-visible {
  border-color: rgba(56, 189, 248, 0.45);
  background: var(--accent-soft);
  color: var(--accent);
  outline: none;
}

.title-wrap {
  min-width: 0;
  flex: 1;
}

.title-wrap h1 {
  margin: 0;
  font-size: 19px;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.title-wrap p {
  overflow: hidden;
  margin: 1px 0 0;
  color: var(--muted);
  font-size: 11.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- 搜索 ---------- */

.search {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  margin-top: 10px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--faint);
  transition: border-color 0.15s ease, background 0.15s ease;
}

.search:focus-within {
  border-color: rgba(56, 189, 248, 0.5);
  background: rgba(56, 189, 248, 0.07);
}

.search input {
  min-width: 0;
  flex: 1;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 16px;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

.search input::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
}

.search input::placeholder {
  color: var(--faint);
}

/* ---------- 国家筛选 ---------- */

.chips {
  display: flex;
  gap: 8px;
  margin: 10px -16px 0;
  padding: 0 16px 4px;
  overflow-x: auto;
  scrollbar-width: none;
}

.chips::-webkit-scrollbar {
  display: none;
}

.chip {
  flex: none;
  padding: 6px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  font: inherit;
  font-size: 12.5px;
  line-height: 1.4;
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.chip[aria-pressed="true"] {
  border-color: rgba(56, 189, 248, 0.5);
  background: var(--accent-soft);
  color: #bae6fd;
}

.chip:focus-visible {
  outline: 2px solid rgba(56, 189, 248, 0.6);
  outline-offset: 1px;
}

/* ---------- 列表 ---------- */

.feed {
  padding-top: 14px;
}

.list {
  display: grid;
  gap: 12px;
}

.card {
  position: relative;
  padding: 16px 16px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.card:hover,
.card:focus-visible {
  border-color: rgba(56, 189, 248, 0.35);
  background: var(--surface-strong);
  outline: none;
}

.card:active {
  transform: scale(0.994);
}

.card-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 9px;
  color: var(--faint);
  font-size: 11.5px;
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.1);
  color: #7dd3fc;
  font-size: 11px;
  letter-spacing: 0.02em;
}

.tag.hot {
  background: rgba(251, 146, 60, 0.14);
  color: #fdba74;
}

.card-top time {
  margin-left: auto;
  white-space: nowrap;
}

.card h2 {
  margin: 0;
  font-size: 16.5px;
  font-weight: 600;
  line-height: 1.45;
  letter-spacing: -0.01em;
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.card p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.card-foot {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 11px;
  color: var(--faint);
  font-size: 11.5px;
}

.card-foot .source {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-foot .arrow {
  margin-left: auto;
  color: var(--faint);
  font-size: 13px;
}

/* ---------- 骨架屏 ---------- */

.skeletons {
  display: grid;
  gap: 12px;
}

.skeleton-card {
  padding: 18px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.skeleton-card span {
  display: block;
  height: 12px;
  margin-bottom: 10px;
  border-radius: 6px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.055) 25%, rgba(255, 255, 255, 0.11) 37%, rgba(255, 255, 255, 0.055) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
}

.skeleton-card span:nth-child(1) {
  width: 34%;
  height: 10px;
}

.skeleton-card span:nth-child(2) {
  width: 92%;
  height: 17px;
}

.skeleton-card span:nth-child(3) {
  width: 70%;
  margin-bottom: 0;
}

@keyframes shimmer {
  0% {
    background-position: 100% 0;
  }
  100% {
    background-position: 0 0;
  }
}

/* ---------- 状态与加载更多 ---------- */

.more {
  display: block;
  width: 100%;
  margin-top: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.more:hover,
.more:focus-visible {
  border-color: rgba(56, 189, 248, 0.4);
  color: var(--accent);
  outline: none;
}

.status {
  margin: 22px 0 6px;
  color: var(--faint);
  font-size: 12.5px;
  text-align: center;
}

.status.error {
  color: #fca5a5;
}

.status button {
  margin-left: 8px;
  padding: 3px 10px;
  border: 1px solid rgba(248, 113, 113, 0.35);
  border-radius: 999px;
  background: transparent;
  color: #fca5a5;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.sentinel {
  height: 1px;
}

.page-foot {
  padding: 26px 0 4px;
  color: #47536a;
  font-size: 11px;
  text-align: center;
}

.noscript {
  position: fixed;
  right: 20px;
  bottom: 20px;
  left: 20px;
  margin: 0;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #111827;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

/* ---------- 详情面板 ---------- */

.sheet {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  visibility: hidden;
}

.sheet.open {
  visibility: visible;
}

.sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 5, 12, 0.66);
  opacity: 0;
  transition: opacity 0.24s ease;
}

.sheet.open .sheet-backdrop {
  opacity: 1;
}

.sheet-panel {
  position: relative;
  display: flex;
  width: min(720px, 100%);
  max-height: 86dvh;
  flex-direction: column;
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 22px 22px 0 0;
  background: #0d1322;
  box-shadow: 0 -24px 80px rgba(0, 0, 0, 0.5);
  transform: translateY(100%);
  transition: transform 0.26s cubic-bezier(0.32, 0.72, 0.28, 1);
}

.sheet.open .sheet-panel {
  transform: translateY(0);
}

.sheet-head {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 10px 14px 4px;
}

.sheet-grip {
  position: absolute;
  top: 8px;
  left: 50%;
  width: 38px;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  transform: translateX(-50%);
}

.sheet-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  cursor: pointer;
}

.sheet-close:hover,
.sheet-close:focus-visible {
  color: var(--text);
  outline: none;
}

.sheet-body {
  padding: 4px 20px calc(24px + env(safe-area-inset-bottom));
  overflow-y: auto;
  overscroll-behavior: contain;
}

.sheet-meta {
  margin: 0 0 10px;
  color: var(--faint);
  font-size: 11.5px;
}

.sheet h2 {
  margin: 0 0 10px;
  font-size: 20px;
  font-weight: 650;
  line-height: 1.4;
  letter-spacing: -0.01em;
}

.sheet-original {
  margin: 0 0 16px;
  padding-left: 10px;
  border-left: 2px solid rgba(56, 189, 248, 0.35);
  color: var(--faint);
  font-size: 12.5px;
}

.sheet-summary {
  margin: 0 0 22px;
  color: #c3cddd;
  font-size: 14.5px;
  line-height: 1.75;
  white-space: pre-wrap;
}

.sheet-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: #7dd3fc;
  font-size: 13.5px;
  text-decoration: none;
}

.sheet-link:hover,
.sheet-link:focus-visible {
  background: rgba(56, 189, 248, 0.22);
  outline: none;
}

@media (min-width: 720px) {
  .app {
    padding-right: 24px;
    padding-left: 24px;
  }

  .topbar {
    margin-right: -24px;
    margin-left: -24px;
    padding-right: 24px;
    padding-left: 24px;
  }

  .chips {
    margin-right: -24px;
    margin-left: -24px;
    padding-right: 24px;
    padding-left: 24px;
  }

  .sheet {
    align-items: center;
    padding: 32px;
  }

  .sheet-panel {
    max-height: 82dvh;
    border-bottom: 1px solid var(--line);
    border-radius: 22px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .card,
  .chip,
  .back,
  .icon-btn,
  .sheet-panel,
  .sheet-backdrop,
  .skeleton-card span {
    animation: none;
    transition: none;
  }
}
