/* 科学3D科普网 - 主样式文件 */

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

:root {
    --primary-color: #4A90E2;
    --secondary-color: #7B68EE;
    --accent-color: #FF6B6B;
    --success-color: #4CAF50;
    --warning-color: #FFC107;
    --danger-color: #F44336;
    --dark-color: #2C3E50;
    --light-color: #ECF0F1;
    --text-color: #333;
    --text-light: #666;
    --border-color: #DDD;
    --shadow: 0 2px 10px rgba(0,0,0,0.1);
    --shadow-hover: 0 4px 20px rgba(0,0,0,0.15);
    --transition: all 0.3s ease;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: #F5F7FA;
}

a {
    text-decoration: none;
    color: inherit;
}

button {
    cursor: pointer;
    border: none;
    outline: none;
    font-family: inherit;
}

/* 导航栏 */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: white;
    box-shadow: var(--shadow);
    z-index: 1000;
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
}

.nav-logo i {
    font-size: 2rem;
    animation: rotate 10s linear infinite;
}

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

.nav-menu {
    display: flex;
    gap: 2rem;
}

.nav-link {
    padding: 0.5rem 1rem;
    border-radius: 5px;
    transition: var(--transition);
    font-weight: 500;
}

.nav-link:hover,
.nav-link.active {
    background: var(--primary-color);
    color: white;
}

.btn-login {
    padding: 0.5rem 1.5rem;
    background: var(--primary-color);
    color: white;
    border-radius: 25px;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

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

/* 主页横幅 */
.hero-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 100px 2rem 2rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    position: relative;
    overflow: hidden;
}

.hero-content {
    max-width: 600px;
    z-index: 1;
}

.hero-title {
    font-size: 3rem;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.hero-title .highlight {
    color: #FFD700;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.hero-subtitle {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    margin-bottom: 3rem;
}

.btn-primary,
.btn-secondary {
    padding: 1rem 2rem;
    border-radius: 30px;
    font-size: 1.1rem;
    font-weight: 600;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

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

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(255,255,255,0.3);
}

.btn-secondary {
    background: transparent;
    color: white;
    border: 2px solid white;
}

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

.hero-stats {
    display: flex;
    gap: 3rem;
}

.stat-item {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 2.5rem;
    font-weight: bold;
    color: #FFD700;
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.8;
}

.hero-3d {
    position: absolute;
    right: 0;
    top: 0;
    width: 50%;
    height: 100%;
    z-index: 0;
}

/* 实验库 */
.experiments-section {
    padding: 5rem 2rem;
    background: white;
}

.section-container {
    max-width: 1400px;
    margin: 0 auto;
}

.section-title {
    font-size: 2.5rem;
    margin-bottom: 2rem;
    text-align: center;
    color: var(--dark-color);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.section-title i {
    color: var(--primary-color);
}

.experiments-filter {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 3rem;
}

.filter-btn {
    padding: 0.75rem 1.5rem;
    background: var(--light-color);
    border-radius: 25px;
    transition: var(--transition);
    font-weight: 500;
}

.filter-btn:hover,
.filter-btn.active {
    background: var(--primary-color);
    color: white;
}

.experiments-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.experiment-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

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

.experiment-thumbnail {
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    color: white;
}

.experiment-info {
    padding: 1.5rem;
}

.experiment-title {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--dark-color);
}

.experiment-category {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--light-color);
    border-radius: 15px;
    font-size: 0.85rem;
    margin-bottom: 0.75rem;
}

.experiment-desc {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.experiment-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: var(--text-light);
}

.load-more {
    text-align: center;
}

.btn-outline {
    padding: 1rem 2rem;
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    border-radius: 25px;
    font-weight: 600;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-outline:hover {
    background: var(--primary-color);
    color: white;
}

/* 创建实验 */
.create-section {
    padding: 5rem 2rem;
    background: #F5F7FA;
}

.create-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-top: 2rem;
}

.create-input-area,
.create-preview-area {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: var(--shadow);
}

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

.input-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--dark-color);
}

.input-group textarea {
    width: 100%;
    padding: 1rem;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-family: inherit;
    font-size: 1rem;
    resize: vertical;
    transition: var(--transition);
}

.input-group textarea:focus {
    border-color: var(--primary-color);
    outline: none;
}

.input-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.option-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--dark-color);
}

.option-group select {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-family: inherit;
    font-size: 1rem;
    transition: var(--transition);
}

.option-group select:focus {
    border-color: var(--primary-color);
    outline: none;
}

.btn-generate {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-generate:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.preview-controls {
    display: flex;
    gap: 0.5rem;
}

.control-btn {
    width: 40px;
    height: 40px;
    background: var(--light-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.control-btn:hover {
    background: var(--primary-color);
    color: white;
}

.preview-canvas {
    width: 100%;
    height: 400px;
    background: #1a1a2e;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.preview-placeholder {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: #666;
}

.preview-placeholder i {
    font-size: 4rem;
    margin-bottom: 1rem;
    color: #444;
}

.preview-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.info-item {
    display: flex;
    flex-direction: column;
}

.info-label {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 0.25rem;
}

.info-value {
    font-weight: 600;
    color: var(--dark-color);
}

/* 知识库 */
.knowledge-section {
    padding: 5rem 2rem;
    background: white;
}

.knowledge-search {
    max-width: 600px;
    margin: 0 auto 3rem;
    display: flex;
    gap: 0.5rem;
}

.search-input {
    flex: 1;
    padding: 1rem 1.5rem;
    border: 2px solid var(--border-color);
    border-radius: 30px;
    font-size: 1rem;
    transition: var(--transition);
}

.search-input:focus {
    border-color: var(--primary-color);
    outline: none;
}

.search-btn {
    width: 50px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    transition: var(--transition);
}

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

.knowledge-categories {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 2rem;
}

.category-card {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: var(--shadow);
    text-align: center;
    transition: var(--transition);
    cursor: pointer;
}

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

.category-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: white;
}

.category-card h3 {
    margin-bottom: 0.5rem;
    color: var(--dark-color);
}

.category-card p {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.category-count {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--light-color);
    border-radius: 15px;
    font-size: 0.85rem;
    color: var(--primary-color);
    font-weight: 600;
}

/* AI助手 */
.ai-assistant {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 380px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 30px rgba(0,0,0,0.2);
    z-index: 999;
    overflow: hidden;
}

.assistant-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.assistant-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
}

.assistant-toggle {
    background: transparent;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    transition: var(--transition);
}

.assistant-toggle:hover {
    background: rgba(255,255,255,0.2);
}

.assistant-body {
    max-height: 500px;
    display: flex;
    flex-direction: column;
}

.chat-messages {
    flex: 1;
    padding: 1rem;
    overflow-y: auto;
    max-height: 400px;
}

.message {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.message-avatar {
    width: 35px;
    height: 35px;
    background: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
}

.message.user .message-avatar {
    background: var(--secondary-color);
}

.message-content {
    background: var(--light-color);
    padding: 0.75rem 1rem;
    border-radius: 15px;
    flex: 1;
}

.message.user .message-content {
    background: var(--primary-color);
    color: white;
}

.chat-input {
    padding: 1rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 0.5rem;
}

.chat-text-input {
    flex: 1;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 25px;
    font-size: 0.9rem;
    transition: var(--transition);
}

.chat-text-input:focus {
    border-color: var(--primary-color);
    outline: none;
}

.chat-send-btn {
    width: 40px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    transition: var(--transition);
}

.chat-send-btn:hover {
    background: var(--secondary-color);
}

/* 页脚 */
.footer {
    background: var(--dark-color);
    color: white;
    padding: 3rem 2rem 1rem;
}

.footer-container {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h4 {
    margin-bottom: 1rem;
    font-size: 1.25rem;
}

.footer-section p {
    color: #BDC3C7;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.footer-section a {
    display: block;
    color: #BDC3C7;
    margin-bottom: 0.5rem;
    transition: var(--transition);
}

.footer-section a:hover {
    color: white;
}

.social-links {
    display: flex;
    gap: 1rem;
}

.social-links a {
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.social-links a:hover {
    background: var(--primary-color);
}

.footer-bottom {
    text-align: center;
    padding-top: 1rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    color: #BDC3C7;
}

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 15px;
    width: 90%;
    max-width: 400px;
    overflow: hidden;
}

.modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-close {
    background: transparent;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    transition: var(--transition);
}

.modal-close:hover {
    background: rgba(255,255,255,0.2);
}

.modal-body {
    padding: 2rem;
}

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

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

.form-group input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 1rem;
    transition: var(--transition);
}

.form-group input:focus {
    border-color: var(--primary-color);
    outline: none;
}

.btn-full {
    width: 100%;
    padding: 1rem;
    background: var(--primary-color);
    color: white;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    transition: var(--transition);
}

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

.login-footer {
    text-align: center;
    margin-top: 1.5rem;
    color: var(--text-light);
}

.login-footer a {
    color: var(--primary-color);
    font-weight: 600;
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .create-container {
        grid-template-columns: 1fr;
    }
    
    .hero-3d {
        width: 100%;
        opacity: 0.3;
    }
}

@media (max-width: 768px) {
    .nav-menu {
        display: none;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-stats {
        flex-direction: column;
        gap: 1.5rem;
    }
    
    .ai-assistant {
        width: calc(100% - 2rem);
        right: 1rem;
        bottom: 1rem;
    }
}

@media (max-width: 480px) {
    .hero-buttons {
        flex-direction: column;
    }
    
    .experiments-filter {
        flex-wrap: wrap;
    }
    
    .input-options {
        grid-template-columns: 1fr;
    }
}
