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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    background-color: #fff;
    color: #202124;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 首页容器 */
.container {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 150px 20px 20px;
    min-height: calc(100vh - 60px);
}

/* LOGO区域 */
.logo-section {
    text-align: center;
    margin-bottom: 30px;
}

.logo {
    width: 92px;
    height: 92px;
    margin: 0 auto 16px;
}

.logo svg {
    width: 100%;
    height: 100%;
}

.logo-text {
    font-size: 48px;
    font-weight: 400;
    color: #4285f4;
    letter-spacing: -2px;
}

/* 搜索框区域 */
.search-section {
    width: 100%;
    max-width: 584px;
    margin-bottom: 30px;
}

.search-form {
    width: 100%;
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    height: 70px;
    border: 1px solid #dfe1e5;
    border-radius: 5px;
    padding: 0 8px 0 16px;
    transition: box-shadow 0.2s, border-color 0.2s;
    background-color: #fff;
    box-shadow: 0 2px 8px rgba(32, 33, 36, 0.15);
}

.search-box:hover,
.search-box:focus-within {
    box-shadow: 0 4px 12px rgba(32, 33, 36, 0.25);
    border-color: rgba(223, 225, 229, 0);
}

.search-icon {
    width: 20px;
    height: 20px;
    fill: #9aa0a6;
    flex-shrink: 0;
    margin-right: 12px;
}

/* 搜索模式切换 */
.search-mode-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-shrink: 0;
    margin-right: 8px;
}

.search-mode-toggle {
    position: relative;
    cursor: pointer;
}

.search-mode-label {
    font-size: 10px;
    color: #5f6368;
    margin-top: 2px;
    white-space: nowrap;
}

.search-icon-img {
    width: 24px;
    height: 24px;
    display: block;
}

.search-mode-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 8px;
    background-color: #fff;
    border: 1px solid #dfe1e5;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    min-width: 80px;
    overflow: hidden;
}

.search-mode-item {
    padding: 10px 16px;
    font-size: 14px;
    color: #3c4043;
    cursor: pointer;
    transition: background-color 0.2s;
    white-space: nowrap;
}

.search-mode-item:hover {
    background-color: #f1f3f4;
}

.search-mode-item.active {
    background-color: #e8f0fe;
    color: #4285f4;
}

.search-input {
    flex: 1;
    height: 100%;
    border: none;
    outline: none;
    font-size: 16px;
    color: #202124;
    background: transparent;
}

.search-input::placeholder {
    color: #9aa0a6;
}

.search-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s;
    flex-shrink: 0;
}

.search-btn:hover {
    background-color: #f1f3f4;
}

.search-btn svg {
    width: 50px;
    height: 50px;
    fill: #4285f4;
}

/* 筛选和历史容器 */
.filter-history-container {
    width: 100%;
    margin-top: 8px;
}

/* 按钮容器 */
.filter-history-buttons {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 15px;
    margin-bottom: 12px;
}

/* 网友历史 */
.history-section {
    text-align: right;
}

.history-toggle {
    font-size: 14px;
    color: #202124;
    cursor: pointer;
    display: inline-block;
    padding: 4px 0;
    transition: color 0.2s;
}

.history-toggle:hover {
    color: #3367d6;
    text-decoration: underline;
}

.history-toggle.active {
    color: #4285f4;
}

.history-toggle span {
    margin-left: 4px;
    font-size: 12px;
}

.history-options {
    margin-top: 12px;
    padding: 16px;
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
}

.history-list {
    max-height: 300px;
    overflow-y: auto;
}

.history-item {
    font-size: 14px;
    color: #3c4043;
    padding: 6px 0;
    border-bottom: 1px solid #e9ecef;
    text-align: left;
}

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

/* 网盘筛选 */
.cloud-filter {
    text-align: right;
}

.cloud-filter-toggle {
    font-size: 14px;
    color: #202124;
    cursor: pointer;
    display: inline-block;
    padding: 4px 0;
    transition: color 0.2s;
}

.cloud-filter-toggle:hover {
    color: #3367d6;
    text-decoration: underline;
}

.cloud-filter-toggle.active {
    color: #4285f4;
}

.cloud-filter-toggle span {
    margin-left: 4px;
    font-size: 12px;
}

.cloud-filter-options {
    margin-top: 12px;
    padding: 16px;
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
}

.cloud-filter-item {
    margin-bottom: 12px;
}

.cloud-filter-item:last-child {
    margin-bottom: 0;
}

/* 网盘类型选择 */
.cloud-types-select {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: #3c4043;
    cursor: pointer;
}

.checkbox-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.checkbox-item span {
    user-select: none;
}

/* 热门搜索 */
.hot-search {
    text-align: left;
    font-size: 14px;
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
}

.hot-label {
    color: #5f6368;
    margin-right: 8px;
}

.hot-tag {
    display: inline-block;
    padding: 6px 14px;
    margin: 4px;
    background-color: #f1f3f4;
    color: #3c4043;
    text-decoration: none;
    border-radius: 5px;
    transition: background-color 0.2s, color 0.2s;
    position: relative;
}

.hot-tag:hover {
    background-color: #e8eaed;
    color: #202124;
}

.hot-tag-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: #4285f4;
    color: white;
    font-size: 10px;
    padding: 2px 5px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

/* 页脚 */
.footer {
    text-align: center;
    padding: 20px;
    font-size: 14px;
    color: #70757a;
    background-color: #f2f2f2;
    border-top: 1px solid #dadce0;
}

/* ==================== 搜索结果页面 ==================== */

/* 搜索头部 */
.search-header {
    background-color: #fff;
    border-bottom: 1px solid #ebebeb;
    padding: 16px 20px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 24px;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    flex-shrink: 0;
}

.header-logo svg {
    width: 32px;
    height: 32px;
}

.header-logo span {
    font-size: 20px;
    color: #4285f4;
    font-weight: 500;
}

.header-search-form {
    flex: 1;
    max-width: 692px;
}

.header-search-box {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    height: 44px;
    border: 1px solid #dfe1e5;
    border-radius: 5px;
    padding: 0 8px 0 16px;
    transition: box-shadow 0.2s, border-color 0.2s;
    background-color: #fff;
}

.header-search-box:hover,
.header-search-box:focus-within {
    box-shadow: 0 1px 6px rgba(32, 33, 36, 0.28);
    border-color: rgba(223, 225, 229, 0);
}

.header-search-input {
    flex: 1;
    height: 100%;
    border: none;
    outline: none;
    font-size: 16px;
    color: #202124;
    background: transparent;
}

.header-search-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s;
    flex-shrink: 0;
}

.header-search-btn:hover {
    background-color: #f1f3f4;
}

.header-search-btn svg {
    width: 20px;
    height: 20px;
    fill: #4285f4;
}

/* 搜索结果容器 */
.search-results-container {
    flex: 1;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 20px;
}

.results-info {
    font-size: 14px;
    color: #70757a;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid #ebebeb;
}

.results-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.result-item {
    padding: 12px 0;
}

.result-url {
    font-size: 14px;
    color: #202124;
    margin-bottom: 4px;
}

.result-title {
    font-size: 16px;
    color: #1a0dab;
    text-decoration: none;
    display: block;
    margin-bottom: 8px;
    line-height: 1.3;
}

.result-title:hover {
    text-decoration: none;
}

.result-title:visited {
    color: #660099;
}

.result-desc {
    font-size: 14px;
    color: #4d5156;
    line-height: 1.58;
}

/* 无结果 */
.no-results {
    text-align: center;
    padding: 60px 20px;
}

.no-results p {
    font-size: 18px;
    color: #202124;
    margin-bottom: 16px;
}

.no-results ul {
    list-style: none;
    display: inline-block;
    text-align: left;
}

.no-results li {
    font-size: 14px;
    color: #5f6368;
    margin: 8px 0;
    padding-left: 16px;
    position: relative;
}

.no-results li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: #9aa0a6;
}

/* API结果样式 */
.api-results {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.source-group {
    border: 1px solid #ebebeb;
    border-radius: 8px;
    overflow: hidden;
    background-color: #f8f9fa;
}

.source-title {
    font-size: 18px;
    font-weight: 500;
    color: #202124;
    padding: 16px 20px;
    background-color: #e9ecef;
    border-bottom: 1px solid #ebebeb;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.source-title:hover {
    background-color: #dee2e6;
}

.toggle-icon {
    font-size: 12px;
    transition: transform 0.2s;
}

.result-count {
    font-size: 14px;
    font-weight: 400;
    color: #6c757d;
    background-color: #dee2e6;
    padding: 2px 8px;
    border-radius: 10px;
    min-width: 32px;
    text-align: center;
}

.source-items {
    display: flex;
    flex-direction: column;
    gap: 1px;
    background-color: #ebebeb;
}

.api-result-item {
    background-color: #fff;
    padding: 20px;
    transition: background-color 0.2s;
}

.api-result-item:hover {
    background-color: #f8f9fa;
}

.result-header {
    margin-bottom: 12px;
}

.result-title {
    font-size: 16px;
    color: #000;
    font-weight: 500;
}

.result-url {
    color: #000;
    cursor: pointer;
    background-color: #f8f9fa;
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid #dee2e6;
    transition: all 0.2s;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;    
    max-width: 100px;
    flex-shrink: 0;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
}

.result-url:hover {
    background-color: #f1f3f4;
    border-color: #dadce0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.result-url.copied {
    background-color: #28a745;
    color: #fff;
    border-color: #28a745;
    box-shadow: 0 1px 3px rgba(40, 167, 69, 0.3);
}

.open-url-btn {
    color: #000;
    cursor: pointer;
    background-color: #f8f9fa;
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid #dee2e6;
    transition: all 0.2s;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    text-decoration: none;
    flex-shrink: 0;
    text-align: center;
}

.open-url-btn:hover {
    background-color: #f1f3f4;
    border-color: #dadce0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.result-meta {
    display: flex;
    gap: 16px;
    margin-bottom: 12px;
    font-size: 14px;
    color: #70757a;
}

.result-datetime {
    flex-shrink: 0;
}

.result-url-container {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 14px;
    flex-wrap: nowrap;
}

.result-url-label {
    color: #5f6368;
    font-weight: 500;
    flex-shrink: 0;
    min-width: 40px;
}

.result-url {
    color: #1a0dab;
    text-decoration: none;
    word-break: break-all;
    flex: 1;
}

.result-url:hover {
    text-decoration: underline;
}

.result-password {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    flex-shrink: 0;
}

.password-label {
    color: #5f6368;
    font-weight: 500;
    min-width: 40px;
}

.password-value {
    color: #202124;
    font-family: monospace;
    background-color: #f8f9fa;
    padding: 2px 6px;
    border-radius: 3px;
    border: 1px solid #e9ecef;
}

/* 调试信息样式 */
.debug-info {
    margin-top: 30px;
    padding: 20px;
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    font-family: monospace;
    font-size: 12px;
}

.debug-info h3 {
    margin-bottom: 10px;
    color: #202124;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    font-size: 14px;
}

.debug-info pre {
    margin: 0;
    white-space: pre-wrap;
    word-wrap: break-word;
    color: #333;
    background-color: #fff;
    padding: 10px;
    border-radius: 4px;
    border: 1px solid #e9ecef;
    max-height: 400px;
    overflow-y: auto;
}

/* 类型筛选样式 */
.type-filter {
    margin: 20px 0;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    background-color: #f8f9fa;
    padding: 16px;
}

.filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.filter-btn {
    padding: 6px 12px;
    border: 1px solid #dfe1e5;
    border-radius: 5px;
    background-color: #fff;
    color: #3c4043;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.filter-btn:hover {
    background-color: #f1f3f4;
    border-color: #dadce0;
}

.filter-btn.active {
    background-color: #4285f4;
    color: #fff;
    border-color: #4285f4;
}

.filter-btn.active:hover {
    background-color: #3367d6;
    border-color: #3367d6;
}

.btn-count {
    font-size: 12px;
    font-weight: 500;
    opacity: 0.8;
}

.filter-btn.active .btn-count {
    opacity: 1;
    color: rgba(255, 255, 255, 0.9);
}

/* ==================== 响应式设计 ==================== */

/* 平板设备 */
@media (max-width: 1024px) {
    .header-content {
        gap: 16px;
    }
    
    .search-results-container {
        padding: 16px;
    }
}

/* 手机设备 */
@media (max-width: 768px) {
    /* 首页适配 */
    .logo {
        width: 72px;
        height: 72px;
    }
    
    .logo-text {
        font-size: 36px;
    }
    
    .search-section {
        max-width: 100%;
        padding: 0 16px;
    }
    
    .search-box {
        height: 70px;
    }
    
    .search-input {
        font-size: 16px;
    }
    
    .hot-search {
        padding: 0 16px;
    }
    
    .hot-tag {
        padding: 5px 12px;
        font-size: 13px;
    }
    
    /* 搜索结果页适配 */
    .search-header {
        padding: 12px 16px;
    }
    
    .header-content {
        flex-wrap: wrap;
        gap: 12px;
    }
    
    .header-logo span {
        display: none;
    }
    
    .header-search-form {
        max-width: 100%;
        flex: 1;
    }
    
    .header-search-box {
        height: 40px;
    }
    
    .search-results-container {
        padding: 12px 16px;
    }
    
    .result-title {
        font-size: 16px;
    }
    
    .result-desc {
        font-size: 13px;
    }
}

/* 小屏手机 */
@media (max-width: 480px) {
    .logo {
        width: 64px;
        height: 64px;
    }
    
    .logo-text {
        font-size: 32px;
    }
    
    .search-box {
        height: 65px;
        padding: 0 6px 0 12px;
    }
    
    .search-icon {
        width: 18px;
        height: 18px;
        margin-right: 8px;
    }
    
    .search-input {
        font-size: 15px;
    }
    
    .search-btn {
        width: 32px;
        height: 32px;
    }
    
    .search-btn svg {
        width: 50px;
        height: 50px;
    }
    
    .hot-search {
        font-size: 13px;
    }
    
    .hot-tag {
        padding: 4px 10px;
        font-size: 12px;
        margin: 3px;
    }
    
    .cloud-filter {
        padding: 0 16px;
    }
    
    .cloud-filter-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .cloud-filter-item label {
        width: 100%;
        margin-bottom: 4px;
    }
    
    .cloud-types-select {
        width: 100%;
        gap: 12px;
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    }
    
    .checkbox-item {
        font-size: 13px;
        min-width: 80px;
    }
    
    .result-title {
        font-size: 16px;
    }
    
    .result-url {
        font-size: 12px;
    }
    
    /* API结果响应式 */
    .api-results {
        gap: 20px;
    }
    
    .source-title {
        font-size: 16px;
        padding: 12px 16px;
    }
    
    .api-result-item {
        padding: 16px;
    }
    
    .result-meta {
        flex-direction: column;
        gap: 4px;
    }
    
    .result-url-container {
        flex-direction: row;
        gap: 8px;
        align-items: center;
    }
    
    .result-url-label {
        min-width: 40px;
    }
    
    .result-url {
        width: 35px;
        max-width: 35px;
        flex-shrink: 0;
        text-align: center;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .open-url-btn {
        flex-shrink: 0;
        white-space: nowrap;
        font-size: 12px;
        padding: 3px 6px;
    }
    
    .result-password {
        flex-direction: row;
        gap: 8px;
        align-items: center;
        flex-shrink: 0;
        white-space: nowrap;
    }
    
    .password-label {
        min-width: 40px;
    }
    
    /* 类型筛选响应式 */
    .type-filter {
        padding: 12px;
    }
    
    .filter-buttons {
        gap: 6px;
    }
    
    .filter-btn {
        padding: 6px 12px;
        font-size: 13px;
    }
}

/* 横屏手机 */
@media (max-height: 500px) and (orientation: landscape) {
    .container {
        padding-top: 40px;
        padding-bottom: 40px;
    }
    
    .logo-section {
        margin-bottom: 20px;
    }
    
    .logo {
        width: 56px;
        height: 56px;
    }
    
    .logo-text {
        font-size: 28px;
    }
}
