/* naspt 获取链接弹窗公共样式
 * 放在 common 下，保证首页、详情页、分类页、榜单页等所有 simple 前台页面都生效。
 */

.el-overlay.naspt-resource-overlay {
    background: rgba(0, 0, 0, 0.6) !important;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 9999 !important;
}

.el-overlay.naspt-resource-overlay .el-overlay-dialog {
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    padding: 20px;
    overflow: auto;
}

.el-overlay.naspt-resource-overlay .el-dialog.naspt-resource-dialog,
.el-overlay-dialog .el-dialog.naspt-resource-dialog,
.el-dialog.naspt-resource-dialog {
    width: min(440px, 90vw) !important;
    max-width: 440px !important;
    max-height: 90vh;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    color: #1e293b;
    background: #ffffff !important;
    border: 0 !important;
    border-radius: 20px !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12) !important;
    animation: nasptDialogSlideIn 0.3s ease;
}

.naspt-resource-dialog .el-dialog__header {
    display: none !important;
}

.naspt-resource-dialog .el-dialog__body {
    padding: 0 !important;
    color: #1e293b;
    background: transparent !important;
}

.naspt-dialog-box {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    min-height: 320px;
    max-height: 90vh;
    overflow-y: auto;
    background: #ffffff;
    border-radius: 20px;
}

.naspt-dialog-box::-webkit-scrollbar {
    width: 6px;
}

.naspt-dialog-box::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.45);
    border-radius: 999px;
}

.naspt-close-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 8px;
    color: #94a3b8;
    cursor: pointer;
    background: #f1f5f9;
    border: none;
    border-radius: 9999px;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.naspt-close-btn:hover {
    color: #64748b;
    background: #e2e8f0;
}

.naspt-close-btn:active {
    transform: scale(0.96);
}

.naspt-dialog-loading {
    display: flex;
    flex: 1;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 320px;
    padding: 48px 20px;
    text-align: center;
}

.naspt-loading-spinner {
    width: 48px;
    height: 48px;
    margin: 0 auto 20px;
    border: 4px solid #e2e8f0;
    border-top-color: #fd9000;
    border-right-color: #ffa836;
    border-radius: 50%;
    animation: nasptSpin 0.8s linear infinite;
}

.naspt-loading-text {
    margin-bottom: 8px;
    color: #1e293b;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.5;
}

.naspt-loading-hint {
    color: #94a3b8;
    font-size: 14px;
    line-height: 1.5;
}

.naspt-dialog-content {
    flex: 1;
    padding: 20px;
}

.naspt-qrcode-section {
    margin-bottom: 16px;
    text-align: center;
}

.naspt-qrcode-title {
    margin-bottom: 8px;
    color: #1e293b;
    font-size: 15px;
    line-height: 24px;
}

.naspt-qrcode-title span {
    color: #fd9000;
    font-weight: 600;
}

.naspt-qrcode-tips {
    margin-bottom: 12px;
    color: #94a3b8;
    font-size: 11px;
    line-height: 17.6px;
}

.naspt-qrcode-box {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 136px;
    height: 136px;
    padding: 8px;
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.naspt-qrcode-box .qrcode,
.naspt-qrcode-box .qrcode canvas {
    display: block;
    width: 120px !important;
    height: 120px !important;
}

.naspt-countdown-warning {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 12px 0;
    padding: 12px 16px;
    background: linear-gradient(135deg, #ff6b6b, #ff5252);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(255, 107, 107, 0.3);
    animation: nasptResourcePulseWarning 2s ease-in-out infinite !important;
}

.naspt-countdown-icon {
    flex: 0 0 auto;
    font-size: 24px;
    line-height: 38.4px;
    transform-origin: 50% 70%;
    animation: nasptAlarmShake 1s ease-in-out infinite !important;
}

.naspt-countdown-content {
    min-width: 0;
}

.naspt-countdown-title {
    margin-bottom: 2px;
    color: #ffffff;
    font-size: 14px;
    font-weight: 700;
    line-height: 22.4px;
}

.naspt-countdown-time {
    display: inline-block;
    padding: 2px 6px;
    color: #fff200;
    font-size: 16px;
    font-weight: 900;
    line-height: 25.6px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

.naspt-countdown-subtitle {
    color: rgba(255, 255, 255, 0.95);
    font-size: 12px;
    font-weight: 500;
    line-height: 19.2px;
}

.naspt-usage-tips {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 10px 0;
}

.naspt-tip-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    font-size: 13px;
    line-height: 1.4;
    border-radius: 6px;
}

.naspt-tip-red {
    color: #c53030;
    font-weight: 600;
    background: #fff5f5;
    border: 2px solid #fc8181;
}

.naspt-tip-orange {
    color: #c05621;
    background: #fffaf0;
    border: 1px solid #fbd38d;
}

.naspt-tip-icon {
    flex: 0 0 auto;
}

.naspt-tip-text {
    min-width: 0;
}

.naspt-resource-nav {
    margin-top: 16px;
}

.naspt-nav-item {
    padding: 8px 0;
}

.naspt-resource-title {
    color: #1e293b;
    font-size: 15px;
    font-weight: 600;
    line-height: 24px;
    word-break: break-word;
}

.naspt-toggle-link-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 8px 0;
    color: #94a3b8;
    font-size: 11px;
    line-height: 17.6px;
    cursor: pointer;
    background: none;
    border: none;
    transition: color 0.2s ease;
}

.naspt-toggle-link-btn:hover {
    color: #64748b;
}

.naspt-toggle-arrow {
    display: inline-block;
    font-size: 16px;
    line-height: 1;
    transition: transform 0.2s ease;
}

.naspt-toggle-arrow.expanded {
    transform: rotate(90deg);
}

.naspt-pc-link-content {
    margin-top: 8px;
    padding: 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
}

.naspt-mobile-link-section {
    display: none;
}

.naspt-link-wrapper {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.naspt-resource-link {
    display: block;
    color: #fd9000;
    font-size: 15px;
    font-weight: 500;
    line-height: 24px;
    text-decoration: none;
    word-break: break-all;
}

.naspt-resource-link:hover {
    text-decoration: underline;
}

.naspt-btn-group {
    display: flex;
    gap: 12px;
}

.naspt-action-btn {
    display: inline-flex;
    flex: 1;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 12px 16px;
    color: #ffffff;
    font-size: 13px;
    font-weight: 600;
    line-height: 20.8px;
    text-decoration: none;
    cursor: pointer;
    border: none;
    border-radius: 10px;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, opacity 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.naspt-action-btn:hover {
    transform: translateY(-1px);
}

.naspt-action-btn:active {
    transform: translateY(0) scale(0.98);
}

.naspt-copy-btn {
    color: #ffffff;
    background: linear-gradient(135deg, #fd9000 0%, #ffa836 100%);
    box-shadow: 0 2px 8px rgba(253, 144, 0, 0.25);
}

.naspt-copy-btn:hover {
    color: #ffffff;
    background: linear-gradient(135deg, #ffa836 0%, #ffc95e 100%);
    box-shadow: 0 4px 12px rgba(253, 144, 0, 0.32);
}

.naspt-open-btn {
    color: #ffffff;
    background: #ffa836;
}

.naspt-open-btn:hover {
    color: #ffffff;
    opacity: 0.9;
}

.naspt-group-tip {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin: 0 20px;
    padding: 12px 16px;
    cursor: pointer;
    background: #fff7ed;
    border: 1px solid #ffc95e;
    border-radius: 10px;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.naspt-group-tip:hover {
    background: #ffedd5;
    border-color: #ffa836;
}

.naspt-group-tip-text {
    color: #fd9000;
    font-size: 13px;
    font-weight: 500;
    line-height: 20.8px;
}

.naspt-group-tip-arrow {
    color: #fd9000;
    font-size: 16px;
    line-height: 1;
}

.naspt-statement {
    margin-top: auto;
    padding: 16px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
}

.naspt-statement-content {
    color: #555555;
    font-size: 12px;
    line-height: 1.7;
}

.naspt-statement-content p {
    margin: 0;
}

.naspt-dialog-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 250px;
    text-align: center;
}

.naspt-error-icon {
    width: 54px;
    height: 54px;
    margin-bottom: 14px;
    color: #ef4444;
    font-size: 32px;
    font-weight: 700;
    line-height: 54px;
    background: #fee2e2;
    border-radius: 50%;
}

.naspt-error-title {
    margin-bottom: 8px;
    color: #1e293b;
    font-size: 18px;
    font-weight: 700;
}

.naspt-error-message {
    margin-bottom: 18px;
    color: #64748b;
    font-size: 14px;
    line-height: 1.6;
}

.naspt-error-close {
    flex: none;
    width: 160px;
}

.naspt-slide-collapse-enter-active,
.naspt-slide-collapse-leave-active {
    max-height: 180px;
    overflow: hidden;
    transition: opacity 0.2s ease, transform 0.2s ease, max-height 0.2s ease;
}

.naspt-slide-collapse-enter-from,
.naspt-slide-collapse-leave-to {
    max-height: 0;
    opacity: 0;
    transform: translateY(-4px);
}

/* 手机底部导航，尺寸参考 naspt mobile-tab-bar */
.mobile-bottom-nav {
    display: none;
}

.mobile-bottom-nav-item {
    color: inherit;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
}

@keyframes nasptDialogSlideIn {
    from {
        opacity: 0;
        transform: translateY(18px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes nasptSpin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes nasptResourcePulseWarning {
    0%,
    100% {
        box-shadow: 0 2px 8px rgba(255, 107, 107, 0.3);
        filter: saturate(1);
    }
    50% {
        box-shadow: 0 5px 18px rgba(255, 82, 82, 0.55);
        filter: saturate(1.16);
    }
}

@keyframes nasptAlarmShake {
    0%,
    100% {
        transform: rotate(0deg) scale(1);
    }
    10%,
    30%,
    50% {
        transform: rotate(-13deg) scale(1.08);
    }
    20%,
    40%,
    60% {
        transform: rotate(13deg) scale(1.08);
    }
    72% {
        transform: rotate(0deg) scale(1);
    }
}

@media (max-width: 1024px) {
    html body .el-overlay.naspt-resource-overlay .el-overlay-dialog {
        align-items: center !important;
        justify-content: center !important;
        padding: 16px !important;
        overflow: auto !important;
    }

    html body .el-overlay.naspt-resource-overlay .el-dialog.naspt-resource-dialog,
    html body .el-overlay-dialog .el-dialog.naspt-resource-dialog,
    html body .el-dialog.naspt-resource-dialog {
        width: min(90vw, 440px) !important;
        max-width: 90vw !important;
        max-height: 85vh !important;
        margin: 0 !important;
        border-radius: 20px !important;
    }

    html body .naspt-dialog-box {
        max-height: 85vh !important;
    }

    html body .naspt-dialog-content {
        padding: 16px !important;
    }

    html body .naspt-dialog-loading {
        padding: 40px 16px !important;
    }

    html body .naspt-loading-spinner {
        width: 40px !important;
        height: 40px !important;
    }

    html body .naspt-usage-tips {
        gap: 8px !important;
        margin: 8px 0 !important;
    }

    html body .naspt-tip-item {
        padding: 10px !important;
        font-size: 12px !important;
    }

    html body .naspt-statement {
        padding: 12px !important;
    }

    html body .naspt-action-btn {
        padding: 12px !important;
    }
}

@media (max-width: 768px) {
    html body {
        padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px)) !important;
    }

    html body .el-overlay.naspt-resource-overlay {
        padding: 0 !important;
        background: rgba(0, 0, 0, 0.6) !important;
    }

    html body .el-overlay.naspt-resource-overlay .el-overlay-dialog {
        min-height: 100%;
        padding: 16px !important;
    }

    html body .el-overlay.naspt-resource-overlay .el-dialog.naspt-resource-dialog,
    html body .el-overlay-dialog .el-dialog.naspt-resource-dialog,
    html body .el-dialog.naspt-resource-dialog {
        width: min(90vw, 440px) !important;
        max-width: 90vw !important;
        max-height: calc(100dvh - 32px) !important;
        border-radius: 20px !important;
    }

    html body .naspt-dialog-box {
        max-height: calc(100dvh - 32px) !important;
        min-height: 0 !important;
        border-radius: 20px !important;
    }

    html body .naspt-close-btn {
        top: 10px !important;
        right: 10px !important;
        width: 34px !important;
        height: 34px !important;
        background: rgba(241, 245, 249, 0.94) !important;
    }

    /* naspt 手机端获取链接弹窗从倒计时警告开始，不展示顶部网盘名和二维码 */
    html body .naspt-resource-dialog .naspt-qrcode-section,
    html body .naspt-dialog-box .naspt-qrcode-section {
        display: none !important;
    }

    html body .naspt-dialog-content {
        padding: 16px !important;
    }

    html body .naspt-countdown-warning {
        gap: 10px !important;
        margin: 12px 0 !important;
        padding: 12px 16px !important;
        border-radius: 8px !important;
        box-shadow: 0 2px 8px rgba(255, 107, 107, 0.3) !important;
        animation: nasptResourcePulseWarning 2s ease-in-out infinite !important;
    }

    html body .naspt-countdown-icon {
        font-size: 24px !important;
        line-height: 38.4px !important;
    }

    html body .naspt-countdown-title {
        font-size: 14px !important;
        line-height: 22.4px !important;
    }

    html body .naspt-countdown-time {
        padding: 2px 6px !important;
        font-size: 16px !important;
        line-height: 25.6px !important;
    }

    html body .naspt-countdown-subtitle {
        font-size: 12px !important;
        line-height: 19.2px !important;
    }

    html body .naspt-usage-tips {
        gap: 8px !important;
        margin: 8px 0 !important;
    }

    html body .naspt-tip-item {
        gap: 8px !important;
        padding: 10px !important;
        font-size: 12px !important;
        border-radius: 6px !important;
    }

    html body .naspt-tip-red {
        border-width: 2px !important;
    }

    html body .naspt-resource-nav {
        margin-top: 16px !important;
    }

    html body .naspt-resource-title {
        font-size: 15px !important;
        line-height: 24px !important;
        padding: 8px 0 !important;
    }

    html body .naspt-resource-title .naspt-label {
        color: #64748b !important;
        font-weight: 400 !important;
    }

    html body .naspt-pc-link-toggle {
        display: none !important;
    }

    html body .naspt-mobile-link-section {
        display: flex !important;
        flex-direction: column !important;
        gap: 8px !important;
        padding: 8px 0 !important;
        color: #1e293b !important;
        font-size: 13px !important;
        font-weight: 400 !important;
        line-height: 20.8px !important;
    }

    html body .naspt-mobile-link-label {
        display: block !important;
        color: #64748b !important;
        font-size: 13px !important;
        font-weight: 400 !important;
        line-height: 20.8px !important;
    }

    html body .naspt-mobile-link-section .naspt-resource-link {
        font-size: 13px !important;
        line-height: 20.8px !important;
        word-break: break-all !important;
    }

    html body .naspt-mobile-link-section .naspt-link-wrapper {
        gap: 12px !important;
    }

    html body .naspt-mobile-link-section .naspt-btn-group {
        gap: 12px !important;
    }

    html body .naspt-mobile-link-section .naspt-action-btn {
        min-height: 52.8px !important;
        padding: 16px !important;
        font-size: 13px !important;
        line-height: 20.8px !important;
    }

    html body .naspt-group-tip {
        margin: 0 20px !important;
        padding: 12px 16px !important;
        border-radius: 10px !important;
    }

    html body .naspt-group-tip-text {
        font-size: 13px !important;
        line-height: 20.8px !important;
    }

    html body .naspt-statement {
        padding: 12px !important;
    }

    html body .naspt-statement-content {
        font-size: 12px !important;
        line-height: 1.7 !important;
    }

    .mobile-bottom-nav {
        position: fixed;
        right: 0;
        bottom: 0;
        left: 0;
        z-index: 9996;
        display: flex;
        align-items: stretch;
        justify-content: space-around;
        height: calc(56px + env(safe-area-inset-bottom, 0px));
        padding: 0 0 env(safe-area-inset-bottom, 0px);
        overflow: hidden;
        background: rgba(255, 255, 255, 0.95);
        border-top: 1px solid #f1f5f9;
        box-shadow: none;
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
    }

    .mobile-bottom-nav-item {
        display: flex;
        flex: 1 1 0;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        min-width: 0;
        height: 56px;
        gap: 2px;
        color: #94a3b8;
        text-decoration: none;
        transition: color 0.16s ease, transform 0.16s ease, background 0.16s ease;
    }

    .mobile-bottom-nav-item:hover,
    .mobile-bottom-nav-item.is-active {
        color: var(--theme-primary, #fd9000);
    }

    .mobile-bottom-nav-item:active {
        transform: translateY(1px) scale(0.97);
    }

    .mobile-bottom-nav-icon {
        display: block;
        width: 22px;
        height: 22px;
        color: currentColor;
    }

    .mobile-bottom-nav-text {
        color: currentColor;
        font-size: 10px;
        font-weight: 500;
        line-height: 10px;
        white-space: nowrap;
    }

    .floating-group {
        top: auto !important;
        bottom: calc(86px + env(safe-area-inset-bottom, 0px)) !important;
    }
}

@media (max-width: 420px) {
    html body .el-overlay.naspt-resource-overlay .el-overlay-dialog {
        padding: 12px !important;
    }

    html body .el-overlay.naspt-resource-overlay .el-dialog.naspt-resource-dialog,
    html body .el-overlay-dialog .el-dialog.naspt-resource-dialog,
    html body .el-dialog.naspt-resource-dialog {
        width: 92vw !important;
        max-width: 92vw !important;
        max-height: calc(100dvh - 24px) !important;
    }

    html body .naspt-dialog-box {
        max-height: calc(100dvh - 24px) !important;
    }

    html body .naspt-countdown-warning {
        padding: 10px 12px !important;
    }

    html body .naspt-countdown-title {
        font-size: 13px !important;
    }

    html body .naspt-btn-group {
        gap: 8px !important;
    }

    html body .naspt-mobile-link-section .naspt-action-btn {
        min-height: 52.8px !important;
        padding: 16px !important;
        font-size: 13px !important;
        line-height: 20.8px !important;
    }

    html body .naspt-group-tip {
        margin: 0 16px !important;
        padding: 11px 12px !important;
    }
}

[data-theme="dark"] .mobile-bottom-nav {
    background: rgba(14, 22, 32, 0.94);
    border-top-color: rgba(148, 163, 184, 0.16);
}

[data-theme="dark"] .mobile-bottom-nav-item {
    color: #7890aa;
}

[data-theme="dark"] .mobile-bottom-nav-item:hover,
[data-theme="dark"] .mobile-bottom-nav-item.is-active {
    color: var(--theme-primary, #ffc95e);
}
