/* 全局重置与变量 */
:root {
    --primary: #6c63ff;
    --primary-dark: #5a52d5;
    --secondary: #f0f0ff;
    --text: #2d2d3a;
    --text-light: #6b6b80;
    --bg: #ffffff;
    --bg-light: #f8f9ff;
    --radius: 16px;
    --shadow: 0 4px 20px rgba(108, 99, 255, 0.12);
    --shadow-hover: 0 8px 30px rgba(108, 99, 255, 0.2);
    --transition: 0.3s ease;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: var(--text);
    line-height: 1.6;
    background: var(--bg);
}

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

/* 导航 */
.navbar {
    background: rgba(255,255,255,0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid #eee;
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 12px 0;
}

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

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-links {
    display: flex;
    gap: 24px;
    align-items: center;
}

.nav-links a {
    color: var(--text);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: var(--transition);
    padding: 6px 0;
    border-bottom: 2px solid transparent;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.admin-link {
    background: var(--primary);
    color: #fff !important;
    padding: 8px 18px !important;
    border-radius: 8px;
    border-bottom: none !important;
}

.admin-link:hover {
    background: var(--primary-dark) !important;
    color: #fff !important;
}

.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.hamburger span {
    width: 28px;
    height: 3px;
    background: var(--text);
    border-radius: 3px;
    transition: var(--transition);
}

/* 英雄区 */
.hero {
    padding: 80px 0 60px;
    background: linear-gradient(135deg, var(--bg-light) 0%, #e8e6ff 100%);
}

.hero .container {
    display: flex;
    align-items: center;
    gap: 40px;
}

.hero-content {
    flex: 1;
}

.hero-content h1 {
    font-size: 2.8rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 20px;
    background: linear-gradient(135deg, var(--primary), #a78bfa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-content p {
    font-size: 1.15rem;
    color: var(--text-light);
    margin-bottom: 30px;
    max-width: 540px;
}

.hero-actions {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.hero-image {
    flex: 1;
    max-width: 400px;
}

.hero-image img {
    width: 100%;
    border-radius: var(--radius);
}

/* 按钮 */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 32px;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition);
    border: 2px solid transparent;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.btn-secondary {
    background: #fff;
    color: var(--primary);
    border-color: var(--primary);
}

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

.btn-outline {
    background: transparent;
    color: var(--primary);
    border-color: var(--primary);
}

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

.btn-block {
    width: 100%;
    justify-content: center;
}

.btn-sm {
    padding: 8px 18px;
    font-size: 0.85rem;
}

/* 标题 */
.section-title {
    font-size: 2rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 12px;
    color: var(--text);
}

.section-subtitle {
    text-align: center;
    color: var(--text-light);
    font-size: 1.05rem;
    margin-bottom: 40px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

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

.mt-30 {
    margin-top: 30px;
}

/* 功能卡片 */
.features {
    padding: 80px 0;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}

.feature-card {
    background: #fff;
    padding: 32px 24px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: var(--transition);
    border: 1px solid #f0f0ff;
}

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

.feature-icon {
    width: 56px;
    height: 56px;
    background: var(--secondary);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    color: var(--primary);
    margin-bottom: 16px;
}

.feature-card h3 {
    font-size: 1.2rem;
    margin-bottom: 8px;
}

.feature-card p {
    color: var(--text-light);
    font-size: 0.95rem;
}

/* 统计 */
.stats {
    padding: 60px 0;
    background: var(--primary);
    color: #fff;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
    text-align: center;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 800;
}

.stat-label {
    font-size: 1rem;
    opacity: 0.85;
    margin-top: 4px;
}

/* 模板 */
.templates-preview {
    padding: 80px 0;
}

.templates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
}

.template-card {
    background: #fff;
    padding: 24px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: var(--transition);
    border: 1px solid #f0f0ff;
    position: relative;
}

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

.template-icon {
    font-size: 2rem;
    color: var(--primary);
    margin-bottom: 12px;
}

.template-card h4 {
    font-size: 1.1rem;
    margin-bottom: 6px;
}

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

.template-badge {
    display: inline-block;
    background: var(--secondary);
    color: var(--primary);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

/* 页脚 */
.footer {
    background: #2d2d3a;
    color: #ccc;
    padding: 50px 0 20px;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.footer-col h4 {
    color: #fff;
    font-size: 1.1rem;
    margin-bottom: 14px;
}

.footer-col p {
    font-size: 0.9rem;
    line-height: 1.6;
}

.footer-col a {
    display: block;
    color: #aaa;
    text-decoration: none;
    font-size: 0.9rem;
    margin-bottom: 8px;
    transition: var(--transition);
}

.footer-col a:hover {
    color: var(--primary);
}

.social-links {
    display: flex;
    gap: 12px;
}

.social-links a {
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.1);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: #fff;
}

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

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 20px;
    text-align: center;
    font-size: 0.9rem;
}

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

/* 页面通用 */
.page-hero {
    padding: 60px 0 40px;
    background: linear-gradient(135deg, var(--bg-light), #e8e6ff);
    text-align: center;
}

.page-hero h1 {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 12px;
}

.page-hero p {
    color: var(--text-light);
    font-size: 1.05rem;
}

/* 搜索 */
.search-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    max-width: 500px;
}

.form-control {
    flex: 1;
    padding: 12px 18px;
    border: 2px solid #e0e0f0;
    border-radius: 10px;
    font-size: 1rem;
    transition: var(--transition);
    outline: none;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(108, 99, 255, 0.15);
}

/* 历史记录 */
.history-list {
    padding: 40px 0;
}

.history-items {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.history-item {
    background: #fff;
    padding: 20px 24px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid #f0f0ff;
}

.history-meta {
    display: flex;
    gap: 16px;
    margin-bottom: 8px;
    font-size: 0.85rem;
    color: var(--text-light);
}

.history-type {
    background: var(--secondary);
    color: var(--primary);
    padding: 2px 10px;
    border-radius: 12px;
    font-weight: 500;
}

.history-item h4 {
    font-size: 1.05rem;
    margin-bottom: 4px;
}

.history-item p {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 12px;
}

.history-actions {
    display: flex;
    gap: 10px;
}

/* 导出 */
.export-options {
    padding: 60px 0;
}

.export-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}

.export-card {
    background: #fff;
    padding: 36px 24px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    text-align: center;
    transition: var(--transition);
    border: 1px solid #f0f0ff;
}

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

.export-icon {
    font-size: 3rem;
    color: var(--primary);
    margin-bottom: 16px;
}

.export-card h3 {
    margin-bottom: 8px;
}

.export-card p {
    color: var(--text-light);
    margin-bottom: 20px;
}

/* 管理后台 */
.admin-body {
    background: var(--bg-light);
}

.admin-container {
    max-width: 800px;
    margin: 40px auto;
    padding: 0 20px;
}

.login-form {
    background: #fff;
    padding: 40px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    max-width: 400px;
    margin: 0 auto;
}

.login-form h2 {
    text-align: center;
    margin-bottom: 24px;
}

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

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    font-size: 0.95rem;
}

.admin-dashboard {
    background: #fff;
    padding: 40px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.admin-dashboard h2 {
    margin-bottom: 24px;
}

.alert {
    padding: 12px 18px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 0.95rem;
}

.alert-error {
    background: #fee2e2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

textarea.form-control {
    min-height: 120px;
    font-family: monospace;
    font-size: 0.85rem;
}

/* 响应式 */
@media (max-width: 768px) {
    .hamburger {
        display: flex;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 60px;
        left: 0;
        right: 0;
        background: #fff;
        flex-direction: column;
        padding: 20px;
        box-shadow: 0 10px 20px rgba(0,0,0,0.1);
        border-bottom: 1px solid #eee;
    }

    .nav-links.active {
        display: flex;
    }

    .hero .container {
        flex-direction: column;
        text-align: center;
    }

    .hero-content h1 {
        font-size: 2rem;
    }

    .hero-content p {
        margin-left: auto;
        margin-right: auto;
    }

    .hero-actions {
        justify-content: center;
    }

    .hero-image {
        max-width: 300px;
    }

    .section-title {
        font-size: 1.6rem;
    }

    .features-grid,
    .templates-grid,
    .export-grid {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .hero-content h1 {
        font-size: 1.6rem;
    }

    .btn {
        padding: 12px 24px;
        font-size: 0.9rem;
    }

    .footer-grid {
        grid-template-columns: 1fr;
    }
}