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

@font-face {
    font-family: 'FangSong';
    src: local('FangSong'), local('仿宋');
    font-display: swap;
}

@font-face {
    font-family: 'KaiTi';
    src: local('KaiTi'), local('楷体');
    font-display: swap;
}

:root {
    /* 优化后的色彩系统 - 更现代、更和谐 */
    --bg-primary: #faf8f3;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f5f1e8;
    --bg-overlay: rgba(255, 255, 255, 0.95);

    --color-primary: #2c1810;
    --color-secondary: #6b5744;
    --color-tertiary: #9c8670;
    --color-accent: #c9a961;
    --color-gold: #d4af37;

    --border-light: #e8e3d9;
    --border-medium: #d4cfc4;
    --border-dark: #b8af9f;

    --shadow-sm: 0 2px 8px rgba(44, 24, 16, 0.06);
    --shadow-md: 0 4px 16px rgba(44, 24, 16, 0.08);
    --shadow-lg: 0 8px 32px rgba(44, 24, 16, 0.12);
    --shadow-xl: 0 16px 48px rgba(44, 24, 16, 0.15);

    --transition-fast: 0.2s ease;
    --transition-base: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
}

body {
    font-family: 'FangSong', 'SimSun', 'STSong', -apple-system, BlinkMacSystemFont, serif;
    background: linear-gradient(135deg, #faf8f3 0%, #f5f1e8 100%);
    color: var(--color-primary);
    line-height: 1.75;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* 优雅的背景纹理 */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        radial-gradient(circle at 20% 50%, rgba(201, 169, 97, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(201, 169, 97, 0.03) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

.container {
    max-width: 900px;
    margin: 40px auto;
    padding: 60px 50px;
    background: var(--bg-overlay);
    backdrop-filter: blur(20px);
    box-shadow: var(--shadow-xl);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-light);
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg,
        transparent,
        var(--color-accent) 20%,
        var(--color-gold) 50%,
        var(--color-accent) 80%,
        transparent
    );
    opacity: 0.6;
}

.container::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    height: 1px;
    background: linear-gradient(90deg,
        transparent,
        var(--border-medium),
        transparent
    );
    opacity: 0.5;
}

header {
    text-align: center;
    margin-bottom: 60px;
    padding-bottom: 40px;
    border-bottom: 1px solid var(--border-light);
    position: relative;
}

header::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 3px;
    background: linear-gradient(90deg,
        transparent,
        var(--color-accent),
        transparent
    );
    border-radius: 2px;
}

h1 {
    color: var(--color-primary);
    font-size: 3.2rem;
    margin-bottom: 16px;
    font-family: 'KaiTi', 'STKaiti', serif;
    letter-spacing: 8px;
    font-weight: 500;
    position: relative;
    display: inline-block;
}

h1::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 2px;
    background: var(--color-gold);
    opacity: 0.4;
}

.subtitle {
    color: var(--color-secondary);
    font-size: 1.05rem;
    position: relative;
    display: inline-block;
    padding: 0 30px;
    letter-spacing: 2px;
    opacity: 0.85;
}

.subtitle::before,
.subtitle::after {
    content: '';
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 1px;
    background: var(--color-tertiary);
    opacity: 0.4;
}

.subtitle::before {
    left: 0;
}

.subtitle::after {
    right: 0;
}

.divination-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 60px;
    position: relative;
    padding: 50px 30px;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-light);
    transition: var(--transition-base);
}

.divination-area:hover {
    box-shadow: var(--shadow-lg);
}

.coins-container {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-bottom: 50px;
    padding: 30px;
    position: relative;
}

.coin {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: linear-gradient(135deg, #c9a961 0%, #d4af37 50%, #c9a961 100%);
    box-shadow:
        0 8px 24px rgba(201, 169, 97, 0.3),
        0 4px 8px rgba(0, 0, 0, 0.1),
        inset 0 2px 4px rgba(255, 255, 255, 0.6),
        inset 0 -2px 4px rgba(0, 0, 0, 0.2);
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all var(--transition-base);
    transform-style: preserve-3d;
    perspective: 1000px;
    cursor: pointer;
}

.coin:hover {
    transform: translateY(-8px) scale(1.05);
    box-shadow:
        0 12px 32px rgba(201, 169, 97, 0.4),
        0 6px 12px rgba(0, 0, 0, 0.15),
        inset 0 2px 4px rgba(255, 255, 255, 0.7),
        inset 0 -2px 4px rgba(0, 0, 0, 0.2);
}

.coin::before {
    content: '';
    position: absolute;
    width: 80%;
    height: 80%;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.4), transparent 50%),
                radial-gradient(circle at center, var(--color-gold), var(--color-accent));
    border: 2px solid rgba(184, 134, 11, 0.3);
    z-index: 1;
}

.coin.heads::after {
    content: '阳';
    position: absolute;
    color: var(--color-primary);
    font-size: 2rem;
    font-weight: 600;
    z-index: 2;
    font-family: 'KaiTi', 'STKaiti', serif;
    text-shadow: 0 2px 4px rgba(255, 255, 255, 0.8);
    letter-spacing: 2px;
}

.coin.tails::after {
    content: '阴';
    position: absolute;
    color: var(--color-primary);
    font-size: 2rem;
    font-weight: 600;
    z-index: 2;
    font-family: 'KaiTi', 'STKaiti', serif;
    text-shadow: 0 2px 4px rgba(255, 255, 255, 0.8);
    letter-spacing: 2px;
}

.coin.tossing {
    animation: toss 1s cubic-bezier(0.34, 1.56, 0.64, 1) infinite;
    transform-style: preserve-3d;
    perspective: 1000px;
}

@keyframes toss {
    0% {
        transform: translateY(0) rotateY(0) rotateX(0) scale(1);
        box-shadow:
            0 8px 24px rgba(201, 169, 97, 0.3),
            0 4px 8px rgba(0, 0, 0, 0.1);
    }
    25% {
        transform: translateY(-60px) rotateY(180deg) rotateX(90deg) scale(1.1);
        box-shadow:
            0 16px 40px rgba(201, 169, 97, 0.4),
            0 8px 16px rgba(0, 0, 0, 0.2);
    }
    50% {
        transform: translateY(-80px) rotateY(360deg) rotateX(180deg) scale(1.15);
        box-shadow:
            0 20px 48px rgba(201, 169, 97, 0.5),
            0 10px 20px rgba(0, 0, 0, 0.25);
    }
    75% {
        transform: translateY(-60px) rotateY(540deg) rotateX(270deg) scale(1.1);
        box-shadow:
            0 16px 40px rgba(201, 169, 97, 0.4),
            0 8px 16px rgba(0, 0, 0, 0.2);
    }
    100% {
        transform: translateY(0) rotateY(720deg) rotateX(360deg) scale(1);
        box-shadow:
            0 8px 24px rgba(201, 169, 97, 0.3),
            0 4px 8px rgba(0, 0, 0, 0.1);
    }
}

.controls {
    text-align: center;
    position: relative;
    padding: 20px 0 0;
}

button {
    background: linear-gradient(135deg, var(--color-accent) 0%, var(--color-gold) 100%);
    color: var(--bg-secondary);
    border: none;
    padding: 16px 48px;
    font-size: 1.1rem;
    border-radius: 50px;
    cursor: pointer;
    transition: all var(--transition-base);
    font-family: 'FangSong', 'SimSun', 'STSong', serif;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    letter-spacing: 2px;
    font-weight: 500;
}

button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: var(--transition-slow);
}

button::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

button:hover {
    background: linear-gradient(135deg, var(--color-gold) 0%, var(--color-accent) 100%);
    transform: translateY(-3px) scale(1.02);
    box-shadow: var(--shadow-lg);
}

button:hover::before {
    left: 100%;
}

button:hover::after {
    width: 300px;
    height: 300px;
}

button:active {
    transform: translateY(-1px) scale(0.98);
    box-shadow: var(--shadow-sm);
}

button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.instruction {
    margin-top: 24px;
    color: var(--color-tertiary);
    position: relative;
    display: inline-block;
    font-size: 0.95rem;
    opacity: 0.8;
    letter-spacing: 1px;
}

.progress-indicator {
    margin-top: 24px;
    font-size: 0.95rem;
    color: var(--color-secondary);
    background: var(--bg-tertiary);
    padding: 14px 24px;
    border-radius: 20px;
    text-align: center;
    position: relative;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
    letter-spacing: 1px;
}

.result-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 60px;
    padding-top: 60px;
    position: relative;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    visibility: hidden;
}

.result-area::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg,
        transparent,
        var(--border-medium) 25%,
        var(--border-medium) 75%,
        transparent
    );
}

.result-area.visible {
    opacity: 1;
    transform: translateY(0);
    visibility: visible;
}

.hexagram-display {
    text-align: center;
    margin-bottom: 50px;
    padding: 40px 30px;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    position: relative;
    border: 1px solid var(--border-light);
    transition: var(--transition-base);
}

.hexagram-display:hover {
    box-shadow: var(--shadow-lg);
}

.hexagram-title {
    font-size: 1.2rem;
    color: var(--color-secondary);
    margin-bottom: 30px;
    font-family: 'KaiTi', 'STKaiti', serif;
    position: relative;
    display: inline-block;
    letter-spacing: 3px;
    opacity: 0.75;
}

.hexagram {
    display: flex;
    flex-direction: column;
    gap: 14px;
    align-items: center;
    padding: 20px 0;
    position: relative;
}

.line {
    width: 140px;
    height: 14px;
    background: linear-gradient(180deg, var(--color-primary) 0%, var(--color-secondary) 100%);
    opacity: 0;
    transform: scaleX(0.2);
    transition: all 0.7s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 3px 8px rgba(44, 24, 16, 0.2);
    border-radius: 2px;
    position: relative;
}

.line.show {
    opacity: 1;
    transform: scaleX(1);
}

.line.yin {
    display: flex;
    justify-content: space-between;
    background: transparent !important;
    box-shadow: none !important;
}

.line.yin::before,
.line.yin::after {
    content: '';
    display: block;
    width: 45%;
    height: 100%;
    background: linear-gradient(180deg, var(--color-primary) 0%, var(--color-secondary) 100%);
    box-shadow: 0 3px 8px rgba(44, 24, 16, 0.2);
    border-radius: 2px;
}

/* 变爻样式 - 阳爻变爻 */
.line.yang.changing::after {
    content: '○';
    position: absolute;
    right: -30px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-accent);
    font-weight: bold;
    font-size: 18px;
    animation: pulse 1.8s ease-in-out infinite;
    z-index: 10;
}

/* 变爻样式 - 阴爻变爻 */
/* 注意：阴爻的 ::before 和 ::after 用于绘制断开的两段线条 */
/* 因此变爻标记需要通过 JavaScript 动态添加标记元素 */
.line.yin.changing {
    position: relative;
}

/* 为了兼容性，保留伪元素方案作为备选 */
/* 但这会导致右半段线条消失 */

@keyframes pulse {
    0%, 100% {
        opacity: 0.4;
        transform: translateY(-50%) scale(0.9);
        text-shadow: 0 0 8px rgba(201, 169, 97, 0.4);
    }
    50% {
        opacity: 1;
        transform: translateY(-50%) scale(1.3);
        text-shadow: 0 0 16px rgba(201, 169, 97, 0.8);
    }
}

.hexagram-name {
    margin-top: 30px;
    font-size: 2rem;
    color: var(--color-primary);
    font-weight: 600;
    font-family: 'KaiTi', 'STKaiti', serif;
    letter-spacing: 6px;
    position: relative;
}

.hexagram-name::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg,
        transparent,
        var(--color-accent),
        transparent
    );
    border-radius: 2px;
}

.interpretation {
    max-width: 700px;
    text-align: center;
    padding: 20px;
}

.interpretation h2 {
    color: var(--color-primary);
    margin-bottom: 30px;
    font-size: 1.6rem;
    font-family: 'KaiTi', 'STKaiti', serif;
    position: relative;
    display: inline-block;
    letter-spacing: 4px;
}

.interpretation h2::after {
    content: '';
    position: absolute;
    bottom: -12px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 2px;
    background: linear-gradient(90deg,
        transparent,
        var(--color-accent),
        transparent
    );
}

#interpretation-text {
    text-align: left;
    line-height: 2;
    padding: 32px;
    background: var(--bg-tertiary);
    border-left: 4px solid var(--color-accent);
    border-radius: var(--radius-md);
    white-space: pre-line;
    box-shadow: var(--shadow-sm);
    font-size: 1.05rem;
    color: var(--color-primary);
    transition: var(--transition-base);
}

#interpretation-text:hover {
    box-shadow: var(--shadow-md);
    border-left-color: var(--color-gold);
}

.interpretation-content {
    margin-bottom: 20px;
}

.analysis-section {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px dashed #c8b08f;
}

.analysis-section h3 {
    color: #8b4513;
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.analysis-content {
    font-size: 0.95rem;
    line-height: 1.6;
}

.analysis-content ol {
    margin-left: 20px;
    margin-bottom: 15px;
}

.analysis-content li {
    margin-bottom: 8px;
}

.history-section {
    width: 100%;
    margin-top: 60px;
    padding-top: 50px;
    border-top: 1px solid var(--border-light);
    position: relative;
}

.history-section::before {
    content: '';
    position: absolute;
    top: -1px;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 3px;
    background: linear-gradient(90deg,
        transparent,
        var(--color-accent),
        transparent
    );
}

.user-info {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 20px;
    font-size: 0.85rem;
    color: var(--color-tertiary);
}

.user-info span {
    background: var(--bg-tertiary);
    padding: 8px 16px;
    border-radius: 20px;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
    letter-spacing: 0.5px;
}

.history-section h2 {
    color: var(--color-primary);
    margin-bottom: 30px;
    text-align: center;
    font-size: 1.6rem;
    font-family: 'KaiTi', 'STKaiti', serif;
    letter-spacing: 4px;
}

.history-records {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-height: 500px;
    overflow-y: auto;
    padding: 16px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
}

/* 自定义滚动条 */
.history-records::-webkit-scrollbar {
    width: 8px;
}

.history-records::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 4px;
}

.history-records::-webkit-scrollbar-thumb {
    background: var(--color-tertiary);
    border-radius: 4px;
    transition: var(--transition-fast);
}

.history-records::-webkit-scrollbar-thumb:hover {
    background: var(--color-accent);
}

.no-history {
    text-align: center;
    padding: 60px 20px;
    color: var(--color-tertiary);
    font-size: 0.95rem;
    opacity: 0.6;
}

.history-record {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: all var(--transition-base);
    position: relative;
    border: 1px solid var(--border-light);
}

.history-record::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(180deg,
        var(--color-accent),
        var(--color-gold)
    );
    border-radius: var(--radius-md) 0 0 var(--radius-md);
    opacity: 0;
    transition: var(--transition-base);
}

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

.history-record:hover::before {
    opacity: 1;
}

.hexagram-preview {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-right: 20px;
    padding: 8px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
}

.line-preview {
    width: 45px;
    height: 5px;
    background: linear-gradient(180deg, var(--color-primary), var(--color-secondary));
    border-radius: 1px;
}

.line-preview.yin {
    display: flex;
    justify-content: space-between;
    background: transparent !important;
    background-image: none !important;
}

.line-preview.yin::before,
.line-preview.yin::after {
    content: '';
    display: block;
    width: 45%;
    height: 100%;
    background: linear-gradient(180deg, var(--color-primary), var(--color-secondary));
    border-radius: 1px;
}

.line-preview.changing {
    position: relative;
}

/* 阳爻变爻预览标记 */
.line-preview.yang.changing::after {
    content: '○';
    position: absolute;
    right: -12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-accent);
    font-weight: bold;
    font-size: 10px;
}

/* 阴爻变爻预览标记 - 需要通过JavaScript动态添加，避免覆盖阴爻的伪元素 */
.line-preview.yin.changing {
    /* 样式保留为空，标记由JavaScript添加 */
}

.record-info {
    flex-grow: 1;
    padding-left: 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.record-note {
    font-size: 0.9rem;
    color: var(--color-tertiary);
    margin-top: 8px;
    line-height: 1.5;
}

.note-label {
    font-weight: 600;
    margin-right: 6px;
    color: var(--color-secondary);
}

.record-actions {
    display: flex;
    align-items: center;
    margin-left: 16px;
}

.note-button {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-medium);
    color: var(--color-secondary);
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all var(--transition-base);
    font-weight: 500;
    letter-spacing: 0.5px;
}

.note-button:hover {
    background: var(--color-accent);
    color: var(--bg-secondary);
    border-color: var(--color-accent);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.record-time {
    font-size: 0.8rem;
    color: var(--color-tertiary);
    margin-bottom: 6px;
    opacity: 0.8;
}

.record-name {
    font-size: 1.1rem;
    color: var(--color-primary);
    font-weight: 600;
    font-family: 'KaiTi', 'STKaiti', serif;
    letter-spacing: 2px;
}

footer {
    margin-top: 60px;
    text-align: center;
    font-size: 0.9rem;
    color: var(--color-tertiary);
    padding-top: 40px;
    border-top: 1px solid var(--border-light);
    position: relative;
    opacity: 0.7;
}

footer::before {
    content: '';
    position: absolute;
    top: -1px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 2px;
    background: linear-gradient(90deg,
        transparent,
        var(--color-accent),
        transparent
    );
}

footer p {
    position: relative;
    display: inline-block;
    letter-spacing: 1px;
}

/* 备注功能相关样式 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(44, 24, 16, 0.6);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

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

.modal-content {
    background: var(--bg-overlay);
    padding: 32px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    width: 90%;
    max-width: 520px;
    position: relative;
    border: 1px solid var(--border-light);
    animation: slideUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

.modal-content h3 {
    color: var(--color-primary);
    margin-bottom: 20px;
    font-family: 'KaiTi', 'STKaiti', serif;
    text-align: center;
    font-size: 1.4rem;
    letter-spacing: 3px;
}

.modal-hexagram-info {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-light);
    text-align: center;
    color: var(--color-secondary);
}

.note-textarea {
    width: 100%;
    height: 140px;
    padding: 16px;
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
    background: var(--bg-tertiary);
    resize: none;
    font-family: 'FangSong', 'SimSun', 'STSong', serif;
    margin-bottom: 20px;
    transition: var(--transition-base);
    font-size: 1rem;
    line-height: 1.8;
    color: var(--color-primary);
}

.note-textarea:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(201, 169, 97, 0.1);
}

.modal-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.modal-button {
    padding: 12px 24px;
    border-radius: 24px;
    cursor: pointer;
    font-family: 'FangSong', 'SimSun', 'STSong', serif;
    transition: all var(--transition-base);
    font-size: 1rem;
    font-weight: 500;
    letter-spacing: 1px;
}

.modal-button.cancel {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-medium);
    color: var(--color-secondary);
}

.modal-button.cancel:hover {
    background: var(--border-light);
}

.modal-button.save {
    background: linear-gradient(135deg, var(--color-accent), var(--color-gold));
    border: none;
    color: var(--bg-secondary);
    box-shadow: var(--shadow-sm);
}

.modal-button.save:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.note-section {
    margin-top: 30px;
    padding-top: 24px;
    border-top: 1px solid var(--border-light);
}

.note-content {
    background: var(--bg-tertiary);
    padding: 20px;
    border-radius: var(--radius-md);
    margin-bottom: 16px;
    line-height: 1.8;
    color: var(--color-secondary);
    border-left: 3px solid var(--color-accent);
}

.edit-note-button, .add-note-button {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-medium);
    color: var(--color-secondary);
    padding: 10px 20px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all var(--transition-base);
    display: inline-block;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.edit-note-button:hover, .add-note-button:hover {
    background: var(--color-accent);
    color: var(--bg-secondary);
    border-color: var(--color-accent);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

/* 帮助按钮样式 */
.help-button {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--color-accent), var(--color-gold));
    color: var(--bg-secondary);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    text-decoration: none;
    font-weight: bold;
    font-size: 1.4rem;
    box-shadow: var(--shadow-md);
    transition: all var(--transition-base);
    border: none;
    font-family: 'KaiTi', 'STKaiti', serif;
    z-index: 10;
}

.help-button:hover {
    background: linear-gradient(135deg, var(--color-gold), var(--color-accent));
    transform: scale(1.15) rotate(15deg);
    box-shadow: var(--shadow-lg);
}

.help-button:active {
    transform: scale(0.95);
    box-shadow: var(--shadow-sm);
}

/* 响应式设计 - 优化的移动端体验 */
@media (max-width: 768px) {
    .container {
        padding: 40px 24px;
        margin: 20px;
        max-width: calc(100% - 40px);
        border-radius: var(--radius-lg);
    }

    header {
        margin-bottom: 50px;
        padding-bottom: 30px;
    }

    h1 {
        font-size: 2.6rem;
        letter-spacing: 6px;
    }

    .subtitle {
        font-size: 0.95rem;
        letter-spacing: 1.5px;
    }

    .divination-area {
        padding: 40px 20px;
        margin-bottom: 50px;
    }

    .coins-container {
        gap: 30px;
        padding: 20px;
    }

    .coin {
        width: 85px;
        height: 85px;
    }

    .coin.heads::after,
    .coin.tails::after {
        font-size: 1.7rem;
    }

    button {
        padding: 14px 40px;
        font-size: 1.05rem;
        letter-spacing: 1.5px;
    }

    .hexagram-display {
        padding: 32px 24px;
    }

    .line {
        width: 120px;
        height: 13px;
    }

    .line.yin::before,
    .line.yin::after {
        height: 13px;
    }

    .hexagram-name {
        font-size: 1.7rem;
        letter-spacing: 4px;
    }

    .interpretation h2 {
        font-size: 1.5rem;
        letter-spacing: 3px;
    }

    #interpretation-text {
        padding: 24px;
        font-size: 1rem;
        line-height: 1.9;
    }

    .history-records {
        padding: 12px;
        gap: 14px;
    }

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

    .help-button {
        width: 40px;
        height: 40px;
        font-size: 1.3rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 30px 20px;
        margin: 15px;
        max-width: calc(100% - 30px);
    }

    header {
        margin-bottom: 40px;
        padding-bottom: 25px;
    }

    h1 {
        font-size: 2.2rem;
        letter-spacing: 4px;
    }

    .subtitle {
        font-size: 0.9rem;
        padding: 0 20px;
        letter-spacing: 1px;
    }

    .divination-area {
        padding: 30px 16px;
    }

    .coins-container {
        gap: 20px;
        padding: 16px;
        flex-wrap: wrap;
    }

    .coin {
        width: 75px;
        height: 75px;
    }

    .coin.heads::after,
    .coin.tails::after {
        font-size: 1.5rem;
    }

    button {
        padding: 13px 32px;
        font-size: 1rem;
        letter-spacing: 1px;
    }

    .hexagram-display {
        padding: 28px 20px;
    }

    .line {
        width: 100px;
        height: 12px;
    }

    .line.yin::before,
    .line.yin::after {
        height: 12px;
    }

    .hexagram-name {
        font-size: 1.5rem;
        letter-spacing: 3px;
    }

    .interpretation {
        padding: 16px;
    }

    .interpretation h2 {
        font-size: 1.35rem;
        letter-spacing: 2px;
    }

    #interpretation-text {
        padding: 20px;
        font-size: 0.95rem;
        line-height: 1.85;
    }

    .history-records {
        padding: 10px;
        gap: 12px;
        max-height: 400px;
    }

    .history-record {
        padding: 12px 14px;
        flex-wrap: wrap;
    }

    .hexagram-preview {
        margin-right: 12px;
        padding: 6px;
    }

    .line-preview {
        width: 38px;
        height: 4px;
    }

    .record-info {
        padding-left: 12px;
    }

    .record-name {
        font-size: 1rem;
        letter-spacing: 1.5px;
    }

    .record-actions {
        width: 100%;
        margin-left: 0;
        margin-top: 12px;
        justify-content: flex-end;
    }

    .note-button {
        padding: 7px 14px;
        font-size: 0.8rem;
    }

    .modal-content {
        padding: 24px;
        width: 95%;
    }

    .modal-content h3 {
        font-size: 1.2rem;
        letter-spacing: 2px;
    }

    .help-button {
        width: 38px;
        height: 38px;
        font-size: 1.2rem;
        top: 15px;
        right: 15px;
    }

    .feedback-section {
        margin-top: 40px;
    }

    .feedback-buttons {
        flex-direction: column;
        gap: 12px;
    }

    .feedback-btn {
        width: 100%;
        padding: 14px;
    }
}

/* 反馈区域样式 */
.feedback-section {
    margin-top: 60px;
    padding: 40px;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    border: 2px solid var(--border-light);
    box-shadow: var(--shadow-md);
    text-align: center;
}

.feedback-section h3 {
    font-family: 'KaiTi', 'STKaiti', serif;
    font-size: 1.5rem;
    color: var(--color-primary);
    margin-bottom: 24px;
    letter-spacing: 3px;
}

.feedback-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
}

.feedback-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 32px;
    font-size: 1.1rem;
    font-family: 'KaiTi', 'STKaiti', serif;
    border: 2px solid var(--border-medium);
    border-radius: var(--radius-md);
    background: var(--bg-primary);
    color: var(--color-primary);
    cursor: pointer;
    transition: all var(--transition-base);
    letter-spacing: 2px;
}

.feedback-btn .icon {
    font-size: 1.5rem;
    transition: transform var(--transition-base);
}

.feedback-btn:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: var(--color-accent);
}

.feedback-btn:hover .icon {
    transform: scale(1.2);
}

.feedback-btn:active {
    transform: translateY(-1px);
}

.feedback-btn.active {
    background: var(--color-accent);
    color: white;
    border-color: var(--color-gold);
    box-shadow: var(--shadow-lg);
}

.feedback-btn.like-btn.active {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
}

.feedback-btn.dislike-btn.active {
    background: linear-gradient(135deg, #f56565 0%, #e53e3e 100%);
}

.feedback-message {
    font-size: 1rem;
    color: var(--color-secondary);
    margin-top: 16px;
    min-height: 24px;
    letter-spacing: 1px;
}

.feedback-message.success {
    color: #38a169;
    font-weight: 500;
}

.feedback-message.error {
    color: #e53e3e;
    font-weight: 500;
}