/* ============================================================
   柴郡·小舍 — style.css
   主题：苔金 Moss & Brass（森系·暖调·高级）
   ============================================================ */

/* ---------- Reset & Base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --brand: #6E7B54;        /* 苔绿主色 */
  --brand-light: #E7EADF;  /* 淡苔底（tint） */
  --brand-dark: #55613F;   /* hover 深苔 */
  --gold: #B08D57;         /* 古铜金点缀 */
  --gold-dark: #977544;
  --text: #2E332B;         /* 松墨字 */
  --text-secondary: #6E6E60;
  --text-muted: #8A897C;
  --bg: #F4F2EC;           /* 暖米底 */
  --card: #FBFAF6;         /* 纸白卡 */
  --border: rgba(46,51,43,.12);
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(46,51,43,.05);
  --shadow: 0 8px 30px rgba(46,51,43,.08);
  --danger: #B4573F;
  --success: #5E7B54;
  --warning: #B08D57;
  --serif: "LXGW WenKai", "Noto Serif SC", "Source Han Serif SC", "Songti SC", Georgia, serif;
}

html { font-size: 15px; scroll-behavior: smooth; }

body {
  font-family: "Noto Sans SC", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-dark); }

/* ---------- 高级感：衬线标题 + 细线图标 ---------- */
h1, h2, h3, .brand, .page-header h1, .topic-title, .topic-title-lg,
.replies-heading, .reply-form-title, .member-name, .error-title,
.admin-head h1, .form-page h1, .card-form h1, .auth-card h1, .sidebar-title {
  font-family: var(--serif);
  font-weight: 500;
  letter-spacing: .01em;
}
.meta-views svg, .meta-replies svg, .meta-likes svg,
.topic-header-meta svg, .reply-header svg { stroke-width: 1.5; }
.btn-primary, .btn-primary-sm, .btn-outline, .btn-admin { letter-spacing: .02em; }

/* ---------- Topbar ---------- */
.topbar {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.topbar-inner {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 clamp(1rem, 4vw, 3.5rem);
  height: 54px;
  display: flex;
  align-items: center;
  gap: 1.2rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 500;
  font-size: 1.18rem;
  color: var(--text);
  white-space: nowrap;
  flex-shrink: 0;
}
.brand .brand-mark { width: 30px; height: 30px; color: var(--brand); flex-shrink: 0; }
.brand:hover { color: var(--text); }

/* Desktop nav */
.desktop-nav {
  display: flex;
  align-items: center;
  gap: .9rem;
  flex: 1;
}

.desktop-nav a {
  color: var(--text);
  font-size: .9rem;
  white-space: nowrap;
  transition: color .15s;
}
.desktop-nav a:hover { color: var(--brand); }

.user-badge {
  font-size: .85rem;
  font-weight: 600;
  color: var(--brand);
  padding: .25rem .6rem;
  background: var(--brand-light);
  border-radius: 20px;
}

.nav-link-muted {
  color: var(--text-muted) !important;
  font-size: .85rem;
}

.nav-user-area {
  display: flex;
  align-items: center;
  gap: .7rem;
  margin-left: auto;
}
.user-badge--link { cursor: pointer; text-decoration: none; transition: filter .15s, transform .15s; }
.user-badge--link:hover { filter: brightness(.96); transform: translateY(-1px); }

/* Search form in topbar */
.search-form {
  display: flex;
  align-items: center;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 0 .3rem 0 .7rem;
  height: 32px;
  transition: border-color .15s;
  flex-shrink: 0;
}
.search-form:focus-within { border-color: var(--brand); }

.search-input {
  border: none;
  background: transparent;
  outline: none;
  font-size: .85rem;
  width: 130px;
  color: var(--text);
}
.search-input::placeholder { color: var(--text-muted); }

.search-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 2px;
  display: flex;
  align-items: center;
}
.search-btn:hover { color: var(--brand); }

/* Hamburger button */
.hamburger-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  margin-left: auto;
}
.hamburger-btn span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: .2s;
}

/* Mobile nav overlay */
.mobile-nav {
  position: fixed;
  top: 0;
  right: -100%;
  width: 280px;
  height: 100vh;
  background: var(--card);
  z-index: 200;
  transition: right .3s ease;
  box-shadow: -4px 0 20px rgba(0,0,0,.15);
  display: flex;
  flex-direction: column;
}
.mobile-nav.open { right: 0; }

.mobile-nav-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.2rem;
  border-bottom: 1px solid var(--border);
}

.mobile-nav-close {
  background: none;
  border: none;
  font-size: 1.6rem;
  cursor: pointer;
  color: var(--text-secondary);
  line-height: 1;
}

.mobile-nav-links {
  display: flex;
  flex-direction: column;
  padding: 1rem 0;
}
.mobile-nav-links a {
  padding: .75rem 1.5rem;
  color: var(--text);
  font-size: 1rem;
  border-bottom: 1px solid var(--border);
}
.mobile-nav-links a:hover { background: var(--bg); color: var(--brand); }

.mobile-user {
  padding: .75rem 1.5rem;
  font-weight: 600;
  color: var(--brand);
  border-bottom: 1px solid var(--border);
}

.mobile-search-form {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .75rem 1.5rem;
  border-bottom: 1px solid var(--border);
}
.mobile-search-form .search-input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .5rem .7rem;
  font-size: .9rem;
}

/* ---------- Container / Layout ---------- */
.container {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 1.5rem clamp(1rem, 4vw, 3.5rem);
  flex: 1;
}

.page-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 1.5rem;
  align-items: start;
}

.main-col { min-width: 0; }

/* ---------- Page Header ---------- */
.page-header {
  margin-bottom: 1rem;
}
.page-header h1 {
  font-size: 1.4rem;
  font-weight: 700;
}
.page-desc {
  color: var(--text-secondary);
  font-size: .9rem;
  margin-top: .25rem;
}

/* ---------- Sort Tabs ---------- */
.sort-tabs {
  display: flex;
  gap: .4rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.sort-tab {
  padding: .35rem .9rem;
  border-radius: 20px;
  font-size: .85rem;
  color: var(--text-secondary);
  background: var(--card);
  border: 1px solid var(--border);
  transition: all .15s;
}
.sort-tab:hover { color: var(--brand); border-color: var(--brand); }
.sort-tab.active {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}

/* ---------- Topic List ---------- */
.topic-list {
  display: flex;
  flex-direction: column;
}

.topic-row {
  display: flex;
  align-items: flex-start;
  gap: .8rem;
  padding: .9rem 1rem;
  background: var(--card);
  border-radius: var(--radius);
  margin-bottom: .5rem;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .15s;
}
.topic-row:hover { box-shadow: var(--shadow); }

.topic-avatar { flex-shrink: 0; padding-top: 2px; }

.topic-info { flex: 1; min-width: 0; }

.topic-title-row {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
}

.topic-title {
  font-weight: 600;
  font-size: .95rem;
  color: var(--text);
  word-break: break-word;
}
.topic-title:hover { color: var(--brand); }

.cat-tag {
  display: inline-block;
  font-size: .72rem;
  padding: .1rem .5rem;
  border-radius: 10px;
  background: var(--brand-light);
  color: var(--brand);
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
}

.topic-meta {
  display: flex;
  align-items: center;
  gap: .4rem;
  margin-top: .35rem;
  font-size: .8rem;
  color: var(--text-muted);
  flex-wrap: wrap;
}

.meta-author { color: var(--text-secondary); font-weight: 500; }
.meta-sep { color: var(--border); }

.meta-replies, .meta-views, .meta-likes {
  display: inline-flex;
  align-items: center;
  gap: .2rem;
}
.meta-likes svg { color: #e25555; }

/* ---------- Avatar ---------- */
.avatar-circle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--brand-light);
  color: var(--brand);
  font-weight: 700;
  font-size: .9rem;
  flex-shrink: 0;
}
.avatar-sm { width: 26px; height: 26px; font-size: .7rem; }
.avatar-lg { width: 50px; height: 50px; font-size: 1.2rem; }

/* ---------- Pagination ---------- */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: .3rem;
  margin-top: 1.2rem;
  flex-wrap: wrap;
}
.page-btn {
  padding: .35rem .7rem;
  border-radius: var(--radius-sm);
  font-size: .85rem;
  color: var(--text-secondary);
  background: var(--card);
  border: 1px solid var(--border);
  transition: all .15s;
}
.page-btn:hover { border-color: var(--brand); color: var(--brand); }
.page-btn.active {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}
.page-ellipsis {
  padding: .35rem .4rem;
  color: var(--text-muted);
}

/* ---------- Sidebar ---------- */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.sidebar-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  box-shadow: var(--shadow-sm);
}

.sidebar-title {
  font-size: .9rem;
  font-weight: 700;
  margin-bottom: .7rem;
  color: var(--text);
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .5rem;
  text-align: center;
}
.stat-item { display: flex; flex-direction: column; }
.stat-num { font-size: 1.3rem; font-weight: 700; color: var(--brand); }
.stat-label { font-size: .75rem; color: var(--text-muted); }

.cat-list { list-style: none; }
.cat-list-item {
  display: block;
  padding: .5rem 0;
  border-bottom: 1px solid var(--border);
}
.cat-list-item:last-child { border-bottom: none; }
.cat-list-item.active .cat-list-name { color: var(--brand); font-weight: 700; }
.cat-list-name { font-size: .9rem; color: var(--text); font-weight: 500; }
.cat-list-blurb { display: block; font-size: .78rem; color: var(--text-muted); margin-top: .1rem; }

/* ---------- Buttons ---------- */
.btn-primary {
  display: inline-block;
  padding: .55rem 1.3rem;
  background: var(--brand);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
  text-align: center;
}
.btn-primary:hover { background: var(--brand-dark); color: #fff; }

.btn-primary-sm {
  display: inline-block;
  padding: .3rem .8rem;
  background: var(--brand);
  color: #fff;
  border-radius: var(--radius-sm);
  font-size: .82rem;
  font-weight: 600;
  transition: background .15s;
}
.btn-primary-sm:hover { background: var(--brand-dark); color: #fff; }

.btn-outline {
  display: inline-block;
  padding: .55rem 1.3rem;
  background: transparent;
  color: var(--brand);
  border: 1px solid var(--brand);
  border-radius: var(--radius-sm);
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
}
.btn-outline:hover { background: var(--brand-light); }

.btn-block { display: block; width: 100%; }

.btn-cancel {
  display: inline-block;
  padding: .55rem 1.3rem;
  color: var(--text-secondary);
  font-size: .9rem;
  border-radius: var(--radius-sm);
}
.btn-cancel:hover { color: var(--text); }

/* ---------- Topic Detail ---------- */
.topic-detail { max-width: 800px; margin: 0 auto; }

.topic-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.2rem;
}

.topic-title-lg {
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: .6rem;
}

.topic-header-meta {
  display: flex;
  align-items: center;
  gap: .6rem;
  font-size: .85rem;
  color: var(--text-muted);
  flex-wrap: wrap;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.topic-header-meta .meta-author {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
}

/* ---------- Topic / Reply Actions ---------- */
.topic-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 1.2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.topic-admin-actions {
  display: flex;
  align-items: center;
  gap: .5rem;
}

/* Like button */
.like-btn {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .35rem .7rem;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--card);
  color: var(--text-muted);
  font-size: .85rem;
  cursor: pointer;
  transition: all .15s;
}
.like-btn:hover { border-color: #e25555; color: #e25555; }
.like-btn.liked { color: #e25555; border-color: #e25555; background: #fff5f5; }
.like-btn .heart-icon { transition: transform .15s; }
.like-btn:active .heart-icon { transform: scale(1.2); }

/* Action buttons (edit / delete) */
.action-btn {
  font-size: .78rem;
  padding: .2rem .5rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: none;
  background: transparent;
  transition: all .15s;
}
.action-edit { color: var(--text-muted); }
.action-edit:hover { color: var(--brand); background: var(--brand-light); }
.action-delete { color: var(--text-muted); }
.action-delete:hover { color: var(--danger); background: #fef2f2; }

.inline-form { display: inline; }

/* ---------- Replies ---------- */
.replies-section { margin-bottom: 1.5rem; }

.replies-heading {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: .8rem;
  color: var(--text);
}

.reply-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 1rem 1.2rem;
  margin-bottom: .5rem;
  box-shadow: var(--shadow-sm);
}

.reply-header {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .82rem;
  color: var(--text-muted);
  margin-bottom: .6rem;
  flex-wrap: wrap;
}

.floor-num {
  font-weight: 700;
  color: var(--brand);
  font-size: .85rem;
}

.reply-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: .4rem;
}

.reply-body {
  font-size: .92rem;
  line-height: 1.7;
}

/* ---------- Reply Form ---------- */
.reply-form-section {
  background: var(--card);
  border-radius: var(--radius);
  padding: 1.2rem;
  box-shadow: var(--shadow-sm);
}

.reply-form-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: .8rem;
}

.login-prompt {
  text-align: center;
  padding: 1.5rem;
  background: var(--card);
  border-radius: var(--radius);
  color: var(--text-secondary);
  box-shadow: var(--shadow-sm);
}

/* ---------- Markdown Content ---------- */
.md-content {
  font-size: .93rem;
  line-height: 1.75;
  word-break: break-word;
}
.md-content h1, .md-content h2, .md-content h3,
.md-content h4, .md-content h5, .md-content h6 {
  margin: 1em 0 .5em;
  font-weight: 700;
  line-height: 1.3;
}
.md-content h1 { font-size: 1.3rem; }
.md-content h2 { font-size: 1.15rem; }
.md-content h3 { font-size: 1.05rem; }
.md-content p { margin: .6em 0; }
.md-content ul, .md-content ol { padding-left: 1.5em; margin: .5em 0; }
.md-content li { margin: .2em 0; }
.md-content blockquote {
  border-left: 3px solid var(--brand);
  padding: .5rem .8rem;
  margin: .8em 0;
  background: var(--brand-light);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-secondary);
}
.md-content code {
  background: #f0f1f3;
  padding: .15rem .4rem;
  border-radius: 4px;
  font-size: .85em;
  font-family: "SF Mono", "Fira Code", Consolas, monospace;
}
.md-content pre {
  background: #1e1e2e;
  color: #cdd6f4;
  padding: 1rem;
  border-radius: var(--radius-sm);
  overflow-x: auto;
  margin: .8em 0;
  font-size: .85rem;
  line-height: 1.5;
}
.md-content pre code {
  background: transparent;
  padding: 0;
  color: inherit;
  font-size: inherit;
}
.md-content a { color: var(--brand); text-decoration: underline; }
.md-content a:hover { color: var(--brand-dark); }
.md-content img { max-width: 100%; border-radius: var(--radius-sm); margin: .5em 0; }
.md-content hr { border: none; border-top: 1px solid var(--border); margin: 1.2em 0; }
.md-content table { border-collapse: collapse; width: 100%; margin: .8em 0; }
.md-content th, .md-content td { border: 1px solid var(--border); padding: .4rem .7rem; text-align: left; }
.md-content th { background: var(--bg); font-weight: 600; }

/* ---------- Forms ---------- */
.form-page {
  max-width: 700px;
  margin: 0 auto;
}
.form-page h1 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 1.2rem;
}

.form-group {
  margin-bottom: 1rem;
}
.form-group label {
  display: block;
  font-size: .85rem;
  font-weight: 600;
  margin-bottom: .3rem;
  color: var(--text);
}

.form-input, .form-textarea, .form-select {
  width: 100%;
  padding: .6rem .8rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .9rem;
  font-family: inherit;
  color: var(--text);
  background: var(--card);
  transition: border-color .15s;
}
.form-input:focus, .form-textarea:focus, .form-select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(47,109,246,.1);
}

.form-textarea { resize: vertical; min-height: 120px; line-height: 1.6; }

.form-hint {
  font-size: .78rem;
  color: var(--text-muted);
  margin-top: .35rem;
  line-height: 1.5;
}
.form-hint code {
  background: #f0f1f3;
  padding: .1rem .3rem;
  border-radius: 3px;
  font-size: .85em;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: .8rem;
  margin-top: 1rem;
}

/* ---------- Auth Pages ---------- */
.auth-page {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding-top: 2rem;
}

.auth-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow);
  width: 100%;
  max-width: 400px;
}
.auth-card h1 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 1.2rem;
  text-align: center;
}

.auth-footer {
  text-align: center;
  margin-top: 1rem;
  font-size: .85rem;
  color: var(--text-secondary);
}

/* ---------- Members ---------- */
.members-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: .8rem;
}

.member-card {
  display: flex;
  align-items: center;
  gap: .8rem;
  background: var(--card);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: var(--shadow-sm);
}

.member-info { min-width: 0; }
.member-name {
  font-weight: 600;
  font-size: .95rem;
  display: flex;
  align-items: center;
  gap: .4rem;
}
.admin-badge {
  font-size: .7rem;
  padding: .1rem .4rem;
  background: var(--brand);
  color: #fff;
  border-radius: 10px;
  font-weight: 500;
}
.member-stats {
  font-size: .8rem;
  color: var(--text-muted);
  margin-top: .15rem;
}
.member-time {
  font-size: .75rem;
  color: var(--text-muted);
  margin-top: .15rem;
}

/* ---------- Search Page ---------- */
.search-page { max-width: 800px; margin: 0 auto; }

.search-page-form { margin-bottom: 1.2rem; }
.search-input-group {
  display: flex;
  gap: .5rem;
}
.search-page-input { flex: 1; }

/* ---------- Error Page ---------- */
.error-page {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding-top: 3rem;
}

.error-card {
  text-align: center;
  background: var(--card);
  border-radius: var(--radius);
  padding: 2.5rem 2rem;
  box-shadow: var(--shadow);
  max-width: 420px;
  width: 100%;
}

.error-code {
  font-size: 3.5rem;
  font-weight: 800;
  color: var(--brand);
  line-height: 1;
  margin-bottom: .5rem;
}

.error-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: .5rem;
}

.error-desc {
  color: var(--text-secondary);
  font-size: .9rem;
  margin-bottom: 1.5rem;
}

/* ---------- Empty States ---------- */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-secondary);
}
.empty-state p { margin-bottom: .8rem; }

.empty-state-sm {
  text-align: center;
  padding: 1.5rem;
  color: var(--text-muted);
  font-size: .9rem;
}

.text-muted { color: var(--text-muted); font-size: .85rem; }

/* ---------- Flash Messages ---------- */
.flash-container {
  width: 100%;
  max-width: 1400px;
  margin: .8rem auto 0;
  padding: 0 clamp(1rem, 4vw, 3.5rem);
}

.flash {
  padding: .6rem 1rem;
  border-radius: var(--radius-sm);
  font-size: .85rem;
  margin-bottom: .4rem;
}
.flash-success { background: #e6f9ed; color: #1a7a3a; border: 1px solid #b7ebc9; }
.flash-error { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.flash-warning { background: #fff8e6; color: #92600a; border: 1px solid #fde68a; }
.flash-info { background: var(--brand-light); color: var(--brand-dark); border: 1px solid #bdd4fc; }

/* ---------- Footer ---------- */
.footer {
  margin-top: auto;
  background: var(--card);
  border-top: 1px solid var(--border);
}
.footer-beian { color: var(--text-muted); text-decoration: none; white-space: nowrap; }
.footer-beian:hover { color: var(--brand); text-decoration: underline; }
body.night-mode .footer-beian { color: #9a90b0; }
body.night-mode .footer-beian:hover { color: var(--cyan); }
.footer-inner {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 1rem clamp(1rem, 4vw, 3.5rem);
  text-align: center;
  font-size: .8rem;
  color: var(--text-muted);
}

/* ---------- Mobile: 720px breakpoint ---------- */
@media (max-width: 720px) {
  .desktop-nav { display: none; }
  .hamburger-btn { display: flex; }

  .page-layout {
    grid-template-columns: 1fr;
  }

  .sidebar { order: -1; }

  .topic-row { padding: .7rem .8rem; }
  .hide-mobile { display: none !important; }

  .topic-title-lg { font-size: 1.15rem; }
  .topic-card { padding: 1rem; }

  .topic-header-meta { font-size: .8rem; }

  .reply-header { font-size: .78rem; }
  .reply-actions { gap: .25rem; }

  .members-grid { grid-template-columns: 1fr; }

  .auth-card { padding: 1.5rem; }

  .stat-grid { grid-template-columns: repeat(3, 1fr); }

  .search-input { width: 100px; }

  .error-code { font-size: 2.5rem; }
}

/* ---------- Small phones ---------- */
@media (max-width: 400px) {
  .topbar-inner { padding: 0 .6rem; gap: .6rem; }
  .container { padding: 1rem .6rem; }
  .brand { font-size: 1rem; }
  .topic-title { font-size: .88rem; }
}

/* ---------- Large / ultra-wide screens: scale up gracefully ---------- */
@media (min-width: 1500px) { html { font-size: 16px; } }
@media (min-width: 1900px) { html { font-size: 17px; } }
@media (min-width: 2300px) {
  .container, .topbar-inner, .flash-container, .footer-inner { max-width: 1600px; }
}

/* ---------- Hidden admin trigger ---------- */
.admin-trigger { cursor: default; }

/* ---------- Rich-text editor toolbar ---------- */
.ed-toolbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: .25rem;
  background: var(--bg); border: 1px solid var(--border);
  border-bottom: none; border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  padding: .4rem .5rem;
}
.ed-toolbar + .form-textarea { border-top-left-radius: 0; border-top-right-radius: 0; }
.ed-btn {
  display: inline-flex; align-items: center; gap: .3rem;
  border: 1px solid transparent; background: var(--card); color: var(--text);
  border-radius: var(--radius-sm); padding: .28rem .55rem; font-size: .8rem;
  cursor: pointer; line-height: 1.2; transition: all .12s; min-width: 30px;
}
.ed-btn svg { width: 16px; height: 16px; }
.ed-btn:hover { border-color: var(--brand); color: var(--brand); }
.ed-color { font-weight: 800; }
.ed-sep { width: 1px; height: 18px; background: var(--border); margin: 0 .25rem; }
.md-content .c-color { font-weight: 500; }
.md-content img { max-width: 100%; border-radius: var(--radius-sm); }
.cat-private { background: var(--gold); color: #fff; font-weight: 600; }
.priv-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--gold); vertical-align: middle; }

/* ---------- Admin backend ---------- */
.btn-admin {
  background: var(--gold) !important;
  color: #fff !important;
  padding: .3rem .8rem;
  border-radius: var(--radius-sm);
  font-size: .82rem;
  font-weight: 600;
}
.btn-admin:hover { background: var(--gold-dark) !important; color: #fff !important; }

.admin-wrap { width: 100%; max-width: 1100px; margin: 0 auto; }
.admin-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1.2rem;
}
.admin-head h1 { font-size: 1.4rem; font-weight: 700; }
.admin-stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: .8rem; margin-bottom: 1.5rem;
}
.admin-stat {
  background: var(--card); border-radius: var(--radius); padding: 1.1rem;
  box-shadow: var(--shadow-sm); text-align: center;
}
.admin-stat .stat-num { font-size: 1.6rem; font-weight: 700; color: var(--brand); }
.admin-section-title { font-size: 1rem; font-weight: 700; margin: 1.6rem 0 .6rem; }
.admin-table {
  width: 100%; border-collapse: collapse; background: var(--card);
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm);
  margin-bottom: 1rem;
}
.admin-table th, .admin-table td {
  text-align: left; padding: .6rem .8rem; border-bottom: 1px solid var(--border);
  font-size: .85rem; vertical-align: middle;
}
.admin-table th { background: var(--bg); color: var(--text-secondary); font-weight: 600; }
.admin-table tr:last-child td { border-bottom: none; }
.admin-table td .topic-title { font-weight: 500; }
.admin-lock { max-width: 380px; margin: 3rem auto; }
.admin-lock .auth-card h1 { color: var(--gold); }

/* ---------- Admin account management ---------- */
.admin-role { display: inline-block; padding: .1rem .5rem; border-radius: 999px; font-size: .75rem; font-weight: 600; line-height: 1.6; white-space: nowrap; }
.admin-role--terminal { background: #2b2b2b; color: #ffd479; }
.admin-role--super { background: var(--brand-light, #efe7ff); color: var(--brand, #7a4fd0); }
.admin-role--user { background: var(--bg); color: var(--text-secondary); }
.admin-tag { display: inline-block; padding: .05rem .4rem; border-radius: 6px; font-size: .72rem; color: var(--text-muted); background: var(--bg); margin-left: .3rem; }
.admin-tag--guard { color: #b45309; background: #fff3e0; }
.admin-yes { color: #16a34a; font-weight: 600; }
.admin-no { color: var(--text-muted); }
.admin-status { display: inline-block; font-size: .78rem; }
.admin-status--ok { color: #16a34a; }
.admin-status--recycled { color: #b91c1c; font-weight: 600; }
.admin-locked { font-size: .78rem; color: var(--text-muted); font-style: italic; }
.admin-row-terminal { background: #fbf7ec; }
.admin-row-terminal td { color: var(--text-secondary); }
.admin-row-recycled { opacity: .6; background: var(--bg); }
.admin-row-actions { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; }
.action-warn { background: #fff3e0; color: #b45309; border: 1px solid #f0c98a; }
.action-warn:hover { background: #ffe6c2; }

/* ---------- Admin category management ---------- */
.cat-add {
  display: flex; flex-wrap: wrap; gap: .5rem; align-items: center;
  background: var(--card); border-radius: var(--radius); padding: .8rem;
  box-shadow: var(--shadow-sm); margin-bottom: .8rem;
}
.cat-add .form-input { width: auto; flex: 1 1 120px; min-width: 90px; }
.cat-add .cat-sort { flex: 0 0 70px; width: 70px; }
.cat-priv { display: inline-flex; align-items: center; gap: .3rem; font-size: .82rem; color: var(--text-secondary); white-space: nowrap; }
.cat-list-admin { display: flex; flex-direction: column; gap: .5rem; }
.cat-row {
  display: flex; flex-wrap: wrap; gap: .5rem; align-items: center;
  background: var(--card); border-radius: var(--radius); padding: .6rem .8rem;
  box-shadow: var(--shadow-sm);
}
.cat-edit { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; flex: 1; min-width: 0; }
.cat-edit .form-input { width: auto; min-width: 90px; }
.cat-edit .cat-sort { width: 64px; flex: 0 0 64px; }
.cat-slug { font-size: .78rem; color: var(--text-muted); background: var(--bg); padding: .15rem .4rem; border-radius: 4px; }
.cat-count { font-size: .8rem; color: var(--text-muted); white-space: nowrap; }
.cat-del { flex: 0 0 auto; }

/* ============ 深色主题 · 夜模式主题（变量覆盖，整站自动变赛博） ============ */
body.night-mode{
  --bg:#06090f; --card:rgba(18,26,42,.6); --text:#dbe7ff; --text-secondary:#9fb0cc; --text-muted:#7c8aa8;
  --brand:#37e6ff; --brand-light:rgba(55,230,255,.12); --brand-dark:#8af2ff; --border:rgba(120,200,255,.16);
  --gold:#9a6bff; --danger:#ff4d9d; --success:#37e6ff; --warning:#9a6bff;
  --cyan:#37e6ff; --magenta:#ff4d9d; --violet:#9a6bff;
  background:radial-gradient(1200px 620px at 82% -10%,rgba(154,107,255,.22),transparent 60%),radial-gradient(1000px 560px at 8% 112%,rgba(55,230,255,.16),transparent 60%),#06090f;
}
body.night-mode .topbar{background:rgba(6,9,15,.72);backdrop-filter:blur(8px);border-bottom-color:rgba(120,200,255,.14)}
body.night-mode .brand{color:#fff;text-shadow:0 0 6px var(--cyan),0 0 20px rgba(55,230,255,.5)}
body.night-mode .brand-mark{color:var(--cyan)}
body.night-mode .desktop-nav a,body.night-mode .page-header h1,body.night-mode .topic-title,body.night-mode .cat-list-name,body.night-mode .sidebar-title{color:#dbe7ff}
body.night-mode .page-header h1,body.night-mode .topic-title-lg{text-shadow:0 0 12px rgba(55,230,255,.35)}
body.night-mode .topic-row,body.night-mode .sidebar-card,body.night-mode .reply-card,body.night-mode .member-card,body.night-mode .topic-detail,body.night-mode .op,body.night-mode .floor,body.night-mode .reply-form-section,body.night-mode .login-prompt,body.night-mode .empty-state,body.night-mode .card-form,body.night-mode .auth-card,body.night-mode .error-card,body.night-mode .cat-add,body.night-mode .cat-row{backdrop-filter:blur(6px)}
body.night-mode .cat-tag,body.night-mode .avatar-circle,body.night-mode .member-avatar{background:rgba(154,107,255,.16);color:#c7b6ff}
body.night-mode .form-input,body.night-mode .form-textarea,body.night-mode .form-select,body.night-mode .search-input,body.night-mode .ed-toolbar{background:rgba(10,16,28,.6);color:#dbe7ff;border-color:rgba(120,200,255,.18)}
body.night-mode .ed-btn{background:rgba(18,26,42,.6);color:#dbe7ff}
body.night-mode .footer{background:rgba(6,9,15,.6);border-top-color:rgba(120,200,255,.12)}
body.night-mode .search-form{background:rgba(10,16,28,.6);border-color:rgba(120,200,255,.18)}
body.night-mode .user-badge{background:rgba(55,230,255,.14);color:var(--cyan)}

/* 右下角翻页角（2026-11-08 还原为最初版尺寸 150px：
   浮层是相对这个盒子定位的，容器被缩小会让浮层悬在错位的位置） */
.corner{position:fixed;right:0;bottom:0;width:150px;height:150px;z-index:60;cursor:pointer}
.corner svg{position:absolute;inset:0;width:100%;height:100%;overflow:visible;transition:filter .25s}
.corner:hover svg{filter:drop-shadow(0 0 8px rgba(154,107,255,.9))}
.corner .panel{position:absolute;right:22px;bottom:70px;width:190px;background:rgba(14,12,26,.94);border:1px solid rgba(154,107,255,.5);border-radius:11px;padding:12px;opacity:0;transform:translateY(8px);transition:.25s;pointer-events:none;box-shadow:0 8px 26px rgba(0,0,0,.5)}
.corner.open .panel{opacity:1;transform:none;pointer-events:auto}
.corner .panel .lbl{font-family:var(--serif);font-size:.95rem;color:#c7b6ff;margin-bottom:7px}
.corner .panel input{width:100%;border:1px solid rgba(154,107,255,.4);border-radius:8px;background:rgba(255,255,255,.06);color:#e9e4ff;padding:9px 11px;font-size:.9rem;outline:none}
.corner .panel input:focus{border-color:var(--cyan)}
.corner .panel .msg{font-size:.72rem;color:#ff9ec7;margin-top:6px;min-height:1em}

/* 故障转场 */
#gtx{position:fixed;inset:0;z-index:9999;pointer-events:none;display:none}
#gtx.on{display:block}
#gtx .gx{position:absolute;left:0;right:0;background:linear-gradient(90deg,rgba(55,230,255,.14),rgba(255,77,157,.14));animation:gxo .6s steps(3) forwards}
@keyframes gxo{0%{transform:translateX(0);opacity:.9}30%{transform:translateX(var(--tx,40px));box-shadow:8px 0 0 rgba(255,77,157,.5),-8px 0 0 rgba(55,230,255,.5)}70%{transform:translateX(calc(var(--tx,40px)*-.5))}100%{transform:translateX(0);opacity:0}}
#gtx .flash{position:absolute;inset:0;background:#fff;animation:gfl .6s steps(4) forwards;mix-blend-mode:overlay}
@keyframes gfl{0%,100%{opacity:0}15%{opacity:.5}40%{opacity:0}60%{opacity:.3}}
.gshake{animation:gsh .5s}
@keyframes gsh{0%,100%{transform:translate(0)}20%{transform:translate(-6px,3px)}40%{transform:translate(5px,-4px)}60%{transform:translate(-4px,2px)}80%{transform:translate(3px,-2px)}}

/* 深色主题 视频 + 图册 */
.mv-wrap{position:relative;margin-bottom:18px;border-radius:12px;overflow:hidden;border:1px solid rgba(120,200,255,.22);box-shadow:0 0 26px rgba(55,230,255,.16);aspect-ratio:16/9;background:#000}
.mv-wrap video{width:100%;height:100%;display:block;object-fit:contain;background:#000}
.mv-sound{position:absolute;right:12px;bottom:12px;background:rgba(10,16,28,.8);border:1px solid var(--cyan);color:var(--cyan);border-radius:20px;padding:6px 14px;font-size:.78rem;cursor:pointer}
.n-gallery{display:grid;grid-template-columns:repeat(3,1fr);gap:12px;margin-bottom:20px}
@media(max-width:640px){.n-gallery{grid-template-columns:repeat(2,1fr)}}
.n-g{aspect-ratio:4/3;border-radius:11px;overflow:hidden;border:1px solid rgba(120,200,255,.18);transition:.15s}
.n-g:hover{border-color:var(--cyan);box-shadow:0 0 16px rgba(55,230,255,.25);transform:translateY(-2px)}
.n-g img{width:100%;height:100%;object-fit:cover;display:block}

/* 深色主题 · 专属版式（板块左 + 条目右） */
.night-page{max-width:1000px;margin:0 auto}
.n-cols{display:grid;grid-template-columns:220px 1fr;gap:22px;align-items:start;margin-top:6px}
@media(max-width:720px){.n-cols{grid-template-columns:1fr}}
.n-boards{display:flex;flex-direction:column;gap:8px}
.n-board{display:block;background:rgba(18,26,42,.5);border:1px solid rgba(120,200,255,.14);border-left:3px solid var(--violet);border-radius:10px;padding:12px 14px;cursor:pointer;transition:.15s;color:#dbe7ff;text-decoration:none}
.n-board:hover,.n-board.on{background:rgba(154,107,255,.14);border-left-color:var(--cyan);color:#fff}
.n-board .en{font-size:.6rem;letter-spacing:.2em;color:var(--magenta)}
.n-board .cn{font-family:var(--serif);font-size:1.1rem;color:#fff;margin-top:3px}
.n-board .pv{font-size:.62rem;color:var(--cyan);border:1px solid rgba(120,200,255,.2);border-radius:10px;padding:1px 8px;margin-left:6px}
.n-topics h2{font-family:var(--serif);font-weight:500;font-size:1.25rem;color:#fff;margin-bottom:12px;text-shadow:0 0 12px rgba(55,230,255,.4)}
.n-topic{display:block;background:rgba(18,26,42,.5);border:1px solid rgba(120,200,255,.12);border-radius:11px;padding:14px 16px;margin-bottom:10px;cursor:pointer;transition:.15s;color:#dbe7ff;text-decoration:none}
.n-topic:hover{border-color:var(--cyan);box-shadow:0 0 18px rgba(55,230,255,.15);color:#fff}
.n-topic .t{font-family:var(--serif);font-size:1.05rem;color:#eaf6ff;margin-bottom:5px}
.n-topic .m{font-size:.75rem;color:var(--cymut);display:flex;gap:12px}
.n-empty{color:var(--cymut);font-size:.85rem;padding:20px;text-align:center;border:1px dashed rgba(120,200,255,.2);border-radius:12px;margin-bottom:12px}

/* ============ 深色主题 v2 · 沉浸式影像版式 ============ */
.night-page--v2 {
  position: relative;
  margin: 0 auto;
  overflow: hidden;
}

/* 装饰性模糊光球 */
.nj-blur {
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  opacity: .18;
  pointer-events: none;
  z-index: 0;
  animation: nj-float 12s ease-in-out infinite alternate;
}
.nj-blur--1 {
  width: 320px; height: 320px;
  background: var(--violet);
  top: 10%; left: -80px;
}
.nj-blur--2 {
  width: 260px; height: 260px;
  background: var(--cyan);
  bottom: 20%; right: -60px;
  animation-delay: -6s;
}
@keyframes nj-float {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(30px, -20px) scale(1.1); }
}

/* 全幅视频 Hero */
.nj-hero {
  position: relative;
  width: 100%;
  aspect-ratio: 2.4/1;
  border-radius: 16px;
  overflow: hidden;
  background: #000;
  margin-bottom: 2rem;
  box-shadow: 0 0 40px rgba(55, 230, 255, .12), 0 20px 60px rgba(0,0,0,.5);
}
.nj-hero video {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.nj-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(6,9,15,.7) 0%, transparent 50%);
  pointer-events: none;
}
.nj-sound {
  position: absolute;
  right: 16px; bottom: 16px;
  display: flex; align-items: center; gap: 6px;
  background: rgba(6,9,15,.75);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(55,230,255,.3);
  color: var(--cyan);
  border-radius: 24px;
  padding: 8px 16px;
  font-size: .78rem;
  cursor: pointer;
  transition: .2s;
  z-index: 2;
}
.nj-sound:hover {
  background: rgba(55,230,255,.15);
  border-color: var(--cyan);
}

/* 标题区 */
.nj-title-bar {
  text-align: center;
  margin-bottom: 2rem;
  position: relative;
  z-index: 1;
}
.nj-title {
  display: flex;
  justify-content: center;
  gap: .6rem;
  margin-bottom: .6rem;
}
.nj-letter {
  display: inline-block;
  font-family: var(--serif);
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 600;
  color: #fff;
  text-shadow: 0 0 20px rgba(55,230,255,.35);
  animation: nj-letter-in .6s ease-out both;
  letter-spacing: .08em;
}
.nj-letter:nth-child(1) { animation-delay: .1s; }
.nj-letter:nth-child(2) { animation-delay: .2s; }
.nj-letter:nth-child(3) { animation-delay: .3s; }
.nj-letter:nth-child(4) { animation-delay: .4s; }
.nj-letter:nth-child(5) { animation-delay: .5s; }
@keyframes nj-letter-in {
  0% { opacity: 0; transform: translateY(18px) scale(.9); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}
.nj-sub-zh {
  font-family: var(--serif);
  font-size: 1rem;
  color: rgba(255,255,255,.75);
  margin-bottom: .2rem;
}
.nj-sub-en {
  font-size: .78rem;
  color: rgba(255,255,255,.35);
  letter-spacing: .15em;
  text-transform: lowercase;
}
.nj-title-line {
  width: 60px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--cyan), transparent);
  margin: 1rem auto 0;
}

/* 赛博密钥弹窗 */
.nj-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity .3s ease;
}
.nj-modal.open {
  pointer-events: auto;
  opacity: 1;
}
.nj-modal-bg {
  position: absolute;
  inset: 0;
  background: rgba(4, 6, 12, .88);
  backdrop-filter: blur(6px);
}
.nj-modal-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(55, 230, 255, .015) 2px,
    rgba(55, 230, 255, .015) 4px
  );
  pointer-events: none;
}
.nj-modal-box {
  position: relative;
  width: 380px;
  max-width: 90vw;
  background: rgba(8, 12, 24, .96);
  border: 1px solid rgba(55, 230, 255, .25);
  border-radius: 16px;
  padding: 40px 36px 32px;
  text-align: center;
  transform: translateY(16px) scale(.97);
  transition: transform .35s cubic-bezier(.4,0,.2,1);
  box-shadow: 0 0 60px rgba(55, 230, 255, .08), 0 0 120px rgba(154, 107, 255, .06), inset 0 1px 0 rgba(255,255,255,.04);
}
.nj-modal.open .nj-modal-box {
  transform: none;
}
/* 四角装饰框 */
.nj-modal-frame {
  position: absolute;
  inset: 6px;
  border: 1px solid rgba(55, 230, 255, .1);
  border-radius: 12px;
  pointer-events: none;
}
.nj-modal-frame::before,
.nj-modal-frame::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  border-color: rgba(55, 230, 255, .45);
  border-style: solid;
}
.nj-modal-frame::before {
  top: -1px; left: -1px;
  border-width: 2px 0 0 2px;
}
.nj-modal-frame::after {
  top: -1px; right: -1px;
  border-width: 2px 2px 0 0;
}
.nj-modal-title {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 28px;
}
.nj-modal-en {
  font-size: .65rem;
  letter-spacing: .35em;
  color: rgba(55, 230, 255, .5);
  text-transform: uppercase;
}
.nj-modal-zh {
  font-family: var(--serif);
  font-size: 1.15rem;
  color: #e0f0ff;
  text-shadow: 0 0 16px rgba(55, 230, 255, .3);
}
.nj-modal-input {
  width: 100%;
  box-sizing: border-box;
  background: rgba(55, 230, 255, .04);
  border: 1px solid rgba(55, 230, 255, .2);
  border-radius: 10px;
  padding: 14px 18px;
  font-family: 'Courier New', monospace;
  font-size: 1.1rem;
  letter-spacing: .25em;
  color: #37e6ff;
  text-align: center;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
  caret-color: #37e6ff;
}
.nj-modal-input::placeholder {
  color: rgba(55, 230, 255, .25);
  letter-spacing: .15em;
  font-size: .85rem;
}
.nj-modal-input:focus {
  border-color: rgba(55, 230, 255, .6);
  box-shadow: 0 0 20px rgba(55, 230, 255, .1), inset 0 0 12px rgba(55, 230, 255, .04);
}
.nj-modal-btn {
  margin-top: 20px;
  width: 100%;
  padding: 13px;
  background: linear-gradient(135deg, rgba(55, 230, 255, .12), rgba(154, 107, 255, .12));
  border: 1px solid rgba(55, 230, 255, .3);
  border-radius: 10px;
  color: #37e6ff;
  font-family: var(--serif);
  font-size: 1rem;
  letter-spacing: .3em;
  cursor: pointer;
  transition: all .2s;
}
.nj-modal-btn:hover {
  background: linear-gradient(135deg, rgba(55, 230, 255, .2), rgba(154, 107, 255, .2));
  border-color: rgba(55, 230, 255, .6);
  box-shadow: 0 0 24px rgba(55, 230, 255, .15);
}
.nj-modal-msg {
  margin-top: 14px;
  font-size: .78rem;
  color: #ff9ec7;
  min-height: 1.2em;
}

/* 简洁图片网格 */
/* 影像画廊：改为弹性换行布局，每张图宽度由 --gw 变量控制（拖拉改的是它），
   高度不设约束，所以图片始终按原始比例缩放，不会变形 */
.nj-gallery {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;   /* 各图顶部对齐，短图不再被拉出空白 */
  gap: 14px;
  margin-bottom: 2.5rem;
  position: relative;
  z-index: 1;
}
.nj-gitem {
  position: relative;
  margin: 0;
  width: var(--gw, 280px);
  max-width: 100%;
  flex: 0 0 auto;
}
.nj-gallery-img {
  width: 100%;
  height: auto;              /* 等比例的关键：只给宽度，高度自动 */
  border-radius: 12px;
  display: block;
  transition: transform .25s ease;
  user-select: none;
  -webkit-user-drag: none;   /* 不给浏览器启动"拖图片"的原生手势 */
}
.nj-gitem:hover .nj-gallery-img { transform: scale(1.02); }
.nj-gitem.is-resizing .nj-gallery-img { transform: none; }  /* 拖动中不要放大，否则手柄跟着跑 */
/* 右下角拖拉手柄 */
.nj-ghandle {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 34px;                 /* 命中区域放大到 34px，视觉角标仍由 ::after 画 16px */
  height: 34px;
  cursor: nwse-resize;
  opacity: 1;
  touch-action: none;          /* 手机上拖动不被页面滚动抢走 */
  user-select: none;
}
.nj-ghandle::after {
  content: "";
  position: absolute;
  right: 5px;
  bottom: 5px;
  width: 16px;
  height: 16px;
  border-right: 2px solid rgba(55,230,255,.75);
  border-bottom: 2px solid rgba(55,230,255,.75);
  border-radius: 0 0 10px 0;
  opacity: .55;
  transition: opacity .2s;
}
.nj-gitem:hover .nj-ghandle::after { opacity: 1; }
.nj-gitem.is-resizing .nj-ghandle::after { opacity: 1; }
.nj-gallery-hint {
  font-size: .78rem;
  color: rgba(159,232,255,.55);
  margin: 0 0 8px;
  letter-spacing: .02em;
}
.nj-gitem.is-resizing .nj-gallery-img { transition: none; }
.nj-gbadge {
  position: absolute;
  left: 6px;
  top: 6px;
  font-size: 11px;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(4,6,12,.72);
  color: #9fe8ff;
  border: 1px solid rgba(55,230,255,.28);
  opacity: 0;
  transition: opacity .2s;
  pointer-events: none;
}
.nj-gitem:hover .nj-gbadge, .nj-gitem.is-resizing .nj-gbadge { opacity: 1; }
@media (max-width: 640px) {
  .nj-gitem { width: min(var(--gw, 280px), 100%); }
}

/* 主体双栏 */
.nj-cols {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 2rem;
  align-items: start;
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 clamp(1rem, 4vw, 3rem);
}
@media (max-width: 720px) {
  .nj-cols { grid-template-columns: 1fr; }
}

/* 分类侧栏 */
.nj-boards {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.nj-boards-label {
  display: flex;
  flex-direction: column;
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(120,200,255,.1);
}
.nj-boards-en {
  font-size: .6rem;
  letter-spacing: .25em;
  color: var(--magenta);
  opacity: .7;
}
.nj-boards-zh {
  font-family: var(--serif);
  font-size: .95rem;
  color: rgba(255,255,255,.6);
}
.nj-board {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-radius: 10px;
  background: rgba(18,26,42,.4);
  border: 1px solid rgba(120,200,255,.08);
  color: rgba(255,255,255,.7);
  text-decoration: none;
  transition: .2s;
  font-size: .9rem;
}
.nj-board:hover, .nj-board.on {
  background: rgba(154,107,255,.12);
  border-color: rgba(154,107,255,.3);
  color: #fff;
}
.nj-board-name {
  font-family: var(--serif);
}
.nj-board-pv {
  font-size: .6rem;
  color: var(--cyan);
  border: 1px solid rgba(55,230,255,.2);
  border-radius: 8px;
  padding: 1px 6px;
}

/* 深色主题自定义链接 */
.nj-links-label {
  display: flex;
  flex-direction: column;
  margin-top: 18px;
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(55,230,255,.12);
}
.nj-links-en {
  font-size: .6rem;
  letter-spacing: .25em;
  color: var(--cyan);
  opacity: .7;
}
.nj-links-zh {
  font-family: var(--serif);
  font-size: .95rem;
  color: rgba(255,255,255,.6);
}
.nj-link {
  cursor: pointer;
}
.nj-link:hover {
  background: rgba(55,230,255,.08);
  border-color: rgba(55,230,255,.25);
  color: #fff;
}
.nj-link-arrow {
  font-size: .75rem;
  color: var(--cyan);
  opacity: .6;
  transition: .2s;
}
.nj-link:hover .nj-link-arrow {
  opacity: 1;
  transform: translate(2px, -2px);
}

/* 列表列表 */
.nj-topics-title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.15rem;
  color: #fff;
  margin-bottom: 1rem;
  text-shadow: 0 0 10px rgba(55,230,255,.25);
}
.nj-topic {
  display: flex;
  gap: 14px;
  background: rgba(18,26,42,.45);
  border: 1px solid rgba(120,200,255,.08);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 10px;
  text-decoration: none;
  color: #dbe7ff;
  transition: .2s;
  overflow: hidden;
}
.nj-topic:hover {
  border-color: rgba(55,230,255,.25);
  box-shadow: 0 4px 20px rgba(55,230,255,.08);
  transform: translateY(-1px);
  color: #fff;
}
.nj-topic--has-img {
  padding: 0;
}
.nj-topic-thumb {
  flex: 0 0 120px;
  height: 90px;
  overflow: hidden;
  border-radius: 12px 0 0 12px;
}
.nj-topic-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .3s;
}
.nj-topic--has-img:hover .nj-topic-thumb img {
  transform: scale(1.05);
}
.nj-topic-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 4px 0;
}
.nj-topic--has-img .nj-topic-body {
  padding: 10px 14px;
}
.nj-topic-title {
  font-family: var(--serif);
  font-size: .98rem;
  color: #eaf6ff;
  margin-bottom: 6px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.nj-topic-meta {
  font-size: .72rem;
  color: rgba(200,215,240,.45);
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.nj-empty {
  color: rgba(200,215,240,.4);
  font-size: .85rem;
  padding: 24px;
  text-align: center;
  border: 1px dashed rgba(120,200,255,.15);
  border-radius: 12px;
}

/* nav 图标 + 返回主站 */
.nav-ico{display:inline-flex;align-items:center;gap:5px}
.btn-exit{border:1px solid var(--cyan);color:var(--cyan)!important;background:rgba(55,230,255,.08);padding:.3rem .8rem;border-radius:8px;font-size:.82rem}
.btn-exit:hover{background:rgba(55,230,255,.18);color:var(--cyan)!important}

/* 面板：深色主题设置 + 版块昼夜标记 */
.nset{background:var(--card);border:1px solid var(--border);border-radius:var(--radius);padding:16px;box-shadow:var(--shadow-sm);margin-bottom:1.2rem;display:flex;flex-direction:column;gap:.9rem}
.nset-l{display:flex;flex-direction:column;gap:.35rem;font-size:.85rem;font-weight:600;color:var(--text)}
.nset-cur{display:flex;gap:14px;align-items:center;margin-bottom:12px}
.nset-thumb{width:160px;aspect-ratio:16/9;border-radius:8px;overflow:hidden;border:1px solid var(--border);background:#000;flex:0 0 auto}
.nset-thumb video{width:100%;height:100%;object-fit:cover;display:block}
.nset-info{font-size:.82rem;color:var(--text-secondary)}
.nset-info code{background:var(--bg);padding:1px 6px;border-radius:4px;font-size:.78rem}
.nset-empty{font-size:.82rem;color:var(--text-muted);margin-bottom:10px}
.nset-row{display:flex;gap:10px;align-items:center;flex-wrap:wrap}
.nset-row .form-input{flex:1;min-width:200px}
.nset-tip{font-size:.72rem;color:var(--text-muted);margin-top:8px}
.nset-gal{display:grid;grid-template-columns:repeat(auto-fill,minmax(120px,1fr));gap:10px;margin-bottom:12px}
.nset-gitem{position:relative;border-radius:8px;overflow:hidden;border:1px solid var(--border)}
.nset-gitem img{width:100%;aspect-ratio:4/3;object-fit:cover;display:block}
.nset-gdel{position:absolute;top:6px;right:6px;background:rgba(0,0,0,.6);color:#fff;border:none;border-radius:6px;padding:3px 9px;font-size:.72rem;cursor:pointer}
.nset-gdel:hover{background:var(--danger)}
.cat-space{font-size:.7rem;padding:1px 7px;border-radius:10px;background:var(--brand-light);color:var(--brand);font-weight:600;white-space:nowrap}
.cat-space.night{background:rgba(154,107,255,.18);color:#9a6bff}

/* ============ 深色主题 · 扫描线条纹 + 霓虹站名 + 卡片化条目（对齐预览） ============ */
body.night-mode::before{content:"";position:fixed;inset:0;pointer-events:none;z-index:1;
  background:repeating-linear-gradient(0deg,rgba(255,255,255,.035) 0 1px,transparent 1px 3px)}
body.night-mode .container{position:relative;z-index:2}
body.night-mode .brand{font-size:1.35rem;align-items:flex-start}
body.night-mode .brand-txt{display:flex;flex-direction:column;line-height:1.15}
body.night-mode .brand-sub{font-family:var(--sans);font-size:.58rem;letter-spacing:.4em;color:var(--cyan);text-shadow:0 0 10px rgba(55,230,255,.6);font-weight:400;margin-top:2px}
body.night-mode .topic-row{background:rgba(18,26,42,.55);border:1px solid rgba(120,200,255,.14);border-left:3px solid var(--violet);border-radius:12px;transition:.15s}
body.night-mode .topic-row:hover{border-color:var(--cyan);box-shadow:0 0 20px rgba(55,230,255,.18);transform:translateY(-1px)}
body.night-mode .topic-title{font-family:var(--serif);font-size:1.06rem;color:#eaf6ff}
body.night-mode .topic-title:hover{color:var(--cyan)}
body.night-mode .page-header h1{text-shadow:0 0 14px rgba(55,230,255,.5)}
body.night-mode .sidebar-card{background:rgba(18,26,42,.5);border:1px solid rgba(120,200,255,.14)}
body.night-mode .cat-list-name,body.night-mode .cat-list-blurb{color:#c3d2ee}
body.night-mode .cat-list-item.active .cat-list-name{color:var(--cyan)}
body.night-mode .topic-detail,body.night-mode .op,body.night-mode .reply-card{background:rgba(18,26,42,.55);border:1px solid rgba(120,200,255,.14)}

/* ---------- Status Badges ---------- */
.status-badge {
  display: inline-block;
  font-size: .7rem;
  padding: .15rem .55rem;
  border-radius: 10px;
  font-weight: 600;
  white-space: nowrap;
  vertical-align: middle;
}
.status-open { background: #fff3e0; color: #B08D57; border: 1px solid #fde68a; }
.status-progress { background: #e8f0fe; color: #4A90D9; border: 1px solid #bdd4fc; }
.status-resolved { background: #e6f9ed; color: #5E7B54; border: 1px solid #b7ebc9; }
.status-closed { background: #f0f1f3; color: #8A897C; border: 1px solid #ddd; }

/* ---------- Status Filter Tabs ---------- */
.status-tabs {
  display: flex;
  gap: .35rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.status-tab {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .3rem .75rem;
  border-radius: 16px;
  font-size: .8rem;
  color: var(--text-secondary);
  background: var(--card);
  border: 1px solid var(--border);
  transition: all .15s;
}
.status-tab:hover { border-color: var(--brand); color: var(--brand); }
.status-tab.active {
  background: var(--brand-light);
  color: var(--brand);
  border-color: var(--brand);
  font-weight: 600;
}
.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ---------- Pin / Announcement Badges ---------- */
.pin-badge {
  display: inline-block;
  font-size: .7rem;
  padding: .12rem .5rem;
  border-radius: 10px;
  background: var(--brand-light);
  color: var(--brand);
  font-weight: 600;
  white-space: nowrap;
  vertical-align: middle;
  margin-right: .3rem;
}
.announce-badge {
  background: linear-gradient(135deg, var(--gold), #d4a84b);
  color: #fff;
  border: none;
}

/* ---------- Notification Bell ---------- */
.notif-bell {
  position: relative;
  display: inline-flex;
  align-items: center;
  color: var(--text-muted);
  transition: color .15s;
  padding: .2rem;
}
.notif-bell:hover { color: var(--brand); }
.notif-count {
  position: absolute;
  top: -4px;
  right: -6px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  background: var(--danger);
  color: #fff;
  font-size: .65rem;
  font-weight: 700;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* ---------- Notifications Page ---------- */
.notif-page {
  max-width: 700px;
  margin: 0 auto;
}
.notif-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.2rem;
}
.notif-title {
  font-size: 1.3rem;
  font-weight: 700;
}
.btn-mark-all {
  font-size: .82rem;
  padding: .35rem .8rem;
}
.notif-list {
  display: flex;
  flex-direction: column;
  gap: .4rem;
}
.notif-item {
  display: flex;
  align-items: flex-start;
  gap: .7rem;
  padding: .8rem 1rem;
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: background .15s;
}
.notif-unread {
  border-left: 3px solid var(--brand);
  background: var(--brand-light);
}
.notif-icon { flex-shrink: 0; padding-top: 2px; }
.notif-type-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: .75rem;
  font-weight: 700;
}
.notif-mention { background: #e8f0fe; color: #4A90D9; }
.notif-reply { background: #e6f9ed; color: #5E7B54; }
.notif-status { background: #fff3e0; color: #B08D57; }
.notif-body { flex: 1; min-width: 0; }
.notif-text { font-size: .88rem; color: var(--text); line-height: 1.5; }
.notif-actor { color: var(--brand); font-weight: 600; }
.notif-topic-link {
  color: var(--text-secondary);
  font-size: .85rem;
  text-decoration: underline;
  text-decoration-color: var(--border);
}
.notif-topic-link:hover { color: var(--brand); }
.notif-time { font-size: .75rem; color: var(--text-muted); margin-top: .2rem; }
.notif-read-btn {
  flex-shrink: 0;
  background: none;
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  transition: all .15s;
}
.notif-read-btn:hover { border-color: var(--brand); color: var(--brand); }

/* ---------- Quote Block (in replies) ---------- */
.quote-block {
  border-left: 3px solid var(--gold);
  background: var(--bg);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: .5rem .8rem;
  margin-bottom: .6rem;
  font-size: .85rem;
  color: var(--text-secondary);
}
.quote-author {
  font-weight: 600;
  color: var(--brand);
}
.quote-text {
  margin-top: .2rem;
  line-height: 1.5;
  word-break: break-word;
}

/* Quote preview in reply form */
.quote-preview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .4rem .7rem;
  background: var(--brand-light);
  border: 1px solid var(--brand);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  font-size: .82rem;
  color: var(--brand-dark);
  margin-bottom: -1px;
}
.quote-cancel {
  background: none;
  border: none;
  font-size: 1.1rem;
  cursor: pointer;
  color: var(--text-muted);
  padding: 0 .2rem;
  line-height: 1;
}
.quote-cancel:hover { color: var(--danger); }

/* ---------- Topic Controls (status + pin) ---------- */
.topic-controls-row {
  display: flex;
  align-items: center;
  gap: .6rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.status-form {
  display: flex;
  align-items: center;
  gap: .4rem;
}
.status-form label {
  font-size: .82rem;
  color: var(--text-secondary);
  font-weight: 500;
}
.status-select {
  width: auto;
  padding: .3rem .6rem;
  font-size: .82rem;
  border-radius: var(--radius-sm);
}
.action-pin {
  font: inherit;
  font-size: .78rem;
  padding: .3rem .6rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all .15s;
}
.action-pin:hover { border-color: var(--gold); color: var(--gold); background: #fff8e6; }
.action-quote {
  display: inline-flex;
  align-items: center;
  gap: .2rem;
}

/* ---------- @mention link ---------- */
.mention-link {
  color: var(--brand);
  font-weight: 600;
  text-decoration: none;
}
.mention-link:hover {
  text-decoration: underline;
  color: var(--brand-dark);
}

/* ---------- Night mode overrides for new elements ---------- */
body.night-mode .status-open { background: rgba(176,141,87,.15); color: var(--warning); border-color: rgba(176,141,87,.3); }
body.night-mode .status-progress { background: rgba(55,230,255,.1); color: var(--cyan); border-color: rgba(55,230,255,.2); }
body.night-mode .status-resolved { background: rgba(55,230,255,.1); color: var(--success); border-color: rgba(55,230,255,.2); }
body.night-mode .status-closed { background: rgba(120,200,255,.08); color: var(--text-muted); border-color: rgba(120,200,255,.15); }
body.night-mode .status-tab { background: rgba(18,26,42,.5); border-color: rgba(120,200,255,.14); color: #9fb0cc; }
body.night-mode .status-tab.active { background: rgba(55,230,255,.1); color: var(--cyan); border-color: rgba(55,230,255,.3); }
body.night-mode .pin-badge { background: rgba(154,107,255,.15); color: #c7b6ff; }
body.night-mode .announce-badge { background: linear-gradient(135deg, var(--violet), var(--cyan)); color: #fff; }
body.night-mode .notif-bell { color: #9fb0cc; }
body.night-mode .notif-count { background: var(--magenta); }
body.night-mode .notif-item { background: rgba(18,26,42,.5); border-color: rgba(120,200,255,.14); }
body.night-mode .notif-unread { background: rgba(55,230,255,.06); border-left-color: var(--cyan); }
body.night-mode .notif-mention { background: rgba(55,230,255,.12); color: var(--cyan); }
body.night-mode .notif-reply { background: rgba(154,107,255,.12); color: #c7b6ff; }
body.night-mode .notif-status { background: rgba(176,141,87,.12); color: var(--warning); }
body.night-mode .quote-block { background: rgba(18,26,42,.4); border-left-color: var(--violet); color: #9fb0cc; }
body.night-mode .quote-preview { background: rgba(55,230,255,.08); border-color: rgba(55,230,255,.2); color: var(--cyan); }
body.night-mode .action-pin { background: rgba(18,26,42,.5); border-color: rgba(120,200,255,.14); color: #9fb0cc; }
body.night-mode .action-pin:hover { border-color: var(--violet); color: #c7b6ff; background: rgba(154,107,255,.1); }
body.night-mode .mention-link { color: var(--cyan); }
body.night-mode .mention-link:hover { color: var(--cyan); text-shadow: 0 0 6px rgba(55,230,255,.4); }

/* ---- SVG Icon System ---- */
.ic{display:inline-block;vertical-align:-2px;flex-shrink:0}
.ic-heart{transition:transform .15s}
.ic-heart:hover{transform:scale(1.15)}
.ic-notif{position:relative}

/* ========== Premium Feed Card Layout ========== */
.page-layout--cards {
  grid-template-columns: minmax(0, 1fr) 280px;
}

.feed-cards {
  display: flex;
  flex-direction: column;
  gap: .75rem;
}

/* --- Base card --- */
.pc-card {
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: box-shadow .2s, transform .2s;
}
.pc-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

/* --- Card header (author row) --- */
.pc-header {
  display: flex;
  align-items: center;
  gap: .45rem;
  padding: .85rem 1.1rem .5rem;
  flex-wrap: wrap;
}
.pc-author-name {
  font-size: .85rem;
  font-weight: 600;
  color: var(--text-secondary);
}
.pc-time {
  font-size: .8rem;
  color: var(--text-muted);
}
.pc-cat {
  font-size: .72rem;
  padding: .1rem .5rem;
  border-radius: 10px;
  background: var(--brand-light);
  color: var(--brand);
  font-weight: 500;
  white-space: nowrap;
  margin-left: auto;
}

/* --- Card body --- */
.pc-body {
  padding: 0 1.1rem 1rem;
}

/* --- Card title --- */
.pc-title {
  display: block;
  font-family: var(--serif);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.45;
  margin-bottom: .45rem;
  transition: color .15s;
}
.pc-title:hover {
  color: var(--brand);
}

/* --- Excerpt --- */
.pc-excerpt {
  font-size: .88rem;
  color: var(--text-secondary);
  line-height: 1.65;
  margin-bottom: .7rem;
}

/* --- Image layouts --- */
.pc-images {
  display: grid;
  gap: 6px;
  margin-bottom: .7rem;
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.pc-images--single {
  grid-template-columns: 1fr;
}
.pc-images--dual {
  grid-template-columns: 1fr 1fr;
}
.pc-images--grid {
  grid-template-columns: 1fr 1fr 1fr;
}
.pc-img-frame {
  aspect-ratio: 4/3;
  overflow: hidden;
  border-radius: 6px;
  background: var(--bg);
}
.pc-img-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .3s;
}
.pc-img-frame:hover img {
  transform: scale(1.05);
}
.pc-img-more {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  background: rgba(46,51,43,.45);
  backdrop-filter: blur(2px);
  cursor: pointer;
}
.pc-img-more::before {
  content: "";
  position: absolute;
  inset: 0;
  background: inherit;
}
.pc-img-more span {
  position: relative;
  z-index: 1;
}

/* --- Meta row --- */
.pc-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: .5rem;
  border-top: 1px solid var(--border);
}
.pc-stats {
  display: flex;
  align-items: center;
  gap: .7rem;
}
.pc-stat {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  font-size: .8rem;
  color: var(--text-muted);
}
.pc-stat svg {
  stroke-width: 1.5;
}

/* --- Author row (in meta) --- */
.pc-author {
  display: flex;
  align-items: center;
  gap: .4rem;
}
.pc-author .pc-time {
  margin-left: .2rem;
}

/* --- Small avatar --- */
.avatar-circle--sm {
  width: 28px;
  height: 28px;
  font-size: .75rem;
}

/* --- Tags --- */
.pc-tag {
  display: inline-block;
  font-size: .68rem;
  padding: .1rem .45rem;
  border-radius: 8px;
  font-weight: 600;
  white-space: nowrap;
}
.pc-tag--pin {
  background: var(--brand-light);
  color: var(--brand);
}
.pc-tag--announce {
  background: linear-gradient(135deg, var(--gold), #d4a84b);
  color: #fff;
}
.pc-tag--progress {
  background: #e8f0fe;
  color: #4A90D9;
}
.pc-tag--resolved {
  background: #e6f9ed;
  color: #5E7B54;
}
.pc-tag--closed {
  background: #f0f1f3;
  color: #8A897C;
}

/* --- Pinned card subtle accent --- */
.pc-pinned {
  border-left: 3px solid var(--brand);
}

/* ========== Featured / Hero Card ========== */
.pc-featured {
  border: 1px solid var(--border);
}
.pc-featured:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 36px rgba(46,51,43,.12);
}
.pc-hero {
  position: relative;
  aspect-ratio: 21/9;
  overflow: hidden;
  background: var(--bg);
}
.pc-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .4s;
}
.pc-featured:hover .pc-hero img {
  transform: scale(1.03);
}
.pc-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,.65) 0%, rgba(0,0,0,.1) 60%, transparent 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1.2rem 1.4rem;
  gap: .5rem;
}
.pc-badge {
  align-self: flex-start;
  font-size: .7rem;
  padding: .15rem .55rem;
  border-radius: 10px;
  font-weight: 600;
  backdrop-filter: blur(4px);
}
.pc-badge--pin {
  background: rgba(110,123,84,.85);
  color: #fff;
}
.pc-badge--announce {
  background: linear-gradient(135deg, var(--gold), #d4a84b);
  color: #fff;
}
.pc-hero-title {
  font-family: var(--serif);
  font-size: 1.3rem;
  font-weight: 600;
  color: #fff;
  line-height: 1.4;
  text-shadow: 0 1px 4px rgba(0,0,0,.4);
  transition: color .15s;
}
.pc-hero-title:hover {
  color: #fff;
  text-shadow: 0 1px 6px rgba(0,0,0,.6);
}

/* --- Featured gallery strip --- */
.pc-gallery {
  display: grid;
  gap: 6px;
  margin-top: .7rem;
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.pc-gallery--2 { grid-template-columns: 1fr 1fr; }
.pc-gallery--3 { grid-template-columns: 1fr 1fr 1fr; }
.pc-gallery--4 { grid-template-columns: 1fr 1fr 1fr 1fr; }
.pc-gallery-img {
  aspect-ratio: 4/3;
  overflow: hidden;
  border-radius: 6px;
  background: var(--bg);
}
.pc-gallery-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .3s;
}
.pc-gallery-img:hover img {
  transform: scale(1.05);
}
.pc-gallery-more {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .9rem;
  font-weight: 700;
  color: var(--text-muted);
  background: var(--bg);
  border-radius: 6px;
  aspect-ratio: 4/3;
  cursor: pointer;
  transition: background .15s;
}
.pc-gallery-more:hover {
  background: var(--brand-light);
  color: var(--brand);
}

/* ========== Image Upload Zone (admin) ========== */
.img-upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: border-color .2s, background .2s;
  background: var(--bg);
}
.img-upload-zone:hover,
.img-upload-zone.drag-over {
  border-color: var(--brand);
  background: var(--brand-light);
}
.img-upload-hint {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .4rem;
  color: var(--text-muted);
  font-size: .88rem;
}
.img-upload-hint svg {
  color: var(--text-muted);
  opacity: .6;
}
.img-upload-link {
  color: var(--brand);
  font-weight: 500;
  cursor: pointer;
  text-decoration: underline;
}
.img-upload-sub {
  font-size: .75rem;
  color: var(--text-muted);
  opacity: .7;
}
.img-preview-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.img-preview-item {
  position: relative;
  width: 80px;
  height: 80px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg);
}
.img-preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.img-preview-rm {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 20px;
  height: 20px;
  background: rgba(0,0,0,.6);
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: .75rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: background .15s;
}
.img-preview-rm:hover {
  background: var(--danger);
}

/* --- Card responsive --- */
@media (max-width: 720px) {
  .page-layout--cards {
    grid-template-columns: 1fr;
  }
  .pc-hero { aspect-ratio: 16/9; }
  .pc-hero-title { font-size: 1.1rem; }
  .pc-images--grid { grid-template-columns: 1fr 1fr; }
  .pc-header { padding: .7rem .8rem .4rem; }
  .pc-body { padding: 0 .8rem .8rem; }
  .pc-gallery--3, .pc-gallery--4 { grid-template-columns: 1fr 1fr; }
}

/* --- Night mode overrides for cards --- */
body.night-mode .pc-card {
  background: rgba(18,26,42,.55);
  border-color: rgba(120,200,255,.14);
}
body.night-mode .pc-card:hover {
  border-color: rgba(55,230,255,.3);
  box-shadow: 0 0 20px rgba(55,230,255,.12);
}
body.night-mode .pc-featured:hover {
  box-shadow: 0 0 30px rgba(55,230,255,.18);
}
body.night-mode .pc-title { color: #eaf6ff; }
body.night-mode .pc-title:hover { color: var(--cyan); }
body.night-mode .pc-excerpt { color: #9fb0cc; }
body.night-mode .pc-author-name { color: #c3d2ee; }
body.night-mode .pc-cat {
  background: rgba(154,107,255,.16);
  color: #c7b6ff;
}
body.night-mode .pc-tag--pin {
  background: rgba(154,107,255,.15);
  color: #c7b6ff;
}
body.night-mode .pc-tag--announce {
  background: linear-gradient(135deg, var(--violet), var(--cyan));
  color: #fff;
}
body.night-mode .pc-pinned {
  border-left-color: var(--violet);
}
body.night-mode .pc-img-frame {
  background: rgba(10,16,28,.6);
}
body.night-mode .pc-img-more {
  background: rgba(6,9,15,.7);
  color: var(--cyan);
}
body.night-mode .pc-hero-overlay {
  background: linear-gradient(to top, rgba(0,0,0,.75) 0%, rgba(0,0,0,.2) 60%, transparent 100%);
}
body.night-mode .pc-badge--pin {
  background: rgba(154,107,255,.8);
}
body.night-mode .pc-gallery-more {
  background: rgba(18,26,42,.6);
  color: #9fb0cc;
}
body.night-mode .pc-gallery-more:hover {
  background: rgba(154,107,255,.15);
  color: #c7b6ff;
}
body.night-mode .img-upload-zone {
  background: rgba(10,16,28,.5);
  border-color: rgba(120,200,255,.2);
}
body.night-mode .img-upload-zone:hover,
body.night-mode .img-upload-zone.drag-over {
  border-color: var(--cyan);
  background: rgba(55,230,255,.08);
}
body.night-mode .img-preview-item {
  border-color: rgba(120,200,255,.2);
  background: rgba(10,16,28,.6);
}

/* ============================================================
   储物 · 家庭储物档案
   ============================================================ */
.st-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .8rem; }
.st-header-actions { display: flex; align-items: center; gap: .8rem; }
.st-total-badge {
  font-family: var(--serif); font-size: 1.1rem; font-weight: 600;
  color: var(--gold); background: var(--brand-light);
  padding: 6px 14px; border-radius: 20px;
}
.st-btn-new { white-space: nowrap; }

/* 筛选栏 */
.st-filter-bar {
  display: flex; gap: .6rem; align-items: center; flex-wrap: wrap;
  margin-bottom: 1.5rem; padding: 12px 16px;
  background: var(--card); border-radius: var(--radius); border: 1px solid var(--border);
}
.st-search { flex: 1; min-width: 180px; }
.st-cat-select { width: 120px; }
.st-clear-link { font-size: .85rem; color: var(--text-muted); text-decoration: underline; }

/* 箱子卡片网格 */
.st-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.2rem;
}
.st-card {
  display: flex; flex-direction: column;
  background: var(--card); border-radius: var(--radius);
  border: 1px solid var(--border); overflow: hidden;
  transition: box-shadow .2s, transform .15s;
  text-decoration: none; color: var(--text);
}
.st-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.st-card-cover {
  height: 140px; overflow: hidden; background: var(--brand-light);
  display: flex; align-items: center; justify-content: center;
}
.st-card-cover img { width: 100%; height: 100%; object-fit: cover; }
.st-card-placeholder { font-size: 2.5rem; opacity: .5; }
.st-card-body { padding: 14px 16px; flex: 1; display: flex; flex-direction: column; gap: 4px; }
.st-card-name { font-family: var(--serif); font-size: 1rem; font-weight: 600; margin: 0; }
.st-card-loc { font-size: .8rem; color: var(--text-muted); margin: 0; }
.st-card-stats {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: auto; padding-top: 8px; font-size: .82rem; color: var(--text-secondary);
}
.st-card-total { font-weight: 600; color: var(--gold); font-family: var(--serif); }

/* 面包屑 */
.st-breadcrumb { font-size: .85rem; color: var(--text-muted); margin-bottom: 1rem; }
.st-breadcrumb a { color: var(--brand); }
.st-bc-sep { margin: 0 6px; }

/* 箱子详情头部 */
.st-box-header { display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: 1rem; margin-bottom: 1.5rem; }
.st-box-header-left { flex: 1 1 auto; min-width: 0; display: flex; align-items: flex-start; gap: .9rem; }
.st-box-headtext { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: .2rem; }
.st-box-loc { margin: 0; color: var(--text-secondary); font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-box-header-right { flex: 0 0 auto; text-align: right; }
.st-box-desc { font-size: .9rem; color: var(--text-secondary); margin-top: .3rem; }
.st-box-total { margin-bottom: .5rem; }
.st-box-total-label { display: block; font-size: .75rem; color: var(--text-muted); }
.st-box-total-num { font-family: var(--serif); font-size: 1.5rem; font-weight: 700; color: var(--gold); }
.st-box-actions { display: flex; gap: .5rem; }

/* 添加物品栏 */
.st-add-item-bar { margin-bottom: 1rem; }

/* 物品表格 */
.st-items-table { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.st-items-thead {
  display: grid; grid-template-columns: 48px minmax(0, 1.8fr) minmax(0, 1.2fr) 50px 70px 70px 104px;
  padding: 10px 12px; background: var(--brand-light); font-size: .78rem;
  font-weight: 600; color: var(--text-secondary); gap: 8px; align-items: center;
}
.st-items-thead .st-col { white-space: nowrap; }
.st-items-row {
  /* 操作列必须给够宽度：登记过 69 码的行有「编辑/标签/删除」三个控件，
     以前只留 80px，第三个控件溢出到卡片外面，看起来就是"按钮错位"。
     列宽写死（不用 auto/fr），否则每一行是各自独立的 grid，会按内容长短漂移到不同位置。 */
  display: grid; grid-template-columns: 48px minmax(0, 1.8fr) minmax(0, 1.2fr) 50px 70px 70px 104px;
  padding: 12px; gap: 8px; align-items: center;
  border-top: 1px solid var(--border); transition: background .15s;
}
.st-items-row:hover { background: rgba(110,123,84,.04); }
.st-col { font-size: .88rem; }
.st-col--img { width: 40px; height: 40px; }
.st-col--name { display: flex; flex-direction: column; gap: 2px; }
.st-col--sub { font-weight: 600; color: var(--gold); }
.st-col--act { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-width: 0; }
.st-col--act form { display: contents; }   /* 让「删除」按钮直接成为弹性项，不再被 form 包一层错位 */
.st-item-thumb { width: 40px; height: 40px; object-fit: cover; border-radius: 6px; }
.st-item-note { font-size: .75rem; color: var(--text-muted); }
.st-item-name { font-weight: 600; }
.st-item-meta { font-size: .8rem; color: var(--text-muted); }
.st-act-link { font-size: .78rem; font-family: inherit; line-height: 1.4; white-space: nowrap; color: var(--brand); background: none; border: none; cursor: pointer; padding: 0; }
.st-act-link:hover { text-decoration: underline; }
.st-act-del { color: var(--danger); }
/* 69码组合标签的页内预览弹窗 */
.st-tagmodal[hidden] { display: none; }
.st-tagmodal {
  position: fixed; inset: 0; z-index: 9000;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.st-tagmodal-bg { position: absolute; inset: 0; background: rgba(12, 10, 6, .62); backdrop-filter: blur(2px); }
.st-tagmodal-box {
  position: relative; max-width: min(520px, 92vw); max-height: 88vh;
  display: flex; flex-direction: column; gap: 10px;
  background: var(--card, #fff); border: 1px solid var(--border);
  border-radius: 14px; box-shadow: 0 18px 46px rgba(0, 0, 0, .28);
  padding: 14px 16px 12px;
}
.st-tagmodal-hd { display: flex; align-items: center; gap: 10px; }
.st-tagmodal-title { font-size: .92rem; font-weight: 600; color: var(--text); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-tagmodal-x { margin-left: auto; background: none; border: none; cursor: pointer; font-size: 22px; line-height: 1; color: var(--text-muted); padding: 0 4px; }
.st-tagmodal-x:hover { color: var(--text); }
.st-tagmodal-img {
  width: 100%; height: auto; display: block; border-radius: 10px;
  background: #fff; border: 1px solid var(--border); object-fit: contain;
  -webkit-user-drag: none;
}
.st-tagmodal-ft { font-size: .74rem; color: var(--text-muted); }
body.st-tagmodal-on { overflow: hidden; }
/* 添加/编辑物品：历史名称候选下拉 */
.st-name-wrap { position: relative; }
.st-sug[hidden] { display: none; }
.st-sug {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 40;
  max-height: 268px; overflow-y: auto; overscroll-behavior: contain;
  background: var(--card); border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, .14); padding: 4px;
}
.st-sug-item { display: flex; flex-direction: column; gap: 2px; padding: 7px 9px; border-radius: 8px; cursor: pointer; }
.st-sug-item:hover, .st-sug-item.on { background: var(--brand-light); }
.st-sug-name { font-size: .88rem; color: var(--text); }
.st-sug-name b { color: var(--brand); font-weight: 700; }
.st-sug-meta { font-size: .74rem; color: var(--text-muted); }
.st-sug-filled { font-size: .76rem; color: var(--brand); margin-top: 4px; }
@media (max-width: 720px) {
  .st-sug { max-height: 200px; }
}

/* 分类标签 */
.st-col--cat { min-width: 0; }
.st-tag {
  display: inline-block; font-size: .7rem; padding: 2px 8px;
  border-radius: 10px; background: var(--brand-light); color: var(--brand-dark);
  white-space: normal; overflow-wrap: anywhere; line-height: 1.4; max-width: 100%;
}
.st-tag--book { background: #E8F0E0; color: #4A6741; }
.st-tag--cloth { background: #F0E8F0; color: #6B4A6B; }
.st-tag--elec { background: #E0ECF4; color: #3A5F7A; }
.st-tag--kitchen { background: #F4EDE0; color: #7A5F3A; }
.st-tag--doc { background: #F0F0E0; color: #5F5F3A; }
.st-tag--toy { background: #FFE8EC; color: #8A3A4A; }
.st-tag--other { background: #EAEAEA; color: #555; }

/* 搜索结果 */
.st-search-results { display: flex; flex-direction: column; gap: .6rem; }
.st-result-info { font-size: .88rem; color: var(--text-secondary); margin-bottom: .5rem; }
.st-item-row {
  display: grid; grid-template-columns: 48px minmax(0, 2fr) minmax(0, 1fr) auto;
  gap: 10px; align-items: center; padding: 12px 14px;
  background: var(--card); border-radius: var(--radius-sm); border: 1px solid var(--border);
}
/* 缩略图占位格：没图也必须占住第一列，否则名称会掉进 48px 的格子里变成一字一行 */
.st-item-thumbcell { width: 48px; min-height: 40px; display: flex; align-items: center; }
.st-item-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.st-item-loc { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.st-item-name { overflow-wrap: anywhere; }
.st-item-subtotal { white-space: nowrap; }
/* 分类标签在 flex 列里默认会被拉成满宽（变成一条灰杠），必须自己贴左、按内容收窄 */
.st-item-info .st-tag { align-self: flex-start; width: auto; max-width: 100%; }
/* 搜索命中高亮 */
mark.st-hl { background: #f6efdc; color: #5b4a2a; padding: 0 2px; border-radius: 3px; box-shadow: inset 0 -1px 0 #c8a45c; }
body.night-mode mark.st-hl { background: rgba(199,164,92,.24); color: var(--nv-text, #f0ead8); }
.st-box-link { font-size: .82rem; color: var(--brand); }
.st-box-loc { font-size: .72rem; color: var(--text-muted); }
.st-item-subtotal { font-weight: 600; color: var(--gold); font-size: .9rem; }

/* 表单 */
.st-form-row { display: flex; gap: 1rem; }
.st-current-img { margin-top: .5rem; }
.st-current-img img { width: 80px; height: 80px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); }
.st-current-img small { display: block; margin-top: 4px; font-size: .75rem; color: var(--text-muted); }
.form-actions { display: flex; gap: .8rem; margin-top: 1.2rem; }
.btn-secondary {
  padding: 8px 16px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--card); color: var(--text-secondary); cursor: pointer; text-decoration: none;
  font-size: .9rem;
}
.btn-secondary:hover { background: var(--bg); }

/* 空状态 */
.st-empty, .st-empty-state {
  text-align: center; padding: 3rem 1rem; color: var(--text-muted); font-size: .9rem;
}

/* 响应式 */
@media (max-width: 720px) {
  .st-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
  .st-items-thead, .st-items-row { grid-template-columns: 36px minmax(0, 1.3fr) minmax(0, 1fr) 40px 56px 56px 84px; font-size: .8rem; }
  .st-item-row { grid-template-columns: 36px minmax(0, 1.2fr) minmax(0, 1fr) auto; }
  .st-item-thumbcell { width: 36px; min-height: 32px; }
  .st-header { flex-direction: column; align-items: flex-start; }
}

/* 储物 - 二维码 */
.st-qr-block {
  margin-top: 28px;
  padding: 20px;
  background: #fff;
  border-radius: 14px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(74,48,64,.05);
}
.st-qr-title {
  font-size: .85rem;
  color: #6b4c5e;
  margin-bottom: 12px;
  font-weight: 600;
}
.st-qr-img {
  width: 180px;
  height: 180px;
  border-radius: 8px;
}
.st-qr-tip {
  font-size: .75rem;
  color: #a08898;
  margin-top: 8px;
}

/* Box cover image */
.st-card-img { font-size: 2rem; height: 80px; display: flex; align-items: center; justify-content: center; overflow: hidden; border-radius: 12px 12px 0 0; }
.st-card-img img { width: 100%; height: 100%; object-fit: cover; }
.st-box-cover { flex: none; width: 56px; height: 56px; object-fit: cover; border-radius: 10px; }


/* ============================================================
   柴郡·小舍 — 储物表单样式（苔金主题，贴合站点风格）
   ============================================================ */

/* ---------- 表单页面容器 ---------- */
.st-page { max-width: 640px; margin: 0 auto; padding: .5rem 0 2rem; }
.st-form-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 1.75rem 1.75rem 2rem;
}
.st-form-title {
  font-family: var(--serif);
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 1.5rem;
  padding-bottom: .9rem;
  border-bottom: 1px solid var(--border);
}

/* ---------- 字段块 ---------- */
.st-field { margin-bottom: 1.35rem; }
.st-field label {
  display: block;
  font-size: .82rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: .45rem;
  letter-spacing: .02em;
}
.st-req { color: var(--danger); font-weight: 700; }

.st-field input[type="text"],
.st-field input[type="number"],
.st-field select,
.st-field textarea {
  width: 100%;
  font-family: inherit;
  font-size: .95rem;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .6rem .8rem;
  line-height: 1.5;
  transition: border-color .15s ease, box-shadow .15s ease;
  -webkit-appearance: none;
  appearance: none;
}
.st-field textarea { resize: vertical; min-height: 80px; }
.st-field select {
  background-image: linear-gradient(45deg, transparent 50%, var(--text-muted) 50%),
                    linear-gradient(135deg, var(--text-muted) 50%, transparent 50%);
  background-position: calc(100% - 16px) center, calc(100% - 11px) center;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 2rem;
}
.st-field input::placeholder,
.st-field textarea::placeholder { color: var(--text-muted); opacity: .7; }
.st-field input:focus,
.st-field select:focus,
.st-field textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(110,123,84,.13);
}

/* ---------- 图片上传组件 ---------- */
.st-img-upload {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}
.st-img-preview {
  flex: 0 0 auto;
  width: 120px;
  height: 120px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  background: var(--brand-light);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.st-img-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.st-img-placeholder {
  font-size: .8rem;
  color: var(--text-muted);
  text-align: center;
  padding: 0 .5rem;
}
.st-img-actions {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  justify-content: center;
}

/* ---------- 按钮 ---------- */
.st-btn-img,
.st-btn-submit,
.st-btn-cancel {
  font-family: inherit;
  font-size: .85rem;
  font-weight: 500;
  letter-spacing: .02em;
  border-radius: var(--radius-sm);
  padding: .5rem 1.1rem;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
  border: 1px solid transparent;
  text-decoration: none;
  display: inline-block;
  text-align: center;
}
.st-btn-img {
  background: #fff;
  border-color: var(--brand);
  color: var(--brand);
}
.st-btn-img:hover { background: var(--brand-light); }
.st-btn-clear { border-color: var(--border) !important; color: var(--text-muted) !important; }
.st-btn-clear:hover { background: rgba(180,87,63,.06); border-color: var(--danger) !important; color: var(--danger) !important; }

.st-form-actions {
  display: flex;
  gap: .8rem;
  align-items: center;
  margin-top: 1.8rem;
  padding-top: 1.35rem;
  border-top: 1px solid var(--border);
}
.st-btn-submit {
  background: var(--brand);
  color: #fff;
  padding: .62rem 1.6rem;
  font-size: .92rem;
}
.st-btn-submit:hover { background: var(--brand-dark); }
.st-btn-cancel {
  background: transparent;
  border-color: transparent;
  color: var(--text-muted);
}
.st-btn-cancel:hover { color: var(--text); text-decoration: underline; }

/* ---------- 移动端适配 ---------- */
@media (max-width: 560px) {
  .st-form-card { padding: 1.25rem 1.1rem 1.5rem; }
  .st-img-upload { flex-direction: column; }
  .st-img-preview { width: 100%; height: 160px; }
  .st-img-actions { flex-direction: row; }
  .st-img-actions .st-btn-img { flex: 1; }
  .st-form-actions { flex-wrap: wrap; }
}

/* ============ 储物 · 效期倒计时面板 ============ */
.st-expiry-panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem 1.25rem;
  margin-bottom: 1.6rem;
  box-shadow: var(--shadow-sm);
}
.st-expiry-head {
  display: flex; align-items: baseline; gap: .7rem;
  padding-bottom: .7rem; margin-bottom: .5rem;
  border-bottom: 1px solid var(--border);
}
.st-expiry-title { font-family: var(--serif); font-size: 1.05rem; font-weight: 700; color: var(--text); }
.st-expiry-sub { font-size: .8rem; color: var(--text-muted); }
.st-expiry-list { display: flex; flex-direction: column; gap: .35rem; }
.st-expiry-row {
  display: grid;
  grid-template-columns: 128px 1fr auto auto;
  align-items: center; gap: .8rem;
  padding: .5rem .6rem;
  border-radius: var(--radius-sm);
  text-decoration: none; color: var(--text);
  border-left: 3px solid var(--border);
  transition: background .15s;
}
.st-expiry-row:hover { background: var(--brand-light); }
.st-expiry-name { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-expiry-box { font-size: .8rem; color: var(--text-secondary); }
.st-expiry-date { font-size: .8rem; color: var(--text-muted); }
.st-expiry-badge {
  font-size: .78rem; font-weight: 600; white-space: nowrap;
  padding: .15rem .55rem; border-radius: 999px;
}
.st-expiry-row.is-normal { border-left-color: var(--brand); }
.st-expiry-row.is-normal .st-expiry-badge { background: var(--brand-light); color: var(--brand-dark); }
.st-expiry-row.is-soon { border-left-color: var(--warning); }
.st-expiry-row.is-soon .st-expiry-badge { background: rgba(176,141,87,.16); color: var(--gold-dark); }
.st-expiry-row.is-expired { border-left-color: var(--danger); }
.st-expiry-row.is-expired .st-expiry-badge { background: rgba(180,87,63,.14); color: var(--danger); }
@media (max-width: 560px) {
  .st-expiry-row { grid-template-columns: 1fr auto; grid-row-gap: .2rem; }
  .st-expiry-box { order: 3; } .st-expiry-date { order: 3; }
}

/* ============ 储物 · 三分类 · 长按拖拽 ============ */
.st-drag-hint { font-size: .82rem; color: var(--text-muted); margin: 0 0 1rem; }
.st-zones { display: flex; flex-direction: column; gap: 1.4rem; }
.st-zone {
  background: transparent;
  border-radius: var(--radius);
}
.st-zone-head {
  display: flex; align-items: center; gap: .6rem;
  margin-bottom: .6rem; padding-bottom: .35rem;
  border-bottom: 1px solid var(--border);
}
.st-zone-title { font-family: var(--serif); font-size: 1rem; font-weight: 700; color: var(--brand-dark); }
.st-zone-count {
  font-size: .74rem; font-weight: 600; color: var(--text-secondary);
  background: var(--brand-light); border-radius: 999px; padding: .05rem .55rem;
}
.st-zone-body {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem; min-height: 96px; padding: .6rem;
  border: 1.5px dashed var(--border); border-radius: var(--radius);
  transition: background .15s, border-color .15s;
}
.st-zone-empty {
  grid-column: 1 / -1; display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); font-size: .85rem; min-height: 84px;
}
.st-pressable { cursor: pointer; touch-action: manipulation; user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; }
.st-pressable.st-pressed { transform: scale(.97); transition: transform .12s ease; }
.st-pressable img { pointer-events: none; }

.st-type-menu {
  position: fixed; z-index: 9999; min-width: 190px; max-width: 260px;
  background: var(--bg-card, #fff); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: .55rem;
  display: flex; flex-direction: column; gap: .3rem;
}
.st-type-menu[hidden] { display: none; }
.st-type-menu-title {
  font-size: .76rem; color: var(--text-muted); margin: .1rem .35rem .3rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.st-type-menu-items { display: flex; flex-direction: column; gap: .25rem; }
.st-type-menu-item {
  text-align: left; font: inherit; font-size: .9rem; font-weight: 600;
  color: var(--brand-dark); background: var(--brand-light);
  border: none; border-radius: var(--radius-sm, 8px);
  padding: .55rem .7rem; cursor: pointer;
  transition: background .12s, transform .12s;
}
.st-type-menu-item:hover { background: var(--brand); color: #fff; }
.st-type-menu-item:active { transform: scale(.98); }
.st-type-menu-item.is-current {
  background: transparent; color: var(--text-muted);
  font-weight: 500; cursor: default;
}
.st-type-menu-open {
  text-align: left; font: inherit; font-size: .82rem;
  color: var(--text-secondary); background: transparent;
  border: none; border-top: 1px solid var(--border);
  padding: .5rem .7rem .15rem; margin-top: .15rem; cursor: pointer;
}
.st-type-menu-open:hover { color: var(--gold); }

/* ============ 储物 · 编辑表单 · 食品效期字段 ============ */
.st-food-fields {
  background: var(--brand-light);
  border-radius: var(--radius-sm);
  padding: .9rem 1rem 1rem;
}
.st-food-fields label { display: block; margin-bottom: .3rem; font-size: .85rem; color: var(--text-secondary); }
.st-food-sublabel { margin-top: .8rem !important; }
.st-food-fields input { width: 100%; box-sizing: border-box; }
.st-food-tip { margin: .7rem 0 0; font-size: .76rem; color: var(--text-muted); line-height: 1.5; }

/* ============ 储物 · 详情页标题独立成行 ============ */
.st-box-title-row {
  display: flex; align-items: center; gap: .7rem;
  margin-bottom: 1rem;
}
.st-box-title {
  font-family: var(--serif); font-size: 1.6rem; font-weight: 700;
  color: var(--text); margin: 0;
}
.st-box-type-badge {
  font-size: .78rem; font-weight: 600; color: var(--brand-dark);
  background: var(--brand-light); border: 1px solid var(--border);
  border-radius: 999px; padding: .2rem .7rem; white-space: nowrap;
}

/* ============ 储物 · 物品行效期 ============ */
.st-item-expiry {
  display: block; font-size: .78rem; margin-top: 2px;
  color: var(--text-secondary);
}
.st-item-expiry.is-soon { color: var(--gold-dark); font-weight: 600; }
.st-item-expiry.is-expired { color: var(--danger); font-weight: 600; }
.st-item-expiry.is-normal { color: var(--brand-dark); }
.st-item-expiry.is-infinite { color: #3f7d5a; font-weight: 600; }

/* ============ 储物 · 无限保质期（表单勾选 + 输入禁用） ============ */
.st-food-infinite {
  display: flex; align-items: center; gap: .5rem;
  margin-top: .8rem; font-size: .88rem; color: var(--text-secondary);
  cursor: pointer; user-select: none;
}
.st-food-infinite input[type=checkbox] { width: auto; margin: 0; cursor: pointer; }
.st-food-infinite:hover { color: var(--text-primary); }
.st-input-muted, input.st-input-muted:disabled, input#shelfDaysInput:disabled {
  opacity: .55; background: var(--bg-secondary, #f3ece4);
  cursor: not-allowed; text-decoration: line-through;
}

/* ============ 望楼（价格守望）============ */
.wl-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .8rem; }
.wl-header-actions { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.wl-breadcrumb { font-size: .84rem; color: var(--text-muted); margin-bottom: .9rem; }
.wl-breadcrumb a { color: var(--brand); text-decoration: none; }
.wl-breadcrumb span { margin: 0 .4rem; color: var(--text-muted); }
.wl-breadcrumb em { font-style: normal; color: var(--text); }
.wl-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); padding: 1rem 1.1rem; margin-bottom: 1.1rem; }
.wl-card-hd { display: flex; align-items: center; gap: .6rem; font-family: var(--serif, "Noto Serif SC", serif);
  font-size: 1.02rem; font-weight: 600; color: var(--text); margin-bottom: .8rem; }
.wl-card-state { margin-left: auto; font-size: .74rem; font-weight: 400; padding: 2px 9px;
  border-radius: 999px; background: var(--brand-light); color: var(--brand); }
.wl-card-state.is-warn { background: #fdf3e6; color: var(--gold); }
.wl-link-btn { display: inline-block; padding: 7px 13px; border: 1px solid var(--border); border-radius: 9px;
  background: #fff; color: var(--text); font-size: .82rem; text-decoration: none; }
.wl-link-btn:hover { border-color: var(--brand); color: var(--brand); }
.wl-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .7rem; margin-bottom: 1rem; }
.wl-sum-cell { background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: .7rem .8rem;
  display: flex; flex-direction: column; gap: 3px; }
.wl-sum-k { font-size: .74rem; color: var(--text-muted); }
.wl-sum-v { font-size: 1.25rem; font-weight: 700; color: var(--text); font-family: var(--serif, serif); }
.wl-sum-v.is-hot { color: var(--danger); }
.wl-sum-v.is-warn { color: var(--gold); }
.wl-sum-v.is-ok { color: var(--brand); }
.wl-note { font-size: .8rem; color: var(--text-muted); margin: -.4rem 0 1rem; }
.wl-note a { color: var(--brand); }
.wl-card--near { border-color: rgba(180,87,63,.35); background: #fffafa; }
.wl-near-row { display: flex; align-items: baseline; gap: .7rem; flex-wrap: wrap;
  padding: .5rem .2rem; border-bottom: 1px dashed var(--border); text-decoration: none; color: var(--text); }
.wl-near-row:last-child { border-bottom: none; }
.wl-near-name { font-weight: 600; }
.wl-near-plat { font-size: .76rem; color: var(--text-muted); }
.wl-near-nums { margin-left: auto; font-size: .8rem; color: var(--text-muted); }
.wl-below { color: var(--danger); }
.wl-hot { color: var(--danger); font-weight: 700; }
.wl-thead, .wl-row { display: grid; grid-template-columns: minmax(0,2.1fr) 74px 78px 84px 74px 44px 92px 104px;
  gap: 8px; align-items: center; }
.wl-thead { padding: .5rem .6rem; background: var(--brand-light); border-radius: 9px 9px 0 0;
  font-size: .76rem; color: var(--text-muted); }
.wl-thead .wl-num, .wl-row .wl-num { text-align: right; font-variant-numeric: tabular-nums; }
.wl-row { padding: .62rem .6rem; border-bottom: 1px solid var(--border); font-size: .86rem; }
.wl-row:last-child { border-bottom: none; }
.wl-row.is-near { background: #fff8f5; }
.wl-name { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.wl-name a { color: var(--text); text-decoration: none; font-weight: 600; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }
.wl-name a:hover { color: var(--brand); }
.wl-name small { font-size: .72rem; color: var(--text-muted); }
.wl-off { font-style: normal; font-size: .68rem; color: var(--gold); border: 1px solid rgba(176,141,87,.4);
  border-radius: 6px; padding: 0 5px; align-self: flex-start; }
.wl-plat, .wl-when { font-size: .78rem; color: var(--text-muted); }
.wl-acts { display: flex; gap: 6px; align-items: center; }
.wl-act { font-size: .76rem; color: var(--brand); text-decoration: none; white-space: nowrap; }
.wl-act:hover { text-decoration: underline; }
.wl-empty, .wl-nochart { padding: 1.1rem .6rem; text-align: center; color: var(--text-muted); font-size: .84rem; }
.wl-help { font-size: .8rem; color: var(--text-muted); line-height: 1.65; margin: 0; }
.wl-help ol, .wl-help ul { margin: .3rem 0 0; padding-left: 1.2rem; }
.wl-help li { margin-bottom: .45rem; }
/* 详情：数值带 */
.wl-hero { padding-bottom: 1.2rem; }
.wl-hero.is-near { border-color: rgba(180,87,63,.4); }
.wl-hero-top { display: flex; align-items: baseline; gap: .7rem; flex-wrap: wrap; }
.wl-hero-name { margin: 0; font-size: 1.3rem; font-family: var(--serif, "Noto Serif SC", serif); color: var(--text); }
.wl-hero-plat { font-size: .8rem; color: var(--text-muted); }
.wl-hero-edit { margin-left: auto; }
.wl-goods-url { display: block; margin-top: .4rem; font-size: .76rem; color: var(--brand);
  word-break: break-all; text-decoration: none; }
.wl-hero-note { font-size: .82rem; color: var(--text-muted); margin: .5rem 0 0; }
.wl-nums { display: grid; grid-template-columns: repeat(auto-fit, minmax(126px, 1fr)); gap: .7rem; margin: 1rem 0 1.1rem; }
.wl-num-cell { background: var(--bg, #FBFAF6); border: 1px solid var(--border); border-radius: 10px; padding: .6rem .7rem;
  display: flex; flex-direction: column; gap: 2px; }
.wl-num-k { font-size: .72rem; color: var(--text-muted); }
.wl-num-v { font-size: 1.16rem; font-weight: 700; color: var(--text); font-family: var(--serif, serif); }
.wl-num-v.is-floor { color: var(--brand); }
.wl-num-v.is-hot, .wl-num-v.is-below { color: var(--danger); }
.wl-num-s { font-size: .7rem; color: var(--text-muted); }
/* 趋势图（服务端画的 SVG，不依赖任何前端图表库） */
.wl-chartwrap { width: 100%; }
.wl-chart { width: 100%; height: auto; display: block; background: #fff; border-radius: 8px; }
.wl-chart .wl-band { fill: rgba(180,87,63,.10); }
.wl-chart .wl-floor { stroke: var(--brand); stroke-width: 1.2; stroke-dasharray: 5 4; }
.wl-chart .wl-flab { fill: var(--brand); font-size: 11px; }
.wl-chart .wl-grid { stroke: rgba(46,51,43,.08); stroke-width: 1; }
.wl-chart .wl-ytick, .wl-chart .wl-xtick { fill: var(--text-muted); font-size: 10.5px; }
.wl-chart .wl-ytick { text-anchor: end; }
.wl-chart .wl-line { fill: none; stroke: var(--gold); stroke-width: 1.8; stroke-linejoin: round; }
.wl-chart .wl-dot { fill: var(--brand); }
.wl-legend { display: flex; gap: 1rem; flex-wrap: wrap; margin-top: .5rem; font-size: .74rem; color: var(--text-muted); }
.wl-lg { display: inline-flex; align-items: center; gap: 5px; }
.wl-lg-line { width: 16px; height: 2px; background: var(--gold); display: inline-block; }
.wl-lg-floor { width: 16px; height: 0; border-top: 2px dashed var(--brand); display: inline-block; }
.wl-lg-band { width: 16px; height: 9px; background: rgba(180,87,63,.16); display: inline-block; border-radius: 2px; }
/* 表单 */
.wl-two { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.wl-form .wl-field { margin-bottom: .85rem; }
.wl-field label { display: block; font-size: .8rem; color: var(--text-muted); margin-bottom: 4px; }
.wl-req { color: var(--danger); }
.wl-field input[type=text], .wl-field input[type=number], .wl-field input[type=date],
.wl-field input[type=password], .wl-field select, .wl-field textarea {
  width: 100%; padding: 9px 11px; border: 1px solid var(--border); border-radius: 9px;
  font-size: .9rem; font-family: inherit; color: var(--text); background: #fff; outline: none; }
.wl-field input:focus, .wl-field select:focus, .wl-field textarea:focus { border-color: var(--brand); }
.wl-inline { display: inline-block; vertical-align: top; margin-right: 1rem; }
.wl-inline input { width: auto; min-width: 120px; }
.wl-sublabel { font-size: .76rem; color: var(--text-muted); margin-top: 6px; }
.wl-sublabel input { width: auto; }
.wl-checkline label { display: flex; align-items: center; gap: 6px; font-size: .84rem; color: var(--text); margin-bottom: 6px; }
.wl-checkline input { width: auto; }
.wl-tip { font-size: .74rem; color: var(--text-muted); margin: 5px 0 0; line-height: 1.5; }
.wl-form-acts { display: flex; align-items: center; gap: .8rem; margin-top: .4rem; }
.wl-del-form { margin-top: 1.2rem; padding-top: .9rem; border-top: 1px solid var(--border); }
.wl-btn-del { background: none; border: 1px solid rgba(180,87,63,.4); color: var(--danger);
  padding: 7px 14px; border-radius: 9px; font-size: .82rem; cursor: pointer; font-family: inherit; }
.wl-btn-del:hover { background: #fbeceb; }
.wl-inline-form { display: flex; align-items: center; gap: .8rem; margin-top: 1rem; padding-top: .9rem;
  border-top: 1px solid var(--border); flex-wrap: wrap; }
.wl-btn-test { background: var(--brand); border: none; color: #fff; padding: 8px 16px; border-radius: 9px;
  font-size: .84rem; cursor: pointer; font-family: inherit; }
.wl-btn-test:hover { filter: brightness(1.06); }
/* 价格点表 */
.wl-ptable { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.wl-prow { display: grid; grid-template-columns: 108px minmax(0,1.4fr) 84px minmax(0,1fr); gap: 8px;
  padding: .5rem .7rem; font-size: .82rem; border-bottom: 1px solid var(--border); align-items: center; }
.wl-prow:last-child { border-bottom: none; }
.wl-prow.is-head { background: var(--brand-light); font-size: .74rem; color: var(--text-muted); }
.wl-prow.is-floor { background: #f6f8f2; }
.wl-prow .wl-num { text-align: right; font-variant-numeric: tabular-nums; }
.wl-pnote { color: var(--text-muted); font-size: .78rem; }
.wl-alert-line { display: flex; align-items: baseline; gap: .7rem; flex-wrap: wrap;
  padding: .45rem .2rem; border-bottom: 1px dashed var(--border); font-size: .8rem; }
.wl-alert-line:last-child { border-bottom: none; }
.wl-alert-when { color: var(--text-muted); font-size: .74rem; min-width: 96px; }
.wl-alert-what { color: var(--text); }
.wl-alert-tag { font-size: .72rem; padding: 1px 8px; border-radius: 999px; background: var(--brand-light); color: var(--brand); }
.wl-alert-tag.is-ok { background: #eaf3e6; color: var(--brand); }
.wl-alert-tag.is-bad { background: #fbeceb; color: var(--danger); }
.wl-alert-err, .wl-errline { font-size: .72rem; color: var(--danger); width: 100%; }
.wl-errline { padding: 0 .7rem .4rem; }
/* 一键记价书签 */
.wl-dragline { margin: .8rem 0; }
.wl-bookmark { display: inline-block; padding: 10px 22px; border-radius: 10px; text-decoration: none;
  background: #f3e6c8; color: #6b5220; border: 1px solid #d6c08c;
  font-weight: 700; font-size: .92rem; cursor: grab; }
.wl-bookmark:hover { filter: brightness(1.03); }
.wl-src { margin-top: .8rem; font-size: .78rem; }
.wl-src summary { cursor: pointer; color: var(--text-muted); }
.wl-codeblock { display: block; margin-top: .5rem; padding: .6rem .7rem; background: #f6f3ec;
  border: 1px solid var(--border); border-radius: 8px; font-size: .68rem; word-break: break-all;
  white-space: pre-wrap; color: #5d5340; }
@media (max-width: 1080px) {
  .wl-thead, .wl-row { grid-template-columns: minmax(0,1.7fr) 64px 70px 76px 66px 40px 84px 96px; }
}
@media (max-width: 860px) {
  .wl-two { grid-template-columns: 1fr; }
  .wl-thead { display: none; }
  .wl-row { grid-template-columns: minmax(0,1fr) auto; gap: 4px 10px; }
  .wl-row .wl-plat, .wl-row .wl-when { font-size: .72rem; }
}
