/* 隔壁网页版 — 纯静态站，无框架。配色跟正式商标一致：奶油底 #FFF8E6、黑字 #111111、主色蓝 #2B7FFF、辅色橙 #FF8A00、点缀绿 #009688，白卡片。 */
:root {
  --brand: #2B7FFF;
  --brand-soft: #EAF2FF;
  --brand-dark: #1F66D1;
  --orange: #FF8A00;
  --orange-dark: #E87A00;
  --green: #009688;
  --ink: #111111;
  --bg: #FFF8E6;
  --card: #ffffff;
  --text: #111111;
  --muted: #6b7280;
  --border: #EADFC2;
  --border-soft: #F0E7CE;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(17, 17, 17, .05), 0 4px 16px rgba(17, 17, 17, .05);
  --shadow-hover: 0 2px 4px rgba(17, 17, 17, .06), 0 10px 28px rgba(17, 17, 17, .09);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible {
  outline: 2px solid var(--brand); outline-offset: 2px;
}

/* 顶部导航：奶油底黑字 + 细阴影，吸顶 */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: rgba(255, 248, 230, .96);
  backdrop-filter: blur(8px);
  color: var(--text);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 8px rgba(17, 17, 17, .04);
}
.topbar-inner {
  max-width: 1240px; margin: 0 auto; padding: 10px 20px;
  display: flex; align-items: center; gap: 16px;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand-logo { width: 38px; height: 38px; border-radius: 10px; display: block; box-shadow: 0 2px 8px rgba(17, 17, 17, .12); }
.brand-name { font-size: 23px; font-weight: 800; color: var(--ink); letter-spacing: .5px; line-height: 1; }
.brand-slogan { font-size: 12px; color: var(--muted); background: #fff; border: 1px solid var(--border); border-radius: 999px; padding: 3px 9px; }
.search-box { flex: 1; display: flex; gap: 8px; max-width: 520px; margin-left: auto; }
.search-box input {
  flex: 1; padding: 9px 16px; border: 1px solid var(--border);
  border-radius: 999px; background: #fff; color: var(--text); font-size: 14px;
  transition: border-color .15s, box-shadow .15s;
}
.search-box input::placeholder { color: #9a9a9a; }
.search-box input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(43, 127, 255, .16); }
.search-box button {
  border: none; background: var(--brand); color: #fff; border-radius: 999px; padding: 9px 18px; font-weight: 700;
  transition: background .15s;
}
.search-box button:hover { background: var(--brand-dark); }
.top-actions { display: flex; gap: 8px; align-items: center; }
.btn-primary {
  background: var(--brand);
  color: #fff; border: none; border-radius: 999px; padding: 9px 18px; font-weight: 700;
  transition: background .15s, transform .15s, box-shadow .15s;
}
.btn-primary:hover { background: var(--brand-dark); box-shadow: 0 4px 12px rgba(43, 127, 255, .28); }
.btn-primary:active { transform: translateY(1px); }
/* 发帖用橙色，更醒目 */
#publish-btn, #publish-submit { background: var(--orange); box-shadow: 0 4px 12px rgba(255, 138, 0, .28); }
#publish-btn:hover, #publish-submit:hover { background: var(--orange-dark); box-shadow: 0 6px 16px rgba(255, 138, 0, .36); }
/* 已关注用绿色 */
#follow-btn.followed { background: var(--green); }
.btn-ghost {
  background: #fff; color: var(--text); border: 1px solid var(--border);
  border-radius: 999px; padding: 9px 16px; font-weight: 600;
  transition: border-color .15s, color .15s;
}
.btn-ghost:hover { border-color: var(--brand); color: var(--brand); }
.btn-icon { background: none; border: none; font-size: 24px; line-height: 1; color: var(--muted); border-radius: 8px; padding: 2px 6px; }
.btn-icon:hover { color: var(--text); background: var(--bg); }
.topbar .btn-ghost { background: #fff; color: var(--text); border-color: var(--border); }
.topbar .btn-ghost:hover { border-color: var(--brand); color: var(--brand); }

/* 布局：左栏 230px + 内容 + 右栏 300px */
.layout {
  max-width: 1240px; margin: 0 auto; padding: 20px;
  display: grid; grid-template-columns: 230px minmax(0, 1fr) 300px; gap: 20px;
  align-items: start;
}
.sidebar-left, .sidebar-right { position: sticky; top: 76px; }
.sidebar-left h2, .card h3 { margin: 0 0 10px; font-size: 16px; font-weight: 800; letter-spacing: .3px; }
.content h1 { font-size: 21px; margin: 2px 0 14px; font-weight: 800; letter-spacing: .3px; }
.circle-list { list-style: none; margin: 0 0 16px; padding: 0; }
.circle-list a {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  padding: 9px 12px; border-radius: 10px; color: var(--text);
  transition: background .15s, color .15s;
}
.circle-list a:hover { background: #fff; text-decoration: none; box-shadow: var(--shadow); }
.circle-list a.active { background: #fff; color: var(--brand); font-weight: 700; box-shadow: var(--shadow); box-shadow: var(--shadow), inset 3px 0 0 var(--brand); }
.circle-list .count { color: var(--muted); font-size: 12px; white-space: nowrap; }
.sidebar-note { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.sidebar-note p { margin: 8px 0; }
.sidebar-note strong { font-size: 15px; }
.muted { color: var(--muted); font-size: 13px; }
.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px; margin-bottom: 16px; box-shadow: var(--shadow);
}
.card h3 { display: flex; align-items: center; gap: 8px; }
.card h3::before { content: ""; width: 4px; height: 16px; border-radius: 2px; background: var(--orange); }
.muted-card { background: #FFFDF5; }
.muted-card h3::before { background: var(--green); }
.hot-list { margin: 0; padding-left: 20px; }
.hot-list li { margin: 8px 0; }
.hot-list li::marker { color: var(--orange); font-weight: 800; }
.hot-list a { color: var(--text); font-weight: 600; }
.hot-list a:hover { color: var(--brand); }
.rules { margin: 0; padding-left: 20px; }
.rules li { margin: 8px 0; }
.rules li::marker { color: var(--brand); font-weight: 700; }

/* 排序 + 信息流：分段式切换 */
.sort-tabs { display: inline-flex; gap: 4px; margin-bottom: 14px; background: #fff; border: 1px solid var(--border); border-radius: 999px; padding: 4px; box-shadow: var(--shadow); }
.sort-tabs button {
  border: none; background: transparent; border-radius: 999px; padding: 7px 18px; color: var(--muted); font-weight: 600;
  transition: background .15s, color .15s;
}
.sort-tabs button:hover { color: var(--text); }
.sort-tabs button.active {
  background: var(--brand); color: #fff; font-weight: 700; box-shadow: 0 2px 8px rgba(43, 127, 255, .32);
}
.post-card {
  display: flex; gap: 14px; background: var(--card);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; margin-bottom: 14px; cursor: pointer;
  box-shadow: var(--shadow);
  transition: box-shadow .18s, transform .18s, border-color .18s;
}
.post-card:hover { border-color: var(--brand); box-shadow: var(--shadow-hover); transform: translateY(-1px); }
.vote-col { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 40px; padding-top: 2px; }
.vote-col button {
  border: 1px solid var(--border-soft); background: var(--bg); border-radius: 8px;
  width: 34px; height: 30px; font-size: 13px; line-height: 1; color: var(--muted);
  transition: background .15s, color .15s, border-color .15s;
}
.vote-col button:hover { background: var(--brand-soft); border-color: var(--brand); color: var(--brand); }
.vote-col button.voted-up { background: var(--orange); border-color: var(--orange); color: #fff; }
.vote-col button.voted-down { background: #E8E2D2; border-color: #E8E2D2; color: var(--text); }
.vote-col .score { font-weight: 800; font-size: 14px; line-height: 1.2; }
.post-body { min-width: 0; flex: 1; }
.post-meta { color: var(--muted); font-size: 13px; margin-bottom: 5px; }
.post-meta::first-letter { text-transform: none; }
.post-title { margin: 0 0 6px; font-size: 18px; line-height: 1.45; font-weight: 800; letter-spacing: .2px; }
.post-summary {
  margin: 0 0 10px; color: #3d3d3d;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.post-actions { display: flex; gap: 16px; color: var(--muted); font-size: 13px; flex-wrap: wrap; align-items: center; }
.post-actions button { border: none; background: none; color: var(--muted); padding: 2px 4px; border-radius: 6px; font-weight: 600; }
.post-actions button:hover { color: var(--brand); background: var(--brand-soft); }
.empty, .loading { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 36px 24px; text-align: center; color: var(--muted); box-shadow: var(--shadow); }

/* 详情页 */
.post-detail { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.post-detail h1 { margin: 6px 0 10px; font-size: 23px; line-height: 1.4; }
.post-content { white-space: pre-wrap; margin: 12px 0 16px; font-size: 16px; line-height: 1.75; }
.detail-actions { display: flex; gap: 10px; flex-wrap: wrap; margin: 14px 0; }
.detail-actions .btn-ghost.voted-up { background: var(--orange); border-color: var(--orange); color: #fff; }
.detail-actions .btn-ghost.voted-down { background: #E8E2D2; border-color: #E8E2D2; color: var(--text); }
.comment { border-top: 1px solid var(--border-soft); padding: 14px 0; }
.comment-author { font-weight: 700; font-size: 14px; }
.comment-time { color: var(--muted); font-size: 12px; margin-left: 8px; }
.comment-form { display: flex; gap: 8px; margin-top: 14px; }
.comment-form input { flex: 1; padding: 10px 12px; border: 1px solid var(--border); border-radius: 999px; }
.comment-form input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(43, 127, 255, .16); }
.back-link { display: inline-block; margin-bottom: 12px; font-weight: 600; }

/* 表单 / 弹窗 */
.input {
  width: 100%; padding: 11px 12px; border: 1px solid var(--border);
  border-radius: 10px; font: inherit; background: #fff;
}
.input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(43, 127, 255, .16); }
.textarea { min-height: 140px; resize: vertical; }
.field-label { display: block; font-weight: 700; margin: 14px 0 6px; }
.error { color: #d93025; background: #fdecea; border-radius: 8px; padding: 8px 10px; }
.modal {
  position: fixed; inset: 0; z-index: 50; background: rgba(17, 17, 17, .5);
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.modal[hidden] { display: none; }
.modal-card { background: #fff; border-radius: 16px; padding: 22px; width: 100%; max-width: 560px; max-height: 90vh; overflow: auto; box-shadow: 0 20px 60px rgba(0, 0, 0, .25); }
.modal-head { display: flex; justify-content: space-between; align-items: center; }
.modal-head h2 { margin: 0; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  background: var(--green); color: #fff; padding: 11px 18px; border-radius: 999px; z-index: 60;
  box-shadow: 0 8px 24px rgba(0, 150, 136, .35); font-weight: 600;
}
.toast[hidden] { display: none; }

@media (max-width: 1020px) {
  .layout { grid-template-columns: 200px minmax(0, 1fr); }
  .sidebar-right { display: none; }
  .sidebar-left { position: static; }
}
@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; padding: 14px; gap: 14px; }
  .sidebar-left { order: 2; }
  .sidebar-right { display: block; order: 3; position: static; }
  .brand-slogan { display: none; }
  .topbar-inner { padding: 10px 14px; }
}
@media (max-width: 560px) {
  body { font-size: 14px; }
  .topbar-inner { flex-wrap: wrap; gap: 10px; }
  .search-box { order: 3; flex-basis: 100%; max-width: none; margin-left: 0; }
  .search-box button { padding: 9px 14px; }
  .top-actions { margin-left: auto; }
  .top-actions .btn-primary, .top-actions .btn-ghost { padding: 8px 14px; }
  .post-card { padding: 13px 12px; gap: 10px; margin-bottom: 10px; }
  .post-title { font-size: 16px; }
  .post-detail { padding: 16px 14px; }
  .post-detail h1 { font-size: 20px; }
  .vote-col { min-width: 34px; }
  .vote-col button { width: 30px; height: 28px; }
  .layout { padding: 12px; }
  .content h1 { font-size: 19px; }
  .modal-card { padding: 18px 16px; }
}
