/**
 * 观元易知 - 四柱八字算命游戏样式
 * 文件位置: /front/assets/css/divination-game.css
 * 主题色: #00cc00 (绿色) + 传统中国红金配色
 */

/* ===== 触发按钮 ===== */
.divination-trigger {
    position: fixed;
    bottom: 100px;
    right: 20px;
    z-index: 999;
    cursor: pointer;
    animation: float 3s ease-in-out infinite;
}

.trigger-inner {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #00cc00 0%, #009900 100%);
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0, 204, 0, 0.4);
    position: relative;
    overflow: hidden;
    transition: transform 0.3s;
}

.divination-trigger:hover .trigger-inner {
    transform: scale(1.1);
}

.trigger-icon {
    font-size: 24px;
    color: #fff;
    line-height: 1;
}

.trigger-text {
    font-size: 10px;
    color: #fff;
    margin-top: 2px;
    font-weight: bold;
}

.trigger-glow {
    position: absolute;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255,255,255,0.3) 0%, transparent 70%);
    animation: pulse 2s ease-in-out infinite;
}

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

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

/* ===== 模态框 ===== */
.divination-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    align-items: center;
    justify-content: center;
}

.divination-modal.active {
    display: flex;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
}

.modal-content {
    position: relative;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    background: linear-gradient(180deg, #1a1a2e 0%, #16213e 100%);
    border: 1px solid rgba(0, 204, 0, 0.3);
    border-radius: 20px;
    overflow-y: auto;
    overflow-x: hidden;
    animation: modalIn 0.4s ease-out;
    box-shadow: 0 0 40px rgba(0, 204, 0, 0.2);
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.9) translateY(20px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    z-index: 10;
    transition: background 0.3s;
}

.modal-close:hover {
    background: rgba(255, 0, 0, 0.5);
}

.modal-header {
    text-align: center;
    padding: 30px 20px 20px;
    border-bottom: 1px solid rgba(0, 204, 0, 0.2);
}

.modal-header h2 {
    color: #00cc00;
    font-size: 24px;
    margin: 0 0 10px;
    text-shadow: 0 0 10px rgba(0, 204, 0, 0.5);
}

.modal-header p {
    color: #aaa;
    margin: 0;
    font-size: 14px;
}

/* ===== 今日万年历信息 ===== */
.today-calendar-info {
    text-align: center;
    padding: 8px 15px;
    margin: 10px auto 0;
    color: #00cc00;
    font-size: 13px;
    background: rgba(0, 204, 0, 0.1);
    border: 1px solid rgba(0, 204, 0, 0.3);
    border-radius: 8px;
    max-width: 90%;
}

.loading-dots {
    color: #888;
    font-size: 12px;
}

.loading-dots::after {
    content: '...';
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
    0%, 20% { content: ''; }
    40% { content: '.'; }
    60% { content: '..'; }
    80%, 100% { content: '...'; }
}

/* ===== 步骤控制 ===== */
.divination-step {
    display: none;
    padding: 30px;
    animation: stepIn 0.4s ease-out;
}

.divination-step.active {
    display: block;
}

@keyframes stepIn {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

/* ===== 表单样式 ===== */
.birth-input-form {
    max-width: 400px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    color: #00cc00;
    font-size: 14px;
    margin-bottom: 8px;
    font-weight: bold;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px 15px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(0, 204, 0, 0.3);
    border-radius: 10px;
    color: #fff;
    font-size: 16px;
    outline: none;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus {
    border-color: #00cc00;
    box-shadow: 0 0 10px rgba(0, 204, 0, 0.2);
}

.gender-group {
    margin-bottom: 30px;
}

.gender-options {
    display: flex;
    gap: 15px;
}

.gender-option {
    flex: 1;
    cursor: pointer;
}

.gender-option input {
    display: none;
}

.gender-option span {
    display: block;
    padding: 12px;
    text-align: center;
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(0, 204, 0, 0.3);
    border-radius: 10px;
    color: #aaa;
    transition: all 0.3s;
}

.gender-option input:checked + span {
    border-color: #00cc00;
    background: rgba(0, 204, 0, 0.1);
    color: #00cc00;
}

.btn-start-divination {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #00cc00 0%, #009900 100%);
    border: none;
    border-radius: 10px;
    color: #fff;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
}

.btn-start-divination:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0, 204, 0, 0.4);
}

.btn-shine {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: shine 3s infinite;
}

@keyframes shine {
    0% { left: -100%; }
    100% { left: 200%; }
}

/* ===== 排盘动画 ===== */
.divination-loading {
    text-align: center;
    padding: 40px 20px;
}

.bazi-pan {
    width: 200px;
    height: 200px;
    margin: 0 auto 30px;
    position: relative;
    animation: rotate 20s linear infinite;
}

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

.pan-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #00cc00, #009900);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: bold;
    font-size: 18px;
    z-index: 3;
    box-shadow: 0 0 20px rgba(0, 204, 0, 0.5);
}

.ganzhi-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    animation: counterRotate 20s linear infinite;
}

.dizhi-ring {
    position: absolute;
    width: 140%;
    height: 140%;
    top: -20%;
    left: -20%;
    animation: counterRotate 25s linear infinite reverse;
}

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

.gz-item, .dz-item {
    position: absolute;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    border-radius: 50%;
}

.gz-item {
    background: rgba(0, 204, 0, 0.2);
    color: #00cc00;
    font-size: 14px;
    left: calc(50% + 70px * cos(var(--i) * 36deg) - 15px);
    top: calc(50% + 70px * sin(var(--i) * 36deg) - 15px);
}

.dz-item {
    background: rgba(255, 165, 0, 0.2);
    color: #ffa500;
    font-size: 12px;
    left: calc(50% + 100px * cos(var(--i) * 30deg) - 15px);
    top: calc(50% + 100px * sin(var(--i) * 30deg) - 15px);
}

.loading-text {
    color: #00cc00;
    font-size: 18px;
    margin-bottom: 20px;
    animation: blink 1.5s ease-in-out infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.loading-progress {
    width: 80%;
    max-width: 300px;
    height: 4px;
    background: rgba(0, 204, 0, 0.2);
    border-radius: 2px;
    margin: 0 auto;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #00cc00, #00ff00);
    border-radius: 2px;
    animation: progress 3s ease-out forwards;
}

@keyframes progress {
    0% { width: 0%; }
    100% { width: 100%; }
}

/* ===== 命盘结果 ===== */
.bazi-result {
    padding: 20px 0;
}

.bazi-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 25px;
}

.bazi-card {
    background: linear-gradient(180deg, rgba(0,204,0,0.1) 0%, rgba(0,0,0,0.3) 100%);
    border: 1px solid rgba(0, 204, 0, 0.3);
    border-radius: 12px;
    padding: 15px 10px;
    text-align: center;
    transition: transform 0.3s, box-shadow 0.3s;
    animation: cardAppear 0.5s ease-out backwards;
}

.bazi-card:nth-child(1) { animation-delay: 0.1s; }
.bazi-card:nth-child(2) { animation-delay: 0.2s; }
.bazi-card:nth-child(3) { animation-delay: 0.3s; }
.bazi-card:nth-child(4) { animation-delay: 0.4s; }

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

.bazi-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0, 204, 0, 0.3);
}

.pillar-label {
    color: #aaa;
    font-size: 12px;
    margin-bottom: 8px;
}

.pillar-gan {
    font-size: 28px;
    font-weight: bold;
    color: #00cc00;
    margin-bottom: 5px;
    text-shadow: 0 0 10px rgba(0, 204, 0, 0.3);
}

.pillar-zhi {
    font-size: 24px;
    font-weight: bold;
    color: #ffa500;
    margin-bottom: 5px;
}

.pillar-wuxing {
    font-size: 11px;
    color: #888;
    padding: 2px 8px;
    background: rgba(0,0,0,0.3);
    border-radius: 10px;
    display: inline-block;
}

/* 五行颜色 */
.wuxing-jin { color: #ffd700 !important; }
.wuxing-mu { color: #00cc00 !important; }
.wuxing-shui { color: #00bfff !important; }
.wuxing-huo { color: #ff4444 !important; }
.wuxing-tu { color: #daa520 !important; }

/* ===== 农历信息 ===== */
.lunar-info-display {
    text-align: center;
    padding: 10px;
    margin: 0 20px 15px;
    color: #ffa500;
    font-size: 13px;
    background: rgba(255,165,0,0.1);
    border-radius: 8px;
    animation: fadeIn 0.5s ease-out;
}

/* ===== 高级命理区域 ===== */
.advance-section {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid rgba(0, 204, 0, 0.2);
    animation: fadeIn 0.5s ease-out;
}

.advance-section h4 {
    color: #00cc00;
    margin: 0 0 15px;
    font-size: 16px;
    border-bottom: 1px solid rgba(0, 204, 0, 0.3);
    padding-bottom: 10px;
}

/* 纳音 */
.sounds-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.sound-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 12px;
    background: rgba(0, 204, 0, 0.1);
    border-radius: 8px;
    font-size: 13px;
}

.pillar-name {
    color: #aaa;
}

.sound-value {
    color: #ffa500;
    font-weight: bold;
}

/* 空亡 */
.kong-wang-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.kw-item {
    text-align: center;
    padding: 8px;
    color: #ff4444;
    background: rgba(255, 68, 68, 0.1);
    border-radius: 8px;
    font-size: 13px;
}

/* 神煞 */
.gods-content {
    line-height: 1.8;
    font-size: 13px;
}

.god-group {
    margin-bottom: 10px;
    padding: 10px;
    border-radius: 8px;
}

.god-group.good {
    background: rgba(0, 204, 0, 0.1);
    color: #00cc00;
}

.god-group.bad {
    background: rgba(255, 68, 68, 0.1);
    color: #ff4444;
}

/* 大运/流年 */
.decade-list, .fortune-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 13px;
}

.decade-item, .fortune-item {
    display: grid;
    grid-template-columns: 1fr 1fr 1.5fr 1fr;
    gap: 10px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    align-items: center;
}

.decade-ganzhi, .fortune-ganzhi {
    color: #00cc00;
    font-weight: bold;
}

.decade-age, .fortune-age {
    color: #ffa500;
}

.decade-year, .fortune-year {
    color: #aaa;
    font-size: 12px;
}

.decade-ten, .fortune-ten {
    color: #888;
    font-size: 12px;
}

/* 童限 */
.child-limit-info {
    text-align: center;
    color: #ddd;
    font-size: 13px;
}

.child-limit-info strong {
    color: #00cc00;
}

/* ===== 五行分析 ===== */
.wuxing-analysis {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 25px;
}

.wuxing-analysis h4 {
    color: #00cc00;
    margin: 0 0 15px;
    text-align: center;
}

.wuxing-bars {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.wuxing-bar-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.wuxing-bar-label {
    width: 40px;
    text-align: center;
    font-weight: bold;
    font-size: 14px;
}

.wuxing-bar-track {
    flex: 1;
    height: 20px;
    background: rgba(0,0,0,0.3);
    border-radius: 10px;
    overflow: hidden;
}

.wuxing-bar-fill {
    height: 100%;
    border-radius: 10px;
    transition: width 1s ease-out;
    position: relative;
}

.wuxing-bar-value {
    width: 30px;
    text-align: right;
    color: #aaa;
    font-size: 12px;
}

/* ===== AI解读 ===== */
.ai-reading {
    background: linear-gradient(180deg, rgba(0,204,0,0.05) 0%, rgba(0,0,0,0.2) 100%);
    border: 1px solid rgba(0, 204, 0, 0.2);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 25px;
}

.reading-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    color: #00cc00;
    font-weight: bold;
}

.reading-icon {
    font-size: 20px;
    animation: robotBounce 1s ease-in-out infinite;
}

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

.reading-content {
    color: #ddd;
    line-height: 1.8;
    font-size: 14px;
}

.reading-content p {
    margin: 0 0 10px;
}

.reading-loading {
    display: flex;
    gap: 5px;
    justify-content: center;
    padding: 20px;
}

.reading-loading span {
    width: 10px;
    height: 10px;
    background: #00cc00;
    border-radius: 50%;
    animation: bounce 1.4s ease-in-out infinite both;
}

.reading-loading span:nth-child(1) { animation-delay: -0.32s; }
.reading-loading span:nth-child(2) { animation-delay: -0.16s; }

@keyframes bounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

/* ===== 运势评分 ===== */
.fortune-score {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 25px;
}

.score-item {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    padding: 15px;
    text-align: center;
}

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

.score-ring {
    position: relative;
    width: 80px;
    height: 80px;
    margin: 0 auto;
}

.score-ring svg {
    transform: rotate(-90deg);
    width: 100%;
    height: 100%;
}

.score-bg {
    fill: none;
    stroke: rgba(255,255,255,0.1);
    stroke-width: 8;
}

.score-progress {
    fill: none;
    stroke: #00cc00;
    stroke-width: 8;
    stroke-linecap: round;
    stroke-dasharray: 283;
    stroke-dashoffset: 283;
    transition: stroke-dashoffset 1.5s ease-out;
}

.score-value {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #00cc00;
    font-size: 20px;
    font-weight: bold;
}

/* ===== 操作按钮 ===== */
.result-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-bottom: 20px;
}

.result-actions button {
    padding: 12px 25px;
    border: none;
    border-radius: 25px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: bold;
}

.btn-share {
    background: linear-gradient(135deg, #00cc00, #009900);
    color: #fff;
}

.btn-share:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 204, 0, 0.3);
}

.btn-retry {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-retry:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ===== 历史记录 ===== */
.history-section {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.history-section h4 {
    color: #00cc00;
    margin: 0 0 15px;
    font-size: 16px;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 13px;
}

.history-item {
    display: flex;
    justify-content: space-between;
    padding: 10px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s;
}

.history-item:hover {
    background: rgba(0, 204, 0, 0.1);
}

.history-date {
    color: #888;
}

.history-bazi {
    color: #ffa500;
}

.history-summary {
    color: #aaa;
}

/* ===== 免责声明 ===== */
.disclaimer {
    color: #888;
    font-size: 12px;
    text-align: center;
    margin-top: 15px;
    padding: 10px;
}

/* ===== 分享弹窗 ===== */
.share-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    z-index: 10001;
    align-items: center;
    justify-content: center;
}

.share-modal.active {
    display: flex;
}

.share-content {
    background: linear-gradient(180deg, #1a1a2e 0%, #16213e 100%);
    border: 1px solid rgba(0, 204, 0, 0.3);
    border-radius: 15px;
    padding: 30px;
    max-width: 400px;
    width: 90%;
    text-align: center;
}

.share-content h3 {
    color: #00cc00;
    margin: 0 0 20px;
}

.share-preview {
    background: rgba(0,0,0,0.3);
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 20px;
    color: #ddd;
    font-size: 14px;
    line-height: 1.6;
    text-align: left;
    max-height: 200px;
    overflow-y: auto;
}

.share-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.share-buttons button {
    padding: 10px 20px;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.share-buttons button:first-child {
    background: #00cc00;
    color: #fff;
}

.share-buttons button:last-child {
    background: rgba(255,255,255,0.1);
    color: #fff;
}

/* ===== 响应式 ===== */
@media (max-width: 768px) {
    .bazi-cards {
        grid-template-columns: repeat(2, 1fr);
    }

    .fortune-score {
        grid-template-columns: repeat(2, 1fr);
    }

    .divination-trigger {
        bottom: 80px;
        right: 15px;
    }

    .trigger-inner {
        width: 50px;
        height: 50px;
    }

    .trigger-icon {
        font-size: 20px;
    }

    .trigger-text {
        font-size: 9px;
    }

    .modal-content {
        width: 95%;
        max-height: 85vh;
    }

    .divination-step {
        padding: 20px 15px;
    }

    .decade-item, .fortune-item {
        grid-template-columns: 1fr 1fr;
        gap: 5px;
    }

    .decade-year, .fortune-year {
        grid-column: 1 / -1;
    }
}