/* ========================================
   webube Forum - Global Stylesheet
   ======================================== */

/* CSS Variables */
:root {
  --primary: #2563eb;
  --primary2: #0891b2;
  --primary3: #d97706;
  --primary-dark: #1d4ed8;
  --primary-light: #dbeafe;
  --accent-php: #7c3aed;
  --accent-3d: #0891b2;
  --accent-diy: #d97706;
  --text: #1e293b;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --border: #e2e8f0;
  --bg: #f8fafc;
  --bg-white: #ffffff;
  --bg-card: #ffffff;
  --radius: 8px;
  --radius-sm: 4px;
  --shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,.1);
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --mono: 'Fira Code', 'Cascadia Code', 'Consolas', monospace;
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body { font-family: var(--font); color: var(--text); background: var(--bg); line-height: 1.6; }
a { color: var(--primary); text-decoration: none; transition: color .2s; }
a:hover { color: var(--primary-dark); }
img { max-width: 100%; display: block; }
ul, ol { list-style: none; }
input, textarea, select, button { font-family: inherit; font-size: inherit; }
.hide {display: none;}

/* Layout */
.container { max-width: 1200px; margin: 0 auto; padding: 0 16px; }
.layout { display: grid; grid-template-columns: 1fr 280px; gap: 24px; padding: 24px 0; }
.layout-full { padding: 24px 0; }

/* ---- Header ---- */
.site-header {
  background: var(--bg-white);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
  box-shadow: var(--shadow);
}
.header-inner {
  display: flex; align-items: center; gap: 24px;
  height: 60px;
}
.site-logo {
  font-size: 1.25rem; font-weight: 700; color: var(--primary);
  white-space: nowrap;
}
.site-logo span { color: var(--text); }

/* Main Nav */
.main-nav { display: flex; gap: 4px; flex: 1; }
.main-nav a {
  padding: 6px 14px; border-radius: var(--radius-sm);
  color: var(--text-muted); font-size: .9rem; font-weight: 500;
  transition: background .2s, color .2s;
}
.main-nav a:hover, .main-nav a.active { background: var(--primary-light); color: var(--primary); }
.main-nav a.cat-php { --c: var(--accent-php); }
.main-nav a.cat-php:hover, .main-nav a.cat-php.active { background: #f3e8ff; color: var(--accent-php); }
.main-nav a.cat-3d { --c: var(--accent-3d); }
.main-nav a.cat-3d:hover, .main-nav a.cat-3d.active { background: #cffafe; color: var(--accent-3d); }
.main-nav a.cat-diy { --c: var(--accent-diy); }
.main-nav a.cat-diy:hover, .main-nav a.cat-diy.active { background: #fef3c7; color: var(--accent-diy); }

/* Header Actions */
.header-actions { display: flex; align-items: center; gap: 10px; }
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 16px; border-radius: var(--radius); font-size: .875rem; font-weight: 500; cursor: pointer; border: none; transition: all .2s; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); color: #fff; }
.btn-primary2 { background: var(--primary2); color: #fff; }
.btn-primary2:hover { background: var(--primary-dark); color: #fff; }
.btn-primary3 { background: var(--primary3); color: #fff; }
.btn-primary3:hover { background: var(--primary-dark); color: #fff; }
.btn-outline { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.btn-sm { padding: 5px 12px; font-size: .8rem; }
.btn-danger { background: #ef4444; color: #fff; }
.btn-danger:hover { background: #dc2626; color: #fff; }

/* User Avatar */
.user-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--primary-light); color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-size: .85rem; font-weight: 700; text-transform: uppercase;
  flex-shrink: 0;
}
.user-menu-wrap { position: relative; }
.user-menu-wrap:hover .user-dropdown { opacity: 1; pointer-events: auto; transform: translateY(0); }
.user-dropdown {
  position: absolute; right: 0; top: 100%;
  padding-top: 8px;                         /* 用 padding 代替 top 间隙，保证鼠标不离开元素 */
  background: transparent;                  /* 外层透明，内容层有背景 */
  opacity: 0; pointer-events: none;
  transform: translateY(-6px);
  transition: opacity .2s, transform .2s;
  z-index: 200;
}
.user-dropdown-inner {
  background: var(--bg-white); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-md);
  min-width: 160px; padding: 6px 0;
}
.user-dropdown a, .user-dropdown button {
  display: block; width: 100%; padding: 8px 16px;
  color: var(--text); font-size: .875rem; text-align: left;
  background: none; border: none; cursor: pointer;
  transition: background .15s;
}
.user-dropdown a:hover, .user-dropdown button:hover { background: var(--bg); color: var(--primary); }
.user-dropdown hr { border: none; border-top: 1px solid var(--border); margin: 4px 0; }

/* ---- Auth Modal (Login/Register Popup) ---- */
.auth-modal-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,.45);
  display: flex; align-items: center; justify-content: center;
  z-index: 9999;
  opacity: 0; pointer-events: none;
  transition: opacity .25s;
}
.auth-modal-overlay.active { opacity: 1; pointer-events: auto; }

.auth-modal-box {
  background: var(--bg-white); border-radius: 12px;
  width: 100%; max-width: 440px;
  padding: 28px 32px;
  position: relative;
  box-shadow: 0 20px 60px rgba(0,0,0,.2);
  transform: translateY(16px) scale(.97);
  transition: transform .25s;
  max-height: 90vh; overflow-y: auto;
}
.auth-modal-overlay.active .auth-modal-box { transform: translateY(0) scale(1); }

.auth-modal-close {
  position: absolute; top: 12px; right: 16px;
  background: none; border: none; font-size: 1.4rem;
  color: var(--text-muted); cursor: pointer;
  line-height: 1; padding: 4px 8px;
  transition: color .2s;
}
.auth-modal-close:hover { color: var(--text); }

.auth-modal-tabs {
  display: flex; gap: 0; margin-bottom: 24px;
  border-bottom: 2px solid var(--border);
}
.auth-tab {
  flex: 1; padding: 10px 0; text-align: center;
  font-size: .95rem; font-weight: 600;
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color .2s, border-color .2s;
}
.auth-tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.auth-tab:hover:not(.active) { color: var(--text); }

.auth-tab-panel { display: none; }
.auth-tab-panel.active { display: block; animation: authFadeIn .2s ease; }
@keyframes authFadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.auth-error {
  background: #fef2f2; color: #dc2626; font-size: .82rem;
  padding: 8px 12px; border-radius: 6px;
  margin-bottom: 12px; display: none;
  border: 1px solid #fecaca;
}

.auth-modal-footer {
  text-align: center; margin-top: 16px;
  font-size: .85rem; color: var(--text-muted);
}
.auth-modal-footer a { color: var(--primary); font-weight: 600; }
.auth-modal-footer a:hover { text-decoration: underline; }

/* User-menu-wrap in header — already styled above, just ensure alignment */
.header-actions {
  display: flex; align-items: center; gap: 10px;
}
.header-actions .user-menu-wrap {
  display: flex; align-items: center;
}

/* ---- Breadcrumb ---- */
.breadcrumb { padding: 12px 0; font-size: .85rem; color: var(--text-muted); }
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb span { margin: 0 6px; }

/* ---- Page Title Banner ---- */
.page-banner {
  padding: 28px 0 20px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0;
}
.page-banner .cat-icon {
  width: 48px; height: 48px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; margin-bottom: 10px;
}
.page-banner h1 { font-size: 1.5rem; font-weight: 700; margin-bottom: 4px; }
.page-banner p { color: var(--text-muted); font-size: .9rem; }

/* ---- Card ---- */
.card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
}
.card-header {
  padding: 14px 18px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.card-header h3 { font-size: .95rem; font-weight: 600; }
.card-body { padding: 18px; }

/* ---- Post List ---- */
.post-list { background: var(--bg-white); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.post-list-header {
  display: grid; grid-template-columns: 1fr 80px 80px 100px;
  padding: 10px 18px; background: var(--bg);
  font-size: .8rem; color: var(--text-muted); font-weight: 600;
  border-bottom: 1px solid var(--border); text-transform: uppercase; letter-spacing: .04em;
}
.post-item {
  display: grid; grid-template-columns: 1fr 80px 80px 100px;
  padding: 14px 18px; border-bottom: 1px solid var(--border);
  align-items: center; transition: background .15s;
}
.post-item:last-child { border-bottom: none; }
.post-item:hover { background: var(--bg); }

.post-item-main { display: flex; gap: 12px; align-items: flex-start; min-width: 0; }
.post-item-avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--primary-light); color: var(--primary); display: flex; align-items: center; justify-content: center; font-size: .8rem; font-weight: 700; flex-shrink: 0; }
.post-item-info { min-width: 0; }
.post-item-title { font-size: .95rem; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.post-item-title:hover { color: var(--primary); }
.post-item-meta { font-size: .78rem; color: var(--text-muted); margin-top: 3px; }
.post-item-meta a { color: var(--text-muted); }
.post-item-meta a:hover { color: var(--primary); }

.tag { display: inline-block; padding: 2px 8px; border-radius: 20px; font-size: .72rem; font-weight: 600; }
.tag-php { background: #f3e8ff; color: var(--accent-php); }
.tag-3d  { background: #cffafe; color: var(--accent-3d); }
.tag-diy { background: #fef3c7; color: var(--accent-diy); }
.tag-new { background: #fee2e2; color: #dc2626; }
.tag-hot { background: #ffe4e6; color: #be123c; }
.tag-pin { background: #f1f5f9; color: var(--text-muted); }

.post-count, .post-views, .post-last { font-size: .82rem; color: var(--text-muted); text-align: center; }
.post-last { text-align: right; font-size: .78rem; }

/* ---- Pagination ---- */
.pagination { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 24px 0; }
.pagination a, .pagination span {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: var(--radius-sm);
  font-size: .875rem; font-weight: 500;
  border: 1px solid var(--border); color: var(--text-muted);
  transition: all .2s;
}
.pagination a:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.pagination .active { background: var(--primary); border-color: var(--primary); color: #fff; }
.pagination .disabled { opacity: .4; pointer-events: none; }
.pagination .dots { border: none; background: none; }

/* ---- Sidebar ---- */
.sidebar { display: flex; flex-direction: column; gap: 18px; }
.sidebar-card { background: var(--bg-white); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.sidebar-card-title { padding: 12px 16px; border-bottom: 1px solid var(--border); font-size: .875rem; font-weight: 700; color: var(--text); }
.sidebar-list { }
.sidebar-list li { padding: 10px 16px; border-bottom: 1px solid var(--border); font-size: .85rem; display: flex; gap: 8px; align-items: flex-start; }
.sidebar-list li:last-child { border-bottom: none; }
.sidebar-list .num { width: 20px; height: 20px; border-radius: 4px; background: var(--bg); color: var(--text-light); font-size: .75rem; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; margin-top: 1px; }
.sidebar-list li:nth-child(1) .num { background: #ef4444; color: #fff; }
.sidebar-list li:nth-child(2) .num { background: #f97316; color: #fff; }
.sidebar-list li:nth-child(3) .num { background: #eab308; color: #fff; }
.sidebar-list a { color: var(--text); font-size: .85rem; line-height: 1.4; }
.sidebar-list a:hover { color: var(--primary); }

/* Category Widget */
.cat-list li { padding: 10px 16px; border-bottom: 1px solid var(--border); }
.cat-list li:last-child { border-bottom: none; }
.cat-list a { display: flex; align-items: center; justify-content: space-between; color: var(--text); font-size: .875rem; font-weight: 500; }
.cat-list a:hover { color: var(--primary); }
.cat-list .cat-count { font-size: .78rem; color: var(--text-light); }

/* Stats Widget */
.stats-grid { display: grid; grid-template-columns: 1fr 1fr; }
.stat-item { padding: 14px 16px; text-align: center; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.stat-item:nth-child(2n) { border-right: none; }
.stat-item:nth-last-child(-n+2) { border-bottom: none; }
.stat-num { font-size: 1.25rem; font-weight: 700; color: var(--primary); }
.stat-label { font-size: .75rem; color: var(--text-muted); margin-top: 2px; }

/* ---- Hero (Homepage) ---- */
.hero {
  background: linear-gradient(135deg, #1e40af 0%, #2563eb 50%, #0891b2 100%);
  color: #fff; padding: 48px 0 40px;
}
.hero h1 { font-size: 2rem; font-weight: 800; margin-bottom: 10px; }
.hero p { font-size: 1rem; opacity: .85; margin-bottom: 24px; max-width: 480px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.btn-white { background: #fff; color: var(--primary); }
.btn-white:hover { background: #f0f9ff; color: var(--primary-dark); }
.btn-ghost { background: rgba(255,255,255,.15); color: #fff; border: 1px solid rgba(255,255,255,.3); }
.btn-ghost:hover { background: rgba(255,255,255,.25); color: #fff; }

/* Category Cards (Homepage) */
.cat-cards { display: grid; grid-template-columns: repeat(3,1fr); gap: 20px; padding: 32px 0; }
.cat-card {
  background: var(--bg-white); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px; transition: box-shadow .2s, transform .2s;
}
.cat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.cat-card-icon { width: 52px; height: 52px; border-radius: 14px; display: flex; align-items: center; justify-content: center; font-size: 1.6rem; margin-bottom: 14px; }
.cat-card h3 { font-size: 1.05rem; font-weight: 700; margin-bottom: 8px; }
.cat-card p { font-size: .85rem; color: var(--text-muted); line-height: 1.5; margin-bottom: 16px; }
.cat-card-footer { display: flex; align-items: center; justify-content: space-between; font-size: .8rem; color: var(--text-muted); }
.cat-card-footer a { color: var(--primary); font-weight: 500; }

.cat-php .cat-card-icon { background: #f3e8ff; }
.cat-3d  .cat-card-icon { background: #cffafe; }
.cat-diy .cat-card-icon { background: #fef3c7; }
.cat-php h3 { color: var(--accent-php); }
.cat-3d  h3 { color: var(--accent-3d); }
.cat-diy h3 { color: var(--accent-diy); }
.cat-php .btn-link { color: var(--accent-php); }
.cat-3d  .btn-link { color: var(--accent-3d); }
.cat-diy .btn-link { color: var(--accent-diy); }

/* ---- Post Detail ---- */
.post-detail { background: var(--bg-white); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.post-detail-header { padding: 24px; border-bottom: 1px solid var(--border); }
.post-detail-title { font-size: 1.4rem; font-weight: 700; margin-bottom: 12px; line-height: 1.4; }
.post-detail-meta { display: flex; gap: 16px; align-items: center; font-size: .83rem; color: var(--text-muted); flex-wrap: wrap; }
.post-detail-meta span { display: flex; align-items: center; gap: 4px; }

.post-content { padding: 24px; }
.post-content p { margin-bottom: 1em; line-height: 1.8; }
.post-content h2, .post-content h3 { margin: 1.5em 0 .6em; font-weight: 700; }
.post-content pre { background: #1e293b; color: #e2e8f0; padding: 16px; border-radius: var(--radius); overflow-x: auto; font-family: var(--mono); font-size: .85rem; margin-bottom: 1em; }
.post-content code { background: #f1f5f9; color: #e11d48; padding: 1px 5px; border-radius: 3px; font-family: var(--mono); font-size: .875em; }
.post-content pre code { background: none; color: inherit; padding: 0; }
.post-content img { border-radius: var(--radius); margin: 1em 0; }
.post-content blockquote { border-left: 3px solid var(--border); padding: 8px 16px; color: var(--text-muted); margin: 1em 0; background: var(--bg); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }

.post-author-card {
  padding: 20px 24px; border-top: 1px solid var(--border);
  display: flex; align-items: center; gap: 16px;
  background: var(--bg);
}
.author-avatar { width: 52px; height: 52px; border-radius: 50%; background: var(--primary-light); color: var(--primary); display: flex; align-items: center; justify-content: center; font-size: 1.1rem; font-weight: 700; flex-shrink: 0; }
.author-name { font-weight: 700; font-size: .95rem; }
.author-bio { font-size: .82rem; color: var(--text-muted); margin-top: 3px; }
.author-stats { font-size: .78rem; color: var(--text-light); margin-top: 4px; }

.post-actions { padding: 16px 24px; border-top: 1px solid var(--border); display: flex; gap: 12px; align-items: center; }
.action-btn { display: inline-flex; align-items: center; gap: 5px; padding: 7px 14px; border-radius: 20px; font-size: .83rem; color: var(--text-muted); border: 1px solid var(--border); background: var(--bg); cursor: pointer; transition: all .2s; }
.action-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.action-btn.liked { border-color: #ef4444; color: #ef4444; background: #fff5f5; }
button[data-action="favorite"].liked { color: #f59e0b; border-color: #f59e0b; background: #fffbeb; }
.reply-sub-actions .btn-text.liked { color: #ef4444; }

/* ---- Reply / Comments ---- */
.reply-section { margin-top: 24px; }
.reply-section-title { font-size: 1rem; font-weight: 700; margin-bottom: 16px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.reply-item {
  display: grid; grid-template-columns: 48px 1fr;
  gap: 14px; padding: 18px 0; border-bottom: 1px solid var(--border);
}
.reply-item:last-child { border-bottom: none; }
.reply-avatar { width: 42px; height: 42px; border-radius: 50%; background: var(--primary-light); color: var(--primary); display: flex; align-items: center; justify-content: center; font-size: .85rem; font-weight: 700; }
.reply-body {}
.reply-header { display: flex; gap: 10px; align-items: baseline; margin-bottom: 8px; }
.reply-author { font-weight: 700; font-size: .9rem; }
.reply-time { font-size: .78rem; color: var(--text-light); }
.reply-floor { font-size: .75rem; color: var(--text-light); margin-left: auto; }
.reply-text { font-size: .9rem; line-height: 1.7; color: var(--text); }
.reply-actions { margin-top: 8px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

/* Comment replies (single-level, flat under parent comment) */
.comment-replies {
  margin-top: 12px;
  margin-left: 8px;
  padding-left: 18px;
  border-left: 2px solid var(--border);
}
.reply-sub-item {
  display: flex;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px dashed var(--border);
}
.reply-sub-item:last-child { border-bottom: none; }
.reply-sub-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .7rem; font-weight: 700; flex-shrink: 0;
  background: var(--primary-light); color: var(--primary);
}
.reply-sub-body { flex: 1; min-width: 0; }
.reply-sub-meta {
  display: flex; align-items: center; gap: 8px;
  font-size: .78rem; margin-bottom: 4px;
}
.reply-sub-author { font-weight: 600; color: var(--text); }
.reply-sub-time { color: var(--text-muted); }
.reply-sub-text { font-size: .85rem; line-height: 1.6; color: var(--text); }
.reply-at { color: var(--primary); font-weight: 600; cursor: pointer; }
.reply-at:hover { text-decoration: underline; }
.reply-sub-actions { margin-top: 4px; display: flex; gap: 12px; }
.reply-sub-actions .btn-text { font-size: .75rem; color: var(--text-muted); cursor: pointer; border: none; background: none; padding: 0; }

/* Reply Form */
.reply-form { background: var(--bg-white); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; margin-top: 20px; }
.reply-form h4 { font-size: .95rem; font-weight: 700; margin-bottom: 14px; }
.form-group { margin-bottom: 14px; }
.form-label { display: block; font-size: .85rem; font-weight: 600; margin-bottom: 6px; color: var(--text); }
.form-input, .form-textarea, .form-select {
  width: 100%; padding: 9px 12px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: .9rem; color: var(--text); background: var(--bg-white);
  transition: border-color .2s, box-shadow .2s;
  outline: none;
}
.form-input:focus, .form-textarea:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}
.form-textarea { resize: vertical; min-height: 100px; }
.form-hint { font-size: .78rem; color: var(--text-muted); margin-top: 4px; }

/* ---- Auth Pages ---- */
.auth-page { min-height: calc(100vh - 60px); display: flex; align-items: center; justify-content: center; padding: 32px 16px; }
.auth-card { background: var(--bg-white); border: 1px solid var(--border); border-radius: var(--radius); padding: 36px 32px; width: 100%; max-width: 420px; box-shadow: var(--shadow); }
.auth-logo { text-align: center; margin-bottom: 24px; }
.auth-logo .brand { font-size: 1.3rem; font-weight: 800; color: var(--primary); }
.auth-title { font-size: 1.25rem; font-weight: 700; margin-bottom: 6px; }
.auth-subtitle { font-size: .875rem; color: var(--text-muted); margin-bottom: 28px; }
.auth-footer { text-align: center; margin-top: 20px; font-size: .85rem; color: var(--text-muted); }
.divider { display: flex; align-items: center; gap: 10px; margin: 20px 0; color: var(--text-light); font-size: .8rem; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* ---- Profile ---- */
.profile-hero {
  background: linear-gradient(135deg, #1e40af, #2563eb);
  padding: 32px 0; color: #fff;
}
.profile-hero-inner { display: flex; gap: 20px; align-items: flex-end; }
.profile-avatar-lg { width: 80px; height: 80px; border-radius: 50%; background: rgba(255,255,255,.25); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 2rem; font-weight: 700; border: 3px solid rgba(255,255,255,.4); flex-shrink: 0; }
.profile-info h2 { font-size: 1.4rem; font-weight: 800; }
.profile-info p { opacity: .8; font-size: .875rem; margin-top: 4px; }
.profile-tabs { background: var(--bg-white); border-bottom: 1px solid var(--border); }
.tabs { display: flex; gap: 0; }
.tab-link {
  padding: 14px 20px; font-size: .9rem; font-weight: 500;
  color: var(--text-muted); border-bottom: 2px solid transparent;
  transition: color .2s, border-color .2s; cursor: pointer;
  text-decoration: none;
}
.tab-link:hover { color: var(--text); }
.tab-link.active { color: var(--primary); border-bottom-color: var(--primary); }

/* Profile Content */
.profile-content { display: grid; grid-template-columns: 220px 1fr; gap: 24px; padding: 24px 0; }
.profile-sidebar-card { background: var(--bg-white); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.profile-info-list li { padding: 10px 16px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; font-size: .85rem; }
.profile-info-list li:last-child { border-bottom: none; }
.profile-info-list .label { color: var(--text-muted); }
.profile-info-list .value { font-weight: 600; }

/* ---- Post Create ---- */
.editor-toolbar {
  display: flex; gap: 4px; flex-wrap: wrap;
  padding: 10px 12px; background: var(--bg);
  border: 1px solid var(--border); border-bottom: none;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}
.editor-btn {
  width: 32px; height: 32px; border: 1px solid var(--border);
  border-radius: 4px; background: var(--bg-white); cursor: pointer;
  font-size: .8rem; font-weight: 700; color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
  transition: all .15s;
}
.editor-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
#post-content {
  border-radius: 0 0 var(--radius-sm) var(--radius-sm) !important;
  min-height: 320px;
}

/* ---- Notice Bar ---- */
.notice { padding: 12px 16px; border-radius: var(--radius-sm); font-size: .875rem; margin-bottom: 14px; display: flex; align-items: flex-start; gap: 8px; }
.notice-info { background: #dbeafe; color: #1d4ed8; border: 1px solid #bfdbfe; }
.notice-warn { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }
.notice-success { background: #d1fae5; color: #065f46; border: 1px solid #a7f3d0; }

/* ---- Footer ---- */
.site-footer {
  background: #1e293b; color: #94a3b8;
  padding: 40px 0 20px; margin-top: 48px;
}
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 32px; margin-bottom: 32px; }
.footer-brand { font-size: 1.1rem; font-weight: 700; color: #fff; margin-bottom: 10px; }
.footer-desc { font-size: .85rem; line-height: 1.6; }
.footer-col h4 { font-size: .875rem; font-weight: 700; color: #e2e8f0; margin-bottom: 12px; }
.footer-col ul li { margin-bottom: 7px; }
.footer-col a { color: #94a3b8; font-size: .85rem; }
.footer-col a:hover { color: #fff; }
.footer-bottom { padding-top: 20px; border-top: 1px solid #334155; display: flex; justify-content: space-between; align-items: center; font-size: .8rem; flex-wrap: wrap; gap: 8px; }
.footer-bottom a { color: #64748b; }
.footer-bottom a:hover { color: #94a3b8; }

.reply-sub-actions .btn-text:hover { color: var(--primary); }

/* Inline reply form (appears under a comment when "回复" is clicked) */
.comment-reply-form {
  margin-top: 10px;
  padding: 12px;
  background: var(--bg);
  border-radius: 8px;
  border: 1px solid var(--border);
}
.comment-reply-form textarea {
  width: 100%; border: 1px solid var(--border); border-radius: 6px;
  padding: 8px 12px; font-size: .85rem; resize: vertical;
  min-height: 60px; background: var(--bg-white); color: var(--text);
  outline: none; transition: border-color .2s;
}
.comment-reply-form textarea:focus { border-color: var(--primary); }
.comment-reply-form-actions {
  display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px;
}

/* btn-reply (flat text-style reply button) */
.btn-reply {
  cursor: pointer; border: none; background: none;
  font-size: .78rem; color: var(--text-muted); padding: 0 6px;
  transition: color .2s;
}
.btn-reply:hover { color: var(--primary); }

/* ---- Utility ---- */
.text-muted { color: var(--text-muted); }
.text-sm { font-size: .85rem; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.justify-between { justify-content: space-between; }
.section-title { font-size: 1.05rem; font-weight: 700; margin-bottom: 14px; padding-bottom: 10px; border-bottom: 2px solid var(--border); display: flex; align-items: center; gap: 8px; }

/* ---- Responsive ---- */
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .cat-cards { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .profile-content { grid-template-columns: 1fr; }
  .post-list-header { display: none; }
  .post-item { grid-template-columns: 1fr; }
  .post-count, .post-views, .post-last { display: none; }
}
@media (max-width: 600px) {
  .hero h1 { font-size: 1.4rem; }
  .header-inner { gap: 12px; }
  .main-nav { display: none; }
  .footer-grid { grid-template-columns: 1fr; }
  .auth-card { padding: 24px 18px; }
}
