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

:root {
    --primary: #6C5CE7;
    --primary-dark: #5A4BD1;
    --primary-light: #A29BFE;
    --secondary: #00CEC9;
    --accent: #FD79A8;
    --bg-dark: #0a0a1a;
    --bg-card: #1a1a2e;
    --bg-card-hover: #252545;
    --text-primary: #ffffff;
    --text-secondary: #b0b0c8;
    --text-muted: #6c6c8a;
    --border-color: #2d2d4a;
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    --radius: 16px;
    --radius-sm: 10px;
    --gradient-1: linear-gradient(135deg, #6C5CE7, #00CEC9);
    --gradient-2: linear-gradient(135deg, #FD79A8, #6C5CE7);
    --gradient-3: linear-gradient(135deg, #00CEC9, #FD79A8);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
}

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

/* ===== Header ===== */
.header {
    background: rgba(10, 10, 26, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 0 20px;
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text-primary);
    font-size: 24px;
    font-weight: 800;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: var(--gradient-1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

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

.nav a {
    color: var(--text-secondary);
    text-decoration: none;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    transition: all 0.3s ease;
    font-size: 15px;
    font-weight: 500;
    position: relative;
}

.nav a:hover,
.nav a.active {
    color: var(--text-primary);
    background: rgba(108, 92, 231, 0.15);
}

.nav a.active {
    color: var(--primary-light);
}

/* ===== Hero Section ===== */
.hero {
    text-align: center;
    padding: 100px 20px 60px;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 50%, rgba(108, 92, 231, 0.08) 0%, transparent 50%),
                radial-gradient(circle at 70% 50%, rgba(0, 206, 201, 0.08) 0%, transparent 50%);
    pointer-events: none;
}

.hero h1 {
    font-size: 52px;
    font-weight: 800;
    margin-bottom: 16px;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
}

.hero p {
    font-size: 18px;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 40px;
    position: relative;
}

/* ===== Feature Cards ===== */
.features {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    padding: 20px 0 80px;
}

.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 40px 32px;
    text-align: center;
    transition: all 0.4s ease;
    cursor: pointer;
    text-decoration: none;
    color: var(--text-primary);
    position: relative;
    overflow: hidden;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.feature-card:nth-child(1)::before { background: var(--gradient-1); }
.feature-card:nth-child(2)::before { background: var(--gradient-2); }
.feature-card:nth-child(3)::before { background: var(--gradient-3); }

.feature-card:hover {
    transform: translateY(-8px);
    border-color: transparent;
    box-shadow: var(--shadow);
}

.feature-card:hover::before {
    opacity: 1;
}

.feature-icon {
    width: 72px;
    height: 72px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    margin: 0 auto 20px;
}

.feature-card:nth-child(1) .feature-icon { background: rgba(108, 92, 231, 0.15); }
.feature-card:nth-child(2) .feature-icon { background: rgba(253, 121, 168, 0.15); }
.feature-card:nth-child(3) .feature-icon { background: rgba(0, 206, 201, 0.15); }

.feature-card h3 {
    font-size: 22px;
    margin-bottom: 12px;
}

.feature-card p {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.7;
}

.feature-tag {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    margin-top: 16px;
}

.feature-card:nth-child(1) .feature-tag {
    background: rgba(108, 92, 231, 0.15);
    color: var(--primary-light);
}

.feature-card:nth-child(2) .feature-tag {
    background: rgba(253, 121, 168, 0.15);
    color: var(--accent);
}

.feature-card:nth-child(3) .feature-tag {
    background: rgba(0, 206, 201, 0.15);
    color: var(--secondary);
}

/* ===== Page Header ===== */
.page-header {
    text-align: center;
    padding: 60px 20px 40px;
}

.page-header h1 {
    font-size: 36px;
    font-weight: 800;
    margin-bottom: 8px;
}

.page-header p {
    color: var(--text-secondary);
    font-size: 16px;
}

/* ===== Generator Form ===== */
.generator-section {
    padding-bottom: 80px;
}

.generator-box {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 40px;
    max-width: 720px;
    margin: 0 auto;
}

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

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

.form-group textarea,
.form-group input[type="text"],
.form-group input[type="url"] {
    width: 100%;
    padding: 14px 18px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 15px;
    transition: all 0.3s ease;
    font-family: inherit;
    outline: none;
}

.form-group textarea {
    min-height: 120px;
    resize: vertical;
}

.form-group textarea:focus,
.form-group input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.15);
}

.form-group .hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 6px;
}

.form-row {
    display: flex;
    gap: 20px;
}

.form-row .form-group {
    flex: 1;
}

.form-group select {
    width: 100%;
    padding: 14px 18px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 15px;
    font-family: inherit;
    outline: none;
    cursor: pointer;
    transition: all 0.3s ease;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23b0b0c8' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
}

.form-group select:hover {
    border-color: var(--primary-light);
}

.form-group select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.15);
}

.form-group select option {
    background: var(--bg-card);
    color: var(--text-primary);
}

/* ===== Upload Area ===== */
.upload-area {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-sm);
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.upload-area:hover,
.upload-area.dragover {
    border-color: var(--primary);
    background: rgba(108, 92, 231, 0.05);
}

.upload-area .upload-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.upload-area .upload-text {
    color: var(--text-secondary);
    font-size: 14px;
}

.upload-area .upload-hint {
    color: var(--text-muted);
    font-size: 12px;
    margin-top: 8px;
}

.upload-area input[type="file"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.upload-preview {
    display: none;
    margin-top: 16px;
    position: relative;
}

.upload-preview img {
    max-width: 100%;
    max-height: 300px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

.upload-preview .remove-btn {
    position: absolute;
    top: -10px;
    right: -10px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--accent);
    border: none;
    color: white;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.upload-area.has-preview .upload-icon,
.upload-area.has-preview .upload-text,
.upload-area.has-preview .upload-hint {
    display: none;
}

.upload-area.has-preview .upload-preview {
    display: block;
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 32px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    width: 100%;
}

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

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

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.12);
}

/* ===== Result Area ===== */
.result-area {
    display: none;
    margin-top: 32px;
    padding-top: 32px;
    border-top: 1px solid var(--border-color);
}

.result-area.show {
    display: block;
}

.result-status {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
}

.result-status .spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(108, 92, 231, 0.3);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.result-status .status-text {
    font-size: 14px;
    color: var(--text-secondary);
}

.result-status .progress-bar {
    flex: 1;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
}

.result-status .progress-bar .progress-fill {
    height: 100%;
    background: var(--gradient-1);
    border-radius: 2px;
    transition: width 0.5s ease;
    width: 0%;
}

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

.result-display img,
.result-display video {
    max-width: 100%;
    max-height: 500px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
}

.result-display .result-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
    justify-content: center;
}

.result-display .result-actions .btn {
    width: auto;
    padding: 10px 24px;
    font-size: 14px;
}

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

/* ===== History Section ===== */
.history-section {
    margin-top: 40px;
}

.history-section h3 {
    font-size: 18px;
    margin-bottom: 16px;
    color: var(--text-secondary);
}

.history-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.history-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.history-item:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
}

.history-item img,
.history-item video {
    width: 100%;
    height: 140px;
    object-fit: cover;
    border-radius: 6px;
}

.history-item .history-info {
    padding: 8px 0 0;
}

.history-item .history-info .history-type {
    font-size: 12px;
    color: var(--primary-light);
    font-weight: 600;
}

.history-item .history-info .history-time {
    font-size: 11px;
    color: var(--text-muted);
}

/* ===== Footer ===== */
.footer {
    text-align: center;
    padding: 30px 20px;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 13px;
}

/* ===== Toast ===== */
.toast {
    position: fixed;
    top: 90px;
    right: 20px;
    padding: 14px 24px;
    border-radius: var(--radius-sm);
    color: white;
    font-size: 14px;
    font-weight: 500;
    z-index: 1000;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.4s ease;
    max-width: 360px;
}

.toast.show {
    opacity: 1;
    transform: translateX(0);
}

.toast.error {
    background: #e74c3c;
}

.toast.success {
    background: #2ecc71;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 32px;
    }

    .hero p {
        font-size: 15px;
    }

    .features {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .generator-box {
        padding: 24px;
    }

    .form-row {
        flex-direction: column;
        gap: 0;
    }

    .page-header h1 {
        font-size: 28px;
    }

    .nav {
        gap: 4px;
    }

    .nav a {
        padding: 8px 12px;
        font-size: 13px;
    }

    .result-display .result-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .result-display .result-actions .btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 12px;
    }

    .header .container {
        height: 60px;
    }

    .logo {
        font-size: 20px;
    }

    .logo-icon {
        width: 32px;
        height: 32px;
        font-size: 16px;
    }

    .hero {
        padding: 60px 12px 40px;
    }

    .hero h1 {
        font-size: 26px;
    }

    .generator-box {
        padding: 16px;
    }

    .form-group textarea {
        min-height: 100px;
    }
}
