/* 重置样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 全局媒体元素响应式约束 */
img, video, canvas, svg {
    max-width: 100%;
    height: auto;
    display: block;
}

/* 基础样式 - 性能优化 */
body {
    font-family: 'SimSun', 'STSong', serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    color: #e0e0e0;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    will-change: background-position;
}

/* 水墨背景效果 */
.ink-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: 0.3;
}

.ink-drop {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(74, 107, 136, 0.8) 0%, rgba(74, 107, 136, 0) 70%);
    animation: inkSpread 8s infinite ease-in-out;
}

.ink-drop-1 {
    width: 300px;
    height: 300px;
    top: 10%;
    left: 10%;
    animation-delay: 0s;
}

.ink-drop-2 {
    width: 200px;
    height: 200px;
    top: 60%;
    right: 15%;
    animation-delay: 2s;
}

.ink-drop-3 {
    width: 250px;
    height: 250px;
    bottom: 20%;
    left: 20%;
    animation-delay: 4s;
}

.ink-drop-4 {
    width: 180px;
    height: 180px;
    top: 30%;
    right: 25%;
    animation-delay: 6s;
}

@keyframes inkSpread {
    0%, 100% {
        transform: scale(1);
        opacity: 0.3;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.5;
    }
}

/* 加载动画样式 - 优化为网络慢的环境，确保优先显示 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 10, 25, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 99999; /* 提高层级确保显示在最上层 */
    transition: opacity 0.3s ease;
    backdrop-filter: blur(3px);
    /* 确保加载动画立即显示 */
    pointer-events: all;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    /* 减少渲染阻塞 */
    will-change: opacity;
}

.loading-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.loading-container {
    text-align: center;
    padding: 2rem;
    background: rgba(40, 40, 60, 0.8);
    border-radius: 12px;
    border: 1px solid rgba(100, 120, 150, 0.3);
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

/* 阴阳八卦图标 - 修复显示问题 */
.loading-spinner {
    width: 60px;
    height: 60px;
    margin: 0 auto 1.5rem;
    background: conic-gradient(from -90deg, #000 0deg 180deg, #ffffff 180deg 360deg);
    border-radius: 50%;
    animation: spin 3s linear infinite;
    position: relative;
    will-change: transform;
    box-shadow: 0 0 20px rgba(74, 107, 136, 0.5);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

/* 加载提示文本 */
.loading-text {
    color: #fff;
    font-size: 16px;
    margin-top: 16px;
    font-weight: 500;
    text-align: center;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* 黑色半圆 (白色部分中的黑色) 带白色中心圆点 */
.loading-spinner::before {
    content: '';
    position: absolute;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    background: radial-gradient(circle at center, #ffffff 0 6px, #000000 6px 100%);
    z-index: 1;
}

/* 白色半圆 (黑色部分中的白色) 带黑色中心圆点 */
.loading-spinner::after {
    content: '';
    position: absolute;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    background: radial-gradient(circle at center, #000000 0 6px, #ffffff 6px 100%);
    z-index: 1;
}

@supports not (background: conic-gradient(from -90deg, #000 0deg 180deg, #ffffff 180deg 360deg)) {
    .loading-spinner {
        background: linear-gradient(to top, #ffffff 0%, #ffffff 50%, #000000 50%, #000000 100%);
    }
}

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

.loading-text {
    font-size: 1.1rem;
    color: #a0b0c0;
    font-family: 'SimSun', 'STSong', serif;
    letter-spacing: 1px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

/* 主容器 */
.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
    position: relative;
    z-index: 1;
}

/* 标题样式 */
.header {
    text-align: center;
    margin-bottom: 3rem;
    animation: fadeInDown 1s ease-out;
}

.title {
    font-size: 4rem;
    font-weight: normal;
    color: #f8f8f8;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
    margin-bottom: 1rem;
    letter-spacing: 0.5rem;
}

.title-char {
    display: inline-block;
    animation: charFloat 3s ease-in-out infinite;
}

.title-char-1 { animation-delay: 0s; }
.title-char-2 { animation-delay: 0.2s; }
.title-char-3 { animation-delay: 0.4s; }
.title-char-4 { animation-delay: 0.6s; }

.subtitle {
    font-size: 1.2rem;
    color: #b0b0b0;
    font-style: italic;
}

/* 表单容器 */
.form-container {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 2rem;
    margin-bottom: 2rem;
    animation: slideInUp 1s ease-out;
}

.prediction-form {
    display: grid;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-label {
    font-size: 1.1rem;
    color: #e0e0e0;
    font-weight: bold;
}

.form-select {
    padding: 0.8rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: #e0e0e0;
    font-size: 1rem;
    transition: all 0.3s ease;
    cursor: pointer;
}

.form-select:focus {
    outline: none;
    border-color: #4a6b88;
    box-shadow: 0 0 10px rgba(74, 107, 136, 0.3);
}

.form-select option {
    background: #2d3748;
    color: #e0e0e0;
}

/* 提交按钮 */
.submit-btn {
    position: relative;
    padding: 1rem 2rem;
    background: linear-gradient(135deg, #4a6b88 0%, #2d4a6b 100%);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    overflow: hidden;
    margin-top: 1rem;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(74, 107, 136, 0.3);
}

.btn-ink-effect {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.6s ease;
}

.submit-btn:hover .btn-ink-effect {
    width: 300px;
    height: 300px;
}

/* 桌面端：预测表单双列布局，减少滚动 */
@media (min-width: 768px) {
    .prediction-form {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: start;
    }
    .prediction-form .submit-btn {
        grid-column: 1 / -1;
        justify-self: center;
    }
}

/* 结果容器 */
.result-container {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 2rem;
    animation: fadeIn 1s ease-out;
}

.result-card {
    text-align: center;
}

.result-header {
    margin-bottom: 2rem;
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.result-title {
    font-size: 2.5rem;
    color: #f8f8f8;
    margin-bottom: 1rem;
}

.yin-yang-symbol {
    width: 60px;
    height: 30px;
    background: linear-gradient(90deg, #fff 50%, #000 50%);
    border-radius: 50%;
    position: relative;
    margin: 0 auto;
    animation: rotate 10s linear infinite;
}

.yin-yang-symbol::before,
.yin-yang-symbol::after {
    content: '';
    position: absolute;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    top: 50%;
    transform: translateY(-50%);
}

.yin-yang-symbol::before {
    background: #000;
    left: 25%;
}

.yin-yang-symbol::after {
    background: #fff;
    right: 25%;
}

.code-display {
    margin-bottom: 2rem;
}

.code-item {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.code-label {
    color: #b0b0b0;
}

.code-value {
    color: #4a6b88;
    font-weight: bold;
    font-size: 2rem;
}

.interpretation {
    background: rgba(255, 255, 255, 0.1);
    padding: 1.5rem;
    border-radius: 10px;
    margin-bottom: 2rem;
    border-left: 4px solid #4a6b88;
}

.interpretation-text {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #f0f0f0;
    font-family: 'SimSun', 'STSong', serif;
    white-space: pre-line;
    background: rgba(255, 255, 255, 0.05);
    padding: 1.5rem;
    border-radius: 10px;
    border-left: 4px solid #4a6b88;
    margin: 1rem 0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

/* 结果页长文本在窄屏的可读性优化 */
@media (max-width: 480px) {
    .interpretation-text {
        font-size: 1rem;
        line-height: 1.9;
        padding: 1.2rem;
    }
    .result-title {
        font-size: 1.8rem;
    }
    .action-buttons {
        flex-wrap: wrap;
        gap: 10px;
        padding-top: 16px;
    }
}
@media (max-width: 380px) {
    .interpretation-text {
        font-size: 0.95rem;
        line-height: 1.95;
        padding: 1rem;
    }
}
@media (max-width: 320px) {
    .interpretation-text {
        font-size: 0.9rem;
        line-height: 2.0;
        padding: 0.9rem;
    }
    .action-buttons {
        justify-content: space-between;
    }
}

.interpretation-text p {
    margin: 0.3rem 0;
    padding: 0.2rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.interpretation-text p:last-child {
    border-bottom: none;
}

/* 年份样式 */
.year-highlight {
    color: #f0f0f0;
    font-weight: normal;
    font-size: 1.2rem;
}

/* 感情描述样式 */
.relationship-desc {
    color: #e0e0e0;
    font-size: 1.2rem;
    line-height: 1.4;
    margin-left: 0.5rem;
    font-weight: normal;
}

/* 婚期样式 */
.marriage-period {
    color: #f0f0f0;
    font-weight: normal;
    font-size: 1.2rem;
}

/* 整体感情样式 */
.overall-relationship {
    color: #f8f8f8;
    font-weight: normal;
    font-size: 1.2rem;
    border-bottom: 2px solid #4a6b88;
    padding-bottom: 0.3rem;
    margin-bottom: 0.5rem;
}

.detailed-results {
    margin-bottom: 2rem;
}

.result-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.result-item {
    background: rgba(255, 255, 255, 0.05);
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
}

.result-label {
    display: block;
    color: #b0b0b0;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.result-value {
    display: block;
    color: #4a6b88;
    font-size: 1.2rem;
    font-weight: bold;
}

/* 预测结果页面按钮样式 */
.action-buttons {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.continue-prediction-btn, .new-prediction-btn, .back-home-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 12px 24px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    letter-spacing: 0.5px;
    min-width: 140px;
}

.continue-prediction-btn {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.new-prediction-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.back-home-btn {
    background: linear-gradient(135deg, #ff6b6b 0%, #ffa8a8 100%);
}

.continue-prediction-btn:hover, .new-prediction-btn:hover, .back-home-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

.continue-prediction-btn:hover {
    box-shadow: 0 8px 20px rgba(79, 172, 254, 0.4);
}

.new-prediction-btn:hover {
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

.back-home-btn:hover {
    box-shadow: 0 8px 20px rgba(255, 107, 107, 0.4);
}

/* 反馈模态框样式 */
.feedback-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.feedback-modal.hidden {
    display: none;
}

.feedback-modal-content {
    background: rgba(255, 255, 255, 0.07);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    padding: 24px;
    max-width: 520px;
    width: 92%;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
    animation: slideUp 0.3s ease;
    color: #e0e0e0;
}

.feedback-modal-content h3 {
    color: #f8f8f8;
    margin-bottom: 18px;
    font-size: 22px;
}

.feedback-modal-content p {
    color: #d0d0d0;
    margin-bottom: 22px;
}

.feedback-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 25px;
}

.feedback-btn {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 12px 20px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

/* 非常准确 - 绿色 */
.feedback-btn[data-rating="5"] {
    background: #e8f5e8;
    border-color: #4caf50;
    color: #2e7d32;
}

/* 比较准确 - 蓝色 */
.feedback-btn[data-rating="4"] {
    background: #e3f2fd;
    border-color: #2196f3;
    color: #1565c0;
}

/* 一般 - 黄色 */
.feedback-btn[data-rating="3"] {
    background: #fff8e1;
    border-color: #ffc107;
    color: #f57f17;
}

/* 不太准确 - 橙色 */
.feedback-btn[data-rating="2"] {
    background: #fff3e0;
    border-color: #ff9800;
    color: #ef6c00;
}

/* 不准确 - 红色 */
.feedback-btn[data-rating="1"] {
    background: #ffebee;
    border-color: #f44336;
    color: #c62828;
}

.feedback-btn:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* 非常准确悬停效果 */
.feedback-btn[data-rating="5"]:hover {
    background: #4caf50;
    color: white;
}

/* 比较准确悬停效果 */
.feedback-btn[data-rating="4"]:hover {
    background: #2196f3;
    color: white;
}

/* 一般悬停效果 */
.feedback-btn[data-rating="3"]:hover {
    background: #ffc107;
    color: white;
}

/* 不太准确悬停效果 */
.feedback-btn[data-rating="2"]:hover {
    background: #ff9800;
    color: white;
}

/* 不准确悬停效果 */
.feedback-btn[data-rating="1"]:hover {
    background: #f44336;
    color: white;
}

.skip-feedback-btn {
    background: #f1f3f5;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 10px 20px;
    font-size: 14px;
    cursor: pointer;
    color: #6c757d;
    transition: all 0.3s ease;
}

.skip-feedback-btn:hover {
    background: #e9ecef;
    color: #495057;
}

/* 选择窗口样式 */
.choice-window {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.choice-window.show {
    opacity: 1;
    visibility: visible;
}

.choice-window-content {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    border-radius: 15px;
    padding: 30px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.choice-window.show .choice-window-content {
    transform: translateY(0);
}

.choice-window-content h3 {
    color: white;
    margin-bottom: 20px;
    font-size: 22px;
    font-weight: 600;
}

.choice-options {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.choice-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 12px 20px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.choice-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(102, 126, 234, 0.3);
}

.choice-btn:nth-child(2) {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.choice-btn:nth-child(2):hover {
    box-shadow: 0 8px 15px rgba(79, 172, 254, 0.3);
}

.choice-btn:nth-child(3) {
    background: linear-gradient(135deg, #ff6b6b 0%, #ffa8a8 100%);
}

.choice-btn:nth-child(3):hover {
    box-shadow: 0 8px 15px rgba(255, 107, 107, 0.3);
}

/* 选择按钮禁用态：暗色、不可点击、无悬浮效果 */
.choice-btn.disabled,
.choice-btn[disabled] {
    background: linear-gradient(135deg, #555 0%, #777 100%);
    color: #ddd;
    cursor: not-allowed;
    opacity: 0.6;
    pointer-events: none;
}
.choice-btn.disabled:hover,
.choice-btn[disabled]:hover {
    transform: none;
    box-shadow: none;
}

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

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

/* 加载动画 */
.loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.loading-content {
    text-align: center;
}

.lotus-flower {
    position: relative;
    width: 80px;
    height: 80px;
    margin: 0 auto 2rem;
    animation: lotusRotate 3s linear infinite;
}

.lotus-petal {
    position: absolute;
    width: 40px;
    height: 20px;
    background: #4a6b88;
    border-radius: 50%;
    transform-origin: 50% 100%;
}

.lotus-petal:nth-child(1) { transform: rotate(0deg); }
.lotus-petal:nth-child(2) { transform: rotate(45deg); }
.lotus-petal:nth-child(3) { transform: rotate(90deg); }
.lotus-petal:nth-child(4) { transform: rotate(135deg); }
.lotus-petal:nth-child(5) { transform: rotate(180deg); }
.lotus-petal:nth-child(6) { transform: rotate(225deg); }
.lotus-petal:nth-child(7) { transform: rotate(270deg); }
.lotus-petal:nth-child(8) { transform: rotate(315deg); }

.loading-text {
    color: #e0e0e0;
    font-size: 1.2rem;
}

/* 底部样式 */
.footer {
    text-align: center;
    padding: 2rem;
    color: #888;
    font-size: 0.9rem;
}

/* 结构化命理数据样式 */
.relationship-section {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 1rem;
    animation: fadeIn 0.5s ease-out;
}

.relationship-section h4 {
    color: #4a6b88;
    margin-bottom: 0.8rem;
    font-size: 1.1rem;
    border-bottom: 1px solid rgba(74, 107, 136, 0.3);
    padding-bottom: 0.5rem;
}

.relationship-section p {
    margin-bottom: 0.5rem;
    line-height: 1.5;
    color: #d0d0d0;
}

.relationship-section strong {
    color: #f8f8f8;
    font-weight: bold;
}

.relationship-section p:last-child {
    margin-bottom: 0;
}

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

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

/* 动画定义 */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

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

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

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

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

/* 响应式设计 */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
    
    .title {
        font-size: 2.5rem;
        letter-spacing: 0.3rem;
    }
    
    .form-container {
        padding: 1.5rem;
    }
    
    .result-grid {
        grid-template-columns: 1fr;
    }
    
    .result-title {
        font-size: 2rem;
    }
}

@media (max-width: 480px) {
    .title {
        font-size: 2rem;
        letter-spacing: 0.2rem;
    }
    
    .form-container {
        padding: 1rem;
    }
    
    .submit-btn {
        padding: 0.8rem 1.5rem;
        font-size: 1.1rem;
    }
}

/* 移动端性能优化：弱化或关闭背景墨滴动画，避免过度重绘 */
@media (max-width: 480px) {
  .ink-background { opacity: 0.15; }
  .ink-drop { display: none; }
  /* 细微旋转动效在窄屏禁用，提升滚动与交互流畅度 */
  .spin-slow { animation: none !important; }
}

/* 管理员按钮样式 */
.admin-btn-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1000;
    display: flex;
    gap: 12px;
}

.admin-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: linear-gradient(135deg, #4a6b88 0%, #2d4a6b 100%);
    border: none;
    border-radius: 25px;
    color: white;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(74, 107, 136, 0.3);
}

.admin-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(74, 107, 136, 0.4);
}

.admin-btn i {
    font-size: 16px;
}

/* 联系我们按钮（配色稍有区分） */
.contact-btn {
    background: linear-gradient(135deg, #4a6b88 0%, #2d4a6b 100%);
}

/* 响应式调整 */
@media (max-width: 768px) {
    .admin-btn-container {
        bottom: 20px;
        right: 20px;
        gap: 10px;
    }
    
    .admin-btn {
        padding: 10px 16px;
        font-size: 12px;
    }
}

/* 联系我们模态框样式 */
.contact-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1001;
    animation: fadeIn 0.3s ease;
}

.contact-modal.hidden {
    display: none;
}

.contact-modal-content {
    background: rgba(255, 255, 255, 0.07);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    padding: 24px;
    max-width: 520px;
    width: 92%;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
    position: relative;
    animation: slideUp 0.3s ease;
    color: #e0e0e0;
}

.contact-modal-content h3 {
    color: #f8f8f8;
}

.contact-close {
    position: absolute;
    right: 12px;
    top: 12px;
    background: transparent;
    border: none;
    font-size: 22px;
    color: #e0e0e0;
    cursor: pointer;
}

.contact-text {
    color: #d0d0d0;
    margin: 10px 0 16px 0;
}

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

.contact-qr img {
    width: 260px;
    max-width: 80%;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.qr-fallback {
    color: #dc3545;
    background: #fff3f3;
    border: 1px solid #f5c2c7;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 14px;
}

/* 主页进入提示模态框 */
.intro-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1002;
    animation: fadeIn 0.3s ease;
}

.intro-modal.hidden { display: none; }

.intro-modal-content {
    background: rgba(255, 255, 255, 0.07);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    padding: 24px;
    max-width: 560px;
    width: 92%;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
    position: relative;
    animation: slideUp 0.3s ease;
    color: #e0e0e0;
}

.intro-close {
    position: absolute;
    right: 12px;
    top: 12px;
    background: transparent;
    border: none;
    font-size: 22px;
    color: #e0e0e0;
    cursor: pointer;
}

.intro-text { color: #d0d0d0; margin: 10px 0 16px; }

.intro-actions { margin-top: 8px; }
.intro-ok {
    background: linear-gradient(135deg, #4a6b88 0%, #2d4a6b 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 10px 18px;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(74, 107, 136, 0.3);
}
.intro-ok:hover { transform: translateY(-1px); }

/* 希腊字母命理代码动画展示 */
.greek-code-section {
    margin-top: 18px;
}

.greek-code-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    align-items: stretch;
}

.greek-item {
    position: relative;
    background: linear-gradient(135deg, #4a6b88 0%, #2d4a6b 100%);
    color: #fff;
    border-radius: 12px;
    padding: 16px 14px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(74, 107, 136, 0.35);
    transform: translateY(18px);
    opacity: 0;
    transition: transform 600ms ease, opacity 600ms ease;
}

.greek-item.visible {
    transform: translateY(0);
    opacity: 1;
}

.greek-symbol {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: 2px;
}

.greek-badge {
    position: absolute;
    right: 12px;
    bottom: 12px;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.9), rgba(255,255,255,0.35));
    color: #2d4a6b;
    font-weight: 700;
    box-shadow: 0 6px 18px rgba(255,255,255,0.35);
    animation: pulseBadge 1.8s ease-in-out infinite;
}

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

.greek-item::after {
    content: "";
    position: absolute;
    left: -20%;
    top: -50%;
    width: 60%;
    height: 200%;
    background: linear-gradient(135deg, rgba(255,255,255,0.2), rgba(255,255,255,0));
    transform: rotate(25deg);
    filter: blur(12px);
    pointer-events: none;
}

.greek-final {
    margin-top: 18px;
    display: flex;
    align-items: center;
    gap: 14px;
}

.final-symbol {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #4a6b88 0%, #2d4a6b 100%);
    color: #fff;
    font-size: 24px;
    font-weight: 800;
    box-shadow: 0 8px 24px rgba(74, 107, 136, 0.35);
    animation: flipIn 800ms ease;
}

.final-code-animated {
    font-size: 22px;
    font-weight: 700;
    color: #2d4a6b;
    letter-spacing: 2px;
}

@keyframes flipIn {
    0% { transform: rotateX(90deg); opacity: 0; }
    100% { transform: rotateX(0deg); opacity: 1; }
}

@media (max-width: 768px) {
    .greek-code-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
    }
    .greek-item {
        padding: 14px 12px;
        border-radius: 10px;
    }
    .greek-symbol {
        font-size: 24px;
    }
}

/* 更窄屏幕优化 */
@media (max-width: 480px) {
    .greek-code-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }
    .greek-item {
        padding: 12px 10px;
        border-radius: 10px;
    }
    .greek-symbol {
        font-size: 22px;
    }
}

@media (max-width: 380px) {
    .greek-code-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }
    .greek-item {
        padding: 10px 8px;
        border-radius: 9px;
    }
    .greek-symbol {
        font-size: 20px;
    }
}

/* 超小屏优化：宽度 < 320px 时改为每行 2 个卡片，增大可读性 */
@media (max-width: 320px) {
    .greek-code-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    .greek-item {
        padding: 10px 8px;
        border-radius: 9px;
    }
.greek-symbol {
    font-size: 18px;
}
}

/* 阴阳小八卦图标与动画 */
.yin-yang-small {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    position: relative;
    background: conic-gradient(from 0deg, #000 0deg 180deg, #fff 180deg 360deg);
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}
/* 兼容旧浏览器：不支持 conic-gradient 时使用线性渐变作为退化显示 */
@supports not (background: conic-gradient(from 0deg, #000 0deg 180deg, #fff 180deg 360deg)) {
    .yin-yang-small {
        background: linear-gradient(90deg, #000 50%, #fff 50%);
    }
}
.yin-yang-small::before,
.yin-yang-small::after {
    content: '';
    position: absolute;
    width: 14px;
    height: 14px;
    border-radius: 50%;
}
.yin-yang-small::before {
    background: #fff;
    top: 0;
    left: 7px;
}
.yin-yang-small::after {
    background: #000;
    bottom: 0;
    right: 7px;
}

/* 细微旋转动效，避免干扰阅读 */
.spin-slow {
    animation: yinYangSpin 12s linear infinite;
}
@keyframes yinYangSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* 用户偏好减少动效时关闭旋转 */
@media (prefers-reduced-motion: reduce) {
    .spin-slow {
        animation: none !important;
    }
}

/* 阴阳图标的尺寸变体（如需在不同页面使用） */
.yin-yang-medium { width: 40px; height: 40px; }
.yin-yang-large { width: 56px; height: 56px; }

/* 全站小优化：容器与结果区的响应式细节 */
.container {
    max-width: 960px; /* 桌面更舒适的阅读宽度 */
    padding-inline: clamp(12px, 4vw, 24px);
}
.result-container {
    padding: clamp(16px, 4vw, 32px);
}

/* 小屏进一步优化：按钮尺寸与管理员按钮布局 */
@media (max-width: 480px) {
    .admin-btn-container {
        bottom: 12px;
        right: 12px;
        flex-direction: column;
        gap: 8px;
    }
    .admin-btn {
        padding: 8px 12px;
        font-size: 12px;
        border-radius: 20px;
    }
    .continue-prediction-btn,
    .new-prediction-btn,
    .back-home-btn {
        padding: 10px 14px;
        font-size: 14px;
        min-width: 120px;
    }
}

/* 用户偏好减少动效：全面关闭关键动画与过渡，避免眩晕与性能抖动 */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    .ink-drop,
    .lotus-flower,
    .title-char,
    .yin-yang-symbol,
    .yin-yang-small,
    .greek-badge,
    .final-symbol {
        animation: none !important;
    }
    .submit-btn,
    .admin-btn,
    .choice-window-content,
    .feedback-modal-content,
    .contact-modal-content,
    .intro-modal-content {
        transition: none !important;
    }
}

/* —— 结果页信息栅格与关系段落优化 —— */
.basic-info { margin-bottom: 16px; }

.info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(140px, 1fr));
  gap: 12px 16px;
  align-items: start;
}

.info-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.info-label { color: #6b7280; }
.info-value { color: #111827; }

.relationship-overview,
.relationship-details,
.timeline-text { color: #1f2937; }
.relationship-overview { margin-bottom: 12px; }
.relationship-details,
.timeline-text { margin-top: 10px; }

/* 小屏断点优化 */
@media (max-width: 480px) {
  .info-grid { grid-template-columns: 1fr; gap: 10px 12px; }
  .info-item { gap: 6px; }
  .relationship-overview,
  .relationship-details,
  .timeline-text { font-size: 0.98rem; line-height: 1.7; }
}
@media (max-width: 380px) {
  .info-grid { grid-template-columns: 1fr; gap: 8px 10px; }
  .relationship-overview,
  .relationship-details,
  .timeline-text { font-size: 0.94rem; line-height: 1.68; }
}
@media (max-width: 320px) {
  .info-grid { grid-template-columns: 1fr; gap: 6px 8px; }
  .relationship-overview,
  .relationship-details,
.timeline-text { font-size: 0.92rem; line-height: 1.66; }
}

.submit-btn,
.admin-btn,
.choice-btn,
.feedback-btn,
.back-home-btn,
.new-prediction-btn,
.continue-prediction-btn {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}