/* 基础重置和变量 */
:root {
    --primary-yellow: #FFD700;
    --primary-black: #0A0A0A;
    --dark-gray: #1A1A1A;
    --medium-gray: #2D2D2D;
    --light-gray: #404040;
    --text-light: #FFFFFF;
    --text-muted: #B0B0B0;
    --gradient-primary: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    --gradient-glass: linear-gradient(135deg, rgba(255,215,0,0.1) 0%, rgba(255,165,0,0.05) 100%);
    --shadow-glass: 0 8px 32px rgba(255,215,0,0.1);
    --shadow-card: 0 4px 20px rgba(255,215,0,0.15);
    --shadow-modal: 0 20px 60px rgba(0,0,0,0.5);
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--primary-black);
    color: var(--text-light);
    line-height: 1.6;
    overflow-x: hidden;
}

/* 液态背景 */
.liquid-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.liquid-shape {
    position: absolute;
    width: 600px;
    height: 600px;
    border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%;
    background: var(--gradient-primary);
    opacity: 0.03;
    animation: liquidMove 20s infinite linear;
}

.liquid-shape:nth-child(1) {
    top: -300px;
    left: -200px;
    animation-delay: 0s;
}

.liquid-shape:nth-child(2) {
    top: 50%;
    right: -300px;
    animation-delay: -7s;
    animation-duration: 25s;
}

.liquid-shape:nth-child(3) {
    bottom: -400px;
    left: 50%;
    animation-delay: -14s;
    animation-duration: 30s;
}

@keyframes liquidMove {
    0% {
        transform: translate(0, 0) rotate(0deg);
        border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%;
    }
    50% {
        border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
    }
    100% {
        transform: translate(100px, 50px) rotate(360deg);
        border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%;
    }
}

/* 玻璃态效果基础类 */
.glass-container {
    min-height: 100vh;
    position: relative;
}

.glass-header, .glass-card, .glass-form, .glass-footer {
    background: rgba(26, 26, 26, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 215, 0, 0.1);
    box-shadow: var(--shadow-glass);
}

/* 头部导航 */
.glass-header {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    padding: 1rem 0;
}

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

.logo {
    font-size: 1.8rem;
    font-weight: bold;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav a {
    color: var(--text-light);
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    position: relative;
}

.nav a:hover, .nav a.active {
    color: var(--primary-yellow);
    background: rgba(255, 215, 0, 0.1);
}

.nav a.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 1rem;
    right: 1rem;
    height: 2px;
    background: var(--gradient-primary);
}

.logout-btn, .logout-link {
    background: rgba(255, 0, 0, 0.2);
    border: 1px solid rgba(255, 0, 0, 0.3);
    color: #ff6b6b !important;
}

.logout-link {
    background: none;
    border: none;
    text-decoration: underline;
    padding: 0;
}

/* 主内容区域 - 修复移动端遮挡问题 */
.main-content {
    margin-top: 100px; /* 增加顶部间距防止移动端遮挡 */
    min-height: calc(100vh - 160px);
}

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

/* 英雄区域 */
.hero {
    text-align: center;
    padding: 4rem 0; /* 减少内边距适应移动端 */
    position: relative;
}

.hero-content h2 {
    font-size: 3rem; /* 减小字体适应移动端 */
    margin-bottom: 1.5rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-content p {
    font-size: 1.2rem; /* 减小字体适应移动端 */
    color: var(--text-muted);
    margin-bottom: 2.5rem;
}

.cta-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* 按钮样式 */
.btn {
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-block;
}

.btn-primary {
    background: var(--gradient-primary);
    color: var(--primary-black);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 215, 0, 0.3);
}

.btn-secondary {
    background: transparent;
    color: var(--primary-yellow);
    border: 2px solid var(--primary-yellow);
}

.btn-secondary:hover {
    background: rgba(255, 215, 0, 0.1);
    transform: translateY(-2px);
}

/* 卡片样式 */
.glass-card {
    padding: 1.5rem; /* 减小内边距适应移动端 */
    border-radius: 16px;
    margin: 1rem 0;
    transition: all 0.3s ease;
}

.glass-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-card);
}

.features-grid, .news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.feature-card h4, .news-card h4 {
    color: var(--primary-yellow);
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

/* 可点击新闻卡片 */
.clickable-news {
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.clickable-news::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,215,0,0.1), transparent);
    transition: left 0.5s;
}

.clickable-news:hover::before {
    left: 100%;
}

.news-preview {
    color: var(--text-muted);
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 页面内容 */
.page-content {
    padding: 2rem 0;
}

.page-header {
    margin-bottom: 2rem;
    text-align: center;
}

.page-header h2 {
    color: var(--primary-yellow);
    font-size: 2.2rem; /* 减小字体适应移动端 */
    margin-bottom: 0.5rem;
}

.page-body {
    line-height: 1.8;
    font-size: 1.1rem;
}

/* 新闻列表页面 */
.news-list-page {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.news-item-page {
    transition: all 0.3s ease;
}

.news-item-page:hover {
    transform: translateX(10px);
}

.news-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.news-item-header h3 {
    color: var(--primary-yellow);
    margin-right: 1rem;
}

.news-date {
    color: var(--text-muted);
    white-space: nowrap;
}

.read-more {
    color: var(--primary-yellow);
    font-weight: 500;
    margin-top: 1rem;
    text-align: right;
}

/* 表单样式 */
.glass-form-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 70vh;
}

.glass-form {
    padding: 2.5rem; /* 减小内边距适应移动端 */
    border-radius: 20px;
    width: 100%;
    max-width: 500px;
}

.glass-form h2 {
    text-align: center;
    margin-bottom: 2rem;
    color: var(--primary-yellow);
}

.login-note {
    text-align: center;
    margin-top: 1rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
    font-weight: 500;
}

.form-group input, .form-group textarea, .form-group select {
    width: 100%;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 215, 0, 0.2);
    border-radius: 8px;
    color: var(--text-light);
    font-size: 1rem;
    transition: all 0.3s ease;
    font-family: inherit;
}

.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
    outline: none;
    border-color: var(--primary-yellow);
    box-shadow: 0 0 0 2px rgba(255, 215, 0, 0.1);
}

.rich-editor {
    min-height: 200px;
    resize: vertical;
    line-height: 1.6;
}

/* 管理后台样式 */
.admin-panel {
    padding: 2rem 0;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 215, 0, 0.2);
}

.admin-header h2 {
    color: var(--primary-yellow);
}

.admin-info {
    color: var(--text-muted);
}

.admin-tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    border-bottom: 1px solid rgba(255, 215, 0, 0.2);
    padding-bottom: 1rem;
    flex-wrap: wrap;
}

.tab-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.tab-btn.active {
    background: rgba(255, 215, 0, 0.1);
    color: var(--primary-yellow);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.admin-section {
    margin-bottom: 3rem;
}

.admin-section h3 {
    color: var(--primary-yellow);
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 215, 0, 0.1);
}

.admin-note {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 0.5rem;
    font-style: italic;
}

.news-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.news-item .news-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.news-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.news-status {
    padding: 0.3rem 0.8rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: bold;
}

.news-status.published {
    background: rgba(0, 255, 0, 0.1);
    color: #00ff00;
}

.news-status.draft {
    background: rgba(255, 215, 0, 0.1);
    color: var(--primary-yellow);
}

.btn-edit, .btn-delete {
    padding: 0.4rem 0.8rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.btn-edit {
    background: rgba(255, 215, 0, 0.2);
    color: var(--primary-yellow);
}

.btn-edit:hover {
    background: rgba(255, 215, 0, 0.3);
}

.btn-delete {
    background: rgba(255, 0, 0, 0.2);
    color: #ff4444;
}

.btn-delete:hover {
    background: rgba(255, 0, 0, 0.3);
}

.edit-form {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border-left: 4px solid var(--primary-yellow);
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1001;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.modal-content {
    position: relative;
    margin: 5% auto;
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
    animation: modalSlideIn 0.3s ease;
    padding: 2rem;
}

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

.close-modal {
    position: absolute;
    right: 1.5rem;
    top: 1.5rem;
    font-size: 2rem;
    color: var(--text-muted);
    cursor: pointer;
    z-index: 1;
    transition: color 0.3s ease;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-modal:hover {
    color: var(--primary-yellow);
}

.modal-body {
    padding: 1rem 0;
    line-height: 1.8;
    font-size: 1.1rem;
    white-space: pre-line; /* 保留换行符 */
}

.modal-meta {
    margin-bottom: 1.5rem;
    color: var(--text-muted);
    border-bottom: 1px solid rgba(255, 215, 0, 0.1);
    padding-bottom: 1rem;
}

/* 消息提示 */
.message {
    padding: 1rem 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    font-weight: 500;
    border-left: 4px solid;
}

.message.success {
    background: rgba(0, 255, 0, 0.1);
    color: #00ff00;
    border-color: #00ff00;
}

.message.error {
    background: rgba(255, 0, 0, 0.1);
    color: #ff4444;
    border-color: #ff4444;
}

/* 无内容提示 */
.no-news {
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
}

/* 页脚 */
.glass-footer {
    text-align: center;
    padding: 2rem 0;
    margin-top: 4rem;
    color: var(--text-muted);
}

.glass-footer a {
    color: var(--primary-yellow);
    text-decoration: none;
}

.glass-footer a:hover {
    text-decoration: underline;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .glass-header .container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav {
        gap: 0.5rem;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .nav a {
        padding: 0.4rem 0.8rem;
        font-size: 0.9rem;
    }
    
    .main-content {
        margin-top: 140px; /* 移动端增加更多顶部间距 */
    }
    
    .hero-content h2 {
        font-size: 2.2rem;
    }
    
    .hero-content p {
        font-size: 1.1rem;
    }
    
    .cta-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .features-grid, .news-grid {
        grid-template-columns: 1fr;
    }
    
    .admin-tabs {
        flex-direction: column;
    }
    
    .container {
        padding: 0 1rem;
    }
    
    .admin-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    
    .news-item .news-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .news-actions {
        width: 100%;
        justify-content: flex-start;
    }
    
    .modal-content {
        width: 95%;
        margin: 10% auto;
        padding: 1.5rem;
    }
    
    .news-item-header {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .page-header h2 {
        font-size: 1.8rem;
    }
    
    .glass-card {
        padding: 1.2rem;
    }
}

@media (max-width: 480px) {
    .glass-form {
        padding: 2rem 1.5rem;
    }
    
    .hero {
        padding: 3rem 0;
    }
    
    .hero-content h2 {
        font-size: 1.8rem;
    }
    
    .modal-content {
        padding: 1rem;
    }
    
    .main-content {
        margin-top: 160px; /* 超小屏幕进一步增加顶部间距 */
    }
}