/* ============================================
   中医药百科 - 主样式表
   ============================================ */

:root {
    --primary: #198754;
    --primary-dark: #146c43;
    --herb-color: #ffc107;
    --formula-color: #dc3545;
    --book-color: #0d6efd;
}

/* 通用样式 */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    background: #f5f6f7;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

a {
    color: var(--primary);
}

a:hover {
    color: var(--primary-dark);
}

/* 导航栏 */
.navbar-brand {
    font-size: 1.3rem;
    letter-spacing: 1px;
}

.navbar .form-control {
    min-width: 200px;
}

/* 首页横幅 */
.hero-section {
    background: linear-gradient(135deg, #198754 0%, #20c997 50%, #0dcaf0 100%) !important;
}

.hero-section h1 {
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

/* 卡片悬停效果 */
.hover-highlight {
    transition: all 0.2s ease;
}

.hover-highlight:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15) !important;
    border-color: var(--primary) !important;
}

/* 药材卡片 */
.herb-card {
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.herb-card:hover {
    border-left-color: var(--herb-color);
    transform: translateX(3px);
}

/* 字母索引按钮 */
.letter-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 30px;
    min-height: 30px;
    font-weight: bold;
    border: 1px solid #dee2e6;
    transition: all 0.15s ease;
}

.letter-btn:hover {
    background: var(--primary) !important;
    color: white !important;
    border-color: var(--primary);
}

.letter-btn sup {
    font-size: 0.6rem;
    font-weight: normal;
}

/* 详情页内容 */
.card-body p {
    line-height: 1.8;
}

/* 表格优化 */
.table th {
    font-weight: 600;
    white-space: nowrap;
}

.table td {
    vertical-align: middle;
}

/* 分页 */
.pagination .page-link {
    color: var(--primary);
}

.pagination .active .page-link {
    background-color: var(--primary);
    border-color: var(--primary);
}

/* 面包屑 */
.breadcrumb {
    background: transparent;
    padding: 0.5rem 0;
}

/* 响应式优化 */
@media (max-width: 768px) {
    .hero-section {
        padding: 2rem 1rem !important;
    }
    
    .hero-section h1 {
        font-size: 2rem;
    }
    
    .navbar .form-control {
        min-width: 120px;
    }
    
    .table-responsive {
        font-size: 0.85rem;
    }
}

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

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

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* 打印样式 */
@media print {
    .navbar, footer, .breadcrumb, .btn {
        display: none !important;
    }
    
    .card {
        border: none !important;
        box-shadow: none !important;
    }
}

/* 加载动画 */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.card {
    animation: fadeIn 0.3s ease;
}

/* 引用块样式 */
blockquote {
    border-left: 4px solid var(--primary);
    padding: 0.5rem 1rem;
    margin: 1rem 0;
    background: #f8f9fa;
    border-radius: 0 4px 4px 0;
}

/* 搜索结果高亮 */
mark {
    background: #fff3cd;
    padding: 2px 4px;
    border-radius: 2px;
}
