/* ==================== CSS变量与主题配置 ==================== */
        :root {
            /* 治愈系配色 */
            --color-cream: #FAF9F6;
            --color-yellow: #F5F5DC;
            --color-blue: #B0C4DE;
            --color-gray: #F0F0F0;
            --color-text: #4A4A4A;
            --color-text-light: #7A7A7A;
            --color-accent: #D4A5A5;
            --color-gold: #D4AF37;
            
            /* 主题色彩（可通过JS切换） */
            --bg-primary: var(--color-cream);
            --bg-secondary: var(--color-yellow);
            --bg-card: rgba(255, 255, 255, 0.9);
            --shadow: rgba(0, 0, 0, 0.08);
            --particle-color: #FFD700;
            
            /* 字体 */
            --font-serif: 'Noto Serif SC', serif;
            --font-art: 'ZCOOL XiaoWei', serif;
            
            /* 尺寸 */
            --border-radius: 20px;
            --transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        }

/* 星空主题 - 优化版 */
[data-theme="starry"] {
    --bg-primary: #1a1a2e;
    --bg-secondary: #16213e;
    --bg-card: rgba(255, 255, 255, 0.08);  /* 略微提高透明度 */
    --color-text: #f5f5f5;                /* 主文字调亮 */
    --color-text-light: #c5c5c5;          /* 关键：辅助文字从#a0a0a0改为#c5c5c5 */
    --shadow: rgba(0, 0, 0, 0.4);
    --particle-color: #ffffff;
    --color-accent: #e6c9a8;              /* 强调色改为暖金色，在深色背景更醒目 */
}

        /* 禅意主题 */
        [data-theme="zen"] {
            --bg-primary: #E8E8E8;
            --bg-secondary: #D4D4D4;
            --bg-card: rgba(255, 255, 255, 0.95);
            --color-text: #2C3E50;
            --color-accent: #8B9DC3;
            --particle-color: #95A5A6;
        }

        /* ==================== 基础重置与布局 ==================== */
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: var(--font-serif);
            background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
            color: var(--color-text);
            min-height: 100vh;
            overflow-x: hidden;
            transition: var(--transition);
            position: relative;
        }

        /* 背景纹理 */
        body::before {
            content: '';
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-image: 
                radial-gradient(circle at 20% 50%, rgba(176, 196, 222, 0.1) 0%, transparent 50%),
                radial-gradient(circle at 80% 80%, rgba(212, 165, 165, 0.1) 0%, transparent 50%);
            pointer-events: none;
            z-index: -1;
        }

        .container {
            max-width: 800px;
            margin: 0 auto;
            padding: 20px;
            min-height: 100vh;
            display: flex;
            flex-direction: column;
            position: relative;
            z-index: 1;
        }

        /* ==================== 头部区域 ==================== */
        header {
            text-align: center;
            padding: 30px 0;
            position: relative;
        }

        .title-wrapper {
            display: inline-block;
            position: relative;
            cursor: pointer;
            user-select: none;
        }

        h1 {
            font-family: var(--font-art);
            font-size: 2.8rem;
            font-weight: 400;
            color: var(--color-text);
            letter-spacing: 0.2em;
            margin-bottom: 10px;
            position: relative;
            display: inline-block;
        }

        /* 标题装饰 */
        h1::after {
            content: '✦';
            position: absolute;
            right: -30px;
            top: 0;
            color: var(--color-accent);
            font-size: 1.5rem;
            animation: twinkle 3s infinite;
        }

        @keyframes twinkle {
            0%, 100% { opacity: 0.3; transform: scale(0.8); }
            50% { opacity: 1; transform: scale(1.2); }
        }

        .subtitle {
            font-size: 1rem;
            color: var(--color-text-light);
            font-weight: 300;
            letter-spacing: 0.15em;
            font-style: italic;
        }

        /* 幸运日签 */
        .daily-quote {
            margin-top: 20px;
            padding: 15px 25px;
            background: rgba(255, 255, 255, 0.6);
            border-radius: 30px;
            display: inline-flex;
            align-items: center;
            gap: 10px;
            font-size: 0.9rem;
            color: var(--color-text-light);
            backdrop-filter: blur(10px);
            border: 1px solid rgba(255, 255, 255, 0.3);
            box-shadow: 0 4px 15px var(--shadow);
            transition: var(--transition);
        }

        .daily-quote:hover {
            transform: translateY(-2px);
            box-shadow: 0 6px 20px var(--shadow);
        }

        .daily-quote i {
            color: var(--color-accent);
        }

        /* ==================== 主体内容区 ==================== */
        main {
            flex: 1;
            display: flex;
            flex-direction: column;
            gap: 30px;
            padding: 20px 0;
        }

        /* 输入区域 */
        .input-section {
            position: relative;
            width: 100%;
        }

        .question-input {
            width: 100%;
            padding: 20px 25px;
            font-size: 1.1rem;
            font-family: var(--font-serif);
            border: 2px solid transparent;
            border-radius: var(--border-radius);
            background: var(--bg-card);
            box-shadow: 0 4px 20px var(--shadow);
            transition: var(--transition);
            outline: none;
            color: var(--color-text);
        }

        .question-input:focus {
            border-color: var(--color-blue);
            box-shadow: 0 6px 30px rgba(176, 196, 222, 0.3);
        }

        .question-input::placeholder {
            color: var(--color-text-light);
            opacity: 0.6;
        }

        /* 答案展示卡 - 古籍书页设计 */
        .answer-card {
            position: relative;
            min-height: 300px;
            padding: 40px;
            background: 
                linear-gradient(to right, rgba(0,0,0,0.02) 0%, transparent 5%, transparent 95%, rgba(0,0,0,0.02) 100%),
                var(--bg-card);
            border-radius: 5px;
            box-shadow: 
                0 10px 40px var(--shadow),
                inset 0 0 60px rgba(0,0,0,0.02);
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            text-align: center;
            transform-style: preserve-3d;
            transition: transform 0.6s;
            overflow: hidden;
        }

        /* 古籍磨损边缘效果 */
        .answer-card::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' /%3E%3C/filter%3E%3Crect width='100' height='100' filter='url(%23noise)' opacity='0.08'/%3E%3C/svg%3E");
            opacity: 0.3;
            pointer-events: none;
        }

        /* 书页折痕 */
        .answer-card::after {
            content: '';
            position: absolute;
            top: 0;
            left: 50%;
            width: 1px;
            height: 100%;
            background: linear-gradient(to bottom, transparent 10%, rgba(0,0,0,0.05) 50%, transparent 90%);
            transform: translateX(-50%);
        }

        .answer-content {
            position: relative;
            z-index: 2;
            font-size: 1.5rem;
            line-height: 2;
            color: var(--color-text);
            font-weight: 400;
            min-height: 3em;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        /* 打字机光标 */
        .typing-cursor {
            display: inline-block;
            width: 2px;
            height: 1.2em;
            background: var(--color-accent);
            margin-left: 2px;
            animation: blink 1s infinite;
            vertical-align: middle;
        }

        @keyframes blink {
            0%, 50% { opacity: 1; }
            51%, 100% { opacity: 0; }
        }

        .answer-meta {
            margin-top: 30px;
            font-size: 0.85rem;
            color: var(--color-text-light);
            opacity: 0;
            transform: translateY(10px);
            transition: all 0.5s ease 0.5s;
        }

        .answer-meta.show {
            opacity: 1;
            transform: translateY(0);
        }

        .category-tag {
            display: inline-block;
            padding: 5px 15px;
            background: rgba(176, 196, 222, 0.2);
            border-radius: 20px;
            margin-top: 10px;
            font-size: 0.8rem;
            color: var(--color-blue);
            border: 1px solid rgba(176, 196, 222, 0.3);
        }

        /* ==================== 分类标签栏 ==================== */
        .category-filter {
            display: flex;
            gap: 10px;
            overflow-x: auto;
            padding: 10px 0;
            scrollbar-width: none;
            -ms-overflow-style: none;
        }

        .category-filter::-webkit-scrollbar {
            display: none;
        }

        .category-chip {
            flex-shrink: 0;
            padding: 8px 20px;
            background: rgba(255, 255, 255, 0.6);
            border: 1px solid rgba(0, 0, 0, 0.05);
            border-radius: 25px;
            cursor: pointer;
            transition: var(--transition);
            font-size: 0.9rem;
            color: var(--color-text-light);
            white-space: nowrap;
            backdrop-filter: blur(5px);
        }

        .category-chip:hover {
            transform: translateY(-2px);
            box-shadow: 0 4px 12px var(--shadow);
        }

        .category-chip.active {
            background: var(--color-blue);
            color: white;
            border-color: transparent;
        }

        /* ==================== 控制按钮区 ==================== */
        .controls {
            display: flex;
            gap: 15px;
            flex-wrap: wrap;
            justify-content: center;
            margin-top: 10px;
        }

        .btn {
            padding: 12px 30px;
            border: none;
            border-radius: 30px;
            font-family: var(--font-serif);
            font-size: 1rem;
            cursor: pointer;
            transition: var(--transition);
            display: inline-flex;
            align-items: center;
            gap: 8px;
            position: relative;
            overflow: hidden;
            background: var(--bg-card);
            color: var(--color-text);
            box-shadow: 0 4px 15px var(--shadow);
            border: 1px solid rgba(0, 0, 0, 0.05);
        }

        .btn:hover {
            transform: translateY(-3px) scale(1.02);
            box-shadow: 0 8px 25px var(--shadow);
        }

        .btn:active {
            transform: translateY(-1px) scale(0.98);
        }

        .btn-primary {
            background: linear-gradient(135deg, var(--color-blue) 0%, #9BB5D4 100%);
            color: white;
            border: none;
        }

        .btn-primary:hover {
            background: linear-gradient(135deg, #9BB5D4 0%, var(--color-blue) 100%);
        }

        .btn-secondary {
            background: rgba(255, 255, 255, 0.8);
        }

        /* 按钮波纹效果 */
        .btn::after {
            content: '';
            position: absolute;
            top: 50%;
            left: 50%;
            width: 0;
            height: 0;
            border-radius: 50%;
            background: rgba(255, 255, 255, 0.3);
            transform: translate(-50%, -50%);
            transition: width 0.6s, height 0.6s;
        }

        .btn:active::after {
            width: 300px;
            height: 300px;
        }

        /* ==================== 历史记录面板 ==================== */
        .history-panel {
            margin-top: 20px;
            border-radius: var(--border-radius);
            overflow: hidden;
            background: var(--bg-card);
            box-shadow: 0 4px 20px var(--shadow);
            max-height: 0;
            transition: max-height 0.5s ease;
        }

        .history-panel.open {
            max-height: 400px;
        }

        .history-header {
            padding: 15px 20px;
            background: rgba(0, 0, 0, 0.02);
            display: flex;
            justify-content: space-between;
            align-items: center;
            cursor: pointer;
            border-bottom: 1px solid rgba(0, 0, 0, 0.05);
        }

        .history-title {
            font-weight: 600;
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .history-list {
            padding: 15px 20px;
            overflow-y: auto;
            max-height: 300px;
        }

        .history-item {
            padding: 12px;
            margin-bottom: 10px;
            background: rgba(0, 0, 0, 0.02);
            border-radius: 10px;
            border-left: 3px solid var(--color-blue);
            transition: var(--transition);
        }

        .history-item:hover {
            background: rgba(0, 0, 0, 0.04);
            transform: translateX(5px);
        }

        .history-q {
            font-size: 0.85rem;
            color: var(--color-text-light);
            margin-bottom: 5px;
        }

        .history-a {
            font-weight: 600;
            color: var(--color-text);
        }

        .history-time {
            font-size: 0.75rem;
            color: var(--color-text-light);
            opacity: 0.7;
            margin-top: 5px;
        }

        .clear-history {
            font-size: 0.8rem;
            color: var(--color-accent);
            cursor: pointer;
            background: none;
            border: none;
            font-family: inherit;
        }

        /* ==================== 特效与动画 ==================== */
        /* 花瓣/粒子容器 */
        .particles-container {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            pointer-events: none;
            z-index: 0;
            overflow: hidden;
        }

        .particle {
            position: absolute;
            opacity: 0.6;
            animation: fall linear infinite;
        }

        @keyframes fall {
            to {
                transform: translateY(100vh) rotate(360deg);
            }
        }

        /* 星空背景特殊效果 */
        .stars {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            pointer-events: none;
            z-index: -1;
            opacity: 0;
            transition: opacity 0.5s;
        }

        [data-theme="starry"] .stars {
            opacity: 1;
            background-image: 
                radial-gradient(2px 2px at 20px 30px, #eee, rgba(0,0,0,0)),
                radial-gradient(2px 2px at 40px 70px, rgba(255,255,255,0.8), rgba(0,0,0,0)),
                radial-gradient(2px 2px at 50px 160px, #ddd, rgba(0,0,0,0)),
                radial-gradient(2px 2px at 90px 40px, #fff, rgba(0,0,0,0)),
                radial-gradient(2px 2px at 130px 80px, #fff, rgba(0,0,0,0)),
                radial-gradient(2px 2px at 160px 120px, #ddd, rgba(0,0,0,0));
            background-repeat: repeat;
            background-size: 200px 200px;
            animation: sparkle 5s ease-in-out infinite;
        }

        @keyframes sparkle {
            0%, 100% { opacity: 0.5; }
            50% { opacity: 1; }
        }

        /* 淡入动画 */
        .fade-in {
            animation: fadeIn 0.8s ease-out forwards;
        }

        @keyframes fadeIn {
            from { opacity: 0; transform: translateY(20px); }
            to { opacity: 1; transform: translateY(0); }
        }

        /* ==================== 辅助功能 ==================== */
        .help-btn {
            position: fixed;
            bottom: 30px;
            right: 30px;
            width: 50px;
            height: 50px;
            border-radius: 50%;
            background: var(--bg-card);
            border: none;
            box-shadow: 0 4px 15px var(--shadow);
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.2rem;
            color: var(--color-text);
            transition: var(--transition);
            z-index: 100;
        }

        .help-btn:hover {
            transform: scale(1.1) rotate(15deg);
            background: var(--color-blue);
            color: white;
        }

        /* 帮助弹窗 */
        .modal-overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.5);
            backdrop-filter: blur(5px);
            display: flex;
            align-items: center;
            justify-content: center;
            z-index: 1000;
            opacity: 0;
            visibility: hidden;
            transition: all 0.3s;
        }

        .modal-overlay.active {
            opacity: 1;
            visibility: visible;
        }

        .modal-content {
            background: var(--bg-card);
            padding: 40px;
            border-radius: var(--border-radius);
            max-width: 500px;
            width: 90%;
            max-height: 80vh;
            overflow-y: auto;
            box-shadow: 0 20px 60px rgba(0,0,0,0.3);
            transform: scale(0.9);
            transition: transform 0.3s;
        }

        .modal-overlay.active .modal-content {
            transform: scale(1);
        }

        .modal-title {
            font-family: var(--font-art);
            font-size: 1.8rem;
            margin-bottom: 20px;
            text-align: center;
        }

        .modal-close {
            position: absolute;
            top: 15px;
            right: 20px;
            background: none;
            border: none;
            font-size: 1.5rem;
            cursor: pointer;
            color: var(--color-text-light);
        }

        .feature-list {
            list-style: none;
            margin: 20px 0;
        }

        .feature-list li {
            padding: 10px 0;
            padding-left: 30px;
            position: relative;
            border-bottom: 1px solid rgba(0,0,0,0.05);
        }

        .feature-list li::before {
            content: '✦';
            position: absolute;
            left: 0;
            color: var(--color-accent);
        }

        /* 页脚 */
        footer {
            text-align: center;
            padding: 30px 0;
            font-size: 0.85rem;
            color: var(--color-text-light);
            opacity: 0.8;
        }

        footer a {
            color: var(--color-blue);
            text-decoration: none;
            border-bottom: 1px dotted;
        }

        /* 摇一摇提示 */
        .shake-hint {
            position: fixed;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%) scale(0);
            background: rgba(0, 0, 0, 0.8);
            color: white;
            padding: 20px 40px;
            border-radius: 50px;
            font-size: 1.1rem;
            pointer-events: none;
            transition: transform 0.3s;
            z-index: 999;
        }

        .shake-hint.show {
            transform: translate(-50%, -50%) scale(1);
        }

        /* ==================== 响应式设计 ==================== */
        @media (max-width: 768px) {
            h1 { font-size: 2rem; }
            .answer-card { padding: 30px 20px; min-height: 250px; }
            .answer-content { font-size: 1.2rem; }
            .controls { flex-direction: column; align-items: stretch; }
            .btn { justify-content: center; }
            .help-btn { bottom: 20px; right: 20px; width: 45px; height: 45px; }
        }

        @media (max-width: 480px) {
            .container { padding: 15px; }
            h1 { font-size: 1.8rem; letter-spacing: 0.1em; }
            .daily-quote { font-size: 0.8rem; padding: 10px 15px; }
            .category-chip { padding: 6px 15px; font-size: 0.85rem; }
        }

        /* 隐藏彩蛋动画 */
        .easter-egg {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            pointer-events: none;
            z-index: 9999;
            display: none;
        }

        .easter-egg.active {
            display: block;
        }

        .floating-text {
            position: absolute;
            font-family: var(--font-art);
            font-size: 2rem;
            color: var(--color-accent);
            opacity: 0;
            animation: floatUp 3s ease-out forwards;
        }

        @keyframes floatUp {
            0% { opacity: 0; transform: translateY(100vh) scale(0.5); }
            20% { opacity: 1; transform: translateY(80vh) scale(1); }
            100% { opacity: 0; transform: translateY(-100px) scale(1.2); }
        }