/* ============================================================
   SBTI 職場パーソナリティ診断 - 統合版 CSS (2026最终优化)
   ============================================================ */

/* --- 1. 基础布局 --- */
.sbti-wrapper {
    max-width: 800px;
    margin: 40px auto;
    padding: 0 15px;
    font-family: "Noto Sans JP", "Helvetica Neue", Arial, sans-serif;
    color: #333;
    line-height: 1.6;
}

.sbti-section { display: none; }
.sbti-section.active { display: block; animation: fadeIn 0.5s ease-in-out; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- 2. 诊断卡片基础样式 (保留原有精致感) --- */
.cert-card, .quiz-card, .result-card, .quiz-card-clean, .sbti-dimensions-guide {
    background: #fff;
    border: 2px solid #333;
    padding: 40px 30px;
    text-align: center;
    position: relative;
    box-shadow: 10px 10px 0px rgba(0,0,0,0.05);
    margin-bottom: 30px;
}
.result-card {
    border: none !important;
    box-shadow: none !important;
    padding: 20px 0 !important; /* 调整内边距，让内容更自然 */
}
.sbti-dimensions-guide {
    border: none !important;
    box-shadow: none !important;
    width: 100% !important;
    max-width: none !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

.quiz-card-clean { border: none; box-shadow: none; padding: 20px 0; }
.quiz-divider { height: 1px; background: #eee; margin: 15px 0; width: 100%; }

/* --- 3. 答题进度条 (修复 PC/手机不显示问题) --- */
.progress-container {
    margin-bottom: 25px;
    text-align: right;
}
#progress-text { font-size: 0.9rem; color: #888; margin-bottom: 8px; display: block; }

.progress-bar {
    height: 10px;
    background: #eee;
    border-radius: 5px;
    overflow: hidden;
    width: 100%;
    display: block;
}
#progress-fill {
    height: 100%;
    background: #d32f2f;
    width: 0%;
    transition: width 0.3s ease;
    display: block;
}

/* --- 4. 题目与选项 --- */
.question-text {
    font-size: 1.4rem;
    margin-bottom: 35px;
    font-weight: bold;
    min-height: 3em;
    display: flex;
    align-items: center;
    justify-content: center;
}

.options-group { display: flex; flex-direction: column; gap: 15px; }

.btn-option {
    display: block;
    width: 100%;
    padding: 18px 20px;
    border: 1px solid #ddd;
    background: #fdfdfd;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.2s;
    border-radius: 8px;
    text-align: center;
}

/* 只有在支持鼠标悬停的设备上才显示悬停效果，解决手机端红框残留 */
@media (hover: hover) {
    .btn-option:hover {
        border-color: #d32f2f;
        background-color: #fdf2f2;
    }
}

/* 移除移动端点击时的蓝色高亮阴影，并防止点击态残留 */
.btn-option {
    -webkit-tap-highlight-color: transparent;
    outline: none;
}

/* 明确的选中反馈样式 */
.btn-option.selected {
    border-color: #d32f2f !important;
    background-color: #fdf2f2 !important;
    color: #d32f2f !important;
    font-weight: bold;
    /* 加上一个轻微的外发光，更有点击感 */
    box-shadow: 0 0 0 2px rgba(211, 47, 47, 0.2);
}
/* --- 5. 结果页 - 人格信息与解说 --- */
#res-type-name-top { color: #d32f2f; font-size: 1.5rem; margin-left: 10px; border-bottom: 2px solid #d32f2f; }
.res-char-wrapper { margin: 0 auto 20px; width: 200px; }
#res-char-img { width: 100%; height: auto; animation: fadeInDown 0.8s ease-out;margin-top:20px; }

.res-explanation-box {
    background: #fdf2f2;
    border-radius: 12px;
    padding: 25px;
    margin: 25px 0;
    text-align: left;
    border-left: 5px solid #d32f2f;
}
.res-explanation-title { font-size: 1.1rem; font-weight: bold; color: #d32f2f; margin-bottom: 12px; }
#res-desc { font-size: 1.05rem; line-height: 1.8; color: #444; white-space: pre-wrap; }

/* --- 6. 15维度解析卡片 (进度条修复) --- */
.score-card {
    background: #f8faf9;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 15px;
    border: 1px solid #edf1f0;
    text-align: left;
}
.card-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.dim-label { font-weight: bold; color: #333; font-size: 1.05rem; }
.score-badge-area { display: flex; align-items: center; gap: 10px; }

.bar-outer { width: 100%; height: 8px; background: #eef2f1; border-radius: 4px; margin-bottom: 12px; overflow: hidden; }
.bar-inner { height: 100%; transition: width 1s ease-out; }

/* 维度颜色 */
.bar-inner.lvl-L { background-color: #facc15; }
.bar-inner.lvl-M { background-color: #bbf7d0; }
.bar-inner.lvl-H { background-color: #22c55e; }

.user-badge { padding: 2px 10px; border-radius: 4px; font-size: 0.75rem; font-weight: bold; }
.user-badge.lvl-L { background-color: #facc15 !important; color: #854d0e !important; }
.user-badge.lvl-M { background-color: #bbf7d0 !important; color: #166534 !important; }
.user-badge.lvl-H { background-color: #22c55e !important; color: #ffffff !important; }

/* --- 7. 导航按钮 (31题) --- */
.quiz-nav { 
    display: grid; 
    grid-template-columns: repeat(16, 1fr); 
    gap: 8px; 
    justify-content: center; 
    max-width: 550px;
    margin: 20px auto;
}
.nav-item {
    width: 24px; height: 24px; border-radius: 4px; border: 1px solid #ddd;
    font-size: 11px; display: flex; align-items: center; justify-content: center;
    cursor: pointer; background: #fff; color: #999;
}
.nav-item.active { box-shadow: 0 0 0 2px #d32f2f; color: #d32f2f; font-weight: bold; }
.nav-item.answered { background-color: #22c55e !important; border-color: #22c55e !important; color: #fff !important; }

/* --- 7.5 SNS分享区域 --- */
.sns-share-wrapper {
    margin: 40px 0;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 12px;
    text-align: center;
}
.share-label {
    font-size: 1.1rem;
    font-weight: bold;
    margin-bottom: 20px;
    color: #333;
}
.sns-btns {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}
.sns-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 20px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: bold;
    font-size: 0.95rem;
    color: #fff;
    transition: opacity 0.2s;
    border: none;
    cursor: pointer;
    min-width: 150px;
}
.sns-btn:hover { opacity: 0.8; color: #fff; }

/* 品牌色设定 */
.sns-line { background-color: #06C755 !important; }
.sns-ins { background: linear-gradient(45deg, #f09433 0%,#e6683c 25%,#dc2743 50%,#cc2366 75%,#bc1888 100%) !important; }
.sns-x { background-color: #000 !important; }
.sns-copy { background-color: #666 !important; }

.sns-btn i { margin-right: 8px; font-size: 1.1rem; }

/* --- 9. 全局动作按钮样式 (开始、保存、重新开始) --- */
#btn-start, #btn-download, .btn-restart {
    display: inline-block;
    padding: 15px 40px;
    font-size: 1.1rem;
    font-weight: bold;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    border: none;
    margin: 10px;
    min-width: 240px;
}

/* 诊断开始 & 诊断书下载 (红色主按钮) */
#btn-start, #btn-download {
    background-color: #d32f2f;
    color: #fff;
    box-shadow: 0 4px 15px rgba(211, 47, 47, 0.3);
}

#btn-start:hover, #btn-download:hover {
    background-color: #b71c1c;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(211, 47, 47, 0.4);
}

/* 重新开始 (白底黑框次按钮) */
.btn-restart {
    background-color: #fff;
    color: #333;
    border: 2px solid #333;
}

.btn-restart:hover {
    background-color: #f5f5f5;
    transform: translateY(-2px);
}

/* 按钮容器布局 */
.action-btns {
    margin-top: 30px;
    display: flex;
    justify-content: center;
    gap: 15px;
}


/* 您的静态二维码样式 */
.static-qrcode {
    width: 80px !important;
    height: 80px !important;
    border: 1px solid #d32f2f !important; /* 给二维码加个细红边，更有配套感 */
    padding: 2px;
    background: #fff;
    display: block;
}

/* --- 结果页底部居中修正 --- */

.result-footer {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px dashed #ccc;
    /* 核心修改：确保子元素在垂直方向排列并居中 */
    display: flex;
    flex-direction: column;
    align-items: center; 
    text-align: center;
}

.benri-japan-logo {
    font-size: 1.4rem;
    font-weight: bold;
    color: #333;
    margin-bottom: 5px;
    /* 确保文字居中 */
    width: 100%;
}

.hanko-qr-group {
    /* 核心修改：确保印章和二维码这组元素整体居中 */
    display: flex;
    justify-content: center; 
    align-items: center;
    gap: 20px;
    margin-top: 15px;
    width: 100%;
}

.result-qrcode-wrapper {
    /* 确保二维码容器本身不偏向 */
    display: flex;
    justify-content: center;
    align-items: center;
}

/* --- 漏答题目高亮特效 --- */
@keyframes errorPulse {
    0% { transform: scale(1); box-shadow: none; }
    50% { transform: scale(1.02); box-shadow: 0 0 20px rgba(211, 47, 47, 0.4); border: 2px solid #d32f2f; }
    100% { transform: scale(1); box-shadow: none; }
}

.error-pulse {
    animation: errorPulse 0.5s ease-in-out 2; /* 闪烁两次 */
    border-radius: 12px;
}

/* 导航点漏答提示（可选）：如果想让导航点也变红，可以加这个 */
.nav-item.missing {
    border-color: #d32f2f;
    color: #d32f2f;
}




/* 性格图鉴卡片样式 */
/* --- 修改后的性格图鉴容器样式 --- */
.type-library-section { 
    /* 1. 核心修改：设置最大宽度并居中 */
    max-width: 1000px;  /* 这个宽度通常对齐 benri.jp 的主内容区 */
    margin: 40px auto;  /* 上下留 40px 间距，左右自动居中 */
    
    /* 2. 装饰修改 */
    padding: 40px 20px; 
    background: #fff;   /* 改为白色或浅灰，与主色调统一 */
    border: 1px solid #eee; 
    border-radius: 15px; /* 让边缘带点圆角，更有卡片感 */
    box-shadow: 0 4px 10px rgba(0,0,0,0.02); /* 淡淡的投影，增加层级感 */
}

/* 确保内部的 container 不要再设宽度，直接撑满父级即可 */
.type-library-section .container {
    width: 100%;
}
.section-title { text-align: center; font-size: 1.8rem; color: #333; margin-bottom: 10px; }
.section-intro { text-align: center; color: #666; margin-bottom: 40px; font-size: 0.95rem; }

.type-group-title { font-size: 1.2rem; border-left: 4px solid #333; padding-left: 15px; margin: 40px 0 20px; color: #444; }
.rare-title { border-left-color: #d32f2f; color: #d32f2f; }

.type-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); 
    gap: 15px; 
}

.type-card { 
    background: #fff; 
    border: 1px solid #eee; 
    border-radius: 12px; 
    text-align: center; 
    padding: 15px 10px; 
    text-decoration: none !important; 
    transition: all 0.3s ease; 
    display: block;
}

.type-card:hover { transform: translateY(-5px); box-shadow: 0 10px 20px rgba(0,0,0,0.05); border-color: #d32f2f; }

.type-card img { width: 80px; height: 80px; object-fit: contain; margin-bottom: 10px; }

.type-code { display: block; font-size: 0.75rem; color: #999; font-weight: bold; margin-bottom: 5px; }
.type-card h4 { font-size: 0.9rem; color: #333; margin: 0; line-height: 1.4; }

/* 稀有人格卡片特殊样式 */
.rare-card { background: #fff8f8; border-color: #f8d7da; }
.rare-card h4 { color: #d32f2f; }

/* 手机端适配 */
@media (max-width: 480px) {
    .type-grid { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 10px; }
    .type-card img { width: 60px; height: 60px; }
    .type-card h4 { font-size: 0.8rem; }
}






/* ~~~~~~~~~~~~~~~~~~~~~~以下スマホCSS定義~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
/* --- 8. 移动端极致优化 --- */
@media screen and (max-width: 600px) {
    .sbti-wrapper { margin: 10px auto; padding: 0 5px; }
    
    /* 缩小留白 */
    .cert-card, .quiz-card, .result-card, .quiz-card-clean { padding: 12px 12px; }

    /* 字体极大化 */
    /* 【修改点1】题目字体调整为 1.2rem */
    .question-text {
        font-size: 1.2rem !important; 
        line-height: 1.5 !important;
        text-align: left !important;
        margin-bottom: 20px !important;
        min-height: auto !important; /* 字体缩小后取消最小高度限制 */
    }

    /* 选项大间距防误触 */
    .btn-option {
        font-size: 1.15rem !important; /* 配合题目字体略微缩小 */
        padding: 15px 12px !important;
        margin-bottom: 15px !important; /* 间距由 22px 降至 15px */
    }

    #res-desc { font-size: 1.1rem !important; }
    .quiz-nav {
        grid-template-columns: repeat(8, 1fr) !important;
        gap: 5px !important;
        max-width: 100% !important;
    }

    /* 导航点调大 */
    .nav-item { width: 34px; height: 34px; font-size: 14px; }

    /* 手机版SNS按钮改为垂直堆叠，方便点击 */
    .sns-share-wrapper {
        padding: 20px 10px !important;
    }

    /* 【修改点】由垂直堆叠改为网格布局，实现一行两个 */
    .sns-btns {
        display: grid !important; 
        grid-template-columns: repeat(2, 1fr) !important; /* 核心：平分两列 */
        gap: 10px !important;
        flex-direction: row !important; /* 覆盖掉之前的 column 设置 */
    }

    /* 调整按钮内部间距和字体大小，防止文字溢出 */
    .sns-btn {
        width: 100% !important;
        max-width: none !important;
        margin: 0 !important;
        padding: 12px 5px !important; /* 稍微缩小内边距 */
        font-size: 0.95rem !important; /* 字体略微调小以适应半宽 */
        justify-content: center !important;
        display: flex !important;
        align-items: center !important;
    }

    
    .action-btns { flex-direction: column; gap: 15px; }
    .btn-primary, .btn-download, .btn-restart { width: 100%; }

    /* 手机版按钮全宽化，方便点击 */
    #btn-start, #btn-download, .btn-restart {
        width: 100% !important;
        margin: 10px 0 !important;
        padding: 16px !important;
        font-size: 1.2rem !important; /* 手机端字体更大 */
    }

    .action-btns {
        flex-direction: column !important; /* 手机端按钮上下堆叠 */
    }

    .hanko-qr-group { gap: 10px !important; }
    #hanko-canvas-mini { width: 75px !important; height: 75px !important; }
    .static-qrcode { width: 65px !important; height: 65px !important; }

}

/* 兼容性补丁 */
#radar-canvas { max-width: 100%; margin: 20px auto; display: block; }
.quiz-controls { display: flex; justify-content: space-between; margin-top: 2px; }
.btn-prev, .btn-next { background: none; border: none; color: #666; font-size: 0.9rem; cursor: pointer; padding: 10px; }