* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', sans-serif;
    background: #f5f5f5;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
    background: white;
    min-height: 100vh;
}

h2 {
    color: #333;
    margin-bottom: 20px;
    font-size: 22px;
}

h3 {
    color: #333;
    margin: 20px 0 10px;
    font-size: 18px;
}

/* 导航栏样式 */
.step-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 5px;
}

.step-btn {
    padding: 8px 12px;
    background: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 20px;
    font-size: 12px;
    cursor: pointer;
    color: #666;
}

.step-btn.active {
    background: #007bff;
    color: white;
    border-color: #0056b3;
}

.step-btn.disabled {
    background: #e9ecef;
    color: #999;
    cursor: not-allowed;
    border-color: #dee2e6;
}

.step-arrow {
    color: #999;
    font-size: 14px;
    margin: 0 2px;
}

/* 表单样式 */
.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    font-weight: bold;
    margin-bottom: 8px;
    color: #444;
    font-size: 15px;
}

.form-input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0,123,255,0.15);
}

/* 单选组：紧凑药丸式，横排换行（手机/桌面通用） */
.radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    background: #f8f9fa;
    padding: 12px;
    border-radius: 8px;
}

.radio-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    cursor: pointer;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    padding: 7px 13px;
    transition: border-color 0.15s;
}

.radio-item:hover {
    border-color: #007bff;
}

.radio-item input[type="radio"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.input-area {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    margin-bottom: 20px;
    resize: vertical;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.input-area:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0,123,255,0.15);
}

.direction-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin: 15px 0;
}

.direction-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    padding: 8px;
    background: #f8f9fa;
    border-radius: 6px;
    cursor: pointer;
}

.direction-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0;
    cursor: pointer;
}

.other-input {
    margin: 15px 0;
}

.other-input-field {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
}

.start-btn {
    width: 100%;
    padding: 15px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    margin-top: 20px;
}

.start-btn:hover {
    background: #0056b3;
}

.start-btn:disabled {
    background: #cccccc;
    cursor: not-allowed;
}

.jump-section {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    color: #666;
}

.jump-section select {
    padding: 4px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.socratic-badge {
    display: inline-block;
    background-color: #9c27b0;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    margin-left: 10px;
}

.question {
    font-size: 18px;
    margin-bottom: 20px;
    line-height: 1.5;
    font-weight: bold;
    color: #333;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.question.socratic {
    border-left: 4px solid #9c27b0;
    padding-left: 15px;
}

.options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.option-item {
    width: 100%;
}

.option-btn {
    padding: 16px;
    background-color: #f8f9fa;
    color: #333;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    width: 100%;
    text-align: left;
    transition: all 0.2s;
}

.option-btn:hover {
    background-color: #e9ecef;
    border-color: #adb5bd;
}

.option-btn.selected {
    background-color: #007bff;
    color: white;
    border-color: #0056b3;
}

.selected-hint {
    margin: 15px 0;
    padding: 10px;
    background-color: #e7f3ff;
    border-left: 4px solid #007bff;
    color: #0056b3;
    font-size: 14px;
}

.nav-buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.nav-btn {
    padding: 12px 24px;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    flex: 1;
}

.nav-btn:hover:not(:disabled) {
    background: #5a6268;
}

.nav-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.nav-btn.primary {
    background: #007bff;
}

.nav-btn.primary:hover {
    background: #0056b3;
}

.loading-container {
    text-align: center;
    padding: 40px;
    color: #666;
}

.blueprint {
    background: #f8f9fa;
    border-left: 4px solid #007bff;
    padding: 20px;
    margin: 20px 0;
    white-space: pre-wrap;
    font-family: monospace;
    font-size: 13px;
    line-height: 1.7;
    color: #333;
    border-radius: 4px;
    max-height: 500px;
    overflow-y: auto;
}

.action-buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.copy-btn, .share-btn, .restart-btn {
    padding: 12px 24px;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    flex: 1;
}
.copy-btn { background: #28a745; }
.copy-btn:hover { background: #218838; }
.share-btn { background: #9c27b0; }
.share-btn:hover { background: #7b1fa2; }
.restart-btn { background: #dc3545; }
.restart-btn:hover { background: #c82333; }

/* 分享图片预览区域 */
.share-preview {
    margin-top: 30px;
    border-top: 1px solid #eee;
    padding-top: 20px;
}
.preview-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 15px;
}
.preview-item {
    width: 100px;
    text-align: center;
    cursor: pointer;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 8px;
    transition: transform 0.2s;
}
.preview-item:hover {
    transform: scale(1.05);
    background: #e9ecef;
}
.preview-img {
    width: 100%;
    height: auto;
    border-radius: 4px;
    border: 1px solid #ddd;
}
.preview-item span {
    display: block;
    font-size: 12px;
    color: #666;
    margin-top: 5px;
}

/* 图片模态框 */
.image-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}
.image-modal-content {
    background: white;
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    max-width: 90%;
    max-height: 90%;
    overflow: auto;
}
.modal-image {
    max-width: 100%;
    max-height: 70vh;
    margin-bottom: 15px;
}
.save-image-btn, .close-modal-btn {
    padding: 10px 20px;
    margin: 5px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
}
.save-image-btn {
    background: #28a745;
    color: white;
}
.save-image-btn:hover {
    background: #218838;
}
.close-modal-btn {
    background: #6c757d;
    color: white;
}
.close-modal-btn:hover {
    background: #5a6268;
}

/* 反馈浮层 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}
.modal-container {
    background: white;
    padding: 30px;
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}
.feedback-question {
    margin-bottom: 20px;
}
.feedback-question label {
    display: block;
    font-weight: bold;
    margin-bottom: 8px;
    color: #444;
}
.modal-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
}

/* 顶部栏样式 */
.top-bar {
    background: #f0f2f5;
    padding: 10px 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.buy-btn {
    background: #28a745;
    color: white;
    border: none;
    padding: 5px 12px;
    border-radius: 20px;
    cursor: pointer;
    margin-right: 8px;
}
.logout-btn {
    background: #dc3545;
    color: white;
    border: none;
    padding: 5px 12px;
    border-radius: 20px;
    cursor: pointer;
}

/* ===== 响应式：平板/桌面 ===== */

/* ≥600px：问题方向/期望结果选项增至3列 */
@media (min-width: 600px) {
    .direction-options { grid-template-columns: repeat(3, 1fr); }
}

/* ≥768px：容器卡片化加宽，排版升级 */
@media (min-width: 768px) {
    .container {
        max-width: 920px;
        min-height: auto;
        margin: 28px auto;
        border-radius: 16px;
        box-shadow: 0 10px 40px rgba(15, 23, 42, 0.08);
        padding: 32px 40px;
    }
    h2 { font-size: 24px; }
    .question { font-size: 20px; }
    .option-btn { font-size: 17px; }
    .blueprint { font-size: 14px; max-height: 560px; }
    .step-btn { font-size: 13px; padding: 9px 16px; }
    .form-group { margin-bottom: 22px; }
}

/* ≥960px：信息表单双栏；答题区居中收窄保证可读性 */
@media (min-width: 960px) {
    .direction-options { grid-template-columns: repeat(4, 1fr); }

    .user-info-page {
        display: grid;
        grid-template-columns: 1fr 1fr;
        column-gap: 40px;
        align-items: start;
    }
    .user-info-page .top-bar,
    .user-info-page h2,
    .user-info-page .nav-buttons { grid-column: 1 / -1; }

    .questioning-page .jump-section,
    .questioning-page .question,
    .questioning-page .options,
    .questioning-page .selected-hint,
    .questioning-page .nav-buttons {
        max-width: 620px;
        margin-left: auto;
        margin-right: auto;
    }
}

/* ===== 底部固定栏：三种模式，整条贴底（所有屏幕尺寸，不悬浮） ===== */
:root {
    --bottom-chrome: calc(68px + env(safe-area-inset-bottom, 0px));
}

#training-floating-btns {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 16px calc(8px + env(safe-area-inset-bottom, 0px));
    background: #fff;
    border-top: 1px solid #e5e7eb;
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.06);
}

#training-floating-btns a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 1 200px;
    padding: 10px 18px;
    border-radius: 10px;
    text-decoration: none;
    font-size: 14px;
    font-weight: bold;
    text-align: center;
    transition: background-color 0.2s, transform 0.15s;
    -webkit-tap-highlight-color: transparent;
}

/* 浅色底 + 深色字，比纯色块更柔和 */
#training-floating-btns a.mode-quick {
    background: #fff3e6;
    color: #c2410c;
}
#training-floating-btns a.mode-quick:hover { background: #ffe4cc; }

#training-floating-btns a.mode-training {
    background: #f3e8ff;
    color: #7e22ce;
}
#training-floating-btns a.mode-training:hover { background: #ead9ff; }

#training-floating-btns a.mode-profile {
    background: #e7f1ff;
    color: #1d4ed8;
}
#training-floating-btns a.mode-profile:hover { background: #d8e8ff; }

#training-floating-btns a:active { transform: scale(0.98); }

/* 手机：三个按钮三等分，占满整条 */
@media (max-width: 767px) {
    #training-floating-btns {
        gap: 6px;
        padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px));
    }
    #training-floating-btns a {
        flex: 1;
        min-width: 0;
        padding: 10px 4px;
        font-size: 13px;
    }
}