/* 撸什么 · 线报站 —— 左侧240固定栏 | 中间内容 | 右侧360热门栏 */
:root {
  color-scheme: light;
  --primary: #007fff;
  --primary-soft: #e8f3ff;
  --page: #f5f5f5;
  --surface: #ffffff;
  --surface-raised: #ffffff;
  --text: #1f2329;
  --muted: #73849b;
  --border: #ededed;
  --soft: #f2f5f9;
  --shadow: 0 1px 4px rgba(15, 23, 42, .06);
  --shadow-hover: 0 6px 20px rgba(15, 23, 42, .10);
  --side-w: 240px;
  --hot-w: 360px;
}
html[data-theme="dark"] {
  color-scheme: dark;
  --primary: #70b7ff;
  --primary-soft: #1b2c40;
  --page: #141c27;
  --surface: #1e2936;
  --surface-raised: #253243;
  --text: #e8edf4;
  --muted: #a7b3c2;
  --border: #354355;
  --soft: #293749;
  --shadow: 0 4px 16px rgba(0, 0, 0, .2);
  --shadow-hover: 0 6px 22px rgba(0, 0, 0, .35);
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--page); color: var(--text);
  font: 15px/1.65 -apple-system, BlinkMacSystemFont, "PingFang SC", "Segoe UI", "Microsoft YaHei", sans-serif;
}
a { color: inherit; text-decoration: none; }

/* ===== 三栏结构 ===== */
.layout { display: flex; min-height: 100vh; align-items: flex-start; }

/* 左侧固定栏 240 */
.side {
  flex: 0 0 var(--side-w); width: var(--side-w);
  position: sticky; top: 0; height: 100vh;
  background: var(--surface); border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  padding: 18px 10px 12px; gap: 14px; z-index: 20;
}
.logo { display: flex; align-items: center; gap: 8px; padding: 0 6px; }
.logo-sheep { font-size: 30px; line-height: 1; }
.logo-text { font-size: 18px; font-weight: 700; letter-spacing: 1px; }
.logo-text em { color: var(--primary); font-style: normal; }

/* 分类 + 两列浮层 */
.side-nav { flex: 1; width: 100%; overflow-y: auto; overflow-x: visible; display: flex; flex-direction: column; gap: 2px; scrollbar-width: none; }
.side-nav::-webkit-scrollbar { display: none; }
.cat-all, .cat-name {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 12px; border-radius: 9px; font-size: 14.5px; font-weight: 600; color: var(--text);
  cursor: pointer; transition: background .12s;
}
.cat-all:hover, .cat-name:hover { background: var(--soft); }
.cat-all .n { font-weight: 400; }
.cat { position: relative; }
.cat .arr { color: var(--muted); font-size: 12px; transition: transform .15s; }
.cat:hover .arr, .cat.open .arr { transform: rotate(90deg); }
.flyout {
  display: none; position: absolute; left: calc(100% + 10px); top: -6px;
  width: 320px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 12px; z-index: 60;
  grid-template-columns: 1fr 1fr; gap: 2px 8px;
  box-shadow: var(--shadow-hover);
}
.cat:hover .flyout, .cat.open .flyout { display: grid; }
.flyout a {
  display: flex; align-items: center; justify-content: space-between;
  padding: 7px 10px; border-radius: 8px; font-size: 13.5px; color: var(--text);
}
.flyout a:hover { background: var(--primary-soft); color: var(--primary); }
.flyout .n { font-size: 11.5px; color: var(--muted); }

.side-foot { display: flex; align-items: center; justify-content: space-between; padding: 0 6px; }
.side-foot .tip { font-size: 11px; color: var(--muted); }
.theme-btn {
  border: 1px solid var(--border); background: var(--soft); border-radius: 999px;
  width: 38px; height: 38px; cursor: pointer; font-size: 16px; line-height: 1; color: var(--text);
}

/* 中间内容区 */
.main { flex: 1; min-width: 0; max-width: 760px; padding: 20px 20px 50px; width: 100%; }

/* 搜索 */
.search { display: flex; align-items: center; gap: 8px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 999px; padding: 9px 18px; box-shadow: var(--shadow); }
.search input { flex: 1; border: 0; outline: 0; background: transparent; font-size: 15px; color: var(--text); min-width: 0; }
.search svg { flex-shrink: 0; stroke: var(--muted); }
.count { font-size: 12.5px; color: var(--muted); padding: 10px 4px 0; }

/* 列表 */
.list { margin-top: 8px; }
.item { background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 14px 18px; margin-bottom: 10px; box-shadow: var(--shadow); transition: box-shadow .15s, transform .15s; }
.item:hover { box-shadow: var(--shadow-hover); transform: translateY(-1px); }
.item-title { font-size: 15.5px; font-weight: 600; color: var(--text); }
.item-title:hover { color: var(--primary); }
.item-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin-top: 6px; font-size: 12.5px; color: var(--muted); }
.item-meta .t-tags a { color: var(--primary); margin-right: 8px; }
.m-views { margin-left: auto; color: var(--muted); font-size: 12px; }
.empty { text-align: center; color: var(--muted); padding: 60px 0; }

/* 右侧热门栏 360，固定 */
.hot {
  flex: 0 0 var(--hot-w); width: var(--hot-w);
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  padding: 20px 16px 30px 4px;
}
.hot-head { font-size: 16px; font-weight: 700; padding: 4px 8px 10px; }
.hot-item {
  display: flex; align-items: baseline; gap: 8px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  padding: 9px 12px; margin-bottom: 8px; box-shadow: var(--shadow);
  transition: box-shadow .15s;
}
.hot-item:hover { box-shadow: var(--shadow-hover); }
.hot-rank { flex: 0 0 20px; text-align: center; font-size: 13px; font-weight: 700; color: var(--muted); }
.hot-rank.top3 { color: #ff6b35; }
.hot-title { flex: 1; font-size: 13.5px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hot-item:hover .hot-title { color: var(--primary); }
.hot-views { flex-shrink: 0; font-size: 12px; color: var(--muted); }
.hot-foot { text-align: center; font-size: 11.5px; color: var(--muted); padding: 8px 0; }

/* 详情页 */
.back { font-size: 14px; color: var(--muted); }
.back:hover { color: var(--primary); }
.page-title { font-size: 20px; font-weight: 700; margin: 10px 0 4px; }
.count-inline { font-size: 13px; color: var(--muted); font-weight: 400; }
.d-title { font-size: 21px; font-weight: 700; margin: 10px 0 6px; color: var(--text); line-height: 1.4; }
.d-meta { font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px 14px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 18px 20px; margin-top: 14px; box-shadow: var(--shadow); }
.d-content { font-size: 15.5px; white-space: pre-wrap; word-break: break-word; }
.d-content a { color: var(--primary); word-break: break-all; }
.d-content img { max-width: 100%; border-radius: 8px; border: 1px solid var(--border); margin: 8px 0; }
.d-tags { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--border); }
.d-tags a { display: inline-block; padding: 3px 12px; margin: 0 8px 8px 0; border-radius: 999px;
  background: var(--soft); color: var(--primary); font-size: 13px; }
.d-src { margin-top: 14px; font-size: 12.5px; color: var(--muted); }
.pn { display: flex; justify-content: space-between; gap: 10px; margin-top: 14px; }
.pn a, .pn span { flex: 1; }
.pn a { background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  padding: 10px 14px; font-size: 13.5px; color: var(--primary); overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; box-shadow: var(--shadow); }
.pn a.next { text-align: right; }

.foot { text-align: center; color: var(--muted); font-size: 12.5px; padding: 30px 0 10px; }

/* ===== 响应式 ===== */
@media (max-width: 1279px) {
  .hot { display: none; }   /* 窄屏收起右栏 */
}
@media (max-width: 767px) {
  .side {
    flex: none; width: 100%; height: auto;
    flex-direction: row; align-items: center;
    padding: 8px 12px; gap: 10px;
    border-right: 0; border-bottom: 1px solid var(--border);
  }
  .logo { padding: 0; }
  .logo-sheep { font-size: 24px; }
  .logo-text { font-size: 15px; }
  .side-nav { flex-direction: row; overflow-x: auto; flex: 1; padding: 0; gap: 4px; overflow-x: auto; }
  .cat-all, .cat-name { padding: 5px 10px; font-size: 13px; white-space: nowrap; }
  .cat-all .n, .flyout .n { display: none; }
  .flyout {
    position: fixed; left: 10px; right: 10px; top: 58px; width: auto;
    grid-template-columns: 1fr 1fr;
  }
  .side-foot { width: auto; }
  .side-foot .tip { display: none; }
  .main { padding: 14px 12px 40px; }
}
