/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', sans-serif;
    line-height: 1.6;
    background-color: #f5f5f5;
}

/* 头部导航样式 */
header {
    background-color: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
}

.main-nav {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo a {
    font-size: 1.5rem;
    font-weight: bold;
    color: #333;
    text-decoration: none;
}

.nav-links {
    display: flex;
    list-style: none;
}

.nav-links li {
    margin-left: 2rem;
}

.nav-links a {
    color: #333;
    text-decoration: none;
    font-size: 1rem;
    transition: color 0.3s;
}

.nav-links a:hover {
    color: #007bff;
}

/* 主要内容区域 */
main {
    margin-top: 60px;
    padding: 2rem 0;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    gap: 10px;
}

/* 侧边栏样式 */
.sidebar {
    width: 100%;
    background: #fff;
    padding: 1rem;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.sidebar ul {
    list-style: none;
}

.sidebar li {
    margin-bottom: 0.5rem;
}

.sidebar a {
    color: #333;
    text-decoration: none;
    display: block;
    padding: 0.5rem;
    border-radius: 3px;
    transition: background-color 0.3s;
}

.sidebar a:hover {
    background-color: #f0f0f0;
}

/* 内容区域样式 */
.content {
    flex: 1;
    background: #fff;
    padding: 2rem;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* 页脚样式 */
footer {
    text-align: center;
    padding: 2rem;
    background: #333;
    color: #fff;
    margin-top: 2rem;
}

/* 搜索框样式更新 - 统一圆角矩形设计 */
#contentTypeSelect {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24'%3e%3cpath stroke='%233b82f6' stroke-linecap='round' stroke-linejoin='round' stroke-width='2.5' d='M7 10l5 5 5-5'/%3e%3c/svg%3e");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.2em 1.2em;
    z-index: 1;
}

/* 确保下拉框箭头显示正常 */
select#contentTypeSelect {
    /* 背景图片通过HTML中的SVG元素处理，此处不设置背景图片 */
    text-align: center !important;
}

/* 搜索框容器样式 */
.relative.w-full.flex.items-center > div {
    transition: box-shadow 0.3s ease;
}

.relative.w-full.flex.items-center > div:hover {
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
}

/* 搜索输入框焦点效果 */
#searchInputDesktop:focus {
    box-shadow: none;
}

/* 搜索按钮样式 */
#searchBtnDesktop {
    transition: all 0.3s ease;
}

#searchBtnDesktop:hover {
    background-color: #2563eb;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.2);
}

#searchBtnDesktop:active {
    background-color: #1d4ed8;
    transform: scale(0.98);
}

.search-button:active {
    background: #1d4ed8;
    border-color: #1d4ed8;
}

/* 搜索结果样式 - 与rjml.html保持一致 */
.content-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
    transition: all 0.2s;
    border: 1px solid #e8e8e8;
    position: relative;
    overflow: hidden;
}

.item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: #4a9eff;
    border-radius: 8px 0 0 8px;
}

.item:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    border-color: #e0e0e0;
    transform: translateY(-1px);
}

.item-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.item-title {
    font-size: 1.08rem;
    color: #333;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.item-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

/* 搜索结果头部样式 */
.group-header {
    display: flex;
    align-items: center;
    padding: 14px 18px;
    background: #fff;
    border-radius: 8px 8px 0 0;
    border-bottom: 1px solid #f0f0f0;
}

.group-header i {
    color: #666;
}

.group-header span {
    font-weight: 500;
    color: #333;
}

/* 搜索结果内容区域样式 */
.group-content {
    padding: 14px 0;
    background: #fff;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

/* 按钮样式 - 与rjml.html保持一致 */
.item-actions button {
    margin-left: 10px;
    padding: 7px 18px;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
}

.item-actions .download {
    background: #ffb74d;
    color: white;
    padding: 7px 18px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.2s;
}

.item-actions .download:hover {
    background: #ffa726;
}

.item-actions .unlimited-download-btn {
    background: #4CAF50;
    color: #fff;
}

.item-actions .tutorial {
    background: #ccc;
    color: #fff;
    cursor: not-allowed;
    padding: 7px 18px;
    border-radius: 6px;
    border: none;
    font-size: 1rem;
    transition: background-color 0.2s;
}

.item-actions .tutorial:hover {
    background: #bbb;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        flex-direction: row;
    }
    
    .sidebar {
        width: 25%;
        max-width: 250px;
        min-width: 200px;
    }
    
    .nav-links {
        display: none;
    }
    
    .search-container {
        flex-direction: row;
        max-width: 100%;
        margin: 0 1rem;
    }
    
    .search-type-select {
        font-size: 0.75rem;
        padding: 0.375rem 0.5rem;
        height: 38px;
    }
    
    .search-input {
        font-size: 0.75rem;
        padding: 0.375rem 0.5rem;
        height: 38px;
    }
    
    .search-button {
        font-size: 0.75rem;
        padding: 0.375rem 0.75rem;
        height: 38px;
    }
    
    .item {
        flex-direction: row;
        align-items: center;
        gap: 12px;
    }
    
    .item-actions {
        width: auto;
        justify-content: flex-end;
    }
    
    .item-actions button {
        font-size: 0.875rem;
        padding: 0.5rem 1rem;
    }
}

@media (max-width: 900px) {
    .container {
        flex-direction: row;
    }
    .sidebar {
        width: 25%;
        max-width: 250px;
        min-width: 200px;
        border-radius: 5px;
        padding: 1rem;
        box-shadow: 0 2px 5px rgba(0,0,0,0.1);
        background: #fff;
    }
    .sidebar ul {
        display: block;
        padding: 0;
        margin: 0;
    }
    .sidebar li {
        margin-bottom: 10px;
        margin-right: 0;
    }
    .sidebar button {
        width: 100%;
        min-width: 60px;
        padding: 10px 0;
        font-size: 0.95rem;
        border-radius: 8px;
        white-space: normal;
    }
    .main {
        padding: 10px 4px;
    }
    .main, .main * {
        font-size: 0.92rem !important;
    }
    .item-title {
        font-size: 1rem !important;
    }
    .item-actions {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        gap: 4px !important;
        margin-left: 4px !important;
    }
    .item-actions button, .download {
        font-size: 0.82rem !important;
        padding: 4px 8px !important;
        border-radius: 5px !important;
        margin: 0 !important;
    }
    .item-actions .tutorial {
        font-size: 0.82rem !important;
        padding: 4px 8px !important;
        border-radius: 5px !important;
        margin: 0 !important;
        background: #f6ffed !important;
        color: #52c41a !important;
        border: 1px solid #52c41a !important;
    }
    .item {
        flex-wrap: nowrap !important;
        white-space: nowrap !important;
        overflow-x: auto !important;
        gap: 6px !important;
        padding: 8px 6px !important;
        scrollbar-width: thin;
        scrollbar-color: #ccc #f5f5f5;
    }
    
    /* 美化滚动条 */
    .item::-webkit-scrollbar {
        height: 6px;
    }
    
    .item::-webkit-scrollbar-track {
        background: #f5f5f5;
        border-radius: 3px;
    }
    
    .item::-webkit-scrollbar-thumb {
        background: #ccc;
        border-radius: 3px;
    }
    
    .item::-webkit-scrollbar-thumb:hover {
        background: #999;
    }
    
    .item-info, .item-title {
        white-space: nowrap !important;
        overflow: visible !important;
    }
    .content-list {
        gap: 12px !important;
    }
    
    .item {
        padding: 12px 16px !important;
        border-width: 1px !important;
    }
}

/* 按钮悬浮和点击效果（增强） */
.item-actions button {
    background: #f5f5f5;
    color: #333;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 0.4rem 1.1rem;
    margin-right: 0.6rem;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.18s, box-shadow 0.18s, color 0.18s, font-weight 0.18s;
    outline: none;
    font-weight: 400;
}
.item-actions button:hover {
    background: #1890ff;
    color: #fff;
    font-weight: 600;
    box-shadow: 0 4px 16px rgba(24,144,255,0.18), 0 0 0 2px #91d5ff;
    border-color: #1890ff;
    transform: translateY(-2px) scale(1.04);
    z-index: 2;
}
.item-actions button:active {
    background: #1466b3;
    color: #fff;
    font-weight: 700;
    box-shadow: 0 2px 6px rgba(20,102,179,0.18) inset, 0 0 0 2px #1466b3;
    border-color: #1466b3;
    transform: translateY(1px) scale(0.98);
    z-index: 1;
}

/* 菜单栏悬浮和点击效果 */
.sidebar li, .sidebar a, .group-header {
    transition: background 0.2s, color 0.2s;
    cursor: pointer;
}
.sidebar li:hover, .sidebar a:hover, .group-header:hover {
    background: #f0f6ff;
    color: #1890ff;
}
.sidebar li:active, .sidebar a:active, .group-header:active {
    background: #d6e4ff;
    color: #1466b3;
}

/* 分组头高亮展开时 */
.group-header:not(.collapsed) {
    background: #e6f7ff;
    color: #1890ff;
}

/* 下载按钮专属悬浮和点击效果 */
.item-actions .download,
.download {
    background: #ffb74d;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 7px 18px;
    margin-right: 0.6rem;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.18s, box-shadow 0.18s, color 0.18s, font-weight 0.18s;
    outline: none;
    font-weight: 500;
}
.item-actions .download:hover,
.download:hover {
    background: #1890ff;
    color: #fff;
    font-weight: 700;
    box-shadow: 0 4px 16px rgba(24,144,255,0.18), 0 0 0 2px #91d5ff;
    border-color: #1890ff;
    transform: translateY(-2px) scale(1.04);
    z-index: 2;
}
.item-actions .download:active,
.download:active {
    background: #1466b3;
    color: #fff;
    font-weight: 700;
    box-shadow: 0 2px 6px rgba(20,102,179,0.18) inset, 0 0 0 2px #1466b3;
    border-color: #1466b3;
    transform: translateY(1px) scale(0.98);
}

/* 不限速下载按钮专属悬浮和点击效果 */
.item-actions .unlimited-download,
.unlimited-download {
    background: #fff7e6;
    color: #fa8c16;
    border: 1px solid #ffd591;
    border-radius: 4px;
    padding: 0.4rem 1.1rem;
    margin-right: 0.6rem;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.18s, box-shadow 0.18s, color 0.18s, font-weight 0.18s;
    outline: none;
    font-weight: 500;
}
.item-actions .unlimited-download:hover,
.unlimited-download:hover {
    background: #fa8c16;
    color: #fff;
    font-weight: 700;
    box-shadow: 0 4px 16px rgba(250,140,22,0.18), 0 0 0 2px #ffd591;
    border-color: #fa8c16;
    transform: translateY(-2px) scale(1.04);
    z-index: 2;
}
.item-actions .unlimited-download:active,
.unlimited-download:active {
    background: #d46b08;
    color: #fff;
    font-weight: 700;
    box-shadow: 0 2px 6px rgba(212,107,8,0.18) inset, 0 0 0 2px #d46b08;
    border-color: #d46b08;
    transform: translateY(1px) scale(0.98);
    z-index: 1;
}

/* 安装教程按钮专属样式 */
.item-actions .tutorial,
.tutorial {
    background: #f6ffed !important;
    color: #52c41a !important;
    border: 1px solid #52c41a !important;
    border-radius: 4px;
    padding: 0.4rem 1.1rem;
    margin-right: 0.6rem;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.18s, box-shadow 0.18s, color 0.18s, font-weight 0.18s;
    outline: none;
    font-weight: 500;
}
.item-actions .tutorial:hover,
.tutorial:hover {
    background: #1890ff !important;
    color: #fff !important;
    font-weight: 700;
    box-shadow: 0 4px 16px rgba(24,144,255,0.18), 0 0 0 2px #91d5ff;
    border-color: #1890ff !important;
    transform: translateY(-2px) scale(1.04);
    z-index: 2;
}
.item-actions .tutorial:active,
.tutorial:active {
    background: #1466b3 !important;
    color: #fff !important;
    font-weight: 700;
    box-shadow: 0 2px 6px rgba(20,102,179,0.18) inset, 0 0 0 2px #1466b3;
    border-color: #1466b3 !important;
    transform: translateY(1px) scale(0.98);
    z-index: 1;
}