/* ========================================
   高端交易心理问卷系统 - 精致设计
   ======================================== */

/* 全局CSS变量 - 精致浅色主题 */
:root {
    /* 主色调 - 深蓝紫渐变 */
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --primary-color: #667eea;
    --primary-dark: #5568d3;
    --primary-light: #8b9bff;

    /* 辅助色 */
    --accent-color: #06b6d4;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --info-color: #06b6d4;

    /* 背景色 - 浅色模式 */
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --bg-glass: rgba(255, 255, 255, 0.85);

    /* 文字颜色 */
    --text-primary: #0f172a;
    --text-secondary: #334155;
    --text-tertiary: #64748b;
    --text-muted: #94a3b8;

    /* 边框和分隔线 */
    --border-color: rgba(0, 0, 0, 0.08);
    --divider-color: rgba(0, 0, 0, 0.06);

    /* 阴影效果 - 浅色柔和阴影 */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.12), 0 10px 10px -5px rgba(0, 0, 0, 0.06);
    --shadow-glow: 0 0 20px rgba(102, 126, 234, 0.15);

    /* 毛玻璃效果 */
    --glass-bg: rgba(255, 255, 255, 0.75);
    --glass-border: rgba(0, 0, 0, 0.08);

    /* 圆角 */
    --radius-sm: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;

    /* 过渡效果 */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* 深色主题（可选） */
[data-theme="dark"] {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --bg-glass: rgba(30, 41, 59, 0.7);
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-tertiary: #94a3b8;
    --text-muted: #64748b;
    --border-color: rgba(255, 255, 255, 0.1);
    --divider-color: rgba(255, 255, 255, 0.05);
    --glass-bg: rgba(30, 41, 59, 0.7);
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -1px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -2px rgba(0, 0, 0, 0.4);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.6), 0 10px 10px -5px rgba(0, 0, 0, 0.4);
}

/* ========================================
   基础样式重置
   ======================================== */

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI',
                 Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* 背景装饰 - 精致浅色 */
body::before {
    content: '';
    position: fixed;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 20%, rgba(102, 126, 234, 0.04) 0%, transparent 50%),
                radial-gradient(circle at 70% 80%, rgba(118, 75, 162, 0.03) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    position: relative;
    z-index: 1;
}

/* ========================================
   顶部导航栏 - Glassmorphism
   ======================================== */

.header {
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 1.25rem 0;
    background: var(--glass-bg);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.header .container > div:first-child {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
    margin: 0;
}

.header-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* ========================================
   按钮系统 - 现代化设计
   ======================================== */

.btn {
    position: relative;
    padding: 0.625rem 1.25rem;
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-base);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    overflow: hidden;
    letter-spacing: 0.01em;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, transparent 100%);
    opacity: 0;
    transition: opacity var(--transition-base);
}

.btn:hover::before {
    opacity: 1;
}

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

.btn:active {
    transform: translateY(0);
}

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

.btn-primary {
    background: var(--primary-gradient);
    color: white;
    box-shadow: var(--shadow-md), 0 0 0 0 rgba(102, 126, 234, 0.5);
}

.btn-primary:hover {
    box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.btn-secondary {
    background: white;
    color: var(--text-primary);
    border: 1.5px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

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

.btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.btn-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
}

.btn-info {
    background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
    color: white;
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.125rem;
    border-radius: var(--radius-lg);
}

/* ========================================
   进度条 - 精美设计
   ======================================== */

.progress-bar-container {
    display: none;  /* 隐藏进度条 */
}

.progress-info {
    margin-bottom: 0.75rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.progress-info span {
    font-weight: 600;
}

.progress-bar {
    position: relative;
    height: 12px;
    background: var(--bg-tertiary);
    border-radius: 9999px;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.06);
}

.progress-fill {
    height: 100%;
    background: var(--primary-gradient);
    border-radius: 9999px;
    transition: width var(--transition-slow);
    position: relative;
    box-shadow: 0 0 15px rgba(102, 126, 234, 0.25);
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* ========================================
   主要内容布局
   ======================================== */

main {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 2rem;
    padding: 2.5rem 2rem;
    min-height: calc(100vh - 200px);
}

/* ========================================
   侧边栏 - Glassmorphism
   ======================================== */

.sidebar {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 2rem;
    box-shadow: var(--shadow-md);
    height: fit-content;
    position: sticky;
    top: 100px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
}

.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 3px;
}

.sidebar h3 {
    margin-bottom: 1.5rem;
    font-size: 1.25rem;
    font-weight: 700;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-section {
    margin-bottom: 2rem;
}

.nav-section h4 {
    font-size: 0.813rem;
    color: var(--text-tertiary);
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
}

.nav-links {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.nav-link {
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 0.875rem;
    transition: all var(--transition-base);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-secondary);
    font-weight: 500;
    border: 1px solid transparent;
}

.nav-link:hover {
    background: rgba(102, 126, 234, 0.1);
    border-color: rgba(102, 126, 234, 0.3);
    transform: translateX(4px);
}

.nav-link.active {
    background: var(--primary-gradient);
    color: white;
    box-shadow: var(--shadow-md), 0 0 15px rgba(102, 126, 234, 0.4);
    font-weight: 600;
}

.nav-link.completed {
    color: var(--success-color);
}

.nav-link .status-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
    flex-shrink: 0;
    transition: all var(--transition-base);
    position: relative;
}

.nav-link.completed .status-icon {
    background: var(--success-color);
    border-color: var(--success-color);
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
}

.nav-link.completed .status-icon::after {
    content: '✓';
    color: white;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 12px;
    font-weight: bold;
}

.nav-link.important {
    border-left: 3px solid var(--warning-color);
}

/* ========================================
   内容区域 - 卡片设计
   ======================================== */

.content {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 3rem;
    box-shadow: var(--shadow-md);
    min-height: 600px;
}

/* ========================================
   欢迎卡片
   ======================================== */

.welcome-card {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.welcome-card h2 {
    margin-bottom: 1.5rem;
    font-size: 2.5rem;
    font-weight: 800;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
}

.welcome-card > p {
    color: var(--text-secondary);
    margin-bottom: 2.5rem;
    font-size: 1.125rem;
    line-height: 1.8;
}

.tips {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.06) 0%, rgba(217, 119, 6, 0.03) 100%);
    border: 1.5px solid rgba(245, 158, 11, 0.15);
    border-radius: var(--radius-lg);
    padding: 2rem;
    text-align: left;
    margin-bottom: 2.5rem;
    backdrop-filter: blur(10px);
}

.tips h3 {
    margin-bottom: 1.25rem;
    color: var(--warning-color);
    font-size: 1.25rem;
    font-weight: 700;
}

.tips ul {
    list-style: none;
}

.tips li {
    padding: 0.75rem 0;
    color: var(--text-secondary);
    line-height: 1.7;
}

/* ========================================
   场景表单
   ======================================== */

.scenario-forms {
    max-width: 900px;
}

.scenario-card {
    display: none;
    animation: fadeInUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.scenario-card.active {
    display: block;
}

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

.scenario-header {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid var(--divider-color);
}

.scenario-meta {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.badge {
    display: inline-block;
    padding: 0.375rem 1rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-primary {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.12) 0%, rgba(118, 75, 162, 0.12) 100%);
    color: var(--primary-dark);
    border: 1px solid rgba(102, 126, 234, 0.2);
}

.badge-warning {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.12) 0%, rgba(217, 119, 6, 0.12) 100%);
    color: #d97706;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.scenario-title {
    font-size: 1.5rem;
    margin-top: 1rem;
    line-height: 1.5;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

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

.form-group label {
    display: block;
    margin-bottom: 0.75rem;
    font-weight: 700;
    color: var(--text-primary);
    font-size: 1rem;
}

.form-group textarea {
    width: 100%;
    padding: 1rem 1.25rem;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    font-family: inherit;
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-primary);
    resize: vertical;
    min-height: 120px;
    transition: all var(--transition-base);
}

.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1), var(--shadow-md);
    background: var(--bg-primary);
}

.form-group textarea::placeholder {
    color: var(--text-muted);
}

.form-group .helper-text {
    font-size: 0.875rem;
    color: var(--text-tertiary);
    margin-top: 0.5rem;
    line-height: 1.5;
}

/* ========================================
   底部导航 - 隐藏固定导航
   ======================================== */

.footer-nav {
    display: none;  /* 隐藏固定的底部导航 */
}

/* ========================================
   场景内导航按钮
   ======================================== */

.scenario-nav-buttons {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 2px solid var(--divider-color);
    gap: 1rem;
}

.scenario-counter {
    font-weight: 700;
    font-size: 0.875rem;
    color: var(--text-secondary);
    background: var(--bg-secondary);
    padding: 0.625rem 1.25rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    white-space: nowrap;
}

.scenario-nav-buttons .btn {
    min-width: 120px;
}

/* ========================================
   模态对话框
   ======================================== */

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(10px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 2.5rem;
    max-width: 550px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    animation: modalSlideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.modal-close {
    float: right;
    font-size: 1.75rem;
    cursor: pointer;
    color: var(--text-tertiary);
    transition: all var(--transition-base);
    line-height: 1;
}

.modal-close:hover {
    color: var(--text-primary);
    transform: rotate(90deg);
}

#modalTitle {
    margin-bottom: 1.5rem;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
}

#modalBody {
    margin-bottom: 2rem;
    line-height: 1.8;
    color: var(--text-secondary);
}

.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

/* ========================================
   加载指示器
   ======================================== */

.loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.loader-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(102, 126, 234, 0.2);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.loader p {
    color: var(--text-primary);
    margin-top: 1.5rem;
    font-size: 1.125rem;
    font-weight: 600;
}

/* ========================================
   响应式设计
   ======================================== */

@media (max-width: 1024px) {
    main {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
        max-height: none;
        margin-bottom: 2rem;
    }
}

@media (max-width: 768px) {
    .header .container {
        flex-direction: column;
        align-items: stretch;
    }

    .header h1 {
        text-align: center;
        font-size: 1.25rem;
    }

    .header-actions {
        justify-content: center;
        flex-wrap: wrap;
    }

    .content {
        padding: 1.5rem;
    }

    .scenario-title {
        font-size: 1.25rem;
    }

    .scenario-nav-buttons {
        flex-wrap: wrap;
        gap: 0.75rem;
    }

    .scenario-nav-buttons .btn {
        flex: 1;
        min-width: auto;
    }

    .scenario-counter {
        width: 100%;
        text-align: center;
        order: -1;
    }

    .footer-nav .container {
        flex-direction: column;
        gap: 1rem;
    }
}

/* ========================================
   自定义滚动条
   ======================================== */

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* ========================================
   打印样式
   ======================================== */

@media print {
    body::before,
    .header,
    .sidebar,
    .footer-nav,
    .modal,
    .loader {
        display: none !important;
    }

    body {
        background: white;
        color: black;
    }

    .content {
        box-shadow: none;
        border: none;
        padding: 0;
    }
}
