/* ========================================
                Searching for⋯
   ======================================== */

/* ---------- 全局重置 ---------- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    width: 100%;
    height: 100%;
    overflow: hidden;
}

body {
    width: 100%;
    min-height: 100vh;
    text-align: center;
    background: #fff;
    font-family: Arial, "Microsoft YaHei", "微软雅黑", sans-serif;
    font-size: 12px;
    position: relative;
    z-index: 0;
}

a {
    text-decoration: none;
    color: #222;
}
a:hover {
    color: #315efb;
}

img {
    -webkit-user-drag: none;
    user-select: none;
    pointer-events: none;
}

/* ---------- 皮肤背景层 ---------- */
#skin-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    /* 必应每日壁纸，微软服务器自动更新 */
    background-color: #000;
    background-image: url('https://api.dujin.org/bing/1920.php');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* ---------- 顶部导航栏 ---------- */
.top-nav {
    position: fixed;
    left: 0;
    top: -6px;
    z-index: 100;
    height: 60px;
    padding-left: 24px;
    display: flex;
    align-items: center;
}

.top-nav a {
    display: inline-block;
    margin-right: 24px;
    font-size: 14px;
    color: #ccc;
    font-weight: 400;
    white-space: nowrap;
}
.top-nav a:hover {
    color: #fff;
}

/* 顶部导航下拉菜单 */
.top-nav-dropdown {
    display: inline-block;
    position: relative;
    margin-right: 24px;
}

.top-nav-trigger {
    display: inline-block;
    font-size: 14px;
    color: #ccc;
    font-weight: 400;
    white-space: nowrap;
    cursor: default;
    user-select: none;
}

.top-nav-dropdown:hover .top-nav-trigger {
    color: #fff;
}

/* hover 时桥接文字与下拉框之间的 18px 空隙，防止 hover 丢失 */
.top-nav-dropdown:hover::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    height: 18px;
}

.top-nav-dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 18px);
    left: 50%;
    transform: translateX(-50%);
    padding: 4px 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 8px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12);
    z-index: 200;
}

.top-nav-dropdown:hover .top-nav-dropdown-menu {
    display: block;
}

.top-nav-dropdown-menu a {
    display: block !important;
    margin-right: 0 !important;
    padding: 4px 14px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.85) !important;
    white-space: nowrap;
    line-height: 1.4;
}

.top-nav-dropdown-menu a:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff !important;
}

/* 右上角区域 */
.top-nav-right {
    position: fixed;
    right: 0;
    top: -6px;
    z-index: 100;
    height: 60px;
    padding-right: 24px;
    display: flex;
    align-items: center;
}

/* 天气模块 */
.weather-wrapper {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: #ccc;
    text-decoration: none;
    white-space: nowrap;
    height: 23px;
    line-height: 23px;
    cursor: pointer;
}
.weather-wrapper:hover {
    color: #fff;
}

.weather-location {
    font-weight: 400;
}

.weather-emoji {
    font-size: 15px;
    line-height: 1;
}

.weather-temp {
    font-weight: 400;
}

/* ---------- 主包裹 ---------- */
#wrapper {
    position: relative;
    z-index: 0;
    min-width: 1000px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 顶部半透明黑色底色条：横穿全页，高48px */
#wrapper::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 48px;
    background: rgba(0, 0, 0, 0.5);
    z-index: -1;
    pointer-events: none;
}

/* ---------- 头部容器 ---------- */
#head {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding-top: 60px;  /* 留给顶部导航栏 */
    margin-top: -120px;  /* 整体上移120px */
}

/* ---------- 搜索主体包裹 ---------- */
#head_wrapper {
    position: relative;
    width: 100%;
    text-align: center;
    padding-bottom: 50px;
}

/* ---------- Logo 区域 ---------- */
#lg {
    height: 24vh;
    min-height: 185px;
    max-height: 310px;
    position: relative;
    text-align: center;
    top: -30px;
}

/* Logo 交叉叠化层 */
.logo-layer {
    position: absolute;
    bottom: 10px;
    left: 50%;
    margin-left: -135px;
    width: 270px;
    height: 85px;
    border: 0;
    display: block;
    transition: opacity 1.2s ease;
}

.logo-current {
    opacity: 1;
    z-index: 2;
}

.logo-next {
    opacity: 0;
    z-index: 1;
}

/* ---------- 搜索表单 ---------- */
#form {
    position: relative;
    z-index: 1;
    margin: 0 auto;
    padding: 0;
    width: 800px;
    top: -10px;
}

.s_form_wrapper {
    position: relative;
    display: block;
    width: 800px;
    height: 48px;
    margin: 0 auto;
}

/* 搜索框左侧图标 */
.search-left-icon {
    display: block;
    width: 28px;
    height: 28px;
    border-radius: 4px;
    object-fit: cover;
    object-position: center;
}

/* 上传成功后的关闭按钮（居中，仅在有图片且 hover 时显示） */
.image-upload-close {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    font-size: 12px;
    line-height: 20px;
    text-align: center;
    border-radius: 50%;
    cursor: pointer;
    pointer-events: auto;
    z-index: 5;
}

.search-left-icon-wrapper.has-image:hover .image-upload-close {
    display: block;
}

/* 上传中 loading 旋转动画 */
.image-upload-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid rgba(0, 0, 0, 0.15);
    border-top-color: #4e6ef2;
    border-radius: 50%;
    animation: icon-spin 0.6s linear infinite;
    z-index: 3;
    display: none;
}

.image-upload-loading.active {
    display: block;
}

@keyframes icon-spin {
    to { transform: rotate(360deg); }
}

/* 输入框包裹 */
#s_ipt_wr {
    display: block;
    width: 100%;
    height: 48px;
}

#s_ipt_wr:hover #kw {
    border-color: #a7aab5;
}

#kw {
    width: 100%;
    height: 48px;
    padding: 0 144px 0 58px;
    font-size: 16px;
    margin: 0;
    outline: 0;
    box-shadow: none;
    border-radius: 24px;
    border: 2px solid #c4c7ce;
    background: #fff;
    color: #222;
    box-sizing: border-box;
    -webkit-appearance: none;
    font-family: Arial, "Microsoft YaHei", sans-serif;
    line-height: 44px;
}

/* 输入文字时：用底部 padding 把文字向上挤压 2px */
#kw:not(:placeholder-shown) {
    padding: 0 144px 4px 58px;
}

#kw:focus {
    border-color: #4e6ef2 !important;
}

#kw::placeholder {
    font-size: 16px;
    color: #9195a3;
}

#kw::-webkit-input-placeholder {
    font-size: 16px;
    color: #9195a3;
}

#kw::-moz-placeholder {
    font-size: 16px;
    color: #9195a3;
}

/* 多引擎搜索按钮组 */
.search-engine-btns {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    gap: 6px;
    z-index: 2;
}

.search-engine-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    overflow: hidden;
    cursor: pointer;
    transition: opacity 0.2s ease, transform 0.2s ease;
    flex-shrink: 0;
}

.search-engine-btn:hover {
    opacity: 0.8;
    transform: scale(1.1);
}

.search-engine-btn img {
    display: block;
    width: 36px;
    height: 36px;
    border-radius: 50%;
}


/* ---------- 我的导航 ---------- */
#s-nav-wrapper {
    position: relative;
    width: 780px;
    margin: 14px auto 0;
}

/* 白色毛玻璃卡片 */
.site-card {
    background: rgba(255, 255, 255, 0.60);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-radius: 18px;
    padding: 0 24px 36px;
    box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.60);
    height: 260px;
}

/* 标题栏 */
.site-card-header {
    height: 46px;
    display: flex;
    align-items: center;
}

.site-card-title {
    font-size: 14px;
    color: #222;
    font-weight: 600;
    padding-top: 5px;
}

/* 站点网格容器 - Grid锁定7列2行 */
.site-pills {
    display: grid;
    grid-template-columns: repeat(7, 80px);
    gap: 16px 28px;
    justify-content: center;
    padding-top: 7px;
}

/* 单个站点项：圆形图标在上 + 名称在下 */
.site-pill {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 84px;
    padding: 6px 4px;
    background: transparent;
    border-radius: 12px;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s ease;
    box-sizing: border-box;
}

.site-pill:hover {
    background: rgba(0, 0, 0, 0.04);
}

.site-pill:hover .site-pill-name {
    color: #315efb;
}

/* 站点图标（圆形） */
.site-pill-icon {
    display: block;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, 0.05);
    flex-shrink: 0;
    object-fit: contain;
    margin: 0 auto 8px;
}

/* 站点名称 */
.site-pill-name {
    font-size: 13px;
    color: #222;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 72px;
    line-height: 1.2;
    text-align: center;
}

/* 隐藏旧的底部链接 */
#s_lm_wrap {
    display: none;
}

/* ---------- 底部信息 ---------- */
#foot {
    text-align: center;
    padding: 20px 0;
    color: rgba(255, 255, 255, 0.8);
    font-size: 15px;
    position: relative;
    top: 10px;
}

/* ========================================
   响应式适配
   ======================================== */

/* 大屏幕优化 */
@media screen and (min-width: 1920px) {
    #lg {
        max-height: 350px;
    }
}

/* 小屏幕简化 */
@media screen and (max-width: 1100px) {
    #wrapper {
        min-width: auto;
    }
    .top-nav a {
        margin-right: 14px;
        font-size: 13px;
    }
}

/* 手机/平板竖屏 */
@media screen and (max-width: 768px) {
    #wrapper {
        min-width: auto;
    }
    .top-nav {
        padding-left: 12px;
    }
    .top-nav a {
        margin-right: 8px;
        font-size: 12px;
    }
    .top-nav-right {
        padding-right: 12px;
    }
    #foot {
        font-size: 10px;
    }
}

/* 高分辨率大屏（4K 150% 等，CSS像素高度 ≥ 1200px）向上偏移 */
@media screen and (min-height: 1200px) {
    #head {
        margin-top: -180px;
    }
}

/* 暗色模式基础支持 */
@media (prefers-color-scheme: dark) {
    /* 暂不强制切换，保持皮肤效果 */
}

/* 搜索框左侧图标外层容器 */
.search-left-icon-wrapper {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    z-index: 2;
    border-radius: 4px;
}

/* file input 由浏览器原生 label[for] 机制激活，display:none 安全 */
#image-upload {
    display: none;
}

/* 搜索框左侧图标容器（label 元素，可点击） */
.search-left-icon-label {
    display: block;
    position: relative;
    width: 28px;
    height: 28px;
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
}

/* 无图片时 hover 变暗 */
.search-left-icon-wrapper:not(.has-image) .search-left-icon-label:hover {
    opacity: 0.85;
}

/* 有图片时 hover 缩略图半透明，露出 × 按钮 */
.search-left-icon-wrapper.has-image .search-left-icon-label:hover .search-left-icon {
    opacity: 0.5;
}
