/* 简易论坛 - 简洁实用风格 */
:root {
  --primary: #3b82f6;
  --primary-dark: #2563eb;
  --bg: #f2f4f7;
  --border: #e5e7eb;
  --text: #333;
  --muted: #888;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Microsoft Yahei", "PingFang SC", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
.container { max-width: 1480px; margin: 0 auto; padding: 0 16px; }

.site-header { background: #fff; border-bottom: 1px solid var(--border); }
.header-inner { display: flex; align-items: center; height: 60px; gap: 20px; }
.logo { font-size: 20px; font-weight: bold; color: var(--primary-dark); }
.search-box { flex: 1; display: flex; max-width: 320px; }
.search-box input { flex: 1; padding: 6px 10px; border: 1px solid var(--border); border-radius: 4px 0 0 4px; }
.search-box button { border: none; background: var(--primary); color: #fff; padding: 6px 14px; border-radius: 0 4px 4px 0; cursor: pointer; }
.nav-links { display: flex; gap: 16px; align-items: center; white-space: nowrap; }
.nav-links .badge { background: #ef4444; color: #fff; font-size: 11px; border-radius: 8px; padding: 0 5px; margin-left: 2px; }
.nav-links .lv { color: var(--muted); font-size: 12px; }

.main-content { padding: 24px 16px 60px; min-height: 60vh; }

.flash { padding: 10px 14px; border-radius: 4px; margin-bottom: 16px; font-size: 13px; }
.flash-success { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }
.flash-error { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }

.stats-bar { background: #fff; border: 1px solid var(--border); border-radius: 6px; padding: 12px 16px; margin-bottom: 16px; color: var(--muted); }

.board-list { display: flex; flex-direction: column; gap: 10px; }
.board-card { background: #fff; border: 1px solid var(--border); border-radius: 6px; padding: 16px 20px; display: flex; justify-content: space-between; align-items: center; }
.board-name { font-size: 17px; font-weight: bold; }
.board-desc { color: var(--muted); font-size: 13px; margin-top: 4px; }
.board-meta { color: var(--muted); font-size: 13px; text-align: right; }

.crumb { color: var(--muted); margin-bottom: 14px; font-size: 13px; }
.board-toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.board-desc-line { color: var(--muted); }

.btn { display: inline-block; background: var(--primary); color: #fff; padding: 8px 18px; border-radius: 4px; border: none; cursor: pointer; font-size: 14px; }
.btn:hover { background: var(--primary-dark); text-decoration: none; }

.thread-table { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.thread-table th, .thread-table td { padding: 10px 14px; border-bottom: 1px solid var(--border); text-align: left; font-size: 13px; }
.thread-table th { background: #fafafa; color: var(--muted); font-weight: normal; }
.thread-table td.tt { font-size: 14px; }
.empty-tip { text-align: center; color: var(--muted); padding: 30px 0 !important; }

.tag { display: inline-block; font-size: 11px; padding: 1px 6px; border-radius: 3px; margin-right: 4px; }
.tag-top { background: #fee2e2; color: #b91c1c; }
.tag-essence { background: #fef3c7; color: #92400e; }
.tag-admin { background: #dbeafe; color: #1d4ed8; }

.pagination { margin: 18px 0; text-align: center; }
.pagination a, .pagination span { display: inline-block; padding: 6px 12px; margin: 0 3px; border: 1px solid var(--border); border-radius: 4px; background: #fff; font-size: 13px; }
.pagination .cur { background: var(--primary); color: #fff; border-color: var(--primary); }

.form-box { background: #fff; border: 1px solid var(--border); border-radius: 6px; padding: 20px; max-width: 640px; }
.form-box.narrow { max-width: 400px; }
.form-box label { display: block; margin: 12px 0 4px; color: #555; font-size: 13px; }
.form-box input[type=text], .form-box input[type=password], .form-box input[type=email], .form-box input[type=number], .form-box input[type=file], .form-box textarea, .form-box select {
  width: 100%; padding: 8px 10px; border: 1px solid var(--border); border-radius: 4px; font-size: 14px;
}
.form-box textarea { min-height: 100px; }
.editor-toolbar-extra { margin-bottom: 6px; }
.editor-toolbar-extra .mini-btn { background: #eff6ff; border-color: #bfdbfe; color: var(--primary-dark); }
.rich-editor-wrap { background: #fff; }
.rich-src-area { font-family: Consolas, Monaco, monospace; font-size: 13px; }
.switch-link { color: var(--muted); font-size: 13px; }

.thread-post { display: flex; background: #fff; border: 1px solid var(--border); border-radius: 6px; margin-bottom: 12px; }
.post-side { width: 130px; padding: 16px; border-right: 1px solid var(--border); text-align: center; flex-shrink: 0; }
.post-side .uname { font-weight: bold; }
.post-side .ulevel, .post-side .upoints { color: var(--muted); font-size: 12px; margin-top: 4px; }
.post-body { flex: 1; padding: 16px 20px; min-width: 0; }
.thread-title { margin: 0 0 12px; font-size: 20px; }
.post-content { word-break: break-word; }
.post-content img { max-width: 100%; }
.post-meta { color: var(--muted); font-size: 12px; margin-top: 12px; border-top: 1px dashed var(--border); padding-top: 8px; }
.att-img img { max-width: 300px; margin-top: 10px; border-radius: 4px; }
.att-file { margin-top: 8px; font-size: 13px; }
.meta-btn { display: inline; background: none; border: none; padding: 0; margin: 0; color: var(--primary); font-size: inherit; cursor: pointer; text-decoration: none; }
.meta-btn:hover { text-decoration: underline; color: #dc2626; }
.reply-title { margin: 20px 0 10px; }
.notice-box { background: #fff; border: 1px solid var(--border); padding: 14px; border-radius: 6px; text-align: center; }

.profile-box { background: #fff; border: 1px solid var(--border); border-radius: 6px; padding: 24px; }
.profile-header { display: flex; gap: 20px; margin-bottom: 20px; }
.profile-header .avatar { width: 80px; height: 80px; border-radius: 6px; object-fit: cover; background: #eee; }
.avatar-placeholder { display: flex; align-items: center; justify-content: center; background: var(--primary); color: #fff; font-size: 32px; font-weight: bold; }
.bio { color: var(--muted); margin-top: 6px; }
.simple-list { list-style: none; padding: 0; margin: 0; }
.simple-list li { padding: 8px 0; border-bottom: 1px dashed var(--border); }
.muted { color: var(--muted); font-size: 12px; }

.messages-layout { display: flex; gap: 16px; }
.conv-list { width: 220px; background: #fff; border: 1px solid var(--border); border-radius: 6px; padding: 14px; flex-shrink: 0; }
.conv-list li.active a { font-weight: bold; }
.conv-main { flex: 1; background: #fff; border: 1px solid var(--border); border-radius: 6px; padding: 16px; }
.chat-box { max-height: 420px; overflow-y: auto; margin-bottom: 14px; }
.chat-msg { margin-bottom: 10px; max-width: 70%; }
.chat-msg.mine { margin-left: auto; text-align: right; }
.chat-text { display: inline-block; background: #f3f4f6; padding: 8px 12px; border-radius: 6px; }
.chat-msg.mine .chat-text { background: #dbeafe; }
.chat-time { font-size: 11px; color: var(--muted); margin-top: 2px; }

.notif-list { list-style: none; padding: 0; }
.notif-list li { background: #fff; border: 1px solid var(--border); border-radius: 6px; padding: 12px 16px; margin-bottom: 8px; }
.notif-list li.unread { border-left: 3px solid var(--primary); }
.page-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.page-title { font-size: 20px; }

/* Admin */
.admin-layout { display: flex; gap: 20px; }
.admin-sidebar { width: 160px; background: #fff; border: 1px solid var(--border); border-radius: 6px; padding: 10px 0; flex-shrink: 0; height: fit-content; }
.admin-sidebar ul { list-style: none; margin: 0; padding: 0; }
.admin-sidebar li a { display: block; padding: 10px 20px; color: #444; }
.admin-sidebar li.active a, .admin-sidebar li a:hover { background: #eff6ff; color: var(--primary-dark); text-decoration: none; }
.admin-main { flex: 1; min-width: 0; }
.admin-stats { display: flex; gap: 14px; margin-bottom: 20px; }
.stat-card { background: #fff; border: 1px solid var(--border); border-radius: 6px; padding: 18px 24px; text-align: center; flex: 1; }
.stat-card .num { font-size: 26px; font-weight: bold; color: var(--primary-dark); }
.stat-card .lbl { color: var(--muted); font-size: 13px; margin-top: 4px; }
.admin-table { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--border); border-radius: 6px; margin-bottom: 14px; }
.admin-table th, .admin-table td { padding: 8px 10px; border-bottom: 1px solid var(--border); font-size: 13px; text-align: left; }
.admin-table th { background: #fafafa; color: var(--muted); }
.mini-btn { background: #f3f4f6; border: 1px solid var(--border); padding: 4px 10px; border-radius: 4px; font-size: 12px; cursor: pointer; }
.mini-btn.danger { color: #dc2626; }
.ok { color: #16a34a; }
.bad { color: #dc2626; }
.inline-search { margin-bottom: 14px; }
.inline-search input { padding: 6px 10px; border: 1px solid var(--border); border-radius: 4px; }

.site-footer { text-align: center; color: var(--muted); font-size: 12px; padding: 20px 0; border-top: 1px solid var(--border); }

@media (max-width: 1024px) {
  .admin-sidebar { width: 130px; }
  .conv-list { width: 180px; }
}

@media (max-width: 700px) {
  .messages-layout { flex-direction: column; }
  .conv-list { width: 100%; }
  .conv-list ul { display: flex; flex-wrap: wrap; gap: 6px; }
  .conv-list li { padding: 4px 0; border-bottom: none; }
  .admin-layout { flex-direction: column; }
  .admin-sidebar { width: 100%; }
  .admin-sidebar ul { display: flex; flex-wrap: wrap; }
  .admin-sidebar li a { padding: 8px 12px; }
  .header-inner { flex-wrap: wrap; height: auto; padding: 10px 0; }
  .search-box { order: 3; max-width: 100%; }

  .board-card { flex-direction: column; align-items: flex-start; gap: 8px; }
  .board-meta { text-align: left; display: flex; gap: 16px; }

  .thread-table-wrap { width: 100%; overflow-x: auto; }
  .thread-table { min-width: 560px; }

  .thread-post { flex-direction: column; }
  .post-side { width: 100%; border-right: none; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 10px; text-align: left; padding: 10px 16px; }
  .post-side .uname, .post-side .ulevel, .post-side .upoints { margin-top: 0; }

  .form-box, .form-box.narrow { max-width: 100%; }
  .admin-stats { flex-wrap: wrap; }
  .stat-card { min-width: 45%; }
  .admin-table { display: block; overflow-x: auto; white-space: nowrap; }
  .profile-header { flex-direction: column; align-items: flex-start; }
  .chat-msg { max-width: 90%; }
  .page-head { flex-direction: column; align-items: flex-start; gap: 8px; }
  .inline-search { display: flex; }
}

@media (max-width: 420px) {
  .nav-links { gap: 10px; font-size: 13px; }
  .logo { font-size: 17px; }
}

