/* 
sousou.cc 增强样式表
优化点：响应式设计、可访问性、性能优化、搜索建议美化
基于原有style.css增强
*/

@charset "utf-8";

/* 基础重置和优化 */
* {
    padding: 0;
    margin: 0;
    outline: none;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

/* 屏幕阅读器专用文本 */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

html,
body {
    width: 100%;
    min-height: 100%;
    position: relative;
    background: #fff;
    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: 1px;
    font-size: 16px;
}

input::-moz-placeholder {
    color: #ccc;
    letter-spacing: 1px;
    font-size: 16px;
}

/* 列表和链接 */
ul,
li {
    display: block;
    list-style: none;
}

a {
    text-decoration: none;
    color: #000;
}

/* 主要内容区域 */
#content {
    width: 100%;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: 20px 0;
}

.con {
    width: 100%;
    transition: 1s all;
    margin: auto;
    min-width: 320px;
    max-width: 680px;
    position: relative;
    padding: 0 30px;
}

/* Logo优化 */
.con .shlogo {
    position: relative;
    width: 480px;
    height: 120px;
    margin: 20px auto;
    background: url(icon/logo3.svg) no-repeat center/contain;
    max-width: 100%;
}

.con .shlogo a {
    width: 100%;
    display: block;
    height: 100%;
}

/* 搜索区域优化 */
.con .sou {
    position: relative;
    width: 100%;
    max-width: 600px;
    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: 2px solid #e0e0e0;
    border-radius: 25px;
    line-height: 100%;
    font-size: 18px;
    text-indent: 50px;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
}

.con .sou form .wd:focus {
    background: #fff;
    box-shadow: 0 8px 30px rgba(32, 33, 36, 0.15);
    border-color: #4285f4;
    transform: translateY(-2px);
}

/* 搜索引擎切换按钮 */
.con .sou form .lg {
    display: block;
    width: 30px;
    height: 30px;
    position: absolute;
    left: 13px;
    top: 10px;
    border-radius: 50%;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
    background-size: contain;
}

.con .sou form .lg:hover {
    transform: scale(1.1);
}

/* 搜索按钮优化 */
.con .sou form button {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    z-index: 10;
    right: 5px;
    top: 5px;
    cursor: pointer;
    border-radius: 50%;
    color: #777;
    transition: all 0.2s ease;
    border: none;
    background: transparent;
}

.con .sou form button:hover {
    background: rgba(66, 133, 244, 0.1);
    color: #4285f4;
}

.con .sou form button .icon {
    width: 20px;
    height: 20px;
    fill: currentColor;
    margin: 0;
    vertical-align: middle;
}

/* 搜索建议优化 */
.con .sou #word {
    width: 100%;
    position: absolute;
    z-index: 500;
    top: 65px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    display: none;
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #e0e0e0;
}

.con .sou #word::-webkit-scrollbar {
    width: 6px;
}

.con .sou #word::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.con .sou #word::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

/* 搜索建议项 */
.suggestion-item {
    padding: 12px 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: all 0.2s ease;
    border-bottom: 1px solid #f5f5f5;
    min-height: 48px;
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-item:hover,
.suggestion-item.selected {
    background: #f8f9fa;
    color: #4285f4;
}

.suggestion-item .suggestion-icon {
    width: 16px;
    height: 16px;
    margin-right: 12px;
    opacity: 0.6;
    fill: currentColor;
}

.suggestion-item .suggestion-text {
    flex: 1;
}

.suggestion-item .suggestion-text strong {
    color: #4285f4;
    font-weight: 600;
}

/* 加载状态 */
.loading {
    padding: 16px;
    text-align: center;
    color: #666;
    font-size: 14px;
}

/* 页脚 */
.foot {
    position: fixed;
    bottom: 20px;
    left: 0;
    right: 0;
    text-align: center;
    color: #999;
    height: 20px;
    line-height: 20px;
    font-size: 12px;
    padding: 0 20px;
    z-index: 10;
}

/* 导航菜单优化 */
#menu {
    width: 50px;
    height: 50px;
    position: fixed;
    right: 20px;
    top: 20px;
    z-index: 1000;
    cursor: pointer;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

#menu:hover {
    background: rgba(255, 255, 255, 1);
    transform: scale(1.05);
}

#menu i {
    width: 20px;
    height: 2px;
    background: #333;
    display: block;
    position: relative;
    transition: all 0.3s ease;
}

#menu i::before,
#menu i::after {
    content: '';
    width: 20px;
    height: 2px;
    background: #333;
    position: absolute;
    transition: all 0.3s ease;
}

#menu i::before {
    top: -6px;
}

#menu i::after {
    top: 6px;
}

#menu.on i {
    background: transparent;
}

#menu.on i::before {
    transform: rotate(45deg);
    top: 0;
}

#menu.on i::after {
    transform: rotate(-45deg);
    top: 0;
}

/* 侧边导航 */
.list {
    position: fixed;
    right: 0;
    top: 0;
    width: 400px;
    height: 100vh;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    z-index: 999;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
    padding: 20px 15px 20px 15px;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
}

.list:not(.closed) {
    transform: translateX(0);
}

.list ul {
    padding: 0;
    margin-bottom: 20px;
}

.list ul li {
    padding: 0;
    margin: 0;
    float: left;
    clear: none;
}

/* 分类标题样式 */
.list ul li.title {
    width: 100%;
    padding: 12px 15px;
    font-weight: 600;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    display: flex;
    align-items: center;
    margin: 15px 0 8px 0;
    border-radius: 8px;
    font-size: 14px;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
    clear: both;
    float: none;
}

.list ul li.title:first-child {
    margin-top: 0;
}

.list ul li.title .icon {
    width: 16px;
    height: 16px;
    margin-right: 8px;
    fill: currentColor;
}

/* 网站链接多列网格布局 */
.list ul li:not(.title) {
    width: calc(50% - 4px);
    margin: 2px;
    height: auto;
    float: left;
}

.list ul li a {
    display: flex;
    align-items: center;
    padding: 8px 10px;
    color: #555;
    transition: all 0.2s ease;
    background: #fff;
    border-radius: 6px;
    border: 1px solid #e8e8e8;
    min-height: 36px;
    font-size: 11px;
    text-decoration: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.list ul li a:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border-color: #667eea;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.list ul li a .icon {
    width: 14px;
    height: 14px;
    margin-right: 6px;
    fill: currentColor;
    flex-shrink: 0;
}

/* 为缺失的图标提供默认显示 */
.list ul li a .icon:not([data-icon]) {
    display: inline-block;
    width: 14px;
    height: 14px;
    background: #ddd;
    border-radius: 2px;
    position: relative;
}

.list ul li a .icon:not([data-icon])::before {
    content: '•';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 8px;
    color: #999;
}

/* 清除浮动 */
.list ul::after {
    content: '';
    display: table;
    clear: both;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .con {
        padding: 0 20px;
    }
    
    .con .shlogo {
        width: 300px;
        height: 80px;
        margin: 15px auto;
    }
    
    .con .sou form {
        height: 48px;
        margin: 15px auto 25px;
    }
    
    .con .sou form .wd {
        font-size: 16px; /* 防止iOS缩放 */
        text-indent: 45px;
        border-radius: 24px;
    }
    
    .con .sou form .lg {
        width: 28px;
        height: 28px;
        left: 10px;
        top: 10px;
    }
    
    .con .sou form button {
        width: 36px;
        height: 36px;
        right: 6px;
        top: 6px;
    }
    
    .con .sou form button .icon {
        width: 18px;
        height: 18px;
        margin: 0;
    }
    
    .con .sou #word {
        top: 58px;
        border-radius: 8px;
        max-height: 300px;
    }
    
    .suggestion-item {
        padding: 14px 16px;
        min-height: 50px;
    }
    
    #menu {
        width: 44px;
        height: 44px;
        right: 16px;
        top: 16px;
    }
    
    .list {
        width: 340px;
        padding: 15px 10px;
    }
    
    .list ul li:not(.title) {
        width: calc(50% - 3px);
        margin: 1.5px;
    }
    
    .list ul li a {
        padding: 7px 8px;
        font-size: 10px;
        min-height: 32px;
    }
    
    .list ul li.title {
        padding: 10px 12px;
        font-size: 13px;
        margin: 12px 0 6px 0;
    }
    
    .list ul li a .icon {
        width: 12px;
        height: 12px;
        margin-right: 5px;
    }
    
    .list ul li.title .icon {
        width: 14px;
        height: 14px;
        margin-right: 6px;
    }
    
    .foot {
        bottom: 10px;
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    .con .shlogo {
        width: 250px;
        height: 70px;
    }
    
    .con .sou #word {
        max-height: 250px;
    }
    
    .list {
        width: 300px;
        padding: 12px 8px;
    }
    
    .list ul li:not(.title) {
        width: calc(50% - 2px);
        margin: 1px;
    }
    
    .list ul li a {
        padding: 6px 7px;
        font-size: 10px;
        min-height: 30px;
    }
    
    .list ul li.title {
        padding: 8px 10px;
        font-size: 12px;
        margin: 10px 0 5px 0;
    }
}

/* 平板适配 */
@media (min-width: 769px) and (max-width: 1024px) {
    .con {
        max-width: 600px;
        padding: 0 40px;
    }
    
    .con .sou form {
        height: 52px;
    }
    
    .con .sou form .wd {
        font-size: 17px;
    }
}

/* 大屏幕优化 */
@media (min-width: 1200px) {
    .con {
        max-width: 720px;
    }
    
    .con .sou form {
        height: 54px;
    }
}

/* 可访问性增强 */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* 高对比度模式 */
@media (prefers-contrast: high) {
    .con .sou form .wd {
        border: 2px solid #000;
    }
    
    .con .sou form .wd:focus {
        border-color: #0066cc;
        outline: 2px solid #0066cc;
    }
    
    .suggestion-item:hover,
    .suggestion-item.selected {
        background: #000;
        color: #fff;
    }
}

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
    html,
    body {
        background: #1a1a1a;
        color: #e0e0e0;
    }
    
    .con .sou form .wd {
        background: rgba(42, 42, 42, 0.95);
        border-color: #444;
        color: #e0e0e0;
    }
    
    .con .sou form .wd::placeholder {
        color: #888;
    }
    
    .con .sou form .wd:focus {
        background: #333;
        border-color: #666;
        color: #fff;
    }
    
    .con .sou #word {
        background: #2a2a2a;
        border-color: #444;
    }
    
    .suggestion-item {
        border-bottom-color: #444;
        color: #e0e0e0;
    }
    
    .suggestion-item:hover,
    .suggestion-item.selected {
        background: #333;
    }
    
    #menu {
        background: rgba(42, 42, 42, 0.9);
    }
    
    #menu i,
    #menu i::before,
    #menu i::after {
        background: #e0e0e0;
    }
    
    .list {
        background: rgba(42, 42, 42, 0.95);
    }
    
    .list ul li.title {
        background: #333;
        color: #e0e0e0;
    }
    
    .list ul li a {
        color: #ccc;
    }
    
    .list ul li a:hover {
        background: #333;
        color: #4285f4;
    }
}

/* 焦点可见性 */
:focus-visible {
    outline: 2px solid #4285f4;
    outline-offset: 2px;
}

/* 触摸设备优化 */
@media (hover: none) and (pointer: coarse) {
    .con .sou form .wd:focus {
        transform: none; /* 移动端不需要上移效果 */
    }
    
    .suggestion-item {
        padding: 16px 20px; /* 增大触摸区域 */
        min-height: 52px;
    }
    
    #menu {
        width: 48px;
        height: 48px;
    }
}

/* 打印样式 */
@media print {
    body {
        background: none !important;
    }
    
    #menu,
    .list,
    #word {
        display: none !important;
    }
    
    .con {
        position: static;
        height: auto;
    }
}