/**
 * 首页专用样式
 */

/* ========== 首页主体布局 ========== */
.main {
    flex: 1;
    margin-left: 0;
    display: flex;
    flex-direction: column;
}

/* ========== Hero 区域 ========== */
.home-hero {
    padding: 80px 48px 60px;
    text-align: center;
    border-bottom: 1px solid var(--color-border-light);
}

.home-hero-title {
    font-size: 44px;
    font-weight: 400;
    letter-spacing: -1px;
    margin-bottom: 16px;
    line-height: 1.2;
}

.home-hero-title strong {
    font-weight: 600;
    background: linear-gradient(135deg, var(--color-primary), var(--color-success), var(--color-warning), var(--color-error));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.home-hero-desc {
    font-size: 18px;
    color: var(--color-text-secondary);
    margin-bottom: 32px;
}

.home-hero-search {
    max-width: 520px;
    margin: 0 auto 20px;
    position: relative;
}

.home-hero-search input {
    width: 100%;
    height: 48px;
    padding: 0 20px 0 44px;
    border: 1px solid var(--color-border);
    border-radius: 24px;
    font-size: 15px;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
}

.home-hero-search input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 2px 12px rgba(26,115,232,0.2);
}

.home-hero-search svg {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-text-light);
    width: 20px;
    height: 20px;
    pointer-events: none;
}

/* 搜索下拉框 */
.hero-search-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: var(--color-bg);
    border: 1px solid var(--color-border-light);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.12);
    max-height: 400px;
    overflow-y: auto;
    z-index: 100;
    display: none;
}

.hero-search-dropdown.show {
    display: block;
    animation: searchDropdownIn 0.2s ease;
}

@keyframes searchDropdownIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-search-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px 8px;
    border-bottom: 1px solid var(--color-border-light);
}

.hero-search-count {
    font-size: 12px;
    color: var(--color-text-light);
}

.hero-search-tip {
    font-size: 11px;
    color: var(--color-text-light);
    background: var(--color-bg-secondary);
    padding: 4px 8px;
    border-radius: 4px;
}

.hero-search-list {
    padding: 8px 0;
}

.hero-search-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    cursor: pointer;
    text-decoration: none;
    color: var(--color-text);
    transition: var(--transition);
}

.hero-search-item:hover,
.hero-search-item.active {
    background: var(--color-primary-light);
}

.hero-search-item-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.hero-search-item-icon.blue { background: #e8f0fe; color: #1a73e8; }
.hero-search-item-icon.green { background: #e6f4ea; color: #34a853; }
.hero-search-item-icon.yellow { background: #fef7e0; color: #fbbc04; }
.hero-search-item-icon.red { background: #fce8e6; color: #ea4335; }
.hero-search-item-icon.purple { background: #f3e8fd; color: #9334e6; }
.hero-search-item-icon.cyan { background: #e0f7fa; color: #00acc1; }
.hero-search-item-icon.orange { background: #fef3e0; color: #f09300; }

.hero-search-item-info {
    flex: 1;
    min-width: 0;
}

.hero-search-item-name {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 2px;
}

.hero-search-item-name mark {
    background: #fef7e0;
    color: inherit;
    padding: 0 2px;
    border-radius: 2px;
}

.hero-search-item-desc {
    font-size: 12px;
    color: var(--color-text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hero-search-item-arrow {
    color: var(--color-text-light);
    font-size: 12px;
    opacity: 0;
    transition: var(--transition);
}

.hero-search-item:hover .hero-search-item-arrow,
.hero-search-item.active .hero-search-item-arrow {
    opacity: 1;
}

.hero-search-empty {
    padding: 40px 20px;
    text-align: center;
}

.hero-search-empty-icon {
    font-size: 40px;
    margin-bottom: 12px;
    opacity: 0.5;
}

.hero-search-empty-text {
    font-size: 14px;
    color: var(--color-text-secondary);
    margin-bottom: 8px;
}

.hero-search-empty-hint {
    font-size: 12px;
    color: var(--color-text-light);
}

.hero-search-footer {
    display: flex;
    justify-content: center;
    gap: 16px;
    padding: 12px 16px;
    border-top: 1px solid var(--color-border-light);
    background: var(--color-bg-secondary);
    border-radius: 0 0 16px 16px;
}

.hero-search-shortcut {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--color-text-light);
}

.hero-search-shortcut kbd {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 4px;
    font-size: 11px;
    font-family: inherit;
}

.home-hero-tags {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.home-hero-tag {
    padding: 6px 14px;
    background: var(--color-bg-secondary);
    border-radius: 16px;
    font-size: 13px;
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.home-hero-tag:hover {
    background: var(--color-primary-light);
    color: var(--color-primary);
}

/* ========== 内容区块 ========== */
.home-section {
    padding: 40px 48px;
    border-bottom: 1px solid var(--color-border-light);
}

.home-section:last-child {
    border-bottom: none;
}

.home-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.home-section-title {
    font-size: 20px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.home-section-hint {
    font-size: 14px;
    color: var(--color-text-secondary);
    font-weight: 400;
}

.home-section-link {
    color: var(--color-primary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
}

.home-section-link:hover {
    text-decoration: underline;
}

/* ========== 工具卡片网格 ========== */
.home-tool-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
}

.home-tool-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 18px;
    background: var(--color-bg);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-md);
    text-decoration: none;
    color: var(--color-text);
    transition: var(--transition);
}

.home-tool-card:hover {
    border-color: var(--color-primary);
    box-shadow: var(--shadow-md);
}

.home-tool-icon {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.home-tool-icon.blue { background: #e8f0fe; color: #1a73e8; }
.home-tool-icon.green { background: #e6f4ea; color: #34a853; }
.home-tool-icon.yellow { background: #fef7e0; color: #fbbc04; }
.home-tool-icon.red { background: #fce8e6; color: #ea4335; }
.home-tool-icon.purple { background: #f3e8fd; color: #9334e6; }
.home-tool-icon.cyan { background: #e0f7fa; color: #00acc1; }
.home-tool-icon.orange { background: #fef3e0; color: #f09300; }

.home-tool-info {
    flex: 1;
    min-width: 0;
}

.home-tool-name {
    font-size: 15px;
    font-weight: 500;
    margin-bottom: 2px;
}

.home-tool-desc {
    font-size: 13px;
    color: var(--color-text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ========== 分类区块 ========== */
.home-category-section {
    margin-bottom: 32px;
}

.home-category-section:last-child {
    margin-bottom: 0;
}

.home-category-title {
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    color: var(--color-text);
}

.home-category-title .home-category-icon {
    font-size: 18px;
}

/* ========== 响应式 ========== */
@media (max-width: 900px) {
    .home-hero {
        padding: 60px 24px 40px;
    }

    .home-hero-title {
        font-size: 32px;
    }

    .home-hero-desc {
        font-size: 16px;
    }

    .home-section {
        padding: 32px 24px;
    }

    .home-tool-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .home-hero {
        padding: 48px 16px 32px;
    }

    .home-hero-title {
        font-size: 26px;
        letter-spacing: -0.5px;
    }

    .home-hero-desc {
        font-size: 14px;
        margin-bottom: 24px;
    }

    .home-hero-search input {
        height: 44px;
        font-size: 14px;
    }

    .home-hero-tags {
        gap: 6px;
    }

    .home-hero-tag {
        padding: 5px 12px;
        font-size: 12px;
    }

    .hero-search-footer {
        display: none;
    }

    .home-section {
        padding: 24px 16px;
    }

    .home-section-header {
        margin-bottom: 16px;
    }

    .home-section-title {
        font-size: 18px;
    }

    .home-section-hint {
        font-size: 13px;
    }

    .home-tool-grid {
        gap: 10px;
    }

    .home-tool-card {
        padding: 14px 16px;
        gap: 12px;
    }

    .home-tool-icon {
        width: 38px;
        height: 38px;
        font-size: 18px;
    }

    .home-tool-name {
        font-size: 14px;
    }

    .home-tool-desc {
        font-size: 12px;
    }

    .home-category-section {
        margin-bottom: 24px;
    }

    .home-category-title {
        font-size: 15px;
        margin-bottom: 12px;
    }
}
