/* 诸葛神算自定义样式 */

/* 全局样式 */
:root {
    --primary-color: #8B4513;
    --secondary-color: #D2B48C;
    --accent-color: #CD853F;
    --dark-color: #3E2723;
    --light-color: #F5F5DC;
    --bg-color: #F9F6F0;
    --border-radius: 0.75rem;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --transition-base: all 0.3s ease;
}

/* 字体 */
body {
    font-family: 'SimHei', 'Microsoft YaHei', 'PingFang SC', 'Hiragino Sans GB', sans-serif;
    background-color: var(--bg-color);
    color: var(--dark-color);
    line-height: 1.6;
    overflow-x: hidden;
    font-weight: 500; /* 增加字体粗细，使黑体更明显 */
}

/* 全局黑体字体设置 */
* {
    font-family: 'SimHei', 'Microsoft YaHei', 'PingFang SC', 'Hiragino Sans GB', sans-serif !important;
}

/* 标题字体加粗 */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    font-family: 'SimHei', 'Microsoft YaHei', 'PingFang SC', 'Hiragino Sans GB', sans-serif !important;
}

/* 按钮字体 */
button, .btn-primary, .btn-secondary, a[class*="bg-primary"] {
    font-family: 'SimHei', 'Microsoft YaHei', 'PingFang SC', 'Hiragino Sans GB', sans-serif !important;
    font-weight: 600 !important;
}

/* 强制所有按钮使用黑体 */
#divine-button, a[href="#divination"] {
    font-family: 'SimHei', 'Microsoft YaHei', 'PingFang SC', 'Hiragino Sans GB', sans-serif !important;
    font-weight: 600 !important;
}

/* 导航栏 */
#navbar {
    transition: var(--transition-base);
    z-index: 1000;
}

#navbar.scrolled {
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-md);
}

/* 链接样式 */
a {
    transition: var(--transition-base);
}

a:hover {
    text-decoration: none;
}

/* 按钮样式 */
.btn-primary {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius);
    font-weight: 500;
    transition: var(--transition-base);
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    background-color: #7A3C11;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background-color: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius);
    font-weight: 500;
    transition: var(--transition-base);
}

.btn-secondary:hover {
    background-color: var(--primary-color);
    color: white;
}

/* 卡片样式 */
.card {
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    transition: var(--transition-base);
    overflow: hidden;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

/* 装饰元素 */
.divider {
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--primary-color), transparent);
    margin: 2rem auto;
    width: 6rem;
}

/* 卦象显示 */
.hexagon {
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
}

/* 动画效果 */
@keyframes float {
    0% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
    100% {
        transform: translateY(0px);
    }
}

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

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(139, 69, 19, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(139, 69, 19, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(139, 69, 19, 0);
    }
}

/* Logo专用动画效果 */
@keyframes logoRotate {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

@keyframes logoRotateSlow {
    0% {
        transform: rotate(0deg) scale(1);
    }
    25% {
        transform: rotate(90deg) scale(1.02);
    }
    50% {
        transform: rotate(180deg) scale(1);
    }
    75% {
        transform: rotate(270deg) scale(1.02);
    }
    100% {
        transform: rotate(360deg) scale(1);
    }
}

@keyframes logoGlow {
    0% {
        filter: drop-shadow(0 0 5px rgba(139, 69, 19, 0.3));
    }
    50% {
        filter: drop-shadow(0 0 15px rgba(139, 69, 19, 0.6));
    }
    100% {
        filter: drop-shadow(0 0 5px rgba(139, 69, 19, 0.3));
    }
}

@keyframes logoFloat {
    0% {
        transform: translateY(0px) rotate(0deg);
    }
    33% {
        transform: translateY(-5px) rotate(120deg);
    }
    66% {
        transform: translateY(2px) rotate(240deg);
    }
    100% {
        transform: translateY(0px) rotate(360deg);
    }
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-2px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(2px);
    }
}

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

.fade-in-up {
    animation: fadeInUp 0.8s ease-out forwards;
}

.pulse-animation {
    animation: pulse 2s infinite;
}

/* Logo动画类 - 自动持续转动 */
.logo-rotate {
    animation: logoRotate 6s linear infinite;
}

.logo-rotate-slow {
    animation: logoRotateSlow 12s ease-in-out infinite;
}

.logo-glow {
    animation: logoGlow 3s ease-in-out infinite;
}

.logo-float {
    animation: logoFloat 15s ease-in-out infinite;
}

.shake-on-hover:hover {
    animation: shake 0.5s ease-in-out;
}

.logo-interactive {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

/* 自动转动的logo在悬停时增强效果 */
.logo-interactive:hover {
    animation-duration: 2s; /* 悬停时加速转动 */
    filter: drop-shadow(0 0 15px rgba(139, 69, 19, 0.7));
    transform: scale(1.05);
}

.logo-interactive:active {
    animation-duration: 1s; /* 点击时更快转动 */
    transform: scale(0.98);
}

/* 滚动显示动画 */
.scroll-reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.scroll-reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* 加载动画 */
.loader {
    border: 4px solid rgba(139, 69, 19, 0.1);
    border-radius: 50%;
    border-top: 4px solid var(--primary-color);
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

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

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    h1 {
        font-size: 2.5rem;
    }
    
    h2 {
        font-size: 2rem;
    }
    
    .grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.75rem;
    }
    
    .btn-primary, .btn-secondary {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }
}

/* 历史记录项 */
.history-item {
    transition: var(--transition-base);
    border-left: 3px solid transparent;
}

.history-item:hover {
    border-left: 3px solid var(--primary-color);
    background-color: rgba(210, 180, 140, 0.1);
}

/* 卦象解释文本样式 */
.hexagram-content {
    white-space: pre-line;
    line-height: 1.8;
}

/* 页脚样式 */
footer {
    background-color: var(--dark-color);
    color: var(--light-color);
}

footer a {
    color: var(--secondary-color);
}

footer a:hover {
    color: white;
}

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

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

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

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

/* 打印样式 */
@media print {
    .no-print {
        display: none;
    }
    
    body {
        background: white;
    }
    
    .divider {
        border-top: 1px solid #ccc;
    }
}