/* ============================================
   奇灵数字人 - 完整平台共享样式
   ============================================ */

/* --- CSS 变量 --- */
:root {
    --primary: #1677ff;
    --primary-hover: #4096ff;
    --primary-weak: #e8f0ff;
    --bg: #f5f7fa;
    --card: #ffffff;
    --text: #1a1a2e;
    --text-secondary: #5c6272;
    --text-muted: #9aa0af;
    --border: #e6e8ef;
    --border-strong: #d0d5e0;
    --success: #52c41a;
    --warning: #faad14;
    --danger: #ff4d4f;
    --radius-lg: 20px;
    --radius-md: 14px;
    --radius-sm: 10px;
    --shadow-card: 0 6px 24px rgba(23, 43, 99, 0.07);
    --shadow-hover: 0 12px 32px rgba(23, 43, 99, 0.12);
    --header-h: 64px;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-size: 15px;
}

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

img {
    max-width: 100%;
    display: block;
}

button {
    font-family: inherit;
}

/* ============================================
   顶部导航
   ============================================ */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    height: var(--header-h);
    padding: 0 24px;
    display: flex;
    align-items: center;
    gap: 32px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.brand-logo {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, #1677ff 0%, #4096ff 100%);
    color: #fff;
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(22, 119, 255, 0.3);
}

.brand-name {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: 1px;
}

.main-nav {
    display: flex;
    gap: 4px;
    flex: 1;
}

.nav-link {
    padding: 8px 16px;
    border-radius: 999px;
    font-size: 15px;
    color: var(--text-secondary);
    transition: all 0.2s ease;
    white-space: nowrap;
}

.nav-link:hover {
    color: var(--primary);
    background: var(--primary-weak);
}

.nav-link.active {
    color: var(--primary);
    background: var(--primary-weak);
    font-weight: 600;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-shrink: 0;
}

.user-credits {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 6px 14px;
    border-radius: 999px;
    background: linear-gradient(135deg, #fff7e6 0%, #fff1d6 100%);
    font-size: 13px;
    color: #d48806;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid #ffe7ba;
    transition: all 0.2s ease;
}

.user-credits:hover {
    transform: scale(1.03);
    box-shadow: 0 2px 10px rgba(250, 173, 20, 0.2);
}

.user-credits .credits-icon { font-size: 14px; }
.user-credits .credits-num {
    font-weight: 800;
    font-size: 14px;
    transition: color 0.3s ease;
}

.user-credits .credits-num.flash {
    animation: creditsFlash 0.6s ease;
}

@keyframes creditsFlash {
    0% { color: #d48806; }
    50% { color: #ff4d4f; transform: scale(1.2); }
    100% { color: #d48806; }
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1677ff 0%, #4096ff 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s ease;
    border: 2px solid #fff;
    box-shadow: 0 2px 8px rgba(22, 119, 255, 0.25);
}

.user-avatar:hover {
    transform: scale(1.06);
    box-shadow: 0 4px 14px rgba(22, 119, 255, 0.35);
}

.menu-toggle {
    display: none;
    width: 40px;
    height: 40px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fff;
    font-size: 18px;
    color: var(--text);
    cursor: pointer;
    align-items: center;
    justify-content: center;
}

/* ============================================
   页脚
   ============================================ */
.site-footer {
    margin-top: auto;
    background: #ffffff;
    border-top: 1px solid var(--border);
    padding: 40px 24px 32px;
}

.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr 1fr;
    gap: 32px;
}

.footer-brand p {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 12px;
    max-width: 260px;
}

.footer-col h4 {
    font-size: 14px;
    color: var(--text);
    margin-bottom: 14px;
    font-weight: 600;
}

.footer-col a {
    display: block;
    font-size: 13px;
    color: var(--text-secondary);
    padding: 5px 0;
    transition: color 0.2s ease;
}

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

.footer-beian {
    max-width: 1200px;
    margin: 28px auto 0;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    font-size: 12px;
    color: var(--text-muted);
}

.footer-beian a {
    color: var(--text-muted);
}

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

/* ============================================
   按钮
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 22px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 500;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.25s ease;
    white-space: nowrap;
    user-select: none;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 4px 14px rgba(22, 119, 255, 0.3);
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(22, 119, 255, 0.4);
}

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

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

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

.btn-ghost:hover {
    background: #d6e6ff;
}

.btn-lg {
    padding: 14px 34px;
    font-size: 16px;
    border-radius: 12px;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 13px;
    border-radius: 8px;
}

.btn-block {
    width: 100%;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* ============================================
   卡片 / 容器
   ============================================ */
.page-wrap {
    flex: 1;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 24px 60px;
}

.card {
    background: var(--card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border);
}

.section-title {
    font-size: 32px;
    font-weight: 700;
    color: var(--text);
    text-align: center;
    letter-spacing: 1px;
}

.section-sub {
    font-size: 16px;
    color: var(--text-muted);
    text-align: center;
    margin-top: 10px;
}

/* ============================================
   表单
   ============================================ */
.form-group {
    margin-bottom: 18px;
}

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

.form-label .optional {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: normal;
}

.form-input {
    width: 100%;
    border: 1px solid var(--border-strong);
    outline: none;
    font-size: 14px;
    padding: 11px 14px;
    background: #fff;
    color: var(--text);
    resize: none;
    font-family: inherit;
    line-height: 1.6;
    border-radius: 10px;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.form-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(22, 119, 255, 0.12);
}

.form-input::placeholder {
    color: #b8bdca;
}

/* ============================================
   Toast 通知
   ============================================ */
.toast-container {
    position: fixed;
    top: 76px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.14);
    font-size: 14px;
    color: #333;
    animation: toastSlideIn 0.3s ease;
    pointer-events: auto;
    max-width: 90vw;
    border: 1px solid var(--border);
}

.toast.toast-success { border-left: 4px solid var(--success); }
.toast.toast-warning { border-left: 4px solid var(--warning); }
.toast.toast-error { border-left: 4px solid var(--danger); }
.toast.toast-info { border-left: 4px solid var(--primary); }

.toast .toast-icon { font-size: 18px; flex-shrink: 0; }

.toast.toast-out {
    animation: toastSlideOut 0.3s ease forwards;
}

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

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

/* ============================================
   模态弹窗
   ============================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.modal-overlay.open {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: #fff;
    border-radius: var(--radius-lg);
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.18);
    max-width: 560px;
    width: 100%;
    max-height: 82vh;
    overflow-y: auto;
    transform: scale(0.95);
    transition: transform 0.25s ease;
}

.modal-overlay.open .modal {
    transform: scale(1);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 16px;
    border-bottom: 1px solid #f0f0f0;
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 1;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.modal-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
}

.modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: none;
    font-size: 20px;
    color: #999;
    cursor: pointer;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: #f5f5f5;
    color: #333;
}

.modal-body {
    padding: 20px 24px 24px;
}

/* ============================================
   创作页通用组件（角色/音色）
   ============================================ */
.character-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 14px;
}

.character-card {
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.25s ease;
    background: #fff;
}

.character-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-card);
}

.character-card.selected {
    border-color: var(--primary);
    background: #f0f7ff;
}

.character-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    margin: 0 auto 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
}

.character-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 4px;
}

.character-desc {
    font-size: 12px;
    color: var(--text-muted);
}

.voice-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.voice-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border: 2px solid var(--border);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.25s ease;
}

.voice-item:hover {
    border-color: var(--primary);
}

.voice-item.selected {
    border-color: var(--primary);
    background: #f0f7ff;
}

.voice-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.voice-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #e0e7ff, #dbeafe);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.voice-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
}

.voice-tag {
    font-size: 12px;
    color: var(--text-muted);
}

.voice-preview-btn {
    padding: 6px 14px;
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    background: #fff;
    font-size: 12px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.voice-preview-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* ============================================
   空状态
   ============================================ */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state .empty-icon {
    font-size: 56px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 18px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    font-weight: 600;
}

.empty-state p {
    font-size: 14px;
    max-width: 360px;
    margin: 0 auto 20px;
}

/* ============================================
   响应式
   ============================================ */
@media (max-width: 860px) {
    .menu-toggle {
        display: flex;
    }

    .main-nav {
        position: fixed;
        top: var(--header-h);
        left: 0;
        right: 0;
        background: #fff;
        flex-direction: column;
        padding: 12px 20px 20px;
        gap: 4px;
        box-shadow: 0 12px 30px rgba(0, 0, 0, 0.1);
        border-bottom: 1px solid var(--border);
        display: none;
    }

    .main-nav.open {
        display: flex;
    }

    .nav-link {
        padding: 12px 16px;
        border-radius: 10px;
    }

    .header-inner {
        gap: 12px;
        padding: 0 16px;
    }

    .brand-name {
        font-size: 16px;
    }

    .footer-inner {
        grid-template-columns: 1fr 1fr;
        gap: 24px;
    }

    .page-wrap {
        padding: 24px 16px 48px;
    }
}

@media (max-width: 480px) {
    .user-credits {
        padding: 5px 10px;
        font-size: 12px;
    }

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

    .footer-beian {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* ========== 首页滚动入场动画 ========== */
.feature-card.pre-reveal,
.step-card.pre-reveal,
.scene-card.pre-reveal,
.price-card.pre-reveal {
    opacity: 0;
    transform: translateY(24px);
}

.feature-card,
.step-card,
.scene-card,
.price-card {
    transition: opacity 0.6s ease, transform 0.6s ease, box-shadow 0.3s ease;
}

.feature-card.revealed,
.step-card.revealed,
.scene-card.revealed,
.price-card.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* --- 内测滚动通知条 --- */
.beta-notice {
    background: linear-gradient(90deg, #fff7e6 0%, #fffbe6 50%, #fff7e6 100%);
    border-bottom: 1px solid #ffe7ba;
    overflow: hidden;
    white-space: nowrap;
}

.beta-notice .notice-track {
    display: inline-block;
    padding: 7px 0;
    font-size: 13px;
    color: #d46b08;
    font-weight: 600;
    letter-spacing: 1.5px;
    animation: notice-scroll 20s linear infinite;
    will-change: transform;
}

@keyframes notice-scroll {
    0% { transform: translateX(100vw); }
    100% { transform: translateX(-100%); }
}
