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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f7fa;
    /* 防止移动端偶发的横向滚动条 */
    overflow-x: hidden;
}

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

/* 头部样式 */
header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

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

.logo h1 {
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 0.2rem;
}

.logo h1 a {
    color: white;
    text-decoration: none;
}

.logo p {
    font-size: 0.9rem;
    opacity: 0.9;
}

.language-switcher {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.language-switcher a,
.language-switcher button {
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.3);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    text-decoration: none;
    line-height: 1;            /* 统一行高，避免 <a> 继承 body 的 1.6 导致更高 */
    display: inline-flex;      /* 垂直居中内容，视觉统一 */
    align-items: center;
    justify-content: center;
}

.language-switcher a:hover,
.language-switcher button:hover {
    background: rgba(255,255,255,0.3);
    transform: translateY(-1px);
}

/* 主要内容区域 */
main {
    flex: 1;
    padding: 0rem 0;
}

/* 搜索区域 */
.search-section {
    background: white;
    border-radius: 15px;
    padding: 3rem 2rem;
    margin-bottom: 3rem;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    text-align: center;
    margin-top: 20px;
}

.search-section h2 {
    font-size: 2.5rem;
    color: #333;
    margin-bottom: 0.5rem;
}

.search-section p {
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 2rem;
}

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

.search-input-wrapper {
    position: relative;
    margin-bottom: 1.5rem;
}

.search-input-wrapper input {
    width: 100%;
    padding: 1rem 1.5rem;
    font-size: 1.1rem;
    border: 2px solid #e1e8ed;
    border-radius: 50px;
    outline: none;
    transition: border-color 0.3s ease;
    background: #f8f9fa;
}

.search-input-wrapper input:focus {
    border-color: #667eea;
    background: white;
}

.language-filter label {
    display: block;
    margin-bottom: 1rem;
    font-weight: 600;
    color: #333;
}

.language-options {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.lang-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    padding: 0.5rem 1rem;
    border-radius: 25px;
    transition: all 0.3s ease;
    border: 2px solid #e1e8ed;
    background: white;
}

.lang-option:hover {
    border-color: #667eea;
    background: #f0f4ff;
}

.lang-option input[type="radio"] {
    display: none;
}

.lang-option input[type="radio"]:checked + span {
    color: #667eea;
    font-weight: bold;
}

.lang-option:has(input[type="radio"]:checked) {
    border-color: #667eea;
    background: #f0f4ff;
}

.search-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 1rem 3rem;
    font-size: 1.1rem;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.search-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.3);
}

/* 特性展示区域 */
.features-section {
    margin: 3rem 0;
}

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

.feature-card {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
}

.feature-card h3 {
    color: #667eea;
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.feature-card p {
    color: #666;
    line-height: 1.6;
}

/* 搜索结果页面样式 */
.search-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 15px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    border: 1px solid rgba(102, 126, 234, 0.1);
    margin-top: 20px;
}

.search-form.compact {
    /* Grid 重构：防止英文长文本挤压按钮换行 */
    --search-height: 54px;
    --search-radius: 14px;
    --search-gap: 0.9rem;
    --btn-min-width: 150px; /* 按钮不会被压缩到换行 */
    --lang-min-width: 170px; /* 语言选择最小宽度确保英文展示 */
    display: grid;
    grid-template-columns: minmax(0,1fr) var(--lang-min-width) var(--btn-min-width);
    gap: var(--search-gap);
    align-items: stretch;
    position: relative;
    width: 100%;
    max-width: 1080px;
    margin: 0 auto;
}

.search-form.compact .search-input-wrapper {
    min-width: 260px; /* 过窄时仍可压缩，主列 minmax(0,1fr) 允许文本收缩 */
    margin-bottom: 0;
    position: relative;
}

.search-form.compact .search-input-wrapper::before {
    content: "🔍";
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    z-index: 2;
    pointer-events: none;
}

.search-form.compact .search-input-wrapper input {
    width: 100%;
    padding: 0 1.4rem 0 3rem;
    font-size: 1rem;
    border: 1.5px solid #d7ddeb;
    border-radius: var(--search-radius);
    outline: none;
    transition: all 0.25s ease;
    background: linear-gradient(#fff,#fdfdff);
    height: var(--search-height);
    line-height: var(--search-height);
    box-sizing: border-box;
    box-shadow: 0 2px 4px rgba(30,41,59,0.06);
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-form.compact .search-input-wrapper input:focus {
    border-color: #667eea;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.15);
    transform: translateY(-1px);
}

.search-form.compact .search-input-wrapper input::placeholder {
    color: #999;
    transition: opacity 0.3s ease;
}

.search-form.compact .search-input-wrapper input:focus::placeholder {
    opacity: 0.7;
}

.language-filter.inline {
    position: relative;
}

.language-filter.inline::before {
    content: "⚡";
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #667eea;
    z-index: 2;
    pointer-events: none;
}

.language-filter.inline select {
    padding: 0 2.4rem 0 2.6rem;
    border: 1.5px solid #d7ddeb;
    border-radius: var(--search-radius);
    font-size: 0.95rem;
    background: linear-gradient(#fff,#fdfdff);
    outline: none;
    cursor: pointer;
    height: var(--search-height);
    width: 100%;
    box-sizing: border-box;
    transition: all 0.25s ease;
    box-shadow: 0 2px 4px rgba(30,41,59,0.06);
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%23667488' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.85rem center;
    background-repeat: no-repeat;
    background-size: 1.1em 1.1em;
    min-width: var(--lang-min-width);
}

.language-filter.inline select:focus {
    border-color: #667eea;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.15);
    transform: translateY(-1px);
}

.language-filter.inline select:hover {
    border-color: #a5b4fc;
}

.search-form.compact .search-btn {
    background: linear-gradient(135deg, #6366f1 0%, #7c3aed 100%);
    color: #fff;
    border: none;
    padding: 0 2rem;
    font-size: 0.92rem;
    border-radius: var(--search-radius);
    cursor: pointer;
    transition: all 0.25s ease;
    font-weight: 600;
    height: var(--search-height);
    white-space: nowrap;
    box-sizing: border-box;
    box-shadow: 0 4px 12px -2px rgba(99,102,241,0.45);
    position: relative;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    letter-spacing: 0.5px;
    min-width: var(--btn-min-width);
}

.search-form.compact .search-btn::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 ease;
}

.search-form.compact .search-btn:hover::before {
    left: 100%;
}

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

.search-form.compact .search-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.results-section {
    margin-top: 2rem;
}

.results-header {
    margin-bottom: 2rem;
}

.results-header h2 {
    color: #333;
    margin-bottom: 0.5rem;
}

.results-header p {
    color: #666;
    font-size: 1.1rem;
}

.results-grid {
    display: grid;
    gap: 2rem;
    /* 确保网格项在小屏可缩小而不挤出视口 */
    grid-template-columns: minmax(0, 1fr);
}

.function-card {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
    /* 允许在 Grid/Flex 下内容缩小；并阻止横向溢出影响页面 */
    min-width: 0;
    overflow-x: hidden;
}

.function-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.function-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    gap: 1rem;
}

.function-name-section {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.function-name {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    min-height: 1.4rem;
}

.name-wrapper h3 {
    color: #333;
    font-size: 1.4rem;
    margin: 0;
    line-height: 1.3;
    flex-shrink: 0;
}

.function-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: center;
}

.function-tags .tag {
    display: inline-flex;
    align-items: center;
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    color: #475569;
    padding: 0.3rem 0.8rem;
    border-radius: 16px;
    font-size: 0.8rem;
    font-weight: 500;
    border: 1px solid #e2e8f0;
    transition: all 0.2s ease;
}

.function-tags .tag:hover {
    background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);
    border-color: #cbd5e1;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(71, 85, 105, 0.1);
}

.language-tag {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
    white-space: nowrap;
    flex-shrink: 0;
}

.function-description {
    margin-bottom: 1.5rem;
}

.function-description p {
    color: #666;
    font-size: 1rem;
    line-height: 1.6;
}

.function-details {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.function-details > div {
    margin-bottom: 0.8rem;
}

.function-details > div:last-child {
    margin-bottom: 0;
}

.function-details strong {
    color: #333;
    margin-right: 0.5rem;
}

.param, .return {
    display: inline-block;
    background: #e3f2fd;
    color: #1976d2;
    padding: 0.2rem 0.6rem;
    border-radius: 15px;
    font-size: 0.9rem;
    margin-right: 0.5rem;
    margin-bottom: 0.3rem;
}

.scores {
    display: flex;
    gap: 2rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.score {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.score span:first-child {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 0.3rem;
}

.score-value {
    font-size: 1.2rem;
    font-weight: bold;
    color: #667eea;
}

.code-section {
    border-top: 1px solid #e1e8ed;
    padding-top: 1rem;
}

.code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    gap: 1rem;
}

.toggle-code {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 0.7rem 1.4rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
    position: relative;
    overflow: hidden;
}

.toggle-code::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 ease;
}

.toggle-code:hover::before {
    left: 100%;
}

.toggle-code:hover {
    background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.copy-code {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #64748b;
    padding: 0.6rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.25s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    min-width: 44px;
    height: 44px;
}

.copy-code:hover {
    background: #e2e8f0;
    border-color: #cbd5e1;
    color: #475569;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(100, 116, 139, 0.15);
}

.copy-code svg {
    width: 16px;
    height: 16px;
    transition: transform 0.2s ease;
}

.copy-code:hover svg {
    transform: scale(1.1);
}

.code-container {
    position: relative;
    /* 代码区内部独立滚动，避免撑开外层卡片 */
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.code-block {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    color: #e2e8f0;
    padding: 1.5rem;
    border-radius: 12px;
    overflow-x: auto;
    max-width: 100%;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', 'Source Code Pro', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
    border: 1px solid #475569;
    box-shadow: 0 4px 20px rgba(30, 41, 59, 0.4);
    position: relative;
}

.code-block::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, #64748b, transparent);
}

.code-block::-webkit-scrollbar {
    height: 8px;
}

.code-block::-webkit-scrollbar-track {
    background: #334155;
    border-radius: 4px;
}

.code-block::-webkit-scrollbar-thumb {
    background: #64748b;
    border-radius: 4px;
}

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

.no-results {
    text-align: center;
    padding: 3rem 2rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.no-results h3 {
    color: #333;
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.no-results p {
    color: #666;
    font-size: 1.1rem;
}

/* 底部样式 */
footer {
    background: #2d3748;
    color: white;
    text-align: center;
    padding: 2rem 0;

    margin-top: 3rem;
}

footer p {
    opacity: 0.8;
}

/* 最新文章模块 */
.latest-posts {
    margin: 3rem 0;
}

.latest-posts h2 {
    color: #333;
    margin-bottom: 2rem;
    font-size: 2rem;
    font-weight: 700;
    text-align: center;
}

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

.post-item {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    text-align: left;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
    text-decoration: none;
    color: inherit;
    display: block;
}

.post-item:hover {
    transform: translateY(-5px);
}

.post-meta {
    display: flex;
    gap: 0.8rem;
    align-items: center;
    margin-bottom: 1rem;
    color: #666;
    font-size: 0.9rem;
}

.post-tag {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.post-title {
    color: #667eea;
    margin-bottom: 1rem;
    font-size: 1.3rem;
    font-weight: 600;
}

.post-desc {
    color: #666;
    line-height: 1.6;
    font-size: 1rem;
}

/* 信息区块（支持/勘误/免责声明） */
.info-section {
    margin: 2rem 0 3rem;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.4rem;
}

.info-card {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.08);
    padding: 1.2rem 1.2rem 1.1rem;
    border: 1px solid rgba(102, 126, 234, 0.12);
}

.info-card h3 {
    color: #4f46e5; /* 接近 #667eea 的主色系 */
    font-size: 1.15rem;
    margin-bottom: 0.6rem;
}

.info-card p {
    color: #4b5563;
    line-height: 1.7;
    font-size: 0.98rem;
}

.support-content {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.support-qr {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 12px;
    padding: 0.6rem;
    min-width: 160px;
    margin: 0 auto;
}

.support-qr img {
    width: 160px;
    height: 160px;
    object-fit: contain;
    border-radius: 8px;
    background: #fff;
}

.qr-caption {
    font-size: 0.85rem;
    color: #64748b;
    margin-top: 0.35rem;
}

@media (max-width: 640px) {
    .info-card { border-radius: 12px; padding: 1rem; }
    .support-qr { min-width: 140px; }
    .support-qr img { width: 140px; height: 140px; }
}

/* 响应式设计 */
@media (max-width: 980px) { /* 过渡断点：稍早压缩布局 */
    .search-form.compact {
        --btn-min-width: 130px;
        --lang-min-width: 150px;
        grid-template-columns: minmax(0,1fr) var(--lang-min-width) var(--btn-min-width);
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    header .container {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .search-section {
        padding: 2rem 1rem;
    }
    
    .search-section h2 {
        font-size: 2rem;
    }
    
    .language-options {
        justify-content: center;
        gap: 0.5rem;
    }
    
    .lang-option {
        padding: 0.4rem 0.8rem;
        font-size: 0.9rem;
    }
    
    .search-header {
        padding: 1.5rem;
        margin-bottom: 1.5rem;
        border-radius: 12px;
    }
    
    .search-form.compact {
        grid-template-columns: 1fr; /* 堆叠 */
        gap: 0.8rem;
    }
    
    .search-form.compact .search-input-wrapper {
        min-width: auto;
    }
    
    .search-form.compact .search-input-wrapper input {
        height: 56px;
        font-size: 16px;
        padding: 0 1.2rem 0 2.8rem;
        border-radius: 14px;
    }
    
    .search-form.compact .search-input-wrapper::before {
        left: 0.8rem;
        font-size: 0.9rem;
    }
    
    .language-filter.inline::before {
        left: 0.8rem;
        font-size: 0.9rem;
    }
    
    .language-filter.inline select {
        height: 56px;
        font-size: 16px;
        padding: 0 2.5rem 0 2.5rem;
        border-radius: 14px;
        width: 100%;
        background-position: right 0.7rem center;
    }
    
    .search-form.compact .search-btn {
        height: 56px;
        font-size: 1rem;
        padding: 0 2rem;
        border-radius: 14px;
        margin-top: 0.4rem;
    }
    
    /* 添加触摸友好的间距 */
    .search-form.compact .search-input-wrapper input:focus,
    .language-filter.inline select:focus,
    .search-form.compact .search-btn:hover {
        transform: none; /* 移动端禁用变换效果 */
    }
    
    .function-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .function-name-section {
        width: 100%;
    }
    
    .language-tag {
        align-self: flex-start;
    }
    
    .function-name {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.8rem;
    }
    
    .function-tags {
        width: 100%;
        justify-content: flex-start;
    }
    
    .code-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.8rem;
    }
    
    .copy-code {
        align-self: flex-end;
    }
    
    .scores {
        flex-direction: column;
        gap: 1rem;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .logo h1 {
        font-size: 1.5rem;
    }
    
    .search-section h2 {
        font-size: 1.8rem;
    }
    
    .search-input-wrapper input {
        padding: 0.8rem 1rem;
        font-size: 1rem;
    }
    
    .search-btn {
        padding: 0.8rem 2rem;
        font-size: 1rem;
    }
    
    .function-card {
        padding: 1.5rem;
    }
}

/* 更精细的卡片与交互移动端优化 */
@media (max-width: 640px) {
    /* 让搜索条在滚动时保持可见，便于重新搜索 */
    .search-header {
        position: sticky;
        top: 0;
        z-index: 40;
        box-shadow: 0 4px 12px rgba(0,0,0,0.08);
        backdrop-filter: blur(6px);
    }

    /* 减少整体外边距以提升可视密度 */
    .results-section {
        margin-top: 1.2rem;
    }

    .results-header h2 {
        font-size: 1.2rem;
    }
    .results-header p {
        font-size: 0.85rem;
    }

    /* 卡片改为更紧凑视觉 */
    .function-card {
        padding: 1rem 1rem 1.1rem;
        border-radius: 10px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.08);
        gap: 0.75rem;
        transition: none; /* 移动端减少性能消耗 */
    }
    .function-card:hover {
        transform: none;
        box-shadow: 0 2px 10px rgba(0,0,0,0.12);
    }

    .function-header {
        margin-bottom: 0.4rem;
        gap: 0.6rem;
    }
    .name-wrapper h3 {
        font-size: 1.15rem;
    }
    .function-tags .tag {
        padding: 0.22rem 0.55rem;
        font-size: 0.68rem;
        border-radius: 12px;
    }
    .language-tag {
        font-size: 0.65rem;
        padding: 0.3rem 0.65rem;
        box-shadow: none;
        letter-spacing: 0.3px;
    }

    .function-description p {
        font-size: 0.85rem;
        line-height: 1.5;
        margin-bottom: 0.2rem;
    }

    .function-details {
        padding: 0.65rem 0.75rem 0.75rem;
        margin-bottom: 0.9rem;
        border-left-width: 3px;
    }
    .function-details strong {
        font-size: 0.78rem;
    }
    .param, .return {
        font-size: 0.68rem;
        padding: 0.15rem 0.45rem;
        margin-right: 0.35rem;
        margin-bottom: 0.25rem;
    }

    /* 分数区块堆叠精简 */
    .scores {
        padding: 0.6rem 0.75rem;
        margin-bottom: 0.9rem;
        gap: 0.6rem;
        background: #f1f5f9;
    }
    .score span:first-child {
        font-size: 0.68rem;
        margin-bottom: 0.15rem;
    }
    .score-value {
        font-size: 0.95rem;
    }

    /* 代码区域按钮触控优化 */
    .code-header {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    .toggle-code {
        padding: 0.55rem 0.95rem;
        font-size: 0.75rem;
        border-radius: 6px;
        box-shadow: none;
    }
    .copy-code {
        height: 36px;
        min-width: 36px;
        padding: 0.45rem;
        border-radius: 6px;
    }
    .code-block {
        padding: 1rem 0.9rem;
        font-size: 0.75rem;
        line-height: 1.4;
    }

    /* 减弱动画来降低掉帧 */
    .function-card { animation-duration: 0.35s; }
    .search-form.compact .search-input-wrapper:focus-within,
    .language-filter.inline:focus-within,
    .search-form.compact .search-btn:focus {
        transform: none;
        animation: none;
    }

    /* 减少整体阴影带来的滚动性能开销 */
    .toggle-code:hover::before { display: none; }
    .toggle-code:hover { transform: none; box-shadow: none; }
    .copy-code:hover { transform: none; box-shadow: none; }
}

/* 极小屏进一步精简 (例如 360px 宽 Android) */
@media (max-width: 400px) {
    .function-card { padding: 0.85rem 0.85rem 1rem; }
    .name-wrapper h3 { font-size: 1.05rem; }
    .function-details { padding: 0.55rem 0.65rem 0.6rem; }
    .scores { padding: 0.5rem 0.6rem; }
    .code-block { font-size: 0.7rem; }
}

/* 国际化相关样式 */
.name-en, .desc-en {
    display: none;
}

[data-lang="en"] .name-zh,
[data-lang="en"] .desc-zh {
    display: none;
}

[data-lang="en"] .name-en,
[data-lang="en"] .desc-en {
    display: block;
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes shimmer {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    }
    50% {
        box-shadow: 0 8px 25px rgba(102, 126, 234, 0.5);
    }
}

.function-card {
    animation: fadeIn 0.5s ease forwards;
}

.function-card:nth-child(even) {
    animation-delay: 0.1s;
}

.function-card:nth-child(odd) {
    animation-delay: 0.2s;
}

/* 搜索框额外交互效果 */
.search-form.compact .search-input-wrapper:focus-within {
    transform: scale(1.02);
}

.language-filter.inline:focus-within {
    transform: scale(1.02);
}

.search-form.compact .search-btn:focus {
    animation: pulse 2s infinite;
}

/* 加载状态样式 */
.search-form.loading .search-btn {
    pointer-events: none;
    opacity: 0.7;
}

.search-form.loading .search-btn::after {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    display: inline-block;
    margin-left: 8px;
}

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

/* 深色模式支持准备 */
@media (prefers-color-scheme: dark) {
    .search-header {
        background: linear-gradient(135deg, #2d3748 0%, #4a5568 100%);
        border-color: rgba(102, 126, 234, 0.2);
    }
    
    .search-form.compact .search-input-wrapper input,
    .language-filter.inline select {
        background: #4a5568;
        color: white;
        border-color: #718096;
    }
    
    .search-form.compact .search-input-wrapper input::placeholder {
        color: #a0aec0;
    }
}

/* 友情链接样式 */
.friend-links {
    margin-top: 15px;
    font-size: 0.85rem;
    color: #a0aec0;
    text-align: center;
}

.friend-links a {
    color: #a0aec0;
    text-decoration: none;
    margin: 0 10px;
    transition: color 0.2s ease, text-decoration 0.2s ease;
}

.friend-links a:hover {
    color: #e2e8f0;
    text-decoration: underline;
}

.friend-links span {
    margin-right: 5px;
    color: #a0aec0;
}

@media (max-width: 640px) {
    .friend-links {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 8px;
    }
    
    .friend-links span {
        margin-bottom: 5px;
    }
}

.friend-links a{
    
}
