:root {
    --bg: #f5f7fb;
    --card-bg: #ffffff;
    --text: #1e293b;
    --text-light: #5b6e8c;
    --border: #eef2ff;
    --primary: #3b82f6;
    --primary-dark: #2563eb;
    --card-shadow: 0 5px 15px rgba(0, 0, 0, 0.03), 0 0 0 1px #f0f2f5;
}
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    padding: 0; 
    transition: background 0.3s, color 0.3s;
}

.container {
    max-width: 1400px;
    margin: 1rem auto; 
    width: calc(100% - 2rem); 
    background: var(--card-bg);
    border-radius: 2rem;
    box-shadow: var(--card-shadow);
    padding: 2rem 1.5rem;
    position: relative;
}

.header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--card-bg);
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 1rem max(1.5rem, calc((100vw - 1400px) / 2 + 1.5rem));
    border-bottom: 1px solid var(--border);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.logo h1 {
    font-size: 1.8rem;
    font-weight: 700;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
}

.logo p {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-top: 0.2rem;
}

.nav-links a, .theme-toggle {
    text-decoration: none;
    color: var(--primary);
    font-weight: 500;
    background: var(--border);
    padding: 0.5rem 1.2rem;
    border-radius: 2rem;
    transition: all 0.2s;
    display: inline-block;
    cursor: pointer;
    border: none;
    font-size: 0.9rem;
}

.nav-links a:hover, .theme-toggle:hover {
    background: var(--primary);
    color: white;
}

/* 网格布局 - 响应式每行最多的列数 */
.software-grid {
    display: grid;
    gap: 1.8rem;
    margin: 1rem 0;
}

@media (max-width: 767px) {
    .software-grid {
        grid-template-columns: 1fr;
    }
}
@media (max-width: 1023px) and (min-width: 768px) {
    .software-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (min-width: 1024px) {
    .software-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (min-width: 1200px) {
    .software-grid { 
		grid-template-columns: repeat(3, 1fr); 
	}
}
@media (min-width: 1400px) {
    .software-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* 软件卡片 */
.software-card {
    background: var(--card-bg);
    border-radius: 1.5rem;
    box-shadow: var(--card-shadow);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.hidden-card { display: none !important; }

.software-card .card-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

/* 图标包装容器（新增） */
.app-icon-wrapper {
    width: 88px;
    height: 88px;
    flex-shrink: 0;
    position: relative;
}
.app-icon, .app-icon-fallback {
    width: 100%;
    height: 100%;
    border-radius: 1rem;
    object-fit: cover;
}
.app-icon-fallback {
    background: var(--border);
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    display: flex;
}

.software-card .app-info {
    flex: 1;
    min-width: 0;
}
.software-card .software-name {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 0.2rem;
    word-break: break-word;
}
.software-card .software-version {
    display: inline-block;
    font-size: 0.75rem;
    background: var(--border);
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    margin-bottom: 0;
}
.software-card .card-content {
    padding: 1.2rem 1.2rem 0.8rem 1.2rem;
    flex: 1;
}
.software-card .software-desc {
    margin-top: 0.5rem;
    margin-bottom: 0;
}

/* 卡片底部样式 */
.card-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border);
    background: var(--card-bg);
    margin-top: auto;
    overflow: hidden;
}

.card-footer .detail-link {
    display: inline-block;
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    font-size: 1rem;
    transition: color 0.2s;
    float: right;
    text-align: right;
	position: relative;
}
/* 下划线从左向右展开 */
.card-footer .detail-link::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -2px;
    width: 0;
    height: 2px;
    background: var(--primary-dark);
    transition: width 0.3s ease-in-out;
}
.card-footer .detail-link:hover {
    color: var(--primary-dark);

}
.card-footer .detail-link:hover::after {
    width: 100%;
}
.card-content {
    padding: 1.5rem;
    flex: 1;
}

.software-name {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.4rem;
}

.software-version {
    font-size: 0.8rem;
    color: var(--text-light);
    background: var(--border);
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    margin-bottom: 0.8rem;
}

.software-desc {
    color: var(--text);
    font-size: 0.9rem;
    margin: 0.75rem 0 1rem;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 5;	/* 软件介绍显示的行数 */
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 详情页布局 */
.detail-layout {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

.main-content {
    flex: 1;
    min-width: 0;
}

.sidebar {
    width: 280px;
    position: -webkit-sticky;
    position: sticky;
    top: 6px;
    align-self: flex-start;
    height: fit-content;
}

/* 软件详情卡片 */
.info-card {
    background: var(--card-bg);
    border-radius: 1.5rem;
    box-shadow: var(--card-shadow);
    padding: 1.8rem;
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.info-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.info-header-text {
    flex: 1;
}

.app-icon-large {
    width: 99px;
    height: 99px;
    object-fit: cover;
    flex-shrink: 0;
    vertical-align: middle;
    margin-bottom: 0.5rem;
    display: inline-block;
    /* 美化：圆角、背景、柔和阴影 */
    border-radius: 1.1rem;
    background: var(--border);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s, box-shadow 0.2s;
}

.app-icon-large:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.software-name-large {
    font-size: 2rem;
    font-weight: 700;
    margin: 0 0 0.3rem 0;
    word-break: break-word;
}

.meta-info {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-light);
    border-bottom: 1px dashed var(--border);
    padding-bottom: 1rem;
}

.meta-info span {
    background: var(--border);
    padding: 0.2rem 0.7rem;
    border-radius: 20px;
}

.full-description {
    background: var(--bg);
    padding: 1rem;
    border-radius: 1rem;
    margin: 1rem 0;
    line-height: 1.6;
    word-break: break-word;
}

/* 截图轮播 */
.screenshot-carousel {
    margin: 1.5rem 0;
    position: relative;
    overflow: hidden;
    border-radius: 1rem;
}
.carousel-container {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 1rem;
    padding: 0.5rem;
    -webkit-overflow-scrolling: touch;
}
.carousel-container img {
    max-width: 280px;
    height: auto;
    max-height: 160px;
    object-fit: cover;
    scroll-snap-align: start;
    border-radius: 0.5rem;
    border: 1px solid var(--border);
    flex-shrink: 0;
    cursor: pointer;
    transition: transform 0.2s;
}

/* 下载按钮区域 */
.download-section {
    background: var(--bg);
    padding: 1rem;
    border-radius: 1rem;
    margin: 1rem 0;
    line-height: 1.6;
	margin-top: 1.5rem;
    word-break: break-word;
}

.download-buttons-wrapper {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    margin: 0.5rem 0;
}

.download-btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 0.4rem;
    padding: 0.75rem 1.5rem;
    box-sizing: border-box;
    min-width: 140px;
    background: var(--primary);
    color: white;
    border-radius: 2rem;
    font-weight: 500;
    font-size: 0.9rem;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: background 0.2s;
}
.download-btn.demo-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        text-decoration: none;
    }

.download-btn:hover {
    background: var(--primary-dark);
}

.download-note {
    font-size: 0.75rem;
    color: var(--text-light);
    margin-top: 0.75rem;
    text-align: center;
}

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}
.modal-content {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 1.5rem;
    max-width: 400px;
    width: 90%;
    text-align: center;
}
.modal-buttons {
    margin-top: 1rem;
    display: flex;
    gap: 1rem;
    justify-content: center;
}
.modal-buttons button {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 2rem;
    cursor: pointer;
    font-size: 0.9rem;
}
.modal-buttons .confirm {
    background: var(--primary);
    color: white;
}
.modal-buttons .cancel {
    background: var(--border);
    color: var(--text);
}

/* 相关软件卡片 */
.related-card {
    background: var(--card-bg);
    border-radius: 1.5rem;
    box-shadow: var(--card-shadow);
    padding: 1.5rem;
    transition: box-shadow 0.2s, transform 0.2s;
}
.related-title {
    font-weight: bold;
    padding: 0 0 0.8rem 0;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    user-select: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.toggle-icon {
    transition: transform 0.2s;
    display: inline-block;
}
.toggle-icon.rotated {
    transform: rotate(180deg);
}
.related-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin: 0;
    padding: 0;
}
.related-list.collapsed {
    display: none !important;
}
.related-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.6rem 0.5rem;
    border-radius: 1rem;
    transition: background 0.2s;
    text-decoration: none;
    color: var(--text);
    border: 1px solid var(--border);
}
.related-item:hover {
    background: var(--border);
    transform: translateX(3px);
}
.related-icon {
    min-width: 2.5rem;
    text-align: center;
}
/* 相关推荐图标圆角美化 */
.related-icon img {
    width: 66px;
    height: 66px;
    object-fit: cover;
    border-radius: 0.9rem;
    background: var(--border);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s, box-shadow 0.2s;
}
.related-icon img:hover {
    transform: scale(1.03);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}
.related-info {
    flex: 1;
}
.related-name {
    font-weight: 600;
    font-size: 0.9rem;
}
.related-version {
    font-size: 0.7rem;
    color: var(--text-light);
}

/* 更新日志 */
.changelog-version {
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 1rem;
}
.changelog-version:last-child {
    border-bottom: none;
}
.version-header {
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: var(--primary);
}
.version-date {
    font-size: 0.8rem;
    color: var(--text-light);
    margin-left: 0.5rem;
    font-weight: normal;
}
.changelog-items {
    margin: 0.5rem 0 0 1.5rem;
    padding-left: 0;
}
.changelog-items li {
    margin-bottom: 0.3rem;
    line-height: 1.4;
}

/* 加载状态与错误提示 */
.footer {
    margin-top: 3rem;
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-light);
    border-top: 1px solid var(--border);
    padding-top: 2rem;
}

/* 回到顶部按钮 */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 20px;
    width: 44px;
    height: 44px;
    background-color: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    z-index: 9999;
}
.back-to-top.show {
    opacity: 1;
    visibility: visible;
}
.back-to-top:hover {
    background-color: #0056b3;
    transform: translateY(-3px);
}

/* ========= 响应式设计 ========= */
@media (max-width: 768px) {
    body {
		padding: 0;                  /* 与桌面一致 */
	}
	.container {
		margin: 1rem auto;
		width: calc(100% - 1rem);    /* 手机两侧各留 0.5rem */
		padding: 1rem;
		border-radius: 1rem;
	}
	.header {
		flex-direction: row;
		flex-wrap: nowrap;
		align-items: center;
		justify-content: space-between;
		gap: 0.5rem;
		padding: 0.75rem 1rem;       /* 移动端更紧凑，仍全宽 */
	}
    .logo {
        text-align: left;
        flex: 0 1 auto;
        min-width: 0;
    }
    .logo h1 {
        font-size: 1.3rem;              /* 适当缩小标题 */
        white-space: nowrap;
    }
    .logo p {
        display: none;                  /* 移动端隐藏副标题，节省空间 */
    }
    .nav-links {
        display: flex;
        align-items: center;
        gap: 0.4rem;
        flex-shrink: 0;                 /* 防止被压缩 */
    }
    .menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }
    .category-menu-wrapper {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        z-index: 100;
        margin: 0;
    }
    .software-card .card-content {
        padding: 1rem;
    }
    .software-name {
        font-size: 1.3rem;
    }
    .app-icon-wrapper {
        width: 66px;
        height: 66px;
    }
    .app-icon, .app-icon-fallback {
        border-radius: 0.8rem;
    }
	
    .detail-layout {
        flex-direction: column;
        gap: 1.5rem;
    }
    .main-content {
        flex: auto;
        width: 100%;
    }
    .sidebar {
        position: static; 
        top: auto;
        width: 100%;
    }
    .related-card {
        position: static;
        top: auto;
        margin-top: 0;
    }
    .info-card {
        padding: 1.2rem;
    }
    .software-name-large {
        font-size: 1.6rem;
    }
    .app-icon-large {
        font-size: 3rem;
        /* 移动端略微缩小圆角保持协调 */
        border-radius: 1rem;
    }
    .meta-info {
        gap: 0.6rem;
    }
    .full-description {
        font-size: 0.9rem;
    }
    
    .download-buttons-wrapper {
        flex-direction: column;
        align-items: center;
        gap: 0.8rem;
        width: 100%;
    }
    
    .download-btn {
        width: 100%;
        max-width: 220px;
        justify-content: center;
        padding: 0.7rem 1rem;
        font-size: 0.95rem;
    }
    
    .modal-content {
        width: 85%;
        padding: 1.5rem;
    }
    .modal-buttons {
        flex-direction: column;
        gap: 0.8rem;
    }
    .modal-buttons button {
        width: 100%;
        padding: 0.6rem;
    }
    .related-item {
        gap: 0.6rem;
        padding: 0.5rem;
    }
    .related-icon {
        font-size: 1.5rem;
        min-width: 2rem;
    }
    .related-name {
        font-size: 0.85rem;
    }
    .carousel-container img {
        max-width: 250px;
        height: 150px;
    }
    .version-header {
        font-size: 1rem;
    }
    .changelog-items {
        margin-left: 1rem;
    }
    
    .card-footer {
        padding: 0.8rem 1rem;
    }
    .card-footer .detail-link {
        font-size: 0.85rem;
    }
    /* 移动端相关推荐图标调整 */
    .related-icon img {
        width: 56px;
        height: 56px;
        border-radius: 0.8rem;
    }
}

/* 小折叠屏/极小屏 (<480px) */
@media (max-width: 480px) {
    .container {
        padding: 0.8rem;
    }
    .logo h1 {
        font-size: 1.5rem;
    }
    .software-name {
        font-size: 1.2rem;
    }
    .app-icon-wrapper {
        width: 56px;
        height: 56px;
    }
    .software-version {
        font-size: 0.7rem;
    }
    .card-footer {
        padding: 0.6rem 0.8rem;
    }
    .info-card {
        padding: 1rem;
    }
    .software-name-large {
        font-size: 1.4rem;
    }
    .app-icon-large {
        width: 80px;
        height: 80px;
        border-radius: 0.9rem;
    }
    .meta-info span {
        font-size: 0.75rem;
    }
    .full-description {
        font-size: 0.85rem;
        padding: 0.8rem;
    }
    .download-buttons-wrapper {
        gap: 0.7rem;
    }
    .download-btn {
        max-width: 180px;
        padding: 0.7rem 0.8rem;
        font-size: 0.85rem;
    }
    .carousel-container img {
        max-width: 200px;
        height: 130px;
    }
    .related-card {
        padding: 1rem;
    }
    .footer {
        font-size: 0.7rem;
        margin-top: 2rem;
    }
    .back-to-top {
        bottom: 20px;
        right: 15px;
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
    .related-icon img {
        width: 48px;
        height: 48px;
        border-radius: 0.7rem;
    }
    .category-item {
                padding: 0.35rem 0.9rem;
                font-size: 0.75rem;
            }
    .category-menu {
                gap: 0.5rem;
            }
}

/* 平板设备优化 (769px - 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
    .software-grid {
        gap: 1.2rem;
    }
    .detail-layout {
        gap: 1.5rem;
    }
    .sidebar {
        min-width: 200px;
    }
    .carousel-container img {
        max-width: 280px;
        height: 160px;
    }
}

/* 触摸优化 */
button, 
.related-item,
.modal-buttons button {
    cursor: pointer;
    touch-action: manipulation;
}

/* 移动端点击反馈 */
@media (max-width: 768px) {
    .software-card:active,
    .related-item:active,
    button:active {
        transform: scale(0.97);
        transition: transform 0.05s;
    }
}

/* 滚动条美化 */
.carousel-container {
    scrollbar-width: thin;                 /* Firefox 滚动条宽度 */
    scrollbar-color: var(--primary) var(--border); /* Firefox 滚动条颜色 */
}
.carousel-container::-webkit-scrollbar {
    height: 6px;
}
.carousel-container::-webkit-scrollbar-track {
    background: var(--border);
    border-radius: 4px;
}
.carousel-container::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 4px;
}
.carousel-container::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* 桌面下载按钮更大气 */
@media (min-width: 769px) {
    .download-buttons-wrapper {
        justify-content: center;
        gap: 1.5rem;
    }
    .download-btn {
        min-width: 180px;
        padding: 0.8rem 1.5rem;
        font-size: 1rem;
    }
}

@media (max-width: 768px) {
    .info-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .info-header-text {
        width: 100%;
    }
    
    .app-icon-large {
        width: 100px;
        height: 100px;
    }
}

/* 软件名称链接样式 */
.software-name-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.software-name {
    display: inline-block;   /* 关键：让宽度由内容决定 */
    position: relative;      /* 为伪元素定位 */
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 0.2rem;
    word-break: break-word;
}

/* 下划线伪元素（从左向右动画） */
.software-name::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -2px;           /* 下划线距离文字底部 */
    width: 0;
    height: 2px;
    background: var(--primary-dark);
    transition: width 0.3s ease-in-out;
}

/* 悬停时下划线展开至 100% */
.software-name-link:hover .software-name::after {
    width: 100%;
}


.software-name-link .software-name {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 0.2rem;
    word-break: break-word;
    color: inherit;
}
.software-name-link .software-name:hover {
    text-decoration: none;
}

/* 无结果提示 - 完美居中 */
.no-result-wrapper {
    grid-column: 1 / -1;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    min-height: 220px;
}

.no-result-card {
    text-align: center;
    padding: 2rem 2rem;
    background: var(--card-bg);
    border-radius: 1.5rem;
    box-shadow: var(--card-shadow);
    max-width: 550px;
    width: 90%;
    color: var(--text-light);
    font-size: 1rem;
    transition: all 0.2s ease;
}

.no-result-card .no-result-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    display: block;
}

.no-result-card .no-result-text {
    margin-bottom: 0.5rem;
    color: var(--text);
    font-weight: 500;
}

.no-result-card .no-result-hint {
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

.no-result-card .clear-search-link {
    color: var(--primary);
    text-decoration: underline;
    cursor: pointer;
    font-weight: 500;
    display: inline-block;
    margin-top: 1rem;
}

.no-result-card .clear-search-link:hover {
    color: var(--primary-dark);
}

@media (max-width: 768px) {
    .no-result-card {
        padding: 2rem 1.5rem;
        max-width: 90%;
    }
    .no-result-card .no-result-icon {
        font-size: 3rem;
    }
}

/* 图片灯箱 Lightbox 样式 */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.92);
    z-index: 10000;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    backdrop-filter: blur(4px);
    transition: opacity 0.25s ease;
    opacity: 0;
}
.lightbox.show {
    display: flex;
    opacity: 1;
}
.lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    text-align: center;
    cursor: default;
    animation: lightboxFadeIn 0.2s ease-out;
	display: flex; 
    justify-content: center; 
    align-items: center; 
}
@keyframes lightboxFadeIn {
    from {
        transform: scale(0.96);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}
.lightbox-img {
    max-width: 90vw;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 16px;
    box-shadow: 0 20px 35px rgba(0, 0, 0, 0.4);
    background: #1e1e2f;
    border: 1px solid rgba(255,255,255,0.2);
}
.lightbox-close {
    position: absolute;
    top: -48px;
    right: -12px;
    width: 44px;
    height: 44px;
    background: rgba(30,30,40,0.85);
    backdrop-filter: blur(8px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 400;
    color: white;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid rgba(255,255,255,0.25);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    font-family: system-ui, -apple-system;
    line-height: 1;
}
.lightbox-close:hover {
    background: #ff4d4d;
    transform: scale(1.05);
    border-color: rgba(255,255,255,0.5);
}
@media (max-width: 768px) {
    .lightbox-close {
        top: -40px;
        right: -8px;
        width: 38px;
        height: 38px;
        font-size: 24px;
    }
    .lightbox-img {
        max-height: 80vh;
    }
}
.carousel-container img {
    cursor: pointer;
    transition: transform 0.15s, opacity 0.2s;
}
.carousel-container img:active {
    transform: scale(0.98);
}

/* 分类菜单栏样式 - 完美融入现有设计系统 */
.category-menu-wrapper {
            margin: 0 0 1.25rem 0;
            position: relative;
        }
.category-menu {
            display: flex;
            flex-wrap: wrap;
            gap: 0.65rem;
            align-items: center;
            padding: 0.25rem 0 0.5rem 0;
            border-bottom: 1px solid var(--border);
            transition: all 0.2s ease;
        }
.category-item {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            padding: 0.45rem 1.2rem;
            background: var(--border);
            border-radius: 2.5rem;
			border: none;
            font-size: 0.85rem;
			font: inherit;
            font-weight: 500;
            color: var(--text);
            cursor: pointer;
            transition: all 0.2s cubic-bezier(0.2, 0.9, 0.4, 1.1);
            text-decoration: none;
            user-select: none;
            backdrop-filter: blur(2px);
            letter-spacing: 0.3px;
            white-space: nowrap;
        }
/* 分类菜单禁用状态 */
.category-item.disabled {
    opacity: 0.5;
    pointer-events: none;
    cursor: default;
    background: var(--border);
    color: var(--text-light);
}
.category-item:hover {
            background: var(--primary);
            color: white;
            transform: translateY(-1px);
            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
        }
.category-item.active {
            background: var(--primary);
            color: white;
            box-shadow: 0 2px 6px rgba(59,130,246,0.25);
            font-weight: 500;
        }
/* 移动端体验优化：横向滑动 + 紧凑 */
@media (max-width: 768px) {
    .category-menu-wrapper {
                margin-bottom: 1rem;
                position: relative;
            }
    .category-menu {
                flex-wrap: nowrap;
                overflow-x: auto;
                overflow-y: hidden;
                gap: 0.6rem;
                padding-bottom: 0.8rem;
                margin-bottom: 0;
                scrollbar-width: thin;
                -webkit-overflow-scrolling: touch;
                scroll-behavior: smooth;
            }
    .category-item {
                flex-shrink: 0;
                padding: 0.4rem 1rem;
                font-size: 0.8rem;
                white-space: nowrap;
            }
    /* 隐藏滚动条但保留功能 (美观) */
    .category-menu::-webkit-scrollbar {
                height: 3px;
            }
    .category-menu::-webkit-scrollbar-track {
                background: var(--border);
                border-radius: 10px;
            }
    .category-menu::-webkit-scrollbar-thumb {
                background: var(--primary);
                border-radius: 10px;
            }
}

/* 平板横向舒适间距 */
@media (min-width: 769px) and (max-width: 1024px) {
    .category-item {
                padding: 0.5rem 1.3rem;
                font-size: 0.85rem;
            }
}

/* 无结果时菜单仍保持可见，不受影响 */
.no-result-wrapper {
            grid-column: 1 / -1;
        }


/* ---------- 汉堡菜单按钮样式 ---------- */
.menu-toggle {
    display: none;          /* 默认隐藏（桌面/平板不显示） */
    background: transparent;
    border: none;
    width: 44px;
    height: 44px;
    padding: 0;
    cursor: pointer;
    position: relative;
    border-radius: 8px;
    transition: background 0.2s;
    color: var(--text);
}
.menu-toggle:hover {
    background: var(--border);
}
.menu-icon {
    position: relative;
    display: block;
    width: 24px;
    height: 2px;
    background: currentColor;
    margin: 0 auto;
    transition: background 0.2s;
}
.menu-icon::before,
.menu-icon::after {
    content: '';
    position: absolute;
    left: 0;
    width: 100%;
    height: 2px;
    background: currentColor;
    transition: transform 0.3s, top 0.3s;
}
.menu-icon::before {
    top: -8px;
}
.menu-icon::after {
    top: 8px;
}
/* 激活状态（展开时变为关闭图标） */
.menu-toggle.active .menu-icon {
    background: transparent;
}
.menu-toggle.active .menu-icon::before {
    top: 0;
    transform: rotate(45deg);
}
.menu-toggle.active .menu-icon::after {
    top: 0;
    transform: rotate(-45deg);
}

/* 移动端适配 */
@media (max-width: 768px) {
    /* 显示汉堡按钮 */
    .menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }
    /* 调整导航链接区域布局 */
    .nav-links {
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }
    /* 分类菜单包装器：默认隐藏，展开时显示（下拉式） */
    .category-menu-wrapper {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--card-bg);
        box-shadow: 0 10px 25px rgba(0,0,0,0.1);
        border-radius: 0 0 1.5rem 1.5rem;
        padding: 0.8rem 1rem;
        margin: 0;
        z-index: 100;
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: transform 0.3s ease, opacity 0.2s, visibility 0.2s;
        border-top: 1px solid var(--border);
    }
    .category-menu-wrapper.show {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }
    /* 菜单内部横向滚动可改为纵向换行，更易点选 */
    .category-menu {
        flex-wrap: wrap;
        overflow-x: visible;
        padding-bottom: 0;
        border-bottom: none;
    }
    .category-item {
        flex: 0 0 auto;
        white-space: nowrap;
    }
    /* header 已由 sticky 提供定位上下文，菜单绝对定位依旧生效 */
    .header {
        flex-wrap: wrap;
    }
}

/* ===== 新增：加载更多提示 #loading ===== */
#loading {
    text-align: center;
    padding: 12px 10px;
    color: var(--text-light);
    font-size: 0.9rem;
    margin: 0.5rem 0;
    transition: opacity 0.3s;
    clear: both;
}

.description-content {
    max-height: 310px;           /* 默认最大高度 */
    overflow: hidden;
    transition: max-height 0.4s ease;
    position: relative;
}

.description-content.expanded {
    max-height: none;           /* 展开后取消高度限制 */
}

.desc-toggle {
    display: none;              /* 默认隐藏，由 JS 控制显示 */
    margin-top: 0.8rem;
    background: transparent;
    border: 1px solid var(--primary);
    color: var(--primary);
    padding: 0.3rem 1.2rem;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.2s, color 0.2s;
}

.desc-toggle:hover {
    background: var(--primary);
    color: #fff;
}

.desc-toggle.show {
    display: inline-block;
}


/* ===== 页脚链接样式（与 detail-link 效果一致） ===== */
.footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem 1.2rem;
    margin-bottom: 0.5rem;
}

.footer-link-item {
    display: inline-block;
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    position: relative;
    transition: color 0.2s ease;
    padding: 0.1rem 0;
}

/* 下划线从左向右展开动画（与 detail-link 完全一致） */
.footer-link-item::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -2px;
    width: 0;
    height: 2px;
    background: var(--primary-dark);
    transition: width 0.3s ease-in-out;
}

.footer-link-item:hover {
    color: var(--primary-dark);
}

.footer-link-item:hover::after {
    width: 100%;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .footer-links {
        gap: 0.4rem 0.8rem;
    }
    .footer-link-item {
        font-size: 0.8rem;
    }
}