/* ========================================
   小红书风格设计系统 - CSS变量 (V6.0 - Ethereal Oriental)
   莫兰迪配色 + 毛玻璃质感 + 极简圆润
   ======================================== */

:root {
    /* --- 核心色板 (Morandi) --- */
    
    /* 五行色 - 低饱和度高级灰 (Morandi v2) */
    --wuxing-wood: #8FB397;      /* 抹茶绿 */
    --wuxing-fire: #C08888;      /* 干枯玫瑰 - 替换原 D49A9A/f5222d */
    --wuxing-earth: #CFC0A7;     /* 香槟金 - 替换原 C7B299/faad14 */
    --wuxing-metal: #C5C5C5;     /* 银灰 */
    --wuxing-water: #94B0C2;     /* 雾霾蓝 */
    
    /* 辅助色 */
    --color-vermilion: #C08888;  /* 主强调色跟随"火" */
    --color-gold: #CFC0A7;       /* 辅助金 */
    
    /* 界面色 */
    --color-bg-primary: #F9F7F5;    /* 暖宣纸白 */
    --color-bg-secondary: #fffff8;  /* 极暖白 */
    --color-surface-glass: rgba(255, 255, 255, 0.60); /* 毛玻璃表面 - 更通透 */
    
    /* 文字色 */
    --color-text-primary: #4A4A4A;   /* 暖炭灰 - 比纯黑更柔和 */
    --color-text-secondary: #8C8C8C; /* 中灰 */
    --color-text-tertiary: #C0C0C0;  /* 浅灰 */

    /* --- 系统参数 --- */
    
    /* 圆角 - 极致圆润 */
    --radius-sm: 12px;
    --radius-md: 20px;
    --radius-lg: 32px;
    --radius-full: 9999px;

    /* 间距 */
    --space-xs: 8px;
    --space-sm: 16px;
    --space-md: 24px;
    --space-lg: 32px;
    --space-xl: 48px;

    /* 阴影 - 弥散柔光 (Elevation System) */
    --shadow-sm: 0 4px 16px rgba(110, 110, 110, 0.04);
    --shadow-md: 0 12px 32px rgba(110, 110, 110, 0.08); /* 增加深度感 */
    --shadow-lg: 0 24px 64px rgba(110, 110, 110, 0.12); /* 极致漫射 */
    --shadow-heavy: 0 32px 80px rgba(192, 136, 136, 0.15); /* 强调卡片专用 */
    --shadow-in: inset 0 2px 4px rgba(0,0,0,0.02);
    
    /* 字体 */
    --font-serif: "Songti SC", "Noto Serif SC", "STSong", serif; /* 增强宋体兼容性 */
    --font-sans: "PingFang SC", "Noto Sans SC", -apple-system, sans-serif;
    
    /* 动画与过渡 */
    --transition-base: 0.5s cubic-bezier(0.16, 1, 0.3, 1); /* Apple 风格平滑曲线 */
    --anim-stagger: 0.1s; /* 交错间隔 */
}

/* ========================================
   基础重置 & 全局样式
   ======================================== */

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

body {
    font-family: var(--font-sans);
    background-color: var(--color-bg-primary);
    background-image: 
        radial-gradient(circle at 5% 5%, rgba(192, 136, 136, 0.08) 0%, transparent 35%),
        radial-gradient(circle at 95% 95%, rgba(147, 176, 194, 0.08) 0%, transparent 35%),
        radial-gradient(circle at 50% 50%, rgba(207, 192, 167, 0.03) 0%, transparent 60%);
    background-attachment: fixed;
    color: var(--color-text-primary);
    line-height: 1.8; /* 增加行高提升呼吸感 */
    min-height: 100vh;
    overflow-x: hidden;
}

#app {
    width: 100%;
    min-height: 100vh;
    padding-bottom: env(safe-area-inset-bottom);
}

/* ========================================
   组件库
   ======================================== */

/* 1. 容器 */
.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 24px 20px 40px;
}

/* 2. 卡片 (Glass/Paper) */
.card, .question-card, .result-card {
    background: var(--color-surface-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.6);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 32px 24px;
    margin-bottom: 24px;
    transition: transform var(--transition-base);
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* 3. 按钮 */
.btn {
    display: inline-flex; /* 让内容垂直居中 */
    align-items: center;
    justify-content: center;
    padding: 16px 36px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all var(--transition-base);
    letter-spacing: 1px;
    user-select: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--wuxing-fire) 0%, var(--wuxing-earth) 100%);
    color: white;
    box-shadow: 0 8px 24px rgba(212, 154, 154, 0.3);
}

.btn-primary:active {
    transform: scale(0.96);
    box-shadow: 0 4px 12px rgba(212, 154, 154, 0.2);
}

.btn-secondary {
    background: white;
    color: var(--color-text-primary);
    border: 1px solid rgba(0,0,0,0.05);
    box-shadow: var(--shadow-sm);
}

/* 4. 排版 */
.title, .hero-title, .result-title {
    font-family: var(--font-serif);
    font-weight: 600;
    color: var(--color-text-primary);
    line-height: 1.4;
    letter-spacing: 1px;
}

.subtitle {
    font-size: 15px;
    color: var(--color-text-secondary);
    font-weight: 400;
    letter-spacing: 0.5px;
}

/* ========================================
   页面特定样式
   ======================================== */

/* --- 首页 (Birth Input) --- */
.hero-section {
    text-align: center;
    padding: 30px 0 20px;
}

.hero-title {
    font-size: 32px;
    margin-bottom: 8px;
    background: linear-gradient(45deg, var(--color-text-primary), #666);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.feature-tags {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 12px;
}

.feature-tag {
    font-size: 11px;
    padding: 4px 12px;
    background: rgba(255,255,255,0.6);
    border-radius: 12px;
    color: var(--color-text-secondary);
    border: 1px solid rgba(0,0,0,0.03);
}

.date-card.compact-card {
    padding: 24px 20px;
    background: var(--color-surface-glass);
    border: 1px solid rgba(255,255,255,0.8);
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
}

.city-identity {
    display: flex; /* 改回 flex 布局以便垂直居中 */
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
}

.city-name-v2 {
    font-size: 28px; /* Unify with MBTI Type size (approx) */
    font-weight: 700; /* Bold but not black */
    color: #333;
    letter-spacing: 2px;
    line-height: 1.2;
    font-family: var(--font-serif);
    margin: 0;
}

.date-selector-row {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.date-label-sm {
    font-size: 12px;
    color: var(--color-text-secondary);
    margin-bottom: 6px;
    display: block;
    text-align: center;
}

.date-input-sm {
    width: 100%;
    padding: 10px;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 12px;
    font-size: 15px;
    color: #333;
    text-align: center;
    appearance: none;
    -webkit-appearance: none;
    outline: none;
    height: 44px; /* Mobile touch friendly */
}

/* Custom select arrow if needed, but simple is better */
.select-wrapper {
    position: relative;
}
.select-wrapper::after {
    content: "▼";
    font-size: 8px;
    color: #aaa;
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
}

.divider-line {
    height: 1px;
    background: rgba(0,0,0,0.03);
    margin: 20px 0;
}

.gender-options-row {
    display: flex;
    gap: 12px;
}

.gender-option-item {
    flex: 1;
    cursor: pointer;
    position: relative;
}

.gender-option-item input {
    display: none;
}

.gender-btn {
    padding: 14px;
    background: #fff;
    border: 1px solid rgba(0,0,0,0.05); /* Subtle border */
    border-radius: 16px;
    text-align: center;
    font-size: 15px;
    font-weight: 500;
    color: #555;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.02); /* Soft shadow */
}

.gender-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}

.gender-btn .emoji {
    font-size: 18px;
}

/* Active State handled by JS, but also :checked */
.gender-option-item input:checked + .gender-btn {
    border-color: var(--wuxing-fire);
    background: rgba(212, 154, 154, 0.1);
    color: var(--wuxing-fire);
}

/* --- 测验页 (Quiz) --- */
.question-progress {
    font-family: var(--font-serif);
    color: var(--wuxing-earth);
    margin-bottom: 16px;
    font-size: 14px;
    letter-spacing: 2px;
}

.question-text {
    font-size: 22px;
    font-family: var(--font-serif);
    margin-bottom: 32px;
    line-height: 1.6;
}

.option {
    background: white;
    border-radius: var(--radius-md);
    padding: 20px 24px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid transparent;
    box-shadow: var(--shadow-sm);
}

.option-label {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #f0f0f0;
    color: #999;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
}

.option:hover {
    transform: translateX(4px);
    box-shadow: var(--shadow-md);
}

.option.selected {
    background: linear-gradient(to right, #FFF5F5, white);
    border-color: var(--wuxing-fire);
}

.option.selected .option-label {
    background: var(--wuxing-fire);
    color: white;
}

/* --- 结果页 (Result) --- */
.result-header {
    text-align: center;
    margin-bottom: 30px;
}

/* 城市主卡片 */
.city-card.primary {
    background: linear-gradient(135deg, white 0%, #FFFDF9 100%);
    border: 2px solid var(--wuxing-gold);
    border-radius: var(--radius-lg);
    padding: 40px 24px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

/* 装饰性背景 */
.city-card.primary::before {
    content: "";
    position: absolute;
    top: -50px;
    right: -50px;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(207, 192, 167, 0.1) 0%, transparent 70%);
    border-radius: 50%;
}

.city-rank {
    display: inline-block;
    background: var(--wuxing-fire);
    color: white;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 12px;
    letter-spacing: 1px;
    margin-bottom: 16px;
}

.city-name {
    font-family: var(--font-serif);
    font-size: 56px; /* 大号字体 */
    margin: 10px 0 20px;
    color: var(--color-text-primary);
    text-shadow: 2px 2px 0px rgba(0,0,0,0.05);
}

.city-quote-container {
    padding: 24px;
    background: rgba(246, 246, 246, 0.5);
    border-radius: var(--radius-md);
    margin: 24px 0;
}

.match-circle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: white;
    border: 3px solid var(--wuxing-fire);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md);
}

.match-value {
    color: var(--wuxing-fire);
    font-weight: 800;
}

/* 次要城市 */
.city-card.secondary {
    background: white;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-radius: var(--radius-md);
    margin-bottom: 12px;
}

.city-name-small {
    font-family: var(--font-serif);
    font-size: 20px;
    color: var(--color-text-primary);
}

.match-badge {
    background: var(--color-bg-primary);
    color: var(--color-text-secondary);
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 13px;
}

/* 模态框 */
.modal-backdrop {
    background: rgba(255, 255, 255, 0.6); /* 浅色遮罩 */
    backdrop-filter: blur(10px);
}

.modal-card {
    background: white;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
    border: 1px solid rgba(0,0,0,0.05);
}

/* --- 实用工具 --- */
.fade-in {
    animation: fadeIn 0.8s ease-out;
}

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

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 90% { transform: translateX(-4px); }
    50% { transform: translateX(4px); }
}
.shake { animation: shake 0.4s ease-in-out; }
.input-error { border-color: var(--wuxing-fire) !important; background: #fff5f5; }

/* 移动端适配 */
@media (max-width: 480px) {
    .container { padding: 16px; }
    .city-name { font-size: 42px; }
    .btn { width: 100%; }
    .result-actions { 
        position: sticky; 
        bottom: 0; 
        padding: 20px; 
        background: linear-gradient(to top, rgba(255,255,255,0.95) 80%, transparent); 
        margin: 0 -20px -20px;
        z-index: 100;
        backdrop-filter: blur(5px);
    }
}

/* === 次选城市网格 === */
.secondary-cities-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.city-card.secondary {
    background: white;
    border-radius: 16px;
    padding: 16px;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s, box-shadow 0.2s;
}

.city-card.secondary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.city-card.secondary .city-header {
    display: flex;
    flex-direction: row;
    align-items: center;
}

.city-card.secondary .city-name {
    font-size: 18px !important;
}

.city-card.secondary .city-rank {
    font-size: 11px;
    color: #888;
}

@media (max-width: 480px) {
    .secondary-cities-grid {
        grid-template-columns: 1fr;
    }
}


/* ========================================
   Result Page Specific (V2.0 - Clean & Premium)
   ======================================== */

/* 极简标签 (Ghost Style) */
.tag-clean {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    color: var(--color-text-secondary);
    background: rgba(0, 0, 0, 0.02);
    border: 1px solid rgba(0, 0, 0, 0.04);
    margin-right: 6px;
    margin-bottom: 6px;
    transition: all 0.2s;
}

.tag-clean:hover {
    background: rgba(0, 0, 0, 0.04);
    color: var(--color-text-primary);
}

/* 匹配度大数字 */
.match-score-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: white;
    border: 1px solid rgba(0,0,0,0.03);
    border-radius: 20px;
    padding: 12px 16px;
    box-shadow: var(--shadow-sm);
    min-width: 80px;
}

.match-score-val {
    font-size: 28px;
    font-weight: 700;
    line-height: 1;
    color: var(--color-vermilion);
    font-family: var(--font-serif);
}

.match-score-label {
    font-size: 10px;
    color: var(--color-text-tertiary);
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* 信息网格 (Features) */
.info-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px dashed rgba(0,0,0,0.06);
}

.info-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.info-label {
    font-size: 11px;
    color: var(--color-text-tertiary);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.info-val {
    font-size: 13px;
    color: var(--color-text-primary);
    font-weight: 500;
    line-height: 1.4;
}

/* 核心命理组 (流年 + 本命) */
.core-insight-group {
    display: flex;
    flex-direction: column;
    gap: 24px;
    margin-bottom: 40px; /* 增加组间距 */
}

/* === 结果页深度增强 (Pro Max Refinement) === */

/* 1. 交错入场动画系统 */
@keyframes staggeredFadeIn {
    0% { opacity: 0; transform: translateY(30px) scale(0.98); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

.staggered-item {
    opacity: 0;
    animation: staggeredFadeIn 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    animation-delay: calc(var(--index) * var(--anim-stagger));
}

/* 2. 头部增强 */
.result-icon-floating {
    font-size: 56px;
    margin-bottom: 20px;
    animation: floating 3s ease-in-out infinite;
}

@keyframes floating {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* 3. 城市图鉴头部优化 */
.city-catalog-header {
    text-align: center;
    margin: 60px auto 40px; /* 居中 */
    padding: 0 20px;
    max-width: 500px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px; /* 稍微收紧间距 */
}

.city-catalog-header h3 {
    font-size: 18px; /* 稍微缩小以适应手机屏幕 */
    color: var(--color-text-secondary);
    font-weight: 600;
    letter-spacing: 2px; /* 减小字间距防止溢出 */
    margin: 0;
    font-family: var(--font-serif);
    white-space: nowrap; /* 强制不换行 */
    flex-shrink: 0; /* 防止标题被挤压 */
}

.catalog-divider {
    height: 1px;
    flex: 1; /* 使用 flex 填充剩余空间 */
    min-width: 30px;
    background: linear-gradient(90deg, transparent, rgba(0,0,0,0.1), transparent);
}

.result-subtitle-glow {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: 14px;
    color: var(--color-text-secondary);
    letter-spacing: 4px;
    margin-bottom: 20px;
}

.result-subtitle-glow i {
    opacity: 0.3;
    font-style: normal;
}

.result-motto {
    font-size: 13px;
    color: var(--color-text-tertiary);
    font-weight: 300;
}

/* 3. 元数据徽章 */
.user-meta-row {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 32px;
}

.meta-badge {
    padding: 6px 12px;
    background: white;
    border-radius: 12px;
    font-size: 11px;
    color: var(--color-text-secondary);
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(0,0,0,0.02);
}

/* 4. 高级卡片系统 */
.premium-card {
    background: white;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.8);
    box-shadow: var(--shadow-md);
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
    margin-bottom: 24px; /* 增加卡片间距 */
}

.premium-card:last-child {
    margin-bottom: 0;
}

.premium-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.card-tag {
    position: absolute;
    top: 16px;
    right: 16px;
    font-size: 10px;
    color: var(--color-text-tertiary);
    text-transform: uppercase;
    letter-spacing: 1px;
    background: rgba(0,0,0,0.03);
    padding: 2px 6px;
    border-radius: 4px;
}

/* 运程卡片特定 - 时间轴布局 */
.fortune-card {
    padding: 24px;
}

.fortune-timeline {
    position: relative;
    padding-left: 16px;
    margin-top: 12px;
}

.fortune-timeline::before {
    content: '';
    position: absolute;
    left: 4px;
    top: 8px;
    bottom: 20px;
    width: 1px;
    background: rgba(0,0,0,0.06);
}

.timeline-item {
    position: relative;
    padding-bottom: 24px;
    padding-left: 16px;
}

.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-dot {
    position: absolute;
    left: -16px;
    top: 6px;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: white;
    border: 2px solid var(--color-vermilion);
    z-index: 2;
}

.timeline-item.future .timeline-dot {
    border-color: #ccc;
    background: white;
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.timeline-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--color-text-primary);
    font-family: var(--font-serif);
}

.timeline-tag {
    font-size: 11px;
    padding: 2px 6px;
    background: rgba(0,0,0,0.03);
    border-radius: 4px;
    color: var(--color-text-secondary);
    font-weight: 600;
}

.timeline-tag.highlight {
    color: var(--color-vermilion);
    background: rgba(212, 154, 154, 0.1);
}

.timeline-desc {
    font-size: 13px;
    color: var(--color-text-secondary);
    line-height: 1.6;
    text-align: justify;
}

/* 本命格局卡片特定 */
.patterns-card {
    padding: 24px;
}

.patterns-main {
    display: flex;
    gap: 32px;
    margin-bottom: 20px;
    padding-top: 8px;
}

.pattern-item {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.pattern-item .label {
    font-size: 12px;
    color: var(--color-text-secondary); /* 加深颜色 */
    margin-bottom: 8px;
    font-weight: 500;
}

.pattern-item .val {
    font-size: 22px;
    font-weight: 700;
    font-family: var(--font-serif);
    color: var(--color-text-primary);
}

.theme-color {
    color: var(--color-vermilion);
}

.strategy-pill {
    background: rgba(0,0,0,0.02);
    padding: 16px;
    border-radius: 12px;
    font-size: 13px;
    color: var(--color-text-secondary);
    line-height: 1.6;
}

/* MBTI 卡片特定 (Refactored V3) */
.mbti-energy-section {
    margin-bottom: 40px; /* 增加与下方模块的距离 */
}

/* Refined MBTI Card Layout */
.mbti-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px; /* Slightly more breathing room */
    padding: 24px 20px;
    background: linear-gradient(180deg, #FFFFFF 0%, #FFF9F0 100%);
    text-align: center;
    border: 1px solid rgba(0,0,0,0.02);
}

/* Horizontal Header */
.mbti-header-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px; /* Increased gap for better separation */
    width: 100%;
}

.mbti-visual {
    width: 52px; /* Balanced size */
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.06); /* Softer shadow */
    border: 1px solid rgba(0,0,0,0.04);
    font-size: 26px;
    margin-bottom: 0;
    flex-shrink: 0;
}

.mbti-type {
    font-size: 32px;
    font-weight: 800;
    color: var(--color-text-primary);
    letter-spacing: 1px;
    line-height: 1;
    font-family: var(--font-sans); 
    text-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.mbti-title {
    font-size: 13px;
    font-weight: 600;
    color: #888;
    margin-bottom: 0;
    background: white;
    border: 1px solid rgba(0,0,0,0.08); /* Outlined style */
    padding: 6px 14px;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    height: fit-content;
    box-shadow: 0 2px 6px rgba(0,0,0,0.02);
}

.mbti-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.mbti-quote {
    font-size: 14px;
    color: var(--color-text-secondary);
    font-style: italic;
    line-height: 1.6;
    max-width: 96%;
    margin-top: 4px;
    font-family: var(--font-serif);
    opacity: 0.8;
}

/* 5. 城市卡片 V2 (Destiny City - Ethereal Style) */
.city-card-v2 {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm); /* 默认阴影变轻 */
    margin-bottom: 32px;
    position: relative;
    padding: 28px 24px;
    border: 1px solid rgba(0,0,0,0.02);
    transition: transform var(--transition-base), box-shadow var(--transition-base);
}

/* TOP 1 专属样式 - 居中大气 */
.primary-city {
    background: linear-gradient(135deg, #FFFCF5 0%, #FFFFFF 100%); /* 极淡香槟金背景 */
    border: 1px solid rgba(207, 192, 167, 0.3);
    box-shadow: var(--shadow-md); /* 略深阴影 */
    margin-bottom: 48px; /* 增加与后续卡片的距离 */
    padding-top: 50px; /* 为 Ribbon 留空间 */
}

/* 所有的内容容器增加相对定位 */
.city-main-info {
    position: relative;
    z-index: 2;
}

/* 优化 Ribbon - 悬挂式 */
.city-rank-ribbon {
    position: absolute;
    top: -6px;
    left: 24px;
    background: linear-gradient(135deg, var(--color-vermilion) 0%, #D49A9A 100%);
    color: white;
    padding: 8px 12px;
    font-size: 11px;
    font-weight: 700;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(192, 136, 136, 0.4);
    letter-spacing: 1px;
    z-index: 10;
}

.city-rank-ribbon::after {
    /* 丝带折角效果 */
    content: '';
    position: absolute;
    top: 0;
    right: -6px;
    width: 0;
    height: 0;
    border-top: 6px solid #8B5E5E; /* 深色折角 */
    border-right: 6px solid transparent;
}

.city-rank-minimal {
    position: absolute;
    top: 24px;
    right: 24px;
    font-size: 32px; /* 更大 */
    font-weight: 900;
    color: rgba(0,0,0,0.04); /* 极淡水印感 */
    line-height: 1;
    font-family: var(--font-sans);
}


/* 布局调整：PC 端左右，移动端上下 */
.city-main-info {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
}

.city-name-v2 {
    font-size: 32px;
    font-family: var(--font-serif);
    color: var(--color-text-primary);
    margin-bottom: 12px;
    font-weight: 700;
}

.city-pills-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* 轻量化标签 */
.city-pill {
    padding: 4px 10px;
    background: transparent;
    border: 1px solid rgba(0,0,0,0.08); /* 极细描边 */
    border-radius: 20px; /* 全圆角 */
    font-size: 11px;
    color: var(--color-text-secondary);
    transition: all 0.2s;
}

.primary-city .city-pill {
    border-color: rgba(207, 192, 167, 0.4);
    color: #8C8070;
    background: rgba(255,255,255,0.5);
}

.city-energy-stats {
    display: flex;
    gap: 12px;
}

/* 重构能量盒 */
.energy-box, .match-box {
    width: auto; /* 自适应宽度 */
    min-width: 56px;
    height: 64px;
    padding: 0 12px;
    border-radius: 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.energy-box { 
    background: rgba(0,0,0,0.02); 
    border: none; 
}

.match-box { 
    background: white; 
    border: 1px solid rgba(0,0,0,0.05);
    color: var(--color-text-primary);
    box-shadow: var(--shadow-sm);
}

.element-char { font-size: 20px; font-weight: 700; margin-bottom: 4px; }
.element-label, .match-label { font-size: 9px; color: #999; text-transform: uppercase; letter-spacing: 0.5px; }

.match-num { 
    font-size: 22px; 
    font-weight: 700; 
    color: var(--color-vermilion); 
    line-height: 1;
}

.match-num i { 
    font-size: 11px; 
    color: #ccc; 
    font-weight: 400; 
    margin-left: 1px;
    font-style: normal;
}

/* 引用语优化 */
.city-essence-box {
    text-align: center;
    margin: 24px 0 32px;
    position: relative;
    padding: 0 16px;
    background: none; /* 移除背景 */
    border: none;
}

/* 引用语优化 V2 */
.city-quotes-wrapper {
    position: relative;
    display: block; /* Ensure block for width control */
    margin: 16px 0; /* More balanced margin */
    padding: 12px 0; /* Remove left padding as requested */
    text-align: left; /* User requested left align */
}

.city-quotes-wrapper::before {
    content: '"';
    position: absolute;
    top: -10px;
    left: -18px; /* Push quote mark to left margin */
    font-size: 60px; /* Slightly larger decorative quote */
    font-family: serif;
    color: rgba(0,0,0,0.05);
}

.city-quotes-wrapper::after {
    content: '”';
    position: absolute;
    bottom: -24px;
    right: 10px;
    font-size: 36px;
    font-family: var(--font-serif);
    color: var(--color-vermilion);
    opacity: 0.15;
    line-height: 1;
}

.city-quote-text {
    font-family: "FangSong", "STFangsong", "SimFang", serif; /* 仿宋优先 */
    font-size: 14px; /* User requested 14px */
    color: rgba(0,0,0,0.65); /* Slightly darker for thin font readability */
    line-height: 1.8; /* Increased line-height for elegance */
    margin-bottom: 8px;
    letter-spacing: 0; /* User requested 0 */
    white-space: normal; /* Allow wrap */
    text-align: justify; /* Justify for cleaner block look */
}


.city-quote-text:last-child {
    margin-bottom: 0;
}

.city-summary {
    font-size: 13px;
    color: var(--color-text-secondary);
    line-height: 1.8;
    margin-top: 16px;
    text-align: justify;
    opacity: 0.9;
}

/* 信息矩阵 - 增加图标感 */
.city-feature-matrix {
    display: flex; /* 改用 Flex row */
    justify-content: space-between;
    background: rgba(0,0,0,0.02);
    padding: 16px 20px;
    border-radius: 12px;
    margin-bottom: 24px;
}

.feature-col {
    display: flex;
    flex-direction: column;
    align-items: center; /* 居中对齐 */
    flex: 1;
    position: relative;
}

.feature-col:not(:last-child)::after {
    content: '';
    position: absolute;
    right: 0;
    top: 20%;
    height: 60%;
    width: 1px;
    background: rgba(0,0,0,0.05);
}

.feature-col .label {
    font-size: 10px;
    color: #aaa;
    margin-bottom: 6px;
    letter-spacing: 1px;
}

.feature-col .val {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text-primary);
}


/* AI 按钮组 - 移动端并排 */
.ai-interaction-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.ai-glass-btn {
    padding: 12px;
    background: white;
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: 12px;
    font-size: 13px;
    font-weight: 500;
    color: #555;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.02);
}

.ai-glass-btn.secondary {
    background: #FAFAFA;
}

.ai-streaming-container {
    grid-column: span 2; /* 结果全宽 */
}

/* 移动端适配 */
@media (max-width: 480px) {
    .city-main-info {
        flex-direction: column;
        gap: 16px;
    }
    
    .city-energy-stats {
        width: 100%;
    }
    
    .energy-box, .match-box {
        flex: 1;
        height: 56px;
        flex-direction: row; /* 横向排列省空间 */
        gap: 8px;
        align-items: center;
    }

    .element-char, .match-num { margin-bottom: 0; font-size: 18px; }
    .element-label, .match-label { margin-top: 0; font-size: 11px; }
}

.match-logic-toast {
    background: transparent;
    padding: 15px 0 0 0;
    border-radius: 0;
    margin-bottom: 20px;
    border: none;
    border-top: 1px dashed rgba(0,0,0,0.05);
}

/* 重新测试按钮 - 最终触点 */
.btn-primary-glow {
    width: 100%;
    padding: 18px;
    background: linear-gradient(135deg, #4A4A4A 0%, #333 100%);
    color: white;
    border-radius: var(--radius-md);
    font-weight: 700;
    font-size: 16px;
    letter-spacing: 2px;
    box-shadow: 0 12px 32px rgba(0,0,0,0.15);
    margin-top: 20px;
    cursor: pointer;
    border: none;
    transition: all 0.4s;
}

.btn-primary-glow:hover {
    transform: scale(1.02);
    box-shadow: 0 16px 48px rgba(0,0,0,0.2);
}

.disclaimer-text {
    text-align: center;
    font-size: 11px;
    color: var(--color-text-tertiary);
    margin-top: 32px;
    line-height: 1.6;
}


/* --- 先天五行页 (Innate Page) --- */
.innate-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    border: 1px solid white;
    box-shadow: 0 20px 40px rgba(0,0,0,0.05);
    border-radius: 24px;
    padding: 40px 30px;
    text-align: center;
    position: relative;
    overflow: hidden;
    margin-bottom: 30px;
}

.innate-title {
    font-size: 24px;
    font-weight: bold;
    color: #333;
    margin-bottom: 8px;
    letter-spacing: 1px;
}

.innate-subtitle {
    font-size: 13px;
    color: #999;
    margin-bottom: 40px;
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* 五行可视化 */
.element-visual {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    color: white;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    position: relative;
    animation: float 6s ease-in-out infinite;
}

.element-visual::after {
    content: "";
    position: absolute;
    inset: -10px;
    border-radius: 50%;
    border: 1px solid currentColor;
    opacity: 0.3;
    animation: pulse 3s infinite;
}

/* 五行特定样式 */
/* 金: 银白渐变 */
.element-metal { background: linear-gradient(135deg, #E0E0E0 0%, #BDBDBD 100%); color: #616161; }
/* 木: 清新绿 */
.element-wood { background: linear-gradient(135deg, #A8E6CF 0%, #56AB2F 100%); color: #1B5E20; }
/* 水: 深邃蓝 */
.element-water { background: linear-gradient(135deg, #E0C3FC 0%, #8EC5FC 100%); color: #0D47A1; }
/* 火: 热情红 */
.element-fire { background: linear-gradient(135deg, #ff9a9e 0%, #fad0c4 99%, #fad0c4 100%); color: #B71C1C; }
/* 土: 大地黄 */
.element-earth { background: linear-gradient(135deg, #f6d365 0%, #fda085 100%); color: #E65100; }

.element-name-large {
    font-family: var(--font-serif);
    font-size: 42px;
    font-weight: bold;
    color: #333;
    margin-bottom: 16px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.element-desc-box {
    background: rgba(249, 249, 249, 0.8);
    padding: 24px;
    border-radius: 16px;
    font-size: 15px;
    color: #555;
    line-height: 1.8;
    margin-bottom: 30px;
    text-align: justify;
    box-shadow: inset 0 2px 6px rgba(0,0,0,0.02);
}

/* 星座 Pill */
.zodiac-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: white;
    padding: 8px 20px;
    border-radius: 50px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    margin-bottom: 30px;
    font-weight: 600;
    color: #555;
    border: 1px solid rgba(0,0,0,0.05);
}

.instruction-box {
    border: 1px dashed rgba(0,0,0,0.1);
    border-radius: 12px;
    padding: 20px;
    background: rgba(255,255,255,0.4);
    margin-bottom: 30px;
    text-align: left;
}

.instruction-title {
    font-size: 14px;
    font-weight: bold;
    color: #333;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Animations added previously */

.rank-badge.rank-2 { background: #D4B69A; box-shadow: 2px 2px 8px rgba(212, 182, 154, 0.2); }
.rank-badge.rank-3 { background: #A8B8A0; box-shadow: 2px 2px 8px rgba(168, 184, 160, 0.2); }

/* --- Phase 22: Ritual Page Styles --- */
.ritual-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 80vh;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

/* 五行环绕容器 */
.five-elements-orbit {
    position: relative;
    width: 260px;
    height: 260px;
    margin-bottom: 40px;
    animation: orbit-rotate 20s linear infinite;
}

.orbit-item {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin-top: -20px;
    margin-left: -20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255,255,255,0.5);
    backdrop-filter: blur(4px);
}

/* 计算位置: r=110px. 0deg is top (but we start at -90deg logically if we want top) */
/* CSS transforms are relative to element center. translate(0, -110px) moves up. rotate() rotates the axis. */
/* Items need to counter-rotate to stay upright if desired, or just rotate with ring. */
/* Let's fix them at specific angles. */
.orbit-item:nth-child(1) { transform: rotate(0deg) translate(110px) rotate(0deg); }   /* 0度 */
.orbit-item:nth-child(2) { transform: rotate(72deg) translate(110px) rotate(-72deg); } /* 72度 */
.orbit-item:nth-child(3) { transform: rotate(144deg) translate(110px) rotate(-144deg); } /* 144度 */
.orbit-item:nth-child(4) { transform: rotate(216deg) translate(110px) rotate(-216deg); } /* 216度 */
.orbit-item:nth-child(5) { transform: rotate(288deg) translate(110px) rotate(-288deg); } /* 288度 */

/* 中心脉冲倒计时 */
.ritual-timer {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    font-weight: 300;
    color: var(--color-vermilion);
    background: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    backdrop-filter: blur(10px);
    box-shadow: 0 0 20px rgba(212, 154, 154, 0.2);
    font-family: var(--font-serif);
    animation: pulse-timer 1s ease-in-out infinite;
    z-index: 10;
}

.ritual-message {
    font-size: 16px;
    color: #555;
    min-height: 24px;
    text-align: center;
    font-family: var(--font-serif);
    letter-spacing: 1px;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

.ritual-message.visible {
    opacity: 1;
}

@keyframes orbit-rotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes pulse-timer {
    0% { transform: translate(-50%, -50%) scale(1); box-shadow: 0 0 20px rgba(212, 154, 154, 0.2); }
    50% { transform: translate(-50%, -50%) scale(1.05); box-shadow: 0 0 30px rgba(212, 154, 154, 0.4); }
    100% { transform: translate(-50%, -50%) scale(1); box-shadow: 0 0 20px rgba(212, 154, 154, 0.2); }
}

.fade-out-page {
    opacity: 0;
    transition: opacity 0.8s ease-out;
}


/* Radar Chart Styles */
.radar-card {
    padding: 24px;
    background: linear-gradient(180deg, #ffffff 0%, #fcfdfe 100%);
    background: linear-gradient(180deg, #ffffff 0%, #fcfdfe 100%);
}

.city-radar-section {
    position: relative;
    padding: 10px 0;
    margin: 10px 0;
    /* Seamless integration: no background/border */
}

.radar-chart-container {
    margin: 20px auto 10px;
    max-width: 100%;
}

.radar-legend {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 10px;
    font-size: 12px;
    color: var(--color-text-secondary);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.legend-item .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.legend-item.user .dot {
    background: #4ECDC4;
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px #4ECDC4;
}

.legend-item.city .dot {
    background: #FF6B6B;
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px #FF6B6B;
}
