/* ─── 基础重置与变量 ─── */
:root {
    --bg-dark: #0a0f1a;
    --bg-card: rgba(255,255,255,0.03);
    --bg-card-hover: rgba(255,255,255,0.06);
    --border-color: rgba(255,255,255,0.08);
    --text-primary: #e8e6f0;
    --text-secondary: #8b87a0;
    --text-muted: #5d5a70;
    --accent: #7c6fe0;
    --accent-glow: rgba(124, 111, 224, 0.3);
    --accent-light: #a89eff;
    --green: #6bcf7f;
    --gold: #f0c674;
    --radius: 16px;
    --radius-sm: 10px;
    --font-serif: 'Noto Serif SC', serif;
    --font-sans: 'Noto Sans SC', sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: var(--font-sans);
    background: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
}

/* ─── 星空背景 ─── */
#bg-canvas {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* ─── 容器 ─── */
.container {
    position: relative;
    z-index: 1;
    max-width: 800px;
    margin: 0 auto;
    padding: 24px 20px 80px;
}

/* ─── 头部 ─── */
.header {
    text-align: center;
    padding: 40px 0 20px;
}
.logo {
    display: inline-flex;
    align-items: center;
    gap: 12px;
}
.logo-icon {
    font-size: 2.4em;
}
.header h1 {
    font-family: var(--font-serif);
    font-size: 1.8em;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent-light), var(--gold));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.subtitle {
    font-size: 0.85em;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* ─── 页面切换 ─── */
.page { display: none; }
.page.active { display: block; }

/* ─── 首页 ─── */
.hero {
    text-align: center;
    padding: 40px 0;
}
.hero-animal {
    font-size: 5em;
    margin-bottom: 16px;
    animation: float 3s ease-in-out infinite;
}
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-12px); }
}
.hero h2 {
    font-family: var(--font-serif);
    font-size: 1.6em;
    margin-bottom: 16px;
    color: var(--text-primary);
}
.hero-text {
    color: var(--text-secondary);
    font-size: 0.95em;
    line-height: 1.8;
    margin-bottom: 32px;
}

/* ─── 特性卡片 ─── */
.features {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-top: 40px;
}
.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 24px 16px;
    text-align: center;
    transition: all 0.3s ease;
}
.feature-card:hover {
    background: var(--bg-card-hover);
    transform: translateY(-4px);
    border-color: var(--accent-glow);
}
.feature-icon {
    font-size: 2em;
    margin-bottom: 12px;
    display: block;
}
.feature-card h3 {
    font-family: var(--font-serif);
    font-size: 1em;
    margin-bottom: 8px;
    color: var(--text-primary);
}
.feature-card p {
    font-size: 0.82em;
    color: var(--text-secondary);
}

/* ─── 按钮 ─── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 28px;
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font-sans);
    font-size: 0.95em;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}
.btn-primary {
    background: linear-gradient(135deg, var(--accent), #5a4db8);
    color: white;
    box-shadow: 0 4px 20px var(--accent-glow);
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 30px rgba(124, 111, 224, 0.4);
}
.btn-secondary {
    background: var(--bg-card);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}
.btn-secondary:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}
.btn-large {
    padding: 16px 48px;
    font-size: 1.1em;
    border-radius: var(--radius);
}
.btn-small {
    padding: 8px 16px;
    font-size: 0.85em;
}
.btn-full {
    width: 100%;
    padding: 16px;
    margin-top: 24px;
    font-size: 1.05em;
}
.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* ─── 页面头部 ─── */
.page-header {
    text-align: center;
    margin: 20px 0 32px;
}
.page-header h2 {
    font-family: var(--font-serif);
    font-size: 1.4em;
    margin-bottom: 8px;
}
.page-header p {
    color: var(--text-secondary);
    font-size: 0.9em;
}

/* ─── 表单 ─── */
.session-form {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 32px;
}
.form-section {
    margin-bottom: 24px;
}
.form-section.half {
    flex: 1;
}
.form-row {
    display: flex;
    gap: 16px;
}
.section-label {
    display: block;
    font-family: var(--font-serif);
    font-weight: 600;
    font-size: 0.95em;
    margin-bottom: 8px;
    color: var(--text-primary);
}
.form-input {
    width: 100%;
    padding: 12px 16px;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 0.95em;
    transition: border-color 0.3s ease;
    outline: none;
}
.form-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}
.form-input::placeholder {
    color: var(--text-muted);
}

/* ─── 照片上传 ─── */
.photo-upload {
    width: 200px;
    height: 200px;
    border: 2px dashed var(--border-color);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    overflow: hidden;
    position: relative;
    background: var(--bg-card);
}
.photo-upload:hover {
    border-color: var(--accent);
    background: var(--bg-card-hover);
}
.upload-placeholder {
    text-align: center;
    padding: 20px;
}
.upload-icon {
    font-size: 2.5em;
    color: var(--text-muted);
    display: block;
    margin-bottom: 8px;
}
.upload-placeholder p {
    font-size: 0.85em;
    color: var(--text-secondary);
}
.upload-hint {
    font-size: 0.75em !important;
    color: var(--text-muted) !important;
    margin-top: 4px;
}
.upload-preview {
    width: 100%;
    height: 100%;
    position: relative;
}
.upload-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.btn-change-photo {
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    padding: 4px 12px;
    background: rgba(0,0,0,0.7);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.75em;
    cursor: pointer;
}

/* ─── 问题 ─── */
.question-hint {
    font-size: 0.8em;
    color: var(--text-muted);
    margin-bottom: 12px;
}
.question-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}
.q-number {
    width: 28px;
    height: 28px;
    background: var(--accent-glow);
    border: 1px solid var(--accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8em;
    color: var(--accent-light);
    flex-shrink: 0;
}
.question-item .form-input {
    flex: 1;
}
.btn-remove {
    width: 28px;
    height: 28px;
    background: rgba(255,80,80,0.15);
    border: 1px solid rgba(255,80,80,0.3);
    border-radius: 50%;
    color: #ff6b6b;
    cursor: pointer;
    font-size: 0.85em;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s ease;
}
.btn-remove:hover {
    background: rgba(255,80,80,0.3);
}

/* ─── 示例问题 ─── */
.example-details {
    margin-top: -8px;
}
.example-details summary {
    cursor: pointer;
    color: var(--text-muted);
    font-size: 0.85em;
    padding: 8px 0;
}
.example-details summary:hover {
    color: var(--text-secondary);
}
.example-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}
.example-chip {
    padding: 8px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 0.82em;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}
.example-chip:hover {
    background: var(--accent-glow);
    border-color: var(--accent);
    color: var(--accent-light);
}

/* ─── 沟通动画页 ─── */
.comm-animation {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 70vh;
    text-align: center;
}
.spirit-circle {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    border: 2px solid var(--accent-glow);
    animation: pulse-ring 2s ease-in-out infinite;
    position: relative;
    margin-bottom: 40px;
}
.spirit-circle::before {
    content: '';
    position: absolute;
    top: -20px; left: -20px;
    right: -20px; bottom: -20px;
    border-radius: 50%;
    border: 1px solid rgba(124, 111, 224, 0.15);
    animation: pulse-ring-outer 3s ease-in-out infinite;
}
@keyframes pulse-ring {
    0%, 100% { box-shadow: 0 0 20px var(--accent-glow), inset 0 0 20px var(--accent-glow); }
    50% { box-shadow: 0 0 60px var(--accent-glow), inset 0 0 40px var(--accent-glow); }
}
@keyframes pulse-ring-outer {
    0%, 100% { transform: scale(1); opacity: 0.3; }
    50% { transform: scale(1.3); opacity: 0.1; }
}
.spirit-particles {
    position: absolute;
    width: 300px;
    height: 300px;
}
.comm-status {
    margin-top: 20px;
}
.comm-status h2 {
    font-family: var(--font-serif);
    color: var(--accent-light);
    margin-bottom: 8px;
}
.comm-status p {
    color: var(--text-secondary);
    font-size: 0.9em;
}

/* ─── 进度条 ─── */
.progress-bar {
    width: 300px;
    height: 4px;
    background: rgba(255,255,255,0.08);
    border-radius: 4px;
    margin: 24px auto;
    overflow: hidden;
}
.progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent), var(--gold));
    border-radius: 4px;
    transition: width 0.5s ease;
}
.progress-text {
    font-size: 0.85em !important;
    color: var(--text-muted) !important;
}

/* ─── 结果页 ─── */
.report-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 20px;
    animation: fadeUp 0.5s ease;
}
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 照片展示 */
.report-photo-wrapper {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    overflow: hidden;
    margin: 0 auto 16px;
    border: 2px solid var(--accent-glow);
}
.report-photo-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.photo-perception {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.85em;
    font-style: italic;
}

/* 信息行 */
.info-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
}
.info-row:last-child {
    border-bottom: none;
}
.info-label {
    color: var(--text-muted);
    font-size: 0.9em;
}
.info-value {
    color: var(--text-primary);
    font-size: 0.9em;
}

/* 问答结果 */
.result-item {
    padding: 20px 0;
    border-bottom: 1px solid var(--border-color);
    animation: fadeUp 0.5s ease;
}
.result-item:last-child {
    border-bottom: none;
}
.result-question {
    font-family: var(--font-serif);
    font-weight: 600;
    color: var(--gold);
    margin-bottom: 12px;
    font-size: 0.95em;
}
.result-answer {
    color: var(--text-primary);
    font-size: 0.9em;
    line-height: 1.8;
    white-space: pre-wrap;
}

/* 结尾语 */
.summary-header {
    font-family: var(--font-serif);
    font-weight: 700;
    color: var(--accent-light);
    margin-bottom: 12px;
    font-size: 1em;
}
.summary-content {
    color: var(--text-primary);
    font-size: 0.9em;
    line-height: 1.8;
    white-space: pre-wrap;
}

/* 操作栏 */
.action-bar {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 32px;
}

/* ─── 方案卡片 ─── */
.plans-section { margin-top: 30px; }
.section-title { font-family: var(--font-serif); font-size: 1.2em; margin-bottom: 20px; color: var(--text-primary); text-align: center; }
.plans-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.plan-card {
    background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--radius);
    padding: 28px 20px; text-align: center; cursor: pointer;
    transition: all 0.3s ease; position: relative;
}
.plan-card:hover { transform: translateY(-4px); border-color: var(--accent-glow); }
.plan-card.free { border-color: rgba(107, 207, 127, 0.3); }
.plan-card.popular { border-color: var(--accent-glow); background: rgba(124, 111, 224, 0.06); }
.plan-card.premium { border-color: rgba(240, 198, 116, 0.3); }
.plan-card.vip { border-color: rgba(240, 198, 116, 0.5); background: linear-gradient(135deg, rgba(240,198,116,0.05), rgba(124,111,224,0.05)); }
.plan-badge {
    position: absolute; top: -10px; right: 16px;
    background: var(--green); color: #0a0f1a; font-size: 0.7em; font-weight: 700;
    padding: 4px 12px; border-radius: 20px;
}
.popular-badge { background: var(--accent); color: white; }
.vip-badge { background: var(--gold); color: #0a0f1a; }
.plan-card h4 { font-family: var(--font-serif); font-size: 1.05em; margin-bottom: 8px; color: var(--text-primary); }
.plan-price { font-size: 2em; font-weight: 700; color: var(--text-primary); margin: 8px 0; }
.plan-price small { font-size: 0.4em; color: var(--text-muted); }
.plan-desc { color: var(--text-secondary); font-size: 0.85em; margin-bottom: 16px; }
.plan-card ul { list-style: none; padding: 0; margin: 16px 0; }
.plan-card li { font-size: 0.82em; color: var(--text-secondary); padding: 4px 0; }
.plan-extra { color: var(--text-muted); font-size: 0.75em; margin-top: 8px; }
.btn-plan { width: 100%; padding: 10px; font-size: 0.9em; }
.btn-premium { background: linear-gradient(135deg, #c9a84c, #e8c85a); color: #0a0f1a; border: none; box-shadow: 0 4px 20px rgba(201, 168, 76, 0.3); }
.btn-premium:hover { transform: translateY(-2px); }
.btn-vip { background: linear-gradient(135deg, #c9a84c, #f0c674); color: #0a0f1a; border: none; box-shadow: 0 4px 20px rgba(240, 198, 116, 0.4); }
.btn-vip:hover { transform: translateY(-2px); }

/* ─── 账户栏 ─── */
.account-bar { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 12px; }
.acc-badge {
    padding: 4px 12px; background: var(--bg-card); border: 1px solid var(--border-color);
    border-radius: 20px; font-size: 0.78em; color: var(--text-secondary);
}
.vip-badge { border-color: #f0c674; color: #f0c674; }

/* ─── 工具类 ─── */
.gold-text { color: var(--gold); }
.text-sec { color: var(--text-secondary); font-size: 0.9em; }
.mono { font-family: monospace; letter-spacing: 1px; }
.form-footnote { text-align: center; margin-top: 12px; font-size: 0.8em; color: var(--text-muted); }

/* ─── 响应式 ─── */
@media (max-width: 600px) {
    .form-row { flex-direction: column; }
    .features { grid-template-columns: 1fr; }
    .hero-animal { font-size: 4em; }
    .photo-upload { width: 160px; height: 160px; margin: 0 auto; }
    .container { padding: 16px 12px 60px; }
    .session-form { padding: 20px; }
    .header h1 { font-size: 1.4em; }
}
