/* ============================================================
   BotSearch 知识检索智能体 - 样式文件
   ============================================================ */

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
                 "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background: #f5f7fa;
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.main-content {
    flex: 1;
}

/* ============================================================
   Header
   ============================================================ */
.site-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 16px 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    color: white;
    text-decoration: none;
}

.logo-icon {
    font-size: 28px;
}

.logo-text {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 1px;
}

.logo-sub {
    font-size: 12px;
    opacity: 0.85;
    padding-left: 8px;
    border-left: 1px solid rgba(255, 255, 255, 0.3);
    margin-left: 4px;
}

.nav-links {
    display: flex;
    gap: 24px;
}

.nav-links a {
    color: white;
    text-decoration: none;
    font-size: 14px;
    opacity: 0.9;
    transition: opacity 0.2s;
}

.nav-links a:hover {
    opacity: 1;
    text-decoration: underline;
}

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
    background: #2d3748;
    color: #a0aec0;
    padding: 30px 0;
    text-align: center;
    margin-top: 60px;
}

.footer-sub {
    font-size: 12px;
    margin-top: 6px;
    opacity: 0.7;
}

/* ============================================================
   Hero Section (首页)
   ============================================================ */
.hero-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 80px 0 100px;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    border-radius: 50%;
}

.hero-content {
    text-align: center;
    position: relative;
    z-index: 1;
}

.hero-title {
    font-size: 48px;
    font-weight: 800;
    margin-bottom: 16px;
    line-height: 1.3;
}

.gradient-text {
    background: linear-gradient(90deg, #fef3c7, #fcd34d, #fbbf24);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 16px;
    opacity: 0.9;
    margin-bottom: 40px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Search Form */
.search-form {
    max-width: 650px;
    margin: 0 auto;
}

.search-box {
    display: flex;
    background: white;
    border-radius: 50px;
    padding: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.search-input {
    flex: 1;
    border: none;
    outline: none;
    padding: 14px 24px;
    font-size: 16px;
    background: transparent;
    border-radius: 50px;
    color: #333;
}

.search-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 50px;
    font-size: 16px;
    cursor: pointer;
    font-weight: 600;
    transition: transform 0.2s, box-shadow 0.2s;
}

.search-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.quick-tags {
    margin-top: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
}

.tag-label {
    font-size: 13px;
    opacity: 0.8;
}

.quick-tag {
    color: white;
    text-decoration: none;
    background: rgba(255, 255, 255, 0.2);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    transition: background 0.2s;
}

.quick-tag:hover {
    background: rgba(255, 255, 255, 0.35);
}

/* ============================================================
   Database Section (首页)
   ============================================================ */
.db-section {
    padding: 60px 0;
    margin-top: -50px;
    position: relative;
    z-index: 2;
}

.section-title {
    text-align: center;
    font-size: 28px;
    color: #1a202c;
    margin-bottom: 10px;
}

.title-icon {
    margin-right: 8px;
}

.section-subtitle {
    text-align: center;
    color: #718096;
    margin-bottom: 40px;
}

.db-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.db-card {
    background: white;
    border-radius: 16px;
    padding: 30px;
    text-decoration: none;
    color: inherit;
    transition: transform 0.3s, box-shadow 0.3s;
    position: relative;
    overflow: hidden;
    border: 2px solid transparent;
}

.db-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    opacity: 0;
    transition: opacity 0.3s;
}

.db-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.12);
    border-color: #667eea33;
}

.db-card:hover::before {
    opacity: 1;
}

.db-icon {
    font-size: 40px;
    margin-bottom: 16px;
}

.db-name {
    font-size: 18px;
    font-weight: 600;
    color: #1a202c;
    margin-bottom: 6px;
}

.db-count {
    font-size: 13px;
    color: #718096;
}

.db-arrow {
    position: absolute;
    right: 24px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 20px;
    color: #cbd5e0;
    transition: all 0.3s;
}

.db-card:hover .db-arrow {
    color: #667eea;
    right: 20px;
}

/* Database card color variants */
.db-card-ich { border-left: 4px solid #f56565; }
.db-card-ip { border-left: 4px solid #ed8936; }
.db-card-art { border-left: 4px solid #ecc94b; }
.db-card-knowledge { border-left: 4px solid #48bb78; }
.db-card-cases { border-left: 4px solid #38b2ac; }
.db-card-ai_gen { border-left: 4px solid #4299e1; }
.db-card-craft { border-left: 4px solid #667eea; }
.db-card-supply { border-left: 4px solid #9f7aea; }
.db-card-user { border-left: 4px solid #ed64a6; }

/* ============================================================
   Feature Section
   ============================================================ */
.feature-section {
    padding: 60px 0;
    background: white;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin-top: 40px;
}

.feature-card {
    text-align: center;
    padding: 30px 20px;
    border-radius: 12px;
    transition: background 0.3s;
}

.feature-card:hover {
    background: #f7fafc;
}

.feature-icon {
    font-size: 40px;
    margin-bottom: 16px;
}

.feature-card h3 {
    font-size: 16px;
    color: #1a202c;
    margin-bottom: 10px;
}

.feature-card p {
    font-size: 13px;
    color: #718096;
    line-height: 1.6;
}

/* ============================================================
   Search Header (结果页)
   ============================================================ */
.search-header-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 30px 0;
}

.search-form-small {
    max-width: 700px;
    margin: 0 auto;
}

.search-box-small {
    display: flex;
    background: white;
    border-radius: 12px;
    padding: 6px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

/* ============================================================
   Results Section
   ============================================================ */
.results-section {
    padding: 30px 0;
}

.results-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 30px;
}

/* Filter Sidebar */
.filter-sidebar {
    position: sticky;
    top: 20px;
    align-self: start;
}

.filter-panel {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.filter-title {
    font-size: 14px;
    font-weight: 600;
    color: #1a202c;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e2e8f0;
}

.filter-stats {
    text-align: center;
    padding: 10px 0;
}

.stat-number {
    font-size: 28px;
    font-weight: 700;
    color: #667eea;
    display: block;
}

.stat-label {
    font-size: 12px;
    color: #718096;
}

.filter-list {
    list-style: none;
}

.filter-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 10px;
    border-radius: 8px;
    margin-bottom: 4px;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s;
}

.filter-item:hover {
    background: #f7fafc;
}

.filter-item.active {
    background: #ebf4ff;
    color: #5a67d8;
}

.filter-item a {
    color: inherit;
    text-decoration: none;
    flex: 1;
}

.filter-count {
    background: #edf2f7;
    color: #718096;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}

.filter-item.active .filter-count {
    background: #c3dafe;
    color: #5a67d8;
}

.search-tips p {
    font-size: 12px;
    color: #718096;
    margin-bottom: 10px;
}

.tip-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tip-tag {
    background: #f7fafc;
    color: #4a5568;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    text-decoration: none;
    transition: background 0.2s;
}

.tip-tag:hover {
    background: #edf2f7;
}

/* Results Main */
.results-main {
    min-width: 0;
}

.results-header {
    margin-bottom: 20px;
}

.results-title {
    font-size: 20px;
    color: #1a202c;
    margin-bottom: 10px;
}

.results-title small {
    font-size: 13px;
    color: #718096;
    font-weight: normal;
    margin-left: 10px;
}

.highlight {
    color: #e53e3e;
}

.active-filters {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 13px;
    color: #718096;
}

.filter-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #ebf8ff;
    color: #2b6cb0;
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 12px;
}

.remove-filter {
    color: #2b6cb0;
    text-decoration: none;
    font-weight: bold;
    font-size: 14px;
    line-height: 1;
}

.remove-filter:hover {
    color: #e53e3e;
}

/* Result Cards */
.results-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.result-card {
    background: white;
    border-radius: 12px;
    padding: 20px 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: box-shadow 0.2s, transform 0.2s;
    border-left: 4px solid #667eea;
}

.result-card:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    transform: translateX(2px);
}

.result-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.result-badge {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    color: white;
}

.badge-ich { background: #f56565; }
.badge-ip { background: #ed8936; }
.badge-art { background: #d69e2e; }
.badge-knowledge { background: #38a169; }
.badge-cases { background: #319795; }
.badge-ai_gen { background: #3182ce; }
.badge-craft { background: #5a67d8; }
.badge-supply { background: #805ad5; }
.badge-user { background: #d53f8c; }

.result-db {
    font-size: 12px;
    color: #718096;
}

.result-score {
    margin-left: auto;
    font-size: 12px;
    color: #d69e2e;
    font-weight: 600;
}

.result-title {
    font-size: 18px;
    margin-bottom: 10px;
}

.result-title a {
    color: #1a202c;
    text-decoration: none;
    transition: color 0.2s;
}

.result-title a:hover {
    color: #667eea;
}

.result-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 12px;
}

.meta-item {
    font-size: 13px;
    color: #4a5568;
}

.meta-label {
    color: #718096;
}

.meta-value {
    font-weight: 500;
    color: #2d3748;
}

.result-desc {
    color: #4a5568;
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 12px;
}

.result-footer {
    display: flex;
    justify-content: flex-end;
}

.view-detail {
    color: #667eea;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: color 0.2s;
}

.view-detail:hover {
    color: #5a67d8;
    text-decoration: underline;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 30px;
    padding: 20px 0;
}

.page-link {
    padding: 10px 20px;
    background: white;
    border-radius: 8px;
    text-decoration: none;
    color: #4a5568;
    font-size: 14px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: all 0.2s;
}

.page-link:hover {
    background: #667eea;
    color: white;
}

.page-info {
    color: #718096;
    font-size: 14px;
}

/* No Results */
.no-results {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.no-results-icon {
    font-size: 60px;
    margin-bottom: 20px;
}

.no-results h3 {
    color: #1a202c;
    margin-bottom: 10px;
}

.no-results p {
    color: #718096;
    margin-bottom: 20px;
}

.no-results ul {
    text-align: left;
    max-width: 300px;
    margin: 0 auto 30px;
    color: #718096;
    font-size: 14px;
}

.no-results li {
    margin-bottom: 8px;
}

.back-home {
    display: inline-block;
    padding: 12px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    transition: transform 0.2s;
}

.back-home:hover {
    transform: translateY(-2px);
}

/* ============================================================
   Detail Page
   ============================================================ */
.detail-section {
    padding: 30px 0;
}

.detail-breadcrumb {
    margin-bottom: 20px;
    font-size: 13px;
    color: #718096;
}

.detail-breadcrumb a {
    color: #667eea;
    text-decoration: none;
}

.detail-breadcrumb a:hover {
    text-decoration: underline;
}

.crumb-sep {
    margin: 0 8px;
}

.crumb-current {
    color: #2d3748;
    font-weight: 500;
}

.detail-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.detail-header {
    padding: 30px 40px;
    border-bottom: 1px solid #e2e8f0;
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
}

.detail-badges {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.detail-db {
    font-size: 13px;
    color: #718096;
    background: white;
    padding: 4px 10px;
    border-radius: 6px;
}

.detail-title {
    font-size: 28px;
    color: #1a202c;
    line-height: 1.3;
}

.detail-body {
    padding: 30px 40px;
}

.detail-fields {
    display: grid;
    gap: 24px;
}

.detail-field {
    display: grid;
    grid-template-columns: 160px 1fr;
    gap: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #f0f0f0;
}

.detail-field:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.field-label {
    font-size: 14px;
    color: #718096;
    font-weight: 500;
    padding-top: 2px;
}

.field-value {
    font-size: 14px;
    color: #2d3748;
    line-height: 1.7;
    word-break: break-word;
}

.long-text {
    background: #f7fafc;
    padding: 16px;
    border-radius: 8px;
    line-height: 1.8;
}

.json-block {
    background: #1a202c;
    color: #a0aec0;
    padding: 16px;
    border-radius: 8px;
    font-size: 12px;
    overflow-x: auto;
    font-family: 'Courier New', monospace;
}

.detail-image {
    max-width: 100%;
    max-height: 400px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.detail-footer {
    padding: 20px 40px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f7fafc;
}

.back-btn {
    color: #667eea;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
}

.back-btn:hover {
    text-decoration: underline;
}

.detail-actions {
    display: flex;
    gap: 10px;
}

.action-btn {
    padding: 8px 16px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    color: #4a5568;
    transition: all 0.2s;
}

.action-btn:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

/* Error Page */
.error-page {
    text-align: center;
    padding: 80px 20px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.error-icon {
    font-size: 60px;
    margin-bottom: 20px;
}

.error-page h2 {
    color: #c53030;
    margin-bottom: 20px;
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 992px) {
    .db-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .feature-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .results-layout {
        grid-template-columns: 1fr;
    }

    .filter-sidebar {
        position: static;
    }
}

@media (max-width: 640px) {
    .hero-title {
        font-size: 32px;
    }

    .db-grid {
        grid-template-columns: 1fr;
    }

    .feature-grid {
        grid-template-columns: 1fr;
    }

    .nav-links {
        display: none;
    }

    .detail-field {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .detail-header,
    .detail-body,
    .detail-footer {
        padding-left: 20px;
        padding-right: 20px;
    }
}
