/* ========================================
   VISA REFERENCE - Modern Stylesheet V2
   ======================================== */

/* ========================================
   1. CSS Variables & Base Styles
   ======================================== */
:root {
    --primary-color-start: #667eea;
    --primary-color-end: #764ba2;
    --primary-gradient: linear-gradient(135deg, var(--primary-color-start) 0%, var(--primary-color-end) 100%);
    
    --secondary-color: #59a2f7; /* Sherpa CTA Button */
    
    --background-color: #f7f8fc;
    --card-background-color: #ffffff;
    
    --text-color-primary: #1d2b4f;
    --text-color-secondary: #5e6c87;
    --text-color-light: #ffffff;
    
    --border-color: #e9eef7;
    --border-radius-md: 12px;
    --border-radius-lg: 16px;
    
    --shadow-sm: 0 4px 6px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 10px 25px rgba(0, 0, 0, 0.06), 0 5px 10px rgba(0, 0, 0, 0.04);

    --font-family-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family-sans);
    line-height: 1.6;
    color: var(--text-color-primary);
    background-color: var(--background-color);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ========================================
   2. Layout Components
   ======================================== */
.container {
    max-width: 1200px;
    width: 100%; /* 这可能是关键！没有这个，容器可能不会响应窗口变化 */
    margin: 0 auto;
    padding: 0 0.5rem;
    animation: fadeIn 0.5s ease-out;
}

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

/* ========================================
   3. Header & Search
   ======================================== */
.header {
    background: var(--card-background-color);
    padding: 0;
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.header-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 0.1rem;
}

.site-brand {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    color: inherit;
    transition: opacity 0.3s ease;
}

.site-brand:hover {
    opacity: 0.8;
}

.logo {
    height: 40px; /* Slightly smaller logo */
    margin-right: 12px;
}

.site-title {
    font-size: 0.8rem;
    font-weight: 600;
    opacity: 0.8;
    color: var(--text-color-primary);
    line-height: 1.2;
}

.header-search {
    display: flex;
    align-items: center;
    width: 150px; /* Reduced by 50% from 300px */
    position: relative;
}

.header-search-form {
    display: flex;
    align-items: center;
    width: 100%;
    position: relative;
}

.search-input {
    width: 100%;
    padding: 10px 40px 10px 15px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    font-size: 14px;
    background: var(--background-color);
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color-start);
    background-color: var(--card-background-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

.search-button {
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    width: 40px;
    border: none;
    background: transparent;
    color: var(--text-color-secondary);
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-button:hover {
    color: var(--primary-color-start);
}

/* ========================================
   4. Main Navigation
   ======================================== */
.main {
    flex: 1;
    padding-top: 25px; /* 只控制垂直内边距，避免与 .container 冲突 */
    padding-bottom: 25px;
}

.main-nav {
    background: var(--background-color);
    border-top: 1px solid var(--border-color);
    padding: 0;
    overflow-x: auto;
}

.nav-container {
    display: flex;
    justify-content: center;
    max-width: 1200px;
    margin: 0 auto;
}

.nav-link {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 0.25rem;
    border-bottom: 3px solid transparent;
    background: transparent;
    color: var(--text-color-secondary);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    text-decoration: none;
}

.nav-link i {
    margin-right: 1px;
}

.nav-link:hover {
    background: var(--background-color);
    color: var(--text-color-primary);
    border-bottom-color: var(--primary-color-end);
}

.nav-link.active {
    color: var(--text-color-primary);
    border-bottom-color: var(--primary-color-start);
}

/* ========================================
   5. Minimalist Heading & Content Styles
   ======================================== */

h1, h2, h3, h4, h5, h6 {
    font-size: inherit;
    font-weight: 700;
    color: var(--text-color-primary);
    margin: 0;
    padding: 0;
}

.content-card {
    background: var(--card-background-color);
    border-radius: var(--border-radius-lg);
    padding: 1rem; /* 恢复适当的内边距，提供舒适的阅读空间 */
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
}

.content-card ul,
.content-card ol {
    padding-left: 1.5rem;
}

/* Pagination Styles */
.pagination-container {
    margin: 2rem 0;
    display: flex;
    justify-content: center;
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px;
    gap: 0.25rem; /* 间距变小50%: 从0.5rem改为0.25rem */
    background: var(--card-background-color);
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-sm);
}

.pagination .page-link {
    display: inline-block;
    padding: 0.375rem 0.5rem; /* padding变小50%: 从0.75rem 1rem改为0.375rem 0.5rem */
    margin: 0;
    font-size: 0.85rem; /* 字体大小改为0.85rem */
    color: #333;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-decoration: none;
    transition: background-color 0.3s, color 0.3s, border-color 0.3s;
    cursor: pointer;
    font-weight: 500;
}

.pagination .page-link:hover {
    background-color: #f5f5f5;
    border-color: #ccc;
}

.pagination .page-link.current {
    background-color: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
    cursor: default;
    font-weight: 700;
}

.pagination .page-link.disabled {
    color: #aaa;
    pointer-events: none;
    background-color: #f9f9f9;
    border-color: #ddd;
}

.pagination .page-link.prev,
.pagination .page-link.next {
    font-weight: 700;
}

.pagination .page-link.dots,
.pagination .page-dots {
    border: none;
    background: none;
    pointer-events: none;
    padding: 0.375rem 0.25rem; /* 与page-link保持一致，padding变小50% */
    font-size: 0.85rem; /* 与page-link保持一致 */
    color: #666;
    font-weight: normal;
}

/* Responsive adjustments for pagination */
@media (max-width: 480px) {
    .pagination {
        gap: 0.2rem; /* 在移动端进一步减小间距 */
    }
    .pagination .page-link {
        padding: 0.3rem 0.4rem; /* 在移动端进一步减小padding */
        font-size: 0.8rem; /* 在移动端稍微减小字体 */
    }
    .pagination .page-dots {
        padding: 0.3rem 0.2rem;
        font-size: 0.8rem;
    }
}

/* ========================================
   6. Page-Specific & Component Styles
   ======================================== */
.page-title {
    font-size: 1rem; /* For main page titles */
    margin-bottom: 0.15rem;
}

.tagline {
    font-size: 1rem;
    color: var(--text-color-secondary);
    margin-bottom: 1rem;
}

.article-list {
    border-top: 1px solid var(--border-color);
    padding-top: 10px;
}

/* 更新 .article-item (现在是 a 标签) 的样式 */
.article-item {
    display: block; /* 回归最简单的块级布局 */
    width: 100%; /* 关键：强制宽度等于父容器，不被内容撑开 */
    overflow: hidden; /* 关键：强制容器剪切掉所有溢出的内容 */
    padding: 25px 0;
    border-bottom: 1px solid var(--border-color);
    text-decoration: none; /* 移除链接下划线 */
    transition: background-color 0.2s ease;
}

/* 为整个项目添加悬停效果 */
.article-item:hover {
    background-color: #f7f8fc; /* 使用背景色作为悬停反馈 */
}

.article-item:hover h3 {
    color: var(--primary-color-start); /* 悬停时标题变色 */
}

/* 将溢出样式直接应用到 h3 和 p */
.article-item h3,
.article-item p {
    display: block; /* 确保表现为块级元素 */
    width: 100%; /* 明确设置宽度为100% */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%; /* 强制最大宽度为父容器的100% */
    min-width: 0; /* 允许收缩到0，确保文本截断生效 */
    box-sizing: border-box; /* 确保padding和border包含在宽度计算中 */
}

/* 设置标题和段落的默认颜色，覆盖链接的默认蓝色 */
.article-item h3 {
    color: var(--text-color-primary);
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 8px;
    transition: color 0.2s ease;
}

.article-item p {
    color: var(--text-color-secondary);
    font-size: 0.85rem;
}

.article-item:first-child {
    padding-top: 15px;
}
.article-item:last-child {
    border-bottom: none;
    padding-bottom: 15px;
}

/* 移除不再需要的旧规则 */
.article-title {
    margin-bottom: 8px;
}

.article-title a {
    text-decoration: none;
    color: var(--text-color-primary);
    font-size: 18px;
    font-weight: 600;
    transition: color 0.3s ease;
}

.article-title a:hover {
    color: var(--primary-color-start);
}

.article-excerpt {
    font-size: 15px;
    color: var(--text-color-secondary);
    /* 移除 line-height: 1.7; 避免干扰 */
}

/* Page Metadata Styles */
.page-metadata {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 1rem;
    align-items: center;
    font-size: 0.9rem;
    color: var(--text-color-secondary);
}

.metadata-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.metadata-item i {
    font-size: 0.85rem;
    opacity: 0.7;
}

.pagination {
    margin-top: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.page-link {
    text-decoration: none;
    color: var(--text-color-secondary);
    padding: 8px 14px;
    border-radius: 8px;
    transition: background-color 0.3s ease, color 0.3s ease;
    font-size: 14px;
    border: 1px solid var(--border-color);
}

.page-link:hover {
    background-color: var(--background-color);
    color: var(--text-color-primary);
}

.page-link.current {
    background: var(--primary-gradient);
    color: var(--text-color-light);
    border-color: transparent;
    font-weight: 600;
}

.page-link.disabled {
    color: #d1d5db;
    pointer-events: none;
}

/* ========================================
   7. New Section Styles
   ======================================== */
.query-section {
    margin-bottom: 30px;
}
.query-section:last-child {
    margin-bottom: 0;
}

.section-description {
    font-size: 15px;
    color: var(--text-color-secondary);
    margin-bottom: 25px; /* Reduced from 30px */
    max-width: 95%;
}

hr.section-divider {
    border: none;
    height: 2px;
    background-color: var(--border-color);
    margin: 0.5rem 0;
}

/* ========================================
   8. Forms
   ======================================== */
.query-form {
    margin-top: 0.8rem;
    margin-bottom: 0.8rem;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 10px;
    font-weight: 500;
    color: var(--text-color-primary);
}

.form-select {
    width: 100%;
    padding: 14px 18px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    font-size: 16px;
    background: var(--background-color);
    transition: all 0.3s ease;
}

.form-select:focus {
    outline: none;
    border-color: var(--primary-color-start);
    background-color: var(--card-background-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

/* ========================================
   9. Buttons
   ======================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: var(--border-radius-md);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary-gradient);
    color: white;
}

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

.btn:disabled,
.btn.disabled {
    background-color: #ccc;
    color: #666;
    border-color: #ccc;
    cursor: not-allowed;
    background-image: none;
}

/* ========================================
   10. Sherpa Section
   ======================================== */
#sherpa-section .btn-sherpa {
    background: var(--secondary-color);
    color: white;
    font-size: 1rem;
    padding: 0.5rem 1rem;
}

#sherpa-section .btn-sherpa:hover {
    background: #4a91e2;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(89, 162, 247, 0.3);
}

#sherpa-section .btn-sherpa .sherpa-icon {
    margin-left: 10px;
    font-size: 20px;
    transition: transform 0.3s ease;
}

#sherpa-section .btn-sherpa:hover .sherpa-icon {
    transform: translateX(5px);
}

.sherpa-note {
    display: block;
    margin-top: 15px;
    font-size: 13px;
    color: var(--text-color-secondary);
}

/* ========================================
   11. Statistics & Results
   ======================================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* Changed to force 4 columns */
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--card-background-color);
    border: 1px solid var(--border-color);
    padding: 25px;
    border-radius: var(--border-radius-md);
    text-align: center;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color-start);
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color-start);
    margin-bottom: 8px;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-color-secondary);
    font-weight: 500;
}

.result-container {
    margin-top: 20px;
}

.result-card {
    background: #fdfdff;
    border-radius: var(--border-radius-md);
    padding: 25px;
    border-left: 5px solid var(--primary-color-start);
}

.requirement-type {
    color: white;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
}

/* ========================================
   8. Footer
   ======================================== */
.footer {
    background: var(--background-color);
    padding: 2rem 0;
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-color-secondary);
    border-top: 1px solid var(--border-color);
}

.footer-nav {
    margin-bottom: 0.25rem;
}

.footer-link {
    display: inline-flex;
    align-items: center;
    color: var(--text-color-secondary);
    text-decoration: none;
    margin: 0 0.5rem;
    transition: color 0.3s ease;
}

.footer-link i {
    margin-right: 6px;
}

.footer-link:hover {
    color: var(--primary-color-start);
    text-decoration: underline;
}

.footer-separator {
    color: var(--border-color);
}

.footer-info {
    margin-bottom: 0.75rem;
}

.footer-info p {
    margin: 0.1rem 0;
}

.footer-info i {
    margin-right: 6px;
    color: var(--text-color-secondary);
}

.copyright {
    font-size: 0.85rem;
}

.copyright a {
    color: var(--text-color-secondary);
    text-decoration: none;
}

.copyright a:hover {
    text-decoration: underline;
}

/* 备案号样式 */
.icp-record {
    font-size: 0.8rem;
    margin-top: 0.5rem;
    opacity: 0.8;
}

.icp-record a {
    color: var(--text-color-secondary);
    text-decoration: none;
    transition: color 0.3s ease;
}

.icp-record a:hover {
    color: var(--primary-color-start);
    text-decoration: underline;
}

/* Homepage Feature Grid */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.feature-card {
    background-color: var(--card-background-color);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 2rem;
    text-align: center;
    text-decoration: none;
    color: var(--text-color-primary);
    box-shadow: var(--shadow-sm);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.feature-icon {
    font-size: 2.5rem;
    color: var(--primary-color-start);
    margin-bottom: 1rem;
}

.feature-card h3 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.feature-card p {
    font-size: 0.9rem;
    color: var(--text-color-secondary);
}


/* ========================================
   12. Footer
   ======================================== */
.footer {
    background: var(--background-color);
    color: var(--text-color-secondary);
    padding: 30px 0;
    margin-top: auto;
    border-top: 1px solid var(--border-color);
}

.footer-nav {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.footer-link {
    text-decoration: none;
    color: var(--text-color-secondary);
    font-size: 14px;
    transition: color 0.3s ease;
}

.footer-link:hover {
    color: var(--primary-color-start);
}

.copyright {
    text-align: center;
    font-size: 13px;
    color: #a7b3ce; /* Lighter secondary color */
}

/* Keep other styles like .visually-hidden, error, loading, tables etc. and responsive design */
/* They are largely fine, just minor tweaks might be covered by variable changes */
/* Below is the original CSS for reference and merging, I will keep the important parts */
/* ========================================
   Original CSS Snippets (to be merged/kept)
   ======================================== */

/* Accessibility */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.result-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--card-background-color);
    border-radius: var(--border-radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.result-table th,
.result-table td {
    padding: 14px 18px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.result-table th {
    background: var(--background-color);
    font-weight: 600;
    color: var(--text-color-secondary);
}

.result-table tr:hover {
    background: var(--background-color);
}

.result-table tr:last-child td {
    border-bottom: none;
}

.error-message {
    display: none;
    background: #fff0f0;
    color: #c53030;
    padding: 16px;
    border-radius: var(--border-radius-md);
    border-left: 4px solid #c53030;
    margin: 20px 0;
    font-weight: 500;
}

.loading-indicator {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--card-background-color);
    padding: 30px;
    border-radius: var(--border-radius-lg);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    text-align: center;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--primary-color-start);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

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

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

/* 护照指数页面样式 */
.index-explanation {
    margin-bottom: 1.5rem;
    color: #555;
    line-height: 1.6;
}

.loading-placeholder {
    text-align: center;
    padding: 2rem;
    color: #666;
    font-style: italic;
}

.error-placeholder {
    text-align: center;
    padding: 2rem;
    color: #d32f2f;
    font-style: italic;
}

.table-note {
    margin-top: 1rem;
    color: #666;
    font-style: italic;
    text-align: right;
}

/* 美化表格样式 */
.result-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.result-table th {
    background-color: #f5f5f5;
    padding: 0.75rem;
    text-align: left;
    border-bottom: 2px solid #ddd;
    font-weight: 600;
}

.result-table td {
    padding: 0.75rem;
    border-bottom: 1px solid #eee;
}

.result-table tr:hover {
    background-color: #f9f9f9;
}

.result-table tr:nth-child(even) td {
    background-color: rgba(255, 215, 0, 0.1);
}

.section-description {
    margin-bottom: 1.5rem;
    line-height: 1.6;
    color: #555;
}

/* 护照指数排名表格样式 */
.ranking-description {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.ranking-summary {
    background: #f8f9fa;
    padding: 20px;
    border-radius: var(--border-radius-md);
    margin-top: 20px;
    border-left: 4px solid var(--primary-color-start);
}

.ranking-summary p {
    margin: 0 0 10px 0;
    color: #495057;
}

.ranking-summary p:last-child {
    margin-bottom: 0;
}

.ranking-note {
    font-size: 0.9rem;
    color: #6c757d;
    font-style: italic;
}

/* 表格单元格样式 */
.rank-cell {
    font-weight: 600;
    color: var(--primary-color-start);
    text-align: center;
    min-width: 60px;
}

.country-cell {
    font-weight: 500;
    color: #333;
}

.visa-free-cell {
    font-weight: 600;
    color: #28a745;
    text-align: center;
}

.evisa-cell {
    color: #17a2b8;
    text-align: center;
}

.voa-cell {
    color: #ffc107;
    text-align: center;
}

.total-cell {
    font-weight: 600;
    color: #6f42c1;
    text-align: center;
}

/* 前三名特殊样式 */
.result-table tr:nth-child(1) .rank-cell {
    background: linear-gradient(45deg, #ffd700, #ffed4e);
    color: #333;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.result-table tr:nth-child(2) .rank-cell {
    background: linear-gradient(45deg, #c0c0c0, #e5e5e5);
    color: #333;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.result-table tr:nth-child(3) .rank-cell {
    background: linear-gradient(45deg, #cd7f32, #daa520);
    color: #333;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* 签证要求分布图表样式 - 饼图 */
.chart-container {
    padding: 20px;
    background: #f8f9fa;
    border-radius: var(--border-radius-md);
    margin: 20px 0;
}

.chart-container h3 {
    text-align: center;
    margin-bottom: 30px;
    color: #333;
}

.pie-chart-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 40px;
    flex-wrap: wrap;
    padding: 20px;
}

.pie {
    width: 220px;
    height: 220px;
    border-radius: 50%;
    background: var(--gradient, #f0f0f0);
    position: relative;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.pie:hover {
    transform: scale(1.05);
}

.pie::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 70px;
    height: 70px;
    background: white;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.pie-chart {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    position: relative;
    background: conic-gradient(
        from 0deg,
        #28a745 0deg var(--visa-free),
        #17a2b8 var(--visa-free) calc(var(--visa-free) + var(--e-visa)),
        #ffc107 calc(var(--visa-free) + var(--e-visa)) calc(var(--visa-free) + var(--e-visa) + var(--voa)),
        #dc3545 calc(var(--visa-free) + var(--e-visa) + var(--voa)) 360deg
    );
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.pie-chart:hover {
    transform: scale(1.05);
}

.pie-chart::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 60px;
    height: 60px;
    background: white;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.chart-legend {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 15px;
    background: white;
    border-radius: var(--border-radius-sm);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
}

.legend-item:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.legend-color {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    flex-shrink: 0;
}

.legend-color.visa-free {
    background: #28a745;
}

.legend-color.evisa {
    background: #17a2b8;
}

.legend-color.voa {
    background: #ffc107;
}

.legend-color.visa-required {
    background: #dc3545;
}

.legend-label {
    font-weight: 500;
    color: #333;
    min-width: 60px;
}

.legend-value {
    font-weight: 600;
    color: #666;
    margin-left: auto;
}

.legend-percentage {
    font-size: 0.9rem;
    color: #888;
    margin-left: 8px;
}

/* 保留原有的柱状图样式作为备用 */
.distribution-chart {
    display: flex;
    justify-content: space-around;
    align-items: flex-end;
    height: 200px;
    margin: 20px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: var(--border-radius-md);
}

/* 签证分布两栏式布局 */
.visa-distribution-container {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    justify-content: space-between;
    align-items: flex-start;
    margin: 20px 0;
    width: 100%;
}

.pie-chart-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    flex: 1;
    min-width: 250px;
}

.visa-counts-wrapper {
    min-width: 300px;
    flex: 1;
    background: white;
    border-radius: var(--border-radius-md);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    margin: 20px 0;
}

.visa-counts-wrapper h3 {
    text-align: center;
    margin-bottom: 20px;
    font-size: 1.1rem;
    color: var(--text-color-primary);
}

.visa-counts-table {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.visa-count-item {
    display: flex;
    align-items: center;
    padding: 5px 10px;
    border-radius: var(--border-radius-md);
    background: #f8f9fa;
    transition: transform 0.2s ease;
}

.visa-count-item:hover {
    transform: translateX(5px);
    background: #f0f0f0;
}

.visa-type-indicator {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    margin-right: 12px;
    flex-shrink: 0;
}

.visa-count-item.visa-free .visa-type-indicator {
    background-color: #5cb85c; /* Green */
}

.visa-count-item.evisa .visa-type-indicator {
    background-color: #337ab7; /* Blue */
}

.visa-count-item.voa .visa-type-indicator {
    background-color: #f0ad4e; /* Yellow/Orange */
}

.visa-count-item.visa-required .visa-type-indicator {
    background-color: #d9534f; /* Red */
}

.visa-count-item.other .visa-type-indicator {
    background-color: #777; /* Gray */
}

.visa-type-name {
    flex: 1;
    font-weight: 500;
    font-size: 0.95rem;
}

.visa-type-count {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-color-primary);
    min-width: 60px;
    text-align: right;
}

.chart-placeholder {
    text-align: center;
    padding: 20px;
    color: #666;
    background: #fff;
    border-radius: var(--border-radius-md);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.chart-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    margin: 0 10px;
}

.chart-bar {
    width: 40px;
    min-height: 20px;
    border-radius: 4px 4px 0 0;
    transition: all 0.3s ease;
    position: relative;
}

.chart-bar:hover {
    transform: scaleY(1.05);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.chart-label {
    margin-top: 8px;
    font-size: 0.8rem;
    font-weight: 500;
    color: #666;
    text-align: center;
}

.chart-value {
    margin-top: 4px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #333;
}

.distribution-summary {
    text-align: center;
    margin-top: 20px;
    padding: 15px;
    background: white;
    border-radius: var(--border-radius-md);
    border: 1px solid var(--border-color);
}

.distribution-summary p {
    margin: 0;
    color: #555;
    font-size: 0.9rem;
}

.chart-error {
    text-align: center;
    padding: 40px 20px;
    color: #dc3545;
    background: #f8d7da;
    border-radius: var(--border-radius-md);
    border: 1px solid #f5c6cb;
}

.chart-error p {
    margin: 0;
    font-size: 0.9rem;
}

/* ========================================
   13. Search Page Styles
   ======================================== */
.search-header {
    text-align: left;
    margin-bottom: 2rem;
}

.search-header h1 {
    color: var(--primary-color-start);
    margin-bottom: 0.5rem;
}

.search-form-container {
    margin-bottom: 2rem;
}

.search-input-group {
    display: flex;
    max-width: 600px;
    margin: 0;
    border: 2px solid var(--border-color);
    border-radius: 25px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.search-input-main {
    flex: 1;
    padding: 12px 20px;
    border: none;
    font-size: 16px;
    outline: none;
    background: var(--card-background-color);
}

.search-button-main {
    padding: 12px 24px;
    background: var(--primary-gradient);
    color: white;
    border: none;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    min-width: 80px;
    white-space: nowrap;
}

.search-button-main:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.search-stats {
    margin-bottom: 1rem;
    color: var(--text-color-secondary);
    font-size: 0.9rem;
}

.search-results-list {
    margin-bottom: 2rem;
}

.search-result-item {
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.2s ease;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background-color: var(--background-color);
    border-radius: var(--border-radius-md);
    margin: 0 -1rem;
    padding: 1.5rem 1rem;
}

.result-title {
    margin-bottom: 0.5rem;
}

.result-title a {
    color: var(--primary-color-start);
    text-decoration: none;
    font-size: 1rem;
    font-weight: 600;
    transition: color 0.3s ease;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.result-title a:hover {
    color: var(--primary-color-end);
    text-decoration: underline;
}

.result-summary {
    color: var(--text-color-secondary);
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 0.5rem;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.result-meta {
    display: flex;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-color-secondary);
    align-items: center;
    flex-wrap: wrap;
}

.result-category {
    background: var(--primary-gradient);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    flex-shrink: 0;
}

.result-date i,
.result-views i {
    margin-right: 0.25rem;
    font-size: 0.8rem;
    opacity: 0.7;
}

.result-date,
.result-views {
    display: flex;
    align-items: center;
    white-space: nowrap;
}

.no-results {
    text-align: center;
    padding: 3rem 0;
}

.no-results-icon {
    font-size: 3rem;
    color: var(--text-color-secondary);
    margin-bottom: 1rem;
    opacity: 0.6;
}

.search-tips {
    margin-top: 1.5rem;
    text-align: left;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
    background: var(--background-color);
    padding: 1.5rem;
    border-radius: var(--border-radius-md);
}

.search-tips h4 {
    color: var(--text-color-primary);
    margin-bottom: 0.5rem;
}

.search-tips ul {
    margin: 0;
    padding-left: 1.2rem;
}

.search-tips li {
    margin-bottom: 0.3rem;
    color: var(--text-color-secondary);
}

.visa-terms-section {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.visa-terms-section h2 {
    color: var(--text-color-primary);
    margin-bottom: 0.5rem;
}

.visa-terms-section p {
    color: var(--text-color-secondary);
    margin-bottom: 1rem;
}

.visa-terms-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.5rem;
    margin-top: 1rem;
}

.visa-term-tag {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: var(--background-color);
    color: var(--text-color-primary);
    text-decoration: none;
    border-radius: 20px;
    font-size: 0.9rem;
    text-align: center;
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
    font-weight: 500;
}

.visa-term-tag:hover {
    background: var(--primary-gradient);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
    border-color: transparent;
}

.terms-toggle-container {
    text-align: center;
    margin-top: 1rem;
}

.terms-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--background-color);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    color: var(--text-color-secondary);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.terms-toggle-btn:hover {
    background: var(--primary-gradient);
    color: white;
    border-color: transparent;
    transform: translateY(-1px);
}

.toggle-icon {
    font-size: 0.8rem;
    transition: transform 0.3s ease;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .visa-distribution-container {
        flex-direction: column;
    }
    
    .visa-counts-wrapper {
        width: 100%;
    }
    
    .pie-chart-wrapper {
        width: 100%;
        flex-direction: column;
        gap: 30px;
    }
    
    .pie-chart {
        width: 150px;
        height: 150px;
    }
    
    .pie-chart::before {
        width: 45px;
        height: 45px;
    }
    
    .chart-legend {
        width: 100%;
        max-width: 300px;
    }
    
    .distribution-chart {
        height: 150px;
        padding: 15px;
    }
    
    .chart-bar {
        width: 30px;
    }
    
    .chart-label {
        font-size: 0.7rem;
    }
    
    .chart-value {
        font-size: 0.8rem;
    }

    /* Search page responsive styles */
    .search-input-group {
        max-width: 100%;
        border-radius: 15px;
    }
    
    .search-button-main {
        padding: 12px 20px;
        min-width: 70px;
        font-size: 15px;
    }
    
    .visa-terms-grid {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    }
    
    .result-meta {
        gap: 0.3rem;
    }
    
    .search-result-item:hover {
        margin: 0 !important;
        padding: 1.5rem 0 !important;
    }
}