/* 重置和基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* 现代化配色方案 */
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --primary-light: #818cf8;
    --secondary-color: #8b5cf6;
    --accent-color: #ec4899;
    --text-color: #1f2937;
    --text-light: #6b7280;
    --text-muted: #9ca3af;
    --bg-color: #ffffff;
    --bg-secondary: #f9fafb;
    --bg-tertiary: #f3f4f6;
    --border-color: #e5e7eb;
    --border-light: #f3f4f6;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 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);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-secondary: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --gradient-hero: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    --gradient-card: linear-gradient(135deg, #ffffff 0%, #f9fafb 100%);
    --radius-sm: 6px;
    --radius: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background: var(--bg-color);
    overflow-x: hidden;
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-light);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

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

/* 主要内容区域 */
.main {
    min-height: calc(100vh - 200px);
}

/* 跳转链接 */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: var(--gradient-primary);
    color: white;
    padding: 12px 16px;
    text-decoration: none;
    border-radius: var(--radius);
    z-index: 1000;
    transition: top 0.3s ease;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
}

.skip-link:focus {
    top: 6px;
}

/* 面包屑导航 */
.breadcrumb {
    padding: 1.5rem 0;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-light);
    backdrop-filter: blur(10px);
}

.breadcrumb ol {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 0.9rem;
}

.breadcrumb li:not(:last-child)::after {
    content: "›";
    margin-left: 0.75rem;
    color: var(--text-muted);
    font-weight: bold;
}

.breadcrumb a {
    color: var(--text-light);
    text-decoration: none;
    transition: var(--transition);
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
}

.breadcrumb a:hover {
    color: var(--primary-color);
    background: var(--bg-tertiary);
}

.breadcrumb li[aria-current="page"] {
    color: var(--text-color);
    font-weight: 600;
    background: var(--primary-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-sm);
}

/* 英雄区域 */
.hero {
    padding: 5rem 0;
    text-align: center;
    background: var(--gradient-hero);
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="white" opacity="0.1"/><circle cx="75" cy="75" r="1" fill="white" opacity="0.1"/><circle cx="50" cy="10" r="0.5" fill="white" opacity="0.15"/><circle cx="10" cy="50" r="0.5" fill="white" opacity="0.15"/><circle cx="90" cy="50" r="0.5" fill="white" opacity="0.15"/><circle cx="50" cy="90" r="0.5" fill="white" opacity="0.15"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.3;
}

.hero .container {
    position: relative;
    z-index: 1;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    color: white;
    text-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    letter-spacing: -0.02em;
    animation: fadeInUp 0.8s ease-out;
}

.hero-subtitle {
    font-size: 1.375rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 3rem;
    font-weight: 400;
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

/* 搜索容器 */
.search-container {
    max-width: 700px;
    margin: 0 auto 3rem;
    animation: fadeInUp 0.8s ease-out 0.4s both;
}

.search-form {
    position: relative;
}

.search-input-group {
    display: flex;
    border: 2px solid transparent;
    border-radius: var(--radius-xl);
    overflow: hidden;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: var(--shadow-xl);
    transition: var(--transition);
    backdrop-filter: blur(10px);
}

.search-input-group:focus-within {
    transform: translateY(-2px);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    border-color: var(--primary-light);
}

.search-input {
    flex: 1;
    padding: 1.25rem 2rem;
    border: none;
    outline: none;
    font-size: 1.1rem;
    background: transparent;
    color: var(--text-color);
}

.search-input::placeholder {
    color: var(--text-muted);
    font-weight: 400;
}

.search-button {
    padding: 1.25rem 2.5rem;
    background: var(--gradient-primary);
    color: white;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 600;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    position: relative;
    overflow: hidden;
}

.search-button::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;
}

.search-button:hover::before {
    left: 100%;
}

.search-button:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-lg);
}

.search-icon {
    font-size: 1.3rem;
}

/* 热门搜索 */
.popular-searches {
    margin-top: 3rem;
    animation: fadeInUp 0.8s ease-out 0.6s both;
}

.popular-searches h3 {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 1.5rem;
    font-weight: 500;
}

.popular-tags {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.tag {
    padding: 0.75rem 1.5rem;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    text-decoration: none;
    border-radius: var(--radius-lg);
    font-size: 0.95rem;
    font-weight: 500;
    transition: var(--transition);
    border: 1px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.tag::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.2);
    transition: left 0.3s;
}

.tag:hover::before {
    left: 100%;
}

.tag:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

/* 搜索结果 */
.search-results {
    padding: 4rem 0;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
    padding: 1.5rem;
    background: var(--gradient-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.results-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-color);
}

.results-stats {
    color: var(--text-light);
    font-size: 1rem;
    font-weight: 500;
}

.results-container {
    display: grid;
    gap: 1.5rem;
}

.result-item {
    background: var(--gradient-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 2rem;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

.result-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--gradient-primary);
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

.result-item:hover::before {
    transform: scaleY(1);
}

.result-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
    border-color: var(--primary-light);
}

.result-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text-color);
}

.result-link {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

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

.result-meta {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.result-meta span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.result-description {
    color: var(--text-light);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.result-actions {
    display: flex;
    gap: 1rem;
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 0.95rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transition);
    font-weight: 500;
    position: relative;
    overflow: hidden;
}

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

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--border-color);
    transform: translateY(-1px);
}

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

.btn-copy:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-download {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.btn-download:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 3rem;
    padding: 2rem;
    background: var(--gradient-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.pagination button {
    padding: 0.75rem 1.5rem;
    background: var(--gradient-primary);
    color: white;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pagination button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.pagination button:disabled {
    background: var(--bg-tertiary);
    color: var(--text-muted);
    cursor: not-allowed;
    transform: none;
}

.pagination span {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-color);
    padding: 0.5rem 1rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius);
}

/* 加载动画 */
.loading {
    text-align: center;
    padding: 4rem;
}

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

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

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

/* 特性区域 */
.features {
    padding: 5rem 0;
    background: var(--bg-secondary);
    position: relative;
}

.features::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--gradient-primary);
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 4rem;
    color: var(--text-color);
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -1rem;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: var(--gradient-primary);
    border-radius: 2px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.feature-card {
    text-align: center;
    padding: 2.5rem;
    background: var(--gradient-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    border: 1px solid var(--border-light);
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-primary);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.feature-card:hover::before {
    transform: scaleX(1);
}

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

.feature-icon {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.feature-card h3 {
    font-size: 1.375rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.feature-card p {
    color: var(--text-light);
    line-height: 1.6;
    font-size: 1rem;
}

/* 使用指南 */
.guide {
    padding: 5rem 0;
    background: var(--bg-secondary);
    position: relative;
}

.guide::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--gradient-primary);
}

.guide-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.guide-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 2.5rem;
    background: var(--gradient-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    border: 1px solid var(--border-light);
}

.guide-step::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-primary);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.guide-step:hover::before {
    transform: scaleX(1);
}

.guide-step:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
}

.step-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    background: var(--gradient-primary);
    color: white;
    font-size: 1.5rem;
    font-weight: 700;
    border-radius: 50%;
    margin-bottom: 1.5rem;
    position: relative;
    z-index: 1;
}

.step-number::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: scale(0);
    transition: transform 0.3s ease;
}

.guide-step:hover .step-number::after {
    transform: scale(1);
}

.guide-step h3 {
    font-size: 1.375rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.guide-step p {
    color: var(--text-light);
    line-height: 1.6;
    font-size: 1rem;
}

/* 页脚 */
.footer {
    background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
    color: white;
    padding: 4rem 0 2rem;
    position: relative;
    overflow: hidden;
}

.footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--gradient-primary);
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer-section h3,
.footer-section h4 {
    margin-bottom: 1.5rem;
    font-weight: 700;
    color: white;
}

.footer-section h3 {
    font-size: 1.5rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.75rem;
}

.footer-section a {
    color: #d1d5db;
    text-decoration: none;
    transition: var(--transition);
    padding: 0.25rem 0;
    border-radius: var(--radius-sm);
}

.footer-section a:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid #374151;
    color: #9ca3af;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-subtitle {
        font-size: 1.125rem;
    }
    
    .hero {
        padding: 3rem 0;
    }
    
    .search-input-group {
        flex-direction: column;
        border-radius: var(--radius-lg);
    }
    
    .search-button {
        width: 100%;
        justify-content: center;
    }
    
    .popular-tags {
        justify-content: flex-start;
    }
    
    .results-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
    }
    
    .section-title {
        font-size: 2rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }
    
    .hero {
        padding: 2rem 0;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .search-container {
        margin-bottom: 2rem;
    }
    
    .search-input {
        padding: 1rem 1.5rem;
    }
    
    .search-button {
        padding: 1rem 1.5rem;
    }
    
    .feature-card {
        padding: 2rem 1.5rem;
    }
    
    .result-item {
        padding: 1.5rem;
    }
}

/* 无结果提示 */
.no-results {
    text-align: center;
    padding: 4rem;
    color: var(--text-light);
}

.no-results h3 {
    font-size: 1.75rem;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.no-results p {
    font-size: 1.125rem;
}

/* 错误提示 */
.error-message {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    color: #dc2626;
    padding: 1.25rem;
    border-radius: var(--radius);
    margin: 1.5rem 0;
    border: 1px solid #fecaca;
    font-weight: 500;
}

/* 辅助功能 */
.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;
}

/* 焦点样式 */
button:focus,
input:focus,
a:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* 暗色模式支持 */
@media (prefers-color-scheme: dark) {
    :root {
        --text-color: #f9fafb;
        --text-light: #d1d5db;
        --text-muted: #9ca3af;
        --bg-color: #111827;
        --bg-secondary: #1f2937;
        --bg-tertiary: #374151;
        --border-color: #4b5563;
        --border-light: #374151;
    }
    
    .search-input-group {
        background: rgba(31, 41, 55, 0.95);
    }
    
    .result-item,
    .feature-card,
    .results-header {
        background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
        border-color: var(--border-color);
    }
    
    .search-input {
        color: var(--text-color);
    }
    
    .hero::before {
        opacity: 0.2;
    }
}

/* 动画和过渡效果 */
.fade-in {
    animation: fadeInUp 0.6s ease-out;
}

.slide-in-left {
    animation: slideInLeft 0.6s ease-out;
}

.slide-in-right {
    animation: slideInRight 0.6s ease-out;
}

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

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* 悬浮提示 */
.tooltip {
    position: relative;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--text-color);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 1000;
}

.tooltip:hover::after {
    opacity: 1;
    visibility: visible;
}
