/* 全局样式重置和基础设置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --accent-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --dark-bg: #0a0a0a;
    --darker-bg: #050505;
    --card-bg: rgba(26, 26, 26, 0.95);
    --text-primary: #ffffff;
    --text-secondary: #e0e0e0;
    --text-muted: #888;
    --border-color: rgba(255, 255, 255, 0.1);
    --shadow-glow: 0 0 20px rgba(102, 126, 234, 0.3);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--dark-bg);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* 背景动画效果 */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 20%, rgba(102, 126, 234, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(244, 114, 182, 0.1) 0%, transparent 50%);
    z-index: -1;
    animation: float 20s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(180deg); }
}

/* 容器样式 */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 头部导航 - 现代化设计 */
header {
    padding: 2.5rem 0 1.5rem;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
    background: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 1000;
}

header h1 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 30px rgba(102, 126, 234, 0.5);
    animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
    from { text-shadow: 0 0 20px rgba(102, 126, 234, 0.5); }
    to { text-shadow: 0 0 30px rgba(102, 126, 234, 0.8), 0 0 40px rgba(102, 126, 234, 0.6); }
}

nav {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

nav a {
    color: var(--text-secondary);
    text-decoration: none;
    padding: 0.8rem 1.5rem;
    border-radius: 25px;
    transition: var(--transition);
    font-weight: 500;
    position: relative;
    overflow: hidden;
}

nav a::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--primary-gradient);
    transition: var(--transition);
    z-index: -1;
}

nav a:hover::before,
nav a.active::before {
    left: 0;
}

nav a:hover,
nav a.active {
    color: var(--text-primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

/* 主要内容区域 */
main {
    flex: 1;
    padding: 3rem 0;
}

/* 加载状态 - 现代化设计 */
.loading {
    text-align: center;
    padding: 4rem 2rem;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top: 3px solid var(--text-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1.5rem;
    position: relative;
}

.spinner::after {
    content: '';
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    border: 2px solid transparent;
    border-top: 2px solid rgba(102, 126, 234, 0.5);
    border-radius: 50%;
    animation: spin 2s linear infinite;
}

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

.loading p {
    font-size: 1.2rem;
    color: var(--text-secondary);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* 错误和空状态消息 */
.error-message,
.empty-message {
    text-align: center;
    padding: 3rem;
    color: #ff6b6b;
    background: rgba(255, 107, 107, 0.1);
    border-radius: 15px;
    border: 1px solid rgba(255, 107, 107, 0.3);
}

/* 今日梦境样式 - 现代化设计 */
.dream-container {
    max-width: 1200px;
    margin: 0 auto;
    background: var(--card-bg);
    border-radius: 20px;
    padding: 2.5rem;
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    animation: fadeInUp 0.8s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dream-header {
    text-align: center;
    margin-bottom: 2.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.dream-header h2 {
    font-size: 2.2rem;
    margin-bottom: 1.2rem;
    background: var(--secondary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
}

.seeds {
    display: flex;
    justify-content: center;
    gap: 0.8rem;
    flex-wrap: wrap;
}

.seed-tag {
    background: var(--accent-gradient);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.95rem;
    font-weight: 600;
    transition: var(--transition);
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(79, 172, 254, 0.3);
}

.seed-tag:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(79, 172, 254, 0.5);
}

.dream-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
    margin-bottom: 2.5rem;
    align-items: start;
}

.dream-image {
    position: relative;
    overflow: hidden;
    border-radius: 15px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
    transition: var(--transition);
}

.dream-image:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.5);
}

.dream-image img {
    width: 100%;
    height: 450px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.dream-image:hover img {
    transform: scale(1.05);
}

.dream-text {
    background: rgba(255, 255, 255, 0.05);
    padding: 2rem;
    border-radius: 15px;
    border-left: 4px solid transparent;
    background: linear-gradient(145deg, rgba(26, 26, 26, 0.8), rgba(40, 40, 40, 0.8)) padding-box,
                var(--primary-gradient) border-box;
    border: 1px solid transparent;
}

.dream-text p {
    font-size: 1.15rem;
    line-height: 1.8;
    color: var(--text-secondary);
    text-align: justify;
}

.dream-meta {
    background: rgba(255, 255, 255, 0.05);
    padding: 1.8rem;
    border-radius: 15px;
    font-size: 0.95rem;
    border: 1px solid var(--border-color);
}

.dream-meta p {
    margin-bottom: 0.8rem;
    display: flex;
    align-items: center;
}

.dream-meta strong {
    color: var(--text-primary);
    margin-right: 0.5rem;
    min-width: 80px;
}

/* 档案馆样式 - 现代化设计 */
.archive-header {
    text-align: center;
    margin-bottom: 3rem;
    padding: 2rem;
    background: var(--card-bg);
    border-radius: 20px;
    border: 1px solid var(--border-color);
}

.archive-header h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 800;
}

.archive-header p {
    color: var(--text-secondary);
    font-size: 1.2rem;
    opacity: 0.9;
}

.gallery-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
    padding: 1rem 0;
}

.dream-card {
    background: var(--card-bg);
    border-radius: 20px;
    overflow: hidden;
    transition: var(--transition);
    border: 1px solid var(--border-color);
    position: relative;
}

.dream-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--primary-gradient);
    opacity: 0;
    transition: var(--transition);
    z-index: 1;
}

.dream-card:hover {
    transform: translateY(-8px);
    box-shadow: 
        0 25px 50px rgba(0, 0, 0, 0.4),
        var(--shadow-glow);
}

.dream-card:hover::before {
    opacity: 0.1;
}

.card-image {
    position: relative;
    height: 250px;
    overflow: hidden;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.dream-card:hover .card-image img {
    transform: scale(1.1);
}

.card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    display: flex;
    align-items: flex-end;
    padding: 1.5rem;
    z-index: 2;
}

.card-date {
    color: white;
    font-weight: 600;
    font-size: 1rem;
}

.card-content {
    padding: 2rem;
    position: relative;
    z-index: 2;
}

.card-content h3 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
    font-weight: 700;
}

.card-seeds {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1.2rem;
}

.card-seeds .seed-tag {
    font-size: 0.85rem;
    padding: 0.3rem 0.8rem;
}

.card-preview {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.view-details {
    background: var(--primary-gradient);
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 25px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    transition: var(--transition);
    width: 100%;
}

.view-details:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

/* 关于页面样式 - 现代化设计 */
.about-content {
    max-width: 900px;
    margin: 0 auto;
}

.about-content h2 {
    font-size: 2.8rem;
    margin-bottom: 2.5rem;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-align: center;
    font-weight: 800;
}

.about-content section {
    margin-bottom: 2.5rem;
    background: var(--card-bg);
    padding: 2.5rem;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.about-content section:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
}

.about-content h3 {
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    font-weight: 700;
    background: var(--secondary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.about-content p,
.about-content li {
    color: var(--text-secondary);
    line-height: 1.7;
    font-size: 1.05rem;
}

.about-content ul,
.about-content ol {
    padding-left: 2rem;
    margin: 1rem 0;
}

.about-content li {
    margin-bottom: 0.8rem;
    position: relative;
}

.about-content li::before {
    content: '•';
    color: #667eea;
    font-weight: bold;
    display: inline-block;
    width: 1em;
    margin-left: -1em;
}

.about-content a {
    color: #667eea;
    text-decoration: none;
    transition: var(--transition);
    font-weight: 600;
}

.about-content a:hover {
    color: #764ba2;
    text-decoration: underline;
}

/* 页脚样式 */
footer {
    text-align: center;
    padding: 2.5rem 0;
    margin-top: auto;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* 工具类 */
.hidden {
    display: none !important;
}

.fade-in {
    animation: fadeIn 0.6s ease-out;
}

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

/* 响应式设计 */
@media (max-width: 1024px) {
    .container {
        padding: 0 1.5rem;
    }
    
    header h1 {
        font-size: 2.5rem;
    }
    
    .dream-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .dream-image img {
        height: 400px;
    }
    
    .gallery-container {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
    }
    
    header {
        padding: 2rem 0 1rem;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    nav {
        gap: 1rem;
    }
    
    nav a {
        padding: 0.6rem 1.2rem;
        font-size: 0.9rem;
    }
    
    .dream-container {
        padding: 2rem;
        margin: 0 1rem;
    }
    
    .dream-header h2 {
        font-size: 1.8rem;
    }
    
    .dream-image img {
        height: 350px;
    }
    
    .dream-text,
    .dream-meta {
        padding: 1.5rem;
    }
    
    .gallery-container {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .archive-header {
        padding: 1.5rem;
        margin: 0 1rem 2rem;
    }
    
    .archive-header h2 {
        font-size: 2rem;
    }
    
    .about-content section {
        padding: 2rem;
        margin: 0 1rem 2rem;
    }
    
    .about-content h2 {
        font-size: 2.2rem;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.8rem;
    }
    
    nav {
        flex-direction: column;
        align-items: center;
        gap: 0.8rem;
    }
    
    .dream-container {
        padding: 1.5rem;
    }
    
    .dream-header h2 {
        font-size: 1.6rem;
    }
    
    .dream-image img {
        height: 300px;
    }
    
    .dream-text,
    .dream-meta {
        padding: 1.2rem;
    }
    
    .dream-text p {
        font-size: 1rem;
    }
    
    .seed-tag {
        font-size: 0.85rem;
        padding: 0.4rem 0.8rem;
    }
    
    .archive-header h2 {
        font-size: 1.8rem;
    }
    
    .about-content h2 {
        font-size: 2rem;
    }
    
    .about-content section {
        padding: 1.5rem;
    }
    
    footer {
        padding: 2rem 0;
    }
}

/* 滚动条美化 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--darker-bg);
}

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

::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-gradient);
}

/* 选择文本样式 */
::selection {
    background: rgba(102, 126, 234, 0.3);
    color: var(--text-primary);
}

/* 焦点样式 */
:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* 图片加载过渡效果 */
img {
    transition: opacity 0.3s ease;
}

img[src=""], 
img:not([src]) {
    opacity: 0;
}

img.loaded {
    opacity: 1;
}
