/* 经典模板：最近更新 */
.headerBox,
.headerKox {
    display: none !important;
}

/* Page container（壳层 flex / 撑满视口见 theme.css） */
.latest-page-container {
    max-width: var(--layout-max);
    margin: 0 auto;
    padding: var(--layout-pad);
}

.latest-page-container > .filter-section {
    flex-shrink: 0;
}

/* Filter section */
.filter-section {
    background: var(--theme-surface);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
    border: 1px solid var(--theme-border);
}

.filter-section-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--theme-text);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-section-title::before {
    content: '';
    width: 4px;
    height: 18px;
    background: var(--theme-primary-gradient);
    border-radius: 2px;
}

.filter-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
}

.filter-row:last-child {
    margin-bottom: 0;
}

.filter-label {
    font-size: 13px;
    color: var(--theme-text-secondary);
    min-width: 60px;
    padding-top: 4px;
    flex-shrink: 0;
}

.filter-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    flex: 1;
}

.filter-option {
    padding: 4px 12px;
    border-radius: 14px;
    font-size: 13px;
    color: var(--theme-text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.filter-option:hover {
    color: var(--theme-primary);
    background: rgba(255, 107, 107, 0.1);
}

.filter-option.active {
    color: #fff;
    background: var(--theme-primary-gradient);
    border-color: transparent;
}

/* Content section */
.latest-content {
    background: var(--theme-surface);
    border-radius: 12px;
    padding: 20px;
    border: 1px solid var(--theme-border);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 280px;
}

.latest-content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--theme-border);
}

.latest-content-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--theme-text);
    display: flex;
    align-items: center;
    gap: 8px;
}

.latest-content-title i {
    color: var(--theme-primary);
    font-size: 20px;
}

.latest-total {
    font-size: 13px;
    color: var(--theme-text-secondary);
}

/* List styles */
.latest-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.latest-item {
    display: flex;
    align-items: center;
    padding: 16px;
    background: var(--theme-background);
    border-radius: 10px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.latest-item:hover {
    transform: translateX(4px);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.latest-item-number {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--theme-primary-gradient);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    border-radius: 8px;
    margin-right: 16px;
    flex-shrink: 0;
}

.latest-item-number.top {
    background: linear-gradient(135deg, #ff6b6b 0%, #ff8e53 100%);
}

.latest-item-info {
    flex: 1;
    min-width: 0;
}

.latest-item-title {
    font-size: 15px;
    font-weight: 500;
    color: var(--theme-text);
    margin-bottom: 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.latest-item-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 12px;
    color: var(--theme-text-secondary);
}

.latest-item-tag {
    padding: 2px 8px;
    background: rgba(255, 107, 107, 0.1);
    color: var(--theme-primary);
    border-radius: 4px;
    font-size: 11px;
}

.latest-item-time {
    display: flex;
    align-items: center;
    gap: 4px;
}

.latest-item-action {
    margin-left: 16px;
    flex-shrink: 0;
}

.latest-item-btn {
    padding: 6px 16px;
    background: var(--theme-primary-gradient);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.latest-item-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
}

/* Loading state */
.latest-loading {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 48px 20px;
    min-height: 180px;
}

/* Empty state */
.latest-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 48px 20px;
    min-height: 180px;
}

.latest-empty-icon {
    font-size: 40px;
    color: var(--theme-text-secondary);
    margin-bottom: 10px;
    opacity: 0.7;
}

.latest-empty-text {
    font-size: 14px;
    color: var(--theme-text-secondary);
}

/* Pagination */
.latest-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--theme-border);
}

.latest-page-btn {
    padding: 8px 20px;
    border: 1px solid var(--theme-border);
    background: var(--theme-surface);
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    color: var(--theme-text);
    transition: all 0.2s ease;
}

.latest-page-btn:hover:not(:disabled) {
    border-color: var(--theme-primary);
    color: var(--theme-primary);
}

.latest-page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.latest-page-info {
    font-size: 13px;
    color: var(--theme-text-secondary);
}

@media (max-width: 768px) {
    /* 页面容器 */
    .latest-page-container {
        padding: 12px;
    }

    /* 筛选区域 */
    .filter-section {
        padding: 12px 16px;
    }
    .filter-section-title {
        font-size: 14px;
        margin-bottom: 12px;
        padding-bottom: 10px;
        border-bottom: 1px solid var(--theme-border);
    }
    .filter-row {
        gap: 8px;
        overflow: hidden;
    }
    .filter-label {
        font-size: 11px;
        min-width: 32px;
        padding-top: 5px;
        flex-shrink: 0;
    }
    .filter-options {
        flex-wrap: nowrap;
        overflow-x: auto;
        gap: 6px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
        padding-bottom: 4px;
    }
    .filter-options::-webkit-scrollbar {
        display: none;
    }
    .filter-option {
        padding: 3px 8px;
        font-size: 11px;
        flex-shrink: 0;
    }

    /* 内容区域 */
    .latest-content {
        padding: 12px;
    }
    .latest-content-header {
        margin-bottom: 12px;
        padding-bottom: 10px;
    }
    .latest-content-title {
        font-size: 15px;
    }
    .latest-content-title i {
        font-size: 16px;
    }
    .latest-total {
        font-size: 11px;
    }

    /* 列表项 */
    .latest-item {
        padding: 10px 12px;
    }
    .latest-item-number {
        width: 26px;
        height: 26px;
        font-size: 11px;
        margin-right: 10px;
    }
    .latest-item-title {
        font-size: 13px;
        margin-bottom: 4px;
    }
    .latest-item-meta {
        gap: 8px;
        font-size: 11px;
    }
    .latest-item-tag {
        padding: 1px 6px;
        font-size: 10px;
    }
    .latest-item-btn {
        padding: 4px 10px;
        font-size: 11px;
    }

    /* 分页 */
    .latest-pagination {
        margin-top: 16px;
        padding-top: 16px;
        gap: 8px;
    }
    .latest-page-btn {
        padding: 6px 14px;
        font-size: 12px;
    }
    .latest-page-info {
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .latest-item {
        padding: 8px 10px;
    }
    .latest-item-number {
        width: 24px;
        height: 24px;
        font-size: 10px;
        margin-right: 8px;
    }
    .latest-item-title {
        font-size: 12px;
    }
    .latest-item-meta {
        font-size: 10px;
    }
    .latest-item-btn {
        padding: 3px 8px;
        font-size: 10px;
    }
}

/* 资源弹窗 */
.el-overlay-dialog:has(.resource-dialog) {
    display: flex !important;
    align-items: center;
    justify-content: center;
}
.resource-dialog {
    background: var(--theme-surface) !important;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    padding: 24px !important;
    box-sizing: border-box;
    margin: auto !important;
    height: auto !important;
    max-height: 90vh;
    align-self: center !important;
    flex: none !important;
}
@media (max-width: 768px) {
    .resource-dialog {
        width: 92vw !important;
        max-width: 400px;
    }
    .meta-label { flex-basis: 56px; font-size: 13px; }
    .meta-value, .meta-link { font-size: 13px; }
    .scan-tip { font-size: 12px; }
    .qrcode-wrapper .qrcode { width: 160px; height: 160px; }
    .dialog-actions { gap: 6px; }
    .dialog-actions .btn-primary,
    .dialog-actions .btn-secondary { padding: 9px 12px; font-size: 13px; }
}
.resource-dialog .el-dialog__header {
    margin: 0 0 16px !important;
    padding: 0 0 16px !important;
    border-bottom: 1px dashed var(--theme-border, #e5e7eb);
    background: transparent;
}
.resource-dialog .el-dialog__title {
    font-size: 17px;
    font-weight: 600;
    color: var(--theme-text);
    line-height: 1.3;
}
.resource-dialog.resource-dialog--loading .el-dialog__header {
    display: none !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
}
.resource-dialog .el-dialog__body {
    padding: 0 !important;
    flex: none !important;
    height: auto !important;
}
.resource-dialog-content {
    padding: 0 !important;
    height: auto !important;
    min-height: 0;
}
.loading-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 28px 8px;
    text-align: center;
}
.loading-spinner {
    position: relative;
    width: 60px;
    height: 60px;
}
.spinner-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 3px solid transparent;
    border-top-color: var(--theme-primary);
    animation: spin 1.2s linear infinite;
}
.spinner-ring:nth-child(1) {
    width: 100%;
    height: 100%;
    animation-duration: 1.2s;
}
.spinner-ring:nth-child(2) {
    width: 75%;
    height: 75%;
    top: 12.5%;
    left: 12.5%;
    animation-duration: 0.9s;
    animation-direction: reverse;
    border-top-color: var(--theme-primary-light, #7c9aff);
}
.spinner-ring:nth-child(3) {
    width: 50%;
    height: 50%;
    top: 25%;
    left: 25%;
    animation-duration: 0.6s;
    border-top-color: var(--theme-primary-dark, #4a6cf7);
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
.loading-text {
    font-size: 15px;
    font-weight: 600;
    color: var(--theme-text);
}
.loading-subtext {
    font-size: 13px;
    color: var(--theme-text-secondary);
}
.expire-tip {
    margin: 0 0 16px;
    padding: 10px 12px;
    border-radius: 8px;
    background: rgba(255, 107, 107, 0.08);
    color: #ff6b6b;
    font-size: 13px;
    font-weight: 500;
    text-align: center;
    line-height: 1.5;
}
.resource-meta {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.meta-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 14px;
    line-height: 1.5;
}
.meta-label {
    flex: 0 0 64px;
    color: var(--theme-text-secondary);
}
.meta-value,
.meta-link {
    flex: 1;
    min-width: 0;
    word-break: break-all;
}
.meta-value { color: var(--theme-text); }
.meta-link {
    color: var(--theme-primary, #409eff);
    text-decoration: none;
}
.meta-link:hover { text-decoration: underline; }
.resource-divider {
    margin: 18px 0 16px;
    border: none;
    border-top: 1px dashed var(--theme-border, #e5e7eb);
}
.scan-tip {
    text-align: center;
    font-size: 13px;
    color: var(--theme-text-secondary);
    margin-bottom: 14px;
    line-height: 1.5;
}
.scan-tip .pan-name {
    color: var(--theme-primary);
    font-weight: 500;
}
.qrcode-wrapper {
    display: flex;
    justify-content: center;
    margin-bottom: 16px;
}
.qrcode-wrapper .qrcode {
    width: 180px;
    height: 180px;
    padding: 8px;
    background: #fff;
    border: 1px solid var(--theme-border);
    border-radius: 8px;
    box-sizing: border-box;
}
.qrcode-wrapper .qrcode canvas {
    width: 100%;
    height: 100%;
    display: block;
}
.scan-desc-box {
    padding: 12px 14px;
    margin-bottom: 18px;
    border-radius: 8px;
    background: var(--theme-background, #f5f7fa);
    color: var(--theme-text-secondary);
    font-size: 12px;
    line-height: 1.55;
}
.scan-desc-box .scan-desc { margin: 0; }
.dialog-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}
.dialog-actions .btn-primary,
.dialog-actions .btn-secondary {
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    white-space: nowrap;
}
.dialog-actions .btn-primary {
    flex: 1;
    min-width: 0;
    padding: 10px 16px;
    background: var(--theme-primary, #409eff);
    color: #fff;
    border: none;
    font-weight: 500;
    transition: filter 0.2s ease;
}
.dialog-actions .btn-primary:hover { filter: brightness(1.08); }
.dialog-actions .btn-secondary {
    flex: 0 0 auto;
    background: var(--theme-surface);
    color: var(--theme-text);
    border: 1px solid var(--theme-border);
    transition: background 0.2s ease;
}
.dialog-actions .btn-secondary:hover {
    background: var(--theme-background, #f5f7fa);
}
.dialog-actions .btn-secondary.btn-block {
    flex: 1;
}
.error-content {
    text-align: center;
    padding: 8px 0 0;
}
.error-message {
    font-size: 14px;
    color: var(--theme-text-secondary);
    margin-bottom: 16px;
}
