/* ========================================
   投资风格测试 - 样式文件
   ======================================== */

:root {
    --primary-color: #D4AF37;
    --primary-dark: #C5A028;
    --secondary-color: #1B3A5C;
    --text-color: #333;
    --text-light: #666;
    --bg-color: #F5F7FA;
    --card-bg: #ffffff;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.08);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 100%;
    padding: 0 16px 40px;
}

/* Header */
.header {
    display: flex;
    align-items: center;
    padding: 16px 0;
    gap: 12px;
}

.back-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}

.back-btn svg {
    width: 20px;
    height: 20px;
    color: var(--secondary-color);
}

.back-btn:active {
    transform: scale(0.95);
}

.header .title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--secondary-color);
}

/* Progress */
.progress-section {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 16px 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
}

.progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.progress-text {
    font-size: 0.9rem;
    color: var(--text-light);
}

.progress-count {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--secondary-color);
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--bg-color);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-dark));
    border-radius: 4px;
    transition: width 0.3s ease;
}

/* Question Card */
.question-section {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 24px 20px;
    box-shadow: var(--shadow-md);
    margin-bottom: 20px;
}

.question-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: var(--secondary-color);
    color: #fff;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 8px;
    margin-bottom: 16px;
}

.question-text {
    font-size: 1rem;
    font-weight: 600;
    color: var(--secondary-color);
    margin-bottom: 16px;
    line-height: 1.6;
}

.options-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.option-item {
    display: flex;
    align-items: flex-start;
    padding: 12px 14px;
    background: var(--bg-color);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.option-item:hover {
    background: #eef1f5;
}

.option-item.selected {
    background: rgba(212, 175, 55, 0.1);
    border-color: var(--primary-color);
}

.option-letter {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: var(--card-bg);
    border: 2px solid #ddd;
    border-radius: 50%;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-light);
    margin-right: 10px;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.option-item.selected .option-letter {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
}

.option-text {
    font-size: 0.9rem;
    color: var(--text-color);
    line-height: 1.5;
    flex: 1;
}

/* Navigation */
.nav-section {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.nav-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 20px;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
}

.nav-btn.secondary {
    background: var(--card-bg);
    color: var(--text-color);
    box-shadow: var(--shadow-sm);
}

.nav-btn.primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: #fff;
    box-shadow: 0 4px 20px rgba(212, 175, 55, 0.4);
}

.nav-btn svg {
    width: 18px;
    height: 18px;
}

.nav-btn:active {
    transform: scale(0.98);
}

.nav-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Result Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    padding: 20px;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--card-bg);
    border-radius: 24px;
    padding: 32px 24px;
    max-width: 360px;
    width: 100%;
    transform: scale(0.9);
    transition: transform 0.3s ease;
    max-height: 85vh;
    overflow-y: auto;
}

.modal-content.result-modal {
    max-width: 380px;
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

.modal-header {
    text-align: center;
    margin-bottom: 24px;
}

.modal-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--secondary-color);
    margin-bottom: 8px;
}

.modal-subtitle {
    font-size: 0.9rem;
    color: var(--text-light);
}

.result-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    margin-bottom: 24px;
}

.result-item {
    text-align: center;
    padding: 12px 4px;
    background: var(--bg-color);
    border-radius: 12px;
}

.result-letter {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--secondary-color);
    margin-bottom: 4px;
}

.result-count {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary-color);
}

.result-label {
    font-size: 0.7rem;
    color: var(--text-light);
    margin-top: 2px;
}

.result-summary {
    text-align: center;
    padding: 16px;
    background: linear-gradient(135deg, var(--secondary-color), #2d5a8a);
    border-radius: 16px;
    color: #fff;
    margin-bottom: 20px;
}

.result-main {
    font-size: 0.85rem;
    opacity: 0.9;
    margin-bottom: 8px;
}

.result-type {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 8px;
}

.result-desc {
    font-size: 0.85rem;
    opacity: 0.85;
    line-height: 1.5;
}

/* Result Detail */
.result-detail {
    margin-bottom: 20px;
}

.result-portrait {
    background: var(--bg-color);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
}

.result-portrait h4 {
    font-size: 0.9rem;
    color: var(--secondary-color);
    margin-bottom: 8px;
}

.result-portrait p {
    font-size: 0.85rem;
    color: var(--text-color);
    line-height: 1.7;
    text-align: justify;
}

.result-pros-cons {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.pros-section,
.cons-section {
    padding: 12px 16px;
    border-radius: 12px;
}

.pros-section {
    background: rgba(16, 185, 129, 0.1);
}

.cons-section {
    background: rgba(239, 68, 68, 0.1);
}

.pros-section h4,
.cons-section h4 {
    font-size: 0.85rem;
    margin-bottom: 8px;
}

.pros-section h4 {
    color: #10b981;
}

.cons-section h4 {
    color: #ef4444;
}

.pros-section ul,
.cons-section ul {
    list-style: none;
}

.pros-section li,
.cons-section li {
    font-size: 0.8rem;
    color: var(--text-color);
    line-height: 1.6;
    padding-left: 16px;
    position: relative;
    margin-bottom: 4px;
}

.pros-section li::before {
    content: '·';
    position: absolute;
    left: 4px;
    color: #10b981;
    font-weight: bold;
}

.cons-section li::before {
    content: '·';
    position: absolute;
    left: 4px;
    color: #ef4444;
    font-weight: bold;
}

.pros-section li:last-child,
.cons-section li:last-child {
    margin-bottom: 0;
}

.modal-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.modal-close {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.modal-close:active {
    transform: scale(0.98);
}

.modal-screenshot {
    width: 100%;
    padding: 14px;
    background: var(--secondary-color);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.modal-screenshot:active {
    transform: scale(0.98);
}

/* 截图loading弹窗 */
.screenshot-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
}

.screenshot-loading-content {
    background: #fff;
    border-radius: 16px;
    padding: 40px 50px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #E5E7EB;
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-text {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--secondary-color);
    margin-bottom: 8px;
}

.loading-hint {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 20px;
}

.loading-cancel-btn {
    padding: 10px 30px;
    background: #f5f5f5;
    color: var(--text-color);
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    cursor: pointer;
}

.loading-cancel-btn:active {
    background: #e5e5e5;
}

/* 图片预览弹窗 */
.image-preview-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 20px;
}

.preview-container {
    background: #fff;
    border-radius: 16px;
    max-width: 100%;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: var(--secondary-color);
    color: #fff;
}

.preview-header span {
    font-size: 1rem;
    font-weight: 600;
}

.preview-close {
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(255,255,255,0.2);
    color: #fff;
    font-size: 20px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.preview-tip {
    text-align: center;
    padding: 12px;
    background: var(--bg-color);
    color: var(--text-light);
    font-size: 0.85rem;
}

.preview-image {
    display: block;
    max-width: 100%;
    max-height: calc(90vh - 100px);
    object-fit: contain;
}

/* Toast */
.toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 14px 28px;
    border-radius: 10px;
    font-size: 0.95rem;
    z-index: 1001;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.toast.show {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

/* Brand Footer */
.brand-footer {
    text-align: center;
    padding: 30px 0 20px;
    color: var(--text-light);
    font-size: 0.85rem;
}

.brand-footer a {
    color: var(--secondary-color);
    text-decoration: none;
    font-weight: 500;
}

/* Safe Area */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .container {
        padding-bottom: calc(40px + env(safe-area-inset-bottom));
    }
}

/* 暗色模式保持品牌色调 */
@media (prefers-color-scheme: dark) {
    body {
        background: #F5F7FA;
        color: #333;
    }
}
