/* 塔罗查询系统样式表 */

/* 全局样式 */
:root {
    --primary-color: #2c3e50;
    --secondary-color: #8e44ad;
    --accent-color: #f39c12;
    --success-color: #27ae60;
    --info-color: #3498db;
    --warning-color: #e67e22;
    --danger-color: #e74c3c;
    --light-color: #ecf0f1;
    --dark-color: #2c3e50;
    --mystic-purple: #6c5ce7;
    --moonlight-blue: #74b9ff;
    --gold-accent: #fdcb6e;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --text-primary: #2c3e50;
    --text-secondary: #7f8c8d;
    --bg-gradient-start: #1a1a2e;
    --bg-gradient-end: #16213e;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    color: var(--text-primary);
    line-height: 1.6;
}

/* 头部样式 */
header {
    background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%) !important;
    box-shadow: 0 4px 20px var(--shadow-color);
    border-bottom: 3px solid var(--accent-color);
}

header h1 {
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

header p {
    opacity: 0.9;
    font-style: italic;
}

.search-box .form-control {
    border-radius: 25px 0 0 25px;
    border: none;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.9);
}

.search-box .btn {
    border-radius: 0 25px 25px 0;
    border: none;
    background: var(--accent-color);
    color: white;
    padding: 10px 15px;
}

.search-box .btn:hover {
    background: #e67e22;
    transform: translateY(-1px);
}

/* 侧边栏样式 */
.sidebar {
    min-height: calc(100vh - 80px);
    background: linear-gradient(180deg, #ffffff 0%, #f8f9fa 100%) !important;
    border-right: 3px solid var(--mystic-purple);
    box-shadow: 4px 0 15px var(--shadow-color);
    overflow-y: auto;
    max-height: calc(100vh - 80px);
}

.sidebar-sticky {
    padding: 20px 15px;
}

.sidebar-heading {
    font-weight: 700;
    color: var(--mystic-purple);
    border-bottom: 2px solid var(--mystic-purple);
    padding-bottom: 8px;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.9rem;
}

.nav-section {
    margin-bottom: 20px;
}

.nav-section-title {
    background: linear-gradient(135deg, var(--mystic-purple) 0%, var(--secondary-color) 100%);
    color: white !important;
    padding: 10px 15px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    border: none;
    width: 100%;
    text-align: left;
    display: flex;
    align-items: center;
}

.nav-section-title:hover {
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--mystic-purple) 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow-color);
}

.nav-section-title i {
    transition: transform 0.3s ease;
}

.nav-section-title[aria-expanded="true"] i {
    transform: rotate(90deg);
}

.nav-pills .nav-link {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 8px 15px;
    margin: 2px 0;
    font-size: 0.85rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.nav-pills .nav-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 3px;
    background: var(--mystic-purple);
    transform: translateX(-100%);
    transition: transform 0.3s ease;
}

.nav-pills .nav-link:hover {
    background: rgba(108, 92, 231, 0.1);
    border-color: var(--mystic-purple);
    color: var(--mystic-purple);
    transform: translateX(5px);
}

.nav-pills .nav-link:hover::before {
    transform: translateX(0);
}

.nav-pills .nav-link.active {
    background: linear-gradient(135deg, var(--mystic-purple) 0%, var(--secondary-color) 100%);
    color: white;
    border-color: var(--mystic-purple);
    box-shadow: 0 4px 12px var(--shadow-color);
}

/* 筛选器样式 */
.bg-light.rounded {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%) !important;
    border: 2px solid var(--mystic-purple);
    box-shadow: 0 8px 25px var(--shadow-color);
}

.form-select-sm {
    border-radius: 8px;
    border: 1px solid #dee2e6;
    background: white;
    transition: all 0.3s ease;
}

.form-select-sm:focus {
    border-color: var(--mystic-purple);
    box-shadow: 0 0 0 0.2rem rgba(108, 92, 231, 0.25);
}

/* 主内容区样式 */
.main-content {
    padding: 30px;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    min-height: calc(100vh - 80px);
}

.content-section {
    animation: fadeIn 0.5s ease-in-out;
}

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

/* 欢迎页面样式 */
.hero-section {
    max-width: 900px;
    margin: 0 auto;
}

.hero-icon {
    background: linear-gradient(135deg, var(--mystic-purple) 0%, var(--moonlight-blue) 100%);
    width: 150px;
    height: 150px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    box-shadow: 0 10px 30px var(--shadow-color);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 10px 30px var(--shadow-color);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 15px 40px var(--shadow-color);
    }
}

.hero-icon i {
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.card {
    border: none;
    border-radius: 15px;
    box-shadow: 0 8px 25px var(--shadow-color);
    transition: all 0.3s ease;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px var(--shadow-color);
}

.card-header {
    background: linear-gradient(135deg, var(--mystic-purple) 0%, var(--secondary-color) 100%) !important;
    border: none;
    padding: 20px;
    text-align: center;
}

.card-header h2 {
    font-weight: 700;
    margin: 0;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.alert {
    border-radius: 15px;
    border: none;
    box-shadow: 0 5px 15px var(--shadow-color);
}

.alert-info {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    color: #1565c0;
}

.alert h5 {
    color: #0d47a1;
    font-weight: 700;
}

/* 牌面详情页面样式 */
.card-detail-container {
    max-width: 1000px;
    margin: 0 auto;
}

.card-detail-container .card {
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 15px 35px var(--shadow-color);
}

.card-detail-container .card-header {
    padding: 30px;
    text-align: center;
    position: relative;
}

.card-detail-container .card-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="stars" x="0" y="0" width="20" height="20" patternUnits="userSpaceOnUse"><circle cx="10" cy="10" r="1" fill="white" opacity="0.3"/></pattern></defs><rect width="100" height="100" fill="url(%23stars)"/></svg>');
    opacity: 0.5;
}

.card-detail-container .card-header h2 {
    position: relative;
    z-index: 1;
}

.card-detail-container .card-body {
    padding: 30px;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
}

.card-content-section {
    margin-bottom: 30px;
    padding: 20px;
    background: white;
    border-radius: 12px;
    border-left: 5px solid var(--mystic-purple);
    box-shadow: 0 5px 15px var(--shadow-color);
}

.card-content-section h3 {
    color: var(--mystic-purple);
    font-weight: 700;
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.card-content-section h4 {
    color: var(--secondary-color);
    font-weight: 600;
    margin: 15px 0 10px 0;
    font-size: 1.1rem;
}

.card-content-section p {
    margin-bottom: 12px;
    line-height: 1.7;
    color: var(--text-primary);
}

.card-content-section ul {
    padding-left: 20px;
}

.card-content-section li {
    margin-bottom: 8px;
    line-height: 1.6;
}

.theme-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    margin: 2px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.theme-badge.love {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
    color: white;
}

.theme-badge.career {
    background: linear-gradient(135deg, #4ecdc4 0%, #44a08d 100%);
    color: white;
}

.theme-badge.wealth {
    background: linear-gradient(135deg, #f7b731 0%, #f5af19 100%);
    color: white;
}

.theme-badge.health {
    background: linear-gradient(135deg, #5f27cd 0%, #341f97 100%);
    color: white;
}

.theme-badge.spirituality {
    background: linear-gradient(135deg, #00d2d3 0%, #01a3a4 100%);
    color: white;
}

/* 搜索结果页面样式 */
.search-results-container {
    max-width: 1000px;
    margin: 0 auto;
}

.search-result-item {
    background: white;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 15px;
    border-left: 5px solid var(--mystic-purple);
    box-shadow: 0 5px 15px var(--shadow-color);
    transition: all 0.3s ease;
    cursor: pointer;
}

.search-result-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px var(--shadow-color);
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
}

.search-result-title {
    color: var(--mystic-purple);
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 8px;
}

.search-result-excerpt {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
}

.search-highlight {
    background: var(--gold-accent);
    padding: 2px 4px;
    border-radius: 4px;
    font-weight: 600;
}

/* 按钮样式 */
.btn {
    border-radius: 25px;
    padding: 10px 25px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px var(--shadow-color);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px var(--shadow-color);
}

.btn-outline-secondary {
    background: white;
    color: var(--text-secondary);
    border: 2px solid var(--text-secondary);
}

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

/* 页脚样式 */
footer {
    background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%) !important;
    border-top: 3px solid var(--accent-color);
    margin-top: auto;
}

/* 响应式设计优化 */
@media (max-width: 1200px) {
    .container-fluid {
        padding-left: 15px;
        padding-right: 15px;
    }
}

@media (max-width: 992px) {
    .sidebar {
        min-height: auto;
        max-height: 400px;
        margin-bottom: 20px;
        border-radius: 0 0 15px 15px;
        position: relative;
        z-index: 10;
    }
    
    .main-content {
        padding: 20px;
    }
    
    .hero-section {
        text-align: center;
    }
    
    .hero-icon {
        width: 120px;
        height: 120px;
    }
    
    .hero-icon i {
        font-size: 3rem;
    }
    
    .card-detail-container .card-header {
        padding: 25px 20px;
    }
    
    .search-box {
        margin-top: 15px;
    }
    
    /* 移动端导航优化 */
    .sidebar {
        background: linear-gradient(180deg, #ffffff 0%, #f8f9fa 100%) !important;
        border: 1px solid #dee2e6;
        box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    }
    
    .nav-section-title {
        font-size: 0.85rem;
        padding: 8px 12px;
        margin: 1px 0;
    }
    
    .nav-pills .nav-link {
        font-size: 0.8rem;
        padding: 6px 12px;
        margin: 1px 0;
    }
}

@media (max-width: 768px) {
    header {
        text-align: center;
        padding: 15px 0;
    }
    
    header .row {
        text-align: center;
    }
    
    .search-box {
        margin-top: 15px;
        max-width: 400px;
        margin-left: auto;
        margin-right: auto;
    }
    
    .sidebar {
        max-height: 350px;
        margin-bottom: 20px;
        border-radius: 15px;
        overflow: hidden;
    }
    
    .main-content {
        padding: 15px;
    }
    
    .card-detail-container .card-header,
    .card-detail-container .card-body {
        padding: 20px 15px;
    }
    
    .hero-section h1 {
        font-size: 2.2rem;
    }
    
    .hero-section .row {
        text-align: center;
    }
    
    .hero-section .card {
        margin-bottom: 20px;
    }
    
    /* 移动端优化 */
    .hero-icon {
        width: 100px;
        height: 100px;
    }
    
    .hero-icon i {
        font-size: 2.5rem;
    }
    
    .btn {
        padding: 8px 20px;
        font-size: 0.9rem;
    }
    
    .card-content-section {
        padding: 15px;
        margin-bottom: 15px;
    }
    
    .card-content-section h3 {
        font-size: 1.1rem;
    }
    
    .card-content-section h4 {
        font-size: 1rem;
    }
    
    .card-content-section p {
        font-size: 0.9rem;
    }
    
    /* 触摸优化 */
    .nav-link {
        min-height: 44px;
        display: flex;
        align-items: center;
    }
    
    .clickable-card {
        cursor: pointer;
        transition: all 0.3s ease;
    }
    
    .clickable-card:active {
        transform: scale(0.98);
    }
    
    /* 移动端模态框优化 */
    .modal-dialog {
        margin: 10px;
        max-width: calc(100% - 20px);
    }
    
    .modal-body {
        padding: 15px;
    }
    
    /* 移动端占卜界面优化 */
    .divination-option {
        margin-bottom: 15px;
    }
    
    .divination-card {
        margin-bottom: 15px;
    }
}

@media (max-width: 576px) {
    .sidebar-sticky {
        padding: 15px 10px;
    }
    
    .nav-section-title {
        font-size: 0.8rem;
        padding: 8px 10px;
        margin: 1px 0;
    }
    
    .nav-pills .nav-link {
        font-size: 0.75rem;
        padding: 8px 10px;
        margin: 1px 0;
        min-height: 40px;
    }
    
    .main-content {
        padding: 10px;
    }
    
    .hero-section {
        padding: 20px 0;
    }
    
    .hero-section h1 {
        font-size: 1.8rem;
    }
    
    .hero-section .lead {
        font-size: 0.95rem;
    }
    
    .card-detail-container .card-header,
    .card-detail-container .card-body {
        padding: 15px 10px;
    }
    
    .card-content-section {
        padding: 12px;
        margin-bottom: 15px;
    }
    
    /* 超小屏幕优化 */
    header h1 {
        font-size: 1.5rem;
    }
    
    header p {
        font-size: 0.8rem;
    }
    
    .search-box .form-control {
        font-size: 0.9rem;
        padding: 8px 15px;
    }
    
    .search-box .btn {
        padding: 8px 12px;
    }
    
    .btn {
        padding: 6px 15px;
        font-size: 0.85rem;
    }
    
    .card-content-section h3 {
        font-size: 1rem;
        margin-bottom: 10px;
    }
    
    .card-content-section h4 {
        font-size: 0.9rem;
        margin-bottom: 8px;
    }
    
    .card-content-section p {
        font-size: 0.85rem;
        line-height: 1.5;
        margin-bottom: 8px;
    }
    
    .card-content-section ul {
        padding-left: 15px;
    }
    
    .card-content-section li {
        font-size: 0.85rem;
        margin-bottom: 6px;
    }
    
    /* 响应式表格优化 */
    .row > .col-md-6 {
        margin-bottom: 15px;
    }
    
    /* 移动端占卜界面进一步优化 */
    .divination-option .card-body {
        padding: 15px;
    }
    
    .divination-option h5 {
        font-size: 1rem;
        margin-bottom: 5px;
    }
    
    .divination-option p {
        font-size: 0.8rem;
        margin-bottom: 0;
    }
    
    .divination-card .card-header h6 {
        font-size: 0.9rem;
    }
    
    .divination-card .card-title {
        font-size: 1.1rem;
        margin-bottom: 8px;
    }
    
    .divination-card .card-text {
        font-size: 0.85rem;
        margin-bottom: 10px;
    }
    
    /* 滚动优化 */
    .sidebar {
        -webkit-overflow-scrolling: touch;
    }
    
    /* 防止横向滚动 */
    body {
        overflow-x: hidden;
    }
    
    .container-fluid {
        padding-left: 10px;
        padding-right: 10px;
    }
    
    /* 移动端搜索结果优化 */
    .search-result-item {
        padding: 15px;
        margin-bottom: 10px;
    }
    
    .search-result-title {
        font-size: 1rem;
        margin-bottom: 5px;
    }
    
    .search-result-excerpt {
        font-size: 0.85rem;
        line-height: 1.4;
    }
    
    .badge {
        font-size: 0.7rem;
        padding: 3px 6px;
    }
}

/* 加载动画 */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--mystic-purple);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

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

.sidebar::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: var(--mystic-purple);
    border-radius: 4px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-color);
}

/* 特殊效果 */
.mystical-glow {
    box-shadow: 0 0 20px rgba(108, 92, 231, 0.3);
    animation: mysticalGlow 2s ease-in-out infinite alternate;
}

@keyframes mysticalGlow {
    from {
        box-shadow: 0 0 20px rgba(108, 92, 231, 0.3);
    }
    to {
        box-shadow: 0 0 30px rgba(108, 92, 231, 0.6);
    }
}

.text-gradient {
    background: linear-gradient(135deg, var(--mystic-purple) 0%, var(--secondary-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
}

/* 可点击卡片样式 */
.clickable-card {
    cursor: pointer;
    transition: all 0.3s ease;
}

.clickable-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.clickable-card:active {
    transform: translateY(-2px);
}

/* 组合解读样式 */
.combination-analysis {
    line-height: 1.6;
}

.combination-analysis p {
    margin-bottom: 12px;
}

.combination-analysis strong {
    color: var(--mystic-purple);
}

.advice-summary {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid var(--mystic-purple);
}

.advice-summary ul {
    margin-bottom: 0;
    padding-left: 20px;
}

.advice-summary li {
    margin-bottom: 8px;
}

/* 占卜结果动画 */
@keyframes cardReveal {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.divination-card {
    animation: cardReveal 0.6s ease-out;
}

/* 组合解读区域动画 */
@keyframes combinationSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alert-success {
    animation: combinationSlideIn 0.8s ease-out;
}

.alert-info {
    animation: combinationSlideIn 1s ease-out;
}

/* 移动端占卜结果优化 */
@media (max-width: 768px) {
    .combination-analysis {
        font-size: 0.9rem;
    }
    
    .advice-summary {
        padding: 12px;
    }
    
    .advice-summary ul {
        padding-left: 15px;
    }
}

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
    .advice-summary {
        background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
        color: #e2e8f0;
    }
    
    .combination-analysis strong {
        color: var(--moonlight-blue);
    }
}
}