/* style.css */

/* 1. BBB Read Me Regular (500 weight) */
@font-face {
    font-family: 'BBB Read Me';
    /* 假设字体文件在项目根目录下的 /fonts 文件夹中 */
    src: url('fonts/BBBReadMe-Regular.woff2') format('woff2'),
         url('fonts/BBBReadMe-Regular.woff') format('woff');
    font-weight: 500;
    font-style: normal;
    font-display: swap; 
}

/* 2. BBB-JURAge Bold/Fallback (700 weight) - 用于 headline 和粗体文本 */
@font-face {
    font-family: 'BBB Read Me';
    src: url('fonts/BBB-JURAge.woff2') format('woff2'),
         url('fonts/BBB-JURAge.woff') format('woff');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

/* 核心 CSS 变量和颜色 */
:root {
    --bg-color: #0d0a14;
    --primary-color: #F4F4F4;
    --secondary-text: #b2b2b2;
    --accent-blue: #1ed760; 
    --accent-pink: #f1a2bc; 
    
    /* 统一使用新字体，避免变量冲突 */
    --custom-font: "BBB Read Me", sans-serif;
    --font-family: var(--custom-font);
}

/* Global hidden class for any element */
.hidden {
    display: none !important;
}

body {
    background-color: var(--bg-color);
    color: var(--primary-color);
    font-family: var(--font-family); 
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow: hidden;
}

#app-container {
    width: 100%;
    height: 100vh;
    max-width: 600px; 
    position: relative;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

/* 头部样式 */
#global-header {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 600px; /* 与 app-container 一致 */
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    z-index: 10;
    box-sizing: border-box;
}

.project-name {
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.1em;
}

.header-tools {
    display: flex;
    gap: 15px;
}

/* INFO 按钮样式 */
.tool-btn {
    background: transparent;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 0 5px rgba(255, 255, 255, 0.3);
    transition: box-shadow 0.2s, background-color 0.2s;
}
.tool-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.tool-btn span::before {
    font-family: 'remixicon' !important;
    font-size: 14px;
}

/* 底部样式 (简化为占位) */
#global-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    max-width: inherit;
    height: 40px; 
    z-index: 10;
}


/* 屏幕和内容布局 */
.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 30px; 
    box-sizing: border-box;
    transition: opacity 0.5s ease-in-out;
}

.screen.hidden {
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
}

.content-box {
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.headline {
    font-size: 28px;
    font-weight: 900; /* 使用 700 weight，即 BBB-JURAge 字体 */
    margin-bottom: 20px;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.3);
}

.body-copy {
    font-size: 16px;
    color: var(--primary-color);
    margin-bottom: 30px;
    line-height: 1.4;
}

/* 统一按钮基础样式 */
.main-cta-btn,
.secondary-btn {
    font-size: 16px;
    font-weight: 700;
    padding: 12px 30px;
    border-radius: 999px; 
    cursor: pointer;
    text-transform: uppercase;
    transition: background-color 0.2s, color 0.2s, border-color 0.2s;
    width: 100%;
    max-width: 250px;
    margin-left: auto;
    margin-right: auto;
    display: block;
}

/* CTA 主按钮 */
.main-cta-btn {
    background-color: var(--accent-pink); 
    color: var(--bg-color);
    border: none;
    box-shadow: 0 0 15px rgba(241, 162, 188, 0.5); 
}

.main-cta-btn:hover {
    background-color: #ffb8d0; 
}

/* Secondary 次按钮 */
.secondary-btn {
    background: transparent;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    font-weight: 500;
    margin-top: 0; 
}

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

/* 问卷专用样式 */
#practice-form {
    padding-top: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.question-title { font-size: 20px; font-weight: 700; margin-bottom: 20px; line-height: 1.3; }
.question-subtitle { font-size: 14px; color: var(--secondary-text); margin-bottom: 15px; }

.input-group { margin-bottom: 25px; width: 100%; }
.text-input, textarea { width: 100%; padding: 10px; border: 1px solid var(--secondary-text); background-color: transparent; color: var(--primary-color); border-radius: 6px; box-sizing: border-box; font-size: 16px; }

.slider-container { width: 100%; display: flex; flex-direction: column; align-items: center; }
.slider-labels { display: flex; justify-content: space-between; width: 100%; margin-top: 10px; }
.slider-labels span { font-size: 12px; color: var(--accent-pink); font-weight: 700; }

input[type="range"] {
    width: 90%;
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    cursor: pointer;
}

input[type="range"]::-webkit-slider-runnable-track { background: var(--secondary-text); height: 8px; border-radius: 4px; }
input[type="range"]::-moz-range-track { background: var(--secondary-text); height: 8px; border-radius: 4px; }

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    margin-top: -4px; 
    background-color: var(--accent-pink);
    border: 2px solid var(--primary-color);
    height: 16px;
    width: 16px;
    border-radius: 50%;
    box-shadow: 0 0 10px var(--accent-pink);
}

input[type="range"]::-moz-range-thumb {
    background-color: var(--accent-pink);
    border: 2px solid var(--primary-color);
    height: 16px;
    width: 16px;
    border-radius: 50%;
    box-shadow: 0 0 10px var(--accent-pink);
}

.navigation-buttons { 
    display: flex; 
    justify-content: space-between; 
    width: 100%; 
    margin-top: 30px; 
    gap: 15px; 
}
.navigation-buttons .main-cta-btn,
.navigation-buttons .secondary-btn { 
    flex: 1; 
    max-width: none;
    margin-left: 0;
    margin-right: 0;
    display: inline-block;
}

.step-indicator { font-size: 12px; color: var(--secondary-text); margin-top: 15px; }

/* 地图界面样式 */
.map-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 30px auto;
    min-height: 350px;
    width: 100%;
}

#data-map {
    width: 300px;
    height: 300px;
    position: relative;
    margin: 0 auto;
}

/* 十字轴线 */
.axis-line {
    position: absolute;
    background-color: var(--secondary-text);
}

.axis-horizontal {
    top: 50%;
    left: 0;
    width: 100%;
    height: 1px;
    transform: translateY(-50%);
}

.axis-vertical {
    left: 50%;
    top: 0;
    width: 1px;
    height: 100%;
    transform: translateX(-50%);
}

/* 轴标签位置调整 */
.axis-label { 
    position: absolute; 
    font-size: 11px; 
    color: var(--accent-pink); 
    font-weight: 700; 
    white-space: nowrap;
}

/* Y轴标签 - 顶部和底部 */
#y-up { 
    top: -25px; 
    left: 50%; 
    transform: translateX(-50%); 
}

#y-down { 
    bottom: -25px; 
    left: 50%; 
    transform: translateX(-50%); 
}

/* X轴标签 - 左侧和右侧 */
#x-left { 
    left: -10px; 
    top: 50%; 
    transform: translate(-100%, -50%); 
}

#x-right { 
    right: -10px; 
    top: 50%; 
    transform: translate(100%, -50%); 
}

/* 数据点样式 */
.data-point {
    position: absolute;
    width: 10px;
    height: 10px;
    background-color: var(--accent-blue); 
    border-radius: 50%;
    cursor: pointer;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 10px var(--accent-blue);
    transition: transform 0.2s, box-shadow 0.2s;
    z-index: 10;
}

.data-point:hover { 
    transform: translate(-50%, -50%) scale(1.8); 
    box-shadow: 0 0 15px var(--accent-blue);
    z-index: 20; 
}

/* Reset按钮样式 */
.map-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    margin-top: 40px;
}

#reset-btn {
    margin: 0 auto;
    display: block;
}

#clear-data-btn {
    margin: 15px auto 0;
    display: block;
    opacity: 0.7;
    font-size: 14px;
    padding: 10px 25px;
}

#clear-data-btn:hover {
    opacity: 1;
}

.tooltip {
    position: absolute;
    background: rgba(40, 40, 40, 0.9);
    color: var(--primary-color);
    padding: 8px;
    border-radius: 4px;
    font-size: 12px;
    pointer-events: none;
    z-index: 100;
    white-space: normal;
    min-width: 150px;
    display: none;
    transform: translate(15px, 15px);
    text-align: left;
}
.tooltip strong { color: var(--accent-pink); display: block; margin-bottom: 5px; }


/* --- 模态框/弹窗样式 (Info) --- */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-color); 
    z-index: 100;
    display: flex;
    justify-content: center;
    align-items: center;
    visibility: visible;
    transition: opacity 0.3s ease-in-out;
}

.modal.hidden {
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
}

.modal-content {
    background-color: transparent;
    padding: 30px;
    width: 100%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    color: var(--primary-color);
}

.modal-close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: transparent;
    border: none;
    color: var(--primary-color);
    cursor: pointer;
    font-size: 20px;
    z-index: 101;
    transition: opacity 0.2s;
}
.modal-close-btn:hover {
    opacity: 0.7;
}
.modal-close-btn span::before {
    font-family: 'remixicon' !important;
    font-size: 24px;
}

.modal-body {
    text-align: left;
    padding-top: 30px;
}
.modal-subtitle {
    font-size: 18px;
    font-weight: 700;
    margin-top: 25px;
    margin-bottom: 15px;
    color: var(--accent-pink);
}
.body-copy-modal {
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 15px;
}
.modal-list {
    list-style: disc;
    padding-left: 20px;
    font-size: 14px;
    line-height: 1.6;
}
.modal-list li {
    margin-bottom: 5px;
}
.small-text {
    font-size: 12px;
    color: var(--secondary-text);
    margin-top: 20px;
}

/* ==========================================
   MOBILE RESPONSIVE DESIGN
   ========================================== */

/* 平板电脑 (768px 以下) */
@media screen and (max-width: 768px) {
    #global-header {
        padding: 15px 20px;
    }
    
    .project-name {
        font-size: 12px;
    }
    
    .tool-btn {
        width: 28px;
        height: 28px;
        font-size: 14px;
    }
    
    .screen {
        padding: 70px 20px 40px;
    }
    
    .headline {
        font-size: 24px;
    }
    
    .body-copy {
        font-size: 15px;
    }
    
    .question-text {
        font-size: 16px;
    }
    
    /* 地图在平板上稍小 */
    .map-wrapper {
        min-height: 320px;
    }
    
    #data-map {
        width: 280px;
        height: 280px;
    }
}

/* 手机横屏和小平板 (600px 以下) */
@media screen and (max-width: 600px) {
    body {
        font-size: 15px;
    }
    
    #global-header {
        padding: 12px 15px;
    }
    
    .project-name {
        font-size: 11px;
        max-width: 60%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    
    .tool-btn {
        width: 26px;
        height: 26px;
        font-size: 13px;
    }
    
    .screen {
        padding: 60px 15px 30px;
    }
    
    .content-box {
        max-width: 100%;
    }
    
    .headline {
        font-size: 22px;
        margin-bottom: 15px;
    }
    
    .body-copy {
        font-size: 14px;
        margin-bottom: 25px;
    }
    
    /* 按钮优化 - 更大的触摸区域 */
    .main-cta-btn,
    .secondary-btn {
        font-size: 15px;
        padding: 14px 28px;
        max-width: 100%;
        min-height: 48px; /* iOS 推荐的最小触摸尺寸 */
    }
    
    /* 问卷区域 */
    .question-text {
        font-size: 15px;
        margin-bottom: 15px;
    }
    
    textarea {
        font-size: 15px;
        padding: 12px;
        min-height: 100px;
    }
    
    input[type="text"] {
        font-size: 15px;
        padding: 12px;
    }
    
    /* 滑块优化 */
    input[type="range"] {
        height: 40px; /* 更大的触摸区域 */
    }
    
    input[type="range"]::-webkit-slider-thumb {
        width: 22px;
        height: 22px;
    }
    
    input[type="range"]::-moz-range-thumb {
        width: 22px;
        height: 22px;
    }
    
    .slider-value {
        font-size: 15px;
        margin-top: 8px;
    }
    
    /* 导航按钮 */
    .navigation-buttons {
        gap: 10px;
        margin-top: 25px;
    }
    
    .navigation-buttons .main-cta-btn,
    .navigation-buttons .secondary-btn {
        font-size: 14px;
        padding: 12px 20px;
    }
    
    /* 地图优化 */
    .map-wrapper {
        margin: 20px auto;
        min-height: 280px;
    }
    
    #data-map {
        width: 250px;
        height: 250px;
    }
    
    .axis-label {
        font-size: 10px;
    }
    
    .data-point {
        width: 12px;
        height: 12px;
        box-shadow: 0 0 8px var(--accent-blue);
    }
    
    .data-point:hover {
        transform: translate(-50%, -50%) scale(2);
        box-shadow: 0 0 12px var(--accent-blue);
    }
    
    .tooltip {
        font-size: 11px;
        padding: 6px 10px;
        max-width: 200px;
    }
    
    .map-actions {
        margin-top: 30px;
    }
    
    #clear-data-btn {
        font-size: 13px;
        padding: 10px 20px;
    }
    
    /* Modal 优化 */
    .modal-content {
        width: 90%;
        max-width: 400px;
        padding: 25px 20px;
        max-height: 85vh;
    }
    
    .modal-content h2 {
        font-size: 20px;
    }
    
    .modal-content p,
    .modal-content ul {
        font-size: 14px;
    }
    
    .close-modal-btn {
        font-size: 14px;
        padding: 10px 24px;
    }
}

/* 小手机 (400px 以下) */
@media screen and (max-width: 400px) {
    #global-header {
        padding: 10px 12px;
    }
    
    .project-name {
        font-size: 10px;
    }
    
    .tool-btn {
        width: 24px;
        height: 24px;
        font-size: 12px;
    }
    
    .screen {
        padding: 55px 12px 25px;
    }
    
    .headline {
        font-size: 20px;
        margin-bottom: 12px;
    }
    
    .body-copy {
        font-size: 13px;
        margin-bottom: 20px;
    }
    
    .question-text {
        font-size: 14px;
    }
    
    .main-cta-btn,
    .secondary-btn {
        font-size: 14px;
        padding: 12px 24px;
    }
    
    textarea {
        min-height: 90px;
    }
    
    /* 地图更小 */
    .map-wrapper {
        min-height: 240px;
    }
    
    #data-map {
        width: 220px;
        height: 220px;
    }
    
    .axis-label {
        font-size: 9px;
    }
    
    #y-up { top: -22px; }
    #y-down { bottom: -22px; }
    
    .data-point {
        width: 10px;
        height: 10px;
    }
    
    .tooltip {
        font-size: 10px;
        padding: 5px 8px;
    }
}

/* 触摸设备优化 */
@media (hover: none) and (pointer: coarse) {
    /* 移除 hover 效果，使用 active 代替 */
    .main-cta-btn:hover,
    .secondary-btn:hover,
    .tool-btn:hover {
        background-color: inherit;
        color: inherit;
    }
    
    .main-cta-btn:active {
        background-color: #ffb8d0;
        transform: scale(0.98);
    }
    
    .secondary-btn:active {
        background-color: var(--primary-color);
        color: var(--bg-color);
        transform: scale(0.98);
    }
    
    .tool-btn:active {
        background-color: rgba(255, 255, 255, 0.15);
    }
    
    /* 数据点在触摸设备上更大 */
    .data-point {
        width: 14px;
        height: 14px;
    }
    
    /* 去掉 hover 状态，使用点击显示 tooltip */
    .data-point:hover {
        transform: translate(-50%, -50%) scale(1);
    }
}

/* 横屏优化 (小于 500px 高度) */
@media screen and (max-height: 500px) and (orientation: landscape) {
    .screen {
        padding: 50px 15px 20px;
        justify-content: flex-start;
    }
    
    .headline {
        font-size: 18px;
        margin-bottom: 10px;
    }
    
    .body-copy {
        font-size: 13px;
        margin-bottom: 15px;
    }
    
    .question-text {
        font-size: 14px;
        margin-bottom: 10px;
    }
    
    textarea {
        min-height: 70px;
    }
    
    .navigation-buttons {
        margin-top: 15px;
    }
    
    .map-wrapper {
        margin: 15px auto;
        min-height: 200px;
    }
    
    #data-map {
        width: 180px;
        height: 180px;
    }
    
    .modal-content {
        max-height: 90vh;
        overflow-y: auto;
    }
}

/* 修复 iOS Safari 的输入框缩放问题 */
@supports (-webkit-touch-callout: none) {
    input[type="text"],
    input[type="range"],
    textarea {
        font-size: 16px !important; /* 防止 iOS Safari 自动缩放 */
    }
}

/* 高分辨率屏幕优化 */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .axis-line {
        height: 0.5px;
        width: 0.5px;
    }
    
    .axis-horizontal {
        height: 0.5px;
    }
    
    .axis-vertical {
        width: 0.5px;
    }
}