:root {
    --primary-color: #2196f3;
    --secondary-color: #64b5f6;
    --accent-color: #1976d2;
    --bg-color: #ffffff;
    --text-color: #333333;
    --card-bg: #f8fbff;
    --border-color: #e3f2fd;
    --shadow: 0 2px 15px rgba(33, 150, 243, 0.1);
    --gradient: linear-gradient(135deg, #2196f3 0%, #1976d2 100%);
}

.dark-theme {
    --primary-color: #64b5f6;
    --secondary-color: #90caf9;
    --accent-color: #42a5f5;
    --bg-color: #0a1929;
    --text-color: #e3f2fd;
    --card-bg: #132f4c;
    --border-color: #1e4976;
    --shadow: 0 2px 15px rgba(100, 181, 246, 0.2);
    --gradient: linear-gradient(135deg, #64b5f6 0%, #1976d2 100%);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    transition: background-color 0.3s, color 0.3s, border-color 0.3s;
}

body {
    font-family: 'Microsoft YaHei', 'PingFang SC', 'Helvetica Neue', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(33, 150, 243, 0.05) 0%, transparent 20%),
        radial-gradient(circle at 90% 80%, rgba(100, 181, 246, 0.05) 0%, transparent 20%);
}

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

/* 头部样式 */
header {
    background: var(--gradient);
    color: white;
    padding: 15px 0;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

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

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

.logo-icon {
    font-size: 28px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

.logo h1 {
    font-size: 24px;
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.nav-links {
    display: flex;
    gap: 20px;
}

.nav-links a {
    color: white;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 20px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.nav-links a:hover {
    background-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.nav-links a.active {
    background-color: rgba(255, 255, 255, 0.25);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* 主题切换按钮 */
.theme-toggle {
    position: fixed;
    bottom: 25px;
    right: 25px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--gradient);
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: var(--shadow);
    z-index: 100;
    border: none;
    font-size: 20px;
    transition: all 0.3s ease;
}

.theme-toggle:hover {
    transform: scale(1.1) rotate(15deg);
    box-shadow: 0 4px 20px rgba(33, 150, 243, 0.4);
}

/* 主要内容区 */
.main-content {
    padding: 40px 0;
    min-height: calc(100vh - 140px);
}

/* 帖子卡片 */
.posts-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

.post-card {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.post-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient);
}

.post-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(33, 150, 243, 0.15);
}

.post-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    font-size: 14px;
    color: var(--text-color);
    opacity: 0.8;
}

.post-title {
    font-size: 20px;
    margin-bottom: 12px;
    color: var(--primary-color);
    font-weight: 600;
    line-height: 1.4;
}

.post-content {
    margin-bottom: 20px;
    line-height: 1.7;
    color: var(--text-color);
}

.post-image {
    max-width: 100%;
    border-radius: 12px;
    margin-bottom: 16px;
    border: 1px solid var(--border-color);
    transition: transform 0.3s ease;
}

.post-image:hover {
    transform: scale(1.02);
}

.post-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    transition: all 0.3s ease;
    font-weight: 500;
}

.btn-primary {
    background: var(--gradient);
    color: white;
    box-shadow: 0 2px 8px rgba(33, 150, 243, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(33, 150, 243, 0.4);
}

.btn-secondary {
    background: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background: var(--accent-color);
    transform: translateY(-2px);
}

.btn-small {
    padding: 6px 12px;
    font-size: 12px;
}

/* 表单样式 */
.form-container {
    max-width: 600px;
    margin: 0 auto;
    background: var(--card-bg);
    padding: 40px;
    border-radius: 20px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--primary-color);
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background-color: var(--bg-color);
    color: var(--text-color);
    font-size: 14px;
    transition: all 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1);
}

select.form-control {
    height: 46px;
}

/* 页脚 */
footer {
    background: var(--gradient);
    color: white;
    text-align: center;
    padding: 30px 0;
    margin-top: 60px;
}

footer p {
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 15px;
    }
    
    .posts-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
    }
    
    .form-container {
        padding: 25px;
        margin: 0 15px;
    }
    
    .post-card {
        padding: 20px;
    }
}

/* 匿名标签样式 */
.anonymous-badge {
    background: var(--gradient);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.anonymous-user {
    color: var(--secondary-color);
    font-weight: 500;
}

/* 加载动画 */
.loading-spinner {
    border: 4px solid #e3f2fd;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 图片模态框 */
.image-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 25, 41, 0.95);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.image-modal img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}

.image-modal .close {
    position: absolute;
    top: 30px;
    right: 40px;
    color: white;
    font-size: 40px;
    cursor: pointer;
    transition: color 0.3s ease;
}

.image-modal .close:hover {
    color: var(--secondary-color);
}