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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    min-height: 100vh;
    background: #f6f7fb;
}

body.chat-page {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

body.card-page {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: block;
}

/* ========== 对话页面 ========== */

.chat-page .container {
    width: 90%;
    max-width: 700px;
    height: 85vh;
    background: rgba(255, 255, 255, 0.78);
    backdrop-filter: blur(18px) saturate(160%);
    border: 1px solid rgba(255, 255, 255, 0.35);
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* 头部导航 */
.header {
    padding: 16px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header h1 {
    font-size: 20px;
    letter-spacing: 2px;
}

/* 顶部菜单链接统一去下划线 */
.header-actions a,
.log-actions a,
.history-actions a,
.insights-nav a,
.card-header-nav a {
    text-decoration: none;
}

.end-btn {
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.8);
    border: 1.5px solid rgba(255, 255, 255, 0.4);
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.3s;
}

.end-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    color: white;
}

.end-btn-active {
    background: #e74c3c !important;
    border-color: #e74c3c !important;
    color: white !important;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.03); }
}

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

#chatBox {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

#chatBox::-webkit-scrollbar {
    width: 6px;
}

#chatBox::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.chat-page .message {
    padding: 12px 16px;
    border-radius: 12px;
    max-width: 80%;
    line-height: 1.6;
    font-size: 15px;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.chat-page .message.user {
    align-self: flex-end;
    background: #667eea;
    color: white;
    border-bottom-right-radius: 4px;
}

.chat-page .message.assistant {
    align-self: flex-start;
    background: #f0f0f0;
    color: #333;
    border-bottom-left-radius: 4px;
}

.chat-page .message.system {
    align-self: center;
    background: #ffeaa7;
    color: #d63031;
    font-size: 14px;
    text-align: center;
}

.input-area {
    padding: 16px 20px;
    border-top: 1px solid #eee;
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

#userInput {
    flex: 1;
    padding: 14px 16px;
    border: 2px solid #ddd;
    border-radius: 8px;
    resize: none;
    font-size: 16px;
    font-family: inherit;
    line-height: 1.5;
    transition: border-color 0.2s;
    min-height: 90px;
}

#userInput:focus {
    outline: none;
    border-color: #667eea;
}

#sendBtn {
    padding: 14px 26px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: background 0.2s;
    white-space: nowrap;
}

.intro {
    padding: 16px 20px 10px;
    border-bottom: 1px solid rgba(255,255,255,0.35);
    background:
        radial-gradient(120% 120% at 0% 0%, rgba(167, 196, 255, 0.35) 0%, rgba(167, 196, 255, 0) 50%),
        radial-gradient(120% 120% at 100% 0%, rgba(195, 132, 255, 0.28) 0%, rgba(195, 132, 255, 0) 55%),
        linear-gradient(180deg, rgba(255,255,255,0.75) 0%, rgba(255,255,255,0.05) 100%);
    box-shadow:
        inset 0 -1px 0 rgba(255,255,255,0.35),
        0 10px 30px rgba(92, 110, 200, 0.12);
    position: relative;
}

.intro::after {
    content: '';
    position: absolute;
    left: 20px;
    right: 20px;
    bottom: 8px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(126, 154, 255, 0.5), transparent);
    opacity: 0.8;
}

.intro-title {
    font-size: 20px;
    font-weight: 600;
    color: #1f2240;
    margin-bottom: 8px;
    letter-spacing: 0.5px;
    text-shadow: 0 0 18px rgba(128, 157, 255, 0.45);
}

.intro-subtitle {
    font-size: 14px;
    color: rgba(40, 44, 74, 0.8);
    margin-bottom: 8px;
}

.intro-steps {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 12px;
    color: rgba(35, 38, 66, 0.7);
    margin-bottom: 8px;
}

.intro-steps div {
    padding: 4px 8px;
    border-radius: 999px;
    background: rgba(120, 138, 255, 0.06);
    border: 1px solid rgba(142, 167, 255, 0.2);
    box-shadow: none;
}

.prompt-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.prompt-chip {
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid rgba(142, 167, 255, 0.4);
    background: rgba(120, 138, 255, 0.12);
    color: #2f3b91;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 0 12px rgba(138, 164, 255, 0.18);
}

.prompt-chip:hover {
    background: rgba(120, 138, 255, 0.22);
    border-color: rgba(142, 167, 255, 0.7);
    box-shadow: 0 0 18px rgba(138, 164, 255, 0.28);
}

#sendBtn:hover {
    background: #5568d3;
}

#sendBtn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* ========== 卡片页面样式 ========== */

.card-container {
    width: 90%;
    max-width: 600px;
    margin: 40px auto;
}

.card-header-nav {
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
}

.nav-link {
    color: white;
    text-decoration: none;
    font-size: 16px;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.nav-link:hover {
    opacity: 1;
}

.growth-card {
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    margin-bottom: 20px;
    position: relative;
}

/* ===== 卡片入场动画 ===== */
.growth-card.card-enter {
    animation: cardRise 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes cardRise {
    0% {
        opacity: 0;
        transform: translateY(60px) scale(0.92);
        filter: blur(4px);
    }
    60% {
        opacity: 1;
        filter: blur(0);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
    }
}

/* 各区块依次进场 */
.growth-card.card-enter .card-theme {
    animation: sectionFadeUp 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.2s both;
}

.growth-card.card-enter .card-section:nth-child(2) {
    animation: sectionFadeUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.5s both;
}

.growth-card.card-enter .card-section:nth-child(3) {
    animation: sectionFadeUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.7s both;
}

.growth-card.card-enter .card-section:nth-child(4) {
    animation: sectionFadeUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.9s both;
}

.growth-card.card-enter .practice-tracker {
    animation: sectionFadeUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) 1.1s both;
}

.growth-card.card-enter .card-footer {
    animation: sectionFadeUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) 1.3s both;
}

@keyframes sectionFadeUp {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 主题头部光晕脉冲 */
.growth-card.card-enter .card-theme::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,255,255,0.4) 0%, transparent 70%);
    animation: themeRevealPulse 1.2s cubic-bezier(0.16, 1, 0.3, 1) 0.3s forwards;
    z-index: 0;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

@keyframes themeRevealPulse {
    0% {
        width: 0;
        height: 0;
        opacity: 0.8;
    }
    70% {
        opacity: 0.3;
    }
    100% {
        width: 300%;
        height: 300%;
        opacity: 0;
    }
}

/* 光带扫过卡片 */
.growth-card.card-enter::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 60%;
    height: 100%;
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.3) 50%, transparent 100%);
    animation: shineSweep 1s ease-in-out 0.6s forwards;
    pointer-events: none;
    z-index: 10;
}

@keyframes shineSweep {
    0% {
        left: -100%;
    }
    100% {
        left: 150%;
    }
}

/* 图标入场弹跳 */
.growth-card.card-enter .card-icon {
    animation: iconBounceIn 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) 0.4s both;
}

@keyframes iconBounceIn {
    0% {
        opacity: 0;
        transform: translateY(-30px) scale(0.3);
    }
    60% {
        transform: translateY(4px) scale(1.15);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* 出现次数徽章动画 */
.growth-card.card-enter .occurrence-badge {
    animation: badgePop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 1.5s both;
}

@keyframes badgePop {
    0% {
        opacity: 0;
        transform: scale(0);
    }
    70% {
        transform: scale(1.2);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* 粒子/星光效果 */
.card-sparkles {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 2;
}

.sparkle {
    position: absolute;
    color: rgba(255, 255, 255, 0.9);
    opacity: 0;
    animation: sparkleFloat ease-out forwards;
    text-shadow: 0 0 6px rgba(255, 255, 255, 0.6);
    pointer-events: none;
}

@keyframes sparkleFloat {
    0% {
        opacity: 0;
        transform: translateY(10px) scale(0);
    }
    30% {
        opacity: 1;
        transform: translateY(-5px) scale(1.2);
    }
    70% {
        opacity: 0.7;
        transform: translateY(-20px) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateY(-35px) scale(0.5);
    }
}

.growth-card.card-gold {
    border: 1px solid rgba(220, 170, 50, 0.6);
    box-shadow:
        0 12px 36px rgba(199, 152, 36, 0.28),
        0 0 0 1px rgba(255, 230, 150, 0.6);
}

.growth-card.card-gold .card-theme {
    background: linear-gradient(135deg, #f7d36b 0%, #f0b949 50%, #f7d36b 100%) !important;
}

.card-theme {
    padding: 40px 30px;
    color: white;
    text-align: center;
    background-size: 200% 200%;
    animation: breathe 6s ease-in-out infinite;
    position: relative;
    overflow: hidden;
}

.card-theme::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, transparent 70%);
    animation: glow 8s ease-in-out infinite;
}

@keyframes breathe {
    0%, 100% {
        background-size: 200% 200%;
        background-position: 0% 50%;
    }
    50% {
        background-size: 220% 220%;
        background-position: 100% 50%;
    }
}

@keyframes glow {
    0%, 100% {
        transform: translate(0, 0) scale(1);
        opacity: 0.3;
    }
    50% {
        transform: translate(10%, 10%) scale(1.1);
        opacity: 0.6;
    }
}

.card-icon {
    font-size: 52px;
    display: block;
    margin-bottom: 12px;
    animation: float 4s ease-in-out infinite;
    position: relative;
    z-index: 1;
}

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

.card-theme h2 {
    font-size: 24px;
    letter-spacing: 3px;
    position: relative;
    z-index: 1;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
}

.card-section {
    padding: 20px 30px;
    border-bottom: 1px solid #f0f0f0;
}

.card-section:last-of-type {
    border-bottom: none;
}

.card-section h3 {
    font-size: 12px;
    color: #999;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.card-section p {
    font-size: 16px;
    line-height: 1.8;
    color: #333;
}

.card-footer {
    padding: 15px 30px;
    background: #f8f8f8;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    color: #666;
}

.practice-tracker {
    padding: 16px 20px 18px;
    border-top: 1px solid #f0f0f0;
    border-bottom: 1px solid #f0f0f0;
    background: linear-gradient(180deg, rgba(255,255,255,0.9) 0%, rgba(248,248,255,0.9) 100%);
}

.practice-title {
    font-size: 14px;
    color: #333;
    margin-bottom: 6px;
    font-weight: 600;
}

.practice-desc {
    font-size: 14px;
    color: #555;
    margin-bottom: 12px;
}

.practice-progress {
    font-size: 13px;
    color: #777;
    margin-bottom: 8px;
}

.practice-list {
    display: grid;
    gap: 10px;
}

.practice-item {
    display: grid;
    grid-template-columns: 20px 1fr auto auto;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(255,255,255,0.9);
    border: 1px solid #e9e9f4;
}

.practice-item.done {
    background: #f2f7f2;
    border-color: #d7ead7;
}

.practice-check {
    font-size: 16px;
    color: #667eea;
}

.practice-item.done .practice-check {
    color: #2d8a4b;
    font-weight: bold;
}

.practice-label {
    font-size: 14px;
    color: #444;
}

.practice-btn {
    padding: 6px 12px;
    border-radius: 8px;
    border: 1px solid rgba(102, 126, 234, 0.5);
    background: rgba(102, 126, 234, 0.1);
    color: #4a5bd4;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
}

.practice-btn.view {
    background: rgba(39, 174, 96, 0.12);
    border-color: rgba(39, 174, 96, 0.4);
    color: #2d8a4b;
}

.practice-btn:hover {
    background: rgba(102, 126, 234, 0.2);
}

.practice-btn:disabled {
    background: #e8f5e8;
    border-color: #cde8cd;
    color: #2d8a4b;
    cursor: not-allowed;
}

.practice-date {
    font-size: 12px;
    color: #888;
}

.occurrence-badge {
    background: #667eea;
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
}

.card-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    animation: sectionFadeUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) 1.6s both;
}

.btn-primary, .btn-secondary {
    flex: 1;
    padding: 14px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5568d3;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.9);
    color: #333;
}

.btn-secondary:hover {
    background: white;
}

/* 对话记录展示 */
.conversation-detail {
    background: white;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.conversation-detail h3 {
    font-size: 16px;
    color: #333;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #eee;
}

.conv-message {
    padding: 12px 16px;
    margin: 10px 0;
    border-radius: 10px;
    line-height: 1.7;
    font-size: 14px;
}

.conv-message.user {
    background: #e8eaf6;
}

.conv-message.assistant {
    background: #f5f5f5;
    position: relative;
}

.conv-message.conv-highlight {
    border: 2px solid #f7d36b;
    background: #fff7d6;
    box-shadow: 0 6px 16px rgba(247, 211, 107, 0.35);
}

.conv-message.assistant:hover .btn-save-insight {
    opacity: 1;
}

.conv-message.assistant:hover .save-insight-hint {
    opacity: 1;
}

@media (hover: none) {
    .conv-message.assistant .btn-save-insight,
    .conv-message.assistant .save-insight-hint {
        opacity: 1;
    }
}

/* 同主题历史对话 */
.sibling-section {
    background: white;
    border-radius: 16px;
    padding: 24px;
    margin-top: 16px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.sibling-section h3 {
    font-size: 16px;
    color: #333;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #eee;
}

.sibling-item {
    border: 1px solid #e8e8f0;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 14px;
    background: #fafafe;
    transition: box-shadow 0.2s;
}

.sibling-item:hover {
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.06);
}

.sibling-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

.sibling-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.sibling-date {
    font-size: 12px;
    color: #888;
    white-space: nowrap;
}

.sibling-belief {
    font-size: 13px;
    color: #555;
    font-weight: 500;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sibling-summary {
    font-size: 14px;
    color: #666;
    font-style: italic;
    line-height: 1.5;
    margin-bottom: 6px;
}

.sibling-rounds {
    font-size: 12px;
    color: #aaa;
    margin-bottom: 10px;
}

.btn-toggle-sib {
    background: none;
    border: 1px solid #e0e0e0;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    min-width: 28px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #667eea;
    cursor: pointer;
    transition: all 0.25s ease;
}

.btn-toggle-sib:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
    transform: scale(1.1);
}

.btn-toggle-sib svg {
    transition: transform 0.25s ease;
}

.sibling-conv {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #eee;
}

.sibling-conv .conv-message {
    margin: 4px 0;
    padding: 8px 12px;
    font-size: 13px;
    border-radius: 8px;
    overflow: hidden;
}

.sibling-conv .conv-message.model,
.sibling-conv .conv-message.assistant {
    background: rgba(102, 126, 234, 0.06);
}

.card-loading {
    padding: 40px;
    text-align: center;
    color: #999;
    font-size: 16px;
}

.error {
    color: #e74c3c !important;
}

/* ========== 响应式 ========== */

@media (max-width: 600px) {
    body {
        align-items: stretch;
    }

    .container {
        width: 100%;
        height: 100vh;
        border-radius: 0;
    }

    .message {
        max-width: 90%;
    }

    .card-container {
        width: 95%;
        margin: 20px auto;
    }

    .card-actions {
        flex-direction: column;
    }
}

/* ==================== 成长记录页样式 ==================== */

.log-page {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    display: block;
}

.log-container {
    max-width: 1200px;
    margin: 0 auto;
}

.log-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    color: white;
}

.log-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.export-btn {
    padding: 12px 18px;
    border-radius: 12px;
    border: 2px solid rgba(255,255,255,0.9);
    background: rgba(255,255,255,0.15);
    color: white;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.export-btn:hover {
    background: white;
    color: #667eea;
}

.export-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
}

.export-panel {
    width: 92%;
    max-width: 480px;
    background: white;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.2);
}

.export-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 12px;
}

.export-options {
    display: grid;
    gap: 8px;
    font-size: 14px;
    color: #333;
}

.export-options label {
    display: flex;
    gap: 8px;
    align-items: center;
}

.export-options .disabled {
    color: #999;
}

.export-note {
    font-size: 12px;
    color: #999;
    margin-top: 4px;
}

.export-actions {
    display: flex;
    gap: 10px;
    margin-top: 16px;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(20, 16, 40, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-panel {
    width: 92%;
    max-width: 420px;
    background: linear-gradient(160deg, rgba(255,255,255,0.96) 0%, rgba(245,248,255,0.96) 100%);
    border-radius: 16px;
    padding: 18px;
    box-shadow: 0 25px 60px rgba(20, 16, 40, 0.35);
    border: 1px solid rgba(170, 190, 255, 0.4);
}

.modal-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 10px;
    color: #1f2240;
    text-shadow: 0 0 12px rgba(128, 157, 255, 0.35);
}

.modal-body {
    font-size: 14px;
    color: #3a3f66;
    margin-bottom: 14px;
    white-space: pre-wrap;
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.modal-hint {
    font-size: 13px;
    color: #4b4f7a;
    margin-bottom: 8px;
}

.modal-textarea {
    width: 100%;
    border: 1px solid rgba(132, 152, 255, 0.45);
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    background: rgba(255,255,255,0.9);
    box-shadow: inset 0 0 16px rgba(140, 160, 255, 0.08);
}

.modal-panel .btn-primary {
    background: linear-gradient(135deg, #6d7cff 0%, #8a63ff 100%);
    box-shadow: 0 8px 18px rgba(109, 124, 255, 0.35);
}

.modal-panel .btn-primary:hover {
    background: linear-gradient(135deg, #5e6fff 0%, #7a54ff 100%);
}

.modal-panel .btn-secondary {
    background: rgba(255,255,255,0.85);
    border: 1px solid rgba(122, 140, 255, 0.35);
    color: #3a3f66;
}
.badge-unlocked {
    margin: 10px 0 18px;
    padding: 10px 14px;
    border-radius: 12px;
    background: linear-gradient(135deg, #f7d36b 0%, #f0b949 100%);
    color: #5a3b00;
    font-weight: 600;
    text-align: center;
    box-shadow: 0 8px 20px rgba(199, 152, 36, 0.3);
}

.log-header h1 {
    font-size: 32px;
    font-weight: bold;
}

.new-chat-btn {
    padding: 12px 24px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid white;
    border-radius: 12px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: all 0.3s;
}

.new-chat-btn:hover {
    background: white;
    color: #667eea;
}

/* 统计卡片 */
.stats-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.insight-feedback {
    margin: 0 0 24px;
    padding: 14px 16px;
    border-radius: 14px;
    background: rgba(255,255,255,0.18);
    color: rgba(255,255,255,0.9);
    font-size: 14px;
    line-height: 1.6;
    border: 1px solid rgba(255,255,255,0.3);
    box-shadow: 0 8px 18px rgba(0,0,0,0.12);
}

.stat-card {
    background: white;
    padding: 25px;
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.stat-number {
    font-size: 36px;
    font-weight: bold;
    color: #667eea;
    margin-bottom: 8px;
}

.stat-label {
    font-size: 14px;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* 筛选按钮 */
.filter-section {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 30px;
}

.filter-btn {
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.filter-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.filter-btn.active {
    background: white;
    color: #667eea;
    border-color: white;
}

/* 卡片网格 */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.card-thumbnail {
    background: white;
    padding: 20px;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    position: relative;
}

.card-thumbnail.gold {
    background: linear-gradient(135deg, rgba(255, 247, 215, 0.95) 0%, rgba(255, 231, 156, 0.8) 100%);
    border: 1px solid rgba(220, 170, 50, 0.5);
    box-shadow: 0 8px 24px rgba(199, 152, 36, 0.25);
}

.card-thumbnail:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.card-thumb-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.card-thumb-icon {
    font-size: 32px;
}

.card-thumb-date {
    font-size: 12px;
    color: #999;
}

.card-thumb-theme {
    font-size: 20px;
    font-weight: bold;
    color: #333;
    margin-bottom: 10px;
}

.card-thumb-belief {
    font-size: 14px;
    color: #666;
    line-height: 1.5;
    margin-bottom: 10px;
}

.card-thumb-badge {
    display: inline-block;
    padding: 4px 10px;
    background: #667eea;
    color: white;
    border-radius: 12px;
    font-size: 11px;
    font-weight: bold;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.empty-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

.empty-state h3 {
    font-size: 24px;
    color: #333;
    margin-bottom: 10px;
}

.empty-state p {
    font-size: 16px;
    color: #999;
    margin-bottom: 30px;
}

.loading, .no-results {
    text-align: center;
    padding: 40px;
    color: white;
    font-size: 18px;
}

/* 顶部导航按钮 */
.header-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.nav-link-btn {
    padding: 8px 16px;
    background: rgba(255,255,255,0.2);
    color: white;
    border: 2px solid white;
    border-radius: 8px;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s;
}

.nav-link-btn:hover {
    background: white;
    color: #667eea;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .log-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .log-header h1 {
        font-size: 24px;
    }

    .stats-section {
        grid-template-columns: 1fr;
    }

    .cards-grid {
        grid-template-columns: 1fr;
    }

    .filter-section {
        justify-content: center;
    }
}

/* 打字指示器动画 */
.typing-indicator {
    display: inline-block;
    font-size: 20px;
    color: #999;
    animation: typing 1.4s infinite;
}

@keyframes typing {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

/* 逐字显示的平滑效果 */
.chat-page .message.assistant {
    animation: fadeIn 0.3s ease-in;
}

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

/* 错误消息样式 */
.chat-page .message.error {
    background: #ffeaa7;
    color: #d63031;
}

#energyMeter {
    position: fixed;
    right: 20px;
    bottom: 20px;
    background: rgba(255,255,255,0.92);
    border-radius: 14px;
    padding: 10px 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    font-size: 12px;
    color: #333;
    z-index: 9999;
    width: 140px;
}

.energy-label {
    font-weight: 600;
    margin-bottom: 6px;
}

.energy-bar {
    width: 100%;
    height: 8px;
    background: #e6e6f6;
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 6px;
}

.energy-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(135deg, #6d7cff 0%, #8a63ff 100%);
    border-radius: 999px;
    transition: width 0.3s ease;
}

.energy-text {
    text-align: right;
    font-size: 11px;
    color: #666;
}

/* ========== 洞见收藏按钮（对话页） ========== */

.btn-save-insight {
    display: block;
    margin-top: 8px;
    padding: 4px 10px;
    background: transparent;
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: 6px;
    color: #667eea;
    font-size: 12px;
    cursor: pointer;
    opacity: 0;
    transition: all 0.2s;
}

.message.assistant:hover .btn-save-insight {
    opacity: 1;
}

.btn-save-insight:hover {
    background: rgba(102, 126, 234, 0.1);
    border-color: #667eea;
}

.save-insight-hint {
    font-size: 11px;
    color: #7c82a3;
    margin-top: 4px;
    opacity: 0;
    transition: opacity 0.2s;
}

.message.assistant:hover .save-insight-hint {
    opacity: 1;
}

@media (hover: none) {
    .save-insight-hint {
        opacity: 1;
    }
}

@media (hover: none) {
    .btn-save-insight {
        opacity: 1;
    }
}

.insight-tag-option {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid #ddd;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.insight-tag-option:has(input:checked) {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.insight-tag-option input {
    display: none;
}

.save-toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 15px;
    z-index: 9999;
    animation: toastIn 0.3s ease, toastOut 0.3s ease 1.5s forwards;
}

@keyframes toastIn {
    from { opacity: 0; transform: translateX(-50%) translateY(20px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

@keyframes toastOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

/* ========== 每日签到页 ========== */

.checkin-page {
    background: linear-gradient(135deg, #1a1a3e 0%, #2d1b69 40%, #0f0f2e 100%);
    min-height: 100vh;
    padding: 20px;
    display: block;
}

.day-mode .checkin-page {
    background: linear-gradient(135deg, #667eea 0%, #fccb90 50%, #764ba2 100%);
}

.night-mode .checkin-page {
    background:
        radial-gradient(2px 2px at 20% 30%, rgba(255,255,255,0.6), transparent),
        radial-gradient(2px 2px at 60% 70%, rgba(255,255,255,0.5), transparent),
        radial-gradient(1px 1px at 50% 50%, rgba(255,255,255,0.4), transparent),
        linear-gradient(135deg, #0f0c29 0%, #302b63 50%, #24243e 100%);
}

.checkin-container {
    max-width: 600px;
    margin: 0 auto;
}

.checkin-nav {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-bottom: 20px;
}

.checkin-nav .nav-link {
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    font-size: 14px;
    padding: 6px 12px;
    border-radius: 8px;
    transition: all 0.2s;
}

.checkin-nav .nav-link:hover {
    color: white;
    background: rgba(255,255,255,0.1);
}

.ritual-card {
    background: linear-gradient(160deg, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0.03) 100%);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 24px;
    padding: 32px 28px;
    margin-bottom: 20px;
    backdrop-filter: blur(10px);
}

.ritual-date {
    text-align: center;
    color: rgba(255,255,255,0.5);
    font-size: 14px;
    margin-bottom: 6px;
    letter-spacing: 1px;
}

.ritual-greeting {
    text-align: center;
    color: rgba(255,255,255,0.8);
    font-size: 16px;
    margin-bottom: 28px;
}

.ritual-theme {
    text-align: center;
    margin-bottom: 28px;
}

.ritual-theme-icon {
    font-size: 56px;
    margin-bottom: 10px;
    animation: float 4s ease-in-out infinite;
}

.ritual-theme-label {
    font-size: 12px;
    color: rgba(255,255,255,0.4);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 8px;
}

.ritual-theme-name {
    font-size: 32px;
    color: white;
    letter-spacing: 4px;
    margin-bottom: 12px;
    text-shadow: 0 0 30px rgba(138, 164, 255, 0.4);
}

.ritual-quote {
    font-size: 15px;
    color: rgba(255,255,255,0.7);
    font-style: italic;
    line-height: 1.6;
}

/* 抽卡按钮 */
.daily-card-area {
    text-align: center;
    transition: all 0.6s;
}

.daily-card-area.card-flipping {
    transform: rotateY(90deg);
    opacity: 0;
}

.draw-card-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 16px 32px;
    background: linear-gradient(135deg, rgba(138, 164, 255, 0.3) 0%, rgba(195, 132, 255, 0.3) 100%);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 16px;
    color: white;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s;
}

.draw-card-btn:hover {
    background: linear-gradient(135deg, rgba(138, 164, 255, 0.5) 0%, rgba(195, 132, 255, 0.5) 100%);
    transform: scale(1.05);
    box-shadow: 0 8px 30px rgba(138, 164, 255, 0.3);
}

.draw-icon {
    font-size: 24px;
    animation: spin 3s linear infinite;
}

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

/* 抽到的卡 */
.drawn-card {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.drawn-card.revealed {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.drawn-card-inner {
    background: linear-gradient(160deg, rgba(255,255,255,0.12) 0%, rgba(255,255,255,0.05) 100%);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 16px;
    padding: 24px;
    text-align: center;
}

.drawn-card-icon {
    font-size: 40px;
    margin-bottom: 10px;
}

.drawn-card-inner h3 {
    font-size: 20px;
    color: white;
    margin-bottom: 10px;
    letter-spacing: 2px;
}

.drawn-card-inner p {
    font-size: 15px;
    color: rgba(255,255,255,0.8);
    line-height: 1.6;
    margin-bottom: 12px;
}

.drawn-card-practice {
    font-size: 13px;
    color: rgba(255,255,255,0.6);
    padding: 10px 16px;
    background: rgba(255,255,255,0.06);
    border-radius: 10px;
}

/* 主题选择 */
.topic-section {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 20px;
    padding: 24px;
    margin-bottom: 20px;
}

.topic-section h3 {
    color: white;
    font-size: 18px;
    margin-bottom: 16px;
    text-align: center;
}

.topic-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.topic-btn {
    padding: 14px 16px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 12px;
    color: rgba(255,255,255,0.9);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
}

.topic-btn:hover {
    background: rgba(255,255,255,0.15);
    border-color: rgba(255,255,255,0.3);
    transform: translateY(-2px);
}

/* 签到统计 */
.streak-section {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 16px;
    padding: 20px;
    text-align: center;
    color: rgba(255,255,255,0.8);
    font-size: 15px;
}

.streak-info {
    margin-bottom: 8px;
}

.streak-fire {
    font-size: 20px;
    margin-right: 4px;
}

.streak-meta {
    font-size: 13px;
    color: rgba(255,255,255,0.5);
}

.achievement-banner {
    margin-top: 14px;
    padding: 12px;
    background: linear-gradient(135deg, #f7d36b 0%, #f0b949 100%);
    color: #5a3b00;
    border-radius: 12px;
    font-weight: 600;
    font-size: 14px;
}

/* ========== 今日觉醒时刻（新版签到页） ========== */

.daily-ritual-container {
    max-width: 760px;
    margin: 0 auto;
}

.ritual-header {
    color: white;
    margin: 10px 0 18px;
}

.header-row {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 12px;
}

.back-btn {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 12px;
    cursor: pointer;
}

.header-center {
    text-align: center;
}

.header-title {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 1px;
}

.header-subtitle {
    font-size: 12px;
    opacity: 0.8;
    margin-top: 4px;
}

.header-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.header-actions .nav-link {
    padding: 6px 10px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.35);
    color: white;
    text-decoration: none;
    font-size: 12px;
    background: rgba(255,255,255,0.12);
}

.header-actions .nav-link.icon-only {
    width: 32px;
    text-align: center;
    padding: 6px;
}

.header-streak {
    display: flex;
    justify-content: center;
    margin-top: 8px;
    gap: 10px;
    align-items: center;
}

/* 连续成长徽章（增强） */
.streak-badge.enhanced {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 14px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.28);
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.22);
    color: white;
}

.streak-flame {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #ffe29a 0%, #ff9f45 40%, #ff6b6b 75%);
    box-shadow: 0 0 12px rgba(255, 176, 86, 0.7);
    animation: flameFlicker 1.6s ease-in-out infinite;
}

.streak-info {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.streak-number {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 1px;
}

.streak-label {
    font-size: 11px;
    opacity: 0.9;
}

.streak-milestone {
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: center;
}

.progress-ring {
    position: relative;
    width: 56px;
    height: 56px;
}

.progress-ring svg {
    width: 56px;
    height: 56px;
    transform: rotate(-90deg);
}

.progress-ring-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.25);
    stroke-width: 4;
}

.progress-ring-circle {
    fill: none;
    stroke: #ffe29a;
    stroke-width: 4;
    stroke-linecap: round;
    stroke-dasharray: 0 88;
    transition: stroke-dasharray 0.4s ease;
}

.milestone-text {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    text-align: center;
    line-height: 1.2;
}

.milestone-hint {
    margin: 0;
    font-size: 10px;
    opacity: 0.85;
    text-align: center;
    max-width: 180px;
}

@keyframes flameFlicker {
    0%, 100% { transform: scale(1); opacity: 0.9; }
    50% { transform: scale(1.08); opacity: 1; }
}

.manual-checkin-btn {
    background: rgba(255,255,255,0.18);
    color: white;
    border: 1px solid rgba(255,255,255,0.35);
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 12px;
    cursor: pointer;
}

.manual-checkin-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.reset-checkin-btn {
    background: rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.7);
    border: 1px solid rgba(255,255,255,0.2);
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.3s;
}

.reset-checkin-btn:hover {
    background: rgba(255,255,255,0.15);
    color: white;
    border-color: rgba(255,255,255,0.3);
}

.auto-checkin-hint {
    margin: 6px 0 14px;
    padding: 10px 14px;
    border-radius: 12px;
    background: rgba(255,255,255,0.18);
    color: rgba(255,255,255,0.9);
    font-size: 13px;
    line-height: 1.6;
    text-align: center;
}

.mode-toggle {
    position: relative;
    width: 58px;
    height: 28px;
    border-radius: 999px;
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.35);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    padding: 0 6px;
}

.mode-toggle .toggle-slider {
    position: absolute;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: white;
    left: 4px;
    transition: left 0.3s ease;
}

.mode-toggle.night .toggle-slider {
    left: 32px;
}

.mode-toggle .sun-icon,
.mode-toggle .moon-icon {
    font-size: 14px;
    z-index: 1;
}

.mode-toggle .sun-icon {
    margin-right: auto;
    opacity: 1;
}

.mode-toggle .moon-icon {
    margin-left: auto;
    opacity: 0.6;
}

.mode-toggle.night .sun-icon {
    opacity: 0.5;
}

.mode-toggle.night .moon-icon {
    opacity: 1;
}

.mode-container {
    display: none;
    opacity: 0;
    transform: translateY(12px);
    transition: all 0.4s ease;
}

.mode-container.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

/* 夜间流程提示条 */
.night-flow-hint {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    margin-bottom: 16px;
    background: rgba(255,255,255,0.06);
    border-radius: 12px;
    font-size: 13px;
    color: rgba(255,255,255,0.5);
}

.flow-step {
    padding: 4px 10px;
    border-radius: 8px;
    transition: all 0.3s;
}

.flow-arrow {
    color: rgba(255,255,255,0.25);
    font-size: 11px;
}

/* 夜间卡片基础 */
.night-card {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.10);
    border-radius: 20px;
    padding: 24px;
    margin-bottom: 16px;
    color: rgba(255,255,255,0.9);
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
    transition: all 0.3s;
}

.night-card:hover {
    border-color: rgba(255,255,255,0.18);
    box-shadow: 0 12px 32px rgba(0,0,0,0.3);
}

.night-card-icon {
    font-size: 28px;
    margin-bottom: 8px;
}

.night-card h3 {
    margin-top: 0;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
}

.night-card-dimmed {
    opacity: 0.4;
    pointer-events: none;
}

.night-hint {
    font-size: 14px;
    color: rgba(255,255,255,0.6);
    line-height: 1.6;
    margin-bottom: 12px;
}

.night-actions {
    display: flex;
    gap: 10px;
    margin-top: 12px;
}

/* 夜间文本输入 */
.night-textarea {
    width: 100%;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.15);
    background: rgba(255,255,255,0.06);
    color: rgba(255,255,255,0.9);
    padding: 12px 14px;
    margin: 10px 0;
    font-size: 14px;
    font-family: inherit;
    line-height: 1.6;
    resize: vertical;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.night-textarea:focus {
    outline: none;
    border-color: rgba(255,255,255,0.35);
    background: rgba(255,255,255,0.08);
}

.night-textarea::placeholder {
    color: rgba(255,255,255,0.4);
}

.night-input {
    width: 100%;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.15);
    background: rgba(255,255,255,0.06);
    color: rgba(255,255,255,0.9);
    padding: 10px 14px;
    font-size: 14px;
    font-family: inherit;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.night-input:focus {
    outline: none;
    border-color: rgba(255,255,255,0.35);
    background: rgba(255,255,255,0.08);
}

.night-input::placeholder {
    color: rgba(255,255,255,0.4);
}

/* 梦境模块 */
.dream-mode-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.dream-tab {
    padding: 6px 14px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.15);
    background: transparent;
    color: rgba(255,255,255,0.6);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.dream-tab.active {
    background: rgba(255,255,255,0.15);
    color: white;
    border-color: rgba(255,255,255,0.3);
}

.dream-tab.disabled {
    opacity: 0.35;
    cursor: not-allowed;
    pointer-events: none;
}

.dream-saved-badge {
    background: rgba(129, 199, 132, 0.2);
    color: #a5d6a7;
    padding: 8px 16px;
    border-radius: 10px;
    font-size: 14px;
    margin-bottom: 8px;
    display: inline-block;
}

.dream-saved-content {
    font-size: 13px;
    color: rgba(255,255,255,0.5);
    font-style: italic;
    margin-top: 6px;
    line-height: 1.6;
}

/* 梦境解读结果 */
.dream-clues {
    margin-top: 14px;
    padding: 14px 16px;
    background: rgba(255,255,255,0.06);
    border-radius: 12px;
    border-left: 3px solid rgba(179, 157, 219, 0.6);
}

.dream-clues-title {
    font-size: 14px;
    font-weight: 600;
    color: #b39ddb;
    margin-bottom: 10px;
}

.clue-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    flex-wrap: wrap;
}

.clue-label {
    font-size: 13px;
    color: rgba(255,255,255,0.5);
    white-space: nowrap;
}

.clue-value {
    font-size: 13px;
    color: rgba(255,255,255,0.8);
}

.clue-theme-tag {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 6px;
    background: rgba(179, 157, 219, 0.2);
    color: #ce93d8;
    font-size: 12px;
    margin-right: 4px;
}

.dream-clues-note {
    font-size: 12px;
    color: rgba(255,255,255,0.4);
    margin-top: 10px;
    margin-bottom: 0;
    line-height: 1.5;
}

.btn-small {
    font-size: 13px;
    padding: 6px 14px;
    margin-top: 12px;
}

/* 昨晚意图回显 */
.dream-intent-recall {
    margin-bottom: 16px;
    padding: 14px 16px;
    background: rgba(165, 214, 167, 0.08);
    border-radius: 12px;
    border-left: 3px solid rgba(165, 214, 167, 0.4);
}

.intent-recall-label {
    font-size: 12px;
    color: rgba(165, 214, 167, 0.7);
    margin-bottom: 6px;
}

.intent-recall-text {
    font-size: 15px;
    color: rgba(255,255,255,0.85);
    font-style: italic;
    margin-bottom: 8px;
}

.intent-recall-prompt {
    font-size: 13px;
    color: rgba(255,255,255,0.5);
    margin: 0;
}

/* 今晚意图区域 */
.dream-tonight-intent {
    margin-top: 16px;
}

.tonight-intent-divider {
    height: 1px;
    background: rgba(255,255,255,0.08);
    margin-bottom: 16px;
}

.tonight-intent-label {
    font-size: 15px;
    font-weight: 500;
    color: rgba(255,255,255,0.8);
    margin-bottom: 4px;
}

.tonight-intent-hint {
    font-size: 13px;
    color: rgba(255,255,255,0.45);
    line-height: 1.5;
    margin-bottom: 10px;
}

.tonight-intent-row {
    display: flex;
    gap: 10px;
    align-items: center;
}

.tonight-intent-row .night-input,
.tonight-intent-row .night-textarea {
    flex: 1;
}

.intention-examples {
    background: rgba(255,255,255,0.06);
    border-radius: 12px;
    padding: 12px 14px;
    margin: 10px 0;
    color: rgba(255,255,255,0.75);
    font-size: 12px;
}

.intention-examples ul {
    margin: 6px 0 0;
    padding-left: 16px;
}

.tonight-intent-saved {
    font-size: 13px;
    color: #a5d6a7;
    margin-top: 8px;
}

/* 复盘模块 */
.review-auto-summary {
    margin-bottom: 16px;
    padding: 16px;
    background: rgba(255,255,255,0.05);
    border-radius: 12px;
}

.review-letter {
    color: rgba(255,255,255,0.85);
    line-height: 1.7;
    font-size: 14px;
}

.review-letter strong {
    color: #ffe29a;
}

.review-sign {
    margin-top: 8px;
    text-align: right;
    opacity: 0.8;
}

.review-details {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.review-tag {
    background: rgba(255,255,255,0.08);
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 12px;
    color: rgba(255,255,255,0.6);
}

.review-prompt {
    font-size: 14px;
    color: rgba(255,255,255,0.6);
    margin-bottom: 4px;
}

.reflection-prompts p {
    margin: 10px 0 6px;
    color: rgba(255,255,255,0.7);
    font-size: 13px;
}

.rating-stars {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
}

.rating-stars .star {
    background: transparent;
    border: none;
    font-size: 18px;
    cursor: pointer;
    opacity: 0.4;
    transition: transform 0.2s, opacity 0.2s;
}

.rating-stars .star.active {
    opacity: 1;
    transform: scale(1.05);
}

.rating-stars .star:hover {
    opacity: 0.9;
}

.review-saved-hint {
    font-size: 13px;
    color: #a5d6a7;
    margin-top: 8px;
    padding: 6px 0;
}

/* 冥想模块 */
.sleep-meditation-preview {
    background: rgba(255,255,255,0.06);
    border-radius: 16px;
    padding: 16px;
    margin-top: 8px;
}

.meditation-intro p {
    margin: 0 0 8px;
    color: rgba(255,255,255,0.75);
    font-size: 13px;
}

.meditation-intro blockquote {
    margin: 0;
    padding-left: 12px;
    border-left: 3px solid rgba(255,255,255,0.25);
    color: rgba(255,255,255,0.9);
    font-style: italic;
    line-height: 1.6;
}

.meditation-steps {
    margin-top: 12px;
    display: grid;
    gap: 8px;
}

.meditation-steps .step {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: rgba(255,255,255,0.75);
}

.meditation-text-only {
    margin-top: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.85);
    font-size: 12px;
    line-height: 1.6;
}

.meditation-actions {
    display: grid;
    gap: 8px;
    margin-top: 12px;
}

.meditation-tip {
    font-size: 12px;
    color: rgba(255,255,255,0.4);
    margin-top: 10px;
    text-align: center;
}

/* 对话冲突弹窗 */
.conversation-conflict-modal {
    position: fixed;
    inset: 0;
    z-index: 20000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.conversation-conflict-modal.show {
    opacity: 1;
}

.conversation-conflict-modal .modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    z-index: 1;
}

.conversation-conflict-modal .modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 24px;
    padding: 30px;
    max-width: 520px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideUp 0.3s ease-out;
    z-index: 2;
    pointer-events: auto;
}

.conversation-conflict-modal .modal-icon {
    font-size: 42px;
    text-align: center;
    margin-bottom: 12px;
}

.conversation-conflict-modal h3 {
    text-align: center;
    font-size: 20px;
    color: #2c3e50;
    margin-bottom: 16px;
}

.current-conversation-preview {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 16px;
    margin: 16px 0;
    border-left: 4px solid #667eea;
}

.preview-time {
    font-size: 12px;
    color: #999;
    margin-bottom: 6px;
}

.preview-text {
    font-size: 15px;
    color: #333;
    line-height: 1.5;
    margin-bottom: 6px;
    font-style: italic;
}

.preview-count {
    font-size: 12px;
    color: #667eea;
    font-weight: 600;
}

.modal-hint {
    text-align: center;
    color: #666;
    font-size: 14px;
    margin-bottom: 18px;
}

.modal-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.modal-actions button {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-continue {
    background: #667eea;
    color: white;
    font-weight: 700;
}

.btn-continue:hover {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-new {
    background: white;
    color: #667eea;
    border: 2px solid #667eea;
    font-weight: 700;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.btn-new:hover {
    background: #f8f9ff;
}

.btn-subtext {
    font-size: 11px;
    font-weight: 400;
    color: #999;
}

.btn-cancel {
    background: transparent;
    color: #999;
    border: none;
    padding: 6px;
    font-size: 13px;
}

.btn-cancel:hover {
    color: #666;
}

@keyframes modalSlideUp {
    from {
        opacity: 0;
        transform: translate(-50%, -40%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

.btn-meditation {
    display: block;
    width: 100%;
    padding: 14px;
    font-size: 16px;
    border-radius: 14px;
    background: linear-gradient(135deg, #5c6bc0 0%, #7e57c2 100%);
    color: white;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-meditation:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(92, 107, 192, 0.4);
}

.btn-meditation:disabled {
    opacity: 0.6;
    cursor: default;
    transform: none;
}

.meditation-guide {
    margin-top: 16px;
    padding: 24px;
    background: rgba(255,255,255,0.05);
    border-radius: 16px;
    text-align: center;
    animation: fadeIn 1s ease;
}

.meditation-instruction {
    font-size: 15px;
    color: rgba(255,255,255,0.6);
    margin-bottom: 12px;
    line-height: 1.6;
}

.meditation-affirmation {
    font-size: 20px;
    color: #b39ddb;
    font-style: italic;
    margin: 20px 0;
    line-height: 1.5;
}

.meditation-timer {
    font-size: 36px;
    font-weight: 200;
    color: rgba(255,255,255,0.8);
    margin-top: 16px;
    letter-spacing: 4px;
}

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

/* 明日种子 */
.tomorrow-card {
    background: rgba(255,255,255,0.06);
    border-radius: 14px;
    padding: 16px;
    margin-top: 8px;
    margin-bottom: 16px;
}

.tomorrow-card blockquote {
    margin: 10px 0;
    font-style: italic;
    color: rgba(255,255,255,0.8);
}

.tomorrow-perspective {
    font-size: 15px;
    border-left: 3px solid rgba(255,255,255,0.2);
    padding-left: 12px;
}

.tomorrow-practice {
    font-size: 14px;
    color: rgba(255,255,255,0.6);
    line-height: 1.6;
    margin-top: 8px;
}

.tomorrow-seed {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid rgba(255,255,255,0.08);
}

.seed-prompt {
    font-size: 14px;
    color: rgba(255,255,255,0.6);
    margin-bottom: 8px;
}

.seed-input-row {
    display: flex;
    gap: 10px;
    align-items: center;
}

.seed-input-row .night-input {
    flex: 1;
}

.btn-seed {
    white-space: nowrap;
    padding: 10px 16px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.2);
    background: rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.8);
    cursor: pointer;
    transition: all 0.2s;
}

.btn-seed:hover {
    background: rgba(255,255,255,0.15);
    color: white;
}

.seed-saved-hint {
    font-size: 13px;
    color: #a5d6a7;
    margin-top: 8px;
}

/* 连续天数温暖文案 */
.streak-warm {
    font-size: 12px;
    color: rgba(255,255,255,0.5);
    margin-left: 8px;
    display: none;
}

.night-mode .streak-warm {
    display: inline;
}

/* 夜间按钮样式 */
.btn-record-dream {
    flex: 1;
    padding: 10px 16px;
    border-radius: 12px;
    background: linear-gradient(135deg, #5c6bc0 0%, #7e57c2 100%);
    color: white;
    border: none;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.btn-record-dream:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(92, 107, 192, 0.4);
}

.btn-no-dream {
    padding: 10px 16px;
    border-radius: 12px;
    background: transparent;
    border: 1px solid rgba(255,255,255,0.2);
    color: rgba(255,255,255,0.6);
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.btn-no-dream:hover {
    border-color: rgba(255,255,255,0.4);
    color: rgba(255,255,255,0.8);
}

.review-points {
    margin: 12px 0;
    display: grid;
    gap: 6px;
    color: rgba(255,255,255,0.85);
}

.review-item {
    font-size: 13px;
}

.theme-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9ff 100%);
    border-radius: 24px;
    padding: 50px 40px;
    box-shadow:
        0 10px 40px rgba(102, 126, 234, 0.1),
        0 0 0 1px rgba(102, 126, 234, 0.05);
    margin-bottom: 40px;
    text-align: center;
}

.theme-icon {
    font-size: 56px;
    margin-bottom: 12px;
    animation: float 3s ease-in-out infinite;
    transition: transform 0.3s;
}

.theme-icon:hover,
.night-card-icon:hover,
.card-icon:hover,
.drawn-card-icon:hover {
    transform: scale(1.1);
}

.theme-title {
    font-size: 26px;
    color: #1f2240;
    margin-bottom: 12px;
    font-weight: 700;
}

.recommend-row {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
    margin-bottom: 12px;
}

.recommend-badge {
    background: linear-gradient(135deg, #ffe29a 0%, #ffb672 100%);
    color: #7a3f00;
    font-size: 12px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 999px;
    letter-spacing: 1px;
    box-shadow: 0 6px 14px rgba(255, 184, 114, 0.35);
}

.recommend-reason {
    font-size: 12px;
    color: #6b6f88;
}

.theme-quote {
    font-size: 17px;
    color: #6d7cff;
    font-style: italic;
    border-left: 4px solid #6d7cff;
    padding-left: 16px;
    margin: 18px 0;
    text-align: left;
}

.theme-description {
    text-align: left;
    color: #56607a;
    line-height: 1.8;
    margin: 18px 0;
}

.theme-description p {
    margin: 8px 0;
}

.keywords {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 18px 0;
}

.keyword-tag {
    background: #eef1ff;
    color: #5b6bff;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
}

.daily-practice {
    background: #fff6e9;
    border-left: 4px solid #f39c12;
    padding: 16px;
    margin: 18px 0;
    border-radius: 12px;
    text-align: left;
}

.daily-practice h3 {
    margin: 0 0 6px;
    color: #f39c12;
    font-size: 14px;
    letter-spacing: 1px;
}

.affirmation {
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
    padding: 18px;
    border-radius: 14px;
    margin: 18px 0 0;
    position: relative;
    box-shadow:
        inset 0 0 20px rgba(255, 255, 255, 0.5),
        0 4px 15px rgba(168, 237, 234, 0.3);
}

.affirmation h3 {
    margin-top: 0;
    color: #1f2240;
    font-size: 14px;
}

.affirmation p {
    font-size: 17px;
    font-weight: 600;
    color: #1f2240;
    margin: 10px 0 14px;
}

.affirmation-text {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 10px 0 0;
}

.affirmation-copy-icon {
    font-size: 16px;
    cursor: pointer;
    opacity: 0.7;
    transition: transform 0.2s, opacity 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
}

.affirmation-copy-icon:hover {
    opacity: 1;
    transform: scale(1.1);
}

.affirmation-copy-icon svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.6;
}

.daily-card-section,
.dream-journal-section,
.start-conversation {
    background: white;
    border-radius: 16px;
    padding: 26px;
    margin-bottom: 40px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
}

.start-conversation {
    margin-top: 40px;
}

.daily-card-section h3,
.dream-journal-section h3,
.start-conversation h3 {
    margin-top: 0;
    font-size: 18px;
    color: #1f2240;
}

/* 欢迎仪式 */
.morning-greeting {
    position: fixed;
    inset: 0;
    background:
        radial-gradient(120% 120% at 50% 0%, rgba(255, 226, 155, 0.6) 0%, rgba(255, 255, 255, 0.1) 45%, rgba(102, 126, 234, 0.8) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20000;
    color: white;
    text-align: center;
    backdrop-filter: blur(6px);
    transition: opacity 0.6s ease;
}

.morning-greeting.fade-out {
    opacity: 0;
    pointer-events: none;
}

.greeting-content {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
}

.sunrise-icon {
    font-size: 56px;
    animation: float 3s ease-in-out infinite;
}

.greeting-text {
    font-size: 28px;
    letter-spacing: 6px;
    margin: 0;
}

.greeting-subtext {
    font-size: 14px;
    opacity: 0.85;
    margin: 0;
}

.loading-dots span {
    display: inline-block;
    font-size: 10px;
    margin: 0 2px;
    opacity: 0.6;
    animation: dotsPulse 1.4s ease-in-out infinite;
}

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

@keyframes dotsPulse {
    0%, 100% { opacity: 0.3; transform: translateY(0); }
    50% { opacity: 1; transform: translateY(-4px); }
}

/* 今日进度条 */
.daily-progress-bar {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    padding: 16px 20px;
    margin: 14px 0 18px;
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.12);
    display: block;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: #666;
    margin-bottom: 8px;
}

.progress-track {
    height: 8px;
    background: #eef0f7;
    border-radius: 999px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #6d7cff 0%, #4fd1c5 100%);
    transition: width 0.4s ease;
}

.progress-tasks {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
    font-size: 12px;
}

.task {
    padding: 4px 8px;
    border-radius: 999px;
    background: #f0f0f5;
    color: #777;
    transition: all 0.3s ease;
}

.task.incomplete {
    cursor: pointer;
}

.task.incomplete:hover {
    background: #667eea;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.task.completed {
    background: #e8f7ef;
    color: #2d8a4b;
    font-weight: 600;
    cursor: default;
}

/* 抽卡动画全屏覆盖层 */
.card-animation-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease-in;
    transition: opacity 0.5s ease-out;
}

.card-animation-overlay .card-instruction {
    font-size: 16px;
    color: white;
    margin-top: 20px;
    text-align: center;
    position: relative;
    z-index: 10;
    background: rgba(255, 255, 255, 0.1);
    padding: 15px 30px;
    border-radius: 12px;
    backdrop-filter: blur(10px);
}

/* 今日洞见卡：仪式感 */
.daily-card-waiting {
    text-align: center;
}

.mystical-animation {
    height: 120px;
    margin: 10px 0 6px;
    position: relative;
}

.cards-circle {
    width: 120px;
    height: 120px;
    margin: 0 auto;
    position: relative;
    animation: spin 12s linear infinite;
}

.cards-circle span {
    position: absolute;
    top: 50%;
    left: 50%;
    font-size: 16px;
    transform: translate(-50%, -50%) rotate(calc(var(--i) * 30deg)) translate(50px) rotate(calc(var(--i) * -30deg));
    opacity: 0.8;
}

.cards-circle span:nth-child(1) { --i: 0; }
.cards-circle span:nth-child(2) { --i: 1; }
.cards-circle span:nth-child(3) { --i: 2; }
.cards-circle span:nth-child(4) { --i: 3; }
.cards-circle span:nth-child(5) { --i: 4; }
.cards-circle span:nth-child(6) { --i: 5; }
.cards-circle span:nth-child(7) { --i: 6; }
.cards-circle span:nth-child(8) { --i: 7; }
.cards-circle span:nth-child(9) { --i: 8; }
.cards-circle span:nth-child(10) { --i: 9; }
.cards-circle span:nth-child(11) { --i: 10; }
.cards-circle span:nth-child(12) { --i: 11; }

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

.card-instruction {
    font-size: 13px;
    color: #666;
    line-height: 1.6;
    position: relative;
    z-index: 10;
    background: rgba(255, 255, 255, 0.9);
    padding: 10px;
    border-radius: 8px;
}

.mystical-btn {
    margin-top: 10px;
}

.daily-card-drawn {
    margin-top: 12px;
    background: linear-gradient(160deg, #1a1a3e 0%, #2d1b69 100%);
    color: white;
    border-radius: 16px;
    padding: 18px;
    text-align: center;
}

.daily-card-drawn .card-icon {
    font-size: 40px;
    margin-bottom: 6px;
}

.daily-card-drawn p {
    margin: 6px 0;
}

.card-reflection {
    margin-top: 10px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 12px;
    text-align: left;
}

.daily-card-textarea {
    width: 100%;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.1);
    color: white;
    padding: 8px 10px;
    font-size: 13px;
    resize: vertical;
    box-sizing: border-box;
}

.next-draw-hint {
    margin-top: 10px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
}

/* 引导式对话入口 */
.conversation-guide {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.guide-question {
    font-size: 15px;
    color: #1f2240;
    font-weight: 600;
}

.guide-options {
    display: grid;
    gap: 12px;
}

.guide-option {
    border: 1px solid #e8e8f0;
    background: #fafafe;
    border-radius: 14px;
    padding: 14px 16px;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s;
}

.guide-option:hover {
    border-color: #667eea;
    background: #f6f7ff;
    transform: translateY(-2px);
}

.guide-title {
    display: block;
    font-size: 14px;
    color: #1f2240;
    font-weight: 600;
}

.guide-sub {
    display: block;
    font-size: 12px;
    color: #6b6f88;
    margin-top: 4px;
}

.btn-draw-card {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    border: none;
    padding: 12px 28px;
    border-radius: 999px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 6px 18px rgba(245, 87, 108, 0.35);
}

.btn-draw-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(245, 87, 108, 0.45);
}

.btn-draw-card:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.drawn-card-result {
    margin-top: 16px;
}

.drawn-card-result-inner {
    background: linear-gradient(160deg, #1a1a3e 0%, #2d1b69 100%);
    color: white;
    border-radius: 16px;
    padding: 20px;
    text-align: center;
}

.drawn-card-icon {
    font-size: 36px;
    margin-bottom: 8px;
}

.drawn-card-practice {
    margin-top: 10px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.8);
}

.btn-explore {
    margin-top: 12px;
    padding: 8px 16px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    background: transparent;
    color: white;
    cursor: pointer;
}

.dream-buttons {
    display: flex;
    gap: 12px;
    margin-top: 12px;
}

.dream-hint {
    color: #6b6f88;
    font-size: 13px;
    line-height: 1.6;
    margin-top: 8px;
}

.btn-record-dream,
.btn-no-dream {
    flex: 1;
    padding: 12px;
    border-radius: 12px;
    border: 2px solid #e3e3e3;
    background: white;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.btn-record-dream {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
}

.btn-record-dream:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.35);
}

.btn-no-dream:hover {
    border-color: #999;
}

.conversation-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 16px;
}

.option-btn {
    padding: 16px;
    border: 2px solid #ebebeb;
    border-radius: 12px;
    background: white;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
    text-align: left;
}

.option-btn:hover {
    border-color: #667eea;
    background: #f6f7ff;
    transform: translateY(-2px);
}

.ritual-footer {
    text-align: center;
    margin: 20px 0 10px;
}

.ritual-footer a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 14px;
}

.checkin-toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(30, 30, 50, 0.9);
    color: white;
    padding: 10px 18px;
    border-radius: 10px;
    font-size: 14px;
    z-index: 9999;
}

.achievement-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.achievement-content {
    background: white;
    border-radius: 16px;
    padding: 24px;
    width: 90%;
    max-width: 360px;
    text-align: center;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
}

.achievement-content h2 {
    margin: 0 0 8px;
    font-size: 18px;
}

.achievement-content button {
    margin-top: 12px;
    padding: 8px 16px;
    border-radius: 10px;
    border: none;
    background: #667eea;
    color: white;
    cursor: pointer;
}

@media (max-width: 768px) {
    .header-row {
        grid-template-columns: auto 1fr auto;
    }

    .header-title {
        font-size: 16px;
    }

    .theme-card {
        padding: 28px 20px;
    }

    .theme-title {
        font-size: 22px;
    }

    .conversation-options {
        grid-template-columns: 1fr;
    }

    .dream-buttons {
        flex-direction: column;
    }
}

/* ========== 洞见收藏夹页 ========== */

.insights-page {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    display: block;
}

.insights-container {
    max-width: 800px;
    margin: 0 auto;
}

.insights-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
    color: white;
}

.insights-header h1 {
    font-size: 28px;
    margin-bottom: 4px;
}

.insights-count {
    font-size: 14px;
    color: rgba(255,255,255,0.7);
}

.insights-nav {
    display: flex;
    gap: 10px;
}

.insights-filters {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
}

.tag-filter-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.tag-filter-label {
    color: rgba(255,255,255,0.6);
    font-size: 13px;
}

.tag-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.tag-btn {
    padding: 6px 14px;
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.25);
    border-radius: 999px;
    color: white;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.tag-btn.active,
.tag-btn:hover {
    background: white;
    color: #667eea;
    border-color: white;
}

.insights-list {
    display: grid;
    gap: 16px;
}

.insight-item {
    background: white;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: transform 0.2s;
}

.insight-item:hover {
    transform: translateY(-2px);
}

.insight-quote {
    font-size: 16px;
    line-height: 1.7;
    color: #333;
    font-style: italic;
    margin-bottom: 10px;
}

.insight-note {
    font-size: 14px;
    color: #666;
    padding: 10px 14px;
    background: #f8f8fc;
    border-radius: 10px;
    margin-bottom: 10px;
    border-left: 3px solid #667eea;
}

.insight-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.insight-tags {
    display: flex;
    gap: 6px;
}

.insight-tag {
    padding: 3px 10px;
    background: #f0f0f5;
    border-radius: 999px;
    font-size: 12px;
    color: #667eea;
}

.insight-date {
    font-size: 12px;
    color: #999;
}

.insight-actions {
    display: flex;
    gap: 8px;
}

.insight-actions-hover {
    opacity: 0;
    transform: translateY(6px);
    transition: all 0.2s ease;
}

.insight-item:hover .insight-actions-hover {
    opacity: 1;
    transform: translateY(0);
}

@media (hover: none) {
    .insight-actions-hover {
        opacity: 1;
        transform: none;
    }
}

.insight-action-btn {
    padding: 6px 14px;
    background: transparent;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.insight-action-btn:hover {
    background: #f0f0f5;
}

.insight-action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    border-color: #e0e0e0;
    color: #999;
    background: transparent;
}

.insight-action-btn.delete:hover {
    background: #fff0f0;
    border-color: #e74c3c;
    color: #e74c3c;
}


/* ========== 响应式补充 ========== */
@media (max-width: 600px) {
    .checkin-container {
        margin: 0 auto;
    }

    .ritual-theme-name {
        font-size: 26px;
    }

    .topic-options {
        grid-template-columns: 1fr;
    }

    .insights-header {
        flex-direction: column;
        gap: 12px;
    }

    .insights-nav {
        width: 100%;
    }

    .log-actions {
        flex-wrap: wrap;
        justify-content: center;
    }

    .header-actions {
        gap: 6px;
    }

    .nav-link-btn {
        padding: 6px 10px;
        font-size: 12px;
    }

    .history-header {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }

    .history-actions {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }

    .history-item-title {
        max-width: 200px;
    }
}

/* ========== 对话历史页面 ========== */
.history-page {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    display: block;
}

.history-container {
    max-width: 900px;
    margin: 0 auto;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    color: white;
}

.history-header h1 {
    font-size: 26px;
}

.history-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.history-loading,
.history-empty {
    text-align: center;
    color: rgba(255, 255, 255, 0.8);
    font-size: 15px;
    padding: 40px 0;
}

.history-empty a {
    color: white;
    text-decoration: underline;
}

.history-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.history-group-label {
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding-left: 4px;
}

.history-item {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    border-radius: 14px;
    padding: 14px 18px;
    transition: all 0.2s;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.history-item-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    cursor: pointer;
}

.history-item-main {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    min-width: 0;
}

/* 标题行：标题 + 状态 + 卡片 badge 内联 */
.history-item-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.history-item-title {
    font-size: 15px;
    font-weight: 600;
    color: #333;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 400px;
}

.history-item-preview {
    font-size: 13px;
    color: #888;
    font-style: italic;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
    margin-top: 1px;
}

.history-item-meta {
    display: flex;
    gap: 4px;
    align-items: center;
    font-size: 12px;
    color: #aaa;
    margin-top: 2px;
}

.history-item-sep {
    color: #ccc;
}

.status-badge {
    padding: 1px 7px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
}

.status-ongoing {
    background: #fff3cd;
    color: #856404;
}

.status-completed {
    background: #d4edda;
    color: #155724;
}

.card-link-badge {
    display: inline-flex;
    align-items: center;
    padding: 1px 8px;
    border-radius: 10px;
    font-size: 11px;
    background: #e8eaf6;
    color: #5c6bc0;
    text-decoration: none;
    transition: background 0.2s;
    white-space: nowrap;
}

.card-link-badge:hover {
    background: #c5cae9;
}

/* 右侧图标组 */
.history-item-icons {
    display: flex;
    gap: 4px;
    align-items: center;
    flex-shrink: 0;
    padding-top: 2px;
}

.hi-icon-btn {
    background: none;
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #bbb;
}

.hi-icon-btn:hover {
    background: rgba(0, 0, 0, 0.06);
}

.hi-continue {
    color: #667eea;
    width: 22px;
    height: 22px;
}

.hi-continue:hover {
    color: white;
    background: #667eea;
}

.hi-delete {
    opacity: 0;
    transition: opacity 0.2s, color 0.2s, background 0.2s;
}

.history-item:hover .hi-delete {
    opacity: 1;
}

.hi-delete:hover {
    color: #e74c3c;
    background: rgba(231, 76, 60, 0.1);
}

.hi-toggle {
    color: #667eea;
    border: 1px solid #e0e0e0;
}

.hi-toggle:hover {
    color: white;
    background: #667eea;
    border-color: #667eea;
    transform: scale(1.1);
}

.hi-toggle svg {
    transition: transform 0.25s ease;
}

/* 展开的详情区域 */
.history-item-detail {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #eee;
    max-height: 400px;
    overflow-y: auto;
}

.history-item-detail .conv-message {
    margin: 4px 0;
    padding: 8px 12px;
    overflow: hidden;
    font-size: 13px;
    border-radius: 8px;
}

.history-item-detail .conv-message.user {
    background: rgba(118, 75, 162, 0.06);
}

.history-item-detail .conv-message.model,
.history-item-detail .conv-message.assistant {
    background: rgba(102, 126, 234, 0.06);
}

.conv-role {
    font-weight: 600;
    margin-right: 8px;
    font-size: 12px;
    color: #667eea;
}

.conv-message.user .conv-role {
    color: #764ba2;
}

.detail-loading {
    text-align: center;
    color: #999;
    padding: 16px;
    font-size: 13px;
}

/* 对话详情中的收藏按钮（history + card sibling） */
.btn-collect-insight {
    float: right;
    background: none;
    border: none;
    font-size: 13px;
    cursor: pointer;
    opacity: 0;
    padding: 2px 4px;
    border-radius: 6px;
    transition: all 0.2s;
    margin-top: -2px;
}

.conv-message:hover .btn-collect-insight {
    opacity: 0.6;
}

.btn-collect-insight:hover {
    opacity: 1 !important;
    background: rgba(102, 126, 234, 0.1);
    transform: scale(1.15);
}

@media (hover: none) {
    .btn-collect-insight {
        opacity: 0.5;
    }
}

/* ===== 密码强度计 ===== */
.pw-strength-container {
    margin-top: 8px;
}

.pw-strength-bar {
    height: 6px;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 6px;
}

.pw-strength-fill {
    height: 100%;
    border-radius: 999px;
    transition: width 0.3s ease, background 0.3s ease;
    width: 0%;
}
.pw-strength-fill[data-score="1"] { width: 25%;  background: #e74c3c; }
.pw-strength-fill[data-score="2"] { width: 50%;  background: #e67e22; }
.pw-strength-fill[data-score="3"] { width: 75%;  background: #f1c40f; }
.pw-strength-fill[data-score="4"] { width: 100%; background: #27ae60; }

.pw-strength-label {
    font-size: 12px;
    margin-bottom: 6px;
    font-weight: 600;
    letter-spacing: 0.02em;
}
.pw-strength-label.weak   { color: #e74c3c; }
.pw-strength-label.medium { color: #e67e22; }
.pw-strength-label.strong { color: #27ae60; }

.pw-checklist {
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 12px;
}
.pw-checklist li {
    margin-bottom: 3px;
    color: rgba(255, 255, 255, 0.35);
    transition: color 0.2s;
}
.pw-checklist li::before { content: '✗ '; }
.pw-checklist li.pass    { color: #27ae60; }
.pw-checklist li.pass::before { content: '✓ '; }

/* ===== SH-01/SH-02/SH-03 密码要求说明 & 不一致提示 ===== */
.pw-requirements-hint {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.45);
  margin-top: 4px;
  line-height: 1.5;
}

.pw-mismatch-hint {
  font-size: 12px;
  color: #e74c3c;
  margin-top: 4px;
}

.pw-mismatch-hint.hidden {
  display: none;
}

/* ===== SH-06/SH-08 Turnstile widget 容器 ===== */
.turnstile-box {
  display: none;
  margin: 12px 0 4px;
}

.turnstile-box.active {
  display: block;
}
