/* ==========================================
   通查网站统一样式表
   Unified Stylesheet for Tongcha Platform

   基于 Tailwind CSS + 自定义样式
   ========================================== */

/* 全局字体设置 */
* {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* ==========================================
   核心样式 Core Styles
   ========================================== */

/* 渐变背景 */
.gradient-bg {
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 50%, #06b6d4 100%);
}

/* 玻璃效果 */
.glass-effect {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* 价格标签渐变 */
.price-tag {
    background: linear-gradient(135deg, #f59e0b, #ef4444);
}

/* 卡片悬停效果 */
.card-hover {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-hover:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

/* 搜索框焦点效果 */
.search-input:focus,
.query-input:focus {
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.3);
    border-color: #3b82f6;
}

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

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* 分类图标渐变 */
.category-icon {
    background: linear-gradient(135deg, #3b82f6, #06b6d4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* 导航项下划线动画 */
.nav-item {
    position: relative;
}

.nav-item::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: #3b82f6;
    transition: width 0.3s;
}

.nav-item:hover::after {
    width: 100%;
}

/* 隐藏滚动条但保持功能 */
.scroll-hidden::-webkit-scrollbar {
    display: none;
}

.scroll-hidden {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* ==========================================
   列表页样式 List Page Styles
   ========================================== */

/* 分类项 */
.category-item {
    transition: all 0.2s;
}

.category-item:hover {
    background-color: #eff6ff;
    color: #2563eb;
}

.category-item.active {
    background: linear-gradient(135deg, #3b82f6, #06b6d4);
    color: white;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

/* 标签项 */
.tag-item {
    transition: all 0.2s;
}

.tag-item:hover {
    background-color: #dbeafe;
    border-color: #3b82f6;
    color: #1d4ed8;
}

.tag-item.active {
    background-color: #3b82f6;
    border-color: #3b82f6;
    color: white;
}

/* 视图切换按钮 */
.view-btn {
    transition: all 0.2s;
}

.view-btn.active {
    background-color: #3b82f6;
    color: white;
    border-color: #3b82f6;
}

/* 排序选择框 */
.sort-select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
    -webkit-appearance: none;
    appearance: none;
}

/* 分页按钮 */
.pagination-btn {
    transition: all 0.2s;
}

.pagination-btn:hover:not(:disabled) {
    background-color: #eff6ff;
    border-color: #3b82f6;
    color: #3b82f6;
}

.pagination-btn.active {
    background: linear-gradient(135deg, #3b82f6, #06b6d4);
    color: white;
    border-color: transparent;
}

/* Bootstrap Pagination 分页样式 */
.pagination {
    gap: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 24px 16px;
    flex-wrap: nowrap;
    list-style: none;
    margin: 0;
}

.pagination li {
    display: inline-flex;
    align-items: center;
    float: none;
    border: none;
    margin: 0;
}

.pagination li a,
.pagination li span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    font-size: 14px;
    font-weight: 500;
    color: #666666;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    white-space: nowrap;
    line-height: 1;
}

/* 上一页/下一页按钮 */
.pagination li:first-child a,
.pagination li:first-child span,
.pagination li:last-child a,
.pagination li:last-child span {
    min-width: 44px;
    font-weight: 600;
}

/* 上一页箭头 - 替换 « 为 ‹ */
.pagination li:first-child a,
.pagination li:first-child span {
    font-size: 0;
}
.pagination li:first-child a::after,
.pagination li:first-child span::after {
    content: '‹ 上一页';
    font-size: 14px;
}

/* 下一页箭头 - 替换 » 为 › */
.pagination li:last-child a,
.pagination li:last-child span {
    font-size: 0;
}
.pagination li:last-child a::after,
.pagination li:last-child span::after {
    content: '下一页 ›';
    font-size: 14px;
}

.pagination li a:hover {
    color: #3b82f6;
    border-color: #3b82f6;
    background: #eff6ff;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(59,130,246,0.2);
}

.pagination li a:active {
    transform: translateY(0);
}

/* 当前页样式 - active类 */
.pagination li.active span {
    background: #3b82f6;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: #ffffff;
    border-color: #3b82f6;
    box-shadow: 0 2px 8px rgba(59,130,246,0.3);
    font-weight: 600;
}

/* 禁用状态 */
.pagination li.disabled span {
    color: #cccccc;
    background: #f5f5f5;
    border-color: #e0e0e0;
    cursor: not-allowed;
    box-shadow: none;
}

/* 移动端适配 */
@media (max-width: 480px) {
    .pagination {
        gap: 8px;
        padding: 16px 12px;
    }

    .pagination li a,
    .pagination li span {
        min-width: 36px;
        height: 36px;
        padding: 0 10px;
        font-size: 13px;
        border-radius: 6px;
    }
}

/* 筛选徽章动画 */
.filter-badge {
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* 列表视图 */
.list-view .service-card {
    flex-direction: row;
    align-items: center;
}

.list-view .card-icon {
    width: 80px;
    height: 80px;
    margin-bottom: 0;
    margin-right: 1.5rem;
}

.list-view .card-content {
    flex: 1;
}

/* 价格高亮 */
.price-highlight {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ==========================================
   详情页样式 Detail Page Styles
   ========================================== */

/* 示例数据代码块 */
.sample-data {
    background: #1e293b;
    color: #e2e8f0;
    font-family: 'Courier New', monospace;
}

/* 激活的标签页 */
.tab-active {
    border-bottom: 3px solid #3b82f6;
    color: #3b82f6;
    font-weight: 600;
}

/* 功能图标 */
.feature-icon {
    background: linear-gradient(135deg, #dbeafe, #bfdbfe);
}

/* 步骤数字 */
.step-number {
    background: linear-gradient(135deg, #3b82f6, #06b6d4);
}

/* 高亮框 */
.highlight-box {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
}

/* JSON 语法高亮 */
.json-key { color: #93c5fd; }
.json-string { color: #86efac; }
.json-number { color: #fca5a5; }

/* 流程线 */
.flow-line {
    background: linear-gradient(to bottom, #3b82f6, #06b6d4);
}

/* 粘性侧边栏 */
.sticky-sidebar {
    position: sticky;
    top: 100px;
}

/* ==========================================
   响应式优化 Responsive
   ========================================== */

/* 移动端优化 */
@media (max-width: 768px) {
    .card-hover:hover {
        transform: translateY(-3px);
        box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    }

    .list-view .service-card {
        flex-direction: column;
        align-items: flex-start;
    }

    .list-view .card-icon {
        width: 60px;
        height: 60px;
        margin-bottom: 1rem;
        margin-right: 0;
    }
}

/* 平板端优化 */
@media (min-width: 768px) and (max-width: 1024px) {
    .grid-cols-3 {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ==========================================
   工具类 Utility Classes
   ========================================== */

/* 文本省略 */
.text-ellipsis {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 居中 */
.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 遮罩层 */
.overlay {
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

/* ==========================================
   加载动画 Loading Animations
   ========================================== */

/* 旋转加载 */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.animate-spin {
    animation: spin 1s linear infinite;
}

/* 弹跳加载 */
@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.animate-bounce {
    animation: bounce 1s ease-in-out infinite;
}

/* 淡入动画 */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.animate-fade-in {
    animation: fadeIn 0.3s ease-out;
}

/* ==========================================
   自定义滚动条 Custom Scrollbar
   ========================================== */

/* Webkit 浏览器 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

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

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

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Firefox 浏览器 */
* {
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 #f1f5f9;
}

/* ==========================================
   打印样式 Print Styles
   ========================================== */

@media print {
    .no-print {
        display: none !important;
    }

    .print-only {
        display: block !important;
    }

    body {
        background: white;
    }
}
