/**
 * 软件下载站 - 前端样式
 */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
    background: #f5f7fa;
    color: #333;
    line-height: 1.6;
}
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
a { color: #1a56db; text-decoration: none; }
a:hover { color: #2563eb; }

/* 公告栏 */
.announcement-bar {
    background: #fff7e6;
    border-bottom: 1px solid #ffd591;
    padding: 10px 20px;
    font-size: 14px;
    color: #ad6800;
    text-align: center;
}

/* 导航栏 */
.navbar {
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    position: sticky;
    top: 0;
    z-index: 100;
}
.navbar-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.navbar-brand {
    font-size: 20px;
    font-weight: 600;
    color: #1a56db;
}
.navbar-nav {
    display: flex;
    gap: 24px;
}
.navbar-nav a {
    font-size: 15px;
    color: #555;
    padding: 4px 0;
    border-bottom: 2px solid transparent;
    transition: all 0.3s;
}
.navbar-nav a:hover, .navbar-nav a.active {
    color: #1a56db;
    border-bottom-color: #1a56db;
}
.navbar-search {
    position: relative;
    display: flex;
    align-items: center;
    flex: 0 0 280px;
}
.navbar-search input {
    width: 100%;
    padding: 8px 32px 8px 12px;
    border: 1px solid #d9d9d9;
    border-radius: 20px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.3s;
}
.navbar-search input:focus {
    border-color: #1a56db;
}
.search-icon {
    position: absolute;
    right: 10px;
    color: #999;
    cursor: pointer;
}
.search-toggle-btn {
    display: none;
    background: none;
    border: none;
    color: #555;
    cursor: pointer;
    padding: 4px;
}

/* 分类标签栏 */
.category-bar {
    margin: 20px 0;
    overflow-x: auto;
    white-space: nowrap;
    padding-bottom: 8px;
}
.category-bar-inner {
    display: inline-flex;
    gap: 10px;
}
.category-bar button, .category-btn {
    padding: 6px 16px;
    border: 1px solid #d9d9d9;
    border-radius: 20px;
    background: #fff;
    font-size: 14px;
    color: #555;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
}
.category-bar button:hover, .category-bar button.active,
.category-btn:hover, .category-btn.active {
    background: #1a56db;
    color: #fff;
    border-color: #1a56db;
}

/* 主内容区 */
.main-content {
    margin-top: 20px;
}

/* 软件卡片列表 */
.software-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 20px;
}
.software-card {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    transition: box-shadow 0.3s;
}
.software-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.software-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}
.software-icon {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    background: #eef2ff;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #1a56db;
    font-size: 24px;
    flex-shrink: 0;
}
.software-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}
.software-name {
    font-size: 16px;
    font-weight: 600;
    color: #333;
}
.version-tag {
    font-size: 12px;
    color: #64748b;
    background: #f1f5f9;
    padding: 1px 6px;
    border-radius: 4px;
    margin-left: 8px;
}
.software-meta {
    display: flex;
    gap: 12px;
    font-size: 13px;
    color: #94a3b8;
    margin-bottom: 8px;
}
.software-desc {
    font-size: 14px;
    color: #64748b;
    margin-bottom: 12px;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.software-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* 文档卡片列表 */
.document-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 20px;
}
.document-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    transition: box-shadow 0.3s;
}
.document-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.document-cover {
    width: 100%;
    height: 180px;
    background: #eef2ff;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #1a56db;
    font-size: 48px;
}
.document-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.document-info {
    padding: 16px;
}
.document-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
}
.document-title a {
    color: #333;
}
.document-title a:hover {
    color: #1a56db;
}
.document-summary {
    font-size: 14px;
    color: #64748b;
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.document-meta {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: #94a3b8;
}

/* 按钮 */
.btn {
    padding: 8px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
.btn-primary {
    background: #1a56db;
    color: #fff;
}
.btn-primary:hover:not(:disabled) {
    background: #2563eb;
}
.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}
.btn-secondary {
    background: #f1f5f9;
    color: #64748b;
}
.btn-secondary:hover {
    background: #e2e8f0;
}
.btn-outline {
    background: #fff;
    color: #1a56db;
    border: 1px solid #d9d9d9;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
.btn-outline:hover {
    border-color: #1a56db;
    color: #1a56db;
    background: #f8fafc;
}
.btn-sm {
    padding: 4px 12px;
    font-size: 13px;
}

/* 弹窗 */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}
.modal-overlay.show {
    display: flex;
}
.modal {
    background: #fff;
    border-radius: 12px;
    width: 90%;
    max-width: 480px;
    overflow: hidden;
    animation: modalIn 0.2s ease;
}
@keyframes modalIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}
.modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.modal-title {
    font-size: 18px;
    font-weight: 600;
}
.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #94a3b8;
    cursor: pointer;
    line-height: 1;
}
.modal-close:hover {
    color: #64748b;
}
.modal-body {
    padding: 24px 20px;
}
.modal-footer {
    padding: 16px 20px;
    border-top: 1px solid #f1f5f9;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

/* 下载信息 */
.download-info {
    margin-bottom: 16px;
}
.download-info-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #f1f5f9;
}
.download-info-row:last-child {
    border-bottom: none;
}
.download-info-label {
    font-size: 14px;
    color: #64748b;
}
.download-info-value {
    font-size: 14px;
    font-weight: 500;
    color: #333;
}
.md5-value {
    font-family: Consolas, monospace;
    font-size: 13px;
    color: #1a56db;
}

/* 加载状态 */
.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
}
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #f1f5f9;
    border-top-color: #1a56db;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}
.loading-text {
    margin-top: 12px;
    color: #94a3b8;
    font-size: 14px;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}
.empty-state-icon {
    font-size: 64px;
    color: #cbd5e1;
    margin-bottom: 16px;
}
.empty-state-title {
    font-size: 18px;
    color: #64748b;
    margin-bottom: 8px;
}
.empty-state-desc {
    font-size: 14px;
    color: #94a3b8;
}

/* Toast */
.toast-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.toast {
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    min-width: 280px;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: toastIn 0.3s ease;
}
@keyframes toastIn {
    from { opacity: 0; transform: translateX(100%); }
    to { opacity: 1; transform: translateX(0); }
}
.toast.removing {
    animation: toastOut 0.3s ease;
}
@keyframes toastOut {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(100%); }
}
.toast-success {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}
.toast-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}
.toast-warning {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
}
.toast-icon {
    width: 18px;
    height: 18px;
}

/* 分页 */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 30px;
}
.pagination-btn {
    padding: 6px 14px;
    border: 1px solid #d9d9d9;
    border-radius: 6px;
    background: #fff;
    font-size: 14px;
    color: #64748b;
    cursor: pointer;
    transition: all 0.3s;
}
.pagination-btn:hover:not(:disabled) {
    border-color: #1a56db;
    color: #1a56db;
}
.pagination-btn.active {
    background: #1a56db;
    color: #fff;
    border-color: #1a56db;
}
.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.pagination-info {
    font-size: 14px;
    color: #94a3b8;
    margin: 0 8px;
}

/* 页脚 */
.site-footer {
    background: #fff;
    margin-top: 40px;
    padding: 24px 0;
    text-align: center;
    color: #94a3b8;
    font-size: 14px;
    border-top: 1px solid #f1f5f9;
}
.footer-notice {
    margin-top: 8px;
    font-size: 13px;
    color: #64748b;
}

/* 文档详情页 */
.doc-detail {
    max-width: 820px;
    margin: 30px auto;
    padding: 0 20px;
}
.doc-detail-header {
    text-align: center;
    padding: 40px 0 32px;
    border-bottom: 1px solid #f1f5f9;
    margin-bottom: 32px;
}
.doc-detail-title {
    font-size: 28px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 16px;
    line-height: 1.4;
}
.doc-detail-meta {
    display: flex;
    justify-content: center;
    gap: 24px;
    font-size: 14px;
    color: #94a3b8;
}
.doc-detail-meta svg {
    vertical-align: -2px;
    margin-right: 4px;
}
.doc-detail-body {
    font-size: 16px;
    line-height: 1.8;
    color: #334155;
    word-break: break-word;
}
.doc-detail-body h1 {
    font-size: 24px;
    font-weight: 700;
    color: #1e293b;
    margin: 40px 0 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f1f5f9;
}
.doc-detail-body h2 {
    font-size: 20px;
    font-weight: 700;
    color: #1e293b;
    margin: 32px 0 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #f1f5f9;
}
.doc-detail-body h3 {
    font-size: 18px;
    font-weight: 600;
    color: #334155;
    margin: 24px 0 10px;
}
.doc-detail-body h4 {
    font-size: 16px;
    font-weight: 600;
    color: #475569;
    margin: 20px 0 8px;
}
.doc-detail-body p {
    margin-bottom: 16px;
    text-align: justify;
}
.doc-detail-body ul, .doc-detail-body ol {
    padding-left: 24px;
    margin-bottom: 16px;
}
.doc-detail-body li {
    margin-bottom: 8px;
    line-height: 1.7;
}
.doc-detail-body blockquote {
    border-left: 4px solid #1a56db;
    padding: 16px 20px;
    background: #f8fafc;
    margin: 24px 0;
    color: #475569;
    border-radius: 0 8px 8px 0;
}
.doc-detail-body blockquote p {
    margin-bottom: 8px;
}
.doc-detail-body pre {
    background: #1e293b;
    color: #e2e8f0;
    padding: 20px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 24px 0;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 14px;
    line-height: 1.6;
}
.doc-detail-body code {
    background: #f1f5f9;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 14px;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    color: #e11d48;
}
.doc-detail-body pre code {
    background: none;
    padding: 0;
    color: inherit;
}
.doc-detail-body img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 20px 0;
    display: block;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.doc-detail-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 24px 0;
    font-size: 14px;
}
.doc-detail-body th, .doc-detail-body td {
    border: 1px solid #e2e8f0;
    padding: 12px 16px;
    text-align: left;
}
.doc-detail-body th {
    background: #f8fafc;
    font-weight: 600;
    color: #475569;
}
.doc-detail-body tr:hover {
    background: #f8fafc;
}
.doc-detail-body a {
    color: #1a56db;
    text-decoration: none;
    border-bottom: 1px solid #93c5fd;
}
.doc-detail-body a:hover {
    color: #2563eb;
    border-bottom-color: #2563eb;
}
.doc-detail-body hr {
    border: none;
    height: 1px;
    background: #e2e8f0;
    margin: 32px 0;
}
.doc-detail-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #1a56db;
    font-size: 14px;
    margin-top: 40px;
    padding: 12px 24px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    transition: all 0.3s;
}
.doc-detail-back:hover {
    background: #f8fafc;
}

/* 视频容器 - 16:9固定比例 */
.video-container {
    position: relative;
    width: 100%;
    max-width: 100%;
    aspect-ratio: 16 / 9;
    margin: 24px 0;
    border-radius: 8px;
    overflow: hidden;
    background: #000;
}
.video-container video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* 404页面 */
.page-404 {
    text-align: center;
    padding: 80px 20px;
}
.page-404 h1 {
    font-size: 72px;
    color: #cbd5e1;
    margin-bottom: 16px;
}
.page-404 p {
    font-size: 16px;
    color: #64748b;
    margin-bottom: 24px;
}

/* 软件详情页 */
.detail-page {
    max-width: 800px;
    margin: 30px auto;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    padding: 32px;
}
.detail-header {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid #f1f5f9;
}
.detail-icon {
    width: 72px;
    height: 72px;
    border-radius: 12px;
    background: #eef2ff;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #1a56db;
    font-size: 32px;
    font-weight: 700;
    flex-shrink: 0;
}
.detail-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px;
}
.detail-title {
    font-size: 24px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 8px;
}
.detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 14px;
    color: #94a3b8;
}
.detail-version {
    background: #f1f5f9;
    padding: 2px 8px;
    border-radius: 4px;
    color: #64748b;
}
.detail-category {
    background: #eef2ff;
    padding: 2px 8px;
    border-radius: 4px;
    color: #1a56db;
}
.detail-desc {
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid #f1f5f9;
}
.detail-desc h3 {
    font-size: 16px;
    font-weight: 600;
    color: #334155;
    margin-bottom: 12px;
}
.detail-desc p {
    font-size: 15px;
    line-height: 1.8;
    color: #64748b;
}
.detail-download-section {
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid #f1f5f9;
}
.detail-download-section h3 {
    font-size: 16px;
    font-weight: 600;
    color: #334155;
    margin-bottom: 16px;
}
.detail-file-info {
    background: #f8fafc;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 20px;
}
.detail-file-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #f1f5f9;
    font-size: 14px;
}
.detail-file-row:last-child {
    border-bottom: none;
}
.detail-file-label {
    color: #94a3b8;
}
.detail-file-value {
    color: #334155;
    font-weight: 500;
}
.detail-file-value.md5-value {
    font-family: Consolas, monospace;
    font-size: 13px;
    color: #1a56db;
}
.detail-download-btn {
    text-align: center;
}
.btn-lg {
    padding: 12px 40px;
    font-size: 16px;
    border-radius: 8px;
}
.detail-download-hint {
    margin-top: 12px;
    font-size: 13px;
    color: #94a3b8;
}
.detail-back {
    text-align: center;
}
.detail-back a {
    color: #1a56db;
    font-size: 15px;
}
.detail-back a:hover {
    text-decoration: underline;
}

/* 响应式 */
@media (max-width: 768px) {
    .navbar-inner {
        flex-wrap: wrap;
        height: auto;
        padding: 10px 16px;
        gap: 10px;
    }
    .navbar-search {
        order: 3;
        flex: 1;
        width: 100%;
    }
    .navbar-nav {
        gap: 16px;
    }
    .search-toggle-btn {
        display: block;
    }
    #search-box {
        display: none;
    }
    #search-box.show {
        display: flex;
        order: 3;
        flex: 1;
        width: 100%;
    }
    .category-bar-inner {
        gap: 8px;
    }
    .category-bar button {
        padding: 5px 12px;
        font-size: 13px;
    }
    .software-grid, .document-grid {
        grid-template-columns: 1fr;
    }
    .software-card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    .software-actions {
        width: 100%;
    }
    .btn {
        flex: 1;
    }
    .doc-detail-header, .doc-detail-body {
        padding: 20px 16px;
    }
    .doc-detail-title {
        font-size: 20px;
    }
    .doc-detail-meta {
        flex-wrap: wrap;
        gap: 12px;
    }
    .modal {
        width: 95%;
        max-width: none;
    }
    .toast-container {
        right: 10px;
        left: 10px;
    }
    .toast {
        min-width: auto;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .software-grid, .document-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
