/**
 * Simyo基础样式
 * 定义CSS变量、基础布局和通用样式
 */

:root {
    /* Simyo品牌色 */
    --primary: #ff6b00;
    --secondary: #ffd6b3;
    --success: #10b981;
    --warning: #ef4444;
    --light: #f8f9fa;
    --dark: #212529;
    --gray: #6c757d;
}

body {
    background: linear-gradient(135deg, #f6f1eb 0%, #efe2d3 45%, #e6cfb8 100%);
    color: #212529;
    min-height: 100vh;
    padding: 20px;
    font-family: var(--font-sans, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif);
    margin: 0;
}

.container {
    max-width: 900px;
    margin: 0 auto;
}

/* 应用头部 */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
}

.logo-container {
    display: flex;
    align-items: center;
}

.app-icon {
    font-size: 24px;
    margin-right: 10px;
    color: #ff6b00;
}

.app-title {
    font-size: 24px;
    font-weight: bold;
    background: linear-gradient(to right, #ff6b00, #0056b3);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

.header-buttons {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* 页面标题 */
.page-title {
    text-align: center;
    margin: 30px 0 40px;
}

.page-title h1 {
    font-size: 32px;
    font-weight: 800;
    margin: 0;
    letter-spacing: -0.5px;
    color: #212529;
}

.page-title p {
    color: rgba(33, 37, 41, 0.7);
    font-size: 18px;
    margin-top: 8px;
}

/* 步骤指示器（进度轨见 design-system .step-indicator::before/::after） */
/* 背景与 Simyo 卡片统一：暖橙奶油色，避免冷灰白 */
.step-indicator {
    display: flex;
    justify-content: space-between;
    margin: 0 auto 40px;
    position: relative;
    max-width: 720px;
    counter-reset: step;
    padding: 16px 24px;
    border-radius: 16px;
    background: linear-gradient(135deg, #fffaf5 0%, #fff1e6 55%, #ffe8d6 100%);
    border: 1px solid rgba(255, 107, 0, 0.3);
    box-shadow: 0 4px 25px rgba(0, 0, 0, 0.1);
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 2;
    width: 120px;
    position: relative;
    transition: opacity var(--transition-fast, 160ms ease);
}

.step-number {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #fffaf5;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-bottom: 10px;
    font-size: 20px;
    color: #212529;
    border: 2px solid rgba(255, 107, 0, 0.55);
    box-shadow: inset 0 0 0 2px rgba(255, 107, 0, 0.18);
    transition:
        background var(--transition-base, 240ms ease),
        border-color var(--transition-base, 240ms ease),
        box-shadow var(--transition-base, 240ms ease),
        color var(--transition-base, 240ms ease),
        transform var(--transition-fast, 160ms ease);
}

.step.completed .step-number {
    background: linear-gradient(135deg, #ff8a2b, #ff6b00);
    color: #fff;
    border-color: rgba(255, 107, 0, 0.9);
    box-shadow: 0 4px 12px rgba(255, 107, 0, 0.3);
}

.step.completed .step-text {
    color: #c2410c;
    font-weight: 600;
}

.step.active .step-number {
    background: linear-gradient(135deg, #ff7a1a, #ffb066);
    color: #fff;
    border-color: rgba(255, 107, 0, 0.85);
    /* 脉冲环用偏深橙，在橙色圆上仍清晰 */
    --step-pulse-color: rgba(194, 65, 12, 0.75);
    animation: pulse-ring var(--anim-base, 2.75s) var(--anim-ease-pulse, cubic-bezier(0.4, 0, 0.6, 1)) infinite;
}

.step.active .step-text {
    color: #9a3412;
    font-weight: 700;
}

.step-text {
    font-size: 14px;
    text-align: center;
    color: #7c4a28;
    font-weight: 500;
    transition: color var(--transition-fast, 160ms ease);
}

/* 表单元素 */
.form-label {
    display: block;
    margin-bottom: 15px;
    font-weight: 600;
    font-size: 17px;
    color: #212529;
}

textarea, input {
    width: 100%;
    padding: 16px 18px;
    border-radius: 12px;
    border: 2px solid rgba(255, 107, 0, 0.3);
    background: rgba(255, 255, 255, 0.9);
    color: #212529;
    font-size: 16px;
    transition:
        border-color var(--transition-base, 240ms ease),
        box-shadow var(--transition-base, 240ms ease),
        background-color var(--transition-base, 240ms ease);
    box-sizing: border-box;
}

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

textarea:focus, input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(255, 107, 0, 0.2);
    background: rgba(255, 255, 255, 1);
}

/* 焦点样式 */
a:focus-visible,
button:focus-visible,
.btn:focus-visible,
input:focus-visible,
textarea:focus-visible {
    box-shadow: 0 0 0 3px rgba(76,154,255,0.35);
}

:focus-visible {
    outline: 2px solid #4c9aff;
    outline-offset: 2px;
}

/* 区块显示控制：进入时淡入上移 */
.section {
    display: none;
}

.section.active {
    display: block;
    animation: section-enter 0.35s var(--ease-out, cubic-bezier(.2, .8, .2, 1)) both;
}

#resultContainer {
    display: none;
}

#resultContainer.active {
    display: block;
    animation: section-enter 0.35s var(--ease-out, cubic-bezier(.2, .8, .2, 1)) both;
}

@media (prefers-reduced-motion: reduce) {
    .section.active,
    #resultContainer.active {
        animation: none !important;
    }
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #ccc;
    border-radius: 50%;
    border-top-color: #ff6b00;
    animation: spin 1s ease-in-out infinite;
}

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

/* Tooltip样式 */
.tooltip {
    position: absolute;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-family: 'Courier New', monospace;
    white-space: pre-wrap;
    word-break: break-all;
    max-width: 400px;
    z-index: 1000;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.tooltip.show {
    opacity: 1;
}

/* ===== 暗色模式 ===== */
@media (prefers-color-scheme: dark) {
    :root {
        --secondary: #2a1f16;
        --light: #1a1a1a;
        --dark: #e9ecef;
        --gray: #adb5bd;
    }

    body {
        background: linear-gradient(135deg, #1a1410 0%, #12100e 50%, #0c0b0a 100%);
        color: #e9ecef;
    }

    .app-title {
        background: linear-gradient(to right, #ff8a3d, #6eb0ff);
        background-clip: text;
        -webkit-background-clip: text;
    }

    .page-title h1 {
        color: #f1f5f9;
    }

    .page-title p {
        color: rgba(233, 236, 239, 0.72);
    }

    .step-indicator {
        background: linear-gradient(135deg, #2a1f16 0%, #322318 55%, #3a2818 100%);
        border-color: rgba(255, 107, 0, 0.28);
        box-shadow: 0 4px 25px rgba(0, 0, 0, 0.35);
    }

    .step-number {
        background: #2a2118;
        color: #f8fafc;
        border-color: rgba(255, 107, 0, 0.45);
        box-shadow: inset 0 0 0 2px rgba(255, 107, 0, 0.12);
    }

    .step-text {
        color: #d4a574;
    }

    .step.completed .step-text {
        color: #fdba74;
    }

    .step.active .step-text {
        color: #ffedd5;
    }

    textarea,
    input {
        background: rgba(30, 30, 30, 0.92);
        color: #e9ecef;
        border-color: rgba(255, 107, 0, 0.28);
    }

    textarea:focus,
    input:focus {
        background: rgba(36, 36, 36, 1);
        box-shadow: 0 0 0 4px rgba(255, 107, 0, 0.18);
    }

    .text-dark {
        color: #e9ecef !important;
    }

    .bg-light {
        background-color: #2a2a2a !important;
        color: #e9ecef;
    }

    .alert-danger {
        background-color: rgba(127, 29, 29, 0.35) !important;
        border-color: rgba(248, 113, 113, 0.35) !important;
        color: #fecaca !important;
    }

    .alert-warning {
        background-color: rgba(120, 53, 15, 0.35) !important;
        border-color: rgba(251, 191, 36, 0.35) !important;
        color: #fde68a !important;
    }

    .alert-info {
        background-color: rgba(30, 58, 138, 0.35) !important;
        border-color: rgba(96, 165, 250, 0.35) !important;
        color: #bfdbfe !important;
    }
}

/* Toast通知样式 */
.toast-notification {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 15px 25px;
    border-radius: 50px;
    font-size: 16px;
    display: flex;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1000;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.toast-notification.show {
    opacity: 1;
}

.toast-content {
    display: flex;
    align-items: center;
}

.toast-content i {
    color: #ff6b00;
    font-size: 18px;
}