/* 主页神秘样式 */
.mystical-index-container {
    background: linear-gradient(135deg, #0a0e27 0%, #1a1a2e 50%, #2e1a3e 100%);
    min-height: 100vh;
    position: relative;
    padding-bottom: 40px;
}

/* 防止页面过度滚动 */
html, body {
    overflow-x: hidden;
    max-width: 100%;
}

/* 星空背景 */
.stars-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.star-point {
    position: absolute;
    background: white;
    border-radius: 50%;
    animation: starTwinkle 3s infinite;
}

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

/* 神秘装饰符号 */
.mystical-decorations {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.mystical-decorations .decoration {
    position: absolute;
    font-size: 80px;
    color: rgba(255, 215, 0, 0.15);
    animation: decorationFloat 15s infinite ease-in-out;
}

.decoration.top-left {
    top: 50px;
    left: 50px;
    animation-delay: 0s;
}

.decoration.top-right {
    top: 50px;
    right: 50px;
    animation-delay: 2s;
}

.decoration.bottom-left {
    bottom: 50px;
    left: 50px;
    animation-delay: 4s;
}

.decoration.bottom-right {
    bottom: 50px;
    right: 50px;
    animation-delay: 6s;
}

@keyframes decorationFloat {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
        opacity: 0.15;
    }
    50% {
        transform: translateY(-20px) rotate(180deg);
        opacity: 0.3;
    }
}

/* 神秘头部 */
.mystical-header {
    padding: 40px 20px;
    text-align: center;
    position: relative;
    z-index: 10;
}

.header-decoration {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.decoration-line {
    width: 80px;
    height: 2px;
    background: linear-gradient(90deg, transparent, #FFD700, transparent);
    margin: 0 20px;
}

.header-icon {
    font-size: 50px;
    animation: iconPulse 2s ease-in-out infinite;
    filter: drop-shadow(0 0 20px rgba(255, 215, 0, 0.8));
}

@keyframes iconPulse {
    0%, 100% {
        transform: scale(1) rotate(0deg);
    }
    50% {
        transform: scale(1.1) rotate(5deg);
    }
}

.mystical-header h1 {
    color: #FFD700;
    font-size: 42px;
    margin: 0 0 15px 0;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.6),
                 0 0 40px rgba(255, 215, 0, 0.4),
                 0 0 60px rgba(255, 215, 0, 0.2);
    letter-spacing: 3px;
}

.header-subtitle {
    color: #B0C4DE;
    font-size: 16px;
    margin: 0 0 25px 0;
    opacity: 0.9;
    letter-spacing: 1px;
}

.mystical-header .logout-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 215, 0, 0.3);
    color: #FFD700;
    padding: 10px 25px;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 14px;
    backdrop-filter: blur(10px);
}

.mystical-header .logout-btn:hover {
    background: rgba(255, 215, 0, 0.2);
    border-color: #FFD700;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 215, 0, 0.3);
}

.mystical-header .login-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 215, 0, 0.3);
    color: #FFD700;
    padding: 10px 25px;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 14px;
    backdrop-filter: blur(10px);
}

.mystical-header .login-btn:hover {
    background: rgba(255, 215, 0, 0.2);
    border-color: #FFD700;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 215, 0, 0.3);
}

/* 神秘服务列表 */
.mystical-service-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 10;
}

/* 防止所有子元素被拖拽 */
.mystical-service-list *,
.mystical-service-item * {
    user-select: none;
    -webkit-user-drag: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.mystical-service-item {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    border: 3px solid;
    border-color: var(--service-color);
    border-radius: 20px;
    padding: 30px;
    cursor: pointer;
    transition: all 0.4s;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    gap: 20px;
    user-select: none;
    -webkit-user-drag: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* 不同功能的边框样式 */
.mystical-service-item[data-border="tarot"] {
    border-style: double;
    box-shadow: 0 0 20px var(--service-color)44,
                inset 0 0 20px var(--service-color)11;
}

.mystical-service-item[data-border="bazi"] {
    border-style: solid;
    border-image: linear-gradient(135deg, var(--service-color), transparent, var(--service-color)) 1;
    box-shadow: 0 0 15px var(--service-color)55;
}

.mystical-service-item[data-border="constellation"] {
    border-style: dashed;
    border-width: 2px;
    box-shadow: 0 0 25px var(--service-color)66,
                0 0 40px var(--service-color)33;
}

.mystical-service-item[data-border="name"] {
    border-style: solid;
    border-image: repeating-linear-gradient(
        45deg,
        var(--service-color),
        var(--service-color) 10px,
        transparent 10px,
        transparent 20px
    ) 1;
    box-shadow: 0 0 18px var(--service-color)55;
}

/* 边框装饰元素 */
.border-decoration {
    position: absolute;
    font-size: 18px;
    color: var(--service-color);
    opacity: 0.7;
    text-shadow: 0 0 10px var(--service-color);
    animation: borderSymbolFloat 3s ease-in-out infinite;
    pointer-events: none;
    z-index: 3;
    user-select: none;
    -webkit-user-drag: none;
}

.corner-top-left {
    top: 10px;
    left: 10px;
    animation-delay: 0s;
}

.corner-top-right {
    top: 10px;
    right: 10px;
    animation-delay: 0.5s;
}

.corner-bottom-left {
    bottom: 10px;
    left: 10px;
    animation-delay: 1s;
}

.corner-bottom-right {
    bottom: 10px;
    right: 10px;
    animation-delay: 1.5s;
}

@keyframes borderSymbolFloat {
    0%, 100% {
        transform: scale(1) rotate(0deg);
        opacity: 0.7;
    }
    50% {
        transform: scale(1.2) rotate(180deg);
        opacity: 1;
    }
}

/* 发光背景 */
.service-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 150%;
    height: 150%;
    opacity: 0;
    transition: opacity 0.4s;
    pointer-events: none;
}

.mystical-service-item:hover .service-glow {
    opacity: 1;
    animation: glowPulse 2s ease-in-out infinite;
}

@keyframes glowPulse {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.3;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.1);
        opacity: 0.5;
    }
}

/* 服务图标包装 */
.service-icon-wrapper {
    position: relative;
    flex-shrink: 0;
    user-select: none;
    -webkit-user-drag: none;
    pointer-events: none;
}

.service-icon {
    font-size: 50px;
    filter: drop-shadow(0 0 15px rgba(255, 215, 0, 0.6));
    transition: transform 0.3s;
    position: relative;
    z-index: 2;
    user-select: none;
    -webkit-user-drag: none;
}

.service-symbol {
    position: absolute;
    top: -10px;
    right: -10px;
    font-size: 20px;
    color: rgba(255, 215, 0, 0.8);
    animation: symbolRotate 3s linear infinite;
    z-index: 1;
}

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

.mystical-service-item:hover .service-icon {
    transform: scale(1.1) rotate(5deg);
}

/* 服务内容 */
.service-content {
    flex: 1;
    position: relative;
    z-index: 2;
}

/* 中文书法字体 */
.service-calligraphy {
    font-family: 'KaiTi', 'STKaiti', 'BiauKai', serif;
    font-size: 32px;
    font-weight: bold;
    margin: 0 0 8px 0;
    letter-spacing: 4px;
    text-shadow: 0 0 25px currentColor, 0 0 40px currentColor;
    opacity: 0.95;
    position: relative;
    display: block;
    line-height: 1.2;
}

/* 英文书法字体 */
.service-english {
    font-family: 'Brush Script MT', 'Lucida Handwriting', 'Apple Chancery', cursive;
    font-size: 20px;
    font-weight: normal;
    font-style: italic;
    margin: 0 0 12px 0;
    letter-spacing: 1px;
    text-shadow: 0 0 15px currentColor;
    opacity: 0.85;
    position: relative;
    display: block;
}

.service-english::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, currentColor, transparent);
    opacity: 0.5;
}

.service-content p {
    color: #B0C4DE;
    font-size: 14px;
    line-height: 1.6;
    margin: 0;
}

/* 元素Logo */
.service-element-logo {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    width: 80px;
    height: 80px;
    opacity: 0.3;
    transition: all 0.4s;
    z-index: 1;
    pointer-events: none;
    user-select: none;
    -webkit-user-drag: none;
}

.service-element-logo img {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.3));
    user-select: none;
    -webkit-user-drag: none;
    pointer-events: none;
    draggable: false;
}

.mystical-service-item:hover .service-element-logo {
    opacity: 0.6;
    transform: translateY(-50%) scale(1.1) rotate(10deg);
}

/* Hover效果 */
.mystical-service-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, var(--service-color)22, transparent);
    transition: left 0.5s;
    z-index: 1;
}

.mystical-service-item:hover::before {
    left: 100%;
}

.mystical-service-item:hover {
    transform: translateY(-10px) scale(1.02);
    border-color: var(--service-color);
    box-shadow: 0 15px 40px var(--service-color)66,
                0 0 60px var(--service-color)33 inset;
    background: rgba(255, 255, 255, 0.1);
}

.mystical-service-item:hover .border-decoration {
    opacity: 1;
    transform: scale(1.3);
    animation: borderSymbolFloat 2s ease-in-out infinite;
}

/* 不同边框的hover增强效果 */
.mystical-service-item[data-border="tarot"]:hover {
    box-shadow: 0 0 30px var(--service-color)77,
                inset 0 0 30px var(--service-color)22;
}

.mystical-service-item[data-border="bazi"]:hover {
    box-shadow: 0 0 25px var(--service-color)88,
                0 10px 40px var(--service-color)55;
}

.mystical-service-item[data-border="constellation"]:hover {
    box-shadow: 0 0 35px var(--service-color)99,
                0 0 50px var(--service-color)44;
    border-width: 3px;
}

.mystical-service-item[data-border="name"]:hover {
    box-shadow: 0 0 28px var(--service-color)88,
                0 12px 35px var(--service-color)55;
}

/* 加载效果 */
.mystical-service-list .loading {
    text-align: center;
    color: #FFD700;
    font-size: 18px;
    padding: 60px 20px;
}

.mystical-service-list .loading::before {
    content: '🔮';
    display: block;
    font-size: 60px;
    margin-bottom: 20px;
    animation: loadingPulse 1.5s ease-in-out infinite;
}

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

/* 响应式 */
@media (max-width: 768px) {
    .mystical-header h1 {
        font-size: 32px;
    }

    .header-icon {
        font-size: 40px;
    }

    .decoration-line {
        width: 50px;
    }

    .mystical-decorations .decoration {
        font-size: 50px;
    }

    .decoration.top-left,
    .decoration.top-right {
        top: 20px;
    }

    .decoration.top-left,
    .decoration.bottom-left {
        left: 20px;
    }

    .decoration.top-right,
    .decoration.bottom-right {
        right: 20px;
    }

    .mystical-service-list {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 10px;
    }

    .mystical-service-item {
        padding: 25px 20px;
        flex-direction: column;
        align-items: flex-start;
    }

    .service-icon-wrapper {
        margin-bottom: 10px;
    }

    .service-calligraphy {
        font-size: 26px;
        letter-spacing: 3px;
    }

    .service-english {
        font-size: 16px;
        margin-bottom: 10px;
    }

    .service-element-logo {
        right: 15px;
        width: 60px;
        height: 60px;
        opacity: 0.2;
    }

    .mystical-service-item:hover .service-element-logo {
        opacity: 0.4;
    }

    .border-decoration {
        font-size: 14px;
    }

    .corner-top-left,
    .corner-top-right {
        top: 8px;
    }

    .corner-bottom-left,
    .corner-bottom-right {
        bottom: 8px;
    }

    .corner-top-left,
    .corner-bottom-left {
        left: 8px;
    }

    .corner-top-right,
    .corner-bottom-right {
        right: 8px;
    }
}

/* 卡片进入动画 */
@keyframes cardFadeIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.mystical-service-item {
    animation: cardFadeIn 0.6s ease-out;
}

.mystical-service-item:nth-child(1) {
    animation-delay: 0.1s;
}

.mystical-service-item:nth-child(2) {
    animation-delay: 0.2s;
}

.mystical-service-item:nth-child(3) {
    animation-delay: 0.3s;
}

.mystical-service-item:nth-child(4) {
    animation-delay: 0.4s;
}

/* 头部按钮组 */
.header-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.history-btn {
    background: rgba(255, 215, 0, 0.2);
    border: 2px solid rgba(255, 215, 0, 0.5);
    color: #FFD700;
    padding: 10px 25px;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 14px;
    backdrop-filter: blur(10px);
}

.history-btn:hover {
    background: rgba(255, 215, 0, 0.3);
    border-color: #FFD700;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 215, 0, 0.3);
}

@media (max-width: 768px) {
    .header-actions {
        flex-direction: row;
    }
}

/* 免责声明样式 */
.disclaimer {
    margin-top: 20px;
    padding: 12px 20px;
    background: rgba(255, 193, 7, 0.15);
    border: 1px solid rgba(255, 193, 7, 0.3);
    border-radius: 25px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    backdrop-filter: blur(10px);
    animation: disclaimerPulse 3s ease-in-out infinite;
}

.disclaimer-icon {
    font-size: 18px;
    animation: disclaimerIconShake 2s ease-in-out infinite;
}

.disclaimer-text {
    color: #FFD700;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.5px;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}

@keyframes disclaimerPulse {
    0%, 100% {
        box-shadow: 0 0 10px rgba(255, 193, 7, 0.2);
    }
    50% {
        box-shadow: 0 0 20px rgba(255, 193, 7, 0.4);
    }
}

@keyframes disclaimerIconShake {
    0%, 100% {
        transform: rotate(0deg);
    }
    10%, 30% {
        transform: rotate(-5deg);
    }
    20%, 40% {
        transform: rotate(5deg);
    }
    50% {
        transform: rotate(0deg);
    }
}

@media (max-width: 768px) {
    .disclaimer {
        margin-top: 15px;
        padding: 10px 16px;
    }

    .disclaimer-icon {
        font-size: 16px;
    }

    .disclaimer-text {
        font-size: 13px;
    }
}

/* 神秘诗句横幅 */
.mystical-poem-banner {
    margin: 25px 0;
    padding: 20px;
    background: linear-gradient(135deg, 
        rgba(255, 215, 0, 0.08) 0%, 
        rgba(138, 116, 249, 0.08) 50%,
        rgba(255, 215, 0, 0.08) 100%);
    border-radius: 50px;
    border: 1px solid rgba(255, 215, 0, 0.2);
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(255, 215, 0, 0.1),
                inset 0 1px 0 rgba(255, 255, 255, 0.1);
    opacity: 0;
    transform: translateY(-10px);
    animation: bannerSlideIn 1s ease-out 0.8s forwards;
}

.poem-scroll {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    font-family: 'KaiTi', 'SimKai', serif;
    overflow: hidden;
}

.poem-text {
    display: inline-block;
    font-size: 18px;
    font-weight: 300;
    letter-spacing: 6px;
    color: rgba(255, 215, 0, 0.95);
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.4),
                 0 0 20px rgba(255, 215, 0, 0.2);
    opacity: 0;
    transform: translateX(-20px);
    animation: textSlideIn 1.2s ease-out forwards;
    position: relative;
}

.poem-text:nth-child(1) {
    animation-delay: 1.2s;
}

.poem-text:nth-child(3) {
    animation-delay: 1.6s;
    transform: translateX(20px);
}

.poem-text::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    width: 0;
    height: 1px;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(255, 215, 0, 0.6), 
        transparent);
    animation: underlineGrow 1.5s ease-out forwards;
    animation-delay: inherit;
}

.poem-separator {
    font-size: 20px;
    color: rgba(255, 215, 0, 0.5);
    opacity: 0;
    animation: separatorFadeIn 0.8s ease-out 1.4s forwards;
}

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

@keyframes textSlideIn {
    from {
        opacity: 0;
        transform: translateX(var(--slide-from, -20px));
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes underlineGrow {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

@keyframes separatorFadeIn {
    from {
        opacity: 0;
        transform: scale(0);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* 悬浮光效 */
.mystical-poem-banner::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -100%;
    width: 100%;
    height: calc(100% + 4px);
    background: linear-gradient(90deg, 
        transparent, 
        rgba(255, 215, 0, 0.3), 
        transparent);
    animation: shimmer 3s ease-in-out infinite;
    animation-delay: 2s;
    border-radius: 50px;
}

@keyframes shimmer {
    0% {
        left: -100%;
    }
    50%, 100% {
        left: 200%;
    }
}

/* 响应式调整 */
@media (max-width: 768px) {
    .mystical-poem-banner {
        margin: 15px 0;
        padding: 15px;
    }
    
    .poem-scroll {
        flex-direction: column;
        gap: 8px;
    }
    
    .poem-text {
        font-size: 16px;
        letter-spacing: 4px;
    }
    
    .poem-separator {
        display: none;
    }
}
