/* 中国运势网站自定义样式 - 深色主题搭配金色和紫色 */

/* 主题颜色 */
:root {
    /* 深色主题 */
    --bg-primary: #121212;
    --bg-secondary: #1e1e1e;
    --bg-card: #252525;
    --bg-accent: #1a1a2e;
    
    /* 金色强调 */
    --gold-primary: #D4AF37;
    --gold-light: #f5e39b;
    --gold-dark: #a67c00;
    
    /* 紫色强调 */
    --purple-primary: #9c27b0;
    --purple-light: #d05ce3;
    --purple-dark: #6a0080;
    
    /* 文本颜色 */
    --text-primary: #ffffff;
    --text-secondary: #b0b0b0;
    --text-accent: var(--gold-light);
    
    /* 阴影效果 */
    --shadow-light: 0 4px 6px rgba(0, 0, 0, 0.3);
    --shadow-medium: 0 8px 16px rgba(0, 0, 0, 0.4);
    --shadow-heavy: 0 12px 24px rgba(0, 0, 0, 0.5);
}

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

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

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

/* 工具类 */
.fade-in {
    opacity: 0;
    animation: fadeIn 0.8s ease forwards;
}

.float-animation {
    animation: float 3s ease-in-out infinite;
}

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

/* 深色主题基础样式 */
body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    background-image: url("data:image/svg+xml,%3Csvg width='52' height='26' viewBox='0 0 52 26' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23D4AF37' fill-opacity='0.05'%3E%3Cpath d='M10 10c0-2.21-1.79-4-4-4-3.314 0-6-2.686-6-6h2c0 2.21 1.79 4 4 4 3.314 0 6 2.686 6 6 0 2.21 1.79 4 4 4 3.314 0 6 2.686 6 6 0 2.21 1.79 4 4 4v2c-3.314 0-6-2.686-6-6 0-2.21-1.79-4-4-4-3.314 0-6-2.686-6-6zm25.464-1.95l8.486 8.486-1.414 1.414-8.486-8.486 1.414-1.414z' /%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

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

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--gold-primary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gold-dark);
}

/* 表单元素样式 */
input,
select,
textarea {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--gold-dark);
    border-radius: 4px;
    padding: 0.5rem;
    transition: all 0.3s ease;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--gold-primary);
    box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.2);
}

/* 按钮样式 */
button {
    background: linear-gradient(135deg, var(--gold-primary), var(--gold-dark));
    color: white;
    border: none;
    border-radius: 4px;
    padding: 0.5rem 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-light);
}

button:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
    background: linear-gradient(135deg, var(--gold-light), var(--gold-primary));
    color: black !important;
}

button:active {
    transform: translateY(0);
    box-shadow: var(--shadow-light);
}

/* 表单提交按钮 */
button[type="submit"] {
    transition: all 0.3s ease;
    color: black;
}

button[type="submit"]:hover {
    color: black !important;
}

/* 金色按钮变体 */
.btn-gold {
    background: linear-gradient(135deg, var(--gold-primary), var(--gold-dark));
}

.btn-gold:hover {
    background: linear-gradient(135deg, var(--gold-light), var(--gold-primary));
    color: black !important;
}

/* 个人信息提交按钮 */
#submit-personal-info {
    transition: all 0.3s ease;
}

#submit-personal-info:hover {
    color: black !important;
}

/* 卡片样式 */
.card-hover {
    background-color: var(--bg-card);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-light);
    border: 1px solid rgba(212, 175, 55, 0.1);
}

.card-hover:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-heavy);
    border-color: var(--gold-primary);
}

/* 响应式调整 */
@media (max-width: 768px) {
    .grid-cols-5 {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .grid-cols-5 > div:last-child {
        grid-column: span 2;
        justify-self: center;
    }
}

@media (max-width: 480px) {
    .grid-cols-5 {
        grid-template-columns: 1fr;
    }
    
    .grid-cols-5 > div:last-child {
        grid-column: span 1;
    }
}

/* 标签页过渡效果 */
.tab-content {
    transition: opacity 0.5s ease, transform 0.5s ease;
    background-color: var(--bg-secondary);
    padding: 2rem;
    border-radius: 0 0 8px 8px;
    box-shadow: var(--shadow-light);
}

/* 导航标签 */
.nav-tab {
    position: relative;
    color: var(--text-secondary);
    padding: 1rem 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    background-color: var(--bg-secondary);
    border-radius: 8px 8px 0 0;
    margin-right: 0.25rem;
}

.nav-tab:hover {
    color: var(--gold-light);
    background-color: var(--bg-card);
}

/* 特定导航标签按钮 */
#home-tab, #bazi-tab, #about-tab {
    transition: all 0.3s ease;
}

#home-tab:hover, #bazi-tab:hover, #about-tab:hover {
    color: black !important;
}

.nav-tab::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--gold-primary), var(--gold-light));
    transition: width 0.3s ease;
}

.nav-tab:hover::after {
    width: 100%;
}

.nav-tab.tab-active {
    color: var(--text-primary);
    background-color: var(--bg-secondary);
    font-weight: 600;
}

.nav-tab.tab-active::after {
    width: 100%;
}

/* 排版增强 */
.text-balance {
    text-wrap: balance;
}

/* 强调文本 */
.text-accent {
    color: var(--text-accent);
}

/* 金色文本 */
.text-gold {
    color: var(--gold-primary);
}

/* 紫色文本 */
.text-purple {
    color: var(--purple-light);
}

/* 背景图案 */
.bg-pattern {
    background-image: url("data:image/svg+xml,%3Csvg width='52' height='26' viewBox='0 0 52 26' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23D4AF37' fill-opacity='0.05'%3E%3Cpath d='M10 10c0-2.21-1.79-4-4-4-3.314 0-6-2.686-6-6h2c0 2.21 1.79 4 4 4 3.314 0 6 2.686 6 6 0 2.21 1.79 4 4 4 3.314 0 6 2.686 6 6 0 2.21 1.79 4 4 4v2c-3.314 0-6-2.686-6-6 0-2.21-1.79-4-4-4-3.314 0-6-2.686-6-6zm25.464-1.95l8.486 8.486-1.414 1.414-8.486-8.486 1.414-1.414z' /%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

/* 元素图标 */
.element-icon {
    transition: all 0.3s ease;
}

.element-icon:hover {
    transform: rotate(15deg) scale(1.1);
}

/* 加载动画 */
.loading-spinner {
    border: 3px solid rgba(212, 163, 115, 0.3);
    border-radius: 50%;
    border-top: 3px solid #D4A373;
    width: 24px;
    height: 24px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 语言切换器样式 */
#language-dropdown-btn {
    transition: all 0.3s ease;
}

#language-dropdown-btn:hover {
    color: black !important;
}

#lang-en, #lang-zh {
    transition: all 0.3s ease;
    font-weight: 500;
    min-width: 60px;
    text-align: center;
}

#lang-en:hover, #lang-zh:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    color: black !important;
}

/* 关闭模态框按钮 */
#close-modal {
    transition: all 0.3s ease;
}

#close-modal:hover {
    color: white !important;
}

#lang-en:active, #lang-zh:active {
    transform: translateY(0);
}

/* 中文文本样式 */
[lang="zh"] {
    line-height: 1.6;
}

/* 确保中文字符间距适当 */
.chinese-text {
    letter-spacing: 0.02em;
}

/* 语言切换器的响应式调整 */
@media (max-width: 768px) {
    #lang-en, #lang-zh {
        font-size: 0.85rem;
        padding: 0.25rem 0.5rem;
    }
}

/* 自定义Tailwind工具类 */
.content-auto {
    content-visibility: auto;
}

.tab-active {
    color: #FFD700; 
    border-bottom: 2px solid #FFD700;
}

.bg-pattern {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='100' height='100' viewBox='0 0 100 100'><path fill='rgba(255,255,255,0.05)' d='M50 50L0 0L50 0Z'></path><path fill='rgba(255,255,255,0.05)' d='M50 50L100 0L100 50Z'></path><path fill='rgba(255,255,255,0.05)' d='M50 50L0 100L0 50Z'></path><path fill='rgba(255,255,255,0.05)' d='M50 50L100 100L50 100Z'></path></svg>");
    background-size: 200px;
    opacity: 0.8;
}

.text-shadow {
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.transition-custom {
    transition: all 0.3s ease;
}

.bg-gradient-primary {
    background: linear-gradient(45deg, #FFD700, #FF9D00);
    color: black;
}

.bg-gradient-primary:hover {
    color: black;
    opacity: 0.9;
}

.bg-gradient-background {
    background: linear-gradient(135deg, #0f0c29, #302b63, #24243e);
}

.text-gradient-primary {
    background: linear-gradient(45deg, #FFD700, #FF9D00);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}