/* ========== 基础样式 ========== */
.nav-item-active {
    background-color: white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.post-card {
    background-color: white;
    border-radius: 1rem;
    padding: 0.5rem 1rem;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    transition: all 0.3s;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}
.post-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
@media (min-width: 768px) {
    .post-card {
        padding: 0.75rem 1.5rem;
    }
}
.text-primary {
    color: #165DFF;
}

/* 轮播容器（仅作为 flex 容器，过渡由 #banner-carousel 控制） */
.carousel-slide {
    min-width: 100%;
    height: 100%;
}

.nav-badge {
    position: absolute;
    top: -0.25rem;
    right: -0.25rem;
    min-width: 18px;
    height: 18px;
    background-color: #ef4444;
    color: white;
    font-size: 10px;
    font-weight: bold;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    z-index: 10;
}
.page-btn {
    padding: 0.25rem 0.75rem;
    border-radius: 0.25rem;
    border: 1px solid #d1d5db;
    font-size: 0.875rem;
    background-color: white;
    cursor: pointer;
}
.page-btn:hover:not(:disabled) {
    background-color: #f3f4f6;
}
.page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.nav-container {
    overflow-x: auto;
    display: flex;
    gap: 0.25rem;
    padding: 0.25rem;
    border-radius: 9999px;
    background-color: #f3f4f6;
    max-width: 672px;
    margin: 0 auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.nav-container::-webkit-scrollbar {
    display: none;
}
/* 默认圆点样式（会被右下角样式覆盖，保留以备不时之需） */
.dot-item {
    width: 8px;
    height: 8px;
    border-radius: 9999px;
    background-color: rgba(255,255,255,0.5);
    transition: all 0.3s;
}
.dot-item.active {
    background-color: white;
    transform: scale(1.1);
}
.back-btn {
    width: 32px;
    height: 32px;
    border-radius: 9999px;
    background-color: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #4b5563;
    cursor: pointer;
}
.back-btn:hover {
    background-color: #e5e7eb;
}

/* ========== 下载弹窗样式 ========== */
.download-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.6);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.download-modal {
    background: white;
    border-radius: 16px;
    max-width: 500px;
    width: 100%;
    position: relative;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    overflow: hidden;
}
.download-header {
    padding: 20px 24px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 16px;
}
.download-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    flex-shrink: 0;
    background: linear-gradient(135deg, #64748b, #94a3b8);
    color: white;
}
.download-title {
    font-size: 17px;
    font-weight: 600;
    color: #1e293b;
}
.download-source {
    font-size: 18px;
    font-weight: 600;
    color: #3B82F6;
}
.download-body {
    padding: 24px;
}
.download-url-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 20px;
}
.download-url-text {
    font-size: 13px;
    word-break: break-all;
    font-family: monospace;
    background: white;
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
}
.download-actions {
    display: flex;
    gap: 12px;
}
.download-btn-copy {
    flex: 1;
    padding: 12px 20px;
    background: #3B82F6;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}
.download-btn-copy.copied {
    background: #00b42a;
}
.download-btn-cancel {
    padding: 12px 20px;
    background: #f1f5f9;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}
.download-tips {
    margin-top: 16px;
    padding: 12px;
    background: #fffbeb;
    border-radius: 8px;
}
.download-tips p {
    margin: 0;
    font-size: 12px;
    color: #92400e;
}

/* ========== 弹窗公告样式 ========== */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.6);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.popup-modal {
    background: white;
    border-radius: 12px;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 35px rgba(0,0,0,0.2);
}
.popup-header {
    padding: 20px;
    border-bottom: 1px solid #e2e8f0;
}
.popup-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}
.popup-title i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: #3b82f6;
    color: white;
    border-radius: 8px;
    font-size: 18px;
    margin-right: 12px;
    vertical-align: middle;
}
.popup-body {
    padding: 20px;
}
.popup-image {
    width: 100%;
    border-radius: 8px;
    margin-bottom: 16px;
}
.popup-content {
    line-height: 1.8;
    color: #334155;
}
.popup-footer {
    padding: 16px 20px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
}
.popup-footer label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 13px;
}
.popup-footer button {
    background: #3b82f6;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 8px;
    cursor: pointer;
}
.popup-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    border: none;
    background: #f1f5f9;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ========== Toast 提示 ========== */
.toast-message {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 10px 20px;
    border-radius: 30px;
    font-size: 14px;
    z-index: 10001;
    white-space: nowrap;
}
@media (max-width: 640px) {
    .toast-message {
        white-space: normal;
        max-width: 90%;
        text-align: center;
    }
}

/* ========== 主题切换按钮 ========== */
#theme-toggle-btn {
    position: fixed;
    right: 16px;
    bottom: 120px;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: rgba(55, 65, 81, 0.25);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    cursor: pointer;
    z-index: 9998;
    transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
}
#theme-toggle-btn:hover {
    transform: scale(1.08);
    background: rgba(55, 65, 81, 0.25);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.2);
}
#theme-toggle-btn:active {
    transform: scale(0.96);
}

/* ========== 暗色模式样式 ========== */
html.dark {
    color-scheme: dark;
}
html.dark body {
    background-color: #0f172a !important;
    color: #e2e8f0 !important;
}
html.dark .bg-gray-100 {
    background-color: #1e293b !important;
}
html.dark .bg-gray-100 input {
    color: #f1f5f9 !important;
}
html.dark .bg-gray-100 input::placeholder {
    color: #64748b !important;
}
html.dark .fa-magnifying-glass {
    color: #94a3b8 !important;
}
html.dark .nav-container {
    background-color: #1e293b !important;
}
html.dark nav button {
    color: #94a3b8 !important;
}
html.dark .nav-item-active {
    background-color: #334155 !important;
    color: #f1f5f9 !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3) !important;
}
html.dark nav button:not(.nav-item-active):hover {
    background-color: rgba(255,255,255,0.1) !important;
}
html.dark .post-card {
    background-color: #1e293b !important;
    border: 1px solid #334155 !important;
}
html.dark .post-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.5) !important;
}
html.dark .post-card h3,
html.dark .post-card .text-gray-800,
html.dark .post-card .font-medium {
    color: #f1f5f9 !important;
}
html.dark .post-card .text-primary {
    color: #60a5fa !important;
}
html.dark .post-card .fa-file-pdf {
    color: #f87171 !important;
}
html.dark .post-card .fa-bell {
    color: #60a5fa !important;
}
html.dark .bg-blue-50 {
    background-color: #1e3a5f !important;
}
html.dark .bg-blue-50,
html.dark .bg-blue-50 .text-blue-700 {
    color: #93c5fd !important;
}
html.dark .bg-blue-50 .font-bold {
    color: #bfdbfe !important;
}
html.dark .page-btn {
    background-color: #1e293b !important;
    color: #e2e8f0 !important;
    border-color: #475569 !important;
}
html.dark .page-btn:hover:not(:disabled) {
    background-color: #334155 !important;
}
html.dark .page-btn:disabled {
    opacity: 0.3 !important;
}
html.dark .page-btn span,
html.dark #home-page-box .text-sm,
html.dark [id*="-page-box"] .text-sm,
html.dark .text-gray-600 {
    color: #94a3b8 !important;
}
html.dark #about-content {
    background-color: #1e293b !important;
    border: 1px solid #334155 !important;
}
html.dark #about-content h3 {
    color: #f1f5f9 !important;
}
html.dark #about-content p,
html.dark #about-content .text-gray-600 {
    color: #cbd5e1 !important;
}
html.dark #notice-list .post-card {
    background-color: #1e293b !important;
}
html.dark #notice-list .post-card h3 {
    color: #f1f5f9 !important;
}
html.dark #notice-page-box .text-gray-500 {
    color: #94a3b8 !important;
}
html.dark #detail-content {
    background-color: #1e293b !important;
    border: 1px solid #334155 !important;
}
html.dark #detail-title {
    color: #f1f5f9 !important;
}
html.dark #detail-content,
html.dark #detail-content .text-gray-700 {
    color: #cbd5e1 !important;
}
html.dark .back-btn {
    background-color: #334155 !important;
    color: #e2e8f0 !important;
}
html.dark .back-btn:hover {
    background-color: #475569 !important;
}
html.dark #carouselWrap {
    box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}
html.dark .dot-item {
    background-color: rgba(255,255,255,0.4) !important;
}
html.dark .dot-item.active {
    background-color: #ffffff !important;
}
html.dark #search-empty {
    color: #94a3b8 !important;
}
html.dark .toast-message {
    background-color: #1e293b !important;
    color: #f1f5f9 !important;
    border: 1px solid #475569 !important;
}
html.dark .download-modal {
    background-color: #1e293b !important;
    border: 1px solid #334155 !important;
}
html.dark .download-header {
    border-bottom-color: #334155 !important;
}
html.dark .download-title {
    color: #f1f5f9 !important;
}
html.dark .download-source {
    color: #60a5fa !important;
}
html.dark .download-url-box {
    background-color: #0f172a !important;
    border-color: #334155 !important;
}
html.dark .download-url-text {
    background-color: #1e293b !important;
    color: #e2e8f0 !important;
    border-color: #334155 !important;
}
html.dark .download-btn-cancel {
    background-color: #334155 !important;
    color: #e2e8f0 !important;
}
html.dark .download-btn-cancel:hover {
    background-color: #475569 !important;
}
html.dark .download-tips {
    background-color: #0f172a !important;
    border-color: #334155 !important;
}
html.dark .download-tips p {
    color: #94a3b8 !important;
}
html.dark .download-icon.default {
    background: linear-gradient(135deg, #475569, #64748b) !important;
}
html.dark .download-btn-copy {
    background-color: #2563eb !important;
    color: #ffffff !important;
}
html.dark .download-btn-copy:hover {
    background-color: #1d4ed8 !important;
}
html.dark .download-btn-copy.copied {
    background-color: #00b42a !important;
}
html.dark .popup-overlay {
    background: rgba(0,0,0,0.8) !important;
}
html.dark .popup-modal {
    background-color: #1e293b !important;
    border: 1px solid #334155 !important;
}
html.dark .popup-header {
    border-bottom-color: #334155 !important;
}
html.dark .popup-title {
    color: #f1f5f9 !important;
}
html.dark .popup-content {
    color: #cbd5e1 !important;
}
html.dark .popup-footer {
    border-top-color: #334155 !important;
}
html.dark .popup-footer label span {
    color: #94a3b8 !important;
}
html.dark .popup-close {
    background-color: #334155 !important;
    color: #e2e8f0 !important;
}
html.dark .popup-close:hover {
    background-color: #475569 !important;
}
html.dark #theme-toggle-btn {
    background: rgba(107, 114, 128, 0.25) !important;
    color: #ffffff !important;
}
html.dark .text-gray-500 {
    color: #94a3b8 !important;
}
html.dark .text-gray-400 {
    color: #9ca3af !important;
}
html.dark .border {
    border-color: #334155 !important;
}
html.dark hr {
    border-color: #334155 !important;
}

/* ========== 自定义提示弹窗 ========== */
.custom-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 10002;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.custom-modal {
    background: white;
    border-radius: 16px;
    max-width: 380px;
    width: 100%;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: modalFadeIn 0.3s ease;
}
@keyframes modalFadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}
.custom-modal-header {
    padding: 24px 24px 0 24px;
    text-align: center;
}
.custom-modal-icon {
    width: 64px;
    height: 64px;
    background: #fee2e2;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}
.custom-modal-icon i {
    font-size: 32px;
    color: #ef4444;
}
.custom-modal-title {
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 8px;
}
.custom-modal-body {
    padding: 16px 24px;
    text-align: center;
}
.custom-modal-body p {
    color: #475569;
    font-size: 14px;
    line-height: 1.6;
}
.custom-modal-footer {
    padding: 16px 24px 24px;
    display: flex;
    justify-content: center;
}
.custom-modal-btn {
    padding: 10px 32px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
    border: none;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}
.custom-modal-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99,102,241,0.3);
}
html.dark .custom-modal {
    background: #1e293b;
}
html.dark .custom-modal-title {
    color: #f1f5f9;
}
html.dark .custom-modal-body p {
    color: #cbd5e1;
}
html.dark .custom-modal-icon {
    background: #450a0a;
}

/* ========== 轮播图核心样式 ========== */
/* 关键修复：使轮播 slide 水平排列 */
#banner-carousel {
    display: flex;
}

/* 轮播容器平滑滑动（合并原有 transition） */
#banner-carousel {
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* 图片模糊→清晰动画 */
.carousel-img {
    transition: filter 0.25s ease-out;
    filter: blur(4px);
    will-change: filter;
}
.carousel-img.loaded {
    filter: blur(0);
}

/* 标题：左下角圆角标签 */
.carousel-caption {
    position: absolute;
    bottom: 2px;
    left: 8px;
    background: linear-gradient(to right, rgba(0,0,0,0.6), transparent);
    color: white;
    padding: 4px 12px;
    line-height: 1.3;
    font-size: 16px;
    font-weight: 500;
    border-radius: 12px;
    max-width: 70%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    pointer-events: none;
    z-index: 1;
}
@media (max-width: 640px) {
    .carousel-caption {
        font-size: 14px;
        padding: 4px 10px;
        max-width: 65%;
    }
}

/* 圆点：右下角半透明圆角背景 */
#carouselWrap #dotBox {
    position: absolute !important;
    bottom: 6px !important;
    right: 12px !important;
    left: auto !important;
    transform: none !important;
    display: flex;
    gap: 8px;
    background: rgba(0, 0, 0, 0.6);
    padding: 4px 10px;
    border-radius: 20px;
    backdrop-filter: blur(2px);
    z-index: 1;
}
#carouselWrap #dotBox .dot-item {
    width: 8px;
    height: 8px;
    background-color: rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    transition: all 0.2s;
    cursor: pointer;
}
#carouselWrap #dotBox .dot-item.active {
    background-color: white;
    transform: scale(1.2);
}

/* 暗色模式适配 */
html.dark .carousel-caption {
    background: linear-gradient(to right, rgba(0,0,0,0.8), transparent);
}
html.dark #carouselWrap #dotBox {
    background: rgba(0, 0, 0, 0.7);
}