/* ============================================================
   Daily Plaza — 样式
   浅/深两套色板，跟着 data-theme 走
   ============================================================ */
:root {
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC",
          "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", system-ui, sans-serif;
  --script: "Snell Roundhand", "Bradley Hand", "Segoe Script", cursive;
  --page: #fcfbf9;
  --panel: #ffffff;
  --side: #fbfaf8;
  --ink: #17191c;
  --ink-2: #5c6168;
  --ink-3: #949aa2;
  --line: #e9e6e0;
  --line-soft: #f2efe9;
  --hover: #f6f4ef;
  --accent: #b4471f;
  --shadow: 0 1px 2px rgba(23, 25, 28, .04), 0 6px 20px rgba(23, 25, 28, .04);
  --shadow-lift: 0 2px 4px rgba(23, 25, 28, .05), 0 14px 34px rgba(23, 25, 28, .09);
  --radius: 13px;
  --side-w: 250px;
}
[data-theme="dark"] {
  --page: #0e1012;
  --panel: #171a1d;
  --side: #121417;
  --ink: #e8e5df;
  --ink-2: #a2a8b0;
  --ink-3: #6d747c;
  --line: #262a2f;
  --line-soft: #1e2226;
  --hover: #1d2125;
  --accent: #e07a4c;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-lift: 0 10px 30px rgba(0, 0, 0, .5);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body {
  background: var(--page);
  color: var(--ink);
  font: 400 14px/1.65 var(--sans);
  transition: background .2s ease, color .2s ease;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* ---------------- 骨架 ---------------- */
.shell { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100vh; }

/* ---------------- 侧栏 ---------------- */
.sidebar {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column;
  padding: 26px 20px 18px;
  background: var(--side);
  border-right: 1px solid var(--line);
  overflow-y: auto; overscroll-behavior: contain;
}
.wordmark {
  font-family: var(--script); font-size: 30px; line-height: 1; letter-spacing: .01em;
  display: block; margin-bottom: 22px;
}
.about { font-size: 13px; color: var(--ink-2); margin: 0 0 16px; line-height: 1.7; }
.identity-links { display: flex; flex-direction: column; gap: 8px; }
.identity-links a {
  font-size: 12.5px; color: var(--ink-2); width: fit-content;
  border-bottom: 1px solid var(--line); padding-bottom: 1px;
  transition: color .15s, border-color .15s;
}
.identity-links a:hover { color: var(--ink); border-color: var(--ink-3); }

.issue-nav { margin-top: 30px; }
.issue-list { display: flex; flex-direction: column; gap: 1px; }
.issue-link {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 10px; border-radius: 8px; font-size: 12.5px; color: var(--ink-2);
  transition: background .15s, color .15s;
}
.issue-link:hover { background: var(--hover); color: var(--ink); }
.issue-link.is-on { background: var(--ink); color: var(--page); font-weight: 500; }
.issue-link .count { font-size: 11.5px; font-variant-numeric: tabular-nums; opacity: .7; font-weight: 500; }
.issue-link.is-on .count { opacity: .85; }

.more-btn {
  margin-top: 8px; padding: 6px 10px; font-size: 12.5px; color: var(--ink-3);
  border-radius: 8px; transition: color .15s, background .15s;
}
.more-btn:hover { color: var(--ink); background: var(--hover); }
.issue-more { margin-top: 6px; max-height: 320px; overflow-y: auto; }
.nav-group { margin-bottom: 10px; }
.nav-month {
  font-size: 11px; color: var(--ink-3); padding: 4px 10px; letter-spacing: .04em;
  position: sticky; top: 0; background: var(--side);
}
.issue-more a {
  display: block; padding: 5px 10px; font-size: 12.5px; color: var(--ink-2); border-radius: 7px;
}
.issue-more a:hover { background: var(--hover); color: var(--ink); }
.issue-more a.is-on { color: var(--accent); font-weight: 500; }

.promo {
  margin-top: auto; padding-top: 24px;
}
.promo p { font-size: 12.5px; color: var(--ink-2); margin: 0 0 12px; line-height: 1.65; }
.promo-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  width: 100%; padding: 10px 14px; border-radius: 999px;
  background: var(--ink); color: var(--page); font-size: 12.5px; font-weight: 500;
  transition: opacity .15s, transform .15s;
}
.promo-btn:hover { opacity: .88; transform: translateY(-1px); }

/* 本机才出现的「写一条」入口：访客和线上都看不到 */
.owner-entry {
  margin-top: auto;
  display: flex; flex-direction: column; gap: 2px;
  padding: 10px 12px; border-radius: 10px;
  border: 1px dashed var(--line);
  text-decoration: none; color: var(--ink-2);
  transition: border-color .15s, color .15s;
}
.promo + .owner-entry { margin-top: 18px; }
.owner-entry .oe-main { font-size: 12.5px; font-weight: 500; }
.owner-entry .oe-sub { font-size: 11px; color: var(--ink-3); letter-spacing: .02em; }
.owner-entry:hover { border-color: var(--accent); color: var(--accent); }
.owner-entry:hover .oe-sub { color: var(--accent); opacity: .7; }

.sidebar-foot {
  display: flex; align-items: center; gap: 8px; margin-top: 18px;
  padding-top: 14px; border-top: 1px solid var(--line);
}
.seg { display: flex; gap: 2px; flex: 1; }
.seg button {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 10px; border-radius: 8px; font-size: 12px; color: var(--ink-3);
  transition: background .15s, color .15s;
}
.seg button:hover { color: var(--ink); background: var(--hover); }
.seg button.is-on { color: var(--ink); background: var(--panel); box-shadow: var(--shadow); }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 8px; color: var(--ink-3);
  transition: background .15s, color .15s;
}
.icon-btn:hover { background: var(--hover); color: var(--ink); }

/* ---------------- 主区 ---------------- */
.main { min-width: 0; padding: 22px; padding-bottom: 96px; }
.plaza { min-height: 60vh; }
.cols { display: grid; grid-template-columns: repeat(var(--n, 4), minmax(0, 1fr)); gap: 12px; }
.col { display: flex; flex-direction: column; gap: 12px; min-width: 0; }

/* ---------------- 卡片 ---------------- */
.card {
  display: block; position: relative;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow);
  transition: transform .18s cubic-bezier(.22,1,.36,1), box-shadow .18s, border-color .18s;
  contain: content;
}
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); border-color: var(--line); }
/* 媒体位：骨架 → 就绪淡入 → 悬停轻放大（图片与视频共用） */
.card-media {
  position: relative; aspect-ratio: 640 / 390; background: var(--hover);
  overflow: hidden; min-height: 168px;
}
.card-media.is-ready { min-height: 0; }
.skel { position: absolute; inset: 0; background: var(--hover); z-index: 1; }
.skel::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,.55) 50%, transparent 100%);
  transform: translateX(-100%); animation: shimmer 1.15s linear infinite;
}
[data-theme="dark"] .skel::after {
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,.07) 50%, transparent 100%);
}
.card-media.is-ready .skel { opacity: 0; transition: opacity .2s ease; }
@keyframes shimmer { to { transform: translateX(100%); } }
.card-media img, .card-media video {
  width: 100%; height: 100%; object-fit: cover; display: block;
  opacity: 0; transition: opacity .25s ease, transform .5s cubic-bezier(.22,1,.36,1);
}
.card-media.is-ready img, .card-media.is-ready video { opacity: 1; }
.card:hover .card-media img, .card:hover .card-media video { transform: scale(1.03); }
.card-media video { pointer-events: none; }

.card-body { padding: 12px 14px 14px; }
.kicker {
  display: flex; align-items: center; gap: 7px;
  font-size: 11px; color: var(--ink-3); letter-spacing: .01em; line-height: 1.2;
}
.kicker .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--ink-3); opacity: .6; }
.card-title {
  font-size: 14.5px; font-weight: 600; line-height: 1.45; margin: 7px 0 0;
  letter-spacing: -.005em;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.card-judgment {
  font-size: 12.5px; color: var(--ink-2); line-height: 1.62; margin: 6px 0 0;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.card-go {
  position: absolute; right: 12px; bottom: 12px; color: var(--ink-3);
  opacity: 0; transform: translate(-3px, 3px); transition: all .18s;
}
.card:hover .card-go { opacity: .9; transform: none; }

/* ---------------- 今日看点 ---------------- */
.summary { padding: 16px 16px 6px; cursor: default; }
.summary:hover { transform: none; box-shadow: var(--shadow); }
.summary-head { display: flex; align-items: baseline; justify-content: space-between; }
.summary-head h2 { font-size: 14.5px; font-weight: 600; margin: 0; letter-spacing: -.005em; }
.summary-head time { font-size: 11px; color: var(--ink-3); }
.summary-text { font-size: 12.8px; line-height: 1.78; color: var(--ink-2); margin: 10px 0 0; }

.physics-stage {
  position: relative; height: 186px; margin: 8px 0 0;
  overflow: hidden; touch-action: pan-y;
}
.physics-stage.is-live { cursor: grab; }
.physics-stage.is-live:active { cursor: grabbing; }
.pill {
  position: absolute; top: 0; left: 0; opacity: 0; will-change: transform;
  display: inline-flex; align-items: center; white-space: nowrap;
  padding: 5px 10px; border-radius: 999px;
  background: var(--panel); border: 1px solid var(--line);
  font-size: 11px; color: var(--ink-2); box-shadow: var(--shadow);
  user-select: none; pointer-events: auto;
}
.tagline { display: flex; flex-wrap: wrap; gap: 6px; padding: 12px 0 14px; }
.tag {
  font-size: 11px; color: var(--ink-2); background: var(--hover);
  border-radius: 999px; padding: 4px 9px;
}

/* ---------------- 列表视图 ---------------- */
.plaza.is-list .list-wrap { max-width: 860px; margin: 0 auto; }
.list-summary { margin-bottom: 24px; }
.list-section { margin-bottom: 28px; }
.list-head {
  font-size: 12.5px; font-weight: 600; margin: 0 0 8px; padding: 0 4px;
  display: flex; align-items: baseline; gap: 6px;
}
.list-head span { font-weight: 400; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.row {
  display: flex; gap: 18px; align-items: flex-start;
  padding: 13px 14px; margin-bottom: 8px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 11px;
  box-shadow: var(--shadow);
  transition: transform .15s cubic-bezier(.22,1,.36,1), box-shadow .15s;
}
.row:hover { transform: translateY(-1px); box-shadow: var(--shadow-lift); }
.row-main { min-width: 0; flex: 1; }
.row-title { font-size: 13.5px; font-weight: 600; margin: 5px 0 0; line-height: 1.5; }
.row-judgment { font-size: 12.3px; color: var(--ink-2); margin: 4px 0 0; line-height: 1.6; }
.row-media {
  position: relative; flex: 0 0 76px; aspect-ratio: 16 / 9; border-radius: 4px; overflow: visible;
  border: 1px solid var(--line); background: var(--hover);
}
.row-media > img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 3px; }
.row-pop {
  position: absolute; right: calc(100% + 12px); top: 50%; width: 232px; aspect-ratio: 640 / 390;
  border-radius: 10px; overflow: hidden; background: var(--panel);
  border: 1px solid var(--line); box-shadow: 0 18px 48px rgba(23,25,28,.18);
  opacity: 0; pointer-events: none; z-index: 60; transform-origin: 92% 50%;
  transform: translate(var(--pop-x, 0), calc(-50% + var(--pop-y, 0))) scale(.88) rotate(0deg);
  transition: opacity .18s ease, transform .22s cubic-bezier(.22,1,.36,1);
}
.row-pop img { width: 100%; height: 100%; object-fit: cover; display: block; }
.row:hover .row-pop {
  opacity: 1;
  transform: translate(var(--pop-x, 0), calc(-50% + var(--pop-y, 0))) scale(1) rotate(var(--pop-rot, 0deg));
}

/* ---------------- 底部筛选 ---------------- */
.filterbar {
  position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%);
  display: flex; align-items: center; gap: 2px; padding: 4px;
  background: color-mix(in srgb, var(--panel) 88%, transparent);
  backdrop-filter: saturate(180%) blur(14px); -webkit-backdrop-filter: saturate(180%) blur(14px);
  border: 1px solid var(--line); border-radius: 999px;
  box-shadow: 0 4px 24px rgba(23,25,28,.10);
  max-width: calc(100vw - 24px); overflow-x: auto; scrollbar-width: none;
  z-index: 40;
}
.filterbar::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto; padding: 7px 13px; border-radius: 999px;
  font-size: 12.5px; color: var(--ink-2); white-space: nowrap;
  transition: background .15s, color .15s;
}
.chip:hover { background: var(--hover); color: var(--ink); }
.chip.is-on { background: var(--ink); color: var(--page); font-weight: 500; }

/* ---------------- 移动端 ---------------- */
.mobile-bar { display: none; }
.scrim { display: none; }

@media (max-width: 1023px) {
  .shell { grid-template-columns: 1fr; }
  .mobile-bar {
    display: flex; align-items: center; justify-content: space-between;
    position: sticky; top: 0; z-index: 50; padding: 8px 12px;
    background: color-mix(in srgb, var(--page) 90%, transparent);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--line);
  }
  .mobile-bar .wordmark { font-size: 25px; margin: 0; }
  .sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; width: 280px; height: 100dvh;
    z-index: 60; transform: translateX(-102%);
    transition: transform .26s cubic-bezier(.22,1,.36,1);
    box-shadow: 0 0 0 1px var(--line);
    background: var(--side);
  }
  .sidebar.is-open { transform: none; }
  .scrim {
    display: block; position: fixed; inset: 0; z-index: 55;
    background: rgba(0,0,0,.32); backdrop-filter: blur(1px);
  }
  .scrim[hidden] { display: none; }
  .main { padding: 14px 12px 88px; }
  .sidebar-foot { display: none; }
  .filterbar { bottom: 12px; }
}

@media (max-width: 649px) {
  .cols { grid-template-columns: 1fr; }
  .physics-stage { height: 168px; }
  .row-media { flex-basis: 92px; }
  .card-title { font-size: 14px; }
}

@media (max-width: 1023px) {
  .row-pop { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

.demo-note {
  font-size: 11px; color: var(--ink-3); text-align: center;
  padding: 26px 0 6px; letter-spacing: .01em;
}

/* ---------------- 密度自适应 ---------------- */
/* 条目少时收窄栏数并把卡片限宽居中，避免缩略图被拉成广告牌 */
.cols[data-n="1"] {
  grid-template-columns: minmax(0, 480px);
  justify-content: center;
}
.cols[data-n="2"] {
  grid-template-columns: repeat(2, minmax(0, 400px));
  justify-content: center;
}
.cols[data-n="3"] {
  max-width: 1120px; margin: 0 auto;
}

/* 稀疏日：摘要改为跨栏横幅 */
.summary-banner {
  max-width: 760px; margin: 2px auto 18px;
  padding: 16px 20px 6px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.summary-banner .summary-head { margin-bottom: 8px; }
.summary-banner .summary-text { margin: 0; }
.summary-banner .tagline { padding: 12px 0 6px; }
.summary-banner .tag { background: var(--hover); }

/* 标签少时不要留一大片空舞台 */
.physics-stage.is-short { height: 88px; }
.physics-stage.is-mid { height: 128px; }

@media (max-width: 1023px) {
  .cols[data-n="1"], .cols[data-n="2"] { grid-template-columns: 1fr; }
  .summary-banner { width: auto !important; max-width: none; margin: 2px 0 14px; padding: 14px 16px 4px; }
  .searchbox { width: min(460px, 86vw); }
}

/* ---------------- 搜索 ---------------- */
.filter-sep { width: 1px; height: 16px; background: var(--line); margin: 0 3px; flex: 0 0 auto; }
.chip-icon { display: inline-flex; align-items: center; justify-content: center; padding: 7px 10px; color: var(--ink-3); }
.chip-icon:hover { color: var(--ink); }

.filterbar.is-searching .chip,
.filterbar.is-searching .filter-sep { display: none; }
.searchbox {
  display: flex; align-items: center; gap: 8px;
  padding: 2px 4px 2px 12px; width: min(520px, 72vw);
}
.searchbox[hidden] { display: none; }
.searchbox .search-ico { display: inline-flex; color: var(--ink-3); }
.searchbox input {
  flex: 1; min-width: 0; border: 0; outline: none; background: transparent;
  font: inherit; font-size: 13px; color: var(--ink); padding: 6px 0;
}
.searchbox input::placeholder { color: var(--ink-3); }
.searchbox input::-webkit-search-cancel-button { display: none; }
.search-clear {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 50%; color: var(--ink-3);
}
.search-clear:hover { background: var(--hover); color: var(--ink); }

.search-rows .row:first-child { margin-top: 10px; }
.search-empty {
  font-size: 13px; color: var(--ink-3); padding: 28px 4px; text-align: center;
}

/* ---------------- 栏目为空 ---------------- */
/* 当天没内容的栏目：留在栏里，但淡一点，别显得整站只有两个栏目 */
.chip.is-empty { color: var(--ink-3); opacity: .5; }
.chip.is-empty:hover { opacity: .8; color: var(--ink-2); }
.chip.is-empty.is-on { opacity: 1; }

.empty-cat { max-width: 420px; margin: 64px auto 88px; text-align: center; }
.ec-mark {
  margin: 0 0 10px; font-size: 11px; letter-spacing: .12em;
  text-transform: uppercase; color: var(--ink-3);
}
.ec-title { margin: 0 0 8px; font-size: 17px; color: var(--ink); letter-spacing: -.01em; }
.ec-sub { margin: 0 0 20px; font-size: 13px; line-height: 1.75; color: var(--ink-3); }
.ec-btn {
  font: inherit; font-size: 13px; cursor: pointer;
  padding: 8px 20px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--panel); color: var(--ink-2);
  transition: border-color .15s, color .15s;
}
.ec-btn:hover { border-color: var(--ink-3); color: var(--ink); }

/* 窄屏：标签折成两行，别藏起来让人以为栏目少了 */
@media (max-width: 620px) {
  .filterbar {
    flex-wrap: wrap; justify-content: center;
    width: calc(100vw - 20px); max-width: 480px;
    border-radius: 18px; padding: 6px 8px; row-gap: 1px;
  }
  .filterbar .chip { padding: 6px 10px; font-size: 12px; }
  .filterbar .filter-sep { display: none; }
  .filterbar .chip-icon { margin-left: 2px; }
  /* 搜索展开时占满整行，别被折行挤不见 */
  .filterbar.is-searching { flex-wrap: nowrap; }
  .filterbar.is-searching .searchbox { flex: 1; }
}
