:root {
    --blue: #1a73e8;
    --text: #202124;
    --gray: #70757a;
    --border: #dfe1e5;
}

body.home-layout {
    margin: 0;
    font-family: -apple-system, system-ui, sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
    background: #fff;
    overflow-y: scroll;
    /* 强制显示滚动条占位，防止抖动 */
}

.hero {
    width: 100%;
    max-width: 600px;
    text-align: center;
    /* 关键：使用 padding 而不是 margin 撑开顶部空间 */
    padding-bottom: 120px;
}

.logo {
    font-size: 3.5rem;
    cursor: pointer;
    margin: 0 0 40px 0;
    font-weight: 800;
}

.logo span {
    color: var(--blue);
}

/* 搜索包装器：固定高度是解决页面跳动的核心 */
.search-wrapper {
    position: relative;
    height: 60px;
    margin: 0 auto;
}

#searchInput {
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    padding: 0 28px;
    border: 1px solid var(--border);
    border-radius: 30px;
    font-size: 1.1rem;
    outline: none;
    background: #fff;
    transition: box-shadow 0.2s;
    /* 确保输入框不随内容变化位移 */
    position: absolute;
    top: 0;
    left: 0;
}

#searchInput:focus {
    box-shadow: 0 1px 6px rgba(32, 33, 36, 0.2);
    border-color: rgba(0, 0, 0, 0);
}

/* 结果列表：绝对定位，不占用文档流空间 */
.results-list {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    margin-top: 10px;
    max-height: 300px;
    overflow-y: auto;
}

.search-item {
    padding: 15px 25px;
    text-align: left;
    border-bottom: 1px solid #f1f3f4;
    cursor: pointer;
}

.search-item:hover {
    background: #f8f9fa;
}

.search-item strong {
    display: block;
    color: var(--blue);
}

.search-item small {
    color: var(--gray);
    font-size: 0.8rem;
}

/* 随机板块 */
.random-box {
    margin-top: 60px;
    /* 避免因上方 absolute 元素遮挡无法点击 */
    position: relative;
    z-index: 1;
}

.random-box p {
    color: var(--gray);
    font-size: 0.85rem;
}

.lucky-title-card {
    display: inline-block;
    font-size: 2.2rem;
    font-weight: 800;
    text-decoration: none;
    color: var(--text);
    padding: 5px 0;
    position: relative;
    transition: color 0.3s;
}

.lucky-title-card::after {
    content: '';
    position: absolute;
    width: 0;
    height: 4px;
    bottom: 0;
    left: 50%;
    background: var(--blue);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.lucky-title-card:hover {
    color: var(--blue);
}

.lucky-title-card:hover::after {
    width: 100%;
}

.no-data {
    padding: 20px;
    color: #999;
}