/* ========================================
   AI算命系统 - 全局样式表
   主题：深色背景 + 金色/红色点缀
   ======================================== */

/* CSS变量定义 */
:root {
    /* 主色调 */
    --primary-dark: #0a0a0f;
    --secondary-dark: #12121a;
    --tertiary-dark: #1a1a25;
    --card-bg: #1e1e2e;
    --card-bg-hover: #252538;
    
    /* 金色系 */
    --gold-primary: #d4a853;
    --gold-light: #f0d78c;
    --gold-dark: #b8941d;
    --gold-gradient: linear-gradient(135deg, #d4a853 0%, #f0d78c 50%, #d4a853 100%);
    --gold-gradient-reverse: linear-gradient(135deg, #f0d78c 0%, #d4a853 100%);
    
    /* 红色系 */
    --red-primary: #c41e3a;
    --red-light: #e63950;
    --red-dark: #9a1830;
    --red-gradient: linear-gradient(135deg, #c41e3a 0%, #e63950 100%);
    
    /* 文字颜色 */
    --text-primary: #ffffff;
    --text-secondary: #b0b0c0;
    --text-muted: #6b6b7b;
    --text-gold: #d4a853;
    
    /* 边框和阴影 */
    --border-gold: 1px solid rgba(212, 168, 83, 0.3);
    --border-gold-strong: 1px solid rgba(212, 168, 83, 0.6);
    --shadow-gold: 0 0 20px rgba(212, 168, 83, 0.2);
    --shadow-dark: 0 4px 20px rgba(0, 0, 0, 0.4);
    
    /* 间距 */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    --spacing-xxl: 48px;
    
    /* 圆角 */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 50%;
    
    /* 字体 */
    --font-primary: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    --font-display: 'Noto Serif SC', 'STSong', 'SimSun', serif;
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-primary);
    background: var(--primary-dark);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* 背景装饰 */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(ellipse at 20% 20%, rgba(212, 168, 83, 0.05) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(196, 30, 58, 0.05) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(212, 168, 83, 0.02) 0%, transparent 70%);
    pointer-events: none;
    z-index: -1;
}

/* 粒子背景容器 */
#particles-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
}

/* 链接样式 */
a {
    color: var(--gold-primary);
    text-decoration: none;
    transition: all 0.3s ease;
}

a:hover {
    color: var(--gold-light);
    text-shadow: 0 0 10px rgba(212, 168, 83, 0.5);
}

/* 按钮基础样式 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 500;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: var(--gold-gradient);
    color: var(--primary-dark);
    box-shadow: 0 4px 15px rgba(212, 168, 83, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(212, 168, 83, 0.4);
}

.btn-secondary {
    background: transparent;
    color: var(--gold-primary);
    border: var(--border-gold-strong);
}

.btn-secondary:hover {
    background: rgba(212, 168, 83, 0.1);
    border-color: var(--gold-light);
}

.btn-red {
    background: var(--red-gradient);
    color: white;
    box-shadow: 0 4px 15px rgba(196, 30, 58, 0.3);
}

.btn-red:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(196, 30, 58, 0.4);
}

.btn-large {
    padding: 16px 32px;
    font-size: 16px;
}

.btn-full {
    width: 100%;
}

/* 按钮点击波纹效果 */
.btn::after {
    content: '';
    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: width 0.6s, height 0.6s;
}

.btn:active::after {
    width: 300px;
    height: 300px;
}

/* 卡片样式 */
.card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    border: var(--border-gold);
    padding: var(--spacing-lg);
    transition: all 0.3s ease;
}

.card:hover {
    border-color: rgba(212, 168, 83, 0.5);
    box-shadow: var(--shadow-gold);
    transform: translateY(-4px);
}

.card-glow {
    position: relative;
}

.card-glow::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: var(--gold-gradient);
    border-radius: var(--radius-lg);
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.card-glow:hover::before {
    opacity: 0.5;
}

/* 输入框样式 */
.input-group {
    margin-bottom: var(--spacing-md);
}

.input-group label {
    display: block;
    margin-bottom: var(--spacing-sm);
    color: var(--text-secondary);
    font-size: 14px;
}

.input-field {
    width: 100%;
    padding: 14px 16px;
    background: var(--secondary-dark);
    border: 1px solid rgba(212, 168, 83, 0.2);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 15px;
    transition: all 0.3s ease;
}

.input-field:focus {
    outline: none;
    border-color: var(--gold-primary);
    box-shadow: 0 0 0 3px rgba(212, 168, 83, 0.1);
}

.input-field::placeholder {
    color: var(--text-muted);
}

/* 选择框样式 */
.select-field {
    width: 100%;
    padding: 14px 16px;
    background: var(--secondary-dark);
    border: 1px solid rgba(212, 168, 83, 0.2);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 15px;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23d4a853' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
}

.select-field:focus {
    outline: none;
    border-color: var(--gold-primary);
}

/* 导航栏 */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: rgba(10, 10, 15, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: var(--border-gold);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--spacing-lg);
}

.navbar-logo {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-size: 20px;
    font-weight: bold;
    background: var(--gold-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.navbar-logo i {
    font-size: 28px;
    color: var(--gold-primary);
    -webkit-text-fill-color: initial;
}

.navbar-menu {
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
}

.navbar-menu a {
    color: var(--text-secondary);
    font-size: 14px;
    padding: var(--spacing-sm) 0;
    position: relative;
}

.navbar-menu a:hover,
.navbar-menu a.active {
    color: var(--gold-primary);
}

.navbar-menu a.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--gold-gradient);
}

.navbar-actions {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

/* 语言选择器 */
.lang-selector {
    position: relative;
}

.lang-selector select {
    background: var(--secondary-dark);
    border: var(--border-gold);
    color: var(--gold-primary);
    padding: 8px 32px 8px 12px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 12 12'%3E%3Cpath fill='%23d4a853' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
}

/* 移动端菜单按钮 */
.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: var(--spacing-sm);
}

.menu-toggle span {
    width: 24px;
    height: 2px;
    background: var(--gold-primary);
    transition: all 0.3s ease;
}

/* 页面容器 */
.page-container {
    padding-top: 60px;
    min-height: 100vh;
}

/* 内容区域 */
.content-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--spacing-xl);
}

/* 页面标题 */
.page-title {
    text-align: center;
    margin-bottom: var(--spacing-xl);
}

.page-title h1 {
    font-size: 32px;
    font-weight: bold;
    background: var(--gold-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: var(--spacing-sm);
}

.page-title p {
    color: var(--text-secondary);
    font-size: 16px;
}

/* 区块标题 */
.section-title {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-size: 20px;
    color: var(--gold-primary);
    margin-bottom: var(--spacing-lg);
    padding-bottom: var(--spacing-sm);
    border-bottom: 1px solid rgba(212, 168, 83, 0.2);
}

.section-title::before {
    content: '';
    width: 4px;
    height: 20px;
    background: var(--gold-gradient);
    border-radius: 2px;
}

/* 网格布局 */
.grid {
    display: grid;
    gap: var(--spacing-lg);
}

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

.grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

/* 服务卡片 */
.service-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    border: var(--border-gold);
    padding: var(--spacing-xl);
    text-align: center;
    transition: all 0.4s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gold-gradient);
    transform: scaleX(0);
    transition: transform 0.4s ease;
}

.service-card:hover {
    transform: translateY(-8px);
    border-color: rgba(212, 168, 83, 0.5);
    box-shadow: var(--shadow-gold);
}

.service-card:hover::before {
    transform: scaleX(1);
}

.service-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto var(--spacing-lg);
    background: var(--gold-gradient);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    color: var(--primary-dark);
    transition: all 0.4s ease;
}

.service-card:hover .service-icon {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 0 30px rgba(212, 168, 83, 0.4);
}

.service-card h3 {
    font-size: 18px;
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
}

.service-card p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.service-card .price {
    margin-top: var(--spacing-md);
    font-size: 20px;
    color: var(--gold-primary);
    font-weight: bold;
}

/* 标签 */
.tag {
    display: inline-block;
    padding: 4px 12px;
    background: rgba(212, 168, 83, 0.1);
    border: 1px solid rgba(212, 168, 83, 0.3);
    border-radius: 20px;
    font-size: 12px;
    color: var(--gold-primary);
}

.tag-red {
    background: rgba(196, 30, 58, 0.1);
    border-color: rgba(196, 30, 58, 0.3);
    color: var(--red-light);
}

/* 加载动画 */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
}

.loading-dot {
    width: 8px;
    height: 8px;
    background: var(--gold-primary);
    border-radius: 50%;
    animation: loading-bounce 1.4s infinite ease-in-out both;
}

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

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

/* 脉冲动画 */
.pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(212, 168, 83, 0.4); }
    70% { box-shadow: 0 0 0 15px rgba(212, 168, 83, 0); }
    100% { box-shadow: 0 0 0 0 rgba(212, 168, 83, 0); }
}

/* 发光效果 */
.glow {
    animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
    from { text-shadow: 0 0 10px rgba(212, 168, 83, 0.5); }
    to { text-shadow: 0 0 20px rgba(212, 168, 83, 0.8), 0 0 30px rgba(212, 168, 83, 0.4); }
}

/* 浮动动画 */
.float {
    animation: float 3s ease-in-out infinite;
}

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

/* 旋转动画 */
.spin {
    animation: spin 2s linear infinite;
}

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

/* 淡入动画 */
.fade-in {
    animation: fadeIn 0.5s ease-out;
}

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

/* 模态框 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    border: var(--border-gold);
    padding: var(--spacing-xl);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-lg);
    padding-bottom: var(--spacing-md);
    border-bottom: 1px solid rgba(212, 168, 83, 0.2);
}

.modal-header h3 {
    font-size: 20px;
    color: var(--gold-primary);
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 24px;
    cursor: pointer;
    transition: color 0.3s ease;
}

.modal-close:hover {
    color: var(--gold-primary);
}

/* Toast提示 */
.toast-container {
    position: fixed;
    top: 80px;
    right: var(--spacing-lg);
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.toast {
    background: var(--card-bg);
    border: var(--border-gold);
    border-radius: var(--radius-md);
    padding: var(--spacing-md) var(--spacing-lg);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    box-shadow: var(--shadow-dark);
    animation: slideIn 0.3s ease;
    min-width: 280px;
}

.toast.success {
    border-color: rgba(76, 175, 80, 0.5);
}

.toast.error {
    border-color: rgba(244, 67, 54, 0.5);
}

.toast.warning {
    border-color: rgba(255, 152, 0, 0.5);
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* 底部导航（移动端） */
.mobile-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: rgba(10, 10, 15, 0.98);
    border-top: var(--border-gold);
    z-index: 1000;
}

.mobile-nav-items {
    display: flex;
    justify-content: space-around;
    align-items: center;
    height: 100%;
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: var(--text-muted);
    font-size: 11px;
    transition: color 0.3s ease;
}

.mobile-nav-item i {
    font-size: 20px;
}

.mobile-nav-item.active,
.mobile-nav-item:hover {
    color: var(--gold-primary);
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    /* 移动端隐藏页脚 */
    .footer,
    .footer-section {
        display: none !important;
    }

    .navbar-menu,
    .navbar-actions .btn {
        display: none;
    }
    
    .menu-toggle {
        display: flex;
    }
    
    .content-wrapper {
        padding: var(--spacing-md);
    }
    
    .page-title h1 {
        font-size: 24px;
    }
    
    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }
    
    .service-card {
        padding: var(--spacing-lg);
    }
    
    .mobile-nav {
        display: block;
    }
    
    .page-container {
        padding-bottom: 70px;
    }
    
    .modal-content {
        width: 95%;
        padding: var(--spacing-lg);
    }
    
    .toast-container {
        left: var(--spacing-md);
        right: var(--spacing-md);
    }
    
    .toast {
        min-width: auto;
    }
}

@media (max-width: 480px) {
    .navbar {
        padding: 0 var(--spacing-md);
    }
    
    .navbar-logo {
        font-size: 16px;
    }
    
    .navbar-logo i {
        font-size: 22px;
    }
    
    .page-title h1 {
        font-size: 20px;
    }
    
    .btn {
        padding: 10px 18px;
        font-size: 13px;
    }
}

/* 打印样式 */
@media print {
    .navbar,
    .mobile-nav,
    .btn {
        display: none !important;
    }
    
    body {
        background: white;
        color: black;
    }
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

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

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

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

/* 选中文字样式 */
::selection {
    background: rgba(212, 168, 83, 0.3);
    color: var(--text-primary);
}
