/* 
 * 轻论坛 - 磨砂卡片风格样式表
 * Glassmorphism Design
 */

/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.3);
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --shadow-soft: 0 8px 32px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 12px 48px rgba(0, 0, 0, 0.15);
}

body {
    font-family: 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background: var(--primary-gradient);
    background-attachment: fixed;
    min-height: 100vh;
    color: var(--text-primary);
    line-height: 1.6;
    padding-top: 80px;
}

/* 背景装饰 */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 50%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 20%, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

/* 导航栏 - 磨砂效果 */
.navbar {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    padding: 0 30px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    box-shadow: var(--shadow-soft);
}

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

.navbar-brand a {
    font-size: 28px;
    font-weight: bold;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-decoration: none;
    transition: transform 0.3s;
}

.navbar-brand a:hover {
    transform: scale(1.05);
}

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

.navbar-menu a {
    color: var(--text-primary);
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 12px;
    transition: all 0.3s;
    font-weight: 500;
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(10px);
}

.navbar-menu a:hover {
    background: rgba(255, 255, 255, 0.8);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* 容器 */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
    z-index: 1;
}

/* 磨砂卡片 */
.widget, .card, .post-item, .section-item {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 25px;
    box-shadow: var(--shadow-soft);
    transition: all 0.3s ease;
}

.widget:hover, .card:hover, .post-item:hover, .section-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

/* 标题 */
h1, h2, h3, h4, h5, h6 {
    color: var(--text-primary);
    margin-bottom: 20px;
    font-weight: 600;
}

h1 {
    font-size: 36px;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

h2 {
    font-size: 28px;
    color: var(--text-primary);
}

/* 按钮 */
.btn, button, input[type="submit"] {
    background: var(--primary-gradient);
    color: white;
    padding: 12px 30px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn:hover, button:hover, input[type="submit"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.8);
    color: var(--text-primary);
    backdrop-filter: blur(10px);
}

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

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

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 15px 20px;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 12px;
    font-size: 16px;
    transition: all 0.3s;
    color: var(--text-primary);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

/* 帖子列表 */
.post-list {
    list-style: none;
}

.post-list li {
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s;
    border-radius: 12px;
    margin-bottom: 10px;
}

.post-list li:hover {
    background: rgba(255, 255, 255, 0.5);
    padding-left: 30px;
}

.post-list li a {
    color: var(--text-primary);
    text-decoration: none;
    font-size: 18px;
    font-weight: 500;
    display: block;
    margin-bottom: 10px;
}

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

/* 版块网格 */
.section-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

.section-item {
    text-align: center;
    padding: 40px 30px;
}

.section-item h3 {
    font-size: 24px;
    margin-bottom: 15px;
}

.section-item p {
    color: var(--text-secondary);
    margin-bottom: 20px;
}

/* 头像 */
.avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.avatar-large {
    width: 120px;
    height: 120px;
}

/* 消息提示 */
.alert {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 25px;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.alert-success {
    border-left: 4px solid #10b981;
}

.alert-error {
    border-left: 4px solid #ef4444;
}

/* 搜索框 */
.search-box {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 40px;
    margin-bottom: 30px;
    box-shadow: var(--shadow-soft);
}

.search-box form {
    display: flex;
    gap: 15px;
}

.search-box input[type="text"] {
    flex: 1;
    padding: 15px 25px;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 12px;
    font-size: 16px;
}

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

.pagination a, .pagination span {
    padding: 12px 20px;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.3s;
    font-weight: 500;
}

.pagination a:hover {
    background: rgba(255, 255, 255, 0.9);
    transform: translateY(-2px);
}

.pagination .current {
    background: var(--primary-gradient);
    color: white;
    border: none;
}

/* 页脚 */
.footer {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border-top: 1px solid var(--glass-border);
    padding: 40px 0;
    margin-top: 80px;
    text-align: center;
    color: var(--text-secondary);
}

/* 响应式 */
@media (max-width: 768px) {
    .navbar {
        padding: 0 15px;
    }
    
    .navbar-menu {
        flex-wrap: wrap;
        gap: 5px;
    }
    
    .container {
        padding: 15px;
    }
    
    .widget, .card, .post-item, .section-item {
        padding: 20px;
        border-radius: 15px;
    }
    
    .section-grid {
        grid-template-columns: 1fr;
    }
    
    h1 {
        font-size: 28px;
    }
    
    h2 {
        font-size: 22px;
    }
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #667eea;
    animation: spin 1s ease-in-out infinite;
}

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

/* 徽章 */
.badge {
    display: inline-block;
    padding: 5px 15px;
    background: var(--primary-gradient);
    color: white;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

/* 标签 */
.tag {
    display: inline-block;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    font-size: 14px;
    color: var(--text-primary);
    margin-right: 10px;
    margin-bottom: 10px;
    transition: all 0.3s;
}

.tag:hover {
    background: rgba(255, 255, 255, 0.9);
    transform: translateY(-2px);
}

/* 进度条 */
.progress-bar {
    height: 8px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    overflow: hidden;
}

.progress-bar .progress {
    height: 100%;
    background: var(--primary-gradient);
    border-radius: 10px;
    transition: width 0.3s;
}

/* 工具提示 */
[data-tooltip] {
    position: relative;
    cursor: help;
}

[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 10px 15px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    font-size: 14px;
    white-space: nowrap;
    z-index: 1000;
    box-shadow: var(--shadow-soft);
}

/* 滚动条 */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.3);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-gradient);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}
