/* 基础样式 */
body {
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
    background-color: #f8f9fa; /* 浅灰色背景，类似 Chrome 的风格 */
    display: flex;
    justify-content: flex-start; /* 内容靠上 */
    align-items: center;
    height: 100vh;
    flex-direction: column; /* 垂直排列 */
    padding-top: 5vh; /* 调整顶部间距 */
    overflow: hidden; /* 去掉滚动 */
}

.container {
    text-align: center;
    width: 100%;
    max-width: 800px;
    padding: 20px;
    margin-top: 5vh; /* 调整顶部间距 */
}

/* 搜索栏样式 */
.search-bar {
    margin-bottom: 50px;
    width: 100%;
    max-width: 584px; /* Google搜索框宽度 */
    margin-left: auto;
    margin-right: auto;
}

.search-bar form {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.search-input-wrapper {
    position: relative;
    width: 100%;
}

.clear-button {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #70757a;
    cursor: pointer;
    font-size: 22px;
    padding: 0 5px;
    display: none;
    z-index: 2;
}

.clear-button:hover {
    color: #1a73e8;
}

.search-bar input[type="text"] {
    width: 100%;
    height: 46px;
    padding: 0 45px 0 16px;
    font-size: 16px;
    border: 1px solid #dfe1e5;
    border-radius: 24px;
    background-color: #fff;
    box-shadow: none;
    outline: none;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.search-bar input[type="text"]:hover,
.search-bar input[type="text"]:focus {
    box-shadow: 0 1px 6px rgba(32,33,36,0.28);
    border-color: rgba(223,225,229,0);
}

.search-bar button[type="submit"] {
    display: none;
}

/* 导航链接样式 */
.links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); /* 网格布局，自动适应宽度 */
    gap: 20px; /* 间距 */
    justify-content: center;
    max-width: 800px;
    margin: 0 auto;
}

.links a {
    text-decoration: none;
    color: #333;
    background-color: #fff;
    border-radius: 8px;
    padding: 15px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.links a:hover {
    transform: translateY(-5px); /* 悬停时上移 */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); /* 悬停时阴影 */
}

.links .icon {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 10px;
    color: #007BFF;
}

.links span {
    font-size: 0.9rem;
    color: #555;
}

.brand {
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 30px; /* 增大品牌名称与搜索栏的间距 */
    color: #4285F4; /* Google蓝色 */
    font-family: 'Product Sans', sans-serif; /* Google字体 */
    letter-spacing: 0.5px; /* 字母间距 */
}

.brand span:nth-child(2) {
    color: #EA4335; /* Google红色 */
}

.brand span:nth-child(3) {
    color: #FBBC05; /* Google黄色 */
}

.brand span:nth-child(4) {
    color: #34A853; /* Google绿色 */
}

/* 移动端适配 */
@media (max-width: 600px) {
    .search-bar input[type="text"] {
        width: 100%; /* 搜索栏宽度适应屏幕 */
    }

    .links {
        grid-template-columns: repeat(auto-fit, minmax(80px, 1fr)); /* 调整网格布局 */
    }

    .links a {
        padding: 10px; /* 调整链接的内边距 */
    }

    .links .icon {
        font-size: 20px; /* 调整图标大小 */
    }

    .links span {
        font-size: 0.8rem; /* 调整文字大小 */
    }
}

@media (max-width: 768px) {
    .container {
        padding: 15px;
        margin-top: 0;
        width: 92%; /* 控制整体内容区域宽度 */
    }

    .brand {
        font-size: 2rem;
        margin-bottom: 25px;
        margin-top: 10px;
    }

    .search-bar {
        margin-bottom: 35px;
        width: 92%;
        padding: 0;
        box-sizing: border-box;
        max-width: 90%;
    }

    .links {
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
        width: 100%;
        padding: 0 5px;
        box-sizing: border-box;
    }

    .search-bar input[type="text"] {
        max-width: none;
        width: 100%;
        height: 40px;
        font-size: 0.9rem;
        height: 40px;
        font-size: 15px;
    }

    .search-bar button {
        width: 80px;
        height: 40px;
        font-size: 0.9rem;
    }

    .search-bar button[type="submit"] {
        height: 40px;
        padding: 0 16px;
        font-size: 14px;
    }

    .links {
        grid-template-columns: repeat(3, 1fr);
        gap: 15px;
        padding: 0 10px;
    }

    .links a {
        padding: 12px 8px;
    }

    .links .icon {
        font-size: 18px;
        margin-bottom: 6px;
    }

    .links span {
        font-size: 0.8rem;
    }

    body {
        padding-top: 2vh;
    }

    .clear-button {
        right: 8px;
        font-size: 18px;
        right: 12px;
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .container {
        width: 96%;
        padding: 10px;
    }

    .brand {
        font-size: 1.8rem;
        margin-bottom: 20px;
    }

    .search-bar {
        margin-bottom: 25px;
        width: 94%;
        padding: 0 5px;
    }

    .links {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        padding: 0;
    }

    .links a {
        padding: 12px 5px;
        margin: 0 3px;
    }

    body {
        padding-top: 15px;
    }
}