/* ============================================
   校园论坛 - 高级深色玻璃拟态风格
   ============================================ */

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* 深色背景 */
    --bg-primary: #0a0a0f;
    --bg-gradient-1: #0c0c15;
    --bg-gradient-2: #151520;
    --bg-gradient-3: #1a1525;

    /* 玻璃层级 */
    --glass-1: rgba(255, 255, 255, 0.085);
    --glass-2: rgba(255, 255, 255, 0.055);
    --glass-3: rgba(255, 255, 255, 0.035);

    /* 边框 */
    --border-1: rgba(255, 255, 255, 0.14);
    --border-2: rgba(255, 255, 255, 0.08);

    /* 文字 */
    --text-primary: rgba(255, 255, 255, 0.95);
    --text-secondary: rgba(255, 255, 255, 0.62);
    --text-tertiary: rgba(255, 255, 255, 0.38);
    --text-muted: rgba(255, 255, 255, 0.22);

    /* 强调色 - 克制的高级蓝 */
    --accent: #5b8def;
    --accent-soft: rgba(91, 141, 239, 0.15);
    --accent-glow: rgba(91, 141, 239, 0.35);

    /* 功能色 */
    --danger: #ff6b6b;
    --danger-soft: rgba(255, 107, 107, 0.12);
    --success: #5dd879;
    --warning: #f5c75d;

    /* 圆角 */
    --radius-xs: 8px;
    --radius-sm: 12px;
    --radius-md: 16px;
    --radius-lg: 22px;
    --radius-xl: 28px;
    --radius-full: 9999px;

    /* 字体 */
    --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
            "Helvetica Neue", "PingFang SC", "Noto Sans SC", "Microsoft YaHei",
            sans-serif;

    /* 阴影 */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.25);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.35);
    --shadow-glass: 0 8px 32px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255,255,255,0.08);

    --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font);
    color: var(--text-primary);
    background: var(--bg-primary);
    min-height: 100vh;
    line-height: 1.55;
}

/* 深色渐变背景 */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 50% at 20% 40%, rgba(91, 141, 239, 0.12), transparent 55%),
        radial-gradient(ellipse 60% 40% at 80% 70%, rgba(139, 92, 246, 0.1), transparent 50%),
        radial-gradient(ellipse 100% 60% at 50% 0%, rgba(255, 255, 255, 0.03), transparent 50%),
        linear-gradient(180deg, var(--bg-gradient-1) 0%, var(--bg-gradient-2) 50%, var(--bg-gradient-3) 100%);
    z-index: -2;
}

/* 噪点纹理 */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    opacity: 0.025;
    z-index: -1;
    pointer-events: none;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
}

.app {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ---------- 头部 ---------- */
.header {
    padding: 14px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(10, 10, 15, 0.65);
    backdrop-filter: blur(24px) saturate(160%);
    -webkit-backdrop-filter: blur(24px) saturate(160%);
    border-bottom: 1px solid var(--border-2);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text-primary);
}

.logo-mark {
    width: 34px;
    height: 34px;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, rgba(91,141,239,0.9), rgba(139,92,246,0.85));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 14px;
    color: #fff;
    box-shadow: 0 2px 12px rgba(91, 141, 239, 0.3);
}

.logo-text {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.3px;
}

.nav {
    display: flex;
    align-items: center;
    gap: 10px;
}

.search-form {
    display: flex;
    align-items: center;
    background: var(--glass-2);
    border: 1px solid var(--border-2);
    border-radius: var(--radius-full);
    padding: 0 4px 0 14px;
    transition: all var(--transition);
}

.search-form:focus-within {
    background: var(--glass-1);
    border-color: var(--border-1);
}

.search-input {
    border: none;
    background: transparent;
    padding: 8px 0;
    font-size: 14px;
    font-family: var(--font);
    color: var(--text-primary);
    outline: none;
    width: 120px;
}

.search-input::placeholder {
    color: var(--text-tertiary);
}

.search-btn {
    border: none;
    background: transparent;
    padding: 8px 10px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: color var(--transition);
}

.search-btn:hover {
    color: var(--text-primary);
}

/* ---------- 按钮 ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    border: 1px solid transparent;
    border-radius: var(--radius-full);
    font-size: 14px;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    text-decoration: none;
    transition: all var(--transition);
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    white-space: nowrap;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 2px 12px rgba(91, 141, 239, 0.25);
}

.btn-primary:hover {
    background: #6b9cf5;
    box-shadow: 0 4px 16px rgba(91, 141, 239, 0.35);
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: scale(0.98);
}

.btn-glass {
    background: var(--glass-2);
    color: var(--text-primary);
    border-color: var(--border-2);
}

.btn-glass:hover {
    background: var(--glass-1);
    border-color: var(--border-1);
}

.btn-glass:active {
    transform: scale(0.98);
}

.btn-danger {
    background: var(--danger-soft);
    color: var(--danger);
    border-color: rgba(255, 107, 107, 0.2);
}

.btn-danger:hover {
    background: rgba(255, 107, 107, 0.18);
}

.btn-sm {
    padding: 5px 12px;
    font-size: 12px;
}

.btn-lg {
    padding: 12px 24px;
    font-size: 15px;
}

.btn-block {
    width: 100%;
}

.btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

/* ---------- 主体 ---------- */
.main {
    flex: 1;
    padding: 28px 0 100px;
}

/* ---------- 页头 ---------- */
.page-header {
    margin-bottom: 28px;
    padding: 0 4px;
}

.page-title {
    font-size: 32px;
    font-weight: 800;
    letter-spacing: -1px;
    color: var(--text-primary);
    line-height: 1.2;
}

.page-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 8px;
}

.page-subtitle .link {
    color: var(--accent);
    text-decoration: none;
    margin-left: 8px;
}

.search-keyword {
    background: var(--accent-soft);
    color: var(--accent);
    padding: 2px 10px;
    border-radius: var(--radius-full);
    font-weight: 600;
}

/* ---------- 玻璃卡片 ---------- */
.glass-card {
    background: var(--glass-1);
    backdrop-filter: blur(24px) saturate(160%);
    -webkit-backdrop-filter: blur(24px) saturate(160%);
    border: 1px solid var(--border-1);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-glass);
}

/* ---------- 帖子列表 ---------- */
.post-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.post-card {
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--transition);
}

.post-card:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.1);
    box-shadow: var(--shadow-lg), var(--shadow-glass);
}

.post-card-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.post-card-body {
    padding: 22px 24px 14px;
}

.post-card-title {
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -0.2px;
    margin-bottom: 8px;
    line-height: 1.35;
    color: var(--text-primary);
}

.post-card-excerpt {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.55;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-card-meta {
    padding: 12px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 12px;
    color: var(--text-tertiary);
    border-top: 1px solid var(--border-2);
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.meta-author {
    color: var(--text-secondary);
    font-weight: 500;
}

.avatar-sm {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, rgba(91,141,239,0.8), rgba(139,92,246,0.7));
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    margin-right: 4px;
}

.badge {
    display: inline-block;
    font-size: 10px;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-weight: 600;
    letter-spacing: 0.3px;
    margin-left: 6px;
}

.badge-user {
    background: var(--accent-soft);
    color: var(--accent);
}

.badge-guest {
    background: var(--glass-3);
    color: var(--text-tertiary);
}

/* ---------- 帖子详情 ---------- */
.post-detail {
    padding: 32px;
    margin-bottom: 16px;
}

.post-detail-title {
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -0.5px;
    line-height: 1.25;
    margin-bottom: 16px;
}

.post-detail-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 13px;
    color: var(--text-tertiary);
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-2);
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.post-detail-content {
    font-size: 15px;
    line-height: 1.75;
    color: var(--text-primary);
}

.post-detail-content pre {
    background: rgba(0, 0, 0, 0.25);
    padding: 16px;
    border-radius: var(--radius-sm);
    overflow-x: auto;
    margin: 16px 0;
    font-size: 13px;
    border: 1px solid var(--border-2);
}

.post-detail-content code {
    background: rgba(255, 255, 255, 0.08);
    padding: 2px 7px;
    border-radius: var(--radius-xs);
    font-size: 13px;
}

.post-detail-content pre code {
    background: none;
    padding: 0;
}

.post-detail-content strong {
    font-weight: 700;
    color: var(--text-primary);
}

.post-detail-content a {
    color: var(--accent);
    text-decoration: none;
}

.post-detail-content a:hover {
    text-decoration: underline;
}

.post-detail-content ul, .post-detail-content ol {
    padding-left: 26px;
    margin: 12px 0;
}

.post-detail-actions {
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid var(--border-2);
    display: flex;
    gap: 10px;
}

/* ---------- 评论区 ---------- */
.comments-section {
    padding: 24px 32px;
}

.comments-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.comment-list {
    display: flex;
    flex-direction: column;
}

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

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

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

.comment-author {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
}

.comment-time {
    font-size: 12px;
    color: var(--text-tertiary);
}

.comment-content {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-primary);
    padding-left: 32px;
}

.comment-content code {
    background: rgba(255, 255, 255, 0.08);
    padding: 2px 6px;
    border-radius: var(--radius-xs);
    font-size: 13px;
}

.comment-content pre {
    background: rgba(0, 0, 0, 0.25);
    padding: 14px;
    border-radius: var(--radius-sm);
    overflow-x: auto;
    margin: 10px 0;
    border: 1px solid var(--border-2);
}

.comment-actions {
    margin-left: auto;
}

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

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 7px;
    padding-left: 4px;
}

.form-input, .form-textarea, .form-select {
    width: 100%;
    padding: 13px 18px;
    border: 1px solid var(--border-2);
    border-radius: var(--radius-md);
    background: var(--glass-2);
    font-size: 15px;
    font-family: var(--font);
    color: var(--text-primary);
    transition: all var(--transition);
    outline: none;
}

.form-input:focus, .form-textarea:focus, .form-select:focus {
    border-color: var(--accent);
    background: var(--glass-1);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.form-textarea {
    resize: vertical;
    min-height: 120px;
    line-height: 1.6;
}

.form-hint {
    font-size: 13px;
    color: var(--text-tertiary);
    margin-top: 4px;
    padding-left: 4px;
}

.char-count {
    font-size: 11px;
    color: var(--text-tertiary);
    text-align: right;
    margin-top: 4px;
}

/* ---------- 空状态 ---------- */
.empty-state {
    text-align: center;
    padding: 80px 20px;
}

.empty-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 20px;
    border-radius: var(--radius-lg);
    background: var(--glass-2);
    border: 1px solid var(--border-2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-tertiary);
    font-size: 24px;
    font-weight: 300;
}

.empty-state h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 6px;
    color: var(--text-primary);
}

.empty-state p {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

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

.page-btn {
    padding: 8px 14px;
    border-radius: var(--radius-full);
    background: var(--glass-2);
    border: 1px solid var(--border-2);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all var(--transition);
}

.page-btn:hover {
    background: var(--glass-1);
    color: var(--text-primary);
}

.page-btn.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.page-dots {
    color: var(--text-tertiary);
    padding: 0 4px;
}

/* ---------- 浮动按钮 ---------- */
.floating-actions {
    position: fixed;
    bottom: 28px;
    right: 28px;
    z-index: 50;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 12px;
}

.fab {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border-radius: var(--radius-full);
    background: var(--glass-1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--border-1);
    color: var(--text-primary);
    font-size: 18px;
    text-decoration: none;
    box-shadow: var(--shadow-lg);
    transition: all var(--transition);
    -webkit-tap-highlight-color: transparent;
}

.fab:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    transform: scale(1.06);
}

.fab:active {
    transform: scale(0.96);
}

.fab svg {
    width: 22px;
    height: 22px;
}

/* ---------- Toast ---------- */
.toast-container {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.toast {
    padding: 12px 22px;
    border-radius: var(--radius-full);
    background: var(--glass-1);
    backdrop-filter: blur(24px) saturate(160%);
    -webkit-backdrop-filter: blur(24px) saturate(160%);
    border: 1px solid var(--border-1);
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    animation: toastIn 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    pointer-events: auto;
}

.toast.success { color: var(--success); border-color: rgba(93, 216, 121, 0.25); }
.toast.error { color: var(--danger); border-color: rgba(255, 107, 107, 0.25); }
.toast.warning { color: var(--warning); border-color: rgba(245, 199, 93, 0.25); }

@keyframes toastIn {
    from { opacity: 0; transform: translateY(-10px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.toast.fade-out {
    animation: toastOut 0.2s forwards;
}

@keyframes toastOut {
    to { opacity: 0; transform: translateY(-6px) scale(0.96); }
}

/* ---------- 欢迎弹窗 ---------- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    animation: fadeIn 0.2s forwards;
}

@keyframes fadeIn {
    to { opacity: 1; }
}

.modal-content {
    max-width: 380px;
    width: 100%;
    border-radius: var(--radius-xl);
    overflow: hidden;
    animation: modalIn 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.92) translateY(16px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-body {
    padding: 32px;
    text-align: center;
}

.modal-icon {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, rgba(91,141,239,0.9), rgba(139,92,246,0.85));
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    color: #fff;
    font-size: 20px;
    font-weight: 700;
    box-shadow: 0 4px 20px rgba(91, 141, 239, 0.35);
}

.modal-title {
    font-size: 20px;
    font-weight: 800;
    margin-bottom: 10px;
}

.modal-text {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 24px;
}

.modal-text strong {
    color: var(--text-primary);
    font-weight: 700;
}

.modal-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* ---------- 用户状态栏 ---------- */
.user-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--text-secondary);
}

.user-bar strong {
    color: var(--text-primary);
    font-weight: 600;
}

/* ---------- 后台管理 ---------- */
.admin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.admin-header h2 {
    font-size: 24px;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.admin-stats {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.stat-card {
    flex: 1;
    padding: 18px;
    text-align: center;
}

.stat-num {
    font-size: 30px;
    font-weight: 800;
    color: var(--accent);
}

.stat-label {
    font-size: 12px;
    color: var(--text-tertiary);
    margin-top: 4px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.admin-post-item {
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 10px;
    border-radius: var(--radius-md);
    background: var(--glass-2);
    border: 1px solid var(--border-2);
}

.admin-post-info {
    flex: 1;
    min-width: 0;
}

.admin-post-title {
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-primary);
}

.admin-post-meta {
    font-size: 12px;
    color: var(--text-tertiary);
    margin-top: 3px;
}

/* ---------- 页脚 ---------- */
.footer {
    padding: 24px 0;
    text-align: center;
    font-size: 12px;
    color: var(--text-tertiary);
    border-top: 1px solid var(--border-2);
}

/* ---------- 标签切换 ---------- */
.tab-bar {
    display: flex;
    background: var(--glass-2);
    border-bottom: 1px solid var(--border-2);
}

.tab-btn {
    flex: 1;
    padding: 16px;
    border: none;
    background: transparent;
    font-family: var(--font);
    font-size: 15px;
    font-weight: 600;
    color: var(--text-tertiary);
    cursor: pointer;
    transition: all var(--transition);
}

.tab-btn.active {
    color: var(--accent);
    box-shadow: inset 0 -2px 0 var(--accent);
}

/* ---------- 响应式 ---------- */
@media (max-width: 640px) {
    .container { padding: 0 16px; }
    .page-title { font-size: 26px; }
    .post-detail { padding: 22px; }
    .post-detail-title { font-size: 21px; }
    .comments-section { padding: 20px 22px; }
    .search-input { width: 90px; }
    .admin-stats { flex-direction: column; }
    .floating-actions { right: 20px; bottom: 20px; }
    .fab { width: 48px; height: 48px; }
}

/* ---------- 工具类 ---------- */
.text-center { text-align: center; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.hidden { display: none !important; }

/* ---------- 上传区域 ---------- */
.upload-zone {
    border: 2px dashed var(--border-1);
    border-radius: var(--radius-md);
    padding: 32px 20px;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition);
    background: var(--glass-2);
    color: var(--text-secondary);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.upload-zone:hover {
    border-color: var(--accent);
    background: var(--accent-soft);
}

.upload-zone.upload-zone-drag {
    border-color: var(--accent);
    background: var(--accent-soft);
    transform: scale(1.01);
}

.upload-zone-text {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.upload-zone-hint {
    font-size: 12px;
    color: var(--text-tertiary);
    line-height: 1.5;
}

/* ---------- 上传预览 ---------- */
.upload-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 16px;
}

.upload-item {
    position: relative;
    width: 110px;
    height: 110px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--glass-2);
    border: 1px solid var(--border-2);
    display: flex;
    align-items: center;
    justify-content: center;
}

.upload-thumb {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.upload-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.upload-thumb-video {
    background: rgba(0, 0, 0, 0.2);
    color: var(--text-tertiary);
}

.upload-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 6px 8px;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(8px);
}

.upload-filename {
    font-size: 10px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.upload-progress {
    height: 3px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
}

.upload-progress-bar {
    height: 100%;
    background: var(--accent);
    transition: width 0.2s;
    border-radius: 2px;
}

.upload-item.upload-done .upload-info {
    display: none;
}

.upload-item.upload-error {
    border-color: var(--danger);
}

.upload-error-text {
    font-size: 10px;
    color: var(--danger);
    text-align: center;
}

.upload-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 22px;
    height: 22px;
    border-radius: var(--radius-full);
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    border: none;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
    z-index: 2;
}

.upload-remove:hover {
    background: var(--danger);
    transform: scale(1.1);
}

/* ---------- 媒体展示（帖子详情） ---------- */
.media-gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-top: 24px;
}

.media-item {
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--glass-2);
    border: 1px solid var(--border-2);
    position: relative;
    aspect-ratio: 1;
}

.media-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: pointer;
    transition: transform 0.3s;
}

.media-item img:hover {
    transform: scale(1.05);
}

.media-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #000;
}

/* 单个媒体时居中放大 */
.media-gallery:has(.media-item:only-child) {
    grid-template-columns: 1fr;
    max-width: 480px;
}

.media-gallery:has(.media-item:only-child) .media-item {
    aspect-ratio: auto;
}

.media-gallery:has(.media-item:only-child) .media-item img,
.media-gallery:has(.media-item:only-child) .media-item video {
    max-height: 500px;
}

/* 两个媒体时并排 */
.media-gallery:has(.media-item:nth-child(2):last-child) {
    grid-template-columns: repeat(2, 1fr);
}

/* ---------- Lightbox ---------- */
.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(12px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s;
}

.lightbox.active {
    opacity: 1;
    pointer-events: auto;
}

.lightbox-inner {
    position: relative;
    max-width: 100%;
    max-height: 100%;
}

.lightbox img {
    max-width: 90vw;
    max-height: 85vh;
    object-fit: contain;
    border-radius: var(--radius-sm);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.lightbox-close {
    position: absolute;
    top: -44px;
    right: 0;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
}

.lightbox-close:hover {
    background: var(--danger);
    border-color: var(--danger);
}

/* ---------- 帖子列表媒体指示 ---------- */
.media-indicator {
    color: var(--accent);
    display: flex;
    align-items: center;
    gap: 3px;
}

/* ---------- 响应式补充 ---------- */
@media (max-width: 640px) {
    .media-gallery {
        grid-template-columns: repeat(2, 1fr);
    }
    .upload-item {
        width: 90px;
        height: 90px;
    }
}
