:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-2: #f9fafb;
  --border: rgba(15, 23, 42, 0.08);
  --text: #0f172a;
  --muted: #64748b;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --nav-bg: rgba(255, 255, 255, 0.78);
  --shadow: 0 4px 20px rgba(15, 23, 42, 0.05);
}

[data-theme="dark"] {
  --bg: #0b0f19;
  --surface: #131a2a;
  --surface-2: #1a2338;
  --border: rgba(255, 255, 255, 0.09);
  --text: #f1f5f9;
  --muted: #94a3b8;
  --accent: #3b82f6;
  --accent-hover: #60a5fa;
  --nav-bg: rgba(11, 15, 25, 0.78);
  --shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  transition: background 0.25s, color 0.25s;
}

/* 毛玻璃顶部导航 */
.navbar {
  background: var(--nav-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  padding: 12px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand {
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.4px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-right { display: flex; align-items: center; gap: 10px; }
.tabs { display: flex; gap: 6px; }

.tab {
  border: none;
  background: transparent;
  padding: 7px 14px;
  border-radius: 9px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  transition: all 0.2s;
}
.tab:hover { color: var(--text); background: var(--surface-2); }
.tab.active { background: var(--text); color: var(--bg); }

.theme-btn {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  width: 34px;
  height: 34px;
  border-radius: 9px;
  cursor: pointer;
  font-size: 15px;
  display: grid;
  place-items: center;
}

.container { max-width: 860px; margin: 28px auto 60px; padding: 0 18px; }
.panel { display: none; animation: fadeIn 0.2s ease; }
.panel.active { display: block; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 22px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}

/* Bento 便当盒网格 */
.bento {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 16px;
}
.span-8 { grid-column: span 8; }
.span-4 { grid-column: span 4; }
.span-6 { grid-column: span 6; }

@media (max-width: 680px) {
  .span-8, .span-4, .span-6 { grid-column: span 12; }
}

.bento .card { margin-bottom: 0; height: 100%; }

.clickable { cursor: pointer; transition: transform 0.18s ease, border-color 0.18s ease; }
.clickable:hover { transform: translateY(-2px); border-color: var(--accent); }

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: #10b981;
  background: rgba(16, 185, 129, 0.12);
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 12px;
}

.dot {
  width: 8px;
  height: 8px;
  background: #10b981;
  border-radius: 50%;
  animation: pulse 1.8s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.85); }
}

.stat-num { font-size: 36px; font-weight: 700; margin: 8px 0 4px; letter-spacing: -1px; }
.muted { color: var(--muted); font-size: 14px; line-height: 1.6; margin: 0; }
h1, h2, h3 { margin-top: 0; }

input, textarea {
  width: 100%;
  padding: 11px 13px;
  margin: 8px 0 12px;
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}
input:focus, textarea:focus { border-color: var(--accent); }

.btn {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 9px 18px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: background 0.2s;
}
.btn:hover { background: var(--accent-hover); }
.btn.secondary { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }
.btn.danger { background: rgba(239, 68, 68, 0.12); color: #ef4444; padding: 5px 10px; font-size: 12px; }
.btn.danger:hover { background: #ef4444; color: #fff; }

.row-between { display: flex; justify-content: space-between; align-items: center; }

/* 留言项 & 彩色头像 */
.item {
  display: flex;
  gap: 12px;
  border-bottom: 1px solid var(--border);
  padding: 14px 0;
}
.item:last-child { border-bottom: none; padding-bottom: 0; }
.item-body { flex: 1; min-width: 0; }

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.meta { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.author { font-weight: 600; color: var(--text); margin-right: 8px; font-size: 14px; }
.hidden { display: none; }

/* Toast 轻提示 */
.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  background: var(--text);
  color: var(--bg);
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: all 0.25s ease;
  z-index: 50;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.error { background: #ef4444; color: #fff; }

/* 楼中楼回复 */
.msg-actions { display: flex; gap: 8px; align-items: center; }
.btn.ghost {
  background: transparent;
  color: var(--muted);
  padding: 4px 8px;
  font-size: 12px;
}
.btn.ghost:hover { color: var(--accent); background: var(--surface-2); }

.replies {
  margin-top: 10px;
  padding-left: 12px;
  border-left: 2px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.reply-item {
  background: var(--surface-2);
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 13px;
}
.reply-box {
  margin-top: 10px;
  padding: 10px;
  background: var(--surface-2);
  border-radius: 10px;
  border: 1px solid var(--border);
}
.reply-box input, .reply-box textarea { margin: 4px 0 8px; padding: 8px 10px; font-size: 13px; }