.quark-download-container {
    text-align: left;
    color: #4b5563;
}

.quark-download-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 18px;
}

.quark-external-download-item {
    display: inline-flex;
    flex-direction: column;
    gap: 0;
    margin: 0;
    padding: 0;
    min-width: 150px;
}

.quark-external-download-item .quark-external-download-button {
    width: 100%;
    margin: 0 !important;
    border-radius: 5px 5px 0 0;
}

/* Centered download-button treatment shared by local and Quark downloads. */
.quark-local-download-button,
.quark-external-download-item .quark-external-download-button {
    min-height: 48px !important;
    padding: 6px 12px;
    border-radius: 3px !important;
    box-shadow: none;
    justify-content: center !important;
}

.quark-local-download-button {
    background: #168bf2 !important;
}

.quark-external-download-item .quark-external-download-button {
    background: #16a34a !important;
}

.quark-local-download-button:hover,
.quark-local-download-button:focus {
    background: #087bef !important;
    box-shadow: 0 4px 10px rgba(22, 139, 242, .24);
}

.quark-external-download-item .quark-external-download-button:hover,
.quark-external-download-item .quark-external-download-button:focus {
    background: #12813a !important;
    box-shadow: 0 4px 10px rgba(22, 163, 74, .24);
}

.quark-local-download-button .quark-download-button-icon,
.quark-external-download-item .quark-download-button-icon {
    display: inline-block;
    width: auto;
    height: auto;
    margin: 0 9px 0 0;
    align-items: center;
    justify-content: center;
    border: 0;
    font-size: 16px;
    line-height: 1;
    text-align: center;
}

.quark-local-download-button > span {
    font-size: 16px !important;
    font-weight: 700;
    line-height: 1.1 !important;
}

.quark-external-download-item .quark-download-button-copy {
    display: flex;
    min-width: 0;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.15 !important;
    text-align: left;
}

.quark-external-download-item .quark-download-button-copy strong {
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.1;
}

.quark-external-download-item .quark-download-button-copy small {
    margin-top: 2px;
    color: rgba(255, 255, 255, .96);
    font-size: 11px;
    font-weight: 500;
    line-height: 1.2;
}

.quark-external-download-item .quark-external-download-notice {
    display: none !important;
}

.quark-external-download-notice {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-height: 29px;
    padding: 4px 9px;
    margin: 0 !important;
    box-sizing: border-box;
    border: 1px solid #dbe7f2;
    border-top: 0;
    border-radius: 0 0 5px 5px;
    background: #f3f7fb;
    color: #4f6982;
    font-size: 12px !important;
    line-height: 1.45;
    text-align: center;
    white-space: nowrap;
}

.quark-external-download-notice i {
    color: #3878ae;
    font-size: 12px;
}

.quark-download-button {
    position: relative;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 150px;
    min-height: 46px;
    padding: 9px 20px;
    border: none;
    border-radius: 25px;
    color: white;
    font-size: 15px !important;
    font-weight: 400;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: none;
    outline: none;
    text-align: center;
    box-sizing: border-box;
    line-height: 1.35 !important;
}

.quark-download-button span {
    font-size: inherit !important;
    line-height: inherit !important;
}

.quark-download-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(30, 136, 229, 0.22);
    color: #fff !important;
}

.quark-download-button,
.quark-download-button:visited,
.quark-download-button:focus,
.quark-download-button:active,
.quark-download-button span,
.quark-download-button i {
    color: #fff !important;
    text-decoration: none !important;
}

.quark-local-download-button:hover,
.quark-local-download-button:focus {
    color: #fff !important;
    filter: none;
}

.quark-download-button:focus-visible,
.quark-invalid-link-toggle:focus-visible,
.quark-invalid-link-option:focus-visible {
    outline: 3px solid #111827;
    outline-offset: 3px;
}

.quark-download-button:active {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15);
}

.quark-size-small {
    min-height: 40px;
    padding: 7px 16px;
    font-size: 13px !important;
}

.quark-size-medium {
    min-height: 46px;
    padding: 9px 20px;
    font-size: 15px !important;
}

.quark-size-large {
    min-height: 54px;
    padding: 11px 24px;
    font-size: 17px !important;
}

.quark-style-flat {
    border-radius: 4px;
}

.quark-style-rounded {
    border-radius: 25px;
}

.quark-style-outline {
    background-color: transparent !important;
    border: 2px solid;
    color: inherit;
}

.quark-style-outline:hover {
    background-color: rgba(255, 255, 255, 0.1) !important;
}

.quark-download-button i {
    margin-right: 7px;
    font-size: 14px;
}

.quark-size-small i {
    font-size: 14px;
}

.quark-size-large i {
    font-size: 18px;
}

@media (max-width: 768px) {
    .quark-download-heading {
        gap: 10px;
    }

    .quark-invalid-link-toggle {
        font-size: 12px !important;
        white-space: nowrap;
    }

    .quark-download-buttons {
        flex-direction: column;
        gap: 12px;
    }
    
    .quark-download-button {
        width: 100%;
        min-width: 0;
        justify-content: center;
    }

    .quark-resource-meta {
        gap: 8px;
    }

    .quark-resource-meta-item {
        min-height: 34px;
        padding: 6px 5px;
        font-size: 14px;
        overflow: hidden;
    }

    .quark-warm-tip {
        font-size: 14px;
    }
}

.quark-download-title {
    font-size: 18px !important;
    font-weight: 700;
    margin: 0;
    color: #111827;
    text-align: left;
}

.quark-download-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 3px;
}

.quark-download-heading-no-title {
    justify-content: flex-end;
}

.quark-download-divider {
    height: 2px;
    background: #168bf2;
    margin-bottom: 19px;
}

.quark-resource-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 10px;
    align-items: center;
}

.quark-resource-meta-item {
    display: inline-flex;
    align-items: center;
    min-height: 0px;
    padding: 5px 8px;
    border-radius: 10px;
    color: #555f6c;
    font-size: 13px !important;
    line-height: 1.35;
    box-sizing: border-box;
}

.quark-resource-meta-item strong {
    font-weight: 400;
}

.quark-resource-meta-item,
.quark-resource-meta-item strong,
.quark-resource-meta-item span {
    line-height: 1.35 !important;
}

.quark-category-link,
.quark-resolution-link {
    color: inherit;
    font-size: inherit !important;
    line-height: inherit !important;
    text-decoration: none;
}

.quark-category-link:hover,
.quark-resolution-link:hover {
    color: #005fc1;
    text-decoration: underline;
}

.quark-warm-tip {
    color: #555f6c;
    font-size: 14px !important;
    line-height: 1.7;
}

.quark-warm-tip strong {
    font-weight: 400;
    font-size: inherit !important;
}

.quark-extra-slot {
    width: 100%;
    box-sizing: border-box;
    line-height: 1.4;
    text-align: center;
}

.quark-extra-slot img,
.quark-extra-slot iframe {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 0 auto;
}

.quark-invalid-link-toggle {
    flex: 0 0 auto;
    padding: 3px 0;
    border: 0;
    background: transparent !important;
    color: #7b8794;
    font-size: 13px !important;
    font-weight: 400;
    line-height: 1.4 !important;
    text-decoration: none;
    cursor: pointer;
}

.quark-invalid-link-toggle:hover {
    color: #087bef;
}

.quark-invalid-link-panel {
    margin: -8px 0 14px;
    padding: 12px 14px;
    border: 1px solid #dbe9f8;
    border-radius: 6px;
    background: #f8fbff;
    font-size: 14px !important;
}

.quark-invalid-link-panel[hidden] {
    display: none !important;
}

.quark-invalid-link-label {
    color: #555f6c;
}

.quark-invalid-link-options {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-left: 8px;
}

.quark-invalid-link-option {
    padding: 5px 10px;
    border: 1px solid #9bc9f5;
    border-radius: 5px;
    background: #fff;
    color: #087bef;
    font-size: 13px !important;
    line-height: 1.4 !important;
    cursor: pointer;
}

.quark-invalid-link-option:hover {
    background: #eaf4ff;
}

.quark-invalid-link-option:disabled {
    cursor: default;
    opacity: 0.65;
}

.quark-invalid-link-result {
    display: block;
    margin-top: 8px;
    min-height: 20px;
    color: #667085;
}

.quark-report-success {
    color: #16803c;
}

.quark-report-error {
    color: #c62828;
}

.quark-related-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: flex-start;
    width: 100%;
    margin: 10px 0 0;
    padding: 0;
    text-indent: 0 !important;
    box-sizing: border-box;
}

.quark-related-label {
    flex: 0 0 auto;
    color: #555f6c;
    font-size: 14px !important;
    line-height: 28px !important;
}

.quark-related-tag-list {
    display: flex;
    flex: 1 1 auto;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    min-width: 0;
    margin: 0;
    padding: 0;
    font-size: 0;
    line-height: 1;
}

.quark-related-tag,
.quark-related-tag:visited {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    min-height: 28px;
    margin: 0 !important;
    padding: 4px 10px;
    border: 0;
    border-radius: 10px;
    background: #eaf4ff;
    box-shadow: none;
    color: #087bef !important;
    font-size: 13px !important;
    line-height: 20px !important;
    text-decoration: none !important;
    text-indent: 0 !important;
    white-space: nowrap;
    box-sizing: border-box;
    transition: background-color .2s ease,color .2s ease;
}

.quark-related-tag::before,
.quark-related-tag::after {
    display: none !important;
    content: none !important;
}

.quark-related-tag:hover,
.quark-related-tag:focus {
    background: #d7ebff;
    color: #006bd6 !important;
}

.quark-error {
    color: #d32f2f;
    padding: 10px;
    background-color: #ffebee;
    border-radius: 4px;
    border-left: 4px solid #d32f2f;
}

/* 电脑端拦截弹窗 */
.quark-legacy-prompt-removed {
    display: none !important;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    display: none;
}

.quark-legacy-prompt-visible-removed {
    display: flex !important;
}

.quark-legacy-prompt-box-removed {
    background: #fff;
    border-radius: 12px;
    padding: 40px 30px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    position: relative;
    animation: quarkPromptIn 0.3s ease;
}

@keyframes quarkPromptIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.quark-legacy-prompt-close-removed {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
}

.quark-legacy-prompt-close-hover-removed {
    color: #333;
}

.quark-legacy-qrcode-removed {
    margin: 0 auto 20px;
    width: 200px;
    height: 200px;
    background: #fff;
    padding: 10px;
    border: 1px solid #eee;
    border-radius: 8px;
}

.quark-legacy-qrcode-img-removed {
    display: block;
    width: 100%;
    height: 100%;
}

.quark-legacy-qrcode-canvas-removed {
    display: block;
    width: 180px;
    height: 180px;
    margin: 0 auto;
}

.quark-legacy-qr-fallback-removed {
    display: block;
    padding: 64px 12px;
    color: #4b5563;
    text-align: center;
    font-size: 14px;
}

.quark-legacy-prompt-message-removed {
    font-size: 16px;
    color: #333;
    line-height: 1.6;
}

.quark-limit-dialog[hidden] {
    display: none !important;
}

.quark-limit-dialog {
    position: fixed;
    inset: 0;
    z-index: 100001;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.quark-limit-dialog-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(19, 25, 36, 0.58);
    backdrop-filter: blur(2px);
}

.quark-limit-dialog-box {
    position: relative;
    width: min(400px, 100%);
    padding: 28px 24px 24px;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 18px 55px rgba(0, 0, 0, 0.28);
    text-align: center;
}

.quark-limit-dialog-box h3 {
    margin: 0 0 10px;
    color: #202124;
    font-size: 20px !important;
    line-height: 1.4 !important;
}

.quark-limit-dialog-box p {
    margin: 0 0 20px;
    color: #5f6368;
    font-size: 14px !important;
    line-height: 1.7 !important;
}

.quark-limit-dialog-box {
    width: min(460px, calc(100vw - 32px));
    min-height: 0;
    padding: 34px 32px 30px;
    border: 1px solid #eef1f5;
    border-radius: 8px;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: center;
    gap: 22px 16px;
    text-align: center;
}

.quark-limit-dialog-content h3 {
    margin: 0 0 7px;
    color: var(--theme-color, #1677ff);
    font-size: 19px !important;
    font-weight: 600;
    white-space: normal;
}

.quark-limit-dialog-content p {
    margin: 0;
    color: #707988;
    font-size: 13px !important;
    line-height: 1.55 !important;
}

.quark-limit-dialog-close {
    position: absolute;
    top: 10px;
    right: 12px;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #a1a8b2;
    font-size: 23px;
    line-height: 34px;
    cursor: pointer;
}

.quark-limit-sponsor {
    grid-column: 1 / -1;
    min-height: 42px;
    padding: 10px 20px;
    border: 0;
    border-radius: 6px;
    background: var(--theme-color, #1677ff);
    color: #fff;
    font-size: 15px;
    font-weight: 500;
    line-height: 22px;
    cursor: pointer;
}

.quark-limit-sponsor:hover,
.quark-limit-sponsor:focus {
    background: var(--theme-hover, #1162e8);
    color: #fff;
}

@media (max-width: 600px) {
    .quark-limit-dialog-box {
        padding: 32px 22px 24px;
        grid-template-columns: minmax(0, 1fr);
        gap: 18px 12px;
    }

    .quark-limit-dialog-content h3 {
        font-size: 17px !important;
    }
}

.quark-member-download-records {
    overflow-x: auto;
}

.quark-member-download-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}

.quark-member-download-table th,
.quark-member-download-table td {
    padding: 12px 10px;
    border-bottom: 1px solid #edf0f2;
    text-align: left;
    font-size: 13px;
    line-height: 1.5;
}

.quark-member-download-table th {
    color: #667085;
    font-weight: 600;
    background: #f8fafc;
}

.quark-member-download-table a {
    color: #1677ff;
}

/* Article download sidebar overrides. This stylesheet loads after the theme CSS. */
.single-download-sidebar{position:absolute;top:0;right:calc(0px - var(--theme-sidebar-width) - var(--theme-content-sidebar-gap) - 20px);z-index:2;width:var(--theme-sidebar-width);margin:0!important;text-indent:0;text-align:left}
.single-download-slot{position:static;width:auto;margin:0!important}
.single-download-slot .quark-download-container{overflow:hidden;padding:0;border:1px solid #e3e7ed;border-radius:4px;background:var(--theme-el-bg-color,#fff);box-shadow:0 2px 8px rgba(31,41,55,.05)}
.single-download-slot .quark-download-heading{min-height:54px;margin:0;padding:0 15px;gap:10px;flex-direction:row;align-items:center;justify-content:space-between;background:#2f3640}
.single-download-slot .quark-download-heading p{display:contents;margin:0;padding:0}
.single-download-slot .quark-download-heading p:before,.single-download-slot .quark-download-heading p:after{display:none!important;content:none!important}
.single-download-slot .quark-download-title{width:auto;min-width:0;margin:0;color:#fff;font-size:17px!important;font-weight:600;line-height:1.35;text-align:left;white-space:normal}
.single-download-slot .quark-download-title:before,.single-download-slot .quark-download-title:after{display:none!important;content:none!important}
.single-download-slot .quark-invalid-link-toggle{display:block!important;align-self:center;flex:0 0 auto;margin-left:auto;padding:4px 0;border:0;background:transparent!important;color:#c8e5ff;font-size:12px!important;line-height:1.4!important;white-space:nowrap}
.single-download-slot .quark-invalid-link-toggle:hover{color:#fff}
.single-download-slot .quark-download-divider{display:none}
.single-download-slot .quark-invalid-link-panel{margin:10px 15px 0;padding:11px 12px;border:1px solid #dbe9f8;border-radius:4px;background:#f7fbff;line-height:1.6}
.single-download-slot .quark-invalid-link-label{display:block;margin:0 0 7px;color:#4b5563}
.single-download-slot .quark-invalid-link-options{display:flex;gap:7px;margin:0}
.single-download-slot .quark-invalid-link-result:empty{display:none!important;min-height:0;margin:0}
.single-download-slot .quark-invalid-link-result:not(:empty){display:block;min-height:0;margin:8px 0 0;padding-top:8px;border-top:1px solid #e3edf7}
.single-download-slot .quark-resource-meta{display:block;margin:15px;padding:10px 14px;border:1px solid #e5e7eb;border-radius:2px;background:var(--theme-el-bg-color,#fff)}
.single-download-slot .quark-resource-meta br,.single-download-slot .quark-download-buttons br{display:none!important}
.single-download-slot .quark-resource-meta-item{display:flex;min-height:0;padding:4px 0;color:#374151;font-size:14px!important}
.single-download-slot .quark-resource-meta-item strong{flex:0 0 52px;color:#4b5563}
.single-download-slot .quark-category-link,.single-download-slot .quark-category-link:visited,.single-download-slot .quark-resolution-link,.single-download-slot .quark-resolution-link:visited{color:var(--theme-color,#168bf2)!important;font-weight:500;text-decoration:none}
.single-download-slot .quark-category-link:hover,.single-download-slot .quark-resolution-link:hover{color:var(--theme-hover,#087bef)!important;text-decoration:underline}
.single-download-slot .quark-download-buttons{display:flex;flex-direction:column;gap:10px;margin:0 15px 15px}
.single-download-slot .quark-external-download-item{width:100%;min-width:0}
.single-download-slot .quark-external-download-notice{width:100%;font-size:13px!important}
.single-download-slot .quark-download-button{width:100%;min-width:0;min-height:42px;border-radius:3px}
.single-download-slot .quark-external-download-item .quark-external-download-button{border-radius:3px 3px 0 0}
.single-download-sidebar>.quark-warm-tip,.single-download-sidebar>.quark-extra-slot{margin:14px 0 0;border:1px solid #e3e7ed;border-radius:4px;background:var(--theme-el-bg-color,#fff);box-shadow:0 2px 8px rgba(31,41,55,.05);color:#555f6c;font-size:14px!important;line-height:1.7;box-sizing:border-box}
.single-download-sidebar>.quark-extra-slot{text-align:center;line-height:1.4}
.single-download-sidebar>.quark-extra-slot img,.single-download-sidebar>.quark-extra-slot iframe{display:block;max-width:100%;height:auto;margin:0 auto}
.single-download-slot p:empty{display:none!important}
@media (min-width:992px){.single-download-sidebar{top:-64px}}
@media (max-width:991px){.single-download-sidebar{position:static;top:auto;right:auto;width:100%;margin:20px 0 16px!important}.single-download-slot .quark-download-heading{min-height:52px;padding:0 14px}.single-download-slot .quark-download-title{font-size:16px!important}.single-download-slot .quark-invalid-link-panel{margin:10px 12px 0}.single-download-slot .quark-resource-meta{margin:12px;padding:9px 12px}.single-download-slot .quark-resource-meta-item{padding:4px 0;font-size:13px!important}.single-download-slot .quark-resource-meta-item strong{flex-basis:48px}.single-download-slot .quark-download-buttons{gap:9px;margin:0 12px 12px}.single-download-sidebar>.quark-warm-tip,.single-download-sidebar>.quark-extra-slot{margin-top:12px;}}

/* WordPress editor dialog for inserting the download shortcode. */
#quark-download-editor-dialog{position:fixed;inset:0;z-index:100000;display:flex;align-items:center;justify-content:center;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif}
#quark-download-editor-dialog .quark-editor-backdrop{position:absolute;inset:0;background:rgba(15,23,42,.45)}
#quark-download-editor-dialog .quark-editor-box{position:relative;width:min(560px,calc(100vw - 32px));max-height:calc(100vh - 40px);overflow:auto;background:#fff;border:1px solid #d9e0e8;border-radius:6px;box-shadow:0 16px 45px rgba(15,23,42,.22);color:#1f2937}
#quark-download-editor-dialog .quark-editor-head{display:flex;align-items:center;justify-content:space-between;padding:15px 18px;border-bottom:1px solid #e5e7eb;font-size:16px}
#quark-download-editor-dialog .quark-editor-close{width:30px;height:30px;padding:0;border:0;background:transparent;color:#6b7280;font-size:24px;line-height:30px;cursor:pointer}
#quark-download-editor-dialog .quark-editor-body{padding:16px 18px 6px}
#quark-download-editor-dialog .quark-editor-row,#quark-download-editor-dialog .quark-editor-upload-row{display:flex;align-items:center;gap:12px;margin:0 0 12px}
#quark-download-editor-dialog .quark-editor-row label,#quark-download-editor-dialog .quark-editor-upload-row label{flex:0 0 82px;color:#374151;font-size:13px}
#quark-download-editor-dialog .quark-editor-row input[type=text]{flex:1;min-width:0;height:34px;padding:5px 9px;border:1px solid #cbd5e1;border-radius:3px;box-sizing:border-box}
#quark-download-editor-dialog .quark-editor-row input[type=text]:focus{border-color:#2271b1;outline:0;box-shadow:0 0 0 1px #2271b1}
#quark-download-editor-dialog .quark-editor-upload-row input[type=file]{flex:1;min-width:0}
#quark-download-editor-dialog .quark-editor-foot{display:flex;align-items:center;gap:8px;padding:12px 18px 16px;border-top:1px solid #e5e7eb}
#quark-download-editor-dialog .quark-editor-status{flex:1;min-width:0;color:#64748b;font-size:12px;line-height:1.4}
#quark-download-editor-dialog .button{min-height:32px}
@media (max-width:600px){#quark-download-editor-dialog .quark-editor-row,#quark-download-editor-dialog .quark-editor-upload-row{display:block}#quark-download-editor-dialog .quark-editor-row label,#quark-download-editor-dialog .quark-editor-upload-row label{display:block;margin:0 0 4px}#quark-download-editor-dialog .quark-editor-row input[type=text]{width:100%}#quark-download-editor-dialog .quark-editor-upload-row input[type=file]{display:block;width:100%;margin-bottom:8px}}
