:root {
    --bg: #f5f6f8;
    --surface: #ffffff;
    --surface-soft: #f8fafc;
    --text: #172033;
    --muted: #667085;
    --line: #e7e9ef;
    --primary: #ef1717;
    --primary-dark: #cf0000;
    --accent: #5b5ce2;
    --radius: 18px;
    --shadow: 0 14px 36px rgba(24, 34, 58, 0.08);
    --shadow-hover: 0 20px 48px rgba(24, 34, 58, 0.14);
}

* {
    box-sizing: border-box;
}

html {
    color-scheme: light;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-width: 320px;
    background: var(--bg);
    color: var(--text);
    font-family:
        Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
        "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
        sans-serif;
    line-height: 1.6;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    display: block;
    max-width: 100%;
}

button,
input {
    font: inherit;
}

.shell {
    width: min(1500px, calc(100% - 36px));
    margin: 0 auto;
}

.site-header {
    position: sticky;
    z-index: 50;
    top: 0;
    border-bottom: 1px solid rgba(228, 232, 240, 0.9);
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(18px);
}

.header-inner {
    min-height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

.brand-mark {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: linear-gradient(135deg, #ef1717, #ff684f);
    color: white;
    font-size: 22px;
    font-weight: 900;
    box-shadow: 0 10px 22px rgba(239, 23, 23, 0.25);
}

.brand strong,
.brand small {
    display: block;
}

.brand strong {
    line-height: 1.2;
    font-size: 17px;
}

.brand small {
    margin-top: 3px;
    color: var(--muted);
    font-size: 12px;
}

.header-stat {
    display: flex;
    align-items: baseline;
    gap: 8px;
    color: var(--muted);
    font-size: 13px;
}

.header-stat strong {
    color: var(--text);
    font-size: 22px;
}

/* 展开式分类 */
.category-panel {
    margin-top: 24px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--surface);
    box-shadow: 0 8px 24px rgba(24, 34, 58, 0.045);
}

.category-row {
    display: grid;
    grid-template-columns: 76px minmax(0, 1fr);
    gap: 16px;
    align-items: start;
    padding: 18px 20px;
    border-bottom: 1px dashed var(--line);
}

.category-label {
    padding-top: 7px;
    font-size: 16px;
    white-space: nowrap;
}

.category-options {
    display: flex;
    flex-wrap: wrap;
    gap: 9px 12px;
}

.category-pill {
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 16px;
    border-radius: 999px;
    color: #273047;
    font-size: 14px;
    transition: background 0.18s, color 0.18s, transform 0.18s;
}

.category-pill:hover {
    background: #fff0f0;
    color: var(--primary);
}

.category-pill.active {
    background: var(--primary);
    color: white;
    font-weight: 800;
    box-shadow: 0 7px 18px rgba(239, 23, 23, 0.2);
}

.expanded-search {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 20px;
}

.expanded-search input[type="search"] {
    width: min(520px, 100%);
    min-height: 44px;
    border: 1px solid var(--line);
    border-radius: 12px;
    outline: none;
    background: var(--surface-soft);
    padding: 0 14px;
}

.expanded-search input[type="search"]:focus {
    border-color: rgba(239, 23, 23, 0.55);
    box-shadow: 0 0 0 4px rgba(239, 23, 23, 0.08);
}

.clear-search {
    color: var(--muted);
    font-size: 13px;
}

.clear-search:hover {
    color: var(--primary);
}

.primary-button,
.secondary-button,
.card-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 800;
    transition: transform 0.2s, background 0.2s, box-shadow 0.2s;
}

.primary-button {
    min-height: 44px;
    padding: 0 20px;
    background: var(--primary);
    color: white;
    box-shadow: 0 8px 18px rgba(239, 23, 23, 0.2);
}

.primary-button:hover {
    transform: translateY(-1px);
    background: var(--primary-dark);
}

/* 顶部纯图片位置 */
.home-banner {
    position: relative;
    overflow: hidden;
    margin: 22px 0 0;
    min-height: 230px;
    aspect-ratio: 15 / 3.6;
    border-radius: 24px;
    background:
        radial-gradient(circle at 85% 15%, rgba(255,255,255,.14), transparent 18%),
        linear-gradient(120deg, #13172e, #302a78 58%, #4c3ba3);
    box-shadow: var(--shadow);
}

.home-banner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.home-banner.banner-error::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 82% 22%, rgba(255,255,255,.12), transparent 20%),
        linear-gradient(120deg, #13172e, #302a78 58%, #4c3ba3);
}

.result-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 20px;
    margin: 30px 0 16px;
}

.result-heading h1 {
    margin: 7px 0 0;
    font-size: 26px;
}

.result-heading > p,
.breadcrumb {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
}

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.breadcrumb a:hover,
.detail-breadcrumb a:hover {
    color: var(--primary);
}

/* 桌面端每行五列 */
.card-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 18px;
}

.resource-card {
    overflow: hidden;
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: 0 8px 24px rgba(24, 34, 58, 0.05);
    transition: transform 0.23s ease, box-shadow 0.23s ease;
}

.resource-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.card-image {
    position: relative;
    display: grid;
    place-items: center;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background:
        linear-gradient(135deg, rgba(91, 92, 226, 0.1), rgba(239, 23, 23, 0.05)),
        #edf0f7;
}

.card-image img {
    position: relative;
    z-index: 2;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.resource-card:hover .card-image img {
    transform: scale(1.035);
}

.image-fallback {
    position: absolute;
    z-index: 1;
    color: var(--muted);
    font-size: 13px;
}

.card-image.image-error .image-fallback,
.main-preview.image-error .image-fallback {
    z-index: 3;
}

.file-badge {
    position: absolute;
    z-index: 4;
    top: 11px;
    right: 11px;
    min-width: 40px;
    padding: 4px 7px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    background: rgba(17, 24, 39, 0.74);
    color: white;
    text-align: center;
    font-size: 9px;
    font-weight: 900;
    letter-spacing: 0.04em;
    backdrop-filter: blur(8px);
}

.card-body {
    padding: 16px;
}

.card-category {
    overflow: hidden;
    margin: 0 0 6px;
    color: var(--primary);
    font-size: 11px;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.card-body h2 {
    min-height: 49px;
    margin: 0;
    font-size: 16px;
    line-height: 1.48;
}

.card-body h2 a:hover {
    color: var(--primary);
}

.card-intro {
    min-height: 45px;
    margin: 9px 0 13px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.7;
}

.card-meta {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 11px;
}

.card-action {
    width: 100%;
    min-height: 40px;
    justify-content: space-between;
    margin-top: 13px;
    padding: 0 13px;
    background: #fff0f0;
    color: var(--primary-dark);
    font-size: 12px;
}

.card-action:hover {
    background: #ffe2e2;
}

.secondary-button {
    min-height: 44px;
    padding: 0 20px;
    border: 1px solid var(--line);
    background: var(--surface);
}

.pagination {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin: 40px 0 20px;
}

.pagination a,
.pagination strong,
.pagination span {
    min-width: 40px;
    min-height: 40px;
    display: grid;
    place-items: center;
    padding: 0 11px;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: var(--surface);
    font-size: 13px;
}

.pagination strong {
    border-color: var(--primary);
    background: var(--primary);
    color: white;
}

.pagination .disabled {
    color: #b5bdc9;
    background: #f7f8fa;
}

.empty-state {
    display: grid;
    justify-items: center;
    margin: 30px 0 60px;
    padding: 75px 20px;
    border: 1px dashed #ccd2dd;
    border-radius: var(--radius);
    background: var(--surface);
    text-align: center;
}

.empty-icon {
    width: 64px;
    height: 64px;
    display: grid;
    place-items: center;
    border-radius: 18px;
    background: #fff0f0;
    color: var(--primary);
    font-size: 32px;
}

.empty-state h2 {
    margin: 18px 0 4px;
}

.empty-state p {
    margin: 0 0 20px;
    color: var(--muted);
}

.site-footer {
    margin-top: 54px;
    padding: 26px 0;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 13px;
}

/* 下载详情页 */
.compact-header .header-inner {
    min-height: 68px;
}

.detail-shell {
    padding-top: 28px;
}

.detail-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 18px;
    color: var(--muted);
    font-size: 13px;
}

.detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.12fr) minmax(420px, 0.88fr);
    gap: 28px;
    align-items: start;
}

.gallery-panel,
.download-panel {
    border: 1px solid var(--line);
    border-radius: 22px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.gallery-panel {
    overflow: hidden;
    padding: 18px;
}

.main-preview {
    position: relative;
    display: grid;
    place-items: center;
    min-height: 520px;
    overflow: hidden;
    border-radius: 17px;
    background:
        linear-gradient(135deg, rgba(91, 92, 226, 0.09), rgba(239, 23, 23, 0.05)),
        #eef1f6;
}

.main-preview img {
    width: 100%;
    height: auto;
    max-height: 72vh;
    object-fit: contain;
}

.thumbnail-strip {
    display: flex;
    gap: 10px;
    margin-top: 14px;
    overflow-x: auto;
    padding-bottom: 3px;
}

.thumbnail-button {
    flex: 0 0 88px;
    height: 68px;
    overflow: hidden;
    padding: 3px;
    border: 2px solid transparent;
    border-radius: 12px;
    background: #edf0f5;
    cursor: pointer;
}

.thumbnail-button.active {
    border-color: var(--primary);
}

.thumbnail-button img {
    width: 100%;
    height: 100%;
    border-radius: 8px;
    object-fit: cover;
}

.download-panel {
    position: sticky;
    top: 96px;
    padding: 30px;
}

.detail-category {
    margin: 0;
    color: var(--primary);
    font-size: 12px;
    font-weight: 800;
}

.download-panel > h1 {
    margin: 9px 0 13px;
    font-size: clamp(27px, 3vw, 39px);
    line-height: 1.28;
    letter-spacing: -0.025em;
}

.detail-intro {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
}

.resource-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin: 24px 0;
}

.resource-stats div {
    padding: 13px 15px;
    border-radius: 13px;
    background: var(--surface-soft);
}

.resource-stats dt {
    color: var(--muted);
    font-size: 11px;
}

.resource-stats dd {
    margin: 3px 0 0;
    font-weight: 800;
}

.download-list {
    padding-top: 22px;
    border-top: 1px solid var(--line);
}

.download-list h2 {
    margin: 0 0 13px;
    font-size: 17px;
}

.download-item {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    padding: 15px;
    border: 1px solid var(--line);
    border-radius: 15px;
}

.download-item + .download-item {
    margin-top: 10px;
}

.file-icon {
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    overflow: hidden;
    border-radius: 13px;
    background: #eef0ff;
    color: var(--accent);
    font-size: 10px;
    font-weight: 900;
}

.file-info {
    min-width: 0;
}

.file-info strong,
.file-info span {
    display: block;
}

.file-info strong {
    overflow: hidden;
    font-size: 16px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-info span {
    color: var(--muted);
    font-size: 13px;
}

.download-button {
    min-height: 42px;
    padding: 0 18px;
    font-size: 13px;
}

.disabled-download,
.download-empty {
    color: var(--muted);
    font-size: 13px;
}

.download-empty {
    padding: 18px;
    border-radius: 12px;
    background: #fff4f4;
}

@media (max-width: 1320px) {
    .card-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 1060px) {
    .card-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .detail-layout {
        grid-template-columns: 1fr;
    }

    .download-panel {
        position: static;
    }
}

@media (max-width: 760px) {
    .shell {
        width: min(100% - 22px, 1500px);
    }

    .header-stat {
        display: none;
    }

    .category-row {
        grid-template-columns: 1fr;
        gap: 8px;
        padding: 15px;
    }

    .category-label {
        padding-top: 0;
    }

    .category-options {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 3px;
    }

    .category-pill {
        flex: 0 0 auto;
    }

    .expanded-search {
        align-items: stretch;
        flex-wrap: wrap;
        padding: 15px;
    }

    .expanded-search input[type="search"] {
        flex: 1 1 230px;
    }

    .home-banner {
        min-height: 150px;
        border-radius: 18px;
    }

    .card-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 13px;
    }

    .card-body {
        padding: 13px;
    }

    .card-body h2 {
        min-height: 46px;
        font-size: 15px;
    }

    .card-intro {
        display: none;
    }

    .card-meta {
        display: grid;
        gap: 3px;
    }

    .result-heading {
        align-items: start;
    }

    .main-preview {
        min-height: 330px;
    }

    .download-panel {
        padding: 22px;
    }
}

@media (max-width: 480px) {
    .card-grid {
        grid-template-columns: 1fr;
    }

    .resource-card {
        display: grid;
        grid-template-columns: 42% 58%;
    }

    .card-image {
        height: 100%;
        min-height: 188px;
        aspect-ratio: auto;
    }

    .card-body h2 {
        min-height: 0;
    }

    .card-category {
        white-space: normal;
    }

    .download-item {
        grid-template-columns: 46px minmax(0, 1fr);
    }

    .download-button,
    .disabled-download {
        grid-column: 1 / -1;
        width: 100%;
    }
}


/* =========================================================
   V3 用户、积分下载和后台
   ========================================================= */

.account-nav {
    display: flex;
    align-items: center;
    gap: 8px;
}

.account-nav > a,
.account-nav button {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    padding: 0 14px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--text);
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
}

.account-nav > a:hover,
.account-nav button:hover {
    background: #f3f4f7;
}

.account-nav .nav-register {
    background: var(--primary);
    color: white;
}

.account-nav form {
    margin: 0;
}

.page-alert {
    margin-top: 18px;
}

.alert {
    margin-bottom: 18px;
    padding: 13px 16px;
    border-radius: 12px;
    font-size: 14px;
}

.alert-success {
    border: 1px solid #b8e6ce;
    background: #ecfbf3;
    color: #17653e;
}

.alert-error {
    border: 1px solid #ffc5c5;
    background: #fff1f1;
    color: #a51414;
}


.access-card {
    margin: 22px 0;
    padding: 16px 18px;
    border-radius: 15px;
    background: #f7f8fb;
}

.access-card strong,
.access-card p {
    display: block;
    margin: 0;
}

.access-card strong {
    font-size: 17px;
}

.access-card p {
    margin-top: 4px;
    color: var(--muted);
    font-size: 13px;
}

.access-permanent,
.access-purchased,
.access-free {
    background: #eafaf2;
    color: #12643b;
}

.access-points {
    background: #fff6e7;
    color: #8b5600;
}

.access-insufficient,
.access-login {
    background: #fff0f0;
    color: #a41616;
}

.download-form {
    margin: 0;
}

/* 登录注册 */
.auth-body {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background:
        radial-gradient(circle at 15% 15%, rgba(239, 23, 23, 0.12), transparent 28rem),
        linear-gradient(135deg, #f5f6f8, #eef0f7);
}

.auth-shell {
    width: min(460px, 100%);
}

.auth-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 11px;
    margin-bottom: 18px;
}

.auth-card {
    padding: 34px;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: white;
    box-shadow: var(--shadow);
}

.auth-eyebrow {
    margin: 0;
    color: var(--primary);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .14em;
}

.auth-card h1 {
    margin: 7px 0 5px;
    font-size: 30px;
}

.auth-note {
    margin: 0 0 22px;
    color: var(--muted);
    font-size: 13px;
}

.auth-form {
    display: grid;
    gap: 15px;
}

.auth-form label,
.admin-form label {
    display: grid;
    gap: 7px;
}

.auth-form label > span,
.admin-form label > span {
    color: #4d5669;
    font-size: 13px;
    font-weight: 700;
}

.auth-form input,
.admin-form input,
.admin-form select,
.admin-filter input,
.admin-filter select {
    width: 100%;
    min-height: 44px;
    border: 1px solid var(--line);
    border-radius: 11px;
    outline: none;
    background: #fafbfc;
    padding: 0 13px;
}

.auth-form input:focus,
.admin-form input:focus,
.admin-form select:focus,
.admin-filter input:focus,
.admin-filter select:focus {
    border-color: rgba(239, 23, 23, .55);
    box-shadow: 0 0 0 4px rgba(239, 23, 23, .08);
}

.auth-submit {
    width: 100%;
    margin-top: 4px;
}

.auth-switch {
    margin: 20px 0 0;
    color: var(--muted);
    text-align: center;
    font-size: 13px;
}

.auth-switch a {
    color: var(--primary);
    font-weight: 800;
}

/* 账户页 */
.account-page {
    padding-top: 30px;
}

.account-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 22px;
    padding: 32px;
    border-radius: 22px;
    background: linear-gradient(120deg, #151a35, #40358e);
    color: white;
}

.account-hero p,
.account-hero h1 {
    margin: 0;
}

.account-hero p {
    color: #c9c8ff;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .15em;
}

.account-hero h1 {
    margin-top: 7px;
    font-size: 34px;
}

.account-hero div > span {
    color: rgba(255,255,255,.72);
}

.permanent-badge,
.normal-badge {
    padding: 9px 14px;
    border-radius: 999px;
    background: rgba(255,255,255,.16);
    font-size: 13px;
}

.account-stat-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-top: 18px;
}

.account-stat-grid article {
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: white;
}

.account-stat-grid span,
.account-stat-grid strong {
    display: block;
}

.account-stat-grid span {
    color: var(--muted);
    font-size: 12px;
}

.account-stat-grid strong {
    margin-top: 5px;
    font-size: 21px;
}

.account-section {
    margin-top: 25px;
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: white;
}

.section-title {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 16px;
}

.section-title p,
.section-title h2 {
    margin: 0;
}

.section-title p {
    color: var(--primary);
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .12em;
}

.section-title h2 {
    margin-top: 4px;
}

.section-title > a {
    color: var(--primary);
    font-size: 13px;
    font-weight: 800;
}

.account-order-list {
    display: grid;
    gap: 9px;
}

.account-order-list article {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 18px;
    padding: 14px 16px;
    border-radius: 12px;
    background: #f8f9fb;
}

.account-order-list strong,
.account-order-list small,
.account-order-list div > span {
    display: block;
}

.account-order-list div > span {
    color: var(--muted);
    font-size: 11px;
}

.account-order-list > article > span {
    color: var(--primary);
    font-weight: 800;
}

.account-order-list a {
    font-size: 13px;
    font-weight: 800;
}

.empty-inline {
    padding: 24px;
    border-radius: 12px;
    background: #f8f9fb;
    color: var(--muted);
    text-align: center;
}

/* 后台 */
.admin-body {
    background: #f1f3f7;
}

.admin-layout {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 230px minmax(0, 1fr);
}

.admin-sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 22px 16px;
    background: #151a35;
    color: white;
}

.admin-logo {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 0 8px 20px;
}

.admin-sidebar nav {
    display: grid;
    gap: 7px;
}

.admin-sidebar nav a {
    padding: 11px 13px;
    border-radius: 10px;
    color: rgba(255,255,255,.72);
    font-size: 14px;
    font-weight: 700;
}

.admin-sidebar nav a:hover,
.admin-sidebar nav a.active {
    background: rgba(255,255,255,.11);
    color: white;
}

.admin-user {
    margin-top: auto;
    padding: 15px;
    border-radius: 12px;
    background: rgba(255,255,255,.08);
}

.admin-user span,
.admin-user strong {
    display: block;
}

.admin-user span {
    color: rgba(255,255,255,.55);
    font-size: 11px;
}

.admin-main {
    min-width: 0;
    padding: 28px;
}

.admin-topbar {
    margin-bottom: 20px;
}

.admin-topbar p,
.admin-topbar h1 {
    margin: 0;
}

.admin-topbar p,
.admin-card-title p {
    color: var(--primary);
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .14em;
}

.admin-topbar h1 {
    margin-top: 3px;
    font-size: 30px;
}

.admin-stat-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
}

.admin-stat-grid article {
    padding: 22px;
    border-radius: 16px;
    background: white;
    box-shadow: 0 8px 24px rgba(24,34,58,.05);
}

.admin-stat-grid span,
.admin-stat-grid strong {
    display: block;
}

.admin-stat-grid span {
    color: var(--muted);
    font-size: 12px;
}

.admin-stat-grid strong {
    margin-top: 6px;
    font-size: 27px;
}

.admin-card {
    margin-top: 20px;
    padding: 22px;
    border-radius: 17px;
    background: white;
    box-shadow: 0 8px 24px rgba(24,34,58,.045);
}

.admin-card-title {
    margin-bottom: 17px;
}

.admin-card-title p,
.admin-card-title h2 {
    margin: 0;
}

.admin-card-title h2 {
    margin-top: 3px;
}

.admin-card-title-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.quick-actions {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.quick-actions a {
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 12px;
    font-weight: 800;
}

.quick-actions a:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.admin-filter {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) 220px auto;
    gap: 10px;
    margin-bottom: 16px;
}

.admin-table-wrap {
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.admin-table th,
.admin-table td {
    padding: 13px 12px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: middle;
}

.admin-table th {
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
}

.admin-table td strong,
.admin-table td small {
    display: block;
}

.admin-table td small {
    color: var(--muted);
}

.table-action {
    color: var(--primary);
    font-weight: 800;
}

.status-tag {
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
}

.status-ok {
    background: #e9f9f1;
    color: #17643e;
}

.status-danger {
    background: #fff0f0;
    color: #aa1919;
}

.admin-pagination {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 18px;
}

.admin-pagination a,
.admin-pagination span {
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: 9px;
    font-size: 13px;
}

.admin-form-card {
    max-width: 820px;
}

.admin-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.admin-form label > small {
    color: var(--muted);
    font-size: 11px;
}

.checkbox-label {
    grid-template-columns: auto 1fr !important;
    align-items: center;
    align-self: end;
    min-height: 44px;
}

.checkbox-label input {
    width: 18px;
    min-height: 18px;
}

.admin-form-actions {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 14px;
    padding-top: 5px;
}

.admin-form-actions > a {
    color: var(--muted);
    font-size: 13px;
}

@media (max-width: 980px) {
    .account-stat-grid,
    .admin-stat-grid,
    .quick-actions {
        grid-template-columns: repeat(2, 1fr);
    }

    .admin-layout {
        grid-template-columns: 1fr;
    }

    .admin-sidebar {
        position: static;
        height: auto;
    }

    .admin-sidebar nav {
        display: flex;
        flex-wrap: wrap;
    }

    .admin-user {
        display: none;
    }
}

@media (max-width: 700px) {
    .account-nav > a,
    .account-nav button {
        padding: 0 9px;
    }

    .account-stat-grid,
    .admin-stat-grid,
    .quick-actions,
    .admin-form {
        grid-template-columns: 1fr;
    }

    .account-order-list article {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .admin-main {
        padding: 16px;
    }

    .admin-filter {
        grid-template-columns: 1fr;
    }

    .account-hero {
        align-items: flex-start;
        flex-direction: column;
    }
}


/* V3.1：用户中心只显示积分、会员组和注册时间。 */
.account-stat-grid-three {
    grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 700px) {
    .account-stat-grid-three {
        grid-template-columns: 1fr;
    }
}


/* =========================================================
   V4 会员商城、会员组管理和虎皮椒支付
   ========================================================= */

.stat-link {
    display: inline-block;
    margin-top: 9px;
    color: var(--primary);
    font-size: 12px;
    font-weight: 800;
}

.shop-page {
    padding-top: 28px;
    padding-bottom: 45px;
}

.shop-hero {
    padding: 34px;
    border-radius: 22px;
    background: linear-gradient(120deg, #151a35, #40358e);
    color: white;
}

.shop-hero p,
.shop-hero h1 {
    margin: 0;
}

.shop-hero p {
    color: #c9c8ff;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .15em;
}

.shop-hero h1 {
    margin-top: 7px;
    font-size: 36px;
}

.shop-hero span {
    color: rgba(255,255,255,.75);
}

.membership-hero {
    background: linear-gradient(120deg, #261c14, #a75a18);
}

.shop-empty {
    margin-top: 20px;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    margin-top: 20px;
}

.shop-product {
    display: flex;
    flex-direction: column;
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: white;
    box-shadow: 0 10px 28px rgba(24,34,58,.055);
}

.shop-product > p:first-child {
    margin: 0;
    color: var(--primary);
    font-size: 11px;
    font-weight: 900;
}

.shop-product h2 {
    min-height: 54px;
    margin: 5px 0;
    font-size: 21px;
}

.product-value {
    color: #3e4780;
    font-size: 18px;
}

.product-price {
    margin-top: 15px;
    color: var(--primary);
    font-size: 34px;
    font-weight: 900;
}

.product-price small {
    margin-right: 2px;
    font-size: 17px;
}

.product-description {
    min-height: 48px;
    color: var(--muted);
    font-size: 13px;
}

.plan-feature {
    display: inline-flex;
    align-self: flex-start;
    margin-bottom: 13px;
    padding: 5px 9px;
    border-radius: 999px;
    background: #e9f9f1;
    color: #17643e;
    font-size: 11px;
    font-weight: 800;
}

.shop-product form {
    margin-top: auto;
}

.product-buy {
    width: 100%;
}

.payment-body {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background:
        radial-gradient(circle at 15% 15%, rgba(30, 183, 83, .12), transparent 28rem),
        #f3f5f8;
}

.payment-shell {
    width: min(470px, 100%);
}

.payment-card {
    padding: 32px;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: white;
    text-align: center;
    box-shadow: var(--shadow);
}

.payment-card h1 {
    margin: 6px 0 3px;
}

.payment-title {
    margin: 0;
    color: var(--muted);
}

.payment-amount {
    margin: 10px 0 16px;
    font-size: 35px;
    font-weight: 900;
}

.payment-qr {
    width: 250px;
    height: 250px;
    display: grid;
    place-items: center;
    margin: 0 auto;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: white;
}

.payment-qr img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.payment-tip {
    margin: 15px 0;
    color: var(--muted);
    font-size: 13px;
}

.payment-open {
    margin-bottom: 12px;
}

.payment-wait {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 13px;
    color: #4e596d;
    font-size: 13px;
}

.payment-spinner {
    width: 15px;
    height: 15px;
    border: 2px solid #dce0e7;
    border-top-color: #18a552;
    border-radius: 50%;
    animation: payment-spin .9s linear infinite;
}

@keyframes payment-spin {
    to { transform: rotate(360deg); }
}

.payment-cancel {
    display: inline-block;
    margin-top: 14px;
    color: var(--muted);
    font-size: 13px;
}

.payment-result strong {
    display: block;
    margin-top: 10px;
}

.result-icon {
    width: 68px;
    height: 68px;
    display: grid;
    place-items: center;
    margin: 0 auto;
    border-radius: 50%;
    font-size: 34px;
    font-weight: 900;
}

.result-success {
    background: #e7f9ef;
    color: #16894b;
}

.result-waiting {
    background: #fff4df;
    color: #a66a00;
}

.result-button {
    width: 100%;
    margin-top: 22px;
}

.admin-two-column {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(360px, .85fr);
    gap: 20px;
}

.admin-two-column > .admin-card {
    margin-top: 0;
}

.admin-form-single {
    grid-template-columns: 1fr;
}

.admin-form-full {
    grid-column: 1 / -1;
}

.admin-form textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 11px;
    outline: none;
    background: #fafbfc;
    padding: 11px 13px;
    resize: vertical;
    font: inherit;
}

.admin-form textarea:focus {
    border-color: rgba(239,23,23,.55);
    box-shadow: 0 0 0 4px rgba(239,23,23,.08);
}

.inline-delete-form {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
}

.inline-delete-form button,
.danger-zone button {
    border: 0;
    background: transparent;
    color: #b41414;
    cursor: pointer;
    font-weight: 800;
}

.inline-delete-form button:disabled,
.danger-zone button:disabled {
    color: #adb3be;
    cursor: not-allowed;
}

.danger-zone {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-top: 24px;
    padding: 17px;
    border: 1px solid #ffcaca;
    border-radius: 13px;
    background: #fff5f5;
}

.danger-zone strong,
.danger-zone p {
    display: block;
    margin: 0;
}

.danger-zone p {
    margin-top: 3px;
    color: var(--muted);
    font-size: 12px;
}

.payment-config-note {
    margin-bottom: 20px;
    padding: 15px;
    border-radius: 12px;
    background: #f7f8fb;
}

.payment-config-note strong,
.payment-config-note code,
.payment-config-note p {
    display: block;
}

.payment-config-note code {
    margin-top: 6px;
    overflow-wrap: anywhere;
    color: #2e3e70;
}

.payment-config-note p {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 12px;
}

.compact-filter select {
    min-height: 39px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: white;
    padding: 0 10px;
}

.muted-text {
    color: var(--muted);
    font-size: 12px;
}

@media (max-width: 1100px) {
    .product-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .admin-two-column {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .product-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .account-nav a:first-child,
    .account-nav a:nth-child(2) {
        display: none;
    }
}

@media (max-width: 500px) {
    .product-grid {
        grid-template-columns: 1fr;
    }

    .payment-card {
        padding: 23px;
    }

    .payment-qr {
        width: 220px;
        height: 220px;
    }

    .danger-zone {
        align-items: flex-start;
        flex-direction: column;
    }
}


/* =========================================================
   V4.2 网站资源管理
   ========================================================= */

.resource-storage-status {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
    padding: 13px 16px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: white;
}

.resource-storage-status strong {
    flex: 0 0 auto;
    font-size: 13px;
}

.resource-storage-status code {
    min-width: 0;
    overflow-wrap: anywhere;
    color: #34406b;
    font-size: 12px;
}

.admin-resource-filter {
    display: grid;
    grid-template-columns: minmax(240px, 1fr) 240px 150px auto;
    gap: 10px;
    margin-bottom: 17px;
}

.admin-resource-filter input,
.admin-resource-filter select,
.resource-form-grid input,
.resource-form-grid select,
.resource-upload-grid input[type="file"],
.resource-upload-grid textarea,
.resource-existing-files input,
.resource-delete-form input {
    width: 100%;
    min-height: 44px;
    border: 1px solid var(--line);
    border-radius: 11px;
    outline: none;
    background: #fafbfc;
    padding: 0 13px;
    font: inherit;
}

.admin-resource-filter input:focus,
.admin-resource-filter select:focus,
.resource-form-grid input:focus,
.resource-form-grid select:focus,
.resource-upload-grid textarea:focus,
.resource-existing-files input:focus,
.resource-delete-form input:focus {
    border-color: rgba(239, 23, 23, .55);
    box-shadow: 0 0 0 4px rgba(239, 23, 23, .08);
}

.resource-admin-title {
    min-width: 270px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.resource-admin-title strong,
.resource-admin-title small {
    display: block;
}

.resource-admin-title small {
    margin-top: 3px;
    color: var(--muted);
}

.resource-admin-thumb {
    width: 68px;
    height: 50px;
    flex: 0 0 68px;
    display: grid;
    place-items: center;
    overflow: hidden;
    border-radius: 9px;
    background: #f0f2f6;
    color: var(--muted);
    font-size: 11px;
}

.resource-admin-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.resource-row-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
    font-size: 12px;
    font-weight: 800;
}

.danger-link {
    color: #b41414;
    font-weight: 800;
}

.resource-editor {
    display: grid;
    gap: 20px;
}

.resource-editor > .admin-card {
    margin-top: 0;
}

.resource-editor-top-actions {
    display: flex;
    align-items: center;
    gap: 13px;
}

.resource-editor-top-actions > a {
    font-size: 13px;
    font-weight: 800;
}

.resource-form-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.resource-form-grid label,
.resource-upload-grid label,
.resource-existing-files label,
.resource-delete-form label {
    display: grid;
    gap: 7px;
}

.resource-form-grid label > span,
.resource-upload-grid label > span,
.resource-existing-files label > span,
.resource-delete-form label > span {
    color: #4d5669;
    font-size: 13px;
    font-weight: 700;
}

.resource-form-grid textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 11px;
    outline: none;
    background: #fafbfc;
    padding: 12px 13px;
    resize: vertical;
    font: inherit;
}

.resource-existing-images {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 14px;
}

.resource-existing-images article {
    min-width: 0;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: #fafbfc;
}

.resource-existing-image {
    aspect-ratio: 4 / 3;
    display: grid;
    place-items: center;
    overflow: hidden;
    border-radius: 9px;
    background: #edf0f4;
    color: var(--muted);
    font-size: 11px;
}

.resource-existing-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.resource-cover-choice,
.resource-remove-choice {
    display: flex !important;
    grid-template-columns: auto 1fr !important;
    align-items: center;
    gap: 7px !important;
    margin-top: 9px;
    font-size: 12px;
}

.resource-cover-choice input,
.resource-remove-choice input {
    width: 16px;
    min-height: 16px;
}

.resource-existing-images article > small {
    display: block;
    margin-top: 7px;
    color: var(--muted);
    font-size: 11px;
}

.resource-upload-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-top: 18px;
}

.resource-upload-grid input[type="file"] {
    padding: 9px 11px;
}

.resource-upload-grid textarea {
    min-height: 120px;
    padding: 11px 13px;
    resize: vertical;
}

.resource-upload-grid small,
.resource-existing-files small {
    color: var(--muted);
    font-size: 11px;
    line-height: 1.6;
    overflow-wrap: anywhere;
}

.resource-existing-files {
    display: grid;
    gap: 10px;
}

.resource-existing-files article {
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr) 130px 130px;
    align-items: center;
    gap: 14px;
    padding: 13px;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: #fafbfc;
}

.resource-existing-files .file-icon {
    width: 52px;
    height: 52px;
}

.resource-file-size {
    color: #4e596d;
    font-size: 13px;
    font-weight: 800;
}

.resource-save-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 25px;
}

.resource-save-footer strong,
.resource-save-footer p {
    display: block;
    margin: 0;
}

.resource-save-footer p {
    margin-top: 4px;
    color: var(--muted);
    font-size: 12px;
}

.resource-delete-card {
    max-width: 980px;
}

.resource-delete-warning {
    margin-bottom: 18px;
    padding: 18px;
    border: 1px solid #ffcaca;
    border-radius: 14px;
    background: #fff5f5;
}

.resource-delete-warning strong,
.resource-delete-warning p {
    display: block;
    margin: 0;
}

.resource-delete-warning strong {
    color: #a41414;
}

.resource-delete-warning p {
    margin-top: 5px;
    color: #6a4a4a;
    font-size: 13px;
    line-height: 1.7;
}

.delete-media-summary {
    display: grid;
    gap: 9px;
}

.delete-media-summary article {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 16px;
    padding: 13px 15px;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: #fafbfc;
}

.delete-media-summary strong,
.delete-media-summary small {
    display: block;
}

.delete-media-summary small {
    margin-top: 3px;
    color: var(--muted);
    overflow-wrap: anywhere;
}

.resource-delete-form {
    margin-top: 22px;
    padding-top: 20px;
    border-top: 1px solid var(--line);
}

.resource-delete-form label {
    max-width: 420px;
}

.danger-button {
    min-height: 42px;
    padding: 0 18px;
    border: 0;
    border-radius: 10px;
    background: #b41414;
    color: white;
    cursor: pointer;
    font-weight: 800;
}

.danger-button:disabled {
    background: #c8cbd2;
    cursor: not-allowed;
}

@media (max-width: 1200px) {
    .resource-existing-images {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .resource-form-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .admin-resource-filter {
        grid-template-columns: 1fr 1fr;
    }

    .resource-existing-images {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .resource-existing-files article {
        grid-template-columns: 54px minmax(0, 1fr);
    }

    .resource-file-size,
    .resource-existing-files .resource-remove-choice {
        grid-column: 2;
    }
}

@media (max-width: 650px) {
    .admin-resource-filter,
    .resource-form-grid,
    .resource-upload-grid {
        grid-template-columns: 1fr;
    }

    .resource-existing-images {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .resource-save-footer,
    .admin-card-title-actions {
        align-items: flex-start;
        flex-direction: column;
    }

    .resource-editor-top-actions {
        flex-wrap: wrap;
    }

    .delete-media-summary article {
        grid-template-columns: 1fr;
    }
}


/* =========================================================
   V4.3 NAS / WebDAV resource storage
   ========================================================= */

.resource-storage-overview {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
    align-items: stretch;
    gap: 12px;
    margin-bottom: 18px;
}

.resource-storage-overview article {
    min-width: 0;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: white;
}

.resource-storage-overview article > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.resource-storage-overview strong,
.resource-storage-overview span,
.resource-storage-overview small {
    display: block;
}

.resource-storage-overview span {
    min-width: 0;
    overflow-wrap: anywhere;
    color: #35416c;
    font-size: 12px;
    font-weight: 700;
}

.resource-storage-overview small {
    margin-top: 6px;
    color: var(--muted);
    line-height: 1.55;
}

.resource-storage-overview .storage-ok {
    border-color: #bfe8ce;
    background: #f4fcf7;
}

.resource-storage-overview .storage-warning {
    border-color: #f2d7a3;
    background: #fffaf0;
}

.resource-storage-overview .storage-error {
    border-color: #ffcaca;
    background: #fff5f5;
}

.resource-storage-overview > a {
    display: grid;
    place-items: center;
    min-width: 130px;
    padding: 0 16px;
    border-radius: 12px;
    background: #1c2340;
    color: white;
    font-size: 13px;
    font-weight: 800;
}

.storage-architecture {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 22px;
}

.storage-architecture article {
    min-width: 0;
    padding: 17px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #f8f9fc;
}

.storage-architecture span,
.storage-architecture strong,
.storage-architecture small {
    display: block;
}

.storage-architecture span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .08em;
}

.storage-architecture strong {
    margin-top: 5px;
    overflow-wrap: anywhere;
    color: #28345f;
}

.storage-architecture small {
    margin-top: 7px;
    color: var(--muted);
    line-height: 1.6;
}

.storage-explanation {
    color: #515b6d;
    font-size: 13px;
    line-height: 1.8;
}

.storage-explanation p {
    margin: 0;
}

.storage-explanation p + p {
    margin-top: 9px;
}

.admin-form-actions .secondary-button {
    min-height: 42px;
}

@media (max-width: 900px) {
    .resource-storage-overview {
        grid-template-columns: 1fr;
    }

    .resource-storage-overview > a {
        min-height: 46px;
    }
}

@media (max-width: 650px) {
    .storage-architecture {
        grid-template-columns: 1fr;
    }
}


/* =========================================================
   V4.3.3 Database-only resource deletion
   ========================================================= */

.database-delete-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 13px;
    margin: 18px 0;
}

.database-delete-summary article {
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: #f8f9fc;
}

.database-delete-summary span,
.database-delete-summary strong,
.database-delete-summary small {
    display: block;
}

.database-delete-summary span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
}

.database-delete-summary strong {
    margin-top: 4px;
    font-size: 21px;
}

.database-delete-summary small {
    margin-top: 4px;
    color: var(--muted);
    line-height: 1.5;
}

.database-reference-list {
    margin-top: 16px;
}

.database-delete-tables {
    margin-top: 18px;
    padding: 15px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fafbfc;
}

.database-delete-tables strong,
.database-delete-tables p {
    display: block;
    margin: 0;
}

.database-delete-tables p {
    margin-top: 6px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.8;
    overflow-wrap: anywhere;
}

@media (max-width: 700px) {
    .database-delete-summary {
        grid-template-columns: 1fr;
    }
}


/* =========================================================
   V4.3.4 Direct database deletion
   ========================================================= */

.inline-delete-form {
    display: inline-flex;
    margin: 0;
    padding: 0;
}

.danger-link-button {
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: #b41414;
    cursor: pointer;
    font: inherit;
    font-size: 12px;
    font-weight: 800;
    line-height: inherit;
}

.danger-link-button:hover {
    text-decoration: underline;
}

.resource-editor-top-actions .inline-delete-form {
    align-items: center;
}

.resource-editor-top-actions .danger-link-button {
    font-size: 13px;
}


/* =========================================================
   V4.4 栏目式资源管理与栏目管理
   ========================================================= */

.admin-category-browser {
    margin-bottom: 20px;
}

.category-browser-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.category-browser-actions > a:not(.primary-button) {
    color: #4a5570;
    font-size: 13px;
    font-weight: 800;
}

.admin-category-level + .admin-category-level {
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
}

.admin-category-level-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 10px;
}

.admin-category-level-title strong {
    color: #29324f;
    font-size: 14px;
}

.admin-category-level-title span {
    color: var(--muted);
    font-size: 12px;
}

.admin-category-chips,
.category-top-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
}

.admin-category-chip {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 38px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #f8f9fc;
    color: #39435e;
    font-size: 13px;
    font-weight: 800;
}

.admin-category-chip:hover {
    border-color: #bbc3d4;
    background: white;
}

.admin-category-chip.active {
    border-color: #202944;
    background: #202944;
    color: white;
}

.admin-category-chip small {
    display: inline-grid;
    min-width: 24px;
    min-height: 20px;
    place-items: center;
    padding: 0 5px;
    border-radius: 999px;
    background: rgba(35, 44, 73, .08);
    color: inherit;
    font-size: 10px;
}

.admin-category-chip.active small {
    background: rgba(255, 255, 255, .16);
}

.admin-category-chip em {
    color: #a55f09;
    font-size: 10px;
    font-style: normal;
}

.admin-category-chip.hidden-category {
    border-style: dashed;
    opacity: .72;
}

.category-level-empty {
    align-self: center;
    color: var(--muted);
    font-size: 12px;
}

.resource-base-summary {
    display: grid;
    gap: 4px;
    max-width: 410px;
    color: var(--muted);
    font-size: 11px;
    text-align: right;
    overflow-wrap: anywhere;
}

.resource-batch-form {
    margin: 0;
}

.resource-batch-toolbar {
    display: flex;
    align-items: center;
    gap: 18px;
    min-height: 58px;
    margin-bottom: 12px;
    padding: 10px 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #f8f9fc;
    color: #4b556b;
    font-size: 13px;
}

.resource-batch-toolbar .danger-button {
    margin-left: auto;
}

.resource-select-all-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 800;
}

.resource-select-all-label input,
.resource-row-checkbox {
    width: 17px;
    height: 17px;
    accent-color: #b41414;
}

.resource-checkbox-column {
    width: 64px;
    text-align: center;
}

.resource-category-path {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.resource-category-path span {
    display: inline-flex;
    padding: 3px 7px;
    border-radius: 999px;
    background: #f0f2f6;
    color: #586176;
    font-size: 10px;
    white-space: nowrap;
}

.category-search-form {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) auto auto;
    gap: 10px;
    margin-bottom: 18px;
}

.category-search-form input {
    width: 100%;
    min-height: 44px;
    padding: 0 13px;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: #fafbfc;
    font: inherit;
    outline: none;
}

.category-search-form input:focus {
    border-color: rgba(239, 23, 23, .55);
    box-shadow: 0 0 0 4px rgba(239, 23, 23, .08);
}

.category-top-selector {
    margin-bottom: 20px;
}

.category-overview-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.category-overview-card {
    min-width: 0;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fafbfc;
}

.category-overview-card-head,
.category-second-head,
.category-tree-root,
.category-result-row,
.category-third-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 15px;
}

.category-overview-card strong,
.category-overview-card small,
.category-second-card h4,
.category-second-card small,
.category-tree-root h3,
.category-tree-root small,
.category-result-row strong,
.category-result-row small,
.category-third-row strong,
.category-third-row small {
    display: block;
}

.category-overview-card small,
.category-second-card small,
.category-tree-root small,
.category-result-row small,
.category-third-row small {
    margin-top: 4px;
    color: var(--muted);
    line-height: 1.55;
}

.category-overview-card-head > a {
    flex: 0 0 auto;
    font-size: 12px;
    font-weight: 800;
}

.category-overview-children {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 14px;
}

.category-overview-children span {
    padding: 4px 7px;
    border-radius: 8px;
    background: white;
    color: #596176;
    font-size: 11px;
}

.category-overview-children span.is-hidden {
    text-decoration: line-through;
    opacity: .6;
}

.category-hidden-row {
    border-style: dashed !important;
    background: #fffaf1 !important;
    opacity: .82;
}

.category-tree-section {
    display: grid;
    gap: 16px;
}

.category-tree-root {
    padding: 18px;
    border: 1px solid #c9d1e1;
    border-radius: 14px;
    background: #f6f8fc;
}

.category-tree-root span,
.category-second-head span {
    color: #8a94a8;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .08em;
}

.category-tree-root h3,
.category-second-head h4 {
    margin: 4px 0 0;
}

.category-second-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 15px;
}

.category-second-card {
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: white;
    overflow: hidden;
}

.category-second-head {
    padding: 16px;
    background: #fafbfc;
    border-bottom: 1px solid var(--line);
}

.category-third-list {
    display: grid;
}

.category-third-row {
    align-items: center;
    padding: 12px 15px;
    border-bottom: 1px solid #edf0f4;
}

.category-third-row:last-child {
    border-bottom: 0;
}

.category-third-empty {
    padding: 18px;
    color: var(--muted);
    font-size: 12px;
    text-align: center;
}

.category-row-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 9px;
    flex: 0 0 auto;
    font-size: 11px;
    font-weight: 800;
}

.category-row-actions form {
    display: inline-flex;
    margin: 0;
}

.category-row-actions button {
    padding: 0;
    border: 0;
    background: transparent;
    color: #39435e;
    cursor: pointer;
    font: inherit;
    font-weight: 800;
}

.category-row-actions button:hover,
.category-row-actions a:hover {
    text-decoration: underline;
}

.category-search-results {
    display: grid;
    gap: 9px;
}

.category-result-heading {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.category-result-row {
    align-items: center;
    padding: 13px 15px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fafbfc;
}

.category-edit-card {
    max-width: 880px;
}

@media (max-width: 1150px) {
    .category-overview-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .category-second-grid {
        grid-template-columns: 1fr;
    }

    .resource-base-summary {
        max-width: none;
        text-align: left;
    }
}

@media (max-width: 700px) {
    .category-overview-grid,
    .category-search-form {
        grid-template-columns: 1fr;
    }

    .resource-batch-toolbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .resource-batch-toolbar .danger-button {
        width: 100%;
        margin-left: 0;
    }

    .category-tree-root,
    .category-overview-card-head,
    .category-second-head,
    .category-result-row,
    .category-third-row {
        flex-direction: column;
    }

    .category-row-actions {
        justify-content: flex-start;
    }
}


.admin-card .admin-resource-filter {
    grid-template-columns: minmax(260px, 1fr) 170px auto auto;
}

.admin-card-title h2 small {
    margin-left: 7px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.standalone-action-form { display: none; }


/* =========================================================
   V4.5 前台同款资源筛选
   ========================================================= */

.admin-frontend-category-panel {
    margin: 0 0 22px;
    border-radius: 14px;
    box-shadow: none;
}

.admin-frontend-category-panel .category-row {
    grid-template-columns: 100px minmax(0, 1fr);
    gap: 24px;
    align-items: flex-start;
    padding: 22px 20px;
    border-bottom: 1px dashed #e5e8ee;
}

.admin-frontend-category-panel .category-label {
    padding-top: 8px;
    color: #20283d;
    font-size: 18px;
    font-weight: 900;
}

.admin-frontend-category-panel .category-options {
    gap: 10px 18px;
}

.admin-frontend-category-panel .category-pill {
    min-height: 42px;
    padding: 0 18px;
    color: #343c53;
    font-size: 16px;
    font-weight: 500;
}

.admin-frontend-category-panel .category-pill:hover {
    background: #fff3f3;
    color: var(--primary);
}

.admin-frontend-category-panel .category-pill.active {
    background: var(--primary);
    color: white;
    font-weight: 900;
    box-shadow: 0 10px 22px rgba(239, 23, 23, .22);
}

.admin-frontend-category-panel .admin-hidden-category-pill {
    border: 1px dashed #cfd4de;
    color: #9a6e6e;
    opacity: .68;
}

.admin-frontend-category-panel .admin-hidden-category-pill::after {
    content: "隐";
    margin-left: 5px;
    color: #b87676;
    font-size: 9px;
    font-weight: 800;
}

.admin-frontend-category-panel .category-pill.active::after {
    color: rgba(255, 255, 255, .8);
}

.admin-category-empty-text {
    align-self: center;
    padding: 11px 0;
    color: var(--muted);
    font-size: 13px;
}

.admin-category-panel-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    min-height: 68px;
    padding: 12px 20px;
    background: #fafbfc;
}

.admin-category-panel-footer > div:first-child {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    color: #697286;
    font-size: 12px;
    font-weight: 700;
}

.admin-category-panel-footer i {
    color: #b3b9c5;
    font-style: normal;
}

.admin-category-panel-actions {
    display: flex;
    align-items: center;
    gap: 14px;
}

.admin-category-panel-actions > a:not(.primary-button) {
    color: #515b72;
    font-size: 13px;
    font-weight: 800;
}

/* =========================================================
   V4.5 树形栏目管理
   ========================================================= */

.category-tree-admin-card {
    padding-left: 0;
    padding-right: 0;
    overflow: hidden;
}

.category-tree-admin-card > .admin-card-title,
.category-tree-admin-card > .category-tree-tools {
    margin-left: 20px;
    margin-right: 20px;
}

.category-tree-tools {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.category-tree-search {
    display: grid;
    gap: 6px;
    width: min(520px, 100%);
}

.category-tree-search > span {
    color: #687187;
    font-size: 12px;
    font-weight: 800;
}

.category-tree-search input {
    width: 100%;
    min-height: 42px;
    padding: 0 13px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: #fafbfc;
    font: inherit;
    outline: none;
}

.category-tree-search input:focus {
    border-color: rgba(239, 23, 23, .48);
    box-shadow: 0 0 0 4px rgba(239, 23, 23, .07);
}

.category-tree-tool-actions {
    display: flex;
    gap: 8px;
}

.category-tree-batch-form {
    margin: 0;
}

.category-batch-toolbar {
    display: flex;
    align-items: center;
    gap: 18px;
    min-height: 58px;
    padding: 8px 20px;
    border-top: 1px solid #edf0f4;
    border-bottom: 1px solid #e6e9ef;
    background: #fafbfc;
    color: #5b6579;
    font-size: 12px;
}

.category-batch-toolbar > label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 800;
}

.category-batch-toolbar input[type="checkbox"],
.category-row-checkbox {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
}

.category-batch-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.category-batch-actions .secondary-button,
.category-batch-actions .danger-button {
    min-height: 36px;
    padding: 0 13px;
    border-radius: 8px;
    font-size: 12px;
}

.category-tree-list {
    display: grid;
}

.category-tree-row {
    position: relative;
    display: grid;
    align-items: center;
    min-height: 62px;
    padding: 0 18px;
    border-bottom: 1px solid #edf0f4;
    background: white;
    transition: background .15s;
}

.category-tree-row:hover {
    background: #f4faff;
}

.category-tree-row-hidden {
    background: #fffaf2;
}

.category-tree-row-hidden:hover {
    background: #fff5e8;
}

.category-tree-depth-1 {
    grid-template-columns: 34px 34px 20px minmax(0, 1fr);
    margin-top: 5px;
    border-top: 1px solid #edf0f4;
}

.category-tree-depth-2 {
    grid-template-columns: 34px 34px 76px minmax(0, 1fr);
}

.category-tree-depth-3 {
    grid-template-columns: 34px 34px 144px minmax(0, 1fr);
}

.category-tree-select,
.category-tree-toggle-cell {
    display: grid;
    place-items: center;
}

.category-tree-toggle {
    width: 25px;
    height: 25px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #3567a5;
    cursor: pointer;
    font: inherit;
    font-size: 16px;
    line-height: 1;
}

.category-tree-toggle:hover {
    color: var(--primary);
}

.category-tree-toggle-placeholder {
    width: 25px;
    height: 25px;
}

.category-tree-branch {
    position: relative;
    align-self: stretch;
    min-width: 0;
}

.category-tree-guide {
    position: absolute;
    top: -1px;
    bottom: -1px;
    left: calc((var(--guide-index) - 2) * 68px + 17px);
    width: 1px;
    background: #d6d9df;
}

.category-tree-guide.current {
    bottom: 50%;
}

.category-tree-guide.current::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 0;
    width: 50px;
    height: 1px;
    background: #d6d9df;
}

.category-tree-inline-form {
    display: grid;
    grid-template-columns:
        minmax(180px, 300px)
        82px
        100px
        78px
        88px
        minmax(180px, 1fr);
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.category-tree-name-cell {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
}

.category-tree-name-cell input {
    width: min(230px, 100%);
    min-height: 36px;
    padding: 0 12px;
    border: 1px solid #d4d7dd;
    border-radius: 5px;
    background: #fbfbfc;
    color: #222a3c;
    font: inherit;
    font-size: 13px;
    outline: none;
}

.category-tree-depth-1 .category-tree-name-cell input {
    font-weight: 900;
}

.category-tree-name-cell input:focus {
    border-color: #9eabc0;
    background: white;
    box-shadow: 0 0 0 3px rgba(53, 103, 165, .08);
}

.category-add-child {
    display: inline-grid;
    width: 20px;
    height: 20px;
    flex: 0 0 20px;
    place-items: center;
    border-radius: 4px;
    background: #92979f;
    color: white;
    font-size: 15px;
    font-weight: 900;
    line-height: 1;
}

.category-add-child:hover {
    background: #ff8a00;
    color: white;
}

.category-tree-id {
    color: #bdc2cb;
    font-size: 12px;
    white-space: nowrap;
}

.category-tree-sort {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #8991a1;
    font-size: 10px;
    white-space: nowrap;
}

.category-tree-sort input {
    width: 58px;
    min-height: 32px;
    padding: 0 7px;
    border: 1px solid #dde0e6;
    border-radius: 5px;
    background: #fafbfc;
    font: inherit;
    font-size: 11px;
}

.category-tree-hidden-toggle {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #747d8f;
    font-size: 11px;
    white-space: nowrap;
}

.category-tree-hidden-toggle input {
    width: 15px;
    height: 15px;
    accent-color: #ff8a00;
}

.category-tree-resource-count {
    color: #8a93a4;
    font-size: 11px;
    white-space: nowrap;
}

.category-tree-row-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 11px;
    min-width: 0;
    font-size: 11px;
    font-weight: 800;
    white-space: nowrap;
}

.category-tree-row-actions a,
.category-tree-row-actions button {
    font-size: 11px;
}

.category-tree-save {
    min-height: 30px;
    padding: 0 10px;
    border: 1px solid #cfd5df;
    border-radius: 6px;
    background: white;
    color: #39445a;
    cursor: pointer;
    font-weight: 800;
}

.category-tree-save:hover {
    border-color: #8e9bb0;
    background: #f4f7fb;
}

.category-tree-row[hidden] {
    display: none;
}

@media (max-width: 1260px) {
    .category-tree-inline-form {
        grid-template-columns:
            minmax(170px, 1fr)
            76px
            92px
            70px
            80px
            auto;
        gap: 8px;
    }

    .category-tree-row-actions {
        flex-wrap: wrap;
        justify-content: flex-start;
    }
}

@media (max-width: 980px) {
    .admin-frontend-category-panel .category-row {
        grid-template-columns: 72px minmax(0, 1fr);
        gap: 12px;
    }

    .category-tree-depth-2 {
        grid-template-columns: 30px 30px 45px minmax(0, 1fr);
    }

    .category-tree-depth-3 {
        grid-template-columns: 30px 30px 82px minmax(0, 1fr);
    }

    .category-tree-guide {
        left: calc((var(--guide-index) - 2) * 38px + 12px);
    }

    .category-tree-guide.current::after {
        width: 28px;
    }

    .category-tree-inline-form {
        grid-template-columns: minmax(160px, 1fr) 70px 80px;
    }

    .category-tree-hidden-toggle,
    .category-tree-resource-count,
    .category-tree-row-actions {
        grid-column: auto;
    }
}

@media (max-width: 720px) {
    .admin-frontend-category-panel .category-row {
        grid-template-columns: 1fr;
        padding: 16px;
    }

    .admin-frontend-category-panel .category-label {
        padding-top: 0;
    }

    .admin-category-panel-footer,
    .category-tree-tools,
    .category-batch-toolbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .admin-category-panel-actions,
    .category-batch-actions {
        width: 100%;
        margin-left: 0;
        flex-wrap: wrap;
    }

    .category-tree-admin-card > .admin-card-title,
    .category-tree-admin-card > .category-tree-tools {
        margin-left: 14px;
        margin-right: 14px;
    }

    .category-tree-row {
        padding: 10px 10px;
    }

    .category-tree-depth-1,
    .category-tree-depth-2,
    .category-tree-depth-3 {
        grid-template-columns: 28px 28px 18px minmax(0, 1fr);
    }

    .category-tree-branch {
        display: none;
    }

    .category-tree-inline-form {
        grid-template-columns: 1fr 70px;
    }

    .category-tree-name-cell,
    .category-tree-row-actions {
        grid-column: 1 / -1;
    }
}


/* =========================================================
   V4.6 前台 250 个资源异步懒加载
   ========================================================= */

.resource-lazy-loader {
    position: relative;
    display: grid;
    justify-items: center;
    gap: 12px;
    margin: 26px 0 10px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface);
}

.resource-lazy-progress {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px 18px;
    color: var(--muted);
    font-size: 12px;
}

.resource-lazy-progress strong {
    color: #333c54;
}

.resource-lazy-status {
    color: #8a93a5;
}

.resource-load-more {
    min-width: 190px;
}

.resource-lazy-loader.is-loading
.resource-load-more {
    cursor: wait;
    opacity: .65;
}

.resource-lazy-loader.is-loading
.resource-lazy-status::before {
    content: "";
    display: inline-block;
    width: 12px;
    height: 12px;
    margin-right: 7px;
    border: 2px solid #d8dce4;
    border-top-color: var(--primary);
    border-radius: 50%;
    vertical-align: -2px;
    animation: resource-lazy-spin .75s linear infinite;
}

.resource-lazy-loader.is-complete {
    padding: 12px;
    border-style: dashed;
    background: #fafbfc;
}

.resource-lazy-sentinel {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 1px;
    pointer-events: none;
}

@keyframes resource-lazy-spin {
    to {
        transform: rotate(360deg);
    }
}

@media (max-width: 650px) {
    .resource-lazy-progress {
        display: grid;
        justify-items: center;
    }

    .resource-load-more {
        width: 100%;
    }
}


/* =========================================================
   V5.0 微信扫码登录
   ========================================================= */

.auth-login-divider {
    position: relative;
    display: grid;
    place-items: center;
    margin: 20px 0;
    color: #a0a7b5;
    font-size: 12px;
}

.auth-login-divider::before {
    content: "";
    position: absolute;
    right: 0;
    left: 0;
    height: 1px;
    background: var(--line);
}

.auth-login-divider span {
    position: relative;
    z-index: 1;
    padding: 0 12px;
    background: var(--surface);
}

.wechat-login-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-height: 58px;
    padding: 10px 18px;
    border: 1px solid #c9ead1;
    border-radius: 13px;
    background: #effbf2;
    color: #147a30;
    text-align: left;
    transition:
        border-color .2s,
        background .2s,
        transform .2s;
}

.wechat-login-button:hover {
    border-color: #68c77e;
    background: #e4f8e9;
    color: #106a28;
    transform: translateY(-1px);
}

.wechat-login-icon {
    display: grid;
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    place-items: center;
    border-radius: 10px;
    background: #19ad45;
    color: white;
    font-size: 17px;
    font-weight: 900;
}

.wechat-login-button strong,
.wechat-login-button small {
    display: block;
}

.wechat-login-button strong {
    font-size: 14px;
}

.wechat-login-button small {
    margin-top: 2px;
    color: #5e8d69;
    font-size: 11px;
}

.wechat-auth-body .auth-shell {
    padding-top: 36px;
    padding-bottom: 36px;
}

.wechat-login-card {
    width: min(470px, 100%);
}

.wechat-qr-login {
    display: grid;
    justify-items: center;
    gap: 16px;
    margin-top: 22px;
}

.wechat-qr-frame {
    position: relative;
    display: grid;
    width: 306px;
    height: 306px;
    place-items: center;
    overflow: hidden;
    padding: 12px;
    border: 1px solid #dce1e9;
    border-radius: 18px;
    background: white;
    box-shadow: 0 14px 36px rgba(25, 34, 51, .09);
}

.wechat-qr-frame img {
    width: 280px;
    height: 280px;
    object-fit: contain;
}

.wechat-qr-overlay {
    position: absolute;
    inset: 0;
    display: grid;
    place-content: center;
    gap: 10px;
    padding: 25px;
    background: rgba(255, 255, 255, .94);
    text-align: center;
}

.wechat-qr-overlay[hidden] {
    display: none;
}

.wechat-qr-overlay strong {
    color: #29324a;
    font-size: 18px;
}

.wechat-qr-overlay a {
    color: var(--primary);
    font-size: 13px;
    font-weight: 800;
}

.wechat-login-code {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #8891a1;
    font-size: 11px;
}

.wechat-login-code strong {
    color: #4b566c;
    font-size: 15px;
    letter-spacing: .12em;
}

.wechat-login-live-status {
    display: grid;
    grid-template-columns: auto auto;
    align-items: center;
    justify-content: center;
    gap: 3px 9px;
    color: #34405a;
    text-align: center;
}

.wechat-login-live-status small {
    grid-column: 1 / -1;
    color: var(--muted);
    font-size: 11px;
}

.wechat-status-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #19ad45;
    box-shadow: 0 0 0 5px rgba(25, 173, 69, .12);
    animation: wechat-status-pulse 1.8s ease-in-out infinite;
}

.wechat-qr-login[data-state="success"]
.wechat-status-dot {
    background: #19ad45;
    animation: none;
}

.wechat-qr-login[data-state="expired"]
.wechat-status-dot,
.wechat-qr-login[data-state="error"]
.wechat-status-dot {
    background: #d33b3b;
    box-shadow: 0 0 0 5px rgba(211, 59, 59, .1);
    animation: none;
}

.wechat-login-steps {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px 12px;
    color: #778095;
    font-size: 11px;
}

.wechat-login-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 22px;
}

.wechat-login-actions > a:not(.primary-button):not(.secondary-button) {
    color: #657087;
    font-size: 12px;
    font-weight: 800;
}

@keyframes wechat-status-pulse {
    50% {
        opacity: .5;
        transform: scale(.85);
    }
}

.wechat-login-status-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 13px;
}

.wechat-login-status-grid article {
    min-width: 0;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: #fafbfc;
}

.wechat-login-status-grid span,
.wechat-login-status-grid strong,
.wechat-login-status-grid small {
    display: block;
}

.wechat-login-status-grid span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
}

.wechat-login-status-grid strong {
    margin-top: 5px;
    color: #29334e;
    font-size: 22px;
}

.wechat-login-status-grid small {
    margin-top: 5px;
    overflow-wrap: anywhere;
    color: #8991a2;
    font-size: 10px;
    line-height: 1.55;
}

.wechat-login-status-grid .status-ready {
    border-color: #c5e8cf;
    background: #f4fcf6;
}

.wechat-login-status-grid .status-error {
    border-color: #fac9c9;
    background: #fff5f5;
}

.wechat-plugin-detection {
    display: grid;
    gap: 7px;
    margin-top: 14px;
    padding: 13px 15px;
    border: 1px dashed #cfd5df;
    border-radius: 11px;
    background: #fafbfc;
}

.wechat-plugin-detection strong {
    color: #445069;
    font-size: 12px;
}

.wechat-plugin-detection code {
    overflow-wrap: anywhere;
    color: #798397;
    font-size: 11px;
}

.wechat-login-flow {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 13px;
}

.wechat-login-flow article {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    min-height: 80px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: #fafbfc;
}

.wechat-login-flow strong {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border-radius: 10px;
    background: #19ad45;
    color: white;
}

.wechat-login-flow span {
    color: #4d576e;
    font-size: 12px;
    line-height: 1.6;
}

.wechat-login-important {
    margin-top: 16px;
    padding: 15px;
    border: 1px solid #f1d59a;
    border-radius: 12px;
    background: #fffaf0;
}

.wechat-login-important strong,
.wechat-login-important p {
    display: block;
    margin: 0;
}

.wechat-login-important p {
    margin-top: 6px;
    color: #756847;
    font-size: 12px;
    line-height: 1.7;
}

@media (max-width: 980px) {
    .wechat-login-status-grid,
    .wechat-login-flow {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 600px) {
    .wechat-qr-frame {
        width: min(306px, 100%);
        height: auto;
        aspect-ratio: 1;
    }

    .wechat-qr-frame img {
        width: 100%;
        height: 100%;
    }

    .wechat-login-status-grid,
    .wechat-login-flow {
        grid-template-columns: 1fr;
    }
}


.wechat-login-entry-form {
    margin: 0;
}

button.wechat-login-button {
    width: 100%;
    cursor: pointer;
    font: inherit;
}

.wechat-login-actions form {
    display: inline-flex;
    margin: 0;
}

.wechat-qr-overlay button,
.wechat-refresh-link {
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--primary);
    cursor: pointer;
    font: inherit;
    font-size: 13px;
    font-weight: 800;
}

.wechat-qr-overlay button:hover,
.wechat-refresh-link:hover {
    text-decoration: underline;
}

.wechat-login-ready {
    display: grid;
    justify-items: center;
    gap: 10px;
    margin-top: 22px;
    padding: 26px 20px;
    border: 1px solid #c9ead1;
    border-radius: 16px;
    background: #f3fcf5;
    color: #385d42;
    text-align: center;
}

.wechat-login-ready > .wechat-login-icon {
    width: 52px;
    height: 52px;
    border-radius: 15px;
    font-size: 22px;
}

.wechat-login-ready strong {
    color: #285335;
    font-size: 16px;
}

.wechat-login-ready p {
    max-width: 330px;
    margin: 0;
    color: #66826d;
    font-size: 12px;
    line-height: 1.7;
}


/* =========================================================
   V5.1 Strong 原版两项微信配置
   ========================================================= */

.strong-simple-settings {
    padding-left: 0;
    padding-right: 0;
    overflow: hidden;
}

.strong-simple-settings > .admin-card-title {
    margin: 0;
    padding: 0 26px 20px;
}

.wechat-feature-state {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 0 11px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 900;
}

.wechat-feature-state.is-enabled {
    background: #e9f8ee;
    color: #288148;
}

.wechat-feature-state.is-disabled {
    background: #f1f2f5;
    color: #7a8292;
}

.strong-original-form {
    margin: 0;
}

.strong-setting-section {
    border-top: 1px solid #e5e7eb;
    background: white;
}

.strong-setting-heading {
    padding: 22px 26px;
    border-bottom: 1px solid #e5e7eb;
    background: #fafafa;
    color: #222a38;
    font-size: 17px;
    font-weight: 800;
}

.strong-setting-row {
    display: grid;
    gap: 15px;
    margin: 0;
    padding: 24px 26px;
    border-bottom: 1px dotted #e3e6eb;
}

.strong-setting-row strong {
    color: #202633;
    font-size: 13px;
}

.strong-setting-row p {
    margin: 0;
    color: #344056;
    font-size: 14px;
    line-height: 1.7;
    overflow-wrap: anywhere;
}

.strong-setting-row input {
    width: min(480px, 100%);
    min-height: 39px;
    padding: 0 12px;
    border: 1px solid #d2d6dd;
    border-radius: 5px;
    background: #fbfbfc;
    color: #202633;
    font: inherit;
    outline: none;
}

.strong-setting-row input:focus {
    border-color: #2782d4;
    background: white;
    box-shadow: 0 0 0 3px rgba(39, 130, 212, .1);
}

.strong-setting-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 13px;
    padding: 24px 26px;
    background: #fafafa;
}

.strong-setting-actions .danger-link-button {
    margin-left: auto;
}

@media (max-width: 680px) {
    .strong-simple-settings > .admin-card-title,
    .strong-setting-heading,
    .strong-setting-row,
    .strong-setting-actions {
        padding-left: 16px;
        padding-right: 16px;
    }

    .strong-setting-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .strong-setting-actions .danger-link-button {
        margin-left: 0;
    }
}


/* =========================================================
   V5.2 微信扫码注册与新手上路权限
   ========================================================= */

.wechat-register-entry {
    max-width: 620px;
}

.wechat-register-policy {
    display: grid;
    gap: 9px;
    margin: 22px 0;
    padding: 18px;
    border: 1px solid #dce3ef;
    border-radius: 14px;
    background: #f7f9fc;
    color: #556078;
}

.wechat-register-policy strong {
    color: #202a42;
    font-size: 15px;
}

.wechat-register-policy span {
    position: relative;
    padding-left: 18px;
    font-size: 13px;
    line-height: 1.6;
}

.wechat-register-policy span::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #ef1717;
    font-weight: 900;
}

.wechat-register-start {
    margin: 0;
}



/* =========================================================
   V5.2.2 用户名密码 + 微信扫码双注册方式
   ========================================================= */

.dual-register-shell {
    width: min(1040px, 100%);
}

.dual-register-card {
    padding: 34px;
}

.dual-register-heading {
    max-width: 720px;
    margin-bottom: 24px;
}

.dual-register-heading .auth-note {
    margin-bottom: 0;
    line-height: 1.75;
}

.dual-register-methods {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(320px, .85fr);
    gap: 20px;
    align-items: stretch;
}

.register-method-card {
    min-width: 0;
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #fafbfc;
}

.register-password-card {
    background: white;
}

.register-wechat-card {
    display: flex;
    flex-direction: column;
    background:
        radial-gradient(
            circle at 85% 10%,
            rgba(7, 193, 96, .11),
            transparent 15rem
        ),
        #f7fcf9;
    border-color: #cde9d6;
}

.register-method-title {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.register-method-number {
    display: grid;
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    place-items: center;
    border-radius: 10px;
    background: #202944;
    color: white;
    font-size: 14px;
    font-weight: 900;
}

.register-wechat-card .register-method-number {
    background: #07c160;
}

.register-method-title strong,
.register-method-title small {
    display: block;
}

.register-method-title strong {
    color: #20283e;
    font-size: 16px;
}

.register-method-title small {
    margin-top: 3px;
    color: var(--muted);
    font-size: 11px;
}

.wechat-register-visual {
    display: grid;
    justify-items: center;
    gap: 8px;
    padding: 16px 12px 19px;
    text-align: center;
}

.wechat-register-icon {
    display: grid;
    width: 60px;
    height: 60px;
    place-items: center;
    border-radius: 18px;
    background: #07c160;
    color: white;
    box-shadow: 0 12px 25px rgba(7, 193, 96, .2);
    font-size: 24px;
    font-weight: 900;
}

.wechat-register-visual > strong {
    color: #244432;
    font-size: 17px;
}

.wechat-register-visual p {
    max-width: 330px;
    margin: 0;
    color: #698071;
    font-size: 12px;
    line-height: 1.7;
}

.wechat-register-policy.compact {
    margin: 0 0 18px;
    padding: 15px;
    background: rgba(255, 255, 255, .7);
}

.wechat-register-policy.compact span {
    font-size: 12px;
}

.wechat-register-start {
    margin-top: auto;
}

.wechat-register-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 11px;
    width: 100%;
    min-height: 58px;
    padding: 8px 18px;
    border: 0;
    border-radius: 13px;
    background: #07c160;
    color: white;
    cursor: pointer;
    font: inherit;
    box-shadow: 0 12px 25px rgba(7, 193, 96, .2);
}

.wechat-register-button:hover {
    background: #05ad55;
    transform: translateY(-1px);
}

.wechat-register-button .wechat-login-icon {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, .18);
    box-shadow: none;
}

.wechat-register-button > span:last-child {
    text-align: left;
}

.wechat-register-button strong,
.wechat-register-button small {
    display: block;
}

.wechat-register-button strong {
    font-size: 15px;
}

.wechat-register-button small {
    margin-top: 2px;
    color: rgba(255, 255, 255, .82);
    font-size: 10px;
}


@media (max-width: 820px) {
    .dual-register-methods {
        grid-template-columns: 1fr;
    }

    .register-wechat-card {
        min-height: 0;
    }
}

@media (max-width: 560px) {
    .dual-register-card,
    .register-method-card {
        padding: 20px;
    }
}


/* =========================================================
   V5.2.4 返回顶部与同目录资源
   ========================================================= */

.back-to-top {
    position: fixed;
    right: 24px;
    bottom: 32px;
    z-index: 120;
    display: grid;
    width: 48px;
    height: 48px;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 14px;
    background: var(--primary);
    color: white;
    box-shadow: 0 12px 28px rgba(239, 23, 23, .28);
    cursor: pointer;
    font: inherit;
    font-size: 23px;
    font-weight: 900;
    opacity: 0;
    pointer-events: none;
    transform: translateY(12px);
    transition:
        opacity .18s ease,
        transform .18s ease,
        background .18s ease;
}

.back-to-top:hover {
    background: #d90f0f;
}

.back-to-top.is-visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.related-resources {
    margin-top: 34px;
    padding-top: 28px;
    border-top: 1px solid var(--line);
}

.related-resources-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
}

.related-resources-heading h2 {
    margin: 0;
    color: #182139;
    font-size: 24px;
}

.related-resources-heading a {
    color: var(--primary);
    font-size: 13px;
    font-weight: 800;
}

.related-resource-grid {
    margin-bottom: 24px;
}

@media (max-width: 720px) {
    .back-to-top {
        right: 14px;
        bottom: 18px;
        width: 44px;
        height: 44px;
        border-radius: 13px;
    }

    .related-resources {
        margin-top: 24px;
        padding-top: 22px;
    }

    .related-resources-heading h2 {
        font-size: 21px;
    }
}


/* V5.3: 首页广告、置顶与本地上传 */
.home-ad-carousel { position: relative; overflow: hidden; background: #111631; }
.home-ad-slide { display: none; width: 100%; height: 100%; }
.home-ad-slide.active { display: block; }
.home-ad-slide a, .home-ad-slide img { display: block; width: 100%; height: 100%; }
.home-ad-slide img { object-fit: cover; }
.home-ad-dots { position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%); display: flex; gap: 8px; z-index: 3; }
.home-ad-dots button { width: 9px; height: 9px; border: 0; border-radius: 50%; padding: 0; background: rgba(255,255,255,.45); cursor: pointer; }
.home-ad-dots button.active { width: 24px; border-radius: 999px; background: #fff; }
.table-action-button { border: 0; background: transparent; color: #315ee7; padding: 0; cursor: pointer; font: inherit; }
.admin-ad-thumb { width: 180px; max-height: 80px; object-fit: cover; border-radius: 10px; }
.admin-ad-preview { width: min(100%, 900px); max-height: 300px; object-fit: cover; border-radius: 14px; }
.admin-form select[multiple] { min-height: 210px; padding: 10px; }
@media (max-width: 760px) { .admin-ad-thumb { width: 120px; } .home-ad-dots { bottom: 10px; } }


/* =========================================================
   V5.2 发布作品样式（后台新增/编辑资源）
   ========================================================= */

.publish-work-form {
    display: block;
}

.publish-work-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: 0 8px 24px rgba(20, 33, 61, 0.06);
    overflow: hidden;
}

.publish-work-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 26px 30px 20px;
    border-bottom: 1px solid #eef1f7;
}

.publish-work-header p {
    margin: 0 0 8px;
    font-size: 12px;
    letter-spacing: 0.14em;
    color: #97a1b3;
    text-transform: uppercase;
}

.publish-work-header h2 {
    margin: 0;
    font-size: 30px;
    line-height: 1.2;
    color: #232c3d;
}

.publish-work-top-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

.publish-work-body {
    padding: 14px 30px 30px;
}

.publish-form-row {
    display: grid;
    grid-template-columns: 116px minmax(0, 1fr);
    gap: 20px;
    align-items: start;
    padding: 16px 0;
    border-bottom: 1px solid #f0f2f7;
}

.publish-form-row:last-of-type {
    border-bottom: 0;
}

.publish-form-label {
    padding-top: 12px;
    font-size: 15px;
    line-height: 1.4;
    color: #333c4d;
    font-weight: 600;
}

.publish-form-control {
    min-width: 0;
}

.publish-form-control input[type="text"],
.publish-form-control input[type="number"],
.publish-form-control select,
.publish-form-control textarea {
    width: 100%;
    border: 1px solid #dfe5ef;
    background: #fff;
    border-radius: 10px;
    padding: 11px 14px;
    font: inherit;
    color: #273041;
    outline: none;
}

.publish-form-control textarea {
    resize: vertical;
    min-height: 130px;
}

.publish-form-control input:focus,
.publish-form-control select:focus,
.publish-form-control textarea:focus {
    border-color: #6d7df6;
    box-shadow: 0 0 0 3px rgba(109, 125, 246, 0.12);
}

.publish-inline {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.publish-categories select {
    min-width: 140px;
    max-width: 220px;
}

.publish-row-tip,
.publish-help-text,
.publish-help-block,
.publish-text-block small,
.publish-attachment-tile small,
.publish-image-card small,
.publish-file-main small {
    color: #8b95a7;
    font-size: 12px;
    line-height: 1.6;
}

.publish-short-input {
    width: 110px !important;
    flex: 0 0 110px;
}

.publish-meta-input {
    width: 180px !important;
    flex: 0 0 180px;
}

.publish-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 52px;
    height: 42px;
    padding: 0 14px;
    border: 1px solid #dfe5ef;
    border-radius: 10px;
    background: #f8fafc;
    color: #5d6778;
    font-size: 14px;
}

.publish-sub-label {
    color: #5a6475;
    font-size: 14px;
    white-space: nowrap;
}

.publish-radio-group {
    display: inline-flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.publish-radio-group label,
.publish-image-actions label,
.resource-remove-choice {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 14px;
    color: #445066;
}

.publish-help-block {
    margin-bottom: 14px;
}

.publish-form-row-editor textarea {
    min-height: 240px;
}

.publish-image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 18px;
}

.publish-image-card {
    border: 1px solid #e4e8f0;
    border-radius: 14px;
    padding: 12px;
    background: #fff;
    display: grid;
    gap: 10px;
}

.publish-image-card.is-removed,
.publish-file-card.is-removed {
    opacity: 0.6;
    background: #fafbff;
}

.publish-image-preview {
    border-radius: 10px;
    overflow: hidden;
    background: #f7f8fc;
    aspect-ratio: 4 / 3;
}

.publish-image-preview img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.publish-image-actions {
    display: grid;
    gap: 8px;
}

.publish-asset-grid,
.publish-attachment-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.publish-upload-tile,
.publish-text-block,
.publish-attachment-tile {
    display: grid;
    gap: 10px;
    min-height: 210px;
    border: 1px dashed #d8deeb;
    border-radius: 14px;
    background: #fbfcff;
    padding: 18px;
}

.publish-upload-tile {
    cursor: pointer;
    align-content: center;
    justify-items: center;
    text-align: center;
}

.publish-upload-tile input[type="file"] {
    display: none;
}

.upload-symbol {
    font-size: 46px;
    line-height: 1;
    color: #d1d8e6;
}

.publish-upload-tile strong,
.attachment-tile-inner strong {
    color: #3a4355;
    font-size: 18px;
}

.publish-text-block span,
.publish-attachment-tile span {
    color: #4a5466;
    font-size: 14px;
    font-weight: 600;
}

.publish-existing-files {
    display: grid;
    gap: 12px;
    margin-bottom: 18px;
}

.publish-file-card {
    display: grid;
    grid-template-columns: 68px minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
    border: 1px solid #e4e8f0;
    border-radius: 14px;
    padding: 14px;
    background: #fff;
}

.publish-file-main {
    min-width: 0;
    display: grid;
    gap: 7px;
}

.publish-file-main label {
    display: grid;
    gap: 7px;
}

.publish-file-main small {
    overflow-wrap: anywhere;
}

.publish-attachment-tile.is-disabled {
    display: grid;
    place-items: center;
    text-align: center;
    background: #f8f9fc;
}

.attachment-tile-inner {
    display: grid;
    gap: 10px;
    justify-items: center;
    max-width: 360px;
}

.attachment-icon {
    font-size: 34px;
    line-height: 1;
    color: #c4cddd;
}

.publish-netdisk-tile textarea {
    min-height: 126px;
}

.publish-form-actions {
    display: flex;
    gap: 12px;
    padding-top: 24px;
}

@media (max-width: 1080px) {
    .publish-work-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .publish-form-row {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .publish-form-label {
        padding-top: 0;
    }

    .publish-asset-grid,
    .publish-attachment-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .publish-work-body,
    .publish-work-header {
        padding-left: 18px;
        padding-right: 18px;
    }

    .publish-image-grid {
        grid-template-columns: 1fr 1fr;
    }

    .publish-file-card {
        grid-template-columns: 1fr;
    }
}



/* =========================================================
   V5.3 图片上传预览和作品简介富文本编辑器
   ========================================================= */

.publish-upload-tile {
    position: relative;
    overflow: hidden;
}

.publish-upload-tile .publish-upload-input {
    display: block;
    position: absolute;
    inset: 0;
    z-index: 3;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    font-size: 0;
}

.publish-upload-tile:hover,
.publish-upload-tile:focus-within,
.publish-upload-tile.is-dragging {
    border-color: #7182f4;
    background: #f5f7ff;
    box-shadow: 0 0 0 4px rgba(113, 130, 244, 0.1);
}

.publish-new-image-grid {
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid #eef1f6;
}

.publish-new-image-grid[hidden] {
    display: none;
}

.publish-new-image-card {
    background: #fbfcff;
}

.publish-image-name {
    display: block;
    overflow: hidden;
    color: #394358;
    font-size: 13px;
    line-height: 1.45;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.resource-rich-editor {
    overflow: hidden;
    border: 1px solid #dfe5ef;
    border-radius: 11px;
    background: #fff;
}

.resource-rich-editor:focus-within {
    border-color: #6d7df6;
    box-shadow: 0 0 0 3px rgba(109, 125, 246, 0.12);
}

.resource-editor-toolbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    padding: 9px 10px;
    border-bottom: 1px solid #e8ecf3;
    background: #f7f8fb;
}

.resource-editor-toolbar button,
.resource-editor-toolbar select {
    width: auto;
    min-width: 36px;
    min-height: 34px;
    border: 1px solid #dfe4ed;
    border-radius: 7px;
    background: #fff;
    padding: 0 10px;
    color: #49546a;
    cursor: pointer;
    font: inherit;
    font-size: 13px;
}

.resource-editor-toolbar button:hover,
.resource-editor-toolbar button:focus,
.resource-editor-toolbar select:hover,
.resource-editor-toolbar select:focus {
    border-color: #8795ee;
    color: #4658d9;
    outline: none;
}

.resource-editor-block {
    min-width: 92px !important;
}

.resource-editor-content {
    min-height: 260px;
    padding: 16px 18px;
    color: #2e3748;
    font-size: 15px;
    line-height: 1.8;
    outline: none;
    overflow-wrap: anywhere;
}

.resource-editor-content:empty::before {
    content: attr(data-placeholder);
    color: #a2aaba;
    pointer-events: none;
}

.resource-editor-content h2,
.resource-editor-content h3,
.resource-editor-content p,
.resource-editor-content blockquote,
.resource-editor-content ul,
.resource-editor-content ol {
    margin-top: 0;
    margin-bottom: 0.8em;
}

.resource-editor-content blockquote {
    margin-left: 0;
    padding: 8px 14px;
    border-left: 4px solid #cfd6ee;
    background: #f7f8fc;
    color: #5d6677;
}

.resource-editor-content a {
    color: #5065df;
    text-decoration: underline;
}

.resource-editor-source {
    display: none !important;
}


/* =========================================================
   V5.4 修复上传图片无法点击
   ========================================================= */

.publish-upload-tile input.publish-upload-input[type="file"] {
    display: block !important;
    position: absolute !important;
    inset: 0 !important;
    z-index: 10 !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    opacity: 0 !important;
    cursor: pointer !important;
    pointer-events: auto !important;
}

.publish-upload-tile > .upload-symbol,
.publish-upload-tile > strong,
.publish-upload-tile > small {
    position: relative;
    z-index: 1;
    pointer-events: none;
}


/* =========================================================
   V5.5 正文图片编辑器和作品图片独立删除
   ========================================================= */

.resource-editor-toolbar {
    gap: 9px;
    padding: 10px 12px;
}

.resource-editor-tool-group {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding-right: 9px;
    border-right: 1px solid #dfe4ed;
}

.resource-editor-tool-group:last-child {
    padding-right: 0;
    border-right: 0;
}

.resource-editor-image-button {
    border-color: #7182f4 !important;
    background: #eef1ff !important;
    color: #4658d9 !important;
    font-weight: 800 !important;
}

.resource-editor-content {
    min-height: 360px;
    max-height: 760px;
    overflow-y: auto;
}

.resource-editor-content img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 0 auto;
    border-radius: 10px;
}

.resource-editor-content .resource-intro-image,
.resource-editor-content figure {
    position: relative;
    margin: 18px 0;
    padding: 12px;
    border: 1px solid #e1e6f0;
    border-radius: 12px;
    background: #f8f9fc;
}

.resource-editor-content figcaption {
    margin-top: 8px;
    color: #8b95a7;
    font-size: 12px;
    text-align: center;
}

.resource-editor-content figure:focus-within,
.resource-editor-content figure:hover {
    border-color: #8795ee;
    box-shadow: 0 0 0 3px rgba(109, 125, 246, 0.08);
}

.resource-editor-footer {
    padding: 9px 13px;
    border-top: 1px solid #e8ecf3;
    background: #fafbfe;
    color: #8a94a6;
    font-size: 12px;
    line-height: 1.6;
}

.publish-image-card {
    position: relative;
}

.publish-image-delete {
    position: absolute;
    top: 5px;
    right: 5px;
    z-index: 6;
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 50%;
    background: rgba(24, 31, 47, 0.82);
    color: #fff;
    cursor: pointer;
    font-size: 22px;
    line-height: 1;
    box-shadow: 0 5px 15px rgba(19, 27, 44, 0.2);
}

.publish-image-delete:hover,
.publish-image-delete:focus {
    background: #d93232;
    outline: none;
    transform: scale(1.04);
}

.publish-image-card.is-removed {
    opacity: 0.52;
}

.publish-image-card.is-removed::after {
    content: "保存后删除";
    position: absolute;
    inset: 12px;
    z-index: 4;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: rgba(37, 43, 57, 0.62);
    color: #fff;
    font-size: 14px;
    font-weight: 800;
    pointer-events: none;
}

.publish-image-card.is-removed .publish-image-delete {
    z-index: 7;
    background: #5265d8;
}

.resource-intro-content {
    max-height: 520px;
    overflow-y: auto;
    color: #596275;
    font-size: 14px;
    line-height: 1.85;
    overflow-wrap: anywhere;
}

.resource-intro-content > :first-child {
    margin-top: 0;
}

.resource-intro-content > :last-child {
    margin-bottom: 0;
}

.resource-intro-content p,
.resource-intro-content h2,
.resource-intro-content h3,
.resource-intro-content h4,
.resource-intro-content blockquote,
.resource-intro-content ul,
.resource-intro-content ol,
.resource-intro-content figure {
    margin-top: 0;
    margin-bottom: 14px;
}

.resource-intro-content h2,
.resource-intro-content h3,
.resource-intro-content h4 {
    color: #273145;
    line-height: 1.45;
}

.resource-intro-content img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 0 auto;
    border-radius: 12px;
}

.resource-intro-content figure {
    padding: 10px;
    border: 1px solid #e5e8ef;
    border-radius: 13px;
    background: #fafbfe;
}

.resource-intro-content figcaption {
    margin-top: 8px;
    color: #8a94a6;
    font-size: 12px;
    text-align: center;
}

.resource-intro-content blockquote {
    padding: 10px 14px;
    border-left: 4px solid #8391eb;
    background: #f5f7ff;
}

.resource-intro-content a {
    color: #5065df;
    text-decoration: underline;
}

@media (max-width: 760px) {
    .resource-editor-tool-group {
        padding-right: 0;
        border-right: 0;
    }

    .resource-editor-content {
        min-height: 300px;
    }
}


/* =========================================================
   V5.7 独立多图编辑器页面
   ========================================================= */

.resource-editor-build {
    display: inline-flex;
    margin-top: 9px;
    padding: 6px 11px;
    border-radius: 999px;
    background: #eaf0ff;
    color: #4059d9;
    font-size: 12px;
    font-weight: 900;
}

.resource-editor-image-button {
    min-width: 92px !important;
    border-color: #536ee8 !important;
    background: #536ee8 !important;
    color: #fff !important;
}

.resource-editor-content {
    min-height: 420px;
}

.resource-editor-content figure.resource-intro-image {
    position: relative;
    margin: 18px 0;
    padding: 12px;
    border: 1px solid #dce3f0;
    border-radius: 14px;
    background: #f8faff;
}

.resource-editor-content figure.resource-intro-image img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 0 auto;
    border-radius: 10px;
}

.resource-editor-content figure.resource-intro-image figcaption {
    margin-top: 9px;
    color: #8b95a8;
    font-size: 12px;
    text-align: center;
}

.publish-image-delete {
    display: grid !important;
    place-items: center;
    position: absolute !important;
    top: 6px !important;
    right: 6px !important;
    z-index: 10 !important;
    width: 34px !important;
    height: 34px !important;
    border: 0 !important;
    border-radius: 50% !important;
    background: rgba(30, 37, 53, .86) !important;
    color: #fff !important;
    cursor: pointer !important;
    font-size: 22px !important;
}

.publish-image-card {
    position: relative !important;
}

.publish-image-card .publish-image-remove-input {
    display: none !important;
}

.resource-description-v57 {
    margin-top: 28px;
    padding: 28px;
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(24, 34, 58, .055);
}

.resource-description-v57-heading {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--line);
}

.resource-description-v57-heading p,
.resource-description-v57-heading h2 {
    margin: 0;
}

.resource-description-v57-heading p {
    color: var(--primary);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .14em;
}

.resource-description-v57-heading h2 {
    margin-top: 5px;
    font-size: 24px;
}

.resource-description-v57 .resource-intro-content {
    max-height: none;
    overflow: visible;
    font-size: 15px;
    line-height: 1.9;
}

.resource-description-v57 .resource-intro-content img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 14px auto;
    border-radius: 12px;
}


/* =========================================================
   V6.1 首页资源图片完整显示
   ========================================================= */

.resource-card .card-image {
    background: #f7f8fb;
}

.resource-card .card-image img {
    width: 100%;
    height: 100%;
    padding: 8px;
    box-sizing: border-box;
    object-fit: contain !important;
    object-position: center center;
    transform: none !important;
}

.resource-card:hover .card-image img {
    transform: none !important;
}
