/* 全局样式重置与 Google 风格响应式优化 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', Arial, sans-serif;
    line-height: 1.6;
    color: #202124;
    background: #fff;
    min-height: 100vh;
}

.container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Google风格的首页 - 完全模仿Google布局 */
.home-layout {
    display: flex;
    flex-direction: column;
    justify-content: center; /* 垂直居中 */
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    /* 向下偏移，让内容更容易被用户注意到 */
    padding-top: 15vh; /* 顶部留出更多空间 */
}

/* 搜索结果页 - 整体居中显示，内部保持左对齐 */
.results-layout {
    min-height: 100vh;
    display: flex;
    justify-content: flex-start; /* 改为左对齐 */
    align-items: flex-start;
    padding: 20px;
    padding-left: 105px; /* 调整为105px */
    box-sizing: border-box;
    width: 100vw;
    max-width: 100vw;
    overflow-x: hidden;
}

/* 搜索结果页整体内容容器 - 固定宽度的包，内部左对齐 */
.results-layout .main {
    width: calc(100vw - 145px); /* 调整为145px，对应105px左边距 */
    max-width: 720px; /* 保持最大宽度限制 */
    margin: 0;
    padding: 0 !important; /* 移除内部边距 */
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

/* 搜索头部 - 适应新的居中布局 */
.search-header {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 12px 0 12px 0; /* 增加上下内边距为12px，让搜索头更美观 */
    border-bottom: 1px solid #e8eaed;
    background: #fff;
    width: 100%; /* 确保与下方内容宽度一致 */
    max-width: 720px; /* 与搜索结果区域保持一致 */
    margin-bottom: 0; /* 移除与下方的间距 */
}

/* 搜索结果页的搜索头部 - 桌面端固定定位 */
@media (min-width: 769px) {
    .results-layout .search-header {
        justify-content: flex-start; /* 左对齐 */
        position: fixed; /* 使用固定定位替代sticky */
        top: 0; /* 固定在顶部 */
        left: 105px; /* 与页面左边距保持一致 */
        right: auto;
        z-index: 100; /* 确保在其他内容之上 */
        background: #fff; /* 确保背景色遮盖下方内容 */
        max-width: 720px; /* 保持最大宽度 */
        width: calc(100vw - 145px); /* 与主容器宽度一致 */
        padding: 12px 0 12px 0; /* 与基础样式一致，使用12px内边距 */
    }
    
    /* 为搜索结果区域添加顶部间距，避免被固定头部遮挡 */
    .results-layout .results {
        margin-top: 20px; /* 进一步缩小间距到20px */
    }
}

/* 搜索结果页的搜索框区域 */
.search-header .search-input-section {
    flex: 1;
    max-width: 600px; /* 限制搜索框最大宽度 */
}
/* 搜索头部中的搜索框 - 修复高度和边框，保持圆角一致 */
.search-header .search-input-wrapper {
    margin: 0;
    box-shadow: 0 2px 5px 1px rgba(64,60,67,.16); /* 结果页使用原来的阴影 */
    border: 1px solid #dfe1e5; /* 保持原有边框 */
    border-radius: 24px; /* 与首页搜索框保持一致的圆角 */
}

/* 搜索头部中的输入框 - 与首页搜索框高度一致 */
.search-header #searchInputResults {
    padding: 12px 48px 12px 20px !important; /* 与首页搜索框一致的高度 */
    font-size: 16px;
    border: none !important; /* 移除黑色边框 */
    outline: none !important; /* 移除聚焦时的边框 */
    background: transparent;
}

/* 首页隐藏搜索头部 */
.home-layout .search-header {
    display: none;
}

/* 结果页显示搜索头部 */
.results-layout .search-header {
    display: flex !important;
}

/* 搜索结果页的logo样式 - 应用Google颜色 */
.search-header .logo-section h1 {
    font-size: 1.8rem; /* 从1.5rem增加到1.8rem，让logo更大 */
    font-weight: 500; /* 增加字体粗细，更接近Google */
    margin: 0;
    white-space: nowrap;
}

.search-header .logo-section h1 a {
    text-decoration: none;
    cursor: pointer;
}

.search-header .logo-section h1 a:hover {
    text-decoration: none; /* 移除下划线 */
}

/* 搜索结果页的搜索框区域 */
.search-header .search-input-section {
    flex: 1;
    max-width: 580px; /* 从600px减少到580px，为更大的logo留出空间 */
}

/* 移动端：保持响应式布局 */
@media (max-width: 768px) {
    .container, .main, .results, .search-section, .result-tabs-container {
        max-width: 100% !important;
        width: 100% !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
    .header h1 {
        font-size: 3.2rem;
        letter-spacing: -2px;
    }
    .subtitle {
        font-size: 0.95rem;
    }
    .search-input-wrapper {
        max-width: 98vw;
        margin: 0 auto 12px auto;
        border-radius: 22px;
        display: flex;
        align-items: center;
        position: relative;
    }
    #searchInput {
        font-size: 16px;
        padding: 13px 48px 13px 16px;
        min-height: 44px;
        border-radius: 22px;
        width: 100%;
        box-sizing: border-box;
    }
    .search-btn {
        width: 44px;
        height: 44px;
        right: 2px;
        font-size: 20px;
        border-radius: 22px;
        background: #1a73e8 !important;
        color: #fff !important;
        display: flex;
        align-items: center;
        justify-content: center;
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        border: none;
        box-shadow: 0 1px 6px rgba(32,33,36,.18);
        transition: background 0.2s;
    }
    .search-header {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
        padding: 12px 0 16px 0;
        position: sticky;
        top: 0;
        z-index: 100;
        background: #fff;
        box-shadow: 0 2px 8px rgba(32,33,36,.06);
    }
    .logo-section {
        text-align: center;
    }
    .search-options-bar {
        flex-direction: row;
        gap: 16px;
        align-items: center;
        margin-top: 0;
        margin-bottom: 8px;
        padding-bottom: 8px;
    }
    .search-options {
        flex-direction: row;
        gap: 16px;
        align-items: center;
        margin-top: 0;
    }
    .results-stats {
        position: static;
        text-align: right;
        margin: 0 0 2px 0;
        font-size: 14px;
    }
    .result-tabs-container {
        margin: 0 0 4px 0;
        padding: 0;
    }
    .tab-btn {
        font-size: 14px;
        margin-right: 16px;
        padding: 12px 0;
        min-width: 60px;
    }
    .result-item, .link-item {
        padding: 14px 8px;
        font-size: 15px;
    }
    .footer {
        padding: 12px;
        font-size: 0.85rem;
    }
    
    /* 移动端搜索结果页footer也移除背景色 */
    .results-layout .footer {
        background: transparent !important; /* 移除灰色背景 */
        border-top: 1px solid #e8eaed !important; /* 使用更淡的边框 */
    }
    
    /* 移动端footer链接优化 */
    .footer-links {
        gap: 10px; /* 进一步减少移动端间距 */
        flex-wrap: wrap; /* 允许换行 */
        line-height: 1.1; /* 移动端更紧密的行高 */
        margin-bottom: 14px; /* 移动端增加与版权信息的间距 */
    }
}

/* 首页Google Logo颜色样式 */
.header h1 a {
    color: #4285f4;
    text-decoration: none;
    cursor: pointer;
}

.header h1 a:hover {
    text-decoration: none; /* 移除下划线 */
}

/* Google Logo各字母颜色 */
.logo-g1 { color: #4285f4; } /* 蓝色 */
.logo-u { color: #ea4335; }  /* 红色 */
.logo-g2 { color: #fbbc05; } /* 黄色 */
.logo-e { color: #4285f4; }  /* 蓝色 */
.logo-s { color: #34a853; } /* 绿色 */
.logo-o { color: #ea4335; } /* 红色 */

/* 头部样式 - 仅用于首页 */
.header {
    text-align: center;
    margin-bottom: 40px;
    /* 移除sticky定位，让首页logo不固定在顶部 */
}

.home-layout .header {
    margin-bottom: 40px; /* 增加Logo与搜索框间距 */
    position: static; /* 确保不固定定位 */
}

.header h1 {
    font-size: 6rem; /* 模仿Google Logo的大小 */
    color: #4285f4;
    font-weight: 500; /* 增加字体粗细，更接近Google */
    margin-bottom: 10px;
    letter-spacing: -2px; /* 稍微调整字母间距 */
}

.subtitle {
    font-size: 1rem;
    color: #5f6368;
    font-weight: 400; /* 从300增加到400，更加粗一点 */
}

/* 主体内容 */
.main {
    flex: 1;
    max-width: 720px; /* 增加首页宽度 */
    width: 100%;
    margin: 0 auto;
}

/* 首页保持居中 */
.home-layout .main {
    max-width: 720px; /* 增加首页宽度 */
    padding: 0 20px;
}

/* Google风格的搜索框 */
.search-section {
    margin-bottom: 30px;
}

/* 首页搜索框样式调整 */
.home-layout .search-section {
    margin-bottom: 0; /* 移除底部间距，让按钮紧贴 */
}

/* 搜索按钮容器 - 确保居中 */
.search-buttons {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-top: 30px;
    width: 100%; /* 确保容器占满宽度 */
}

/* 首页搜索按钮容器特殊样式 */
.home-layout .search-buttons {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin: 30px auto 0 auto; /* 上下左右都居中 */
    width: 100%;
    text-align: center; /* 额外确保文本居中 */
}

.search-input-wrapper {
    position: relative;
    max-width: 680px; /* 增加搜索框宽度 */
    margin: 0 auto;
    box-shadow: 0 1px 6px rgba(32,33,36,.28); /* Google风格的均匀阴影 */
    border-radius: 24px;
    border: 1px solid #dfe1e5;
    background: #fff;
    transition: box-shadow 0.3s ease;
}

/* 首页搜索框阴影效果 */
.home-layout .search-input-wrapper {
    box-shadow: 0 2px 5px 1px rgba(64,60,67,.16); /* 更淡的初始阴影 */
}

.home-layout .search-input-wrapper:hover {
    box-shadow: 0 1px 6px rgba(32,33,36,.28); /* 悬停时的均匀阴影 */
}

.home-layout .search-input-wrapper:focus-within {
    box-shadow: 0 1px 6px rgba(32,33,36,.28); /* 聚焦时的均匀阴影 */
}

/* 搜索头部中的搜索框 - 修复高度和边框，保持圆角一致 */
.search-header .search-input-wrapper {
    margin: 0;
    box-shadow: 0 2px 5px 1px rgba(64,60,67,.16); /* 结果页使用原来的阴影 */
    border: 1px solid #dfe1e5; /* 保持原有边框 */
    border-radius: 24px; /* 与首页搜索框保持一致的圆角 */
}

/* 搜索头部中的输入框 - 与首页搜索框高度一致 */
.search-header #searchInputResults {
    padding: 12px 48px 12px 20px !important; /* 与首页搜索框一致的高度 */
    font-size: 16px;
    border: none !important; /* 移除黑色边框 */
    outline: none !important; /* 移除聚焦时的边框 */
    background: transparent;
}

.search-input-wrapper:hover {
    box-shadow: 0 2px 8px 1px rgba(64,60,67,.24);
}

.search-input-wrapper:focus-within {
    box-shadow: 0 2px 8px 1px rgba(64,60,67,.24);
    border-color: transparent;
}

#searchInput {
    width: 100%;
    padding: 12px 48px 12px 20px;
    border: none;
    font-size: 16px;
    outline: none;
    background: transparent;
    border-radius: 24px;
}

/* 首页搜索框输入样式 */
.home-layout #searchInput {
    padding: 13px 48px 13px 20px; /* 稍微增加内边距 */
}

.search-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #9aa0a6;
    padding: 8px;
    cursor: pointer;
    border-radius: 50%;
    transition: background-color 0.3s ease;
}

.search-btn:hover {
    background-color: #f8f9fa;
}

/* 结果页隐藏首页header、搜索按钮和搜索框 */
.results-layout .header,
.results-layout .search-buttons,
.results-layout .search-section .search-input-wrapper {
    display: none !important;
}

/* 结果页显示搜索头部 */
.results-layout .search-header {
    display: flex !important;
}

.result-count {
    color: #70757a;
    font-size: 0.875rem;
}

.btn {
    background: #f8f9fa;
    border: 1px solid #f8f9fa;
    border-radius: 4px;
    color: #3c4043;
    font-size: 14px;
    margin: 11px 4px;
    padding: 0 20px;
    line-height: 36px;
    text-align: center;
    cursor: pointer;
    user-select: none;
    transition: all 0.1s ease;
}

/* 首页按钮Google风格 */
.home-layout .btn {
    background: #f8f9fa;
    border: 1px solid #f8f9fa;
    border-radius: 4px;
    color: #3c4043;
    font-size: 14px;
    margin: 0; /* 移除margin，使用容器的gap来控制间距 */
    padding: 0 20px;
    line-height: 36px;
    min-width: 54px;
    height: 36px;
}

.btn:hover, .home-layout .btn:hover {
    box-shadow: 0 1px 1px rgba(0,0,0,.1);
    background-color: #f1f3f4;
    border: 1px solid #dadce0;
    color: #202124;
}

/* 简洁的加载提示 */
.simple-loading {
    text-align: center;
    padding: 60px 20px;
    color: #5f6368;
}

.loading-main {
    font-size: 18px;
    color: #202124;
    margin-bottom: 8px;
}

.loading-sub {
    font-size: 14px;
    color: #5f6368;
}

/* 手机端loading适配 */
@media (max-width: 768px) {
    .simple-loading {
        padding: 40px 16px;
    }
    .loading-main {
        font-size: 16px;
    }
    .loading-sub {
        font-size: 13px;
    }
}

/* Google风格的搜索结果 */
.results {
    margin-top: 0; /* 删除搜索选项栏后，减少上间距 */
    max-width: 720px; /* 限制最大宽度 */
    width: 100%;
}

.results-header {
    margin-bottom: 20px;
    padding: 0 20px;
    color: #70757a;
    font-size: 0.875rem;
}

.result-count {
    color: #70757a;
}

/* Google搜索结果样式 */
.result-item {
    padding: 20px;
    border-bottom: 1px solid #e8eaed;
    transition: background-color 0.1s ease;
}

/* 搜索结果页的结果项对齐调整 */
.results-layout .result-item {
    padding: 20px 0; /* 桌面端移除左右内边距，与其他内容左对齐 */
}

.result-item:hover {
    background-color: #f8f9fa;
}

.result-item:last-child {
    border-bottom: none;
}

.result-url {
    color: #202124;
    font-size: 0.875rem;
    margin-bottom: 3px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.result-title {
    color: #1a73e8; /* 使用与tab选中一致的蓝色 */
    font-size: 1.1rem; /* 与分组标签保持一致 */
    font-weight: bold; /* 与分组标签保持一致 */
    line-height: 1.3;
    margin-bottom: 3px;
    cursor: pointer;
    text-decoration: none;
}

.result-title:hover {
    text-decoration: underline;
}

.result-title:visited {
    color: #7b1fa2 !important; /* 深紫色，与蓝色有明显区分，使用!important确保优先级 */
}

/* 网盘链接访问状态区分 */
.netdisk-link {
    display: flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    color: #1a73e8; /* 使用一致的蓝色 */
    font-weight: 500;
}

.netdisk-link:visited {
    color: #7b1fa2 !important; /* 深紫色，与蓝色有明显区分，使用!important确保优先级 */
}

.link-title a {
    color: #1a73e8; /* 使用一致的蓝色 */
    text-decoration: none;
}

.link-title a:visited {
    color: #7b1fa2 !important; /* 深紫色，与蓝色有明显区分，使用!important确保优先级 */
}

.result-meta {
    color: #5f6368;
    font-size: 0.875rem;
    margin-bottom: 8px;
}

.result-date {
    color: #70757a;
    font-size: 0.75rem; /* 与分组标签保持一致 */
}

.result-snippet {
    color: #4d5156;
    font-size: 0.875rem;
    line-height: 1.58;
    margin-bottom: 12px;
}

.result-links {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.result-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    background: #f1f3f4;
    border-radius: 16px;
    color: #1a73e8;
    text-decoration: none;
    font-size: 0.8125rem;
    transition: background-color 0.1s ease;
}

.result-link:hover {
    background: #e8f0fe;
}

.result-link i {
    font-size: 0.75rem;
}

/* 新的简洁网盘链接样式 */
.result-netdisk-links {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.result-netdisk-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: #f8f9fa;
    border: 1px solid #e8eaed;
    border-radius: 20px;
    font-size: 0.875rem;
}

.netdisk-link {
    display: flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    color: #1a73e8;
    font-weight: 500;
}

.netdisk-link:hover {
    color: #1557b0; /* 深蓝色悬停效果 */
}

.result-netdisk-item .password-code {
    background: #e8f0fe;
    color: #1a73e8;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
    cursor: pointer;
    transition: background-color 0.1s ease;
    font-size: 0.8rem;
}

.result-netdisk-item .password-code:hover {
    background: #d2e3fc;
}

/* 网盘类型分组 - 简化版 */
.netdisk-group {
    margin-bottom: 32px;
    padding: 0 20px;
}

/* 搜索结果页的分组结果对齐调整 */
.results-layout .netdisk-group {
    padding: 0; /* 桌面端移除内边距，与其他内容左对齐 */
}

.netdisk-title {
    color: #202124;
    font-size: 1.125rem;
    font-weight: 500;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.netdisk-count {
    color: #70757a;
    font-size: 0.875rem;
    font-weight: 400;
}

.netdisk-links {
    /* 确保链接容器不会溢出 */
    width: 100%;
    box-sizing: border-box;
}

.link-item {
    background: #fff;
    border: 1px solid #e8eaed;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.1s ease;
}

.link-item:hover {
    box-shadow: 0 1px 6px rgba(32,33,36,.28);
    border-color: #dadce0;
}

.link-title {
    color: #202124;
    font-size: 1.1rem;
    font-weight: bold;
    margin-bottom: 8px;
    line-height: 1.3;
}

.link-title a {
    color: #1a73e8;
    text-decoration: none;
}

.link-title a:hover {
    text-decoration: underline;
}

.link-url {
    color: #1a73e8;
    font-size: 0.875rem;
    margin-bottom: 8px;
    word-break: break-all;
}

.link-url a {
    color: #1a73e8;
    text-decoration: none;
}

.link-url a:hover {
    text-decoration: underline;
}

.link-details {
    color: #5f6368;
    font-size: 0.8125rem;
    line-height: 1.4;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.link-password {
    display: flex;
    align-items: center;
    gap: 4px;
}

.password-label {
    color: #5f6368;
}

.password-code {
    background: #e8f0fe;
    color: #1a73e8;
    padding: 4px 8px;
    border-radius: 4px;
    font-family: monospace;
    cursor: pointer;
    transition: background-color 0.1s ease;
}

.password-code:hover {
    background: #d2e3fc;
}

.link-date {
    color: #70757a;
    font-size: 0.75rem;
}

.link-note {
    color: #202124;
    margin: 4px 0;
}

/* 标签页容器 - 控制在720px宽度内，支持横向滚动 */
.result-tabs-container {
    position: relative;
    max-width: 720px;
    width: 100%;
    margin-top: 0; /* 移除与搜索头的间距 */
    margin-bottom: 12px;
    border-bottom: 1px solid #e8eaed;
}

/* 标签页 - 横向滚动版本 */
.result-tabs {
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE 10+ */
    padding: 0;
    margin-bottom: 0;
    border-bottom: none; /* 移除原有边框，由容器提供 */
    /* 确保滚动条隐藏 */
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.result-tabs::-webkit-scrollbar {
    display: none;
}

/* 滚动箭头按钮 */
.tabs-scroll-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: white;
    border: 1px solid #e8eaed;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    z-index: 11;
}

.tabs-scroll-arrow:hover {
    background: #f8f9fa;
}

/* 左箭头定位 */
.tabs-scroll-left {
    left: 0;
}

/* 右箭头定位 */
.tabs-scroll-right {
    right: 0;
}

/* 搜索结果页的tab标签页对齐调整 */
.results-layout .result-tabs {
    padding: 0; /* 桌面端移除内边距，移动端保持 */
}

.result-tabs::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

.tab-btn {
    background: none;
    border: none;
    padding: 12px 0;
    margin-right: 24px;
    cursor: pointer;
    font-size: 0.875rem;
    color: #5f6368;
    border-bottom: 3px solid transparent;
    transition: color 0.1s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.tab-btn.active {
    color: #1a73e8;
    border-bottom-color: #1a73e8;
}

.tab-btn:hover {
    color: #202124;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* 错误提示 */
.error {
    background: #fef7e0;
    color: #b75d15;
    padding: 16px 20px;
    border-radius: 8px;
    margin: 20px;
    border: 1px solid #f9e588;
    font-size: 0.875rem;
}

/* 工具类 */
.hidden {
    display: none !important;
}

/* 回到顶部按钮 */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 48px;
    height: 48px;
    background: #1a73e8;
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
    z-index: 1000;
}

.back-to-top:hover {
    background: #1557b0;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

.back-to-top.show {
    display: flex;
}

/* 移动端回到顶部按钮调整 */
@media (max-width: 768px) {
    .back-to-top {
        width: 44px;
        height: 44px;
        bottom: 20px;
        right: 20px;
        font-size: 16px;
    }
}

/* 底部 - 简化版 */
.footer {
    margin-top: auto;
    padding: 20px;
    text-align: center;
    color: #70757a;
    font-size: 0.8125rem;
    border-top: 1px solid #e8eaed;
}

/* 搜索结果页footer样式 - 移除背景色，保持简洁 */
.results-layout .footer {
    background: transparent; /* 移除灰色背景 */
    margin-top: 60px; /* 增加与搜索结果的间距 */
    border-top: 1px solid #e8eaed; /* 使用更淡的边框 */
    text-align: left; /* 搜索结果页改为左对齐 */
}

/* 搜索结果页footer链接也左对齐 */
.results-layout .footer .footer-links {
    justify-content: flex-start; /* 左对齐 */
}

/* 桌面端搜索结果页footer进一步优化 */
@media (min-width: 769px) {
    .results-layout .footer {
        margin-top: 80px; /* 桌面端增加更多间距 */
    }
}

/* 首页footer也使用相同的边框颜色 */
.home-layout .footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: #f2f2f2;
    border-top: 1px solid #dadce0;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 16px; /* 增加与版权信息的间距 */
    line-height: 1.2; /* 减小行高，让换行后的行间距更紧密 */
}

.footer-links a {
    color: #70757a;
    text-decoration: none;
    font-size: 0.8125rem;
}

.footer-links a:hover {
    text-decoration: underline;
}

/* footer文字样式调整 */
.footer p {
    margin: 0;
    font-size: 0.8125rem;
}

/* 响应式设计 */
@media (max-width: 768px) {
    /* 移动端首页调整 - 保持居中但向下偏移 */
    .home-layout {
        justify-content: flex-start; /* 改为从顶部开始 */
        padding: 20px;
        padding-top: 12vh; /* 移动端也向下偏移 */
    }
    
    /* 移动端搜索结果页调整 */
    .results-layout {
        padding: 0; /* 移动端移除所有padding */
        padding-left: 0; /* 重置左边距 */
    }
    
    .results-layout .main {
        width: 100%;
        max-width: 100%;
        padding: 0 12px !important;
    }
    
    /* 移动端搜索头部固定在顶部 */
    .results-layout .search-header {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        z-index: 1000 !important;
        background: #fff !important;
        border-bottom: 1px solid #e8eaed !important;
        padding: 12px !important;
        margin: 0 !important;
    }
    
    /* 移动端搜索结果区域调整上间距 */
    .results-layout .results {
        margin-top: 120px !important; /* 给固定头部留出空间 */
        position: relative !important; /* 确保加载状态能正确定位 */
        min-height: 300px !important; /* 移动端足够的高度 */
    }
    
    .header h1 {
        font-size: 3.5rem; /* 移动端适当缩小Logo */
    }
    
    /* 移动端搜索按钮容器居中 */
    .search-buttons {
        display: flex;
        justify-content: center;
        align-items: center;
        flex-wrap: wrap;
        gap: 8px;
        margin: 24px auto 0 auto;
        width: 100%;
        text-align: center;
    }
    
    /* 移动端首页按钮样式 */
    .home-layout .btn {
        margin: 0; /* 移除所有margin */
        padding: 0 16px;
        height: 36px;
        line-height: 36px;
        font-size: 14px;
        min-width: 80px; /* 移动端适当增加最小宽度 */
    }
    
    .results-layout .header h1 {
        font-size: 1.5rem;
    }
    
    /* 移动端搜索框优化 */
    .search-input-wrapper {
        max-width: 95%;
        margin: 0 auto;
        position: relative;
    }
    
    .search-input {
        font-size: 16px !important; /* 防止iOS缩放 */
        padding: 14px 52px 14px 16px !important; /* 增加右侧空间给按钮 */
        height: auto !important;
        min-height: 48px !important; /* 增加触摸区域 */
        border: 2px solid #dadce0 !important;
        border-radius: 24px !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
    
    .search-btn {
        position: absolute !important;
        right: 4px !important;
        top: 50% !important;
        transform: translateY(-50%) !important;
        width: 40px !important;
        height: 40px !important;
        background: #1a73e8 !important;
        color: white !important;
        border: none !important;
        border-radius: 50% !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        cursor: pointer !important;
        font-size: 16px !important;
        transition: background-color 0.2s ease !important;
        z-index: 2 !important;
        padding: 0 !important;
    }
    
    .search-btn:hover,
    .search-btn:active {
        background: #1557b0 !important;
    }
    
    /* 移动端搜索头部居中 */
    .search-header .search-input-wrapper {
        margin: 0 auto;
    }
    
    .main {
        padding: 0 12px;
    }
    
    .result-item {
        padding: 16px 12px;
    }
    
    /* 搜索头部在移动端保持垂直布局 */
    .search-header {
        flex-direction: column;
        gap: 16px;
        align-items: stretch;
        padding: 16px 0 20px 0;
    }
    
    .logo-section {
        text-align: center;
    }
    
    /* 移动端搜索选项优化 - 保持一致间距 */
    .search-options-bar {
        flex-direction: column;
        gap: 16px;
        align-items: stretch;
        margin-bottom: 16px !important; /* 与搜索框保持一致的间距 */
        padding-bottom: 12px;
        border-bottom: 1px solid #e8eaed;
    }
    
    /* 移动端标签栏优化 - 保持一致间距 */
    .result-tabs-container {
        max-width: 100%;
        margin: 0 -12px 16px -12px; /* 保持与上方一致的16px间距 */
        padding: 0 12px;
    }
    
    /* 移动端居中对齐 */
    .results-layout .search-header,
    .results-layout .search-section,
    .results-layout .results {
        margin: 0 auto;
        padding: 0 12px;
        max-width: 100%;
        width: 100%;
    }
    
    /* 移动端标签栏优化 */
    .result-tabs-container {
        max-width: 100%;
        margin: 0 0 20px 0; /* 移除负边距，与结果区域对齐 */
        padding: 0 12px; /* 与结果区域保持一致的内边距 */
    }
    
    .result-tabs {
        padding: 0;
    }
    
    .tab-btn {
        font-size: 14px;
        margin-right: 20px;
        padding: 14px 0; /* 增加触摸区域 */
        min-width: 60px;
    }
    
    /* 移动端滚动箭头优化 */
    .tabs-scroll-arrow {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }
    
    .tabs-scroll-left {
        left: 12px;
    }
    
    .tabs-scroll-right {
        right: 12px;
    }
    
    /* 移动端结果内容调整 - 确保网盘分组与全部标签宽度一致 */
    .results-layout .netdisk-group {
        padding: 0 12px; /* 与result-item保持一致的内边距 */
        margin-bottom: 32px;
    }
    
    .netdisk-group h3 {
        padding: 0;  /* 移除额外内边距，因为父元素已有 */
        font-size: 16px;
        margin: 20px 0 12px 0;
    }
    
    .results-layout .result-item {
        padding: 20px 12px;
        margin: 0;
        border-bottom: 1px solid #e8eaed;
    }
    
    /* 移动端确保result-title与桌面端一致 */
    .result-title {
        font-size: 1.1rem; /* 与桌面端保持一致 */
        font-weight: bold; /* 与桌面端保持一致 */
        color: #1a73e8; /* 确保未访问状态颜色一致 */
    }
    
    /* 移动端确保visited状态与桌面端一致 */
    .result-title:visited {
        color: #7b1fa2 !important; /* 与桌面端保持一致，使用!important确保优先级 */
    }
    
    /* 移动端确保result-date与桌面端一致 */
    .result-date {
        font-size: 0.75rem; /* 与桌面端保持一致 */
    }
    
    .link-item {
        padding: 16px 12px;
        margin: 8px 0;
        border-radius: 8px;
        border: 1px solid #e8eaed;
    }
    
    /* 确保网盘分组中的link-item不会超出边界 */
    .netdisk-group .link-item {
        margin-left: 0;
        margin-right: 0;
    }
    
    .link-title {
        font-size: 1.1rem; /* 与result-title保持一致 */
        font-weight: bold; /* 与result-title保持一致 */
        line-height: 1.4;
        margin-bottom: 8px;
    }
    
    /* 移动端确保link-title与result-title样式一致 */
    .link-title a {
        color: #1a73e8; /* 与result-title保持一致 */
        font-weight: bold; /* 与result-title保持一致 */
    }
    
    /* 移动端确保link-title访问状态与桌面端一致 */
    .link-title a:visited {
        color: #7b1fa2 !important; /* 与桌面端保持一致，使用!important确保优先级 */
    }
    
    .link-url {
        font-size: 14px;
        margin-bottom: 8px;
        word-break: break-all;
    }
    
    .link-details {
        font-size: 13px;
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .link-password {
        align-self: flex-start;
    }
    
    .password-code {
        padding: 6px 10px;
        font-size: 13px;
        border-radius: 6px;
    }
    
    .link-date {
        font-size: 12px;
    }
    
    /* 移动端统计信息优化 */
    .results-stats {
        position: static;
        text-align: right;
        margin: 12px 0;
        padding-right: 0;
        font-size: 14px;
        color: #70757a;
    }
    
    /* 移动端搜索结果容器 */
    .results {
        padding: 0 12px;
    }
    
    .results-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 16px;
        flex-wrap: wrap;
        gap: 8px;
    }
}

@media (max-width: 480px) {
    /* 小屏幕首页进一步向下调整 */
    .home-layout {
        padding-top: 10vh; /* 小屏幕减少顶部空间 */
    }
    
    .header h1 {
        font-size: 2.5rem;
    }
    
    .results-layout .header h1 {
        font-size: 1.25rem;
    }
    
    /* 小屏幕进一步优化 */
    .search-input {
        font-size: 16px;
        padding: 12px 48px 12px 14px;
        min-height: 44px;
        border-radius: 22px;
    }
    
    .search-btn {
        width: 36px;
        height: 36px;
        right: 4px;
        font-size: 14px;
    }
    
    .tab-btn {
        font-size: 14px;
        margin-right: 16px;
        padding: 12px 0;
    }
    
    .tabs-scroll-arrow {
        width: 32px;
        height: 32px;
        font-size: 12px;
    }
    
    .results-stats {
        font-size: 13px;
    }
    
    /* 小屏幕确保result-title与桌面端一致 */
    .result-title {
        font-size: 1.1rem; /* 与桌面端保持一致 */
        font-weight: bold; /* 与桌面端保持一致 */
        color: #1a73e8; /* 确保未访问状态颜色一致 */
    }
    
    /* 小屏幕确保visited状态与桌面端一致 */
    .result-title:visited {
        color: #7b1fa2 !important; /* 与桌面端保持一致，使用!important确保优先级 */
    }
    
    /* 小屏幕确保result-date与桌面端一致 */
    .result-date {
        font-size: 0.75rem; /* 与桌面端保持一致 */
    }
    
    .link-title {
        font-size: 1.1rem; /* 与result-title保持一致 */
        font-weight: bold; /* 与result-title保持一致 */
    }
    
    /* 小屏幕确保网盘分组与全部标签宽度一致 */
    .results-layout .netdisk-group {
        padding: 0 12px; /* 与result-item保持一致的内边距 */
        margin-bottom: 24px; /* 小屏幕稍微减少间距 */
    }
    
    .netdisk-group .link-item {
        margin-left: 0;
        margin-right: 0;
        padding: 14px 10px; /* 小屏幕调整内边距 */
    }
    
    /* 小屏幕确保link-title与result-title样式一致 */
    .link-title a {
        color: #1a73e8; /* 与result-title保持一致 */
        font-weight: bold; /* 与result-title保持一致 */
    }
    
    /* 小屏幕确保link-title访问状态与桌面端一致 */
    .link-title a:visited {
        color: #7b1fa2 !important; /* 与桌面端保持一致，使用!important确保优先级 */
    }
    
    .link-url {
        font-size: 13px;
    }
}