/* DuckDuckGo 风格搜索引擎 - 支持白天/黑夜模式 */

:root {
    /* 白天模式颜色 */
    --ddg-primary: #de5833;
    --ddg-primary-hover: #c04a2b;
    --ddg-bg: #ffffff;
    --ddg-bg-secondary: #f8f9fa;
    --ddg-text: #222222;
    --ddg-text-secondary: #666666;
    --ddg-border: #d0d0d0;
    --ddg-border-light: #e8e9ea;
    --ddg-link: #0064b7;
    --ddg-link-hover: #004a8a;
    --ddg-visited: #612d70;
    --ddg-shadow: rgba(0, 0, 0, 0.1);
    --ddg-shadow-hover: rgba(0, 0, 0, 0.15);
    --ddg-overlay: rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] {
    /* 黑夜模式颜色 */
    --ddg-primary: #ff6b4a;
    --ddg-primary-hover: #ff5733;
    --ddg-bg: #1a1a1a;
    --ddg-bg-secondary: #2d2d2d;
    --ddg-text: #e0e0e0;
    --ddg-text-secondary: #a0a0a0;
    --ddg-border: #404040;
    --ddg-border-light: #333333;
    --ddg-link: #4da6ff;
    --ddg-link-hover: #66b3ff;
    --ddg-visited: #a569bd;
    --ddg-shadow: rgba(0, 0, 0, 0.3);
    --ddg-shadow-hover: rgba(0, 0, 0, 0.4);
    --ddg-overlay: rgba(255, 255, 255, 0.05);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
    background-color: var(--ddg-bg);
    color: var(--ddg-text);
    line-height: 1.5;
    font-size: 14px;
    transition: background-color 0.3s, color 0.3s;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 顶部控制区域 */
.top-controls {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* 在线人数显示 */
.online-counter {
    background: var(--ddg-bg-secondary);
    border: 1px solid var(--ddg-border);
    border-radius: 24px;
    padding: 8px 16px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: var(--ddg-text-secondary);
    box-shadow: 0 2px 8px var(--ddg-shadow);
    transition: all 0.3s;
    user-select: none;
}

.online-counter:hover {
    background: var(--ddg-overlay);
    box-shadow: 0 4px 12px var(--ddg-shadow-hover);
    transform: translateY(-1px);
}

.online-icon {
    font-size: 16px;
    line-height: 1;
}

.online-text {
    font-weight: 500;
    white-space: nowrap;
}

/* 主题切换按钮 */
.theme-toggle {
    background: var(--ddg-bg-secondary);
    border: 1px solid var(--ddg-border);
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 20px;
    box-shadow: 0 2px 8px var(--ddg-shadow);
    transition: all 0.3s;
}

.theme-toggle:hover {
    background: var(--ddg-overlay);
    box-shadow: 0 4px 12px var(--ddg-shadow-hover);
    transform: translateY(-1px);
}

/* 页面布局 */
.home-page {
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.results-page {
    justify-content: flex-start;
}

/* 头部样式 */
.header {
    width: 100%;
    padding: 20px;
    transition: all 0.3s;
}

.header-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    text-align: center;
}

.header-compact {
    background: var(--ddg-bg);
    border-bottom: 1px solid var(--ddg-border);
    padding: 16px 20px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 3px var(--ddg-shadow);
}

/* Logo 样式 */
.logo {
    text-align: center;
}

.logo-icon {
    margin-bottom: 20px;
    color: var(--ddg-primary);
    opacity: 0.8;
}

.logo h1 {
    font-size: 3.5rem;
    font-weight: 300;
    margin-bottom: 8px;
    letter-spacing: -1px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
}

/* 彩色SESE字母样式 */
.colorful-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
}

.letter {
    font-weight: 700;
    font-size: 3.5rem;
    margin: 0;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
}

.letter-s {
    color: #e53e3e; /* 红色 */
}

.letter-e {
    color: #f6ad55; /* 橙色 */
}

.letter-s2 {
    color: #f6ad55; /* 橙色 */
}

.letter-e2 {
    color: #3182ce; /* 蓝色 */
}

.search-text {
    color: var(--ddg-text);
    font-weight: 300;
    margin-left: 12px;
    font-size: 3rem;
}

.logo .subtitle {
    font-size: 1.1rem;
    color: var(--ddg-text-secondary);
    margin-bottom: 40px;
    font-weight: 400;
}

.logo-small {
    font-size: 28px;
    font-weight: bold;
    color: var(--ddg-primary);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.logo-small .colorful-logo {
    font-size: 28px;
    gap: 0;
}

.logo-small .letter {
    font-size: 28px;
    font-weight: 700;
}

.logo-small .search-text {
    font-size: 24px;
    margin-left: 8px;
}

.logo-small svg {
    color: var(--ddg-primary);
    opacity: 0.9;
}

.logo-small:hover {
    color: var(--ddg-primary-hover);
}

.logo-small:hover svg {
    color: var(--ddg-primary-hover);
}

/* 容器样式 */
.home-container {
    max-width: 600px;
    width: 100%;
}

.results-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

/* 搜索表单 */
.search-form {
    width: 100%;
    max-width: 600px;
}

.search-box {
    position: relative;
    display: flex;
    border: 2px solid var(--ddg-border);
    border-radius: 24px;
    background: var(--ddg-bg);
    transition: all 0.3s;
    box-shadow: 0 2px 5px var(--ddg-shadow);
    overflow: hidden;
    /* 确保搜索框在小屏幕上不会断行 */
    min-width: 280px;
}

.search-box:focus-within {
    border-color: var(--ddg-primary);
    box-shadow: 0 2px 10px var(--ddg-shadow-hover);
}

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

.search-input::placeholder {
    color: var(--ddg-text-secondary);
}

.search-button {
    background: var(--ddg-primary);
    color: white;
    border: none;
    padding: 16px 20px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-button:hover {
    background: var(--ddg-primary-hover);
}

.search-button svg {
    width: 18px;
    height: 18px;
}

/* 搜索过滤器 */
.search-filters {
    display: flex;
    gap: 8px;
    margin-top: 16px;
    padding: 0 4px;
    overflow-x: auto;
    white-space: nowrap;
    justify-content: center;
    -webkit-overflow-scrolling: touch;
}

/* 视频排序过滤器 */
.video-sort-filters {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    padding: 0 4px;
    overflow-x: auto;
    white-space: nowrap;
    justify-content: center;
    -webkit-overflow-scrolling: touch;
}

.sort-label {
    color: var(--ddg-text-secondary);
    font-size: 0.9rem;
    margin-right: 8px;
    white-space: nowrap;
}

/* 隐藏Webkit浏览器的滚动条 */
.search-filters::-webkit-scrollbar,
.video-sort-filters::-webkit-scrollbar {
    display: none;
}

/* 为移动端添加滚动提示渐变 */
@media (max-width: 480px) {
    .search-filters::after {
        content: '';
        position: absolute;
        right: 0;
        top: 0;
        width: 20px;
        height: 100%;
        background: linear-gradient(to right, transparent, var(--ddg-bg));
        pointer-events: none;
        opacity: 0.7;
    }
}

.results-page .search-filters {
    justify-content: flex-start;
}

.filter-option {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    transition: all 0.3s;
    border: 1px solid var(--ddg-border);
    background: var(--ddg-bg);
    color: var(--ddg-text);
    white-space: nowrap; /* 防止文字换行 */
    flex-shrink: 0; /* 防止按钮被压缩 */
    min-width: fit-content; /* 确保按钮有足够宽度 */
}

.filter-option:hover {
    background: var(--ddg-bg-secondary);
}

.filter-option.active {
    background: var(--ddg-primary);
    color: white;
    border-color: var(--ddg-primary);
}

.filter-option input {
    display: none;
}

/* 主要内容区域 */
.main-content {
    flex: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    width: 100%;
}

.home-main {
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* 功能特性 */
.home-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.feature {
    text-align: center;
    padding: 20px;
}

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

.feature h3 {
    font-size: 1.2rem;
    margin-bottom: 8px;
    color: var(--ddg-text);
}

.feature p {
    color: var(--ddg-text-secondary);
}

/* 搜索技巧 */
.search-tips {
    background: var(--ddg-bg-secondary);
    border-radius: 12px;
    padding: 24px;
    border: 1px solid var(--ddg-border-light);
}

.search-tips h3 {
    margin-bottom: 16px;
    color: var(--ddg-text);
}

.search-tips ul {
    list-style: none;
    text-align: left;
}

.search-tips li {
    padding: 4px 0;
    color: var(--ddg-text-secondary);
    position: relative;
    padding-left: 20px;
}

.search-tips li::before {
    content: "•";
    color: var(--ddg-primary);
    font-weight: bold;
    position: absolute;
    left: 0;
}

/* 搜索结果 */
.search-stats {
    padding: 16px 0;
    color: var(--ddg-text-secondary);
    font-size: 13px;
    border-bottom: 1px solid var(--ddg-border-light);
    margin-bottom: 20px;
}

.search-time {
    color: var(--ddg-text-secondary);
}

.search-results {
    display: flex;
    flex-direction: column;
    gap: 16px; /* 减少间距，更紧凑 */
}

.result-item {
    padding: 16px;
    border-radius: 8px;
    transition: all 0.2s ease;
    border: 1px solid var(--ddg-border-light);
    background: var(--ddg-bg);
    
}

.result-item:hover {
    box-shadow: 0 4px 12px var(--ddg-shadow);
    border-color: var(--ddg-border);
    transform: translateY(-1px);
    background: var(--ddg-result-hover-bg);
}

.result-header {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 8px;
}

.result-number {
    color: var(--ddg-text-secondary);
    font-weight: 600;
    font-size: 14px;
    min-width: 24px;
    text-align: right;
    margin-top: 2px;
    /* 隐藏序号 */
    display: none;
}

.result-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    flex: 1;
    flex-wrap: wrap;
}

/* 在标题前显示的类型标签样式 */
.result-title .result-type {
    margin-right: 4px;
    order: -1; /* 确保标签显示在最前面 */
}

.result-emoji {
    font-size: 16px;
}

.result-title a {
    color: var(--ddg-link);
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    line-height: 1.3;
}

.result-title a:visited {
    color: var(--ddg-visited);
}

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

.result-members-inline {
    color: var(--ddg-text-secondary);
    font-size: 14px;
    font-weight: normal;
    white-space: nowrap;
}

.verified-badge-inline {
    color: #4CAF50;
    font-size: 14px;
    white-space: nowrap;
}

.verified-badge {
    color: #4CAF50;
    font-size: 16px;
}

.result-username {
    color: var(--ddg-link);
    font-size: 13px;
    font-weight: 500;
    margin-top: 4px;
    /* 隐藏用户名 */
    display: none;
}

.result-description {
    color: var(--ddg-text-secondary);
    line-height: 1.4;
    margin-bottom: 8px;
    font-size: 14px;
    margin-left: 0; /* 与标题对齐，不再与序号对齐 */
}

.result-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 12px;
    color: var(--ddg-text-secondary);
    flex-wrap: wrap;
    margin-left: 0; /* 与标题对齐，不再与序号对齐 */
}

.result-type {
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    background: linear-gradient(135deg, #607D8B, #455A64);
    border: 1px solid #607D8B;
}

/* 频道类型 - 红色渐变 */
.channel-result .result-type,
.result-type[data-type="channel"] {
    background: linear-gradient(135deg, #FF6B6B, #E55555);
    border: 1px solid #FF5252;
}

/* 群组类型 - 青色渐变 */
.group-result .result-type,
.result-type[data-type="group"] {
    background: linear-gradient(135deg, #4ECDC4, #26A69A);
    border: 1px solid #00BCD4;
}

/* 视频类型 - 紫色渐变 */
.video-result .result-type,
.result-type[data-type="video"] {
    background: linear-gradient(135deg, #9C27B0, #7B1FA2);
    border: 1px solid #9C27B0;
}

/* 图片类型 - 橙色渐变 */
.photo-result .result-type,
.result-type[data-type="photo"] {
    background: linear-gradient(135deg, #FF9800, #F57C00);
    border: 1px solid #FF9800;
}

/* 音频类型 - 蓝色渐变 */
.audio-result .result-type,
.result-type[data-type="audio"] {
    background: linear-gradient(135deg, #2196F3, #1976D2);
    border: 1px solid #2196F3;
}

/* 文档类型 - 灰色渐变 */
.document-result .result-type,
.result-type[data-type="document"] {
    background: linear-gradient(135deg, #607D8B, #455A64);
    border: 1px solid #607D8B;
}

/* 鼠标悬停效果 */
.result-type:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

/* 搜索统计信息 */
.search-stats {
    margin: 20px 0;
    padding: 12px;
    background: var(--ddg-result-bg);
    border-radius: 8px;
    color: var(--ddg-text-secondary);
    font-size: 14px;
    text-align: center;
    border: 1px solid var(--ddg-border-light);
}

.result-members::before {
    content: "👥 ";
}

.result-date::before {
    content: "📅 ";
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid var(--ddg-border-light);
}

.pagination-container {
    display: flex;
    align-items: center;
    gap: 6px; /* 缩小间距 */
    flex-wrap: nowrap; /* 不换行，保持一排 */
    overflow-x: auto; /* 水平滚动 */
    padding: 0 4px;
}

.pagination-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    text-decoration: none;
    color: var(--ddg-text);
    border-radius: 8px;
    transition: all 0.3s;
    padding: 0 8px; /* 缩小内边距 */
    border: 1px solid var(--ddg-border);
    background: var(--ddg-bg);
    white-space: nowrap; /* 不换行 */
    font-size: 14px;
    flex-shrink: 0; /* 不缩小 */
}

.pagination-link:hover {
    background: var(--ddg-bg-secondary);
    border-color: var(--ddg-border);
}

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

/* 错误和无结果 */
.error-message, .no-results {
    text-align: center;
    padding: 40px 20px;
    background: var(--ddg-bg-secondary);
    border-radius: 12px;
    border: 1px solid var(--ddg-border-light);
}

.error-message {
    background: #ffe6e6;
    border-color: #ffcdd2;
    color: #d8000c;
}

[data-theme="dark"] .error-message {
    background: #2d1b1b;
    border-color: #4a2c2c;
    color: #ff6b6b;
}

.no-results h3, .error-message h3 {
    margin-bottom: 16px;
    font-size: 20px;
}

.search-suggestions {
    list-style: none;
    text-align: left;
    max-width: 400px;
    margin: 20px auto 0;
}

.search-suggestions li {
    padding: 4px 0;
    position: relative;
    padding-left: 20px;
}

.search-suggestions li::before {
    content: "•";
    color: var(--ddg-primary);
    font-weight: bold;
    position: absolute;
    left: 0;
}

/* 页脚 */
.footer {
    background: var(--ddg-bg);
    /* border-top: 1px solid var(--ddg-border-light); */
    padding: 30px 20px;
    text-align: center;
    margin-top: auto;
}

.footer-content {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.footer-info {
    text-align: center;
}

.footer-info p {
    margin: 8px 0;
    color: var(--ddg-text-secondary);
    font-size: 14px;
    line-height: 1.5;
}

.footer-info p:first-child {
    color: var(--ddg-text);
    font-weight: 500;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 24px;
}

.footer-links a {
    color: var(--ddg-link);
    text-decoration: none;
    font-size: 14px;
    padding: 8px 12px;
    border-radius: 6px;
    transition: all 0.3s;
}

.footer-links a:hover {
    color: var(--ddg-link-hover);
    background: var(--ddg-overlay);
    text-decoration: none;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .logo h1 {
        font-size: 2.5rem;
    }
    
    .logo .letter {
        font-size: 2.5rem;
    }
    
    .logo .search-text {
        font-size: 2.2rem;
        margin-left: 10px;
    }
    
    .logo h1 svg {
        width: 28px;
        height: 28px;
    }
    
    .logo-icon svg {
        width: 40px;
        height: 40px;
    }
    
    .header-compact .results-container {
        flex-direction: column;
        gap: 16px;
        align-items: flex-start;
    }
    
    .search-form {
        width: 100%;
        max-width: none; /* 移除最大宽度限制 */
    }
    
    .search-box {
        min-width: 250px; /* 在中等屏幕上稍微减小最小宽度 */
    }
    
    .search-filters {
        justify-content: flex-start;
        gap: 6px; /* 减小间距 */
        margin-top: 12px; /* 减小顶部间距 */
        padding: 0 4px; /* 添加左右内边距，为滚动留空间 */
    }
    
    .filter-option {
        padding: 6px 12px;
        font-size: 12px;
        min-width: auto; /* 移除最小宽度限制 */
    }
    
    .main-content {
        padding: 16px;
    }
    
    .result-item {
        padding: 16px;
    }
    
    .result-title a {
        font-size: 16px;
    }
    
    .result-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .footer {
        padding: 24px 16px;
    }
    
    .footer-content {
        gap: 16px;
    }
    
    .footer-links {
        gap: 16px;
    }
    
    .footer-links a {
        font-size: 13px;
        padding: 6px 10px;
    }
    
    .theme-toggle {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
    
    .top-controls {
        top: 16px;
        right: 16px;
        flex-direction: column;
        align-items: flex-end;
        gap: 8px;
    }
    
    .online-counter {
        padding: 6px 12px;
        font-size: 12px;
        border-radius: 20px;
    }
    
    .online-icon {
        font-size: 14px;
    }
    
    .home-features {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

@media (max-width: 480px) {
    .search-box {
        border-radius: 20px;
        /* 保持水平布局，不要换行 */
    }
    
    .search-input {
        padding: 12px 16px;
        font-size: 14px;
        /* 确保输入框有足够空间但不会太宽 */
        min-width: 0; /* 允许flex收缩 */
    }
    
    .search-button {
        padding: 12px 16px;
        font-size: 14px;
        /* 确保按钮大小合适 */
        min-width: 48px; /* 最小宽度确保可点击 */
    }
    
    .search-button svg {
        width: 16px;
        height: 16px;
    }
    
    .search-filters {
        gap: 4px; /* 进一步减小间距 */
        margin-top: 10px;
        padding: 0 2px; /* 减小内边距 */
        /* 确保水平滚动在小屏幕上更明显 */
        -webkit-overflow-scrolling: touch;
        padding-bottom: 4px; /* 为可能的滚动条留空间 */
    }
    
    .filter-option {
        padding: 5px 10px; /* 减小内边距 */
        font-size: 11px; /* 减小字体 */
        border-radius: 16px; /* 减小圆角 */
    }
    
    .pagination-container {
        gap: 4px; /* 更小间距 */
        justify-content: flex-start; /* 左对齐，允许滚动 */
        overflow-x: auto; /* 水平滚动 */
        -webkit-overflow-scrolling: touch;
    }
    
    .pagination-link {
        min-width: 32px;
        height: 32px;
        font-size: 12px;
        padding: 0 6px;
        flex-shrink: 0; /* 不缩小 */
    }
    
    .footer-links {
        gap: 8px; /* 缩小间距保持在一排 */
        flex-wrap: wrap; /* 允许换行但优先保持一排 */
    }
    
    .footer-links a {
        font-size: 12px;
        padding: 4px 6px; /* 缩小内边距 */
        flex: 0 1 auto; /* 自适应宽度 */
    }
}

/* 超小屏幕优化 */
@media (max-width: 320px) {
    .logo h1 {
        font-size: 2rem;
    }
    
    .logo .letter {
        font-size: 2rem;
    }
    
    .logo .search-text {
        font-size: 1.8rem;
        margin-left: 8px;
    }
    
    .logo h1 svg {
        width: 24px;
        height: 24px;
    }
    
    .logo-icon svg {
        width: 36px;
        height: 36px;
    }
    
    .logo-small {
        font-size: 24px;
    }
    
    .logo-small .letter {
        font-size: 24px;
    }
    
    .logo-small .search-text {
        font-size: 20px;
        margin-left: 6px;
    }
    
    .logo-small svg {
        width: 18px;
        height: 18px;
    }
    
    .search-box {
        min-width: 240px;
        border-radius: 16px;
    }
    
    .search-input {
        padding: 10px 12px;
        font-size: 14px;
    }
    
    .search-button {
        padding: 10px 12px;
        min-width: 44px;
    }
    
    .search-button svg {
        width: 14px;
        height: 14px;
    }
    
    .search-filters {
        gap: 3px; /* 最小间距 */
        margin-top: 8px;
        padding: 0 1px;
    }
    
    .filter-option {
        padding: 4px 8px; /* 最小内边距 */
        font-size: 10px; /* 最小字体 */
        border-radius: 12px; /* 最小圆角 */
        min-width: auto;
    }
    
    /* 页脚链接在超小屏幕上也保持一排 */
    .footer-links {
        gap: 4px; /* 最小间距 */
    }
    
    .footer-links a {
        font-size: 10px; /* 最小字体 */
        padding: 3px 4px; /* 最小内边距 */
    }
    
    /* 分页在超小屏幕上的优化 */
    .pagination-container {
        gap: 2px; /* 最小间距 */
    }
    
    .pagination-link {
        min-width: 28px;
        height: 28px;
        font-size: 10px;
        padding: 0 4px;
    }
    
    .logo h1 {
        font-size: 2rem;
    }
    
    .header-compact {
        padding: 12px 16px;
    }
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid var(--ddg-border);
    border-top: 3px solid var(--ddg-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* 模态框样式 */
.modal {
    background: var(--ddg-bg);
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px var(--ddg-shadow-hover);
    animation: modalIn 0.3s ease-out;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px 16px;
    border-bottom: 1px solid var(--ddg-border-light);
}

.modal-header h3 {
    margin: 0;
    color: var(--ddg-text);
    font-size: 20px;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--ddg-text-secondary);
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s;
}

.modal-close:hover {
    background: var(--ddg-overlay);
    color: var(--ddg-text);
}

.modal-content {
    padding: 20px 24px 24px;
    color: var(--ddg-text);
    line-height: 1.6;
}

.modal-content h4 {
    color: var(--ddg-text);
    margin: 16px 0 8px 0;
    font-size: 16px;
}

.modal-content p {
    margin-bottom: 12px;
}

.modal-content ul {
    margin: 8px 0 16px 0;
    padding-left: 20px;
}

.modal-content li {
    margin-bottom: 4px;
    color: var(--ddg-text-secondary);
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* 分页点样式 */
.pagination-dots {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    color: var(--ddg-text-secondary);
    font-weight: bold;
}

/* 平滑过渡 */
* {
    transition: background-color 0.3s, color 0.3s, border-color 0.3s;
}

/* 暗色主题下的类型标签优化 */
[data-theme="dark"] .result-type {
    text-shadow: 0 1px 3px rgba(0,0,0,0.4);
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

[data-theme="dark"] .result-type:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}
