﻿/* 自定义CSS样式文件 */

/* 全局样式 */
:root {
    --primary-color: #1A365D;
    --secondary-color: #2C5282;
    --accent-color: #4A5568;
    --school-link-bg: #EBF8FF;
    --school-link-hover: #BEE3F8;
    --library-link-bg: #F7FAFC;
    --library-link-hover: #E2E8F0;
    --neutral-color: #64748B;
    --light-color: #F1F5F9;
    --dark-color: #1E293B;
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --transition: all 0.3s ease;
}

/* 下拉菜单箭头旋转动画 */
.rotate-180 {
    transform: rotate(180deg);
}

/* 字体加载 */
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 400;
    src: url('https://fonts.gstatic.com/s/inter/v12/UcCO3FwrK3iLTeHuS_fvQtMwCp50KnMw2boKoduKmMEVuLyfAZ9hiA.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* 动画效果 */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* 呼吸动画效果 */
@keyframes breathe {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.03); }
}

/* 自定义ping动画 */
.animate-ping {
    animation: ping 1.5s cubic-bezier(0, 0, 0.2, 1) infinite;
}

@keyframes ping {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    75%, 100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-50px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(50px); }
    to { opacity: 1; transform: translateX(0); }
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* 通用组件样式 */
.btn-primary {
    @apply bg-primary hover:bg-primary/90 text-white font-medium rounded-lg transition-all;
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.btn-primary:hover::before {
    left: 100%;
}

.card {
    @apply bg-white rounded-xl shadow-sm transition-all duration-300;
    overflow: hidden;
}

.card:hover {
    @apply shadow-lg;
    transform: translateY(-5px);
}

/* 表单元素样式 */
.form-input {
    @apply w-full px-4 py-2 rounded-lg border border-gray-300 focus:outline-none transition-all;
}

.form-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1);
}

/* 导航栏样式 - 增加高度并垂直居中 */
header {
    min-height: 80px;
    display: flex;
    align-items: center;
}

header > .container {
    height: 100%;
    display: flex;
    align-items: center;
}

/* 导航链接样式 */
.nav-item {
    position: relative;
}

.nav-item::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--secondary-color);
    transition: width 0.3s ease;
}

.nav-item:hover::after {
    width: 100%;
}

.nav-item.active::after {
    width: 100%;
}

/* 首页横幅样式 - 确保所有内容完整显示 */
#home {
    margin-top: 0;
    padding-top: 1.5rem;
    padding-bottom: 1.5rem;
    min-height: 800px;
    position: relative;
}

/* 确保轮播背景能够正确跟随#home区域的高度 */
#banner-carousel {
    height: 100%;
    min-height: inherit;
}

/* 搜索区容器样式 */
#home .container.mx-auto.px-4.relative.z-10.pb-8 {
    padding-bottom: 1.5rem;
}

/* 搜索区和核心服务区布局 */
#home .search-services-container {
    margin-bottom: 0;
}



/* 常用数据库模块样式 - 确保在banner中完整显示 */
#home .mt-6.bg-white\/95.backdrop-blur-sm.rounded-xl.shadow-xl.overflow-hidden.w-full.lg\:w-9\/10 {
    margin-top: 1.5rem;
    position: relative;
    z-index: 10;
}

/* 响应式布局优化 */
@media (max-width: 1024px) {
    #home {
        min-height: 1050px;
        padding-top: 35px;
        padding-bottom: 35px;
    }
}

@media (max-width: 768px) {
    #home {
        min-height: 1000px;
        padding-top: 30px;
        padding-bottom: 30px;
    }
}

@media (max-width: 480px) {
    #home {
        min-height: 950px;
        padding-top: 25px;
        padding-bottom: 25px;
    }
}

.banner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(30, 64, 175, 0.95), rgba(59, 130, 246, 0.95));
    z-index: -1;
}

.banner::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm-43-7c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm63 31c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM34 90c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm56-76c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM12 86c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm28-65c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm23-11c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-6 60c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm29 22c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zM32 63c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm57-13c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-9-21c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM60 91c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM35 41c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM12 60c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2z' fill='%23ffffff' fill-opacity='0.05' fill-rule='evenodd'/%3E%3C/svg%3E");
    z-index: -1;
}

/* 资源卡片样式 */
.resource-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.resource-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
}

.resource-card .card-icon {
    transition: all 0.3s ease;
}

.resource-card:hover .card-icon {
    transform: scale(1.1);
}

/* 公告卡片样式 */
.announcement-card {
    transition: all 0.3s ease;
    border-left: 4px solid transparent;
}

.announcement-card:hover {
    border-left: 4px solid var(--primary-color);
    background-color: var(--light-color);
    transform: translateX(5px);
}

/* 服务卡片样式 */
.service-card {
    transition: all 0.3s ease;
}

.service-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

/* 资源动态列表圆点样式 - 修复圆点变成长条的问题 */
.resource-dot {
    width: 0.5rem !important;
    height: 0.5rem !important;
    min-width: 0.5rem !important;
    display: inline-block !important;
    flex-shrink: 0 !important;
}

/* 相关链接样式 */
.links-section h2 {
    color: var(--primary-color);
    font-weight: 700;
    position: relative;
    display: inline-block;
}

.links-section h2::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 80%;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 2px;
}

/* 学校相关链接样式 */
.school-links a {
    background-color: var(--school-link-bg);
    color: var(--primary-color);
    border: 1px solid rgba(30, 64, 175, 0.1);
    transition: all 0.3s ease;
}

.school-links a:hover {
    background-color: var(--school-link-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

/* 图书馆相关链接样式 */
.library-links a {
    background-color: var(--library-link-bg);
    color: var(--secondary-color);
    border: 1px solid rgba(59, 130, 246, 0.1);
    transition: all 0.3s ease;
}

.library-links a:hover {
    background-color: var(--library-link-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

/* 通用链接卡片样式 */
.card-hover {
    border-radius: 8px;
    position: relative;
    overflow: hidden;
}

.card-hover::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.5s ease;
}

.card-hover:hover::before {
    left: 100%;
}

.service-card:hover .service-icon {
    background-color: rgba(30, 64, 175, 0.2);
}

/* 图书推荐卡片样式 */
.book-card {
    transition: all 0.3s ease;
}

.book-card:hover {
    transform: translateY(-5px);
}

.book-card .book-cover {
    transition: all 0.3s ease;
}

.book-card:hover .book-cover {
    transform: scale(1.05);
}

/* 访问统计图表样式 */
.chart-container {
    position: relative;
    height: 300px;
    width: 100%;
}

/* 响应式设计优化 */
@media (max-width: 768px) {
    .hero-content {
        padding: 1rem;
    }
    
    .nav-links {
        display: none;
    }
    
    .search-bar {
        width: 100%;
        margin-top: 1rem;
    }
    
    .mobile-menu {
        display: block;
    }
    
    .resource-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .service-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .banner h1 {
        font-size: 2rem;
    }
    
    .resource-grid {
        grid-template-columns: 1fr;
    }
    
    .card-title {
        font-size: 1.2rem;
    }
    
    .btn {
        width: 100%;
        text-align: center;
    }
}

/* 打印样式 */
@media print {
    .no-print {
        display: none;
    }
    
    body {
        font-size: 12pt;
        color: black;
        background: white;
    }
    
    .banner {
        background: white !important;
        color: black !important;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* 无障碍支持 */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* 高对比度模式 */
@media (prefers-contrast: high) {
    :root {
        --primary-color: #0033cc;
        --secondary-color: #0066ff;
        --dark-color: #000000;
    }
    
    .card {
        border: 2px solid #000;
    }
}

/* 暗色模式支持 */
@media (prefers-color-scheme: dark) {
    :root {
        --primary-color: #3b82f6;
        --secondary-color: #60a5fa;
        --light-color: #1e293b;
        --dark-color: #f1f5f9;
    }
    
    body {
        background-color: #0f172a;
        color: var(--dark-color);
    }
    
    .card {
        background-color: var(--light-color);
    }
    
    .form-input {
        background-color: #334155;
        border-color: #475569;
        color: var(--dark-color);
    }
    
    .form-input:focus {
        border-color: var(--secondary-color);
    }
}

/* 滚动动画 */
.scroll-reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.scroll-reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* 加载动画 */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 工具提示 */
.tooltip {
    position: relative;
    cursor: help;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--dark-color);
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 1000;
}

.tooltip:hover::after {
    opacity: 1;
    visibility: visible;
}

/* 活动集锦卡片样式 */
.news-card-wrapper {
    perspective: 1000px;
}

.news-card {
    position: relative;
    overflow: hidden;
}

.news-card-image {
    width: 100%;
    height: 100%;
    transition: transform 0.5s ease;
}

.news-card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    padding: 12px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0.6));
    color: white;
    transform: translateY(100%);
    transition: transform 0.4s ease;
    opacity: 0;
    display: flex;
    flex-direction: column;
}

.news-card:hover .news-card-overlay {
    transform: translateY(0);
    opacity: 1;
}

.news-card:hover .news-card-image {
    transform: scale(1.05);
}

.news-card-title {
    font-size: 0.875rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
    line-height: 1.2;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-card-description {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 0.5rem;
    line-height: 1.3;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-card-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.7);
    margin-top: auto;
}