/* ==================== 全局样式 ==================== */
:root {
    --primary-color: #8B0000;      /* 深红 */
    --accent-color: #C9A227;      /* 金色 */
    --success-color: #2D5016;    /* 墨绿 */
    --warning-color: #B8860B;    /* 暗金 */
    --danger-color: #5C0000;     /* 暗红 */
    --bg-color: #F5F0E8;          /* 米黄宣纸色 */
    --card-bg: #FFFEF7;           /* 象牙白 */
    --text-color: #2C2C2C;       /* 墨黑 */
    --border-color: #D4C5A9;     /* 古铜 */
    --shadow: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-hover: 0 4px 16px rgba(0,0,0,0.12);
}

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

body {
    font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Serif CJK SC", serif;
    background: var(--bg-color);
    color: var(--text-color);
    line-height: 1.8;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 宣纸纹理背景 */
body::before {
    content: '';
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background-image:
        radial-gradient(ellipse at 20% 30%, rgba(200,180,140,0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 70%, rgba(180,150,100,0.06) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}

/* ==================== 容器 ==================== */
.container {
    max-width: 720px;
    margin: 0 auto;
    padding: 20px 24px;
    width: 100%;
}

/* ==================== 页面头部 ==================== */
.header {
    background: linear-gradient(180deg, var(--primary-color) 0%, #6B0000 100%);
    color: var(--accent-color);
    padding: 48px 0 40px;
    text-align: center;
    position: relative;
    box-shadow: 0 4px 20px rgba(139,0,0,0.3);
}

.header::before,
.header::after {
    content: '☯';
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 2rem;
    opacity: 0.4;
}
.header::before { left: 24px; }
.header::after { right: 24px; }

.header h1 {
    font-size: 2.8rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    margin-bottom: 8px;
    color: #FFE4B5;
}

.header .subtitle {
    font-size: 1.1rem;
    opacity: 0.85;
    letter-spacing: 0.3em;
    font-style: italic;
}

.visit-count {
    font-size: 0.85rem;
    opacity: 0.7;
    margin-top: 10px;
    letter-spacing: 0.05em;
}

/* ==================== 主内容区 ==================== */
main {
    flex: 1;
    padding-bottom: 60px;
}

/* ==================== 事项选择 ==================== */
.matter-section {
    text-align: center;
    margin: 28px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
}

.matter-label {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--primary-color);
    letter-spacing: 0.05em;
}

.matter-select {
    padding: 12px 24px;
    font-size: 1rem;
    color: var(--text-color);
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238B0000' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 40px;
    min-width: 200px;
}

.matter-select:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(201,162,39,0.2);
}

.matter-select:hover {
    border-color: var(--accent-color);
}

/* ==================== 起卦按钮区 ==================== */
.divination-section {
    text-align: center;
    margin: 48px 0;
}

.divination-btn {
    display: inline-block;
    padding: 18px 72px;
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    color: #FFF8E7;
    background: linear-gradient(135deg, var(--primary-color), #A50000);
    border: 2px solid var(--accent-color);
    border-radius: 4px;
    cursor: pointer;
    box-shadow:
        0 4px 16px rgba(139,0,0,0.25),
        inset 0 1px 0 rgba(255,255,255,0.1);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.divination-btn::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    transition: left 0.5s ease;
}

.divination-btn:hover::before {
    left: 100%;
}

.divination-btn:hover {
    transform: translateY(-2px);
    box-shadow:
        0 6px 24px rgba(139,0,0,0.35),
        inset 0 1px 0 rgba(255,255,255,0.15);
    background: linear-gradient(135deg, #A50000, var(--primary-color));
}

.divination-btn:active {
    transform: translateY(0);
}

.divination-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* ==================== 卡片样式 ==================== */
.card {
    background: var(--card-bg);
    border-radius: 4px;
    padding: 24px 28px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    position: relative;
    transition: box-shadow 0.3s ease;
}

.card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-color), var(--primary-color), var(--accent-color));
    border-radius: 4px 4px 0 0;
}

.card:hover {
    box-shadow: var(--shadow-hover);
}

.card-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--primary-color);
    letter-spacing: 0.1em;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

/* ==================== 时间信息 ==================== */
.time-info p {
    margin: 8px 0;
    font-size: 1rem;
    color: #555;
}

.time-info strong {
    color: var(--primary-color);
    margin-right: 10px;
    font-weight: 600;
}

/* ==================== 结果摘要 ==================== */
.summary-card {
    background:
        linear-gradient(135deg, rgba(139,0,0,0.95), rgba(107,0,0,0.95)),
        linear-gradient(180deg, var(--primary-color), #6B0000);
    color: #FFF3D4;
    box-shadow: 0 10px 24px rgba(92,0,0,0.22);
}

.summary-card::before {
    background: linear-gradient(90deg, #F0D48A, #FFE7B3, #F0D48A);
}

.summary-card .card-title {
    color: #FFE7B3;
    border-bottom-color: rgba(255,231,179,0.2);
}

.result-summary {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.summary-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.summary-matter {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border: 1px solid rgba(255,231,179,0.25);
    border-radius: 999px;
    background: rgba(255,255,255,0.08);
    color: #FFE7B3;
    font-size: 0.95rem;
    letter-spacing: 0.08em;
}

.summary-main-gua {
    padding: 20px 22px;
    background: rgba(255,248,231,0.08);
    border: 1px solid rgba(255,231,179,0.18);
    border-radius: 6px;
}

.summary-main-label {
    font-size: 0.85rem;
    color: rgba(255,231,179,0.72);
    letter-spacing: 0.14em;
    margin-bottom: 8px;
}

.summary-main-name {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    color: #FFF8E7;
}

.summary-main-meaning {
    margin-top: 10px;
    font-size: 1rem;
    color: rgba(255,243,212,0.88);
}

.summary-gua-overview {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.summary-gua-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(255,248,231,0.1);
    border: 1px solid rgba(255,231,179,0.16);
}

.summary-gua-chip.main {
    background: rgba(255,231,179,0.14);
    border-color: rgba(255,231,179,0.3);
}

.summary-gua-label {
    font-size: 0.82rem;
    color: rgba(255,231,179,0.72);
    letter-spacing: 0.1em;
}

.summary-gua-value {
    font-size: 0.95rem;
    color: #FFF8E7;
}

.summary-headline {
    font-size: 1.05rem;
    line-height: 1.9;
    color: #FFF3D4;
}

.summary-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.summary-action {
    padding: 16px 18px;
    border-radius: 6px;
    border: 1px solid rgba(255,231,179,0.16);
    background: rgba(255,248,231,0.08);
}

.summary-action-positive {
    border-left: 4px solid #C9A227;
}

.summary-action-caution {
    border-left: 4px solid #E0B36B;
}

.summary-action-label {
    font-size: 0.85rem;
    color: rgba(255,231,179,0.72);
    letter-spacing: 0.14em;
    margin-bottom: 8px;
}

.summary-action p {
    color: #FFF3D4;
    line-height: 1.8;
}

/* ==================== 卦象依据 ==================== */
.gua-details-card[open] .gua-details-hint {
    color: var(--primary-color);
}

.gua-details-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    cursor: pointer;
    list-style: none;
    color: var(--primary-color);
    font-weight: 700;
    letter-spacing: 0.08em;
}

.gua-details-toggle::-webkit-details-marker {
    display: none;
}

.gua-details-hint {
    font-size: 0.85rem;
    font-weight: 500;
    color: #8B7355;
    letter-spacing: 0;
}

.gua-result {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 16px;
}

.liushen-item {
    padding: 18px 20px;
    background: #FDFBF5;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--accent-color);
    transition: all 0.3s ease;
}

.liushen-item:hover {
    background: #FAF6ED;
    transform: translateX(6px);
    box-shadow: var(--shadow);
}

.liushen-item.main {
    border-left-color: var(--primary-color);
    background: #FDF8F0;
    border-left-width: 5px;
}

.liushen-item.main:hover {
    background: #FBF3E8;
}

.liushen-label {
    font-size: 0.85rem;
    color: #888;
    letter-spacing: 0.1em;
    margin-bottom: 4px;
}

.liushen-name {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 10px;
    letter-spacing: 0.15em;
}

.liushen-item.main .liushen-name {
    color: var(--danger-color);
}

.liushen-details {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed var(--border-color);
}

.liushen-details p {
    margin: 5px 0;
    font-size: 0.95rem;
    color: #555;
}

.liushen-details strong {
    color: #666;
    font-weight: 600;
}

/* ==================== 吉凶标签 ==================== */
.jixiong-badge {
    display: inline-block;
    padding: 10px 36px;
    border-radius: 2px;
    font-weight: 700;
    font-size: 1.4rem;
    letter-spacing: 0.3em;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.jixiong-badge.吉,
.jixiong-badge.大吉 {
    background: linear-gradient(135deg, var(--success-color), #3D6B1E);
    color: #E8F5E0;
    border: 1px solid #4A7A28;
}

.jixiong-badge.小吉 {
    background: linear-gradient(135deg, #5A7A3A, #4A6A2A);
    color: #E8F5E0;
    border: 1px solid #6A8A3A;
}

.jixiong-badge.平 {
    background: linear-gradient(135deg, #8B7355, #7A6345);
    color: #FFF8E7;
    border: 1px solid #9B8365;
}

.jixiong-badge.凶,
.jixiong-badge.大凶 {
    background: linear-gradient(135deg, var(--danger-color), #4A0000);
    color: #FFE4E4;
    border: 1px solid #6B1010;
}

/* ==================== 解读文本 ==================== */
.analysis-text {
    font-size: 1rem;
    line-height: 1.9;
    color: #444;
    padding: 14px 16px;
    background: #FDFBF5;
    border-radius: 4px;
    border: 1px solid #E8E0D0;
    white-space: pre-line;
}

/* ==================== AI 解读 ==================== */
#ai-section {
    background:
        linear-gradient(180deg, rgba(255,254,247,0.98), rgba(248,244,236,0.98)),
        linear-gradient(135deg, #FFFEF7, #F8F4EC);
}

#ai-section::before {
    background: linear-gradient(90deg, #8B6914, #D4AF37, #8B6914);
}

#ai-section .card-title {
    color: #8B6914;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

#ai-section .card-title::after {
    content: 'AI 扩展';
    display: inline-flex;
    align-items: center;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    color: #8B6914;
    background: rgba(212,175,55,0.1);
    border: 1px solid rgba(212,175,55,0.22);
}

.ai-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 28px 16px;
    color: #888;
    font-size: 0.95rem;
}

.ai-spinner {
    width: 22px;
    height: 22px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent-color);
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
}

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

.ai-result {
    font-size: 1rem;
    line-height: 2;
    color: #3A3A3A;
    padding: 14px 16px;
    background: #FDFBF5;
    border: 1px solid #E8E0D0;
    border-radius: 4px;
}

.ai-content {
    padding: 2px;
    line-height: 1.8;
}

.ai-content > :first-child {
    margin-top: 0;
}

.ai-content > :last-child {
    margin-bottom: 0;
}

.ai-content h1,
.ai-content h2,
.ai-content h3 {
    margin: 1.2em 0 0.6em;
    color: var(--primary-color);
}

.ai-content h1:first-child,
.ai-content h2:first-child,
.ai-content h3:first-child {
    margin-top: 0;
}

.ai-content p {
    margin: 0.6em 0;
}

.ai-content ul,
.ai-content ol {
    margin: 0.6em 0;
    padding-left: 1.5em;
}

.ai-content li {
    margin: 0.3em 0;
}

.ai-content blockquote {
    margin: 1em 0;
    padding: 0.8em 1em;
    background: #F5EFE0;
    border-left: 3px solid var(--accent-color);
    border-radius: 0 4px 4px 0;
    font-style: italic;
}

.ai-content strong {
    color: var(--primary-color);
}

.ai-content hr {
    border: none;
    border-top: 1px dashed var(--border-color);
    margin: 1.2em 0;
}

.ai-error {
    color: var(--danger-color);
    font-size: 0.9rem;
    padding: 14px 16px;
    background: #FEF2F2;
    border-radius: 4px;
    border: 1px solid #E8C0C0;
}

/* ==================== 历史记录 ==================== */
.history-section {
    margin-top: 48px;
}

.history-toggle-btn {
    display: block;
    width: 100%;
    max-width: 260px;
    margin: 0 auto 20px;
    padding: 12px 30px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--primary-color);
    background: transparent;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    letter-spacing: 0.1em;
}

.history-toggle-btn:hover {
    background: var(--primary-color);
    color: #FFE4B5;
    border-color: var(--primary-color);
}

.history-list {
    background: var(--card-bg);
    border-radius: 4px;
    padding: 20px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

.history-item {
    margin-bottom: 12px;
    background: #FDFBF5;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    border-left: 3px solid var(--accent-color);
    transition: all 0.3s ease;
    overflow: hidden;
}

.history-item:hover {
    background: #FAF6ED;
    transform: translateX(4px);
}

.history-item-toolbar {
    display: flex;
    justify-content: flex-end;
    padding: 14px 16px 0;
}

.history-record {
    padding: 0 16px 16px;
}

.history-record[open] .history-item-expand {
    color: var(--primary-color);
}

.history-item-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    cursor: pointer;
    list-style: none;
}

.history-item-summary::-webkit-details-marker {
    display: none;
}

.history-item-info {
    flex: 1;
}

.history-item-time {
    font-size: 0.85rem;
    color: #888;
    margin-bottom: 4px;
}

.history-item-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.history-item-matter {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    font-size: 0.82rem;
    color: #8B6914;
    background: #FFF7E7;
    border: 1px solid #E8D8B0;
    border-radius: 999px;
}

.history-item-result {
    font-size: 1rem;
    font-weight: 600;
    color: var(--primary-color);
}

.history-item .jixiong-badge,
.history-detail-summary-head .jixiong-badge {
    padding: 4px 12px;
    font-size: 0.8rem;
    letter-spacing: 0.08em;
}

.history-item-expand {
    flex-shrink: 0;
    font-size: 0.88rem;
    color: #8B7355;
}

.history-item-detail {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px dashed var(--border-color);
}

.history-detail-section + .history-detail-section {
    margin-top: 16px;
}

.history-detail-title {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 10px;
    letter-spacing: 0.08em;
}

.history-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.history-detail-grid-single {
    grid-template-columns: 1fr;
}

.history-detail-field,
.history-detail-box {
    padding: 12px 14px;
    background: #FFFDF7;
    border: 1px solid #E8E0D0;
    border-radius: 4px;
}

.history-detail-label {
    display: block;
    font-size: 0.8rem;
    color: #8B7355;
    letter-spacing: 0.08em;
    margin-bottom: 6px;
}

.history-detail-value,
.history-detail-box p {
    color: #444;
    line-height: 1.8;
}

.history-detail-summary-head {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 10px;
}

.history-detail-main-gua {
    color: var(--primary-color);
    font-weight: 600;
}

.history-detail-analysis {
    white-space: pre-line;
}

.history-detail-ai .ai-content {
    padding: 0;
}

.history-item-delete {
    padding: 6px 14px;
    font-size: 0.85rem;
    color: #888;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 2px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.history-item-delete:hover {
    background: var(--danger-color);
    color: white;
    border-color: var(--danger-color);
}

/* ==================== 页面底部 ==================== */
.footer {
    background: var(--primary-color);
    color: rgba(255,228,181,0.7);
    text-align: center;
    padding: 24px;
    margin-top: auto;
    letter-spacing: 0.1em;
}

.footer p {
    margin: 0;
    font-size: 0.9rem;
}

/* ==================== 工具类 ==================== */
.hidden {
    display: none !important;
}

/* ==================== 动画效果 ==================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.6s ease-out;
}

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

.pulse {
    animation: pulse 1.2s ease-in-out infinite;
}

/* ==================== 响应式设计 ==================== */
@media (max-width: 768px) {
    main {
        padding-bottom: 44px;
    }

    .header h1 {
        font-size: 2rem;
    }

    .header .subtitle {
        font-size: 0.95rem;
        letter-spacing: 0.2em;
    }

    .header::before,
    .header::after {
        display: none;
    }

    .matter-section {
        flex-direction: column;
        gap: 10px;
    }

    .matter-select {
        width: 100%;
    }

    .divination-btn {
        width: 100%;
        padding: 16px 40px;
        font-size: 1.2rem;
    }

    .card {
        padding: 18px 16px;
        margin-bottom: 16px;
    }

    .card-title {
        font-size: 1.1rem;
        margin-bottom: 14px;
        padding-bottom: 8px;
    }

    .result-summary {
        gap: 14px;
    }

    .summary-meta {
        align-items: flex-start;
        flex-direction: column;
        gap: 10px;
    }

    .summary-matter {
        font-size: 0.88rem;
    }

    .summary-main-name {
        font-size: 1.7rem;
        letter-spacing: 0.14em;
    }

    .summary-actions {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .summary-gua-overview {
        gap: 8px;
    }

    .summary-headline {
        font-size: 0.98rem;
        line-height: 1.8;
    }

    .summary-action,
    .summary-main-gua {
        border-radius: 5px;
    }

    .gua-details-toggle {
        align-items: flex-start;
        flex-direction: column;
        gap: 4px;
        line-height: 1.5;
    }

    .gua-details-hint {
        font-size: 0.8rem;
    }

    .analysis-text,
    .ai-result,
    .history-detail-box,
    .history-detail-field {
        padding: 12px 14px;
    }

    .analysis-text {
        font-size: 0.96rem;
        line-height: 1.85;
    }

    .ai-loading {
        padding: 22px 14px;
    }

    .ai-result {
        font-size: 0.96rem;
        line-height: 1.85;
    }

    .ai-content {
        line-height: 1.72;
    }

    .ai-content h1,
    .ai-content h2,
    .ai-content h3 {
        margin: 0.95em 0 0.45em;
        line-height: 1.45;
    }

    .ai-content p {
        margin: 0.5em 0;
    }

    .ai-content ul,
    .ai-content ol {
        margin: 0.5em 0;
        padding-left: 1.2em;
    }

    .ai-content blockquote {
        margin: 0.85em 0;
        padding: 0.7em 0.85em;
    }

    .liushen-name {
        font-size: 1.4rem;
    }

    .jixiong-badge {
        font-size: 1.2rem;
        padding: 8px 28px;
    }

    .history-detail-grid {
        grid-template-columns: 1fr;
    }

    .history-list {
        padding: 16px 14px;
    }

    .history-item-toolbar {
        padding: 12px 14px 0;
    }

    .history-record {
        padding: 0 14px 14px;
    }

    .history-item-summary {
        gap: 12px;
    }

    .history-item-meta {
        gap: 8px;
    }

    .history-detail-title {
        margin-bottom: 8px;
    }

    .history-detail-section + .history-detail-section {
        margin-top: 14px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 14px;
    }

    .header {
        padding: 32px 0 28px;
    }

    .header h1 {
        font-size: 1.68rem;
        letter-spacing: 0.12em;
    }

    .header .subtitle {
        letter-spacing: 0.14em;
    }

    .summary-card {
        padding: 16px 14px;
    }

    .summary-main-gua,
    .summary-action {
        padding: 12px 14px;
    }

    .summary-gua-chip {
        width: 100%;
        justify-content: space-between;
        padding: 7px 10px;
    }

    .summary-main-name {
        font-size: 1.52rem;
    }

    .summary-main-meaning {
        font-size: 0.94rem;
    }

    .summary-headline {
        font-size: 0.94rem;
    }

    .summary-action-label,
    .summary-gua-label {
        font-size: 0.76rem;
    }

    #ai-section .card-title {
        align-items: flex-start;
        flex-direction: column;
        gap: 6px;
    }

    #ai-section .card-title::after {
        padding: 2px 8px;
        font-size: 0.62rem;
        opacity: 0.78;
    }

    .analysis-text,
    .ai-result {
        font-size: 0.92rem;
        line-height: 1.76;
    }

    .ai-content h1,
    .ai-content h2,
    .ai-content h3 {
        font-size: 1rem;
    }

    .ai-content ul,
    .ai-content ol {
        padding-left: 1.05em;
    }

    .ai-content blockquote {
        padding: 0.65em 0.75em;
    }

    .history-item-summary {
        align-items: flex-start;
        flex-direction: column;
        gap: 10px;
    }

    .history-item-expand {
        font-size: 0.8rem;
    }

    .history-item-matter,
    .history-item .jixiong-badge,
    .history-detail-summary-head .jixiong-badge {
        font-size: 0.74rem;
    }

    .history-detail-field,
    .history-detail-box {
        padding: 11px 12px;
    }
}

/* ==================== 方案二：新中式占课纸风格 ==================== */
:root {
    --primary-color: #A92F24;
    --accent-color: #9D7B3A;
    --success-color: #2F684E;
    --warning-color: #A16B24;
    --danger-color: #7B1F1A;
    --bg-color: #F1E8D8;
    --card-bg: #FFF8E9;
    --text-color: #211F1A;
    --muted-color: #7D7162;
    --line-color: #D7C19B;
    --border-color: #D7C19B;
    --ink-color: #16251E;
    --shadow: 0 18px 42px rgba(88,64,36,0.045);
    --shadow-hover: 0 22px 60px rgba(84,60,32,0.08);
}

body {
    overflow-x: hidden;
    background:
        linear-gradient(90deg, rgba(169,47,36,0.035) 0 1px, transparent 1px),
        linear-gradient(rgba(22,37,30,0.026) 0 1px, transparent 1px),
        radial-gradient(circle at 50% 0%, rgba(255,248,233,0.86), rgba(241,232,216,0.92) 46%, rgba(235,225,207,0.98)),
        var(--bg-color);
    background-size: 32px 32px, 32px 32px, auto;
    color: var(--text-color);
}

body::before {
    background: none;
}

.container {
    max-width: 1040px;
    padding: 24px;
}

.header {
    padding: 38px 0 18px;
    color: var(--text-color);
    text-align: left;
    background: transparent;
    border-bottom: 0;
    box-shadow: none;
}

.header::before,
.header::after {
    display: none;
}

.header .container {
    position: relative;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    align-items: start;
    gap: 18px;
    max-width: 980px;
    padding-top: 10px;
    padding-bottom: 28px;
}

.header .container::after {
    content: '';
    position: absolute;
    right: 24px;
    bottom: 0;
    left: 24px;
    height: 1px;
    background: linear-gradient(90deg, var(--primary-color) 0 84px, var(--line-color) 84px);
}

.brand-mark {
    position: relative;
    display: grid;
    place-items: center;
    width: 68px;
    height: 68px;
    margin-top: 4px;
    color: #FFF8E8;
    background:
        radial-gradient(circle at 35% 28%, rgba(255,248,232,0.18), transparent 26%),
        var(--primary-color);
    border: 1px solid rgba(169,47,36,0.35);
    border-radius: 6px;
    box-shadow: 0 10px 22px rgba(169,47,36,0.16);
    transform: rotate(-3deg);
}

.brand-mark::after {
    content: '';
    position: absolute;
    inset: 7px;
    border: 1px solid rgba(255,248,232,0.45);
    border-radius: 4px;
}

.header-copy {
    min-width: 0;
    padding-top: 4px;
}

.eyebrow,
.section-kicker,
.matter-label,
.summary-main-label,
.summary-gua-label,
.summary-action-label,
.liushen-label,
.history-detail-label {
    font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

.eyebrow,
.section-kicker {
    display: inline-flex;
    color: var(--primary-color);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.18em;
}

.header h1 {
    margin: 3px 0 4px;
    color: var(--ink-color);
    font-size: 2.72rem;
    line-height: 1.18;
    letter-spacing: 0.06em;
    text-shadow: none;
}

.header .subtitle {
    color: var(--muted-color);
    font-size: 0.98rem;
    font-style: normal;
    letter-spacing: 0.18em;
}

.liushen-rail {
    display: grid;
    grid-template-columns: repeat(6, auto);
    gap: 8px;
    align-self: center;
    padding: 8px;
    background: rgba(255,248,233,0.56);
    border: 1px solid var(--line-color);
    box-shadow: inset 0 0 0 4px rgba(255,248,233,0.42);
}

.liushen-rail span {
    display: grid;
    place-items: center;
    width: 34px;
    height: 64px;
    color: var(--muted-color);
    border-right: 1px solid rgba(215,193,155,0.72);
    font-size: 0.82rem;
    line-height: 1.1;
    letter-spacing: 0.1em;
    writing-mode: vertical-rl;
}

.liushen-rail span:last-child {
    border-right: 0;
}

.visit-count {
    justify-self: end;
    align-self: start;
    margin: 0;
    padding: 8px 12px;
    color: var(--muted-color);
    background: rgba(255,248,233,0.58);
    border: 1px solid var(--line-color);
    border-radius: 3px;
    box-shadow: inset 0 0 0 3px rgba(255,248,233,0.42);
    white-space: nowrap;
}

main.container {
    position: relative;
    padding-bottom: 56px;
}

main.container::before,
main.container::after {
    content: '';
    position: absolute;
    top: 18px;
    bottom: 90px;
    width: 1px;
    background: linear-gradient(180deg, transparent, rgba(215,193,155,0.6) 12%, rgba(215,193,155,0.24) 88%, transparent);
    pointer-events: none;
}

main.container::before {
    left: 24px;
}

main.container::after {
    right: 24px;
}

.oracle-panel {
    position: relative;
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr);
    max-width: 980px;
    margin: 34px auto 24px;
    padding: 0;
    overflow: hidden;
    background:
        linear-gradient(90deg, rgba(169,47,36,0.07), transparent 18%, transparent 82%, rgba(157,123,58,0.05)),
        rgba(255,248,233,0.9);
    border: 0;
    border-radius: 0;
    box-shadow:
        0 0 0 1px rgba(215,193,155,0.88),
        0 0 0 8px rgba(255,248,233,0.42),
        var(--shadow-hover);
}

.oracle-panel::after {
    content: '';
    position: absolute;
    inset: 14px;
    border: 1px solid rgba(215,193,155,0.58);
    pointer-events: none;
}

.oracle-panel-copy {
    position: relative;
    display: flex;
    min-height: 230px;
    flex-direction: column;
    justify-content: space-between;
    padding: 30px 28px;
    background:
        linear-gradient(180deg, rgba(169,47,36,0.08), transparent 42%),
        rgba(255,248,233,0.36);
    border-right: 1px solid var(--line-color);
}

.oracle-panel-copy::before {
    content: '小六壬';
    position: absolute;
    left: 28px;
    bottom: 74px;
    color: rgba(169,47,36,0.16);
    font-size: 2.7rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    writing-mode: vertical-rl;
    pointer-events: none;
}

.oracle-panel-copy::after {
    content: '问';
    position: absolute;
    right: 20px;
    top: 18px;
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    color: rgba(169,47,36,0.42);
    border: 1px solid rgba(169,47,36,0.28);
    border-radius: 50%;
    font-size: 0.9rem;
    transform: rotate(10deg);
}

.oracle-panel-copy h2 {
    max-width: 6.7em;
    margin-top: 12px;
    color: var(--ink-color);
    font-size: 1.92rem;
    line-height: 1.45;
    letter-spacing: 0.03em;
}

.oracle-rules {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    margin-top: 26px;
    background: rgba(255,252,244,0.38);
    border: 1px solid rgba(215,193,155,0.82);
}

.oracle-rules span {
    padding: 8px 0;
    color: var(--muted-color);
    text-align: center;
    font-size: 0.82rem;
    letter-spacing: 0.12em;
}

.oracle-rules span + span {
    border-left: 1px solid rgba(215,193,155,0.82);
}

.oracle-controls {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 148px;
    align-content: center;
    gap: 16px;
    padding: 48px 38px;
}

.oracle-controls::before {
    content: '一事一问';
    position: absolute;
    right: 38px;
    top: 22px;
    color: rgba(125,113,98,0.42);
    font-size: 0.78rem;
    letter-spacing: 0.18em;
}

.matter-section,
.divination-section {
    margin: 0;
}

.matter-section {
    display: block;
    text-align: left;
}

.matter-label {
    display: block;
    margin-bottom: 8px;
    color: var(--primary-color);
    font-size: 0.86rem;
    font-weight: 700;
    letter-spacing: 0.12em;
}

.matter-select {
    width: 100%;
    min-width: 0;
    min-height: 58px;
    padding: 11px 42px 11px 18px;
    color: var(--text-color);
    background:
        linear-gradient(90deg, rgba(255,252,244,0.72), rgba(255,248,233,0.36));
    border: 0;
    border-bottom: 1px solid rgba(157,123,58,0.46);
    border-radius: 0;
}

.matter-select:focus {
    outline: none;
    border-bottom-color: rgba(169,47,36,0.72);
    box-shadow: 0 3px 0 rgba(169,47,36,0.16);
}

.divination-btn {
    min-height: 58px;
    padding: 0 26px;
    overflow: hidden;
    color: #FFF8E8;
    background:
        linear-gradient(180deg, rgba(255,255,255,0.08), transparent),
        var(--primary-color);
    border: 1px solid #7F251C;
    border-radius: 0;
    box-shadow: none;
    font-size: 1rem;
    letter-spacing: 0.12em;
    transform: rotate(-1deg);
    transition:
        background-color 0.2s ease,
        box-shadow 0.2s ease,
        transform 0.2s ease;
}

.divination-btn::before {
    display: none;
}

.divination-btn::after {
    content: '';
    position: absolute;
    inset: 7px;
    border: 1px solid rgba(255,248,233,0.22);
    pointer-events: none;
}

.divination-btn:hover {
    background: #8D2A21;
    box-shadow: 0 6px 14px rgba(169,47,36,0.16);
    transform: rotate(-1deg) translateY(1px) scale(0.985);
}

/* ==================== 首屏纸卷入场动效 ==================== */
.brand-mark {
    animation: sealDropIn 0.72s cubic-bezier(0.2, 0.9, 0.25, 1.12) both;
}

.header-copy .eyebrow,
.header h1,
.header .subtitle,
.visit-count {
    animation: inkRiseIn 0.72s ease both;
}

.header-copy .eyebrow {
    animation-delay: 0.12s;
}

.header h1 {
    animation-delay: 0.2s;
}

.header .subtitle {
    animation-delay: 0.28s;
}

.visit-count {
    animation-delay: 0.36s;
}

.liushen-rail {
    animation: paperFadeIn 0.68s ease 0.3s both;
}

.liushen-rail span {
    animation: liushenSlipIn 0.46s ease both;
}

.liushen-rail span:nth-child(1) { animation-delay: 0.38s; }
.liushen-rail span:nth-child(2) { animation-delay: 0.44s; }
.liushen-rail span:nth-child(3) { animation-delay: 0.5s; }
.liushen-rail span:nth-child(4) { animation-delay: 0.56s; }
.liushen-rail span:nth-child(5) { animation-delay: 0.62s; }
.liushen-rail span:nth-child(6) { animation-delay: 0.68s; }

.header .container::after {
    transform-origin: left center;
    animation: ruleBrushIn 0.76s ease 0.24s both;
}

.oracle-panel {
    transform-origin: center top;
    animation: scrollSheetIn 0.86s cubic-bezier(0.2, 0.8, 0.22, 1) 0.42s both;
}

.oracle-panel::after {
    animation: innerRuleIn 0.72s ease 0.76s both;
}

.oracle-panel-copy,
.oracle-controls {
    animation: inkRiseIn 0.68s ease 0.62s both;
}

.history-toggle-btn,
.seo-section {
    animation: inkRiseIn 0.58s ease 0.78s both;
}

@keyframes sealDropIn {
    from {
        opacity: 0;
        transform: translateY(-10px) scale(0.88) rotate(-10deg);
    }
    70% {
        opacity: 1;
        transform: translateY(1px) scale(1.03) rotate(-2deg);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1) rotate(-3deg);
    }
}

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

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

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

@keyframes ruleBrushIn {
    from {
        opacity: 0;
        transform: scaleX(0.16);
    }
    to {
        opacity: 1;
        transform: scaleX(1);
    }
}

@keyframes scrollSheetIn {
    from {
        opacity: 0;
        transform: translateY(16px) scaleY(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scaleY(1);
    }
}

@keyframes innerRuleIn {
    from {
        opacity: 0;
        transform: scaleX(0.96);
    }
    to {
        opacity: 1;
        transform: scaleX(1);
    }
}

@media (prefers-reduced-motion: reduce) {
    .brand-mark,
    .header-copy .eyebrow,
    .header h1,
    .header .subtitle,
    .visit-count,
    .liushen-rail,
    .liushen-rail span,
    .header .container::after,
    .oracle-panel,
    .oracle-panel::after,
    .oracle-panel-copy,
    .oracle-controls,
    .history-toggle-btn,
    .seo-section {
        animation: none;
    }

    .divination-btn {
        transition: none;
    }

    .divination-btn:hover {
        transform: rotate(-1deg);
    }
}

.result-section {
    display: grid;
    max-width: 980px;
    gap: 16px;
    margin: 18px auto 0;
}

.card,
.history-list {
    background:
        linear-gradient(180deg, rgba(255,251,241,0.88), rgba(255,248,233,0.76)),
        var(--card-bg);
    border: 1px solid var(--line-color);
    border-radius: 0;
    box-shadow: var(--shadow);
}

.card {
    padding: 24px;
    margin-bottom: 0;
}

.card::before {
    height: 2px;
    background: linear-gradient(90deg, var(--primary-color), transparent 42%);
    border-radius: 0;
}

.card-title,
.gua-details-toggle {
    min-height: 34px;
    color: var(--ink-color);
    font-size: 1.02rem;
    letter-spacing: 0.08em;
}

.card-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--line-color);
}

.card-title::before,
.history-detail-title::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--primary-color);
}

.summary-card {
    position: relative;
    padding: 30px 34px 34px;
    background:
        linear-gradient(90deg, rgba(169,47,36,0.038), transparent 22%, transparent),
        linear-gradient(180deg, rgba(255,251,241,0.92), rgba(255,248,233,0.82));
}

.summary-card::after {
    content: '课';
    position: absolute;
    right: 34px;
    top: 26px;
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    color: rgba(169,47,36,0.62);
    border: 1px solid rgba(169,47,36,0.38);
    border-radius: 50%;
    font-size: 1rem;
    transform: rotate(12deg);
}

.summary-card .card-title {
    padding-right: 64px;
}

.result-summary {
    gap: 16px;
}

.summary-meta {
    justify-content: flex-start;
    gap: 14px;
    margin-bottom: 2px;
}

.summary-matter {
    min-height: 34px;
    color: #7E5D22;
    background: #F8F0DB;
    border: 1px solid #E5D4AA;
    border-radius: 999px;
    box-shadow: inset 0 0 0 3px rgba(255,248,233,0.4);
}

.summary-card .jixiong-badge {
    display: inline-grid;
    flex: 0 0 auto;
    place-items: center;
    width: 64px;
    height: 64px;
    padding: 0;
    color: var(--primary-color);
    background: transparent;
    border: 1px solid rgba(169,47,36,0.5);
    border-radius: 50%;
    box-shadow: none;
    font-size: 1rem;
    letter-spacing: 0.08em;
    transform: rotate(-8deg);
}

.summary-verdict {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    min-height: 188px;
    border-width: 1px 0;
    border-style: solid;
    border-color: var(--line-color);
}

.summary-verdict .summary-main-gua {
    display: flex;
    min-height: 188px;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    padding: 24px 26px 24px 0;
    background: transparent;
    border: 0;
}

.summary-main-label,
.summary-gua-label,
.summary-action-label {
    color: var(--muted-color);
    font-size: 0.82rem;
    letter-spacing: 0.12em;
}

.summary-verdict .summary-main-label {
    margin-bottom: 14px;
}

.summary-verdict .summary-main-name {
    color: var(--ink-color);
    font-size: 4.25rem;
    line-height: 1;
    letter-spacing: 0.05em;
}

.summary-verdict-copy {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 24px 0 24px 30px;
    border-left: 1px solid var(--line-color);
}

.summary-verdict-label {
    width: fit-content;
    margin-bottom: 12px;
    padding: 4px 10px;
    color: var(--primary-color);
    border: 1px solid rgba(169,47,36,0.28);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.16em;
}

.summary-main-meaning {
    max-width: none;
    margin-bottom: 14px;
    color: var(--ink-color);
    font-size: 1.12rem;
    font-weight: 700;
}

.summary-headline {
    max-width: 42em;
    margin: 0;
    padding: 2px 0 2px 16px;
    color: #3E3932;
    border-left: 2px solid rgba(169,47,36,0.44);
}

.summary-gua-overview {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-top: 16px;
}

.summary-gua-chip {
    display: inline-flex;
    min-height: 50px;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: rgba(255,252,244,0.48);
    border: 1px solid var(--line-color);
    border-radius: 0;
}

.summary-gua-value {
    color: var(--ink-color);
}

.summary-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0;
    overflow: hidden;
    border: 1px solid var(--line-color);
    border-radius: 0;
}

.summary-action {
    min-height: 86px;
    padding: 17px 18px;
    background: rgba(255,253,247,0.54);
    border: 0;
}

.summary-action + .summary-action {
    border-left: 1px solid var(--line-color);
}

.summary-action-label {
    color: var(--primary-color);
}

.summary-action p {
    color: #3E3932;
}

.gua-details-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: var(--ink-color);
}

.gua-details-hint {
    color: var(--muted-color);
    font-size: 0.82rem;
}

.gua-result {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.liushen-item,
.analysis-text,
.ai-result,
.history-item,
.history-detail-field,
.history-detail-box {
    background: rgba(255,252,244,0.58);
    border-color: var(--line-color);
    border-radius: 0;
    box-shadow: none;
}

.liushen-item {
    min-height: 178px;
    padding: 16px;
    border-left-width: 1px;
}

.liushen-item:hover,
.history-item:hover {
    transform: none;
    background: rgba(255,252,244,0.72);
}

.liushen-item.main {
    border-left-width: 1px;
    border-left-color: var(--primary-color);
    box-shadow: inset 0 0 0 1px rgba(169,47,36,0.25);
}

.liushen-name,
.liushen-item.main .liushen-name,
.time-info strong,
.ai-content h1,
.ai-content h2,
.ai-content h3,
.ai-content strong,
.history-item-result,
.history-detail-main-gua,
.history-detail-title {
    color: var(--primary-color);
}

.liushen-name {
    margin-bottom: 12px;
    font-size: 1.85rem;
    line-height: 1.1;
}

.liushen-details {
    border-top-color: rgba(215,193,155,0.8);
}

.analysis-text,
.ai-result {
    padding: 18px 20px;
    background:
        linear-gradient(90deg, rgba(157,123,58,0.04), transparent 18%),
        rgba(255,252,244,0.58);
    color: #3E3932;
}

.time-info {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.time-info p {
    margin: 0;
    padding: 13px 14px;
    color: var(--muted-color);
    background: rgba(255,252,244,0.52);
    border: 1px solid rgba(215,193,155,0.78);
}

#ai-section {
    background:
        linear-gradient(90deg, rgba(47,104,78,0.04), transparent 24%),
        linear-gradient(180deg, rgba(255,251,241,0.9), rgba(255,248,233,0.78));
}

#ai-section::before {
    background: linear-gradient(90deg, #2F684E, transparent 42%);
}

#ai-section .card-title {
    color: var(--ink-color);
}

#ai-section .card-title::after {
    color: #2F684E;
    background: rgba(47,104,78,0.1);
    border-color: rgba(47,104,78,0.22);
    border-radius: 3px;
}

.ai-spinner {
    border-color: var(--line-color);
    border-top-color: #2F684E;
}

.history-section {
    max-width: 980px;
    margin: 28px auto 0;
}

.seo-section {
    max-width: 980px;
    margin: 28px auto 0;
    padding: 24px;
    background:
        linear-gradient(180deg, rgba(255,251,241,0.72), rgba(255,248,233,0.58)),
        var(--card-bg);
    border: 1px solid var(--line-color);
    box-shadow: var(--shadow);
}

.seo-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--line-color);
}

.seo-heading h2 {
    margin: 0;
    color: var(--ink-color);
    font-size: 1.25rem;
    letter-spacing: 0.06em;
}

.seo-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.seo-item {
    padding: 16px;
    background: rgba(255,252,244,0.5);
    border: 1px solid rgba(215,193,155,0.78);
}

.seo-item h3 {
    margin-bottom: 8px;
    color: var(--primary-color);
    font-size: 0.98rem;
    letter-spacing: 0.04em;
}

.seo-item p {
    margin: 0;
    color: #4F473C;
    font-size: 0.94rem;
    line-height: 1.85;
}

.history-toggle-btn {
    display: block;
    width: 100%;
    max-width: 980px;
    min-height: 50px;
    color: var(--ink-color);
    background: rgba(255,248,233,0.52);
    border: 1px solid var(--line-color);
    border-radius: 0;
}

.history-toggle-btn:hover {
    color: #FFF8E8;
    background: var(--ink-color);
    border-color: var(--ink-color);
}

.history-list {
    padding: 16px;
}

.history-item {
    background: rgba(255,252,244,0.64);
    border-left-color: var(--accent-color);
}

.history-item-summary {
    min-height: 50px;
}

.history-item-matter {
    color: #7E5D22;
    background: #F8F0DB;
    border-color: #E5D4AA;
}

.history-detail-title {
    display: flex;
    align-items: center;
    gap: 8px;
}

.history-item-delete {
    color: var(--muted-color);
    border-color: var(--line-color);
    border-radius: 0;
}

.history-item-delete:hover {
    color: #fff;
    background: var(--danger-color);
}

.footer {
    margin-top: 48px;
    color: var(--muted-color);
    background: transparent;
    border-top: 1px solid var(--line-color);
}

.footer p {
    max-width: 100%;
    margin: 0 auto;
    overflow-wrap: anywhere;
    line-height: 1.9;
}

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

    .liushen-rail {
        grid-column: 1 / -1;
        grid-template-columns: repeat(6, 1fr);
        justify-self: stretch;
    }

    .liushen-rail span {
        width: auto;
        height: 36px;
        writing-mode: horizontal-tb;
    }

    .visit-count {
        grid-column: 1 / -1;
        justify-self: start;
    }
}

@media (max-width: 768px) {
    main.container::before,
    main.container::after {
        display: none;
    }

    .oracle-panel {
        grid-template-columns: 1fr;
    }

    .oracle-panel-copy {
        min-height: 0;
        border-right: 0;
        border-bottom: 1px solid var(--line-color);
    }

    .oracle-panel-copy::before,
    .oracle-controls::before {
        display: none;
    }

    .oracle-controls {
        grid-template-columns: 1fr;
        padding: 22px;
    }

    .divination-btn {
        width: 100%;
    }

    .summary-verdict,
    .summary-gua-overview,
    .gua-result,
    .time-info {
        grid-template-columns: 1fr;
    }

    .summary-verdict .summary-main-gua {
        min-height: 0;
        padding: 22px 0 18px;
    }

    .summary-verdict-copy {
        padding: 20px 0 22px;
        border-top: 1px solid var(--line-color);
        border-left: 0;
    }

    .summary-verdict .summary-main-name {
        font-size: 3.15rem;
    }

    .summary-actions {
        grid-template-columns: 1fr;
    }

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

    .seo-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
    }

    .summary-action + .summary-action {
        border-top: 1px solid var(--line-color);
        border-left: 0;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 14px;
    }

    .header {
        padding-top: 26px;
    }

    .header .container {
        gap: 14px;
    }

    .header .container::after {
        right: 14px;
        left: 14px;
    }

    .brand-mark {
        width: 54px;
        height: 54px;
    }

    .header h1 {
        font-size: 2rem;
    }

    .liushen-rail {
        gap: 0;
        padding: 0;
    }

    .liushen-rail span {
        height: 34px;
        font-size: 0.74rem;
    }

    .oracle-panel {
        box-shadow:
            0 0 0 1px rgba(215,193,155,0.88),
            0 14px 34px rgba(84,60,32,0.06);
    }

    .oracle-panel::after {
        inset: 8px;
    }

    .oracle-panel-copy {
        padding: 18px;
    }

    .oracle-panel-copy h2 {
        max-width: none;
        font-size: 1.42rem;
    }

    .summary-card,
    .card,
    .seo-section {
        padding: 18px 16px;
    }

    .summary-card::after {
        right: 16px;
        top: 18px;
        width: 44px;
        height: 44px;
    }

    .summary-card .jixiong-badge {
        width: 54px;
        height: 54px;
        font-size: 0.9rem;
    }

    .liushen-item {
        min-height: 0;
    }

    .footer {
        padding: 20px 14px;
        letter-spacing: 0.04em;
    }
}

/* ==================== 起卦方式切换 ==================== */
.method-tabs {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    background: rgba(255,252,244,0.4);
    border: 1px solid var(--line-color);
}

.method-tab {
    padding: 9px 4px;
    color: var(--muted-color);
    background: transparent;
    border: 0;
    border-left: 1px solid rgba(215,193,155,0.62);
    font-family: inherit;
    font-size: 0.86rem;
    letter-spacing: 0.06em;
    cursor: pointer;
    transition: color 0.2s ease, background-color 0.2s ease;
}

.method-tab:first-child {
    border-left: 0;
}

.method-tab:hover {
    color: var(--primary-color);
    background: rgba(169,47,36,0.06);
}

.method-tab:focus-visible {
    outline: 2px solid rgba(169,47,36,0.45);
    outline-offset: -2px;
}

.method-tab.is-active {
    color: #FFF8E8;
    background: var(--primary-color);
}

.method-panels {
    grid-column: 1 / -1;
}

.method-panel {
    display: grid;
    align-content: start;
    gap: 10px;
}

.method-panel.is-hidden {
    display: none;
}

.method-field {
    display: grid;
    gap: 6px;
    min-width: 0;
}

.method-label {
    color: var(--primary-color);
    font-size: 0.86rem;
    font-weight: 700;
    letter-spacing: 0.12em;
}

.method-input {
    width: 100%;
    min-width: 0;
    min-height: 52px;
    padding: 10px 16px;
    color: var(--text-color);
    background: linear-gradient(90deg, rgba(255,252,244,0.72), rgba(255,248,233,0.36));
    border: 0;
    border-bottom: 1px solid rgba(157,123,58,0.46);
    border-radius: 0;
    font-family: inherit;
    font-size: 1rem;
}

.method-input:focus {
    outline: none;
    border-bottom-color: rgba(169,47,36,0.72);
    box-shadow: 0 3px 0 rgba(169,47,36,0.16);
}

.method-input::placeholder {
    color: rgba(125,113,98,0.5);
}

.number-fields {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.field-hint {
    color: var(--muted-color);
    font-size: 0.78rem;
    line-height: 1.75;
    letter-spacing: 0.02em;
}

/* ==================== 分享链接 ==================== */
.share-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
    margin-bottom: 20px;
}

.share-btn {
    min-height: 46px;
    padding: 0 24px;
    color: var(--ink-color);
    background: rgba(255,248,233,0.52);
    border: 1px solid var(--line-color);
    border-radius: 0;
    font-family: inherit;
    font-size: 0.95rem;
    letter-spacing: 0.1em;
    cursor: pointer;
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.share-btn:hover {
    color: #FFF8E8;
    background: var(--ink-color);
    border-color: var(--ink-color);
}

.share-btn:focus-visible {
    outline: 2px solid rgba(169,47,36,0.45);
    outline-offset: 2px;
}

.share-hint {
    color: var(--muted-color);
    font-size: 0.88rem;
}

.share-notice {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
    padding: 14px 18px;
    background: rgba(157,123,58,0.1);
    border: 1px solid var(--line-color);
    border-left: 3px solid var(--accent-color);
}

.share-notice.hidden {
    display: none;
}

.share-notice-text {
    color: var(--ink-color);
    font-size: 0.95rem;
}

.share-notice-btn {
    padding: 8px 18px;
    color: var(--primary-color);
    background: transparent;
    border: 1px solid var(--primary-color);
    border-radius: 0;
    font-family: inherit;
    font-size: 0.88rem;
    letter-spacing: 0.08em;
    cursor: pointer;
    transition: color 0.2s ease, background-color 0.2s ease;
}

.share-notice-btn:hover {
    color: #FFF8E8;
    background: var(--primary-color);
}

.ai-trigger {
    padding: 24px 16px;
    text-align: center;
}

.ai-trigger-btn {
    min-height: 48px;
    padding: 0 28px;
    color: var(--primary-color);
    background: transparent;
    border: 1px solid var(--primary-color);
    border-radius: 0;
    font-family: inherit;
    font-size: 0.95rem;
    letter-spacing: 0.12em;
    cursor: pointer;
    transition: color 0.2s ease, background-color 0.2s ease;
}

.ai-trigger-btn:hover {
    color: #FFF8E8;
    background: var(--primary-color);
}

.ai-trigger-hint {
    margin-top: 12px;
    color: var(--muted-color);
    font-size: 0.85rem;
}

@media (max-width: 480px) {
    .share-bar,
    .share-notice {
        align-items: stretch;
        flex-direction: column;
    }

    .share-btn,
    .share-notice-btn {
        width: 100%;
    }
}
