/* styles.css */
/* 变量定义 */
:root {
    --primary: #20558a;
    --primary-light: #306ba0;
    --secondary: #3d405b;
    --accent: #4299e1;
    --accent-light: #63b3ed;
    --success: #38a169;
    --warning: #ecc94b;
    --danger: #e53e3e;
    --light-bg: #f0f7ff;
    --card-bg: #ffffff;
    --text-dark: #2d3748;
    --text-light: #718096;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 8px 24px rgba(32, 85, 138, 0.2);
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    --border-radius: 12px;
    --header-height: 80px;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Noto Sans SC', 'Segoe UI', system-ui, sans-serif;
    background: linear-gradient(135deg, #f5fbff 0%, #edf5fa 100%);
    color: var(--text-dark);
    line-height: 1.6;
    min-height: 100vh;
    padding-bottom: 40px;
    position: relative;
}

/* 页面加载进度指示器 */
#page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--accent-light);
    z-index: 9999;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease-out;
}

.container {
    width: 90%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 头部导航优化 */
.header-content {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    background: linear-gradient(135deg, rgba(32, 85, 138, 0.9) 0%, rgba(66, 153, 225, 0.8) 100%);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
    animation: headerSlideIn 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes headerSlideIn {
    from { transform: translateY(-100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.brand {
    display: flex;
    align-items: center;
    gap: 15px;
    text-decoration: none;
    transition: var(--transition);
}

.brand:hover {
    transform: translateY(-2px);
}

.brand-text {
    position: relative;
}

.brand-text h1 {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    padding: 0 20px;
    color: white;
}

.brand-text p {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
    margin-top: 4px;
    padding: 0 20px;
}

.brand-badge {
    position: absolute;
    top: -8px;
    right: 0;
    background: var(--success);
    color: white;
    font-size: 0.7rem;
    padding: 2px 10px;
    border-radius: 20px;
    font-weight: 600;
}

.header-actions {
    display: flex;
    gap: 20px;
    align-items: center;
}

.language-select {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    padding: 10px 20px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 50px;
    font-weight: 500;
    transition: var(--transition);
    font-size: 1rem;
    outline: none;
    backdrop-filter: blur(5px);
    cursor: pointer;
}

.language-select:hover {
    background: rgba(255, 255, 255, 0.25);
}

.auth-button {
    background: white;
    color: var(--primary);
    padding: 12px 24px;
    border-radius: 50px;
    font-weight: 600;
    transition: var(--transition);
    border: none;
    font-size: 1rem;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.auth-button::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -60%;
    width: 20px;
    height: 200%;
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(25deg);
    transition: all 0.6s;
}

.auth-button:hover {
    background: #e6f0ff;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.auth-button:hover::after {
    left: 120%;
}

/* 搜索区域优化 */
.search-container {
    max-width: 800px;
    margin: 2rem auto;
    padding: 0 20px;
    position: relative;
}

.search-box {
    width: 100%;
    padding: 18px 30px 18px 65px;
    border-radius: 50px;
    border: 2px solid transparent;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    font-size: 1.1rem;
    outline: none;
    transition: var(--transition);
    background: white;
}

.search-box:focus {
    border-color: var(--accent);
    box-shadow: 0 4px 20px rgba(66, 153, 225, 0.3);
}

.search-icon {
    position: absolute;
    left: 35px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    font-size: 1.4rem;
}

/* 搜索结果样式 */
.search-results {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    max-height: 300px;
    overflow-y: auto;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
}

.search-results.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.search-result-item {
    padding: 15px 25px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: background 0.2s;
    border-bottom: 1px solid #f1f5f9;
}

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

.search-result-item:hover {
    background: #f0f7ff;
}

.search-result-item i {
    color: var(--primary);
    font-size: 1.3rem;
    min-width: 28px;
}

.keyword {
    color: var(--accent);
    background: rgba(66, 153, 225, 0.1);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.85rem;
    margin-top: 4px;
    display: inline-block;
}

.no-result {
    padding: 20px;
    text-align: center;
    color: var(--text-light);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.no-result i {
    font-size: 2rem;
    color: var(--text-light);
    opacity: 0.6;
}

/* 主体区域优化 */
.section-header {
    text-align: center;
    margin: 3rem 0 2rem;
    padding: 0 20px;
}

.section-title {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    font-weight: 800;
    position: relative;
    display: inline-block;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -12px;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 5px;
    background: var(--accent);
    border-radius: 10px;
}

.section-subtitle {
    color: var(--text-light);
    font-size: 1.15rem;
    max-width: 700px;
    margin: 1.8rem auto 0;
    line-height: 1.7;
}

/* 分类导航优化 */
.categories {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 40px;
    padding: 0 20px;
}

.category-btn {
    padding: 14px 30px;
    border: 2px solid rgba(32, 85, 138, 0.2);
    background: white;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-size: 1.05rem;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.category-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 100%;
    background: linear-gradient(90deg, var(--primary) 0%, var(--primary-light) 100%);
    transition: width 0.4s ease;
    z-index: -1;
}

.category-btn:hover, .category-btn.active {
    color: white;
    border-color: transparent;
}

.category-btn:hover::before, 
.category-btn.active::before {
    width: 100%;
}

/* 工具卡片优化 - 关键区域 */
.tool-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 30px;
    padding: 0 20px 60px;
}

.tool-card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
    border: 1px solid rgba(66, 153, 225, 0.1);
    transform: translateY(20px);
    opacity: 0;
}

.tool-card.loaded {
    transform: translateY(0);
    opacity: 1;
}

.tool-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-hover);
    border-color: rgba(66, 153, 225, 0.3);
}

/* 轮播容器 */
.square-container {
    position: relative;
    width: 100%;
    height: 280px;
    overflow: hidden;
    background: linear-gradient(135deg, #f1f7fd 0%, #e6f0ff 100%);
    border-radius: var(--border-radius) var(--border-radius) 0 0;
}

.square-slider {
    position: relative;
    width: 100%;
    height: 100%;
}

.square-slide {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.square-slide.active {
    opacity: 1;
}

.square-slide img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.1));
    transition: transform 0.5s ease;
}

.square-slide:hover img {
    transform: scale(1.03);
}

/* 工具内容 */
.tool-content {
    padding: 22px;
    width: 100%;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.tool-title {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--secondary);
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
}

.tool-title i {
    font-size: 1.4rem;
    color: var(--accent);
    flex-shrink: 0;
}

.tool-title span {
    color: var(--primary);
    background: linear-gradient(90deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-weight: 600;
    font-size: 1.1rem;
}

.tool-desc {
    font-size: 0.95rem;
    color: var(--text-light);
    margin-bottom: 15px;
    line-height: 1.7;
    flex: 1;
}

.tool-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    padding-top: 15px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.tool-time {
    font-size: 0.9rem;
    color: var(--text-light);
    display: flex;
    align-items: center;
    font-weight: 500;
    gap: 6px;
}

.tool-button {
    background: linear-gradient(90deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 10px rgba(32, 85, 138, 0.3);
}

.tool-button:hover {
    background: linear-gradient(90deg, var(--primary-light) 0%, var(--accent) 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(32, 85, 138, 0.4);
}

/* 标记 */
.badge {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 20;
    padding: 8px 18px;
    border-radius: 30px;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
}

.badge-hot {
    background: linear-gradient(45deg, #e11d48, #ff3860);
    color: white;
}

.badge-basic {
    background: linear-gradient(45deg, #10b981, #34d399);
    color: white;
}

.badge-advanced {
    background: linear-gradient(45deg, #3b82f6, #60a5fa);
    color: white;
}

.badge-special {
    background: linear-gradient(45deg, #8b5cf6, #a78bfa);
    color: white;
}

/* 轮播指示器 */
.slider-indicators {
    position: absolute;
    bottom: 15px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 8px;
    z-index: 10;
}

.slider-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: var(--transition);
}

.slider-indicator.active {
    background: var(--accent);
    transform: scale(1.4);
    border: 2px solid white;
}

.slider-indicator:hover {
    transform: scale(1.6);
    background: white;
}

/* 返回顶部按钮 */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(32, 85, 138, 0.4);
    cursor: pointer;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.4s ease;
    z-index: 800;
}

.back-to-top.visible {
    opacity: 1;
    transform: translateY(0);
}

.back-to-top:hover {
    background: var(--accent);
    transform: translateY(-3px);
}

/* 页脚优化 */
footer {
    background: var(--secondary);
    color: white;
    padding: 4rem 0 3rem;
    margin-top: 3rem;
    position: relative;
    font-size: 1.05rem;
}

footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 6px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
}

.footer-content {
    display: flex;
    justify-content: space-between;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 40px;
}

.footer-column {
    flex: 1;
    padding: 0 20px;
}

.footer-column h3 {
    font-size: 1.6rem;
    margin-bottom: 1.4rem;
    position: relative;
    padding-bottom: 12px;
}

.footer-column h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 50px;
    height: 4px;
    background: var(--accent);
    border-radius: 2px;
}

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

.footer-column ul li {
    margin-bottom: 12px;
}

.footer-column ul li a {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.08rem;
}

.footer-column ul li a:hover {
    color: var(--accent-light);
    transform: translateX(5px);
}

.footer-column p {
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.7;
    margin-bottom: 25px;
}

.copyright {
    text-align: center;
    padding-top: 2rem;
    color: rgba(255, 255, 255, 0.7);
    font-size: 1rem;
    margin-top: 3rem;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    max-width: 1400px;
    margin: 4rem auto 0;
    padding: 25px 0 0;
}

/* 响应式优化 */
@media (max-width: 1100px) {
    .footer-content {
        flex-wrap: wrap;
    }
    .footer-column {
        flex-basis: 50%;
        margin-bottom: 30px;
    }
}

@media (max-width: 900px) {
    .tool-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }
    
    .square-container {
        height: 250px;
    }

    .header-content {
        flex-wrap: wrap;
        justify-content: center;
        gap: 20px;
    }
    
    .brand {
        width: 100%;
        justify-content: center;
        text-align: center;
    }
    
    .header-actions {
        width: 100%;
        justify-content: center;
        margin-top: 15px;
    }
}

@media (max-width: 768px) {
    .footer-column {
        flex-basis: 100%;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .section-subtitle {
        font-size: 1rem;
    }
    
    .tool-title {
        font-size: 1.3rem;
    }
    
    .search-box {
        padding: 16px 24px 16px 60px;
    }
    
    .search-icon {
        left: 28px;
    }
}

@media (max-width: 500px) {
    .tool-grid {
        grid-template-columns: 1fr;
    }
    
    .section-title {
        font-size: 1.8rem;
    }
    
    .language-select, .auth-button {
        width: 100%;
        text-align: center;
        justify-content: center;
    }

    .header-actions {
        flex-direction: column;
        gap: 12px;
        width: 100%;
    }
    
    .categories {
        flex-direction: column;
    }
    
    .category-btn {
        width: 100%;
        justify-content: center;
    }
    
    .square-container {
        height: 220px;
    }
    
    .tool-content {
        padding: 18px;
    }
}