*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", sans-serif; background: #f0f2f5; color: #333; line-height: 1.6; min-height: 100vh; }
a { color: #1890ff; text-decoration: none; }
a:hover { color: #40a9ff; }

/* Login page */
.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
.login-card { background: #fff; border-radius: 12px; padding: 40px 36px; width: 380px; max-width: 90vw; box-shadow: 0 20px 60px rgba(0,0,0,0.15); text-align: center; }
.login-icon { font-size: 48px; margin-bottom: 8px; }
.login-card h1 { font-size: 22px; margin-bottom: 4px; color: #1a1a2e; }
.login-card p { color: #888; margin-bottom: 24px; font-size: 14px; }
.login-card input { display: block; width: 100%; padding: 12px 14px; margin-bottom: 14px; border: 1px solid #d9d9d9; border-radius: 8px; font-size: 15px; transition: border-color 0.2s; }
.login-card input:focus { border-color: #667eea; outline: none; box-shadow: 0 0 0 2px rgba(102,126,234,0.15); }
.login-card button { width: 100%; padding: 12px; background: #667eea; color: #fff; border: none; border-radius: 8px; font-size: 16px; cursor: pointer; transition: background 0.2s; }
.login-card button:hover { background: #5a6fd6; }
.msg { padding: 10px; border-radius: 6px; margin-bottom: 16px; font-size: 14px; }
.msg.error { background: #fff2f0; color: #ff4d4f; border: 1px solid #ffccc7; }
.msg.success { background: #f6ffed; color: #52c41a; border: 1px solid #b7eb8f; }
.msg.warning { background: #fffbe6; color: #d48806; border: 1px solid #ffe58f; }
.register-link { margin-top: 16px; font-size: 14px; color: #888; }
.register-link a { color: #667eea; font-weight: 500; }

/* Navbar */
.navbar { background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,0.08); position: sticky; top: 0; z-index: 100; }
.nav-inner { max-width: 900px; margin: 0 auto; padding: 0 20px; display: flex; align-items: center; justify-content: space-between; height: 56px; }
.brand { font-weight: 700; font-size: 18px; color: #1a1a2e; }
.nav-user { display: flex; align-items: center; gap: 16px; font-size: 14px; color: #666; }
.btn-logout { color: #999; font-size: 13px; }
.btn-logout:hover { color: #ff4d4f; }
.btn-approvals { color: #667eea; font-size: 13px; font-weight: 500; }
.btn-approvals:hover { color: #5a6fd6; }

/* Container */
.container { max-width: 900px; margin: 0 auto; padding: 24px 20px; }

/* Forum header */
.forum-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.forum-header h2 { font-size: 22px; color: #1a1a2e; }
.btn-primary { display: inline-flex; align-items: center; gap: 6px; padding: 10px 20px; background: #667eea; color: #fff; border: none; border-radius: 8px; font-size: 14px; cursor: pointer; text-decoration: none; transition: background 0.2s; }
.btn-primary:hover { background: #5a6fd6; color: #fff; }
.btn-cancel { display: inline-flex; align-items: center; padding: 10px 20px; background: #f5f5f5; color: #666; border: 1px solid #d9d9d9; border-radius: 8px; font-size: 14px; cursor: pointer; text-decoration: none; }
.btn-cancel:hover { background: #e8e8e8; }

/* Post list */
.post-list { display: flex; flex-direction: column; gap: 2px; }
.post-item { background: #fff; padding: 20px 24px; border-radius: 8px; box-shadow: 0 1px 2px rgba(0,0,0,0.04); transition: box-shadow 0.2s; }
.post-item:hover { box-shadow: 0 2px 12px rgba(0,0,0,0.08); }
.post-title { font-size: 17px; font-weight: 600; color: #1a1a2e; display: block; margin-bottom: 6px; }
.post-title:hover { color: #667eea; }
.post-meta { font-size: 13px; color: #999; margin-bottom: 8px; }
.post-excerpt { font-size: 14px; color: #666; line-height: 1.5; }
.empty-state { text-align: center; padding: 60px 20px; color: #bbb; }
.empty-state i { font-size: 48px; display: block; margin-bottom: 12px; }

/* Post detail */
.post-detail { background: #fff; padding: 28px; border-radius: 8px; box-shadow: 0 1px 2px rgba(0,0,0,0.04); margin-bottom: 24px; }
.post-detail h2 { font-size: 22px; color: #1a1a2e; margin-bottom: 8px; }
.post-content { margin-top: 16px; font-size: 15px; line-height: 1.8; color: #333; }

/* Replies */
.replies-section { margin-top: 24px; }
.replies-section h3 { font-size: 17px; margin-bottom: 16px; color: #1a1a2e; }
.reply-item { background: #fff; padding: 18px 20px; border-radius: 8px; margin-bottom: 8px; box-shadow: 0 1px 2px rgba(0,0,0,0.04); }
.reply-meta { font-size: 13px; color: #999; margin-bottom: 6px; }
.reply-content { font-size: 14px; color: #444; line-height: 1.7; }
.empty-reply { text-align: center; padding: 24px; color: #bbb; font-size: 14px; }
.reply-form { background: #fff; padding: 24px; border-radius: 8px; margin-top: 20px; box-shadow: 0 1px 2px rgba(0,0,0,0.04); }
.reply-form h4 { font-size: 15px; margin-bottom: 12px; color: #333; }
.reply-form textarea { width: 100%; padding: 12px; border: 1px solid #d9d9d9; border-radius: 8px; font-size: 14px; font-family: inherit; resize: vertical; }
.reply-form textarea:focus { border-color: #667eea; outline: none; box-shadow: 0 0 0 2px rgba(102,126,234,0.15); }
.reply-form button { margin-top: 10px; }

/* Form card */
.form-card { background: #fff; padding: 28px; border-radius: 8px; box-shadow: 0 1px 2px rgba(0,0,0,0.04); }
.form-card h2 { margin-bottom: 20px; font-size: 20px; color: #1a1a2e; }
.form-card input[type="text"], .form-card textarea { display: block; width: 100%; padding: 12px; margin-bottom: 14px; border: 1px solid #d9d9d9; border-radius: 8px; font-size: 15px; font-family: inherit; }
.form-card input[type="text"]:focus, .form-card textarea:focus { border-color: #667eea; outline: none; box-shadow: 0 0 0 2px rgba(102,126,234,0.15); }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; }

/* Approval table */
.approval-table { background: #fff; border-radius: 8px; box-shadow: 0 1px 2px rgba(0,0,0,0.04); overflow: hidden; }
.approval-table table { width: 100%; border-collapse: collapse; }
.approval-table th { background: #fafafa; padding: 12px 16px; text-align: left; font-size: 13px; color: #888; font-weight: 600; border-bottom: 1px solid #f0f0f0; }
.approval-table td { padding: 14px 16px; font-size: 14px; border-bottom: 1px solid #f0f0f0; }
.approval-table tr:last-child td { border-bottom: none; }
.approval-table .actions { white-space: nowrap; }
.btn-approve { display: inline-flex; align-items: center; gap: 4px; padding: 6px 14px; background: #52c41a; color: #fff; border: none; border-radius: 6px; font-size: 13px; cursor: pointer; transition: background 0.2s; }
.btn-approve:hover { background: #49ad17; }
.btn-reject { display: inline-flex; align-items: center; gap: 4px; padding: 6px 14px; background: #ff4d4f; color: #fff; border: none; border-radius: 6px; font-size: 13px; cursor: pointer; transition: background 0.2s; }
.btn-reject:hover { background: #e04345; }

/* Responsive */
@media (max-width: 600px) {
  .container { padding: 16px 12px; }
  .post-item { padding: 16px; }
  .post-detail { padding: 20px; }
  .nav-inner { padding: 0 12px; }
  .brand { font-size: 15px; }
  .approval-table th, .approval-table td { padding: 10px 12px; font-size: 13px; }
  .approval-table .actions form { display: block; margin: 4px 0; }
}

/* Guest styles */
.guest-badge { background: #fff7e6; color: #d48806; font-size: 11px; padding: 2px 6px; border-radius: 4px; margin-left: 4px; font-weight: 500; }
.btn-login { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; background: #fff; color: #666; border: 1px solid #d9d9d9; border-radius: 8px; font-size: 13px; cursor: pointer; text-decoration: none; transition: all 0.2s; }
.btn-login:hover { background: #f5f5f5; color: #333; border-color: #bbb; }
.guest-tip { margin-top: 14px; font-size: 13px; color: #888; padding: 10px 14px; background: #f9fafb; border-radius: 6px; border-left: 3px solid #667eea; }
.guest-tip i { color: #667eea; margin-right: 6px; }
