@charset "utf-8";

* {
    padding: 0;
    margin: 0;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

html,
body {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
    background: #fff;
    font-family: sans-serif
}

#space {
    width: 100%
}

html {
    font-family: 'Noto Sans SC Sliced', PingFangSC-Light, Microsoft YaHei UI, Microsoft YaHei, helvetica, sans-serif;
    font-weight: 500;
    color: #000;
}

form,
input,
button {
    padding: 0;
    margin: 0;
    border: none;
    outline: none;
    background: none;
}

input::-webkit-input-placeholder {
    color: #ccc;
    letter-spacing: 2px;
    font-size: 16px;
}

ul,
li {
    display: block;
    list-style: none;
}

a {
    text-decoration: none;
    color: #fdfdfd;
}

#content {
    width: 100%;
    height: 100%;
}

.con {
    width: 100%;
    transition: 1s all;
    margin: auto;
    min-width: 320px;
    height: 380px;
    position: absolute;
    left: 0;
    top: -100px;
    right: 0;
    bottom: 0;
}

.con .shlogo {
    position: relative;
    width: 480px;
    height: 130px;
    margin: 20px auto;
    background: url(icon/logo.svg) no-repeat center/cover;
}

.con .shlogo a {
    width: 100%;
    display: block;
    width: 100%;
    height: 100%;
}

.con .sou {
    max-width: 680px;
    position: relative;
    width: calc(100% - 60px);
    min-width: 320px;
    margin: 0 auto;
}

.con .sou form {
    width: 100%;
    height: 50px;
    display: block;
    margin: 10px auto 30px;
    position: relative;
}

.con .sou form .wd {
    width: 100%;
    height: 100%;
    display: block;
    border: 1px solid #238fed;
    border-radius: 25px;
    line-height: 100%;
    font-size: 18px;
    text-indent: 50px;
    transition: 0.3s all;
}
.con .sou form .lg {
    display: block;
    width: 30px;
    height: 30px;
    position: absolute;
    left: 13px;
    top: 10px;
    border-radius: 50%;
    overflow: hidden;
    cursor: pointer;
}

.con .sou form .wd:focus {
    background: #fff;
    box-shadow: 0 0px 15px 0 rgba(32, 33, 36, 0.2);
    border-color: #fff
}

.con .sou form button {
    width: 40px;
    height: 40px;
    display: block;
    position: absolute;
    z-index: 10;
    right: 6px;
    top: 6px;
    cursor: pointer;
    font-size: 22px;
    line-height: 40px;
    border-radius: 50%;
    color: #777;
}

.con .sou #word{
    width: calc(100% - 70px);
    border: 15px solid #f1f1f1;
    border-radius: 10px;
    left:20px;
    position: absolute;z-index: 500; top:65px;
    background: #f1f1f1;
    line-height: 30px; font-style: 16px;overflow: hidden;
    display: none; 
}
.con .sou #word .li{
    cursor: pointer;
    color: #555;
}
.con .sou #word .li:hover{
    color: #29f;
}

.foot {
    position: absolute;
    bottom: 10px;
    text-align: center;
    width: 100%;
    color: #999;
    height: 20px;
    line-height: 20px;
    font-size: 12px;
}

.home {
    width: 50px;
    height: 50px;
    position: absolute;
    right: 70px;
    top: 10px;
    z-index: 200;
    cursor: pointer;
}

.home a {
    font-size: 20px;
    color: #999;
    line-height: 50px;
    display: block;
    text-align: center;
}

#menu {
    width: 50px;
    height: 50px;
    transform: scale(0.8);
    position: absolute;
    right: 10px;
    top: 5px;
    z-index: 2000000;
    cursor: pointer;
    transition: 0.5s;
}

#menu i {
    position: absolute;
    left: 0;
    right: 0;
    margin: 24px auto;
    width: 30px;
    height: 2px;
    background: rgb(240, 6, 6);
}

#menu i:before {
    content: '';
    width: 20px;
    height: 2px;
    top: -8px;
    background: rgb(240, 6, 6);
    position: absolute;
    right: 0;
}

#menu i:after {
    content: '';
    width: 20px;
    height: 2px;
    bottom: -8px;
    background: rgb(240, 6, 6);
    position: absolute;
    left: 0;
}

#menu.on {
    right: 380px;
    background: #29f;
    border-radius: 25px;
    box-shadow: 0 6px 8px rgba(36, 159, 253, .3);
}

#menu.on i {
    width: 20px;
    background: #fff;
}

#menu.on i:before {
    top: -5px;
    transform: rotate(45deg);
    width: 14px;
    right: -1px;
    left: auto;
    background: #fff;
}

#menu.on i:after {
    bottom: -5px;
    transform: rotate(-45deg);
    width: 14px;
    right: -1px;
    left: auto;
    background: #fff;
}

.list {
    width: 337px;
    padding: 0 20px;
    height: 100%;
    overflow: hidden;
    overflow-y: auto;
    position: absolute;
    right: 0px;
    z-index: 2000;
    background: #222d46;
    transition: 0.3s all linear;
}

.list.closed {
    right: -380px;
}

/* ========== 折叠分类核心样式（修复布局错乱） ========== */
.category-collapse {
    width: 100%;
    margin: 10px 0;
    border-radius: 8px;
    background: rgba(255,255,255,0.05);
    overflow: hidden;
    clear: both; /* 清除浮动影响 */
}

.category-title {
    width: 100%;
    height: 45px;
    line-height: 45px;
    padding: 0 15px;
    margin: 0;
    text-align: left;
    text-indent: 0;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255,255,255,0.08);
    transition: all 0.3s ease;
    box-sizing: border-box; /* 防止内边距撑宽 */
}

.category-title:hover {
    background: rgba(255,255,255,0.12);
}

.category-title .icon-wrap {
    display: flex;
    align-items: center;
}

.category-title .arrow {
    width: 16px;
    height: 16px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    transition: all 0.3s ease;
    opacity: 0.7;
}

.category-title.expanded .arrow {
    transform: rotate(225deg);
}

.category-links {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    padding: 0 !important;
    margin: 0 !important;
    list-style: none !important; /* 强制重置列表样式 */
    clear: both; /* 清除浮动 */
    float: none !important;
}

.category-links.expanded {
    max-height: 2000px; /* 增大最大高度，适配多链接 */
    padding: 0 !important;
}

/* 核心修复：完全重置分类链接内li样式，消除原有浮动影响 */
.category-links li {
    float: none !important; /* 强制取消浮动 */
    width: 100% !important;
    height: 42px !important;
    margin: 0 !important;
    padding: 0 15px !important;
    border-bottom: 1px solid rgba(255,255,255,0.05) !important;
    box-sizing: border-box !important;
    display: block !important; /* 强制块级显示 */
    list-style: none !important;
}

.category-links li:last-child {
    border-bottom: none !important;
}

/* 修复链接样式 */
.category-links li a {
    width: 100% !important;
    height: 100% !important;
    border-radius: 0 !important;
    background: transparent !important;
    display: flex !important;
    align-items: center !important;
    padding: 0 10px !important;
    box-sizing: border-box !important;
    font-size: 14px !important;
    color: #fdfdfd !important;
    font-weight: 500 !important;
    text-indent: 0 !important; /* 重置缩进 */
}

.category-links li a:hover {
    background: linear-gradient(135deg, rgba(35, 153, 255, 0.2) 0%, rgba(84, 175, 253, 0.2) 100%) !important;
    box-shadow: none !important;
    transform: translateX(2px) !important;
}

.category-links li a .icon {
    margin-right: 10px !important;
    opacity: 0.8 !important;
    width: 16px !important;
    height: 16px !important;
}

/* ========== 天气预报样式 ========== */
.weather-widget {
    position: absolute;
    left: 20px;
    top: 15px;
    z-index: 100000;
    display: flex;
    align-items: center;
    background: rgba(0,0,0,0.3);
    border-radius: 20px;
    padding: 8px 15px;
    color: #fff;
    font-size: 14px;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    cursor: pointer;
    transition: all 0.3s ease;
}

.weather-widget:hover {
    background: rgba(0,0,0,0.4);
    transform: translateY(-2px);
}

.weather-widget.hidden {
    display: none;
}

.weather-icon {
    width: 30px;
    height: 30px;
    margin-right: 10px;
}

.weather-info {
    display: flex;
    flex-direction: column;
}

.weather-temp {
    font-size: 16px;
    font-weight: 600;
    line-height: 1;
}

.weather-city {
    font-size: 12px;
    opacity: 0.9;
    margin-top: 4px;
}

.weather-desc {
    font-size: 12px;
    opacity: 0.8;
    margin-top: 2px;
}

/* 响应式调整 */
@media (max-width: 640px) {
    .con {
        top: 0px;
    }

    .con .shlogo {
        width: 320px;
        height: 100px;
    }

    .con .sou form .wd:focus {
        background: #f1f1f1;
        box-shadow: none;
        border-color: #ccc
    }

    .con .sou form button {
        border-radius: 25px;
    }
    .con .sou #word{max-height: 150px;}

    #menu.on {
        right: 280px;
    }

    .list {
        width: 280px;
    }

    .category-links li {
        height: 38px !important;
    }

    .category-title {
        height: 40px;
        line-height: 40px;
        font-size: 15px;
    }

    .home,
    #menu {
        top: 5px;
    }

    .weather-widget {
        left: 10px;
        padding: 6px 12px;
        font-size: 12px;
    }

    .weather-temp {
        font-size: 14px;
    }

    .weather-icon {
        width: 25px;
        height: 25px;
    }
}

@media (max-height: 420px) {
    .con {
        margin: 0;
        top: 0px;
    }

    .con .shlogo {
        display: none;
    }

    .home,
    #menu,
    .weather-widget,
    .foot {
        display: none;
    }
}

@media (prefers-color-scheme: dark) {
    body {
        background-color: #162035;
    }

    .weather-widget {
        background: rgba(0,0,0,0.5);
    }

    .con .sou form .wd:focus {
        background: #293550;
        border: 1px solid #162035;
    }

    .con .sou form .wd {
        border: 1px solid #293550;
        color: #bbb;
    }
    .con .sou #word {
        border: 15px solid #293550;
        background: #293550;
    }
    .con .sou #word .click_work {
        color: #89b;
    }
}

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: #222d46;
    border-radius: 0px;
}

::-webkit-scrollbar-thumb {
    background: #293550;
    border-radius: 0px;
}

::-webkit-scrollbar-thumb:hover {
    background: #293550;
}

::-webkit-scrollbar-corner {
    background: #222d46;
}