:root {
  --bg: #ffffff;
  --bg-2: #f5f5f5;
  --text: #222;
  --text-2: #666;
  --border: #ddd;
  --primary: #2b6cb0;
  --danger: #c53030;
}
[data-theme="dark"] {
  --bg: #1a1a1a;
  --bg-2: #2a2a2a;
  --text: #e0e0e0;
  --text-2: #999;
  --border: #444;
  --primary: #63b3ed;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
.container { max-width: 800px; margin: 0 auto; padding: 12px; }

/* 导航 */
.nav {
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
}
.nav-inner {
  max-width: 800px; margin: 0 auto; padding: 10px 12px;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.nav .logo { font-weight: bold; font-size: 18px; color: var(--text); }
.nav .spacer { flex: 1; }
.nav button, .btn {
  padding: 6px 12px; border: 1px solid var(--border);
  background: var(--bg); color: var(--text);
  border-radius: 4px; cursor: pointer; font-size: 14px;
}
.nav button:hover, .btn:hover { background: var(--bg-2); }
.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-danger { background: var(--danger); color: #fff; border-color: var(--danger); }

/* 卡片 */
.card {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 6px; padding: 14px; margin-bottom: 12px;
}
.card h3 { margin: 0 0 8px; }

/* 表单 */
input, textarea, select {
  width: 100%; padding: 8px; margin: 6px 0;
  border: 1px solid var(--border); border-radius: 4px;
  background: var(--bg); color: var(--text);
  font-family: inherit; font-size: 14px;
}
textarea { resize: vertical; min-height: 80px; }
label { font-size: 13px; color: var(--text-2); }

/* 帖子 */
.post-meta { font-size: 13px; color: var(--text-2); margin-bottom: 6px; display: flex; align-items: center; gap: 6px; }
.post-title { font-size: 17px; font-weight: bold; }
.post-content { margin: 6px 0; word-break: break-word; }
.post-actions { display: flex; gap: 12px; font-size: 14px; margin-top: 8px; flex-wrap: wrap; align-items: center; }
.post-actions button {
  background: none; border: none; color: var(--text-2);
  cursor: pointer; padding: 2px 4px; font-size: 14px;
}
.post-actions button.active { color: var(--primary); font-weight: bold; }
.post-images img { max-width: 150px; max-height: 150px; margin: 4px; border-radius: 4px; }
.announcement { border-left: 4px solid #e53e3e; }
.badge { display: inline-block; padding: 1px 6px; background: #e53e3e; color: #fff; border-radius: 3px; font-size: 12px; }

/* 头像 */
.avatar {
  width: 32px; height: 32px; border-radius: 50%;
  object-fit: cover; background: var(--bg-2); vertical-align: middle;
}
.avatar-lg { width: 64px; height: 64px; }

/* Tab */
.tabs { display: flex; gap: 4px; margin-bottom: 12px; flex-wrap: wrap; }
.tabs button {
  padding: 6px 14px; border: 1px solid var(--border);
  background: var(--bg); color: var(--text); cursor: pointer; border-radius: 4px;
}
.tabs button.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* 弹窗 */
.modal-mask {
  position: fixed; inset: 0; background: rgba(0,0,0,0.4);
  display: flex; align-items: center; justify-content: center; z-index: 1000;
}
.modal {
  background: var(--bg); padding: 20px; border-radius: 8px;
  width: 90%; max-width: 400px; max-height: 90vh; overflow-y: auto;
}
.modal h3 { margin-top: 0; }
.hidden { display: none !important; }

/* 通知 */
.notif-dropdown {
  position: absolute; right: 12px; top: 50px;
  width: 320px; max-height: 400px; overflow-y: auto;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 6px; padding: 8px; z-index: 200;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.notif-item { padding: 8px; border-bottom: 1px solid var(--border); font-size: 13px; }
.notif-item.unread { background: rgba(43,108,176,0.08); }
.notif-badge {
  background: #e53e3e; color: #fff; border-radius: 10px;
  padding: 0 6px; font-size: 11px; margin-left: 2px;
}

/* 分页 */
.pagination { display: flex; gap: 8px; align-items: center; justify-content: center; margin: 16px 0; }
.pagination button:disabled { opacity: 0.4; cursor: not-allowed; }

/* Cookie 横幅 */
.cookie-banner {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: var(--bg-2); border-top: 1px solid var(--border);
  padding: 12px; display: flex; gap: 12px; align-items: center;
  justify-content: center; z-index: 999; flex-wrap: wrap;
}
.comment { padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.toast {
  position: fixed; top: 60px; left: 50%; transform: translateX(-50%);
  background: #333; color: #fff; padding: 8px 16px; border-radius: 4px;
  z-index: 2000; font-size: 14px;
}

/* 导航栏外链 */
.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  color: var(--text-2);
  border-radius: 4px;
  text-decoration: none;
  font-size: 14px;
}
.nav-link:hover {
  color: var(--primary);
  background: var(--bg);
  text-decoration: none;
}
.nav-link-text {
  padding: 4px 10px;
  border: 1px solid var(--border);
}
</style>