* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
}

html {
    font-size: 14px; /* 基础字体大小 */
}

body {
    background-color: #f8f9fa;
    color: #333;
    line-height: 1.6;
    font-size: 1rem;
}

/* 头部样式 */
header {
    background: linear-gradient(135deg, #3a8ffe 0%, #96e0ff 100%);
    color: white;
    padding: 1rem 2rem;
    box-shadow: 0 0.285rem 0.857rem rgba(0,0,0,0.08);
    position: sticky;
    top: 0;
    z-index: 100;
    height: 4.6rem;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 85.714rem;
    margin: 0 auto;
    gap: 1rem;
    width: 100%;
}

.logo {
    font-size: 1.7rem;
    font-weight: 700;
    color: #ffffff;
    text-decoration: none;
    transition: color 0.3s;
    white-space: nowrap;
    flex-shrink: 0;
}

/* 搜索容器 */
.search-container {
    position: relative;
    max-width: 28rem;
    width: 100%;
}

/* 搜索输入框 */
#searchInput {
    width: 100%;
    padding: 0.643rem 1rem 0.643rem 2.286rem; /* 左侧留图标空间 */
    font-size: 0.929rem;
    border: 1px solid #cbd5e0;
    border-radius: 1.714rem;
    background-color: white;
    color: #2d3748;
    outline: none;
    transition: border-color 0.3s, box-shadow 0.3s;
    box-shadow: 0 0.143rem 0.429rem rgba(0,0,0,0.05);
}

#searchInput::placeholder {
    color: #a0aec0;
}

#searchInput:focus {
    border-color: #3a8ffe;
    box-shadow: 0 0 0 0.143rem rgba(58, 143, 254, 0.2);
}

/* 搜索图标（固定在左侧） */
.search-icon {
    position: absolute;
    left: 0.857rem;
    top: 50%;
    transform: translateY(-50%);
    color: #718096;
    pointer-events: none;
    font-size: 0.929rem;
}

/* 下拉弹窗 */
.search-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border-radius: 0.714rem;
    box-shadow: 0 0.285rem 1.143rem rgba(0,0,0,0.12);
    z-index: 200;
    margin-top: 0.357rem;
    max-height: 18rem;
    overflow-y: auto;
    display: none;
    border: 1px solid #e2e8f0;
}

.search-dropdown.show {
    display: block;
}

/* 下拉项 */
.search-dropdown-item,
.search-dropdown-empty {
    padding: 0.714rem 1.143rem;
    font-size: 0.929rem;
    text-decoration: none;
    color: #2d3748;
    display: block;
    transition: background 0.2s;
    cursor: pointer;
}

.search-dropdown-item:hover,
.search-dropdown-item:focus {
    background-color: #f0f9ff;
    color: #1a73e8;
    outline: none;
}

/* 无结果提示 */
.search-dropdown-empty {
    color: #718096;
    text-align: center;
    font-style: italic;
}

#toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    background: rgba(58, 143, 254, 0.95);
    color: white;
    padding: 0.8rem 1.5rem;
    border-radius: 0.6rem;
    font-size: 1rem;
    font-weight: 500;
    box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.2);
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: transform 0.3s ease, opacity 0.3s ease;
    backdrop-filter: blur(4px);
    max-width: 80%;
    text-align: center;
}

/* 主内容区样式 */
main {
    max-width: 85.714rem;
    margin: 1.429rem auto;
    padding: 0 1.429rem;
    width: 100%;
    min-height: calc(100vh - 12.7rem);
}

.tool-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(20rem, 1fr));
    gap: 1.429rem;
    margin-top: 0.714rem;
}

.tool-card {
    background: white;
    border-radius: 0.714rem;
    overflow: hidden;
    box-shadow: 0 0.214rem 0.714rem rgba(0,0,0,0.04);
    transition: transform 0.3s, box-shadow 0.3s;
    border: 1px solid #edf2f7;
}

.tool-card:hover {
    transform: translateY(-0.214rem);
    box-shadow: 0 0.357rem 1.071rem rgba(0,0,0,0.08);
}

.tool-content {
    padding: 1.286rem;
}

.tool-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.571rem;
    color: #2d3748;
    display: flex;
    align-items: center;
}

.tool-title::before {
    content: '';
    display: inline-block;
    width: 0.428rem;
    height: 0.428rem;
    background-color: #3a8ffe;
    border-radius: 50%;
    margin-right: 0.714rem;
}

.tool-desc {
    color: #4a5568;
    font-size: 1rem;
    margin-bottom: 0.857rem;
    line-height: 1.6;
}

.tool-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.714rem;
    padding-top: 0.714rem;
    border-top: 1px dashed #e2e8f0;
}

.tool-category {
    background: #f0f9ff;
    color: #3a8ffe;
    padding: 0.286rem 0.857rem;
    border-radius: 1.429rem;
    font-size: 0.8rem;
    font-weight: 500;
}

.tool-link {
    display: inline-flex;
    align-items: center;
    color: #3a8ffe;
    text-decoration: none;
    font-weight: 600;
    gap: 0.357rem;
    transition: color 0.3s;
    font-size: 0.9rem;
}

.tool-link:hover {
    color: #1a73e8;
}

.tool-link::after {
    content: '→';
    transition: transform 0.3s;
}

.tool-link:hover::after {
    transform: translateX(0.214rem);
}

.generator {
    background: white;
    border-radius: 0.714rem;
    padding: 1.2rem;
    box-shadow: 0 0.214rem 0.714rem rgba(0,0,0,0.04);
    margin-bottom: 2rem;
}

/* 页脚样式 */
footer {
    background: #2d3748;
    color: #cbd5e0;
    padding: 1.429rem;
    text-align: center;
    margin-top: 2.143rem;
    height: 4.6rem;
}

.footer-container {
    max-width: 85.714rem;
    margin: 0 auto;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 0.357rem;
    margin-bottom: 0.714rem;
    flex-wrap: wrap;
}

.footer-links a {
    color: #cbd5e0;
    text-decoration: none;
    transition: color 0.3s;
    font-size: 1rem;
}

.footer-links a:hover {
    color: #63b3ed;
}