/* ===== YH论坛 - 浅蓝色液态玻璃风格 ===== */

:root {
    --primary: #0ea5e9;
    --primary-light: #38bdf8;
    --primary-dark: #0284c7;
    --bg-gradient: linear-gradient(135deg, #e0f2fe 0%, #bae6fd 50%, #7dd3fc 100%);
    --glass-bg: rgba(255, 255, 255, 0.65);
    --glass-bg-strong: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(255, 255, 255, 0.6);
    --glass-shadow: 0 8px 32px rgba(14, 165, 233, 0.15);
    --text-main: #0f172a;
    --text-muted: #64748b;
    --text-light: #94a3b8;
    --radius: 16px;
    --radius-lg: 24px;
    --radius-sm: 10px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', Roboto, sans-serif;
    background: var(--bg-gradient);
    background-attachment: fixed;
    min-height: 100vh;
    color: var(--text-main);
    line-height: 1.6;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.2s;
}
a:hover { color: var(--primary-dark); }

/* ===== 导航栏 ===== */
.navbar {
    background: var(--glass-bg-strong);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    padding: 14px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 20px rgba(0,0,0,0.05);
}

.navbar .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.navbar .logo {
    font-size: 24px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), #6366f1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
}

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

.nav-links a, .nav-links button {
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    transition: all 0.3s;
}

.nav-links a:hover {
    background: rgba(14,165,233,0.1);
}

/* ===== 液态玻璃按钮 ===== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 22px;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: var(--text-main);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(14,165,233,0.25);
    border-color: rgba(14,165,233,0.4);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: #fff;
    border-color: transparent;
    box-shadow: 0 4px 15px rgba(14,165,233,0.35);
}

.btn-primary:hover {
    box-shadow: 0 6px 25px rgba(14,165,233,0.5);
    color: #fff;
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444, #f87171);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 4px 15px rgba(239,68,68,0.3);
}

.btn-sm {
    padding: 6px 14px;
    font-size: 13px;
}

.btn-xs {
    padding: 4px 10px;
    font-size: 12px;
    border-radius: 8px;
}

/* ===== 玻璃卡片 ===== */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--glass-shadow);
}

.glass-card-lg {
    border-radius: var(--radius-lg);
    padding: 32px;
}

/* ===== 容器 ===== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.main-content {
    padding: 28px 0;
}

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

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

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid rgba(14,165,233,0.2);
    border-radius: var(--radius-sm);
    background: rgba(255,255,255,0.7);
    backdrop-filter: blur(8px);
    font-size: 14px;
    color: var(--text-main);
    transition: all 0.3s;
    outline: none;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(14,165,233,0.15);
    background: rgba(255,255,255,0.9);
}

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

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%230ea5e9' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 40px;
}

/* ===== 页面标题 ===== */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.page-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-main);
}

/* ===== 论坛板块卡片 ===== */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 16px;
}

.category-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    transition: all 0.3s;
    cursor: pointer;
}

.category-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(14,165,233,0.2);
}

.category-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(14,165,233,0.15), rgba(99,102,241,0.15));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    flex-shrink: 0;
}

.category-info h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
}

.category-info p {
    font-size: 13px;
    color: var(--text-muted);
}

.category-meta {
    margin-left: auto;
    text-align: right;
    font-size: 13px;
    color: var(--text-muted);
}

.category-meta .count {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
    display: block;
}

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

.post-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 20px;
    transition: all 0.3s;
}

.post-item:hover {
    transform: translateX(4px);
    box-shadow: 0 6px 20px rgba(14,165,233,0.12);
}

.post-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-light), #818cf8);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 600;
    font-size: 16px;
    flex-shrink: 0;
}

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

.post-title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.post-title a {
    color: var(--text-main);
}
.post-title a:hover { color: var(--primary); }

.post-meta {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.post-meta span {
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

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

.post-stats span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.pinned-badge {
    display: inline-block;
    background: linear-gradient(135deg, #f59e0b, #fbbf24);
    color: #fff;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 6px;
    margin-right: 6px;
    font-weight: 600;
}

/* ===== 帖子详情 ===== */
.post-detail {
    margin-bottom: 24px;
}

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

.post-detail-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 12px;
    line-height: 1.4;
}

.post-detail-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    color: var(--text-muted);
    flex-wrap: wrap;
}

.post-detail-body {
    font-size: 15px;
    line-height: 1.8;
    white-space: pre-wrap;
    word-break: break-word;
}

.post-actions {
    display: flex;
    gap: 8px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(14,165,233,0.1);
}

/* ===== 回复区域 ===== */
.reply-section {
    margin-top: 32px;
}

.reply-item {
    display: flex;
    gap: 14px;
    padding: 18px 20px;
    margin-bottom: 12px;
}

.reply-content {
    flex: 1;
}

.reply-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    font-size: 13px;
    color: var(--text-muted);
}

.reply-header .username {
    font-weight: 600;
    color: var(--text-main);
    font-size: 14px;
}

.reply-body {
    font-size: 14px;
    line-height: 1.7;
    white-space: pre-wrap;
}

.reply-form {
    margin-top: 24px;
}

/* ===== 认证页面 ===== */
.auth-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 70px);
    padding: 20px;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    padding: 40px;
}

.auth-card h1 {
    font-size: 26px;
    font-weight: 800;
    text-align: center;
    margin-bottom: 8px;
    background: linear-gradient(135deg, var(--primary), #6366f1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.auth-card .subtitle {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 32px;
    font-size: 14px;
}

.auth-card .btn-primary {
    width: 100%;
    padding: 13px;
    font-size: 15px;
    justify-content: center;
    margin-top: 8px;
}

.auth-footer {
    text-align: center;
    margin-top: 24px;
    font-size: 14px;
    color: var(--text-muted);
}

.error-msg {
    background: rgba(239,68,68,0.1);
    border: 1px solid rgba(239,68,68,0.3);
    color: #991b1b;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    margin-bottom: 16px;
}

.success-msg {
    background: rgba(34,197,94,0.1);
    border: 1px solid rgba(34,197,94,0.3);
    color: #166534;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    margin-bottom: 16px;
}

/* ===== 后台管理 ===== */
.admin-sidebar {
    width: 240px;
    flex-shrink: 0;
}

.admin-sidebar .glass-card {
    padding: 16px;
}

.admin-nav {
    list-style: none;
}

.admin-nav li {
    margin-bottom: 4px;
}

.admin-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    color: var(--text-main);
    font-size: 14px;
    transition: all 0.2s;
}

.admin-nav a:hover, .admin-nav a.active {
    background: rgba(14,165,233,0.12);
    color: var(--primary);
}

.admin-layout {
    display: flex;
    gap: 24px;
    align-items: flex-start;
}

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

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.admin-table th {
    text-align: left;
    padding: 12px 16px;
    background: rgba(14,165,233,0.08);
    color: var(--text-muted);
    font-weight: 600;
    font-size: 13px;
}

.admin-table td {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(0,0,0,0.04);
}

.admin-table tr:hover td {
    background: rgba(14,165,233,0.04);
}

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

.stat-card {
    text-align: center;
    padding: 24px;
}

.stat-card .num {
    font-size: 32px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), #6366f1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.stat-card .label {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 4px;
}

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

.search-bar .form-control {
    flex: 1;
}

/* ===== 分页 ===== */
.pagination {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 28px;
}

.pagination a, .pagination span {
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    border: 1px solid var(--glass-border);
    background: var(--glass-bg);
}

.pagination a:hover {
    background: rgba(14,165,233,0.1);
}

.pagination .current {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* ===== 通知 ===== */
.notification-item {
    display: flex;
    gap: 12px;
    padding: 14px 18px;
    margin-bottom: 8px;
    align-items: flex-start;
}

.notification-item.unread {
    border-left: 3px solid var(--primary);
}

.notification-item .notif-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.notification-item .notif-content {
    flex: 1;
    font-size: 14px;
}

.notification-item .notif-time {
    font-size: 12px;
    color: var(--text-light);
    margin-top: 4px;
}

/* ===== 标签/徽章 ===== */
.badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.badge-blue {
    background: rgba(14,165,233,0.12);
    color: var(--primary);
}

.badge-green {
    background: rgba(34,197,94,0.12);
    color: #16a34a;
}

.badge-red {
    background: rgba(239,68,68,0.12);
    color: #dc2626;
}

.badge-gray {
    background: rgba(100,116,139,0.12);
    color: var(--text-muted);
}

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

.empty-state .icon {
    font-size: 48px;
    margin-bottom: 16px;
}

/* ===== 响应式 ===== */
@media (max-width: 768px) {
    .navbar .container {
        padding: 0 14px;
    }
    .nav-links {
        gap: 4px;
    }
    .nav-links a, .nav-links button {
        padding: 6px 10px;
        font-size: 13px;
    }
    .category-grid {
        grid-template-columns: 1fr;
    }
    .admin-layout {
        flex-direction: column;
    }
    .admin-sidebar {
        width: 100%;
    }
    .post-item {
        flex-wrap: wrap;
    }
    .post-stats {
        width: 100%;
        margin-top: 8px;
        padding-left: 58px;
    }
    .auth-card {
        padding: 28px 20px;
    }
    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* ===== 动画 ===== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.4s ease forwards;
}

/* ===== 工具类 ===== */
.text-muted { color: var(--text-muted); }
.text-small { font-size: 13px; }
.mt-12 { margin-top: 12px; }
.mt-20 { margin-top: 20px; }
.mb-12 { margin-bottom: 12px; }
.mb-20 { margin-bottom: 20px; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.w-full { width: 100%; }
