:root {
  color-scheme: light;
  --bg: #f7f3df;
  --paper: #fffdf4;
  --ink: #17231f;
  --muted: #69736b;
  --line: #ded7b9;
  --green: #204f43;
  --red: #b74b3f;
  --gold: #b8892b;
  --soft: #ece6ca;
  --shadow: 0 16px 34px rgba(45, 53, 35, .08);
  --radius: 6px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(32,79,67,.045) 1px, transparent 1px),
    linear-gradient(rgba(32,79,67,.035) 1px, transparent 1px),
    var(--bg);
  background-size: 28px 28px;
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
}

a { color: inherit; text-decoration: none; }
img { display: block; width: 100%; }
h1, h2, h3, p { margin: 0; }
button, select { font: inherit; }

.header,
main,
.footer {
  width: min(1420px, calc(100% - 32px));
  margin: 0 auto;
}

.header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 20px;
  align-items: center;
  min-height: 68px;
  border-bottom: 2px solid var(--green);
  background: rgba(247,243,223,.94);
  backdrop-filter: blur(14px);
}

.logo {
  color: var(--green);
  font-size: 26px;
  font-weight: 900;
}

.nav {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}

.nav a,
.front-actions a,
.tabs button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--paper);
  font-weight: 800;
  white-space: nowrap;
}

.nav a.active,
.nav a:hover,
.front-actions a:first-child,
.tabs button.active {
  color: #fff;
  border-color: var(--green);
  background: var(--green);
}

.front-grid {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr) 270px;
  gap: 16px;
  padding-top: 20px;
}

.front-copy,
.feed-panel,
.rank-panel,
.channel-strip,
.board,
.filter-panel,
.result-panel,
.detail-shell {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255,253,244,.9);
  box-shadow: var(--shadow);
}

.front-copy {
  position: sticky;
  top: 88px;
  align-self: start;
  padding: 20px;
}

.tag {
  margin-bottom: 8px;
  color: var(--red);
  font-size: 12px;
  font-weight: 900;
}

.front-copy h1 {
  margin-bottom: 12px;
  font-size: clamp(38px, 4.5vw, 62px);
  line-height: 1.02;
}

.front-copy p,
.filter-panel p,
.detail-shell p,
.footer p {
  color: var(--muted);
  line-height: 1.72;
}

.front-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0;
}

.numbers {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.numbers div {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--soft);
}

.numbers b {
  display: block;
  color: var(--green);
  font-size: 26px;
}

.numbers span {
  color: var(--muted);
  font-size: 12px;
}

.feed-panel,
.rank-panel,
.board,
.result-panel {
  padding: 14px;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: end;
  margin-bottom: 12px;
}

.panel-head h2 {
  font-size: clamp(24px, 3vw, 38px);
  line-height: 1.1;
}

.panel-head a {
  color: var(--green);
  font-weight: 900;
}

.feed-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.feed-item {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  min-height: 88px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
}

.feed-item img {
  width: 54px;
  height: 72px;
  object-fit: cover;
  border-radius: 3px;
}

.feed-item span,
.result-item span {
  min-width: 0;
}

.feed-item small,
.feed-item em,
.result-item small,
.result-item p,
.poster-item small,
.rank-item small {
  display: block;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.feed-item b,
.result-item b,
.rank-item b {
  display: block;
  overflow: hidden;
  margin: 4px 0;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.rank-item {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.rank-item i {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  color: #fff;
  border-radius: 50%;
  background: var(--red);
  font-style: normal;
  font-weight: 900;
}

.channel-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 16px;
  padding: 12px;
}

.channel-strip a {
  min-height: 86px;
  padding: 14px;
  border-radius: 4px;
  background: var(--green);
  color: #fff;
}

.channel-strip span {
  display: block;
  margin-bottom: 7px;
  color: #f3d88e;
  font-weight: 900;
}

.channel-strip b {
  font-size: 18px;
}

.board-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.board.wide {
  grid-column: 1 / -1;
}

.compact-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.poster-row {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 10px;
}

.poster-item {
  position: relative;
  display: grid;
  gap: 6px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
}

.poster-item img {
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: 3px;
}

.poster-item span {
  position: absolute;
  left: 10px;
  top: 10px;
  padding: 3px 6px;
  color: #fff;
  border-radius: 3px;
  background: rgba(32,79,67,.9);
  font-size: 11px;
}

.poster-item b {
  display: -webkit-box;
  min-height: 40px;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  font-size: 14px;
  line-height: 1.35;
}

.library-shell {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 16px;
  padding-top: 20px;
}

.filter-panel {
  position: sticky;
  top: 88px;
  align-self: start;
  display: grid;
  gap: 12px;
  padding: 18px;
}

.filter-panel h1 {
  font-size: clamp(34px, 4vw, 52px);
  line-height: 1.05;
}

.filter-panel strong {
  color: var(--green);
  font-size: 34px;
}

.tabs {
  display: grid;
  gap: 8px;
}

.sorter {
  display: grid;
  gap: 8px;
  color: var(--muted);
}

.sorter select {
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
}

.result-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 9px;
}

.result-item {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr) 42px;
  gap: 10px;
  align-items: center;
  min-height: 100px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
}

.result-item img {
  width: 62px;
  height: 82px;
  object-fit: cover;
  border-radius: 3px;
}

.result-item em {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  color: #fff;
  border-radius: 50%;
  background: var(--red);
  font-style: normal;
  font-weight: 900;
}

.detail-shell {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 22px;
  align-items: center;
  margin-top: 20px;
  padding: 18px;
}

.detail-shell > img {
  width: 220px;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: 4px;
}

.detail-shell h1 {
  margin-bottom: 10px;
  font-size: clamp(36px, 5vw, 66px);
  line-height: 1.05;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.meta span {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--soft);
  font-weight: 800;
}

.footer {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 1fr);
  gap: 22px;
  margin-top: 34px;
  padding: 28px 0 36px;
  border-top: 2px solid var(--green);
}

.footer b {
  color: var(--green);
  font-size: 24px;
}

.footer h3 {
  margin: 0 0 10px;
  color: var(--red);
}

.footer a {
  display: block;
  margin: 8px 0;
  color: var(--muted);
}

.empty {
  padding: 24px;
  color: var(--muted);
}

@media (max-width: 1180px) {
  .front-grid,
  .library-shell {
    grid-template-columns: 1fr;
  }
  .front-copy,
  .filter-panel {
    position: static;
  }
  .feed-list,
  .result-list {
    grid-template-columns: repeat(2, 1fr);
  }
  .poster-row {
    grid-template-columns: repeat(5, 1fr);
  }
}

@media (max-width: 820px) {
  .header,
  .board-grid,
  .channel-strip,
  .detail-shell,
  .footer {
    grid-template-columns: 1fr;
  }
  .nav {
    justify-content: flex-start;
  }
  .feed-list,
  .compact-list,
  .result-list {
    grid-template-columns: 1fr;
  }
  .poster-row {
    grid-template-columns: repeat(3, 1fr);
  }
  .detail-shell > img {
    width: min(220px, 100%);
  }
}

@media (max-width: 520px) {
  .header,
  main,
  .footer {
    width: calc(100% - 22px);
  }
  .front-copy,
  .feed-panel,
  .rank-panel,
  .board,
  .filter-panel,
  .result-panel,
  .detail-shell {
    padding: 12px;
  }
  .poster-row {
    grid-template-columns: repeat(2, 1fr);
  }
}
