/* ========================================
   Campus Wall 校园墙 - 主样式表
   现代化校园风格，蓝绿主色调，移动端优先
   ======================================== */

/* ========== CSS 变量 ========== */
:root {
    --primary: #2E9B7B;
    --primary-dark: #258066;
    --primary-light: #E8F5F0;
    --primary-lighter: #F3FAF7;
    --secondary: #4A90D9;
    --accent: #F5A623;
    --danger: #E74C3C;
    --warning: #F39C12;
    --success: #27AE60;
    --info: #3498DB;

    --bg: #F7F8FA;
    --bg-white: #FFFFFF;
    --bg-card: #FFFFFF;
    --bg-hover: #F0F2F5;

    --text-primary: #1A1A2E;
    --text-secondary: #666666;
    --text-muted: #999999;
    --text-placeholder: #BBBBBB;

    --border: #E8ECF1;
    --border-light: #F0F2F5;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;

    --font-xs: 0.75rem;
    --font-sm: 0.875rem;
    --font-md: 1rem;
    --font-lg: 1.125rem;
    --font-xl: 1.25rem;
    --font-2xl: 1.5rem;

    --nav-height: 64px;
    --bottom-nav-height: 60px;
    --max-width: 768px;

    --transition: 0.2s ease;
}

/* ========== 基础重置 ========== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    background: var(--bg);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    padding-bottom: var(--bottom-nav-height);
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color var(--transition);
}

a:hover { color: var(--primary-dark); }

img { max-width: 100%; height: auto; }

button, input, textarea, select {
    font-family: inherit;
    font-size: inherit;
}

textarea { resize: vertical; }

/* ========== 顶部导航栏 ========== */
.navbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--bg-white);
    border-bottom: 1px solid var(--border);
    height: var(--nav-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    box-shadow: var(--shadow-sm);
}

.navbar-brand {
    font-size: var(--font-xl);
    font-weight: 700;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.navbar-brand .logo-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.2rem;
}

.navbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all var(--transition);
    position: relative;
}

.nav-btn:hover { background: var(--bg-hover); color: var(--primary); }

.nav-btn-danger { color: var(--danger); }
.nav-btn-danger:hover { background: #fde8e8; color: #c0392b; }

.nav-btn .badge {
    position: absolute;
    top: 2px;
    right: 2px;
    background: var(--danger);
    color: #fff;
    font-size: 10px;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    font-weight: 600;
}

/* ========== 底部导航栏 ========== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: var(--bg-white);
    border-top: 1px solid var(--border);
    height: var(--bottom-nav-height);
    display: flex;
    align-items: center;
    justify-content: space-around;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    color: var(--text-muted);
    font-size: var(--font-xs);
    cursor: pointer;
    transition: color var(--transition);
    position: relative;
    padding: 4px 12px;
    border: none;
    background: transparent;
}

.bottom-nav-item.active { color: var(--primary); }

.bottom-nav-item .nav-icon {
    font-size: 1.4rem;
    transition: transform var(--transition);
}

.bottom-nav-item.active .nav-icon { transform: scale(1.1); }

.bottom-nav-item.publish-btn {
    margin-top: -20px;
}

.bottom-nav-item.publish-btn .nav-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.6rem;
    box-shadow: 0 4px 15px rgba(46, 155, 123, 0.4);
}

/* ========== 容器 ========== */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 16px;
}

/* ========== 分类标签栏 ========== */
.category-tabs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 12px 0;
    scrollbar-width: none;
    -ms-overflow-style: none;
    flex-wrap: nowrap;
}

.category-tabs::-webkit-scrollbar { display: none; }

.category-tab {
    flex-shrink: 0;
    padding: 8px 16px;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: var(--bg-white);
    color: var(--text-secondary);
    font-size: var(--font-sm);
    cursor: pointer;
    white-space: nowrap;
    transition: all var(--transition);
}

.category-tab:hover { border-color: var(--primary); color: var(--primary); }

.category-tab.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(46, 155, 123, 0.3);
}

/* ========== 搜索栏 ========== */
.search-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.search-input {
    flex: 1;
    padding: 10px 16px;
    border-radius: 24px;
    border: 1px solid var(--border);
    background: var(--bg-white);
    font-size: var(--font-sm);
    outline: none;
    transition: border-color var(--transition);
}

.search-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }

.search-btn {
    padding: 10px 20px;
    border-radius: 24px;
    border: none;
    background: var(--primary);
    color: #fff;
    cursor: pointer;
    font-size: var(--font-sm);
    font-weight: 500;
    transition: background var(--transition);
}

.search-btn:hover { background: var(--primary-dark); }

/* ========== 帖子卡片 ========== */
.post-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    transition: all var(--transition);
    cursor: pointer;
}

.post-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.post-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.post-card-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--primary-light);
}

.post-card-meta {
    flex: 1;
}

.post-card-author {
    font-size: var(--font-sm);
    font-weight: 600;
    color: var(--text-primary);
}

.post-card-time {
    font-size: var(--font-xs);
    color: var(--text-muted);
}

.post-card-body { margin-bottom: 12px; }

.post-card-title {
    font-size: var(--font-lg);
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text-primary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-card-content {
    font-size: var(--font-sm);
    color: var(--text-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.5;
}

.post-card-images {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    margin-bottom: 12px;
}

.post-card-images img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: var(--radius-sm);
    background: var(--bg);
}

.post-card-images.single img {
    grid-column: span 3;
    aspect-ratio: 16/9;
    max-height: 300px;
}

.post-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 10px;
    border-top: 1px solid var(--border-light);
}

.post-card-stats {
    display: flex;
    gap: 16px;
    font-size: var(--font-xs);
    color: var(--text-muted);
}

.post-card-stat {
    display: flex;
    align-items: center;
    gap: 4px;
    transition: color var(--transition);
}

.post-card-stat.liked { color: var(--danger); }

/* ========== 分类标签 ========== */
.category-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: var(--font-xs);
    font-weight: 500;
    background: var(--primary-light);
    color: var(--primary);
}

.status-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 500;
}

.status-pending { background: #FFF3E0; color: #F57C00; }
.status-approved { background: #E8F5E9; color: #2E7D32; }
.status-rejected { background: #FFEBEE; color: #C62828; }

/* ========== 帖子详情 ========== */
.post-detail {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-sm);
}

.post-detail-header { margin-bottom: 16px; }

.post-detail-title {
    font-size: var(--font-2xl);
    font-weight: 700;
    margin-bottom: 12px;
    line-height: 1.3;
}

.post-detail-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
    font-size: var(--font-sm);
    color: var(--text-muted);
}

.post-detail-meta-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.post-detail-actions {
    display: flex;
    gap: 6px;
}

.action-btn {
    padding: 6px 12px;
    border-radius: 16px;
    border: 1px solid var(--border);
    background: var(--bg-white);
    color: var(--text-secondary);
    font-size: var(--font-xs);
    cursor: pointer;
    transition: all var(--transition);
    display: flex;
    align-items: center;
    gap: 4px;
}

.action-btn:hover { border-color: var(--primary); color: var(--primary); }
.action-btn.danger { color: var(--danger); border-color: var(--danger); }
.action-btn.danger:hover { background: var(--danger); color: #fff; }

.post-detail-content {
    font-size: var(--font-md);
    line-height: 1.8;
    color: var(--text-primary);
    white-space: pre-wrap;
    word-break: break-word;
}

.post-detail-images {
    margin: 16px 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 8px;
}

.post-detail-images img {
    width: 100%;
    border-radius: var(--radius-sm);
    cursor: pointer;
}

/* ========== 评论区 ========== */
.comments-section {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 20px;
    box-shadow: var(--shadow-sm);
}

.comments-title {
    font-size: var(--font-lg);
    font-weight: 600;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-light);
}

.comment-item {
    padding: 12px 0;
    border-bottom: 1px solid var(--border-light);
}

.comment-item:last-child { border-bottom: none; }

.comment-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.comment-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.comment-author {
    font-size: var(--font-sm);
    font-weight: 600;
}

.comment-time {
    font-size: var(--font-xs);
    color: var(--text-muted);
}

.comment-body {
    font-size: var(--font-sm);
    color: var(--text-primary);
    line-height: 1.6;
    margin-left: 40px;
}

.comment-actions {
    margin-left: 40px;
    margin-top: 4px;
    display: flex;
    gap: 12px;
}

.comment-action {
    font-size: var(--font-xs);
    color: var(--text-muted);
    cursor: pointer;
    background: none;
    border: none;
    transition: color var(--transition);
}

.comment-action:hover { color: var(--primary); }

.comment-reply {
    margin-left: 40px;
    padding-left: 12px;
    border-left: 2px solid var(--border);
}

.comment-form {
    display: flex;
    gap: 8px;
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--border-light);
}

.comment-input {
    flex: 1;
    padding: 10px 14px;
    border-radius: 20px;
    border: 1px solid var(--border);
    font-size: var(--font-sm);
    outline: none;
    transition: border-color var(--transition);
}

.comment-input:focus { border-color: var(--primary); }

.comment-submit {
    padding: 10px 20px;
    border-radius: 20px;
    border: none;
    background: var(--primary);
    color: #fff;
    font-size: var(--font-sm);
    font-weight: 500;
    cursor: pointer;
    transition: background var(--transition);
}

.comment-submit:hover { background: var(--primary-dark); }

/* ========== 按钮 ========== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    border-radius: 24px;
    border: none;
    font-size: var(--font-sm);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 2px 8px rgba(46, 155, 123, 0.3);
}

.btn-primary:hover { background: var(--primary-dark); color: #fff; }

.btn-secondary {
    background: var(--bg);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.btn-secondary:hover { background: var(--bg-hover); }

.btn-danger {
    background: var(--danger);
    color: #fff;
}

.btn-danger:hover { background: #c0392b; color: #fff; }

.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 1px solid var(--primary);
}

.btn-outline:hover { background: var(--primary-light); }

.btn-sm { padding: 6px 14px; font-size: var(--font-xs); border-radius: 16px; }
.btn-lg { padding: 14px 28px; font-size: var(--font-lg); }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* ========== 表单 ========== */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: var(--font-sm);
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.form-input, .form-textarea, .form-select {
    width: 100%;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    font-size: var(--font-sm);
    background: var(--bg-white);
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition);
    color: var(--text-primary);
}

.form-input:focus, .form-textarea:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.form-input::placeholder, .form-textarea::placeholder {
    color: var(--text-placeholder);
}

.form-textarea { min-height: 120px; }

.form-error {
    font-size: var(--font-xs);
    color: var(--danger);
    margin-top: 4px;
}

.form-hint {
    font-size: var(--font-xs);
    color: var(--text-muted);
    margin-top: 4px;
}

/* ========== 登录/注册页 ========== */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: stretch;
    background: var(--bg-white);
    padding: 0;
}

.auth-visual {
    width: 66.6667%;
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, var(--primary-light), #E3F2FD);
}

.auth-visual img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.auth-panel {
    width: 33.3333%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 24px;
    background: var(--bg-white);
}

.auth-card {
    width: 100%;
    max-width: 400px;
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 32px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.auth-logo {
    text-align: center;
    margin-bottom: 24px;
}

.auth-logo .logo-icon {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.8rem;
    margin-bottom: 12px;
}

.auth-logo h1 {
    font-size: var(--font-2xl);
    color: var(--primary);
    font-weight: 700;
}

.auth-link {
    text-align: center;
    margin-top: 16px;
    font-size: var(--font-sm);
    color: var(--text-muted);
}

/* ========== 个人中心 ========== */
.profile-header {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: var(--radius-lg);
    padding: 24px;
    color: #fff;
    text-align: center;
    margin-bottom: 16px;
}

.profile-avatar-wrap {
    position: relative;
    width: 80px;
    height: 80px;
    margin: 0 auto 12px;
}

.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(255,255,255,0.4);
    background: rgba(255,255,255,0.2);
}

.profile-avatar-edit {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #fff;
    color: var(--primary);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
}

.profile-name {
    font-size: var(--font-xl);
    font-weight: 600;
}

.profile-email {
    font-size: var(--font-sm);
    opacity: 0.8;
}

.profile-stats {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-top: 16px;
}

.profile-stat-item {
    text-align: center;
}

.profile-stat-num {
    font-size: var(--font-xl);
    font-weight: 700;
}

.profile-stat-label {
    font-size: var(--font-xs);
    opacity: 0.8;
}

.profile-menu {
    background: var(--bg-white);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.profile-menu-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-light);
    cursor: pointer;
    transition: background var(--transition);
    font-size: var(--font-sm);
    color: var(--text-primary);
    text-decoration: none;
}

.profile-menu-item:last-child { border-bottom: none; }

.profile-menu-item:hover { background: var(--bg-hover); }

.profile-menu-item .menu-icon {
    font-size: 1.2rem;
    margin-right: 12px;
    width: 24px;
    text-align: center;
}

.profile-menu-item .menu-right {
    color: var(--text-muted);
    font-size: var(--font-xs);
}

/* ========== 管理后台 ========== */
/* 首页底部管理入口（仅管理员可见） */
.admin-entry-wrap {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 16px 12px;
    width: 100%;
    box-sizing: border-box;
}

.admin-entry {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #fff;
    border-radius: var(--radius-md);
    text-decoration: none;
    font-weight: 600;
    font-size: var(--font-sm);
    box-shadow: var(--shadow-md);
    transition: transform var(--transition), box-shadow var(--transition);
}

.admin-entry:hover { transform: translateY(-1px); box-shadow: var(--shadow-lg); }

.admin-entry-icon { font-size: 1.2rem; }
.admin-entry-text { flex: 1; }
.admin-entry-arrow { font-size: 1.3rem; opacity: .8; }

.admin-layout {
    display: flex;
    min-height: 100vh;
}

.admin-sidebar {
    width: 240px;
    background: var(--text-primary);
    color: #fff;
    padding: 20px 0;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    overflow-y: auto;
}

.admin-sidebar-brand {
    padding: 0 20px 20px;
    font-size: var(--font-xl);
    font-weight: 700;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    margin-bottom: 12px;
    color: var(--primary);
}

.admin-sidebar-menu { list-style: none; }

.admin-sidebar-item a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    color: rgba(255,255,255,0.7);
    font-size: var(--font-sm);
    transition: all var(--transition);
}

.admin-sidebar-item a:hover,
.admin-sidebar-item a.active {
    background: rgba(255,255,255,0.08);
    color: #fff;
}

.admin-main {
    margin-left: 240px;
    flex: 1;
    padding: 24px;
    background: var(--bg);
    min-height: 100vh;
}

.admin-page-title {
    font-size: var(--font-2xl);
    font-weight: 700;
    margin-bottom: 20px;
}

/* ========== 统计卡片 ========== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-white);
    border-radius: var(--radius-md);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 16px;
}

.stat-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.stat-card-icon.primary { background: var(--primary-light); color: var(--primary); }
.stat-card-icon.warning { background: #FFF3E0; color: var(--warning); }
.stat-card-icon.danger { background: #FFEBEE; color: var(--danger); }
.stat-card-icon.info { background: #E3F2FD; color: var(--info); }

.stat-card-value {
    font-size: var(--font-2xl);
    font-weight: 700;
}

.stat-card-label {
    font-size: var(--font-xs);
    color: var(--text-muted);
}

/* ========== 表格 ========== */
.table-wrapper {
    background: var(--bg-white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--font-sm);
}

th, td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-light);
}

th {
    background: var(--bg);
    font-weight: 600;
    color: var(--text-secondary);
    font-size: var(--font-xs);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

tr:hover td { background: var(--bg-hover); }

/* ========== Toast提示 ========== */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    color: #fff;
    font-size: var(--font-sm);
    box-shadow: var(--shadow-md);
    animation: slideInRight 0.3s ease;
    max-width: 360px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.toast-success { background: var(--success); }
.toast-error { background: var(--danger); }
.toast-warning { background: var(--warning); }
.toast-info { background: var(--info); }

@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ========== 模态框 ========== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.2s ease;
}

.modal {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 480px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: scaleIn 0.2s ease;
}

.modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title {
    font-size: var(--font-lg);
    font-weight: 600;
}

.modal-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: var(--bg);
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-body { padding: 20px; }

.modal-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border-light);
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes scaleIn { from { transform: scale(0.95); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* ========== 加载 ========== */
.loading-spinner {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: var(--text-muted);
}

.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.load-more {
    text-align: center;
    padding: 20px;
    color: var(--text-muted);
    font-size: var(--font-sm);
}

/* ========== 空状态 ========== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state .empty-icon {
    font-size: 3rem;
    margin-bottom: 12px;
    opacity: 0.5;
}

.empty-state p { font-size: var(--font-sm); }

/* ========== 图片预览 ========== */
.image-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 8px;
    margin-top: 8px;
}

.image-preview-item {
    position: relative;
    border-radius: var(--radius-sm);
    overflow: hidden;
    aspect-ratio: 1;
}

.image-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-preview-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(0,0,0,0.5);
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
}

/* ========== 响应式 ========== */
/* 移动端/桌面端显隐 */
.mobile-only { display: block; }
.desktop-only { display: none; }

@media (min-width: 769px) {
    .mobile-only { display: none; }
    .desktop-only { display: block; }
    .desktop-only.desktop-layout { display: flex; }
    .navbar-actions.desktop-only { display: flex; }
    body { padding-bottom: 0; }
    .bottom-nav { display: none; }

    /* 桌面端容器最大宽度 */
    .container {
        max-width: 1200px;
        padding: 24px 32px;
    }

    /* 桌面端首页双栏布局 */
    .desktop-layout {
        display: flex;
        gap: 24px;
        align-items: flex-start;
    }

    .desktop-sidebar {
        width: 240px;
        flex-shrink: 0;
        position: sticky;
        top: calc(var(--nav-height) + 24px);
    }

    .desktop-main {
        flex: 1;
        min-width: 0;
    }

    /* 桌面端帖子网格 */
    .desktop-posts-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    .desktop-posts-grid .post-card {
        margin-bottom: 0;
    }

    /* 桌面端侧边栏卡片 */
    .sidebar-card {
        background: var(--bg-white);
        border-radius: var(--radius-md);
        padding: 16px;
        margin-bottom: 16px;
        box-shadow: var(--shadow-sm);
    }

    .sidebar-card-title {
        font-size: var(--font-sm);
        font-weight: 600;
        color: var(--text-secondary);
        margin-bottom: 12px;
        padding-bottom: 8px;
        border-bottom: 1px solid var(--border-light);
    }

    .sidebar-user {
        display: flex;
        align-items: center;
        gap: 10px;
        margin-bottom: 12px;
    }

    .sidebar-user-avatar {
        width: 40px;
        height: 40px;
        border-radius: 50%;
        object-fit: cover;
    }

    .sidebar-user-name {
        font-weight: 600;
        font-size: var(--font-sm);
    }

    .sidebar-user-info {
        font-size: var(--font-xs);
        color: var(--text-muted);
    }

    /* 桌面端分类列表 */
    .sidebar-category-list { list-style: none; }

    .sidebar-category-item {
        display: block;
        padding: 10px 14px;
        border-radius: var(--radius-sm);
        color: var(--text-secondary);
        font-size: var(--font-sm);
        cursor: pointer;
        transition: all var(--transition);
        margin-bottom: 4px;
        text-decoration: none;
    }

    .sidebar-category-item:hover {
        background: var(--bg-hover);
        color: var(--primary);
    }

    .sidebar-category-item.active {
        background: var(--primary-light);
        color: var(--primary);
        font-weight: 600;
    }

    /* 桌面端热门标签 */
    .sidebar-tags {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
    }

    .sidebar-tag {
        padding: 4px 12px;
        border-radius: 14px;
        background: var(--bg);
        color: var(--text-secondary);
        font-size: var(--font-xs);
        cursor: pointer;
        text-decoration: none;
        transition: all var(--transition);
    }

    .sidebar-tag:hover {
        background: var(--primary-light);
        color: var(--primary);
    }

    /* 桌面端搜索更宽 */
    .desktop-search {
        display: flex;
        gap: 8px;
        margin-bottom: 20px;
    }

    .desktop-search .search-input {
        max-width: 480px;
    }
}

@media (max-width: 768px) {
    .admin-sidebar {
        transform: translateX(-100%);
        transition: transform var(--transition);
        z-index: 1500;
    }

    .admin-sidebar.open { transform: translateX(0); }

    .admin-main { margin-left: 0; padding: 16px; }

    .admin-mobile-toggle {
        display: block;
        position: fixed;
        top: 12px;
        left: 12px;
        z-index: 1501;
        width: 40px;
        height: 40px;
        border-radius: 50%;
        background: var(--primary);
        color: #fff;
        border: none;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.2rem;
        box-shadow: var(--shadow-md);
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .post-detail-title {
        font-size: var(--font-xl);
    }

    /* 登录/注册页移动端单列 */
    .auth-page {
        align-items: center;
        justify-content: center;
        padding: 20px;
        background: linear-gradient(135deg, var(--primary-light), #E3F2FD);
    }

    .auth-visual { display: none; }

    .auth-panel {
        width: 100%;
        padding: 0;
        background: transparent;
    }

    .auth-card {
        box-shadow: var(--shadow-lg);
        border: none;
    }
}

@media (min-width: 769px) {
    .admin-mobile-toggle { display: none; }
    .admin-sidebar { transform: none !important; }
}

/* ========== 工具栏 ========== */
.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.toolbar-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ========== 发布页面 ========== */
.publish-form {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 20px;
}

.publish-form .form-group {
    margin-bottom: 20px;
}

.image-upload-area {
    border: 2px dashed var(--border);
    border-radius: var(--radius-md);
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: border-color var(--transition);
    background: var(--bg);
}

.image-upload-area:hover { border-color: var(--primary); }

.image-upload-area input[type="file"] { display: none; }

.image-upload-hint {
    color: var(--text-muted);
    font-size: var(--font-sm);
}

/* ========== 通知列表 ========== */
.notification-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    background: var(--bg-white);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    cursor: pointer;
    transition: background var(--transition);
    border-left: 3px solid transparent;
}

.notification-item:hover { background: var(--bg-hover); }
.notification-item.unread {
    background: var(--primary-lighter);
    border-left-color: var(--primary);
}

.notification-icon {
    font-size: 1.4rem;
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    border-radius: 50%;
}

.notification-body { flex: 1; }

.notification-title {
    font-size: var(--font-sm);
    font-weight: 500;
    margin-bottom: 2px;
}

.notification-content {
    font-size: var(--font-xs);
    color: var(--text-muted);
}

.notification-time {
    font-size: 11px;
    color: var(--text-muted);
    flex-shrink: 0;
}

/* ========== 分页 ========== */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
}

.pagination-btn {
    padding: 8px 16px;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: var(--bg-white);
    color: var(--text-secondary);
    font-size: var(--font-sm);
    cursor: pointer;
    transition: all var(--transition);
}

.pagination-btn:hover { border-color: var(--primary); color: var(--primary); }
.pagination-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.pagination-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ========================================
   通知轮播（green/yellow）
   ======================================== */
.notice-carousel {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-md);
    margin-bottom: 12px;
    box-shadow: var(--shadow-sm);
}

.notice-track {
    display: flex;
    transition: transform 0.5s ease;
}

.notice-slide {
    flex: 0 0 100%;
    min-width: 100%;
    padding: 10px 14px;
    font-size: 0.85rem;
    line-height: 1.5;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.notice-green { background: #E8F5E9; color: #1B5E20; }
.notice-yellow { background: #FFF8E1; color: #7A5B00; }

.desktop-notice-carousel { margin-bottom: 14px; }

.notice-dots {
    display: flex;
    justify-content: center;
    gap: 6px;
    padding: 6px 0;
    background: rgba(255,255,255,0.6);
}

.notice-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #CCCCCC;
    transition: all 0.3s;
}

.notice-dot.active { background: var(--primary); width: 14px; border-radius: 3px; }

/* ========================================
   校园投票
   ======================================== */
.vote-card-title {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.vote-card-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 10px;
    line-height: 1.5;
}

.vote-options { display: flex; flex-direction: column; gap: 8px; }

.vote-option {
    position: relative;
    display: block;
    width: 100%;
    text-align: left;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 9px 12px;
    background: var(--bg-white);
    cursor: pointer;
    overflow: hidden;
    transition: all 0.2s;
}

.vote-option:hover:not(:disabled) { border-color: var(--primary); }
.vote-option:disabled { cursor: default; }
.vote-option-voted { border-color: var(--primary); background: var(--primary-light); }

.vote-option-text {
    position: relative;
    z-index: 2;
    font-size: 0.85rem;
    color: var(--text-primary);
    font-weight: 500;
}

.vote-option-bar {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    background: var(--primary-light);
    z-index: 1;
    transition: width 0.4s ease;
}

.vote-option-voted .vote-option-bar { background: #D3EBE2; }

.vote-option-stat {
    position: relative;
    z-index: 2;
    float: right;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.vote-card-footer {
    margin-top: 10px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* 移动端投票折叠 */
.mobile-vote-wrap { margin-bottom: 10px; }

.mobile-vote-card {
    background: var(--bg-white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.mobile-vote-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    background: linear-gradient(135deg, var(--primary-light), #E3F2FD);
}

.mobile-vote-body-pad { padding: 0 14px 14px; }
#mobile-vote-body { padding: 0 14px 14px; }

.mobile-topic-entry {
    display: block;
    background: linear-gradient(135deg, #FFF3E0, #FFEBEE);
    color: #8D4E00;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    margin-bottom: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    box-shadow: var(--shadow-sm);
}

/* ========================================
   本周话题（桌面小卡）
   ======================================== */
.topic-mini-title {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.topic-mini-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ========================================
   后台管理扩展（投票/通知/话题/置顶）
   ======================================== */
.admin-tip {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.admin-sub {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 400;
    line-height: 1.5;
}

.notice-cell {
    max-width: 260px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.notice-level-green { background: #E8F5E9; color: #1B5E20; }
.notice-level-yellow { background: #FFF8E1; color: #7A5B00; }
.notice-level-red { background: #FDECEA; color: #C62828; }

.vote-option-row {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
    align-items: center;
}

.vote-option-row .vote-opt-text { flex: 1; }
.vote-opt-del { flex-shrink: 0; }

.pin-row-active { background: var(--primary-lighter); }

.vote-editor-form { max-height: 60vh; overflow-y: auto; padding-right: 4px; }
