* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #1a1a1a;
    color: #333;
    min-height: 100vh;
}

.site-header {
    text-align: center;
    padding: 30px 0;
    background-color: #1a1a1a;
}

.logo {
    color: #fff;
    font-size: 88px;
    margin-bottom: 15px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.site-description {
    color: #ed0404;
    font-size: 16px;
}

.container {
    background-color: #fff;
    margin: 20px auto;
    max-width: 1200px;
    border-radius: 12px;
    padding: 25px;
    display: flex;
    flex-wrap: wrap;
    gap: 25px;
    position: relative;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.search-box {
    flex: 1;
    position: relative;
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
}

.search-box:focus-within {
    box-shadow: 0 0 0 2px rgba(0,123,255,0.25);
    background-color: #fff;
}

.search-icon {
    padding: 0 15px;
    color: #666;
    font-size: 16px;
}

.clear-icon {
    padding: 0 15px;
    color: #666;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
}

.clear-icon:hover {
    color: #333;
}

.search-box input {
    flex: 1;
    padding: 12px 40px;
    border: none;
    border-radius: 6px;
    background: transparent;
    font-size: 15px;
    transition: all 0.3s ease;
}

.search-box input:focus {
    outline: none;
}

.sidebar {
    width: auto;
    max-width: 300px;
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    margin: 0 auto;
    flex-shrink: 0;
}

.sidebar ul {
    list-style: none;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.sidebar li {
    margin-bottom: 8px;
    width: 100%;
}

.sidebar a {
    color: #495057;
    text-decoration: none;
    display: block;
    padding: 10px 15px;
    border-radius: 6px;
    transition: all 0.3s;
    position: relative;
    padding-left: 25px;
    font-size: 14px;
    white-space: nowrap;
    text-align: left;
    width: 100%;
    font-weight: 600;
}

.sidebar a::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 0;
    background-color: #007bff;
    transition: height 0.3s;
}

.sidebar a.active {
    background-color: #e9ecef;
    color: #007bff;
    font-weight: 500;
}

.sidebar a.active::before {
    height: 80%;
}

.sidebar a:hover {
    background-color: #e9ecef;
    color: #007bff;
}

.sidebar a:hover::before {
    height: 80%;
}

.content {
    flex: 1;
    min-width: 0;
}

.software-section {
    display: none;
    margin-bottom: 30px;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.software-section:first-child {
    display: block;
}

.section-header {
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e9ecef;
}

.section-header h2 {
    font-size: 20px;
    color: #2c3e50;
    font-weight: 600;
}

.software-item {
    margin-bottom: 6px ;
    background: #fff;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
}

.software-item:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.software-icon {
    display: flex;
    align-items: center;
    gap: 12px;
}

.software-icon img {
    width: 36px;
    height: 36px;
    border-radius: 6px;
}

.software-icon span {
    font-size: 15px;
    color: #2c3e50;
    font-weight: 500;
}

.software-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.software-header:hover {
    background-color: #e9ecef;
}

.toggle-btn {
    width: 24px;
    height: 24px;
    position: relative;
}

.toggle-btn::before {
    content: '';
    position: absolute;
    width: 10px;
    height: 10px;
    border-right: 2px solid #666;
    border-bottom: 2px solid #666;
    transform: rotate(-45deg);
    top: 4px;
    left: 4px;
    transition: transform 0.3s;
}

.software-item.expanded .toggle-btn::before {
    transform: rotate(45deg);
}

.version-list {
    display: none;
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 0 0 8px 8px;
    margin-top: -1px;
}

.software-item.expanded .version-list {
    display: block;
}

.version-item {
    width: calc(50% - 8px); /* 两列，减去一半gap */
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #fff;
    border-radius: 10px;
    box-sizing: border-box;
    padding: 18px 20px;
    margin-bottom: 0;
    border-bottom: none;
    box-shadow: 0 1px 4px rgba(0,0,0,0.03);
    transition: box-shadow 0.2s;
}

.version-item:hover {
    background-color: #f8f9fa;
}

.version-name {
    flex: 1;
    font-size: 15px;
    color: #333;
    font-weight: 500;
    margin-right: 24px;
    min-width: 0;
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
}

.button-group {
    display: flex;
    gap: 12px;
}

.btn {
    padding: 8px 16px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.3s;
}

.btn.download {
    background-color: #007bff;
    color: white;
}

.btn.download:hover {
    background-color: #0056b3;
}

.btn.cloud {
    background-color: #28a745;
    color: white;
}

.btn.cloud:hover {
    background-color: #218838;
}

.btn.tutorial {
    background-color: #ffc107;
    color: #000;
}

.btn.tutorial:hover {
    background-color: #e0a800;
}

.quick-links {
    position: fixed;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.quick-link {
    padding: 10px 20px;
    background-color: #007bff;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.quick-link:hover {
    transform: translateX(-5px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.quick-link.mobile {
    background-color: #ffc107;
}

.quick-link.tutorial {
    background-color: #28a745;
}

.site-footer {
    text-align: center;
    padding: 25px;
    color: #666;
    font-size: 16px;
    background-color: #1a1a1a;
    margin-top: 30px;
}

.search-results {
    display: none;
    background: white;
    border-radius: 4px;
    margin: 20px 0;
    padding: 20px;
    flex: 1;
}

.search-header {
    font-size: 16px;
    color: #333;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.search-results-list {
    display: grid;
    gap: 10px;
}

.search-result-item {
    background: #f8f9fa;
    border-radius: 4px;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.3s;
}

.search-result-item:hover {
    background: #f0f0f0;
}

.search-result-item .version-name {
    font-size: 14px;
    color: #333;
}

.search-result-item .button-group {
    display: flex;
    gap: 10px;
}

.no-results {
    text-align: center;
    padding: 20px;
    color: #666;
    font-size: 14px;
    background: #f8f9fa;
    border-radius: 4px;
}

.control-panel {
    width: 100%;
    display: flex;
    gap: 20px;
    align-items: center;
    margin-bottom: 20px;
}

.download-options {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* 开关按钮样式 */
.toggle-switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    gap: 8px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 20px;
    background-color: #ccc;
    border-radius: 20px;
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    border-radius: 50%;
    transition: .4s;
}

.toggle-switch input:checked + .slider {
    background-color: #007bff;
}

.toggle-switch input:checked + .slider:before {
    transform: translateX(20px);
}

.toggle-switch .label {
    font-size: 14px;
    color: #333;
    user-select: none;
}

/* 隐藏迅雷下载按钮 */
.btn.download.hidden {
    display: none;
}

/* 响应式调整 */
@media (max-width: 1024px) {
    .container {
        margin: 15px;
        padding: 20px;
        transform: scale(0.9);
        transform-origin: top center;
    }

    .sidebar {
        width: 100%;
        max-width: none;
    }

    .software-icon img {
        width: 32px;
        height: 32px;
    }

    .version-item {
        padding: 12px;
    }

    .btn {
        padding: 6px 12px;
        font-size: 12px;
    }
}

@media (max-width: 768px) {
    .container {
        margin: 10px;
        padding: 15px;
        transform: scale(0.8);
        transform-origin: top center;
        flex-direction: column;
    }
    
    .site-header {
        padding: 20px 0;
    }

    .logo {
        font-size: 28px;
    }
    
    .sidebar {
        width: 100%;
        max-width: none;
        margin-top: 20px;
    }
    
    .content {
        order: 1;
        width: 100%;
    }
    
    .search-box {
        margin-bottom: 15px;
    }

    .search-box input {
        font-size: 14px;
        padding: 10px 35px;
    }
    
    .quick-links {
        position: static;
        flex-direction: row;
        justify-content: center;
        transform: none;
        margin-top: 20px;
        gap: 10px;
    }

    .quick-link {
        padding: 8px 15px;
        font-size: 13px;
    }
    
    .version-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .button-group {
        width: 100%;
        justify-content: flex-start;
        gap: 10px;
    }

    .section-header {
        margin-bottom: 20px;
    }

    .section-header h2 {
        font-size: 18px;
    }

    .software-header {
        padding: 15px;
    }

    .software-icon span {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .container {
        margin: 5px;
        padding: 10px;
        transform: scale(0.7);
        transform-origin: top center;
    }

    .site-header {
        padding: 15px 0;
    }

    .logo {
        font-size: 24px;
    }

    .site-description {
        font-size: 12px;
    }
    
    .software-icon {
        flex-direction: column;
        text-align: center;
        gap: 8px;
    }
    
    .button-group {
        flex-direction: column;
        gap: 8px;
    }
    
    .btn {
        width: 100%;
        text-align: center;
        padding: 10px;
        font-size: 13px;
    }

    .quick-links {
        flex-direction: column;
        align-items: center;
    }

    .quick-link {
        width: 100%;
        text-align: center;
    }

    .version-name {
        font-size: 15px;
    }

    .software-header {
        padding: 12px;
    }

    .toggle-btn {
        width: 20px;
        height: 20px;
    }

    .toggle-btn::before {
        width: 8px;
        height: 8px;
    }
}

/* 平板横屏优化 */
@media (min-width: 768px) and (max-width: 1024px) and (orientation: landscape) {
    .container {
        flex-direction: row;
    }

    .sidebar {
        width: 200px;
    }

    .content {
        flex: 1;
    }

    .version-item {
        flex-direction: row;
        align-items: center;
    }

    .button-group {
        flex-direction: row;
    }
}

/* 大屏手机优化 */
@media (min-width: 480px) and (max-width: 767px) {
    .container {
        margin: 10px;
    }

    .software-icon {
        flex-direction: row;
    }

    .button-group {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .btn {
        flex: 1;
        min-width: 120px;
    }
}

/* 确保内容不会溢出 */
* {
    max-width: 100%;
    box-sizing: border-box;
}

/* 优化触摸体验 */
@media (hover: none) {
    .btn, .quick-link, .sidebar a {
        -webkit-tap-highlight-color: transparent;
    }

    .software-header {
        padding: 20px;
    }

    .version-item {
        padding: 20px;
    }
}

.software-header.clickable {
    cursor: pointer;
    transition: background-color 0.3s;
}

.software-header.clickable:hover {
    background-color: #f0f0f0;
} 

.version-item {
    flex: 1 1 calc(50% - 10px) !important;
    min-width: 320px !important;
    max-width: calc(50% - 12px) !important;
    box-sizing: border-box !important;
    margin-bottom: 0 !important;
    border-bottom: none !important;
}

/* 小屏幕下自动一列显示 */
@media (max-width: 900px) {
    .version-item {
        width: 100%;
    }
}

/* 默认隐藏版本列表 */
.version-list {
    display: none;
    flex-wrap: wrap;
    gap: 0px;
}

/* 只有展开的项才显示并横排 */
.software-item.expanded .version-list {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 0px !important;
}

/* 保持移动端也是左右结构，侧栏变窄，内容自适应 */
@media (max-width: 768px) {
    .container {
        flex-direction: row !important;
        padding: 0 !important;
        gap: 0 !important;
        margin: 0 !important;
        max-width: 100vw !important;
    }
    .sidebar {
        width: 70px !important;
        min-width: 60px !important;
        max-width: 80px !important;
        padding: 5px 0 !important;
        margin: 0 !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        background: #f8f9fa !important;
        overflow-y: auto;
        height: 100vh;
        position: sticky;
        left: 0;
        top: 0;
        z-index: 10;
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    .sidebar ul {
        flex-direction: column !important;
        align-items: center !important;
        width: 100%;
    }
    .sidebar li {
        width: 100% !important;
        margin-bottom: 6px !important;
    }
    .sidebar a {
        font-size: 12px !important;
        padding: 8px 0 !important;
        text-align: center !important;
        width: 100% !important;
        min-width: 0 !important;
    }
    .content {
        margin-left: 0 !important;
        width: calc(100vw - 70px) !important;
        min-width: 0 !important;
        padding: 10px 5px !important;
    }
}

/* 移动端放大显示，去除缩小效果 */
@media (max-width: 768px) {
    .container {
        transform: none !important;
        margin: 10px auto !important;
        padding: 10px !important;
        max-width: 100vw !important;
    }
}
@media (max-width: 480px) {
    .container {
        transform: none !important;
        margin: 5px auto !important;
        padding: 5px !important;
        max-width: 100vw !important;
    }
}

/* 移动端保证软件项logo和文字左右排列且对齐、大小统一 */
@media (max-width: 480px) {
    .software-icon {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        gap: 10px !important;
        text-align: left !important;
        width: 100%;
    }
    .software-icon img {
        width: 28px !important;
        height: 28px !important;
        display: block;
    }
    .software-icon span {
        font-size: 15px !important;
        color: #2c3e50 !important;
        font-weight: 500 !important;
        white-space: normal !important;
        margin-left: 0 !important;
    }
    .software-header {
        padding: 12px !important;
    }
}

/* 移动端按钮横向排列且自适应宽度，保证对齐和完整显示 */
@media (max-width: 480px) {
    .button-group {
        display: flex !important;
        flex-direction: row !important;
        gap: 8px !important;
        width: 100%;
        justify-content: space-between;
        align-items: center;
        margin-top: 10px;
        margin-bottom: 10px;
    }
    .button-group .btn {
        flex: 1 1 0;
        min-width: 0;
        max-width: 100%;
        font-size: 15px !important;
        padding: 12px 0 !important;
        text-align: center !important;
        border-radius: 6px !important;
        box-sizing: border-box;
    }
}

@media (max-width: 480px) {
    .logo {
        font-size: 70px !important; /* 调整为你想要的大小 */
    }
    .site-description {
        font-size: 20px !important; /* 调整为你想要的大小 */
    }
}
