:root {
  color-scheme: light;
  --page: #fdfaf3;
  --surface: #fffdf8;
  --ink: #32271f;
  --muted: #6f6255;
  --soft: #7f7165;
  --line: #e9dfd1;
  --line-strong: #ddcfbd;
  --accent: #c94d25;
  --accent-hover: #ad3e1d;
  --accent-soft: #f8e9df;
  --focus: #e48b63;
  --error: #a52e24;
  --column: 760px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  background: var(--page);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.62;
}

button, input { font: inherit; }
button { color: inherit; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.shell {
  width: min(var(--column), calc(100% - 40px));
  margin-inline: auto;
  padding-bottom: 36px;
}

.channel-header {
  display: grid;
  gap: 8px;
  padding: 26px 0 18px;
  border-bottom: 1px solid var(--line);
}

.channel-identity {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  color: inherit;
  text-decoration: none;
}

.channel-mark {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent-hover);
  font-size: 13px;
  font-weight: 760;
}

.channel-name { font-size: 19px; font-weight: 740; letter-spacing: -0.02em; }
.channel-note { margin: 0; color: var(--muted); font-size: 13px; }

.filter-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.filter-bar input {
  width: 100%;
  min-height: 44px;
  padding: 8px 12px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  outline: none;
}
.filter-bar input::placeholder { color: var(--soft); opacity: 1; }

.date-range { display: flex; align-items: center; gap: 6px; }
.date-range input { width: 146px; font-size: 13px; }
.date-dash { color: var(--soft); }

.quiet-button,
.primary-button {
  min-height: 44px;
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 140ms ease, border-color 140ms ease, transform 140ms ease;
}
.quiet-button:hover { background: var(--accent-soft); border-color: var(--focus); }
.primary-button {
  color: #fffdf8;
  background: var(--accent);
  border-color: var(--accent);
  font-weight: 640;
}
.primary-button:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.quiet-button:active,
.primary-button:active { transform: translateY(1px); }
.quiet-button[hidden],
.primary-button[hidden] { display: none; }

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--focus), transparent 30%);
  outline-offset: 2px;
}

.source-strip { border-bottom: 1px solid var(--line); }
.source-list {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 10px 0;
  scrollbar-width: thin;
}
.source-chip {
  flex: 0 0 auto;
  min-height: 38px;
  padding: 6px 11px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
}
.source-chip:hover { color: var(--ink); border-color: var(--line-strong); }
.source-chip[aria-pressed="true"] {
  color: var(--accent-hover);
  background: var(--accent-soft);
  border-color: #efd2c1;
  font-weight: 640;
}
.chip-count { margin-left: 6px; color: var(--soft); font-variant-numeric: tabular-nums; }
.source-chip[aria-pressed="true"] .chip-count { color: var(--accent-hover); }

.feed-area { padding-top: 18px; }

.feed-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.feed-heading h1 { margin: 0 0 2px; font-size: 18px; letter-spacing: -0.02em; }
.result-count { margin: 0; color: var(--muted); font-size: 12px; }

.status-message { margin: 12px 0 0; color: var(--muted); font-size: 13px; }
.status-message:empty { display: none; }
.status-message.error { color: var(--error); }
.status-message.empty-state { padding: 20px 0; }
.status-title { display: block; color: var(--ink); font-size: 15px; font-weight: 660; }
.error-message { margin: 0 0 8px; }
.retry-button {
  min-height: 44px;
  padding: 8px 13px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface);
  cursor: pointer;
}

.post-feed { list-style: none; margin: 0; padding: 0; }

.post {
  padding: 22px 0 24px;
  border-bottom: 1px solid var(--line-strong);
}
.post:last-child { border-bottom: 0; }

.post-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 10px;
  margin-bottom: 8px;
  color: var(--soft);
  font-size: 12px;
}
.post-source { color: var(--accent-hover); font-weight: 660; }
.post-time { font-variant-numeric: tabular-nums; }
.post-count { color: var(--soft); }

.post-title { margin: 0 0 10px; font-size: 16px; font-weight: 700; line-height: 1.5; overflow-wrap: anywhere; }

.post-body { margin: 0; padding: 0; list-style: none; display: grid; gap: 9px; }
.post-entry { display: grid; gap: 2px; }
.entry-line {
  display: flex;
  align-items: baseline;
  gap: 7px;
  font-size: 14.5px;
  line-height: 1.5;
}
.entry-index {
  flex: 0 0 auto;
  min-width: 1.25em;
  color: var(--soft);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.entry-link {
  color: var(--ink);
  text-decoration-color: color-mix(in srgb, var(--ink), transparent 75%);
  text-underline-offset: 2px;
  overflow-wrap: anywhere;
}
.entry-link:hover { color: var(--accent-hover); text-decoration-color: currentColor; }
.entry-text { color: var(--ink); overflow-wrap: anywhere; }
.entry-note {
  margin: 0 0 0 1.6em;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.55;
  overflow-wrap: anywhere;
  white-space: pre-line;
}
.entry-note.detail { color: var(--muted); font-size: 12.5px; }

.post-foot { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.post-open {
  min-height: 40px;
  padding: 7px 14px;
  border: 1px solid #efd2c1;
  border-radius: 9px;
  background: var(--accent-soft);
  color: var(--accent-hover);
  font-size: 13px;
  font-weight: 660;
  cursor: pointer;
  transition: background-color 140ms ease, border-color 140ms ease, transform 140ms ease;
}
.post-open:hover { background: #f4ded0; border-color: var(--focus); }
.post-open:active { transform: translateY(1px); }

.more-row { display: flex; justify-content: center; padding: 22px 0 8px; }
.load-more { min-width: 160px; color: var(--accent-hover); font-weight: 620; }

.page-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 6px;
  margin-top: 12px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--soft);
  font-size: 12px;
}

.link-sheet {
  width: min(560px, calc(100% - 28px));
  max-height: min(82vh, 640px);
  padding: 18px 20px 14px;
  color: var(--ink);
  background: #fffdf8;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
}
.link-sheet::backdrop { background: rgb(50 39 31 / 45%); }
.link-sheet h2 { margin: 0 0 4px; font-size: 16px; }
.link-sheet-note { margin: 0 0 12px; color: var(--muted); font-size: 12px; }
.link-sheet-list {
  max-height: 46vh;
  overflow-y: auto;
  margin: 0;
  padding: 0 0 0 1.4em;
  display: grid;
  gap: 8px;
  font-size: 13.5px;
}
.link-sheet-list a { color: var(--accent-hover); overflow-wrap: anywhere; }
.link-sheet-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }

@media (max-width: 640px) {
  .shell { width: calc(100% - 28px); }
  .channel-header { padding-top: 18px; }
  .filter-bar { grid-template-columns: 1fr auto; }
  .filter-bar .search-field { grid-column: 1 / -1; }
  .date-range { grid-column: 1 / -1; }
  .date-range input { width: 100%; }
  .post-title { font-size: 15.5px; }
  .entry-line { font-size: 14px; }
  .post-body { gap: 11px; }
  .post-open { min-height: 44px; }
  .source-chip { min-height: 44px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
