/* 柠汐公共留言 · WinUI3 / Fluent Design 风格（浅色 + 深色） */
:root {
  --accent: #0067c0;
  --accent-hover: #005ba8;
  --accent-pressed: #004f92;
  --accent-contrast: #ffffff;
  --accent-text: #0067c0;
  --accent-soft: rgba(0, 103, 192, .1);

  --bg: #f3f3f3;
  --card: #ffffff;
  --card-hover: #f7f7f7;
  --text: #1b1b1b;
  --text-2: #444444;
  --text-3: #6b6b6b;
  --text-muted: #9a9a9a;

  --line: #e6e6e6;
  --line-strong: #d3d3d3;
  --input-bg: #ffffff;
  --input-border: #cfcfcf;

  --header-bg: rgba(255, 255, 255, .84);
  --overlay: rgba(0, 0, 0, .34);
  --toast-bg: #2b2b2b;
  --toast-text: #ffffff;

  --chip-bg: #f0f0f0;
  --rank-bg: #eeeeee;
  --danger: #c42b1c;
  --success: #0f7b3f;
  --warning: #9d5d00;

  --shadow: 0 2px 6px rgba(0, 0, 0, .05);
  --shadow-lg: 0 24px 64px rgba(0, 0, 0, .2);

  --radius: 8px;
  --radius-sm: 4px;
  --font: "Segoe UI Variable Text", "Segoe UI", "Microsoft YaHei UI", "Microsoft YaHei",
    system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}

:root[data-theme="dark"] {
  --accent: #60cdff;
  --accent-hover: #7ed7ff;
  --accent-pressed: #4db8e8;
  --accent-contrast: #00304a;
  --accent-text: #60cdff;
  --accent-soft: rgba(96, 205, 255, .14);

  --bg: #1f1f1f;
  --card: #2b2b2b;
  --card-hover: #333333;
  --text: #f2f2f2;
  --text-2: #d4d4d4;
  --text-3: #a6a6a6;
  --text-muted: #8a8a8a;

  --line: #3b3b3b;
  --line-strong: #4c4c4c;
  --input-bg: #323232;
  --input-border: #4c4c4c;

  --header-bg: rgba(31, 31, 31, .86);
  --overlay: rgba(0, 0, 0, .55);
  --toast-bg: #3a3a3a;
  --toast-text: #f7f7f7;

  --chip-bg: #3a3a3a;
  --rank-bg: #3a3a3a;
  --danger: #ff99a4;
  --success: #6ccb8f;
  --warning: #fce100;

  --shadow: 0 2px 8px rgba(0, 0, 0, .35);
  --shadow-lg: 0 24px 64px rgba(0, 0, 0, .6);
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background .2s ease, color .2s ease;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
[hidden] { display: none !important; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---------------- 顶栏（Mica / Acrylic） ---------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--header-bg);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
}

.header-inner {
  height: 56px;
  display: flex;
  align-items: center;
  gap: 18px;
}

.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 16px;
  width: 100%;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  flex-shrink: 0;
}

.logo-mark {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  color: var(--accent-contrast);
  display: grid;
  place-items: center;
  font-size: 15px;
  font-weight: 600;
}

.logo-text {
  font-family: "Segoe UI Variable Display", "Segoe UI Variable Text", "Segoe UI", "Microsoft YaHei UI", sans-serif;
  font-size: 17px;
  letter-spacing: .2px;
}

.nav {
  display: flex;
  gap: 4px;
  margin-left: 2px;
}

.nav-link {
  color: var(--text-2);
  font-size: 14px;
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  transition: background .15s, color .15s;
}

.nav-link:hover { background: var(--chip-bg); color: var(--text); }

.nav-link.active {
  color: var(--accent-text);
  font-weight: 600;
  background: var(--accent-soft);
}

/* 顶栏搜索框 */
.header-search {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 260px;
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--input-border);
  border-bottom-color: var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--input-bg);
  color: var(--text-3);
  cursor: text;
  transition: border-color .15s, box-shadow .15s;
}

.header-search:hover { border-color: var(--line-strong); }

.header-search:focus-within {
  border-color: var(--accent);
  box-shadow: inset 0 -2px 0 var(--accent);
}

.header-search svg { flex-shrink: 0; }

.header-search input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  outline: none;
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
}

.header-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-btn {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
  transition: background .15s, color .15s;
}

.icon-btn:hover { background: var(--chip-bg); color: var(--text); }

.user-area { display: flex; align-items: center; }

.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}

.user-chip .user-name {
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.badge {
  font-size: 11px;
  color: var(--accent-text);
  background: var(--accent-soft);
  border-radius: 3px;
  padding: 1px 6px;
  line-height: 1.5;
  white-space: nowrap;
}

/* ---------------- 按钮 ---------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 7px 16px;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.4;
  cursor: pointer;
  background: var(--card);
  color: var(--text);
  box-shadow: 0 1px 0 rgba(0, 0, 0, .03);
  transition: background .15s, color .15s, border-color .15s;
  white-space: nowrap;
}

.btn:hover { background: var(--card-hover); }
.btn:active { background: var(--chip-bg); }

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-contrast);
  font-weight: 600;
}

.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-primary:active { background: var(--accent-pressed); }
.btn-primary:disabled { opacity: .55; cursor: not-allowed; }

.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--chip-bg); color: var(--text); }
.btn-ghost:disabled { opacity: .5; cursor: not-allowed; }

.btn-sm { padding: 5px 12px; font-size: 13px; }
.btn-block { width: 100%; margin-top: 8px; }

.link-btn {
  background: none;
  border: none;
  color: var(--text-3);
  cursor: pointer;
  font-size: 13px;
  padding: 0;
}

.link-btn:hover { color: var(--accent-text); }

/* ---------------- 布局 ---------------- */
.layout {
  max-width: 1032px;
  margin: 0 auto;
  padding: 16px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 296px;
  gap: 16px;
  align-items: start;
}

.main-col {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.side-col {
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: sticky;
  top: 72px;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.card-title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-sub { font-size: 12px; color: var(--text-3); }

.title-dot {
  width: 3px;
  height: 16px;
  border-radius: 2px;
  background: var(--accent);
  display: inline-block;
}

/* ---------------- 每日必读 ---------------- */
.daily-card {
  background:
    linear-gradient(180deg, var(--accent-soft), transparent 52%),
    var(--card);
}

.daily-list {
  list-style: none;
  margin: 0;
  padding: 6px 18px 12px;
}

.daily-item + .daily-item { border-top: 1px solid var(--line); }

.daily-link {
  display: flex;
  gap: 12px;
  padding: 13px 0;
}

.daily-rank {
  width: 22px;
  height: 22px;
  border-radius: 4px;
  background: var(--rank-bg);
  color: var(--text-3);
  font-size: 13px;
  font-weight: 600;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  margin-top: 3px;
}

.rank-1 { background: #c42b1c; color: #fff; }
.rank-2 { background: #d97706; color: #fff; }
.rank-3 { background: #b58a00; color: #fff; }

.daily-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.daily-title {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.5;
  transition: color .15s;
}

.daily-link:hover .daily-title { color: var(--accent-text); }

.daily-excerpt {
  font-size: 13px;
  color: var(--text-3);
  line-height: 1.5;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 12px;
  color: var(--text-3);
}

/* ---------------- 帖子列表 ---------------- */
.feed-item {
  display: block;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  border-left: 2px solid transparent;
  transition: background .15s, border-color .15s;
}

.feed-item:last-child { border-bottom: none; }
.feed-item:hover { background: var(--card-hover); border-left-color: var(--accent); }

.feed-title {
  margin: 0 0 6px;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.5;
  color: var(--text);
}

.feed-item:hover .feed-title { color: var(--accent-text); }

.feed-excerpt {
  margin: 0 0 8px;
  font-size: 14px;
  line-height: 1.65;
  color: var(--text-3);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.feed-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  font-size: 12px;
  color: var(--text-3);
}

.feed-author {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-2);
}

.load-more-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 16px;
}

.feed-end { font-size: 12px; color: var(--text-muted); }

/* ---------------- 头像 ---------------- */
.avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  color: var(--accent-contrast);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  flex-shrink: 0;
  user-select: none;
}

.avatar.xs { width: 20px; height: 20px; font-size: 11px; }
.avatar.sm { width: 28px; height: 28px; font-size: 13px; }
.avatar.md { width: 36px; height: 36px; font-size: 15px; }
.avatar.lg { width: 48px; height: 48px; font-size: 20px; }

/* ---------------- 右侧卡片 ---------------- */
.account-card,
.notice-card { padding: 16px 18px; }

.account-card h3,
.notice-card h3 {
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 600;
}

.notice-card p {
  margin: 0 0 8px;
  font-size: 13px;
  line-height: 1.7;
  color: var(--text-3);
}

.notice-card p:last-child { margin-bottom: 0; }

.notice-tip { color: var(--text-muted) !important; }

.account-user {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.account-name { font-size: 15px; font-weight: 600; }

.account-desc {
  margin: 2px 0 0;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-3);
}

.account-btns .btn { margin-top: 8px; }

/* ---------------- 提示 ---------------- */
.placeholder {
  padding: 28px 18px;
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
}

.placeholder.error { color: var(--danger); }

.site-footer {
  max-width: 1032px;
  margin: 0 auto;
  padding: 8px 16px 32px;
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
}

/* ---------------- 弹窗 ---------------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: var(--overlay);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal {
  position: relative;
  width: 100%;
  max-width: 400px;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-lg);
}

.composer-modal { max-width: 640px; }
.search-modal { max-width: 640px; }
.fav-modal { max-width: 620px; }

.modal h2 {
  margin: 0 0 6px;
  font-size: 20px;
  font-family: "Segoe UI Variable Display", "Segoe UI Variable Text", "Segoe UI", "Microsoft YaHei UI", sans-serif;
}

.modal-sub {
  margin: 0 0 16px;
  font-size: 13px;
  color: var(--text-3);
  line-height: 1.6;
}

.modal-close {
  position: absolute;
  top: 8px;
  right: 10px;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: var(--radius-sm);
  background: none;
  font-size: 22px;
  line-height: 1;
  color: var(--text-3);
  cursor: pointer;
}

.modal-close:hover { background: var(--chip-bg); color: var(--text); }

.seg {
  display: flex;
  background: var(--chip-bg);
  border-radius: var(--radius-sm);
  padding: 3px;
  margin-bottom: 16px;
}

.seg button {
  flex: 1;
  border: none;
  background: none;
  padding: 7px;
  border-radius: 3px;
  color: var(--text-2);
  font-size: 14px;
  cursor: pointer;
  transition: background .15s, color .15s;
}

.seg button.active {
  background: var(--card);
  color: var(--accent-text);
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .12);
}

.field { display: block; margin-bottom: 14px; }

.field > span {
  display: block;
  font-size: 13px;
  color: var(--text-2);
  margin-bottom: 6px;
}

.field input,
.field textarea {
  width: 100%;
  border: 1px solid var(--input-border);
  border-bottom-color: var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  font-size: 14px;
  font-family: inherit;
  line-height: 1.6;
  color: var(--text);
  background: var(--input-bg);
  outline: none;
  resize: vertical;
  transition: border-color .15s, box-shadow .15s;
}

.field input:focus,
.field textarea:focus {
  border-color: var(--accent);
  box-shadow: inset 0 -2px 0 var(--accent);
}

.form-error {
  color: var(--danger);
  font-size: 13px;
  min-height: 18px;
  margin: 0 0 10px;
}

.modal-hint {
  margin: 12px 0 0;
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
}

.composer-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.counter { font-size: 12px; color: var(--text-muted); }

body.modal-open { overflow: hidden; }

.nx-toast {
  position: fixed;
  left: 50%;
  bottom: 48px;
  z-index: 300;
  transform: translate(-50%, 12px);
  max-width: 82vw;
  padding: 10px 20px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--toast-bg);
  color: var(--toast-text);
  font-size: 14px;
  text-align: center;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s, transform .25s;
}

.nx-toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------------- 搜索面板 ---------------- */
.search-form {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

.search-form input {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--input-border);
  border-bottom-color: var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  font-family: inherit;
  font-size: 14px;
  color: var(--text);
  background: var(--input-bg);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}

.search-form input:focus {
  border-color: var(--accent);
  box-shadow: inset 0 -2px 0 var(--accent);
}

.search-results {
  max-height: 52vh;
  overflow-y: auto;
  border-top: 1px solid var(--line);
  padding-top: 6px;
}

.search-hint {
  margin: 14px 2px;
  font-size: 13px;
  color: var(--text-3);
}

.search-hint.error { color: var(--danger); }

.search-count {
  margin: 10px 2px 6px;
  font-size: 12px;
  color: var(--text-muted);
}

.search-result {
  display: block;
  padding: 11px 10px;
  border-radius: var(--radius-sm);
  transition: background .15s;
}

.search-result:hover { background: var(--card-hover); }

.search-result-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.search-result:hover .search-result-title { color: var(--accent-text); }

.search-result-summary {
  margin: 3px 0 5px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-3);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.search-result-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 12px;
  color: var(--text-muted);
}

/* ---------------- 我的收藏 ---------------- */
.fav-list {
  max-height: 56vh;
  overflow-y: auto;
  border-top: 1px solid var(--line);
  padding-top: 6px;
}

.fav-item {
  display: block;
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  border-radius: var(--radius-sm);
  transition: background .15s;
}

.fav-item:last-child { border-bottom: none; }
.fav-item:hover { background: var(--card-hover); }

.fav-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.fav-item:hover .fav-title { color: var(--accent-text); }

.fav-excerpt {
  margin: 3px 0 6px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-3);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.fav-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 12px;
  color: var(--text-muted);
}

/* ---------------- 帖子阅读页 ---------------- */
.post-layout {
  max-width: 1128px;
  grid-template-columns: minmax(0, 1fr) 360px;
}

.article-card { padding: 0 28px 30px; }

.article-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 16px;
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  border: 1px solid var(--line-strong);
  background: var(--card);
  color: var(--text-2);
  padding: 6px 14px 6px 9px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  cursor: pointer;
  transition: .15s;
}

.back-btn:hover { background: var(--chip-bg); color: var(--text); }

.article-tag { font-size: 12px; color: var(--text-muted); }

.article-title {
  margin: 14px 0 16px;
  font-size: 26px;
  line-height: 1.42;
  font-weight: 600;
  word-break: break-word;
  font-family: "Segoe UI Variable Display", "Segoe UI Variable Text", "Segoe UI", "Microsoft YaHei UI", sans-serif;
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.article-author { font-size: 14px; font-weight: 600; }
.article-meta-text { min-width: 0; }

.article-sub {
  margin-top: 2px;
  font-size: 12px;
  color: var(--text-3);
}

.action-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 0 14px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line-strong);
  background: var(--card);
  border-radius: var(--radius-sm);
  padding: 6px 14px;
  color: var(--text-2);
  font-size: 13px;
  cursor: pointer;
  transition: .15s;
}

.action:hover {
  color: var(--text);
  background: var(--chip-bg);
}

.action.active {
  color: var(--accent-text);
  border-color: var(--accent);
  background: var(--accent-soft);
}

.article-content {
  font-size: 16px;
  line-height: 1.95;
  color: var(--text);
  word-break: break-word;
}

.article-content p { margin: 0 0 16px; }
.article-content p:last-child { margin-bottom: 0; }

.article-end {
  margin-top: 34px;
  text-align: center;
  font-size: 13px;
  letter-spacing: 2px;
  color: var(--text-muted);
}

.article-error {
  padding: 56px 0 40px;
  text-align: center;
}

.article-error h2 { margin: 0 0 8px; font-size: 20px; }
.article-error p { margin: 0 0 20px; color: var(--text-3); }

/* ---------------- 留言区 ---------------- */
.comments-col {
  position: sticky;
  top: 72px;
  max-height: calc(100vh - 90px);
}

.comments-card {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-height: calc(100vh - 90px);
}

.comments-head { padding: 14px 16px; }

.comment-editor {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}

.comment-editor textarea {
  width: 100%;
  border: 1px solid var(--input-border);
  border-bottom-color: var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 10px;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
  background: var(--input-bg);
  outline: none;
  resize: vertical;
  transition: .15s;
}

.comment-editor textarea:focus {
  border-color: var(--accent);
  box-shadow: inset 0 -2px 0 var(--accent);
}

.comment-editor.logged-out textarea,
.comment-editor.logged-out .editor-foot { display: none; }

.editor-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
}

.editor-login {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 4px 0;
  font-size: 13px;
  color: var(--text-3);
}

.reply-hint {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  font-size: 12px;
  color: var(--text-3);
}

.reply-hint b { color: var(--accent-text); }

.comment-list {
  flex: 1;
  overflow-y: auto;
  padding: 4px 16px 16px;
}

.comment {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.comment:last-child { border-bottom: none; }

.comment-head { display: flex; gap: 10px; }

.comment-user { flex: 1; min-width: 0; }

.comment-user-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.comment-time { font-size: 12px; color: var(--text-muted); }
.reply-to { font-size: 12px; color: var(--text-3); }

.comment-text {
  margin: 5px 0 6px;
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-2);
  word-break: break-word;
}

.comment-ops { display: flex; gap: 14px; }

.op-btn {
  background: none;
  border: none;
  padding: 0;
  font-size: 12px;
  color: var(--text-3);
  cursor: pointer;
}

.op-btn:hover { color: var(--accent-text); }
.op-btn.liked { color: var(--accent-text); font-weight: 600; }

.reply-list {
  margin: 6px 0 0 38px;
  padding-left: 10px;
  border-left: 2px solid var(--line);
}

.is-reply { padding: 8px 0; border-bottom: none; }

/* ---------------- 管理后台 ---------------- */
.admin-wrap {
  max-width: 1128px;
  margin: 0 auto;
  padding: 20px 16px 48px;
}

.gate-card {
  max-width: 520px;
  margin: 48px auto;
  padding: 44px 24px;
  text-align: center;
}

.gate-card h2 { margin: 0 0 10px; font-size: 20px; }
.gate-card p { margin: 0; color: var(--text-3); font-size: 14px; line-height: 1.8; }

.gate-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 20px;
}

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

.admin-head h1 {
  margin: 0;
  font-size: 22px;
  font-family: "Segoe UI Variable Display", "Segoe UI Variable Text", "Segoe UI", "Microsoft YaHei UI", sans-serif;
}

.admin-sub { margin: 4px 0 0; font-size: 13px; color: var(--text-3); }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 14px;
}

.stat-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  text-align: center;
}

.stat-value { font-size: 24px; font-weight: 600; color: var(--accent-text); }
.stat-label { margin-top: 2px; font-size: 12px; color: var(--text-3); }

.admin-card { padding-bottom: 8px; overflow: hidden; }

.admin-tabs { margin: 14px 16px 0; }

.admin-toolbar {
  display: flex;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.admin-toolbar input {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--input-border);
  border-bottom-color: var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-family: inherit;
  font-size: 14px;
  color: var(--text);
  background: var(--input-bg);
  outline: none;
}

.admin-toolbar input:focus {
  border-color: var(--accent);
  box-shadow: inset 0 -2px 0 var(--accent);
}

.admin-toolbar select {
  border: 1px solid var(--input-border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  font-family: inherit;
  font-size: 14px;
  color: var(--text);
  background: var(--input-bg);
  outline: none;
}

.table-wrap { overflow-x: auto; }

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.admin-table th {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--card-hover);
  color: var(--text-3);
  font-weight: 500;
  text-align: left;
  white-space: nowrap;
}

.admin-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.cell-title {
  max-width: 420px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
}

.cell-sub {
  max-width: 420px;
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  color: var(--text-muted);
}

.mono { font-size: 12px; color: var(--text-3); white-space: nowrap; }

.pill {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 11px;
  white-space: nowrap;
}

.pill-live { background: rgba(15, 123, 63, .12); color: var(--success); }
.pill-deleted { background: rgba(196, 43, 28, .12); color: var(--danger); }

.ops { display: flex; flex-wrap: wrap; gap: 10px; }

.op-link {
  background: none;
  border: none;
  padding: 0;
  font-size: 13px;
  color: var(--accent-text);
  cursor: pointer;
}

.op-link.danger { color: var(--danger); }
.op-link:hover { text-decoration: underline; }
.op-disabled { color: var(--text-muted); }

.table-empty {
  padding: 32px 12px !important;
  text-align: center;
  color: var(--text-muted);
}

.table-empty.error { color: var(--danger); }

.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 14px;
  font-size: 13px;
  color: var(--text-3);
}

/* ---------------- 滚动条 ---------------- */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb {
  background: var(--line-strong);
  border-radius: 6px;
  border: 3px solid transparent;
  background-clip: content-box;
}
::-webkit-scrollbar-track { background: transparent; }

/* ---------------- 响应式 ---------------- */
@media (max-width: 1040px) {
  .header-search { width: 200px; }
}

@media (max-width: 960px) {
  .layout,
  .post-layout { grid-template-columns: 1fr; }

  .side-col { position: static; }

  .comments-col { position: static; max-height: none; }
  .comments-card { max-height: none; }
  .comment-list { max-height: 520px; }

  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 760px) {
  .header-inner { gap: 10px; }
  .logo-text { display: none; }
  .nav { display: none; }
  .header-search { flex: 1; width: auto; min-width: 90px; }
  .user-name { display: none; }
}

@media (max-width: 640px) {
  .layout { padding: 10px; gap: 10px; }
  .card-head { padding: 14px; }
  .daily-list { padding: 4px 14px 10px; }
  .feed-item { padding: 14px; }
  .article-card { padding: 0 16px 24px; }
  .article-title { font-size: 22px; }
  .article-content { font-size: 15px; }
  .admin-head { flex-direction: column; align-items: flex-start; }
  .admin-toolbar { flex-wrap: wrap; }
  .admin-toolbar input { flex-basis: 100%; }
  .stat-value { font-size: 20px; }
  .btn-sm { padding: 5px 10px; }
}
