/* ============================================
   狗狗人格测试 - 通用样式
   移动端优先，参考秒哒应用视觉风格
   ============================================ */

:root {
    --bg: #faf9f6;
    --card: #ffffff;
    --border: #e8e5dd;
    --fg: #1a1a1a;
    --fg-muted: #6b6b6b;
    --primary: #2563eb;
    --primary-foreground: #ffffff;
    --primary-light: #eff6ff;
    --accent: #f59e0b;
    --green: #16a34a;
    --red: #dc2626;
    --muted: #f5f4f0;
    --radius: 12px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background: var(--bg);
    color: var(--fg);
    line-height: 1.6;
    min-height: 100vh;
    overscroll-behavior-y: none;
}

/* PC端隐藏（移动端优先，与原应用一致） */
@media (min-width: 768px) {
    #app {
        max-width: 430px;
        margin: 0 auto;
        min-height: 100vh;
        background: var(--bg);
        box-shadow: 0 0 40px rgba(0, 0, 0, 0.05);
    }
}

#app {
    min-height: 100vh;
}

/* ===== 通用布局 ===== */
.screen {
    min-height: 100vh;
    padding: 24px 20px;
    display: flex;
    flex-direction: column;
}

.screen-centered {
    justify-content: center;
    align-items: center;
    text-align: center;
}

/* ===== 首页 ===== */
.home-header {
    text-align: center;
    margin-bottom: 32px;
}

.home-title {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 12px;
    color: var(--fg);
}

.home-subtitle {
    font-size: 0.875rem;
    color: var(--fg-muted);
    line-height: 1.6;
    max-width: 320px;
    margin: 0 auto;
}

.quiz-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: block;
    text-decoration: none;
    color: inherit;
}

.quiz-card:active {
    transform: scale(0.98);
}

.quiz-card:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.1);
}

.quiz-card-num {
    display: inline-block;
    width: 28px;
    height: 28px;
    line-height: 28px;
    text-align: center;
    background: var(--primary);
    color: var(--primary-foreground);
    border-radius: 50%;
    font-size: 0.8rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.quiz-card-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 6px;
}

.quiz-card-desc {
    font-size: 0.825rem;
    color: var(--fg-muted);
    line-height: 1.5;
    margin-bottom: 10px;
}

.quiz-card-meta {
    font-size: 0.75rem;
    color: var(--fg-muted);
    font-family: monospace;
}

.home-footer {
    text-align: center;
    font-size: 0.75rem;
    color: var(--fg-muted);
    margin-top: 24px;
    padding: 16px 0;
    line-height: 1.8;
}

/* ===== 测试介绍页 ===== */
.intro-title {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 16px;
}

.intro-desc {
    font-size: 0.875rem;
    color: var(--fg-muted);
    line-height: 1.7;
    margin-bottom: 24px;
}

.intro-divider {
    width: 40px;
    height: 2px;
    background: var(--primary);
    margin: 0 auto 24px;
}

.intro-modules {
    text-align: left;
    margin-bottom: 32px;
}

.intro-module {
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.875rem;
    color: var(--fg-muted);
    display: flex;
    justify-content: space-between;
}

.intro-module span:first-child {
    color: var(--fg);
    font-weight: 500;
}

.intro-meta {
    text-align: center;
    font-size: 0.75rem;
    color: var(--fg-muted);
    font-family: monospace;
    padding: 16px 0;
}

/* ===== 按钮 ===== */
.btn {
    display: block;
    width: 100%;
    padding: 14px 24px;
    background: var(--primary);
    color: var(--primary-foreground);
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: center;
}

.btn:active {
    transform: scale(0.98);
    opacity: 0.9;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-secondary {
    background: var(--card);
    color: var(--fg);
    border: 1px solid var(--border);
}

.btn-link {
    display: inline-block;
    width: auto;
    background: transparent;
    color: var(--fg-muted);
    padding: 8px 16px;
    font-size: 0.875rem;
    font-weight: 400;
    text-decoration: none;
}

/* ===== 答题页 ===== */
.quiz-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.quiz-progress-text {
    font-size: 0.75rem;
    color: var(--fg-muted);
    font-family: monospace;
}

.quiz-back {
    font-size: 0.825rem;
    color: var(--fg-muted);
    cursor: pointer;
    background: none;
    border: none;
    padding: 4px 8px;
}

.progress-bar {
    width: 100%;
    height: 3px;
    background: var(--border);
    border-radius: 2px;
    margin-bottom: 28px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 2px;
    transition: width 0.3s ease;
}

.question-module {
    font-size: 0.75rem;
    color: var(--primary);
    font-weight: 600;
    margin-bottom: 12px;
    letter-spacing: 0.05em;
}

.question-text {
    font-size: 1.2rem;
    font-weight: 600;
    line-height: 1.5;
    margin-bottom: 24px;
    color: var(--fg);
}

.options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.option {
    padding: 16px;
    background: var(--card);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.15s ease;
    font-size: 0.95rem;
    line-height: 1.5;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    text-align: left;
}

.option:active {
    transform: scale(0.99);
}

.option-key {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    line-height: 24px;
    text-align: center;
    background: var(--muted);
    color: var(--fg-muted);
    border-radius: 50%;
    font-size: 0.75rem;
    font-weight: 700;
    transition: all 0.15s ease;
}

.option.selected {
    border-color: var(--primary);
    background: var(--primary-light);
}

.option.selected .option-key {
    background: var(--primary);
    color: var(--primary-foreground);
}

/* ===== 加载页 ===== */
.loading-text {
    font-size: 1rem;
    color: var(--fg);
    margin-top: 24px;
    font-weight: 500;
    text-align: center;
    min-height: 1.5em;
}

.loading-dots {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-top: 16px;
}

.loading-dot {
    width: 8px;
    height: 8px;
    background: var(--primary);
    border-radius: 50%;
    animation: pulse 1.4s ease-in-out infinite;
}

.loading-dot:nth-child(2) { animation-delay: 0.2s; }
.loading-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes pulse {
    0%, 80%, 100% { opacity: 0.3; transform: scale(0.8); }
    40% { opacity: 1; transform: scale(1); }
}

.spinner {
    width: 48px;
    height: 48px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* ===== 结果页 ===== */
.result-top-bar {
    height: 4px;
    background: var(--primary);
    width: 100%;
}

.result-container {
    max-width: 480px;
    margin: 0 auto;
    padding: 20px 16px 40px;
}

.result-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px 20px;
    margin-bottom: 16px;
}

.result-type-label {
    text-align: center;
    font-size: 0.75rem;
    color: var(--fg-muted);
    font-family: monospace;
    margin-bottom: 8px;
}

.result-type-name {
    text-align: center;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 6px;
}

.result-subtitle {
    text-align: center;
    font-size: 0.875rem;
    color: var(--fg-muted);
    margin-bottom: 20px;
}

/* 成熟度环形进度 */
.maturity-section {
    text-align: center;
    margin: 16px 0;
}

.maturity-ring {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto;
}

.maturity-ring svg {
    transform: rotate(-90deg);
}

.maturity-value {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.maturity-num {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1;
}

.maturity-label {
    font-size: 0.7rem;
    color: var(--fg-muted);
    margin-top: 4px;
}

.maturity-range {
    text-align: center;
    font-size: 0.75rem;
    color: var(--fg-muted);
    margin-top: 8px;
}

.maturity-explain {
    text-align: center;
    font-size: 0.825rem;
    color: var(--fg);
    line-height: 1.6;
    margin-top: 12px;
    padding: 0 8px;
}

/* 指数条 */
.indices {
    margin-top: 20px;
}

.index-item {
    margin-bottom: 14px;
}

.index-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.825rem;
    margin-bottom: 6px;
}

.index-label-name { color: var(--fg-muted); }
.index-label-value { color: var(--fg); font-weight: 600; font-family: monospace; }

.index-bar {
    width: 100%;
    height: 6px;
    background: var(--muted);
    border-radius: 3px;
    overflow: hidden;
}

.index-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.8s ease;
}

/* 核心结论 */
.core-conclusion {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    font-size: 0.9rem;
    line-height: 1.7;
    color: var(--fg);
}

/* 一句话金句 */
.one-liner {
    margin-top: 16px;
    padding: 12px 14px;
    background: var(--muted);
    border-left: 3px solid var(--primary);
    font-size: 0.875rem;
    color: var(--primary);
    font-style: italic;
    font-weight: 500;
    line-height: 1.6;
}

/* 副倾向 */
.secondary-tendency {
    margin-top: 16px;
    padding: 12px 14px;
    background: var(--muted);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.secondary-label {
    font-size: 0.75rem;
    color: var(--fg-muted);
    margin-bottom: 4px;
}

.secondary-text {
    font-size: 0.825rem;
    color: var(--fg);
    line-height: 1.6;
}

/* 结果分节 */
.result-section {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 16px;
}

.section-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
}

.section-num {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    line-height: 24px;
    text-align: center;
    background: var(--primary);
    color: var(--primary-foreground);
    border-radius: 50%;
    font-size: 0.75rem;
    font-weight: 700;
}

.section-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--fg);
}

.section-subtitle {
    font-size: 0.75rem;
    color: var(--fg-muted);
    margin-left: 32px;
    margin-bottom: 10px;
    margin-top: -8px;
}

.section-content {
    font-size: 0.9rem;
    line-height: 1.75;
    color: var(--fg);
    white-space: pre-line;
}

.section-content-muted {
    color: var(--fg-muted);
}

/* 四宫格 */
.grid-4 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 12px;
}

.grid-item {
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    text-align: center;
    font-size: 0.875rem;
    color: var(--fg-muted);
    transition: all 0.2s;
}

.grid-item.active {
    border-color: var(--primary);
    background: var(--primary);
    color: var(--primary-foreground);
    font-weight: 700;
}

/* 多列网格（4列多行，用于超过4个类型） */
.grid-multi {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 12px;
}

.grid-multi .grid-item {
    padding: 10px 6px;
    font-size: 0.75rem;
    line-height: 1.4;
}

/* 副倾向标记（网格里第二高亮） */
.grid-item.secondary {
    border-color: var(--primary);
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 600;
}

.grid-caption {
    text-align: center;
    font-size: 0.75rem;
    color: var(--fg-muted);
}

/* 雷达图 */
.radar-container {
    display: flex;
    justify-content: center;
    padding: 8px 0;
}

.radar-svg {
    max-width: 280px;
    width: 100%;
    height: auto;
}

/* 避坑清单 */
.not-recommended-list {
    list-style: none;
    padding: 0;
}

.not-recommended-list li {
    padding: 8px 0 8px 24px;
    font-size: 0.875rem;
    color: var(--fg);
    position: relative;
    border-bottom: 1px solid var(--border);
    line-height: 1.5;
}

.not-recommended-list li:last-child {
    border-bottom: none;
}

.not-recommended-list li::before {
    content: "✕";
    position: absolute;
    left: 0;
    color: var(--red);
    font-weight: 700;
}

/* 续/变对比 */
.compare-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.compare-col {
    padding: 14px;
    border-radius: 8px;
    background: var(--muted);
}

.compare-col-title {
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.compare-col.continue .compare-col-title { color: var(--green); }
.compare-col.change .compare-col-title { color: var(--accent); }

.compare-list {
    list-style: none;
    font-size: 0.825rem;
    color: var(--fg);
    line-height: 1.6;
}

.compare-list li {
    padding: 3px 0;
}

/* 行动计划 */
.plan-phases {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.plan-phase {
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    border-left: 3px solid var(--primary);
}

.plan-phase-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 6px;
}

.plan-phase-content {
    font-size: 0.825rem;
    color: var(--fg);
    line-height: 1.5;
}

/* 结语 */
.closing-text {
    font-size: 0.95rem;
    line-height: 1.8;
    color: var(--fg);
    white-space: pre-line;
    text-align: center;
    font-weight: 500;
}

.keyword-tag {
    display: inline-block;
    margin-top: 16px;
    padding: 6px 16px;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 20px;
    font-size: 0.825rem;
    font-weight: 600;
}

/* 诊断结论 */
.diagnosis-box {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.diagnosis-label {
    font-size: 0.75rem;
    color: var(--fg-muted);
    margin-bottom: 4px;
}

.diagnosis-text {
    font-size: 0.875rem;
    color: var(--fg);
    line-height: 1.6;
}

.question-box {
    margin-top: 14px;
}

.question-box .diagnosis-label {
    color: var(--primary);
}

/* 结果页底部操作 */
.result-actions {
    display: flex;
    gap: 12px;
    margin-top: 8px;
    margin-bottom: 24px;
}

.result-actions .btn {
    flex: 1;
}

/* 免责声明 */
.disclaimer {
    text-align: center;
    font-size: 0.7rem;
    color: var(--fg-muted);
    line-height: 1.7;
    padding: 16px;
    border-top: 1px solid var(--border);
    margin-top: 16px;
}

/* ===== 推荐资源卡片（结果页二维码） ===== */
.result-promo {
    margin: 16px 0;
}

.promo-divider {
    height: 1px;
    background: linear-gradient(to right, transparent, var(--border), transparent);
    margin: 8px 0 20px;
}

.promo-card {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border: 1px solid #fde68a;
    border-radius: var(--radius);
    padding: 24px 20px;
    text-align: center;
}

.promo-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #92400e;
    margin-bottom: 6px;
}

.promo-desc {
    font-size: 0.825rem;
    color: #b45309;
    line-height: 1.5;
    margin-bottom: 16px;
}

.promo-qr img {
    width: 180px;
    height: 180px;
    border-radius: 8px;
    border: 6px solid #fff;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
    display: block;
    margin: 0 auto;
}

.promo-qr-tip {
    font-size: 0.75rem;
    color: #92400e;
    margin-top: 10px;
    font-weight: 500;
}

/* 动画 */
.fade-in {
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.slide-in {
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

/* ===== 报恩指数相关 ===== */

/* 报恩指数鉴定标签 */
.reward-badge {
    font-size: 0.75rem;
    color: var(--fg-muted);
    font-weight: 600;
    margin-bottom: 8px;
    letter-spacing: 0.05em;
}

/* 报恩指数评级标题 */
.reward-level-title {
    text-align: center;
    font-size: 1.15rem;
    font-weight: 700;
    margin-top: 14px;
    margin-bottom: 6px;
}

/* 报恩指数评级描述 */
.reward-level-desc {
    text-align: center;
    font-size: 0.825rem;
    color: var(--fg-muted);
    line-height: 1.6;
    padding: 0 8px;
}
