/* 全局样式重置与基础配置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
}

/* 页面主体：图片背景+全屏布局 */
body {
    width: 100%;
    height: 100vh;
    overflow: hidden;
    /* 使用图片背景 */
    background-image: url('https://aqdu.cn/assets/img/background.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    color: #ffffff; /* 全局文字白色，与背景对比 */
    padding: 20px 40px;
    /* 添加半透明遮罩，增强文字可读性（降低透明度，让图片更清晰） */
    background-color: rgba(0, 0, 0, 0.2);
    background-blend-mode: overlay;
    box-sizing: border-box; /* 确保padding不影响元素总尺寸 */
    margin: 0;
}

/* 顶部信息容器：菜单 + 时间日期 + 一言 */
.top-bar {
    margin-bottom: 20px;
    font-size: 16px;
}

/* 顶部菜单和时间的容器 */
.top-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

/* 顶部菜单 */
.top-menu {
    display: flex;
    gap: 20px;
    align-items: center;
}

/* 菜单链接 */
.menu-link {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 14px;
    padding: 5px 10px;
    border-radius: 8px;
}

.menu-link:hover {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.1);
}

/* 一言文本样式 */
.hitokoto-text {
    font-size: 18px;
    font-style: italic;
    color: rgba(255, 255, 255, 0.8);
    text-align: center;
    margin-bottom: 10px;
    max-width: 100%;
    line-height: 1.5;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    display: block;
    width: 100%;
}

/* 时间日期（右上角） */
.time-date {
    text-align: right;
    min-width: 180px;
}
.time-container {
    display: flex;
    align-items: baseline;
    justify-content: flex-end;
    gap: 8px;
    margin-bottom: 4px;
}
.time {
    font-size: 24px;
    font-weight: 600;
    margin: 0;
}
.date {
    font-size: 24px;
    font-weight: 600;
    opacity: 0.9;
    text-align: right;
    margin: 0;
}
/* 爱心图标样式 */
.heart-icon {
    font-size: 20px;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 0;
    align-self: center;
    position: relative;
}
.heart-icon:hover {
    color: rgba(255, 255, 255, 1);
    transform: scale(1.2);
}
.heart-icon.liked {
    color: #ff4757;
    animation: heartbeat 0.8s ease-in-out infinite; /* 75次/分钟，更接近真实心跳 */
}
@keyframes heartbeat {
    0% { transform: scale(1); }
    15% { transform: scale(1.25); }
    30% { transform: scale(1); }
    45% { transform: scale(1.25); }
    60% { transform: scale(1); }
}

/* 自定义提示样式 */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip .tooltip-text {
    visibility: hidden;
    background-color: rgba(255, 255, 255, 0.95);
    color: #333;
    text-align: left;
    border-radius: 10px;
    padding: 12px 16px;
    position: absolute;
    z-index: 1000;
    top: 100%;
    right: 0;
    white-space: normal;
    min-width: 200px;
    max-width: 400px;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    font-size: 14px;
    line-height: 1.6;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    font-weight: 500;
    pointer-events: none;
    /* 限制最大宽度，确保不超出屏幕 */
    max-width: calc(100vw - 40px);
    /* 确保提示框在爱心图标下方左侧显示 */
    transform: translateX(0);
    margin-top: 8px;
}

.tooltip .tooltip-text::after {
    content: "";
    position: absolute;
    bottom: 100%;
    right: 15px;
    border-width: 6px;
    border-style: solid;
    border-color: transparent transparent rgba(255, 255, 255, 0.95) transparent;
}

.tooltip:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
    transform: translateY(5px);
}

/* 中间区域：logo + 搜索框 + 分类标签 */
.middle-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 25px;
    margin-bottom: 15px;
}



/* logo文本样式 */
.logo-text {
    font-size: 64px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.95);
    text-align: center;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    margin-bottom: 10px;
    letter-spacing: 4px;
}

/* ICP备案号链接样式，与版权信息保持一致 */
.footer p a,
.maintenance-footer p a {
    color: inherit;
    text-decoration: none;
    transition: none;
}

.footer p a:hover,
.maintenance-footer p a:hover {
    color: inherit;
    text-decoration: none;
    background-color: transparent;
}

/* 名言动画样式 */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideInLeft {
    from { 
        opacity: 0;
        transform: translateX(-20px);
    }
    to { 
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from { 
        opacity: 0;
        transform: translateX(20px);
    }
    to { 
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInDown {
    from { 
        opacity: 0;
        transform: translateY(-20px);
    }
    to { 
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes zoomIn {
    from { 
        opacity: 0;
        transform: scale(0.8);
    }
    to { 
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes bounceIn {
    0% { 
        opacity: 0;
        transform: scale(0.3);
    }
    50% { 
        opacity: 1;
        transform: scale(1.05);
    }
    70% { 
        transform: scale(0.9);
    }
    100% { 
        opacity: 1;
        transform: scale(1);
    }
}

/* 动画类 */
.fade-in { animation: fadeIn 1s ease-out; }
.slide-in-left { animation: slideInLeft 1s ease-out; }
.slide-in-right { animation: slideInRight 1s ease-out; }
.slide-in-down { animation: slideInDown 1s ease-out; }
.zoom-in { animation: zoomIn 1s ease-out; }
.bounce-in { animation: bounceIn 1s ease-out; }

/* 确保动画流畅 */
.hitokoto-text {
    transition: all 0.3s ease;
}

/* 确保logo-text也能应用动画 */
.logo-text {
    transition: all 0.3s ease;
}

/* 搜索框（居中，统一圆角矩形设计） */
.search-box {
    width: 100%;
    max-width: 700px;
    height: 55px;
    background-color: rgba(255, 255, 255, 0.7);
    border-radius: 12px;
    display: flex;
    align-items: center;
    padding: 0;
    color: #0a3d2e;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    border: none;
    position: relative;
    transition: all 0.3s ease;
}

.search-box:hover {
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

/* 搜索框获得焦点时变为不透明 */
.search-box:focus-within {
    background-color: rgba(255, 255, 255, 1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
}

/* 搜索引擎选择器样式 - 与输入框完全融为一体 */
.search-engine-select {
    background-color: transparent;
    border: none;
    border-radius: 12px 0 0 12px;
    padding: 0 32px 0 20px;
    height: 100%;
    font-size: 14px;
    color: #4a5568;
    outline: none;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 80px;
    max-width: 150px;
    /* 移除浏览器默认样式 */
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    /* 隐藏下拉箭头，让用户感觉它不是一个下拉框 */
    background-image: none;
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 14px;
    font-weight: 500;
    letter-spacing: 0.3px;
    /* 确保文本不会溢出 */
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
    /* 确保下拉列表有足够的空间 */
    position: relative;
    z-index: 1;
}

/* 只有当鼠标悬停或聚焦时才显示下拉箭头 */
.search-engine-select:hover,
.search-engine-select:focus {
    background-color: rgba(240, 240, 240, 0.6);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}

/* 搜索框获得焦点时的样式 */
.search-engine-select:focus {
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.3);
}

/* 美化下拉选项样式 */
.search-engine-select option {
    padding: 10px 16px;
    background-color: rgba(255, 255, 255, 0.95);
    color: #4a5568;
    font-size: 14px;
    min-width: 200px;
    white-space: nowrap;
    transition: all 0.2s ease;
}

/* 自定义搜索引擎选择器样式 */
.custom-select-wrapper {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 700px;
}

.search-with-select {
    position: relative;
    width: 100%;
    display: flex;
    flex-direction: column;
}

.custom-select-value {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    padding: 0 20px;
    background-color: transparent;
    color: #4a5568;
    font-size: 18px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 12px 0 0 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 80px;
    max-width: 150px;
}

.custom-select-value:hover {
    background-color: rgba(240, 240, 240, 0.6);
}

.custom-select-value .selected-text {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.select-arrow {
    margin-left: 10px;
    font-size: 12px;
    color: #6b7280;
    transition: all 0.3s ease;
}

.custom-select-options {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    background-color: rgba(255, 255, 255, 0.98);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    max-height: 300px;
    overflow-y: auto;
    display: none;
    border: 1px solid rgba(0, 0, 0, 0.1);
    width: auto;
    min-width: 120px;
    max-width: 300px;
    white-space: nowrap;
}

.custom-select-options.show {
    display: block;
}

.custom-select-option {
    padding: 12px 20px;
    color: #4a5568;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.custom-select-option:last-child {
    border-bottom: none;
}

.custom-select-option:hover {
    background-color: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

.custom-select-option.selected {
    background-color: rgba(59, 130, 246, 0.2);
    color: #3b82f6;
    font-weight: 500;
}

/* 搜索输入框 */
.search-input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-size: 16px;
    color: #2d3748;
    padding: 0 20px;
    height: 100%;
    font-weight: 400;
    letter-spacing: 0.5px;
}

.search-input::placeholder {
    color: rgba(100, 100, 100, 0.6);
    font-weight: 300;
}

/* 搜索图标 - 与输入框融为一体 */
.search-icon {
    font-size: 20px;
    color: #4a5568;
    padding: 0 24px;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    cursor: pointer;
    transition: all 0.3s ease;
    background-color: transparent;
    border: none;
    outline: none;
    border-radius: 0 12px 12px 0;
    font-weight: 600;
    box-shadow: none;
}

.search-icon:hover {
    background-color: rgba(240, 240, 240, 0.6);
    color: #3b82f6;
    border-color: transparent;
    transform: none;
    box-shadow: none;
}

.search-icon:active {
    background-color: rgba(220, 220, 220, 0.6);
    border-color: transparent;
    transform: none;
}

/* 增大Font Awesome搜索图标的大小 */
.search-icon i {
    font-size: 24px;
    line-height: 1;
    color: inherit;
    transition: all 0.3s ease;
    font-weight: normal;
    display: block;
    width: auto;
    height: auto;
    text-align: center;
}

/* 隐藏原始的下拉箭头，使用自定义样式 */
select.search-engine-select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

/* 分类标签栏 */
.category-tags {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
}
.tag {
    padding: 8px 16px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}
.tag:hover {
    background-color: rgba(255, 255, 255, 0.2);
}
.tag.active {
    background-color: rgba(255, 255, 255, 0.3);
    font-weight: 500;
}

/* 内容滚动容器：承载所有分类网站，实现滚动切换 */
.content-scroll-container {
    height: calc(100vh - 350px); /* 固定高度，实现滚动 */
    overflow-x: scroll;
    overflow-y: hidden;
    scroll-snap-type: x mandatory; /* 滚动吸附，切换更顺滑 */
    display: flex;
    flex-direction: row;
    scroll-behavior: smooth;
    padding-top: 15px;
    width: 100%;
    position: relative;
    white-space: nowrap; /* 确保子元素不换行 */
    -webkit-overflow-scrolling: touch; /* 优化移动端滚动体验 */
}
/* 单个分类容器：滚动吸附单元 */
.category-container {
    height: 100%;
    width: calc(100vw - 80px);
    min-width: calc(100vw - 80px);
    scroll-snap-align: start;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    flex-shrink: 0;
    flex-grow: 0;
    flex-basis: calc(100vw - 80px);
    white-space: normal; /* 子元素可以换行 */
}
/* 应用图标网格（每个分类共用） */
.app-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 0px 0px;
    justify-content: center;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}
.app-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0px;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 10px;
    border-radius: 16px;
    width: 100%;
}
.app-item:hover {
    transform: translateY(-5px) scale(1.08);
    background-color: rgba(255, 255, 255, 0.1);
}
.app-item:focus-within {
    outline: 2px solid rgba(255, 255, 255, 0.5);
    outline-offset: 2px;
}
.app-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: #ffffff;
    transition: all 0.3s ease;
    overflow: hidden;
    background-color: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(5px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* 优化图片图标显示 - 提高清晰度 */
.app-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 8px;
    /* 提高图片缩放质量 */
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    image-rendering: pixelated;
    /* 解决浏览器自动模糊问题 */
    filter: blur(0);
    /* 触发GPU加速，提高渲染质量 */
    transform: translateZ(0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

/* 优化SVG图标显示 */
.app-icon svg {
    width: 80%;
    height: 80%;
    fill: currentColor;
    stroke: currentColor;
    /* 触发GPU加速 */
    transform: translateZ(0);
}
.app-item:hover .app-icon {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}
/* 统一图标背景为白色半透明样式 */
.app-icon.common, .app-icon.shop, .app-icon.news, 
.app-icon.life, .app-icon.video, .app-icon.ent, 
.app-icon.work, .app-icon.conv, .app-icon.it {
    background-color: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(5px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.app-name {
    font-size: 14px;
    opacity: 0.9;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 90px;
}

/* 隐藏滚动条（美观优化） */
.content-scroll-container::-webkit-scrollbar {
    display: none;
}
.content-scroll-container {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* 页脚样式 */
.footer {
    position: absolute;
    bottom: 10px;
    left: 0;
    right: 0;
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
    font-size: 12px;
    z-index: 100;
}

.footer-content {
    display: flex;
    justify-content: center;
    align-items: center;
}

.footer p {
    margin: 0;
    opacity: 0.7;
    transition: opacity 0.3s ease;
    letter-spacing: 0.5px;
}

.footer p:hover {
    opacity: 0.9;
}



/* 图标加载失败时的回退样式 - 显示首字母 */
.icon-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 56px;
    font-weight: 700;
    color: #ffffff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    letter-spacing: 2px;
}