/* ============================================
   装机必备软件 - 前端样式
   ============================================ */

:root {
    --primary: #2196f3;
    --primary-dark: #1976d2;
    --primary-light: #e3f2fd;
    --primary-gradient: linear-gradient(145deg, #00a4ff 22%, #67c7fc 100%);
    --accent: #FF6B35;
    --accent-dark: #E55A2B;
    --bg: #f0f2f5;
    --card-bg: #ffffff;
    --text: #212121;
    --text-secondary: #666666;
    --text-light: #999999;
    --border: #e8ecf1;
    --shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 8px 30px rgba(0, 0, 0, 0.12);
    --radius: 12px;
    --radius-sm: 8px;
    --transition: 0.3s ease;
}

/* Reset */
*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    color: var(--primary-dark);
}

img {
    max-width: 100%;
    height: auto;
}

/* ============================================
   Header / Navbar
   ============================================ */

.site-header {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    height: 78px;
    gap: 0;
}

.site-logo {
    flex-shrink: 0;
    margin-right: 28px;
    display: flex;
    align-items: center;
}

.site-logo img {
    height: 44px;
    display: block;
}

.site-logo .logo-text {
    font-size: 22px;
    font-weight: 700;
    color: var(--primary);
    white-space: nowrap;
    letter-spacing: -0.5px;
}

/* Navigation */
.main-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1;
}

.main-nav a {
    display: inline-block;
    padding: 8px 16px;
    font-size: 15px;
    color: var(--text);
    border-radius: 8px;
    transition: var(--transition);
    white-space: nowrap;
    font-weight: 700;
}

.main-nav a:hover,
.main-nav a.active {
    background: var(--primary-light);
    color: var(--primary);
}

/* 导航下拉菜单 */
.nav-dropdown {
    position: relative;
    display: inline-block;
}

.nav-dropdown-toggle {
    cursor: pointer;
}

.dropdown-arrow {
    font-size: 10px;
    margin-left: 2px;
    vertical-align: middle;
}

.nav-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 160px;
    background: rgba(255,255,255,0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.12);
    padding: 6px 0;
    z-index: 300;
    border: 1px solid rgba(255,255,255,0.6);
}

/* 用伪元素桥接父级和下拉菜单之间的间隙，防止鼠标穿过时菜单消失 */
.nav-dropdown::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    height: 8px;
    z-index: 299;
}

.nav-dropdown:hover .nav-dropdown-menu {
    display: block;
}

.nav-dropdown-menu a {
    display: block !important;
    padding: 8px 16px !important;
    font-size: 14px !important;
    border-radius: 0 !important;
    color: var(--text) !important;
    white-space: nowrap;
}

.nav-dropdown-menu a:hover {
    background: var(--primary-light) !important;
    color: var(--primary) !important;
}

/* ============================================
   Mega Menu - 分类超级菜单
   ============================================ */

.mega-menu {
    position: relative;
    display: inline-block;
}

.mega-menu-toggle {
    display: inline-block;
    padding: 8px 16px !important;
    font-size: 15px !important;
    color: var(--text) !important;
    border-radius: 8px !important;
    cursor: pointer;
    white-space: nowrap;
    background: none !important;
    font-weight: 500 !important;
}

.mega-menu:hover .mega-menu-toggle {
    background: var(--primary-light) !important;
    color: var(--primary) !important;
}

/* 下拉面板 — 左右分栏 */
.mega-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255,255,255,0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.15);
    z-index: 300;
    flex-direction: row;
    width: 560px;
    min-height: 380px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.6);
}

.mega-menu:hover .mega-dropdown {
    display: flex;
}

/* 桥接层：防止鼠标移出时菜单消失 */
.mega-menu::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    height: 10px;
    z-index: 299;
}

/* 左侧：一级分类竖列 */
.mega-left {
    width: 140px;
    flex-shrink: 0;
    background: rgba(0,0,0,0.03);
    border-right: 1px solid rgba(0,0,0,0.06);
    padding: 8px 0;
}

.mega-parent {
    display: block;
    padding: 10px 18px;
    font-size: 14px;
    color: #555;
    cursor: pointer;
    white-space: nowrap;
    transition: var(--transition);
    border-left: 3px solid transparent;
}

.mega-parent:hover,
.mega-parent.active {
    background: #fff;
    color: var(--primary);
    font-weight: 600;
    border-left-color: var(--primary);
}

/* 右侧：二级分类内容区 */
.mega-right {
    flex: 1;
    padding: 16px 20px;
    min-width: 0;
}

.mega-child-panel {
    display: none;
}

.mega-child-panel.active {
    display: block;
}

.mega-child-title {
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.mega-child-title a {
    font-size: 15px;
    font-weight: 600;
    color: var(--primary);
}

.mega-child-title a:hover {
    color: var(--primary-dark);
}

.mega-child-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.mega-child-link {
    display: inline-block;
    padding: 6px 14px;
    font-size: 13px;
    color: #555;
    border-radius: 6px;
    background: #f5f7fa;
    white-space: nowrap;
    transition: var(--transition);
}

.mega-child-link:hover {
    color: white;
    background: var(--primary-gradient);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(52, 152, 219, 0.3);
}

/* ============================================
   Search - 图标 + 弹出层
   ============================================ */

/* 搜索图标按钮 */
.search-icon-btn {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: var(--bg);
    cursor: pointer;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: var(--transition);
    margin-left: auto;
}

.search-icon-btn:hover {
    background: var(--primary-light);
    color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(52, 152, 219, 0.3);
}

/* 搜索弹出层 */
.search-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.4);
    z-index: 9999;
    align-items: flex-start;
    justify-content: center;
    padding-top: 120px;
}

.search-overlay.active {
    display: flex;
}

.search-popup {
    width: 520px;
    max-width: 90vw;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.25);
    overflow: hidden;
    animation: slideDown 0.2s ease;
}

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

.search-popup form {
    display: flex;
    align-items: center;
    padding: 6px;
}

.search-popup input {
    flex: 1;
    height: 46px;
    padding: 0 16px;
    border: none;
    font-size: 16px;
    outline: none;
    background: transparent;
}

.search-popup button {
    height: 46px;
    padding: 0 28px;
    border: none;
    border-radius: 30px;
    background: var(--primary);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: var(--transition);
    letter-spacing: 0.5px;
}

.search-popup button:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.3);
}

.search-popup-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,0.2);
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    display: none;
}

/* Mobile Menu Toggle */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text);
    padding: 8px;
    flex-shrink: 0;
}

/* ============================================
   Slideshow
   ============================================ */

.slideshow-section {
    max-width: 1400px;
    margin: 24px auto;
    padding: 0 24px;
}

.slideshow-wrapper {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    background: #e8ecf1;
}

.slideshow-track {
    display: flex;
    transition: transform 0.5s ease-in-out;
}

.slide-item {
    min-width: 100%;
    position: relative;
}

.slide-item a {
    display: block;
}

.slide-item img {
    width: 100%;
    height: 360px;
    object-fit: cover;
    display: block;
}

.slide-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px 30px;
    background: linear-gradient(to top, rgba(0,0,0,0.6), transparent);
    color: #fff;
    font-size: 18px;
    font-weight: 500;
}

/* Slideshow Controls */
.slideshow-prev,
.slideshow-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.85);
    border: none;
    cursor: pointer;
    font-size: 20px;
    color: var(--text);
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.slideshow-prev:hover,
.slideshow-next:hover {
    background: #fff;
    box-shadow: 0 4px 16px rgba(0,0,0,0.18);
}

.slideshow-prev { left: 16px; }
.slideshow-next { right: 16px; }

.slideshow-dots {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 10;
}

.slideshow-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
    border: none;
    cursor: pointer;
    transition: var(--transition);
    padding: 0;
}

.slideshow-dot.active {
    background: #fff;
    transform: scale(1.3);
}

/* ===== 网站公告 ===== */
.announcement-bar {
    max-width: 1400px;
    margin: 0 auto 20px;
    padding: 0 24px;
}
.announcement-inner {
    background: #fff4e6;
    border: 1px solid #ffd8b3;
    border-radius: 16px;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}
.announcement-icon {
    flex-shrink: 0;
    font-size: 18px;
    line-height: 1.6;
}
.announcement-text {
    font-size: 15px;
    font-weight: bold;
    color: #d47800;
    line-height: 1.6;
    text-align: center;
}

/* 最近更新版块容器 */
.recent-section-wrap {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px 0;
}

/* 卡片版本号 */
.card-version {
    font-size: 12px;
    font-weight: 400;
    color: #999;
}

/* 卡片更新时间 */
.card-time {
    font-size: 11px;
    color: #bbb;
    display: block;
    margin-top: 4px;
}

/* ============================================
   Category Sticky Nav (左侧固定导航)
   ============================================ */

.category-sticky-nav {
    position: fixed;
    left: max(24px, calc((100vw - 1400px) / 2 - 194px));
    top: 100px;
    width: 170px;
    z-index: 50;
    background: #fff;
    border: 1px solid #e8ecf1;
    border-radius: 12px;
    padding: 16px 0;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.35s ease, visibility 0.35s ease, transform 0.35s ease;
}

.category-sticky-nav.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

@media (max-width: 1750px) {
    .category-sticky-nav {
        display: none;
    }
}

.category-nav-title {
    font-size: 14px;
    font-weight: 700;
    color: #212121;
    padding: 0 18px 12px;
    border-bottom: 1px solid #f0f0f0;
    margin-bottom: 6px;
}

.category-nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.category-nav-list li {
    margin: 0;
}

.category-nav-list a {
    display: block;
    padding: 9px 18px;
    font-size: 13px;
    color: #666;
    text-decoration: none;
    border-left: 3px solid transparent;
    transition: all 0.2s ease;
    font-weight: 500;
}

.category-nav-list a:hover {
    color: var(--primary);
    background: var(--primary-light);
    border-left-color: var(--primary);
}

.category-nav-list a.active {
    color: var(--primary);
    background: var(--primary-light);
    border-left-color: var(--primary);
    font-weight: 600;
}

.category-sections {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px 80px;
}

.category-section {
    scroll-margin-top: 100px;
    margin-bottom: 32px;
    background: #fff;
    border: 1px solid #e8ecf1;
    border-radius: 16px;
    padding: 28px 28px 24px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

.category-section-title {
    font-size: 24px;
    font-weight: 700;
    color: #212121;
    margin: 0 0 28px;
    line-height: 1.3;
    padding-left: 0;
    border-left: none;
}

.category-section-title a {
    color: #212121;
}

.category-section-title a:hover {
    color: var(--primary);
}

.cat-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    margin-bottom: 18px;
}

.cat-title-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cat-header .category-section-title {
    margin: 0;
}

.cat-subtitle {
    font-size: 12px;
    font-weight: 400;
    color: #b0b8c1;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    white-space: nowrap;
}

.cat-view-all {
    font-size: 14px;
    color: var(--primary);
    font-weight: 500;
    white-space: nowrap;
    transition: var(--transition);
    flex-shrink: 0;
}

.cat-view-all:hover {
    color: var(--primary-dark);
    transform: translateX(3px);
}

/* Category tabs */
.cat-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 2px solid #eef1f5;
}

.cat-tab {
    display: inline-block;
    padding: 6px 16px;
    font-size: 13px;
    color: #666;
    border-radius: 20px;
    cursor: pointer;
    transition: var(--transition);
    background: #f0f2f5;
    white-space: nowrap;
    user-select: none;
}

.cat-tab:hover {
    color: var(--primary);
    background: var(--primary-light);
}

.cat-tab.active {
    color: white;
    background: var(--primary-gradient);
    font-weight: 500;
}

/* Category panels */
.cat-panel {
    display: none;
}

.cat-panel.active {
    display: block;
}

/* 3-column grid for category sections */
.cat-grid {
    grid-template-columns: repeat(4, 1fr) !important;
}

/* Sub-category */
.subcategory-block {
    margin-bottom: 32px;
    background: #fff;
    border: 1px solid #e8ecf1;
    border-radius: 16px;
    padding: 28px 28px 24px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.subcategory-title {
    font-size: 24px;
    font-weight: 700;
    color: #212121;
    margin: 0 0 24px;
    padding: 0;
    border-bottom: none;
}
.subcategory-title a {
    color: #212121;
    text-decoration: none;
}
.subcategory-title a:hover {
    color: var(--primary);
}

/* Software Grid */
.software-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
}

/* Software Card */
.software-card {
    background: var(--card-bg);
    border-radius: 14px;
    padding: 20px;
    display: flex;
    gap: 16px;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid #e8ecf1;
}

.software-card:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
    transform: translateY(-3px);
    border-color: #dde4ee;
}

/* 管理员编辑按钮 - 默认隐藏 */
.card-edit-btn {
    display: none;
    position: absolute;
    top: 8px;
    right: 8px;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: var(--primary);
    color: #fff;
    font-size: 14px;
    line-height: 30px;
    text-align: center;
    text-decoration: none;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
    transform: scale(0.8);
}

body.is-admin .software-card {
    position: relative;
}

body.is-admin .software-card:hover .card-edit-btn {
    display: block;
    opacity: 1;
    transform: scale(1);
}

.card-edit-btn:hover {
    background: var(--primary-dark);
    color: #fff;
    transform: scale(1.1) !important;
}

.software-card-logo {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    border-radius: 30%;
    overflow: hidden;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #e8ecf1;
}

.software-card-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.software-card-logo .default-logo {
    width: 44px;
    height: 44px;
    color: #ccc;
}

.software-card-info {
    flex: 1;
    min-width: 0;
}

.software-card-info h5 {
    margin: 0 0 6px;
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.software-card-info .card-desc {
    margin: 0;
    font-size: 13px;
    color: var(--text-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.5;
}

/* ============================================
   Buttons - 全局下载按钮样式
   ============================================ */

.btn-download {
    padding: 10px 24px;
    border-radius: 30px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: none;
    cursor: pointer;
    font-size: 14px;
    text-decoration: none;
}

.btn-download.primary {
    color: #ffffff;
    background: linear-gradient(145deg, #333 22%, #666 100%);
}

.btn-download.primary:hover {
    background: linear-gradient(-145deg, #333 22%, #666 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.btn-download.secondary {
    color: #ffffff;
    background: linear-gradient(145deg, #00a4ff 22%, #67c7fc 100%);
}

.btn-download.secondary:hover {
    background: linear-gradient(-145deg, #00a4ff 22%, #67c7fc 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(52, 152, 219, 0.3);
}

.btn-download.accent {
    color: #ffffff;
    background: linear-gradient(145deg, #ff6b35 22%, #ff9a6c 100%);
}

.btn-download.accent:hover {
    background: linear-gradient(-145deg, #ff6b35 22%, #ff9a6c 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(255, 107, 53, 0.3);
}

/* 卡片上的下载按钮（隐藏但保留占位） */
.software-card-info .btn-download {
    display: none;
}

/* ============================================
   Search Results
   ============================================ */

.search-section {
    max-width: 1400px;
    margin: 24px auto;
    padding: 0 24px;
}

.search-header {
    margin-bottom: 24px;
}

.search-header h2 {
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 8px;
}

.search-header .search-keyword {
    color: var(--accent);
}

.search-header .search-count {
    font-size: 14px;
    color: var(--text-secondary);
}

.search-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
    font-size: 16px;
}

.search-empty .empty-icon {
    font-size: 64px;
    display: block;
    margin-bottom: 16px;
    opacity: 0.3;
}

/* ============================================
   Modal
   ============================================ */

.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

.modal-overlay.active {
    display: flex;
}

.software-modal {
    background: #fff;
    border-radius: 20px;
    width: 720px;
    max-width: 95vw;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.2);
    animation: slideUp 0.3s ease;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 16px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(0,0,0,0.06);
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.modal-close:hover {
    background: rgba(0,0,0,0.12);
    color: var(--text);
}

.modal-body {
    padding: 32px;
    position: relative;
}

.modal-title-row {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 12px;
}

.modal-title-content {
    width: 100%;
    text-align: center;
}

.modal-title-content h4 {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    font-size: 24px;
    font-weight: 700;
    margin: 0;
    color: #212121;
    border-bottom: none;
}
.modal-title-desc {
    font-size: 14px;
    font-weight: 400;
    color: #888;
    margin-left: 4px;
}
.modal-soft-version {
    font-size: 12px;
    color: #999;
    margin-top: 2px;
    text-align: center;
}

.modal-logo {
    width: 80px;
    height: 80px;
    border-radius: 30%;
    overflow: hidden;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #e8ecf1;
    margin: 0 auto 12px;
}

.modal-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.modal-desc {
    font-size: 15px;
    color: var(--text-secondary);
    margin: 6px 0 0;
    line-height: 1.6;
}

.modal-detail {
    font-size: 14px;
    color: #555;
    margin: 20px 0 10px 0;
    line-height: 1.8;
    max-height: 160px;
    overflow-y: auto;
    padding: 14px;
    background: #f8f9fb;
    border-radius: 10px;
    border: 1px solid #eef0f4;
    text-align: center;
}

.modal-download-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.modal-download-group .btn-dl {
    display: none;
}

.btn-dl-official,
.btn-dl-pan,
.btn-dl-other {
    display: none;
}

/* 隐藏下载按钮（锁头，绿色） */
.hidden-dl-btn {
    background: linear-gradient(135deg, #07c160, #06ad56) !important;
    border: none !important;
    color: #fff !important;
}
.hidden-dl-btn:hover {
    background: linear-gradient(135deg, #06ad56, #059a4c) !important;
}
.hidden-dl-btn svg {
    margin-right: 6px;
}

/* Modal 标记徽章 */
.modal-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
    margin-bottom: 8px;
    justify-content: center;
}

.modal-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.6;
}

.badge-featured { background: #fff3cd; color: #856404; }
.badge-hot { background: #f8d7da; color: #721c24; }
.badge-new { background: #d4edda; color: #155724; }
.badge-light { background: #d1ecf1; color: #0c5460; }
.badge-ai { background: #f3e8ff; color: #6b21a8; }

/* 卡片上的标记徽章 */
.card-badges {
    display: none;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 4px;
}

.card-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.6;
}

/* Modal 介绍链接 */
.modal-intro-link-wrap {
    margin-bottom: 30px;
}
/* Modal 限免/活动 */
.modal-promo-wrap {
    background: linear-gradient(135deg, #fff5f5, #fff8f0);
    border: 1px solid #fdd;
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 12px;
    text-align: center;
}
.promo-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
    justify-content: center;
}
.promo-tag {
    display: inline-block;
    background: #e53e3e;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 3px;
}
.promo-date {
    color: #999;
    font-size: 12px;
}
.promo-content {
    font-size: 13px;
    color: #444;
    line-height: 1.5;
}
/* Modal 图片展示 */
.modal-images-wrap {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    margin-bottom: 16px;
    overflow-x: auto;
    padding-bottom: 4px;
}
.modal-image-item {
    width: 176px;
    height: 176px;
    flex-shrink: 0;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    border: 1px solid #eee;
}
.modal-image-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.2s;
}
.modal-image-item img:hover {
    transform: scale(1.08);
}
/* Lightbox */
.lightbox-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.9);
    z-index: 9999;
    justify-content: center;
    align-items: center;
}
.lightbox-overlay.active {
    display: flex;
}
.lightbox-overlay .lightbox-img {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 4px;
}
.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #fff;
    font-size: 36px;
    cursor: pointer;
    line-height: 1;
    z-index: 10;
}
.lightbox-close:hover {
    color: #ccc;
}
.intro-link-label {
    font-size: 13px;
    color: #999;
    margin-bottom: 4px;
}
.modal-intro-link-row {
    margin-bottom: 2px;
}
.intro-link-sep {
    border-bottom: 1px dashed #ddd;
    margin: 6px 0 6px;
}
.modal-intro-link {
    font-size: 13px;
    color: var(--primary);
    text-decoration: none;
}
.modal-intro-link:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* Modal 标签 */
.modal-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.modal-tag {
    display: inline-block;
    padding: 2px 10px;
    background: #f0f0f5;
    color: #666;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.6;
}

/* ============================================
   Sidebar
   ============================================ */

.sidebar {
    position: fixed;
    right: 20px;
    bottom: 100px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 999;
}

.sidebar-btn {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: none;
    font-size: 18px;
    color: var(--text-secondary);
    transition: var(--transition);
    text-decoration: none;
    position: relative;
}

.sidebar-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.16);
    color: var(--primary);
}

/* WeChat QR Code hover */
.sidebar-btn.wechat-btn .qr-popup {
    display: none;
    position: absolute;
    right: 60px;
    bottom: 0;
    background: #fff;
    border-radius: var(--radius-sm);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    padding: 12px;
    width: 160px;
}

.sidebar-btn.wechat-btn .qr-popup img {
    width: 100%;
    display: block;
    border-radius: 4px;
}

.sidebar-btn.wechat-btn .qr-popup .qr-label {
    text-align: center;
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 6px;
}

.sidebar-btn.wechat-btn:hover .qr-popup {
    display: block;
}

/* ============================================
   Footer
   ============================================ */

.site-footer {
    background: #1a1d24;
    color: #8899aa;
    text-align: center;
    padding: 40px 20px;
    font-size: 14px;
    line-height: 2;
    margin-top: 20px;
}

.site-footer a {
    color: #aabbcc;
}

.site-footer a:hover {
    color: #fff;
}

.friendly-links {
    margin-bottom: 14px;
    font-size: 14px;
    color: #8899aa;
}

.friendly-links a {
    color: #aabbcc;
}

.friendly-links a:hover {
    color: #fff;
}

.friendly-links .fl-sep {
    color: #556;
    margin: 0 6px;
}

/* ============================================
   Animations
   ============================================ */

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(40px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Loading Spinner */
.modal-loading {
    padding: 60px 20px;
    text-align: center;
    color: var(--text-secondary);
}

.modal-loading::before {
    content: '';
    display: inline-block;
    width: 32px;
    height: 32px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-right: 10px;
    vertical-align: middle;
}

/* ============================================
   Responsive
   ============================================ */

@media (max-width: 1440px) {
    .software-grid,
    .cat-grid {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

@media (max-width: 1082px) {
    .software-grid,
    .cat-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (max-width: 768px) {
    .header-inner {
        height: 60px;
        flex-wrap: wrap;
        position: relative;
    }

    .menu-toggle {
        display: block;
        margin-left: 12px;
    }

    .main-nav {
        display: none;
        position: absolute;
        top: 60px;
        left: 0;
        right: 0;
        background: #fff;
        flex-direction: column;
        padding: 12px 0;
        box-shadow: 0 8px 24px rgba(0,0,0,0.1);
        z-index: 100;
    }

    .main-nav.open {
        display: flex;
    }

    .main-nav a {
        padding: 14px 20px;
        border-radius: 0;
        font-size: 16px;
        border-bottom: 1px solid #f0f0f0;
    }

    .main-nav a:last-child {
        border-bottom: none;
    }

    .software-grid,
    .cat-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 14px;
    }

    .slide-item img {
        height: 200px;
    }

    .mega-dropdown {
        width: 92vw;
        left: 0;
        transform: none;
    }
}

@media (max-width: 754px) {
    .software-grid,
    .cat-grid {
        grid-template-columns: 1fr !important;
    }
    .cat-subtitle {
        display: none;
    }
}

@media (max-width: 640px) {
    .software-grid,
    .cat-grid {
        grid-template-columns: 1fr !important;
    }

    .modal-body {
        padding: 20px;
    }

    .modal-title-row {
        flex-direction: column;
        align-items: center;
        gap: 12px;
    }

    .modal-logo {
        width: 64px;
        height: 64px;
    }

    .sidebar {
        right: 10px;
        bottom: 80px;
    }

    .sidebar-btn {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }

    .category-section-title {
        font-size: 20px;
    }

    .subcategory-title {
        font-size: 16px;
    }

    /* 移动端隐藏分类侧边导航 */
    .category-sticky-nav {
        display: none;
    }
}

@media (max-width: 640px) {
    .software-card {
        padding: 12px;
    }

    .software-card-logo {
        width: 60px;
        height: 60px;
        border-radius: 12px;
    }

    .software-card-info h5 {
        font-size: 14px;
    }

    .software-card-info .card-desc {
        font-size: 12px;
    }
}

/* ============ 夯到拉投票 ============ */
.vote-section {
    margin-top: 16px;
}

.vote-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #999;
    font-size: 13px;
    margin-bottom: 14px;
}

.vote-divider::before,
.vote-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e0e0e0;
}

.vote-buttons {
    display: flex;
    justify-content: center;
    gap: 18px;
}

.vote-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.vote-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2px solid #d0d0d0;
    background: #f0f0f0;
    color: #999;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    outline: none;
    user-select: none;
}

.vote-btn:hover {
    transform: scale(1.1);
    border-color: #aaa;
}

/* 最高票按钮颜色 */
.vote-btn.max-hang { background: #d95d52; border-color: #d95d52; color: #fff; }
.vote-btn.max-ding { background: #e8a855; border-color: #e8a855; color: #fff; }
.vote-btn.max-shang { background: #e8d595; border-color: #e8d595; color: #5a4e2b; }
.vote-btn.max-n { background: #e8e4d9; border-color: #e8e4d9; color: #5a5540; }
.vote-btn.max-la { background: #c8c8c8; border-color: #c8c8c8; color: #555; }

/* hover 各颜色 */
.vote-btn[data-vote="hang"]:hover { background: #d95d52; border-color: #d95d52; color: #fff; }
.vote-btn[data-vote="ding"]:hover { background: #e8a855; border-color: #e8a855; color: #fff; }
.vote-btn[data-vote="shang"]:hover { background: #e8d595; border-color: #e8d595; color: #5a4e2b; }
.vote-btn[data-vote="n"]:hover { background: #e8e4d9; border-color: #e8e4d9; color: #5a5540; }
.vote-btn[data-vote="la"]:hover { background: #c8c8c8; border-color: #c8c8c8; color: #555; }

.vote-count {
    font-size: 12px;
    color: #999;
    font-weight: 500;
}

@keyframes fadeOut {
    0% { opacity: 1; }
    80% { opacity: 1; }
    100% { opacity: 0; }
}

/* ===== 密码弹窗 ===== */
.password-popup-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn .2s ease;
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
.password-popup {
    background: #fff;
    border-radius: 16px;
    padding: 32px 28px 24px;
    width: 90%;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    position: relative;
}
.password-popup-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    line-height: 1;
}
.password-popup-close:hover {
    color: #555;
}
.password-popup-icon {
    color: #07c160;
    margin-bottom: 12px;
}
.password-popup-title {
    font-size: 18px;
    font-weight: 700;
    color: #212121;
    margin-bottom: 8px;
}
.password-popup-content {
    font-size: 14px;
    color: #666;
    line-height: 1.6;
    margin-bottom: 16px;
    padding: 10px 14px;
    background: #f8f9fb;
    border-radius: 8px;
    border: 1px solid #eee;
}
.password-popup-input-wrap {
    margin-bottom: 12px;
}
.password-popup-input {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 15px;
    text-align: center;
    outline: none;
    transition: border-color .2s;
    box-sizing: border-box;
}
.password-popup-input:focus {
    border-color: #07c160;
}
.password-popup-btn {
    display: inline-block;
    width: 100%;
    padding: 10px;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    background: #ccc;
    cursor: not-allowed;
    transition: background .2s;
    box-sizing: border-box;
}
.password-popup-btn.active {
    background: linear-gradient(135deg, #07c160, #06ad56);
    cursor: pointer;
}
.password-popup-btn.active:hover {
    background: linear-gradient(135deg, #06ad56, #059a4c);
}
.password-popup-error {
    color: #e53e3e;
    font-size: 13px;
    margin-top: 8px;
    min-height: 18px;
}

/* ============================================
   夯按钮点击动画
   ============================================ */
.hang-explosion {
    position: fixed;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    pointer-events: none;
    z-index: 10001;
}
.hang-explosion-dot {
    position: absolute;
    font-size: 28px;
    opacity: 0;
    animation: hang-burst 1.2s var(--d, 0s) ease-out forwards;
}
.hang-explosion-num {
    position: absolute;
    font-size: 36px;
    font-weight: 800;
    color: #ff4444;
    text-shadow: 0 2px 8px rgba(255,0,0,0.4);
    white-space: nowrap;
    opacity: 0;
    animation: hang-count 1s ease-out forwards;
    transform: translate(-50%, -50%);
}
@keyframes hang-burst {
    0% {
        opacity: 1;
        transform: translate(0, 0) scale(0.3);
    }
    15% {
        opacity: 1;
        transform: translate(var(--x2, 0), var(--y2, 0)) scale(1.2);
    }
    60% {
        opacity: 0.6;
    }
    100% {
        opacity: 0;
        transform: translate(var(--x, 0), var(--y, 0)) scale(0.5);
    }
}
@keyframes hang-count {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.2);
    }
    20% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.3);
    }
    40% {
        transform: translate(-50%, -50%) scale(1);
    }
    70% {
        opacity: 1;
        transform: translate(-50%, -80%) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -120%) scale(0.8);
    }
}
