:root {
    --lib-bg: var(--bg);
    --lib-panel: var(--surface);
    --lib-panel-2: var(--surface-2);
    --lib-border: var(--border);
    --lib-text: var(--text);
    --lib-muted: var(--text-2);
    --lib-cyan: #14b8a6;
    --lib-blue: var(--brand);
    --lib-purple: var(--brand-2);
}

#main-container {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.library-shell {
    width: min(1200px, 100%);
    margin: 0 auto;
    color: var(--lib-text);
}

.library-shell button,
.library-modal button,
.library-shell input,
.library-modal input,
.library-modal textarea {
    font: inherit;
}

.library-shell button,
.library-modal button {
    min-width: 0;
}

/* Hero：与 qiuku 首页一致的浅色极光与悬浮插件面板 */
.library-hero {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(360px, .92fr);
    gap: clamp(28px, 4vw, 52px);
    align-items: center;
    min-height: 220px;
    padding: 22px 24px 26px;
    overflow: hidden;
}

.hero-grid {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(99, 102, 241, .05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(99, 102, 241, .05) 1px, transparent 1px);
    background-size: 60px 60px;
    -webkit-mask-image: radial-gradient(ellipse at center, #000, transparent 76%);
    mask-image: radial-gradient(ellipse at center, #000, transparent 76%);
}

.hero-glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(76px);
    opacity: .36;
    pointer-events: none;
}

.glow-one {
    top: -130px;
    left: -80px;
    width: 430px;
    height: 430px;
    background: rgba(99, 102, 241, .46);
    animation: lib-float 8s ease-in-out infinite;
}

.glow-two {
    right: -80px;
    bottom: -90px;
    width: 360px;
    height: 360px;
    background: rgba(20, 184, 166, .32);
    animation: lib-float 7s ease-in-out -2s infinite reverse;
}

.library-hero-copy,
.hero-console {
    position: relative;
    z-index: 1;
}

.hero-kicker,
.section-eyebrow {
    color: var(--brand-deep);
    font-size: .75rem;
    font-weight: 800;
    letter-spacing: .16em;
    text-transform: uppercase;
}

.hero-kicker {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 5px 13px;
    border: 1px solid var(--brand-soft-2);
    border-radius: var(--radius-pill);
    background: var(--brand-soft);
    box-shadow: var(--shadow-sm);
}

.hero-kicker i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--brand);
    box-shadow: 0 0 0 5px rgba(99, 102, 241, .12);
    animation: lib-pulse 2s ease-in-out infinite;
}

.library-hero h1 {
    margin: 9px 0 7px;
    color: var(--text);
    font-size: clamp(2.4rem, 4.2vw, 3.5rem);
    font-weight: 900;
    line-height: 1.03;
    letter-spacing: -.065em;
    -webkit-text-fill-color: initial;
    background: none;
}

.library-hero h1 span {
    color: transparent;
    background: linear-gradient(135deg, #4f46e5 10%, #6366f1 48%, #8b5cf6 92%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.library-hero-copy > p {
    max-width: 620px;
    margin: 0;
    color: var(--text-2);
    font-size: .88rem;
    line-height: 1.55;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 14px;
}

.hero-actions button,
.empty-state button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 40px;
    padding: 0 21px;
    border: 1px solid transparent;
    border-radius: var(--radius-pill);
    cursor: pointer;
    font-weight: 700;
    transition: transform .25s var(--ease), box-shadow .25s var(--ease), border-color .25s var(--ease), background .25s var(--ease);
}

.primary-action,
.empty-state button {
    color: #fff;
    background: var(--brand-grad);
    box-shadow: var(--shadow-brand);
}

.secondary-action {
    color: var(--text-2);
    border-color: var(--border) !important;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.hero-actions button:hover,
.empty-state button:hover {
    transform: translateY(-2px);
}

.primary-action:hover,
.empty-state button:hover {
    box-shadow: var(--shadow-brand-lg);
}

.secondary-action:hover {
    color: var(--brand-deep);
    border-color: var(--brand-soft-2) !important;
    background: var(--brand-soft);
    box-shadow: var(--shadow-md);
}

.hero-trust {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 18px;
    margin-top: 25px;
    color: var(--text-3);
    font-size: .78rem;
}

.hero-trust span::first-letter {
    color: var(--success);
}

.hero-console {
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-lg);
    animation: lib-console-float 6s ease-in-out infinite;
}

.console-top {
    display: flex;
    align-items: center;
    gap: 7px;
    height: 32px;
    padding: 0 14px;
    border-bottom: 1px solid var(--border);
    background: var(--surface-2);
}

.console-top span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ff5f56;
}

.console-top span:nth-child(2) { background: #ffbd2e; }
.console-top span:nth-child(3) { background: #27c93f; }

.console-top b {
    margin-left: auto;
    color: var(--text-3);
    font-size: .64rem;
    letter-spacing: .14em;
}

.console-body {
    display: grid;
    grid-template-columns: 54px minmax(0, 1fr) 128px;
    column-gap: 13px;
    padding: 12px 16px;
}

.console-mark {
    display: grid;
    place-items: center;
    grid-row: 1 / span 3;
    width: 50px;
    height: 50px;
    margin: auto;
    border: 1px solid var(--brand-soft-2);
    border-radius: 14px;
    color: var(--brand-deep);
    background: linear-gradient(145deg, var(--brand-soft), #f7f2ff);
    font-size: 1.18rem;
    font-weight: 900;
    box-shadow: 0 12px 34px rgba(99, 102, 241, .15);
}

.console-line {
    display: grid;
    grid-template-columns: 9px 1fr auto;
    align-items: center;
    gap: 8px;
    padding: 5px 0;
    border-bottom: 1px solid var(--border);
    color: var(--text-2);
    font-size: .71rem;
}

.console-line i {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 0 4px rgba(16, 185, 129, .1);
}

.console-line b {
    color: var(--success-text);
    font-size: .65rem;
}

.console-stats {
    grid-column: 3;
    grid-row: 1 / span 3;
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    margin: 0;
}

.console-stats div {
    padding: 7px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface-2);
}

.console-stats strong {
    display: block;
    color: var(--text);
    font-size: 1.05rem;
}

.console-stats span {
    color: var(--text-3);
    font-size: .64rem;
}

/* 公告与内容区 */
.notice-board {
    display: grid;
    grid-template-columns: 58px 1fr;
    gap: 18px;
    margin: 0 0 76px;
    padding: 20px 25px;
    border: 1px solid var(--brand-soft-2);
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, var(--brand-soft), var(--surface) 74%);
    box-shadow: var(--shadow-md);
}

.notice-icon {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    color: var(--brand-deep);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    font-size: 1.2rem;
}

.section-label {
    margin-bottom: 5px;
    color: var(--brand-deep);
    font-size: .7rem;
    font-weight: 800;
    letter-spacing: .15em;
}

.notice-item + .notice-item {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--brand-soft-2);
}

.notice-item strong {
    color: var(--text);
    font-size: .95rem;
}

.notice-item p {
    margin: 3px 0 0;
    color: var(--text-2);
    font-size: .84rem;
    line-height: 1.7;
}

.library-section {
    margin-bottom: 86px;
}

.section-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 27px;
}

.section-eyebrow {
    display: inline-block;
    padding: 4px 12px;
    border: 1px solid var(--brand-soft-2);
    border-radius: var(--radius-pill);
    background: var(--brand-soft);
    letter-spacing: .12em;
}

.section-heading h2 {
    margin: 10px 0 0;
    color: var(--text);
    font-size: clamp(1.8rem, 3vw, 2.45rem);
    letter-spacing: -.04em;
    -webkit-text-fill-color: initial;
    background: none;
}

.section-heading p,
.result-count {
    color: var(--text-2);
    font-size: .86rem;
}

.result-count {
    padding: 6px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.featured-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}

.featured-card,
.plugin-card {
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-md);
    transition: transform .25s var(--ease), border-color .25s var(--ease), box-shadow .25s var(--ease);
}

.featured-card {
    display: grid;
    grid-template-columns: 145px 1fr;
    min-width: 0;
    color: inherit;
    text-decoration: none;
}

.featured-card:hover,
.plugin-card:hover {
    transform: translateY(-4px);
    border-color: var(--brand-soft-2);
    box-shadow: var(--shadow-lg);
}

.featured-visual {
    position: relative;
    min-height: 145px;
    overflow: hidden;
    background: var(--surface-3);
}

.featured-visual img,
.plugin-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .4s var(--ease);
}

.featured-card:hover img,
.plugin-card:hover img {
    transform: scale(1.04);
}

.featured-badge,
.json-chip {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 5px 10px;
    border: 1px solid var(--brand-soft-2);
    border-radius: var(--radius-pill);
    color: var(--brand-deep);
    background: rgba(255, 255, 255, .88);
    backdrop-filter: blur(8px);
    font-size: .62rem;
    font-weight: 800;
    letter-spacing: .08em;
}

.featured-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 20px;
}

.featured-info h3 {
    overflow: hidden;
    margin: 0 0 6px;
    color: var(--text);
    font-size: 1.05rem;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.featured-info p {
    margin: 0;
    color: var(--text-2);
    font-size: .76rem;
}

.featured-info > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    color: var(--text-3);
    font-size: .75rem;
}

.featured-info strong {
    color: var(--brand-deep);
    font-size: .9rem;
}

/* 搜索、排序与插件卡片 */
.market-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 27px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-md);
}

.search-box {
    display: flex;
    flex: 1;
    align-items: center;
    max-width: 560px;
    min-height: 46px;
    padding-left: 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface-2);
    transition: border-color .2s var(--ease), box-shadow .2s var(--ease), background .2s var(--ease);
}

.search-box:focus-within {
    border-color: var(--brand);
    background: var(--surface);
    box-shadow: var(--ring);
}

.search-box > span {
    color: var(--text-3);
    font-size: 1.3rem;
}

.search-box input {
    flex: 1;
    min-width: 0;
    padding: 0 11px;
    border: 0;
    outline: 0;
    color: var(--text);
    background: transparent;
}

.search-box button {
    align-self: stretch;
    min-width: 74px;
    padding: 0 18px;
    border: 0;
    border-radius: 12px;
    color: #fff;
    background: var(--brand-grad);
    box-shadow: none;
    cursor: pointer;
    font-weight: 700;
}

.sort-tabs {
    display: flex;
    gap: 6px;
}

.sort-tabs a {
    padding: 9px 13px;
    border-radius: var(--radius-sm);
    color: var(--text-2);
    text-decoration: none;
    font-size: .8rem;
    font-weight: 700;
    transition: color .2s var(--ease), background .2s var(--ease);
}

.sort-tabs a:hover,
.sort-tabs a.active {
    color: var(--brand-deep);
    background: var(--brand-soft);
}

.plugin-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 19px;
}

.plugin-card {
    min-width: 0;
}

.plugin-cover {
    position: relative;
    display: block;
    height: 185px;
    overflow: hidden;
    border-bottom: 1px solid var(--border);
    background: var(--surface-3);
}

.json-chip {
    left: auto;
    right: 10px;
}

.plugin-card-body {
    padding: 18px;
}

.plugin-meta {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    color: var(--text-3);
    font-size: .69rem;
}

.plugin-card h3 {
    margin: 9px 0 8px;
    font-size: 1.05rem;
}

.plugin-card h3 a {
    display: block;
    overflow: hidden;
    color: var(--text);
    text-decoration: none;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.plugin-card-body > p {
    display: -webkit-box;
    min-height: 44px;
    margin: 0;
    overflow: hidden;
    color: var(--text-2);
    font-size: .8rem;
    line-height: 1.7;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.plugin-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
}

.plugin-numbers {
    display: flex;
    gap: 12px;
    color: var(--text-3);
    font-size: .72rem;
}

.plugin-card-footer > strong {
    color: var(--brand-deep);
    font-size: 1.02rem;
}

.plugin-card-footer small {
    font-size: .65rem;
}

.plugin-placeholder {
    display: grid;
    place-items: center;
    align-content: center;
    gap: 8px;
    width: 100%;
    height: 100%;
    color: var(--text-3);
    background:
        radial-gradient(circle at 50% 42%, rgba(99, 102, 241, .2), transparent 38%),
        linear-gradient(145deg, var(--brand-soft), var(--surface-3));
}

.plugin-placeholder span {
    color: var(--brand-deep);
    font-size: .58rem;
    font-weight: 700;
    letter-spacing: .16em;
}

.plugin-placeholder b {
    color: var(--brand);
    font-size: 2.2rem;
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    margin-top: 34px;
}

.pagination a {
    padding: 9px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    color: var(--text-2);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    text-decoration: none;
}

.pagination a:hover {
    color: var(--brand-deep);
    border-color: var(--brand-soft-2);
    background: var(--brand-soft);
}

.pagination span {
    color: var(--text-2);
    font-size: .8rem;
}

.empty-state {
    padding: 70px 24px;
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-md);
    text-align: center;
}

.empty-state > div {
    color: var(--brand);
    font-size: 3rem;
}

.empty-state h3 {
    margin: 10px 0 4px;
    color: var(--text);
}

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

/* 弹窗与表单 */
.library-modal[hidden] {
    display: none;
}

.library-modal {
    position: fixed;
    inset: 0;
    z-index: 3000;
    display: grid;
    place-items: center;
    padding: 20px;
    opacity: 0;
    transition: opacity .18s ease;
}

.library-modal.is-open {
    opacity: 1;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(30, 36, 65, .46);
    backdrop-filter: blur(12px);
}

.modal-panel {
    position: relative;
    width: min(680px, 100%);
    max-height: calc(100vh - 40px);
    padding: 34px;
    overflow: auto;
    border: 1px solid var(--border);
    border-radius: 24px;
    color: var(--text);
    background:
        radial-gradient(440px 240px at 100% 0%, rgba(139, 92, 246, .09), transparent 65%),
        var(--surface);
    box-shadow: 0 28px 90px rgba(20, 24, 52, .26);
    transform: translateY(15px) scale(.98);
    transition: transform .18s ease;
}

.is-open .modal-panel {
    transform: none;
}

.modal-wide {
    width: min(860px, 100%);
}

.modal-close {
    position: absolute;
    top: 14px;
    right: 16px;
    display: grid;
    place-items: center;
    width: 36px;
    min-width: 36px;
    height: 36px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 50%;
    color: var(--text-2);
    background: var(--surface-2);
    box-shadow: none;
    cursor: pointer;
    font-size: 1.3rem;
}

.modal-close:hover:not(:disabled) {
    color: var(--brand-deep);
    border-color: var(--brand-soft-2);
    background: var(--brand-soft);
    box-shadow: none;
    transform: none;
}

.modal-heading > span {
    display: inline-block;
    padding: 4px 11px;
    border-radius: var(--radius-pill);
    color: var(--brand-deep);
    background: var(--brand-soft);
    font-size: .68rem;
    font-weight: 800;
    letter-spacing: .14em;
}

.modal-heading h2 {
    margin: 9px 0 4px;
    color: var(--text);
    font-size: 2rem;
    -webkit-text-fill-color: initial;
    background: none;
}

.modal-heading p {
    margin: 0 0 25px;
    color: var(--text-2);
    font-size: .83rem;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 17px;
}

.form-grid label,
.ledger-panel label {
    display: block;
}

.full-field {
    grid-column: 1 / -1;
}

.form-grid label > span,
.ledger-panel label > span {
    display: block;
    margin-bottom: 7px;
    color: var(--text-2);
    font-size: .79rem;
    font-weight: 700;
}

.form-grid em {
    color: var(--brand);
    font-style: normal;
}

.form-grid input,
.form-grid textarea,
.credential-row input {
    width: 100%;
    padding: 12px 13px;
    border: 1px solid var(--border);
    border-radius: 12px;
    outline: 0;
    color: var(--text);
    background: var(--surface-2);
    transition: border-color .2s var(--ease), box-shadow .2s var(--ease), background .2s var(--ease);
}

.form-grid input:focus,
.form-grid textarea:focus,
.credential-row input:focus {
    border-color: var(--brand);
    background: var(--surface);
    box-shadow: var(--ring);
}

.form-grid input::placeholder,
.form-grid textarea::placeholder,
.credential-row input::placeholder {
    color: var(--text-3);
}

.form-grid textarea {
    min-height: 95px;
    resize: vertical;
}

.form-grid label > small {
    display: block;
    margin-top: 6px;
    color: var(--text-3);
    font-size: .68rem;
}

.credential-cache-note [data-clear-card-key] {
    display: inline;
    min-width: 0;
    margin-left: 5px;
    padding: 0;
    border: 0;
    border-radius: 0;
    color: var(--brand-deep);
    background: transparent;
    box-shadow: none;
    font-size: inherit;
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 2px;
    cursor: pointer;
}

.credential-cache-note [data-clear-card-key]:hover:not(:disabled) {
    color: var(--brand-2);
    background: transparent;
    box-shadow: none;
    transform: none;
}

.credential-cache-note [data-clear-card-key]:disabled {
    color: var(--success-text);
    background: transparent;
    box-shadow: none;
}

.file-picker {
    position: relative;
    display: flex !important;
    align-items: center;
    gap: 10px;
    min-height: 48px;
    margin: 0 !important;
    padding: 8px 11px;
    overflow: hidden;
    border: 1px dashed var(--border-strong);
    border-radius: 12px;
    color: var(--text-2) !important;
    background: var(--surface-2);
    transition: border-color .2s var(--ease), background .2s var(--ease), box-shadow .2s var(--ease);
}

.file-picker:hover,
.file-picker:focus-within {
    border-color: var(--brand);
    background: var(--brand-soft);
    box-shadow: var(--ring);
}

.file-picker.file-error {
    border-color: var(--danger);
    background: var(--danger-soft);
    box-shadow: 0 0 0 4px rgba(239, 68, 68, .1);
}

.file-picker input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.file-picker b {
    color: var(--brand-deep);
    font-size: .76rem;
}

.file-picker small {
    overflow: hidden;
    margin-left: auto;
    color: var(--text-3) !important;
    font-size: .65rem !important;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.file-picker small.error {
    color: var(--danger-text) !important;
}

.image-picker.paste-success {
    border-color: var(--success);
    background: var(--success-soft);
    box-shadow: 0 0 0 4px rgba(16, 185, 129, .12);
    animation: paste-pop .42s var(--ease);
}

@keyframes paste-pop {
    50% { transform: translateY(-2px) scale(1.005); }
}

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

.image-preview-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-top: -5px;
}

.image-preview-item {
    position: relative;
    min-width: 0;
    margin: 0;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface-2);
    box-shadow: var(--shadow-sm);
}

.image-preview-item img {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    background: var(--surface-3);
}

.image-preview-item figcaption {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 7px;
    padding: 8px 9px;
    border-top: 1px solid var(--border);
}

.image-preview-item figcaption span {
    display: grid;
    place-items: center;
    width: 23px;
    height: 23px;
    border-radius: 7px;
    color: var(--brand-deep);
    background: var(--brand-soft);
    font-size: .6rem;
    font-weight: 800;
}

.image-preview-item figcaption b {
    overflow: hidden;
    color: var(--text-2);
    font-size: .66rem;
    font-weight: 600;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.form-message {
    min-height: 22px;
    margin: 15px 0 5px;
    color: var(--text-2);
    font-size: .78rem;
}

.form-message.success,
.download-message.success {
    color: var(--success-text);
}

.form-message.error,
.download-message.error,
.ledger-empty.error {
    color: var(--danger-text);
}

.form-submit {
    width: 100%;
    min-height: 50px;
    padding: 0 24px;
    border: 0;
    border-radius: var(--radius-pill);
    color: #fff;
    background: var(--brand-grad);
    box-shadow: var(--shadow-brand);
    cursor: pointer;
    font-weight: 800;
}

.form-submit:hover:not(:disabled) {
    box-shadow: var(--shadow-brand-lg);
}

.form-submit:disabled,
.credential-row button:disabled {
    opacity: .58;
    cursor: wait;
}

.credential-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 9px;
}

.credential-row button {
    min-width: 88px;
    padding: 0 20px;
    border: 0;
    border-radius: var(--radius-pill);
    color: #fff;
    background: var(--brand-grad);
    box-shadow: var(--shadow-brand);
    cursor: pointer;
    font-weight: 800;
}

.ledger-result {
    margin-top: 20px;
}

.ledger-empty {
    padding: 28px 14px;
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius-md);
    color: var(--text-2);
    background: var(--surface-2);
    text-align: center;
    font-size: .78rem;
}

.ledger-balance {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    padding: 19px;
    border: 1px solid #bfeee1;
    border-radius: var(--radius-md);
    background: var(--success-soft);
}

.ledger-balance span {
    color: var(--success-text);
    font-size: .76rem;
}

.ledger-balance strong {
    color: var(--success-text);
    font-size: 1.7rem;
}

.ledger-balance small {
    font-size: .7rem;
}

.ledger-list {
    margin-top: 12px;
}

.ledger-row {
    display: grid;
    grid-template-columns: 34px 1fr auto;
    gap: 11px;
    align-items: center;
    padding: 12px 4px;
    border-bottom: 1px solid var(--border);
    color: inherit;
    text-decoration: none;
}

.ledger-row:hover strong {
    color: var(--brand-deep);
}

.ledger-type {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 9px;
    font-weight: 900;
}

.ledger-type.income {
    color: var(--success-text);
    background: var(--success-soft);
}

.ledger-type.expense {
    color: var(--danger-text);
    background: var(--danger-soft);
}

.ledger-row strong {
    display: block;
    color: var(--text);
    font-size: .78rem;
}

.ledger-row small {
    display: block;
    margin-top: 2px;
    color: var(--text-3);
    font-size: .65rem;
}

.ledger-row > b {
    font-size: .78rem;
}

.ledger-row > b.income { color: var(--success-text); }
.ledger-row > b.expense { color: var(--danger-text); }

.library-modal-open {
    overflow: hidden;
}

/* 插件详情页 */
.detail-shell {
    width: min(1200px, 100%);
    margin: 0 auto;
    padding-bottom: 54px;
    color: var(--lib-text);
}

.detail-back {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin: 8px 0 24px;
    padding: 7px 13px;
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    color: var(--text-2);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    text-decoration: none;
    font-size: .82rem;
    transition: color .2s var(--ease), border-color .2s var(--ease), background .2s var(--ease);
}

.detail-back:hover {
    color: var(--brand-deep);
    border-color: var(--brand-soft-2);
    background: var(--brand-soft);
}

.detail-header {
    position: relative;
    padding: 46px;
    overflow: hidden;
    border: 1px solid var(--brand-soft-2);
    border-radius: 26px;
    background:
        radial-gradient(circle at 90% 20%, rgba(20, 184, 166, .12), transparent 30%),
        radial-gradient(circle at 8% 100%, rgba(139, 92, 246, .12), transparent 34%),
        linear-gradient(135deg, var(--brand-soft), var(--surface) 68%);
    box-shadow: var(--shadow-lg);
}

.detail-header::after {
    content: "{ JSON }";
    position: absolute;
    right: 5%;
    bottom: -28px;
    color: rgba(99, 102, 241, .075);
    font-size: 7rem;
    font-weight: 900;
    letter-spacing: -.08em;
}

.detail-chip {
    display: inline-flex;
    padding: 6px 11px;
    border: 1px solid var(--brand-soft-2);
    border-radius: var(--radius-pill);
    color: var(--brand-deep);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    font-size: .66rem;
    font-weight: 800;
    letter-spacing: .1em;
}

.detail-header-actions {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.detail-edit-button {
    min-height: 38px;
    padding: 0 17px;
    border: 1px solid var(--brand-soft-2);
    border-radius: var(--radius-pill);
    color: var(--brand-deep);
    background: rgba(255, 255, 255, .78);
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    font-weight: 800;
}

.detail-edit-button:hover {
    background: var(--surface);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.detail-header h1 {
    position: relative;
    z-index: 1;
    max-width: 850px;
    margin: 15px 0 12px;
    color: transparent;
    background: linear-gradient(135deg, #4f46e5, #6366f1 48%, #8b5cf6);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-size: clamp(2.2rem, 5vw, 4.2rem);
    line-height: 1.12;
    letter-spacing: -.055em;
}

.detail-author {
    position: relative;
    z-index: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 9px 15px;
    color: var(--text-2);
    font-size: .8rem;
}

.detail-author strong {
    color: var(--text);
}

.detail-disclaimer {
    position: relative;
    z-index: 1;
    max-width: 760px;
    margin: 10px 0 0;
    color: var(--text-3);
    font-size: .72rem;
    line-height: 1.65;
}

.detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 25px;
    margin-top: 25px;
}

.detail-main,
.purchase-panel {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-md);
}

.detail-main {
    padding: 32px;
}

.detail-block + .detail-block {
    margin-top: 32px;
    padding-top: 28px;
    border-top: 1px solid var(--border);
}

.detail-block h2 {
    margin: 0 0 14px;
    color: var(--text);
    background: none;
    -webkit-text-fill-color: initial;
    font-size: 1.25rem;
}

.detail-block h2::before {
    content: "";
    display: inline-block;
    width: 4px;
    height: 17px;
    margin-right: 9px;
    border-radius: var(--radius-pill);
    background: var(--brand-grad);
    vertical-align: -2px;
}

.detail-copy {
    color: var(--text-2);
    font-size: .9rem;
    line-height: 1.9;
    white-space: pre-line;
    overflow-wrap: anywhere;
}

.screenshot-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.screenshot-grid button {
    position: relative;
    display: block;
    width: 100%;
    padding: 0;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface-3);
    box-shadow: var(--shadow-sm);
    cursor: zoom-in;
    text-align: left;
    transition: border-color .2s var(--ease), box-shadow .2s var(--ease), transform .2s var(--ease);
}

.screenshot-grid img {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    transition: transform .25s var(--ease);
}

.screenshot-grid button > span {
    position: absolute;
    right: 10px;
    bottom: 10px;
    padding: 6px 10px;
    border: 1px solid rgba(255, 255, 255, .3);
    border-radius: var(--radius-pill);
    color: #fff;
    background: rgba(15, 23, 42, .74);
    backdrop-filter: blur(8px);
    font-size: .68rem;
    font-weight: 700;
    opacity: 0;
    transform: translateY(5px);
    transition: opacity .2s var(--ease), transform .2s var(--ease);
}

.screenshot-grid button:hover,
.screenshot-grid button:focus-visible {
    border-color: var(--brand-soft-2);
    box-shadow: var(--shadow-md), var(--ring);
    transform: translateY(-2px);
    outline: 0;
}

.screenshot-grid button:hover img,
.screenshot-grid button:focus-visible img {
    transform: scale(1.03);
}

.screenshot-grid button:hover > span,
.screenshot-grid button:focus-visible > span {
    opacity: 1;
    transform: translateY(0);
}

.no-screenshots {
    padding: 45px 20px;
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius-md);
    color: var(--text-3);
    background: var(--surface-2);
    text-align: center;
}

.screenshot-lightbox[hidden] {
    display: none;
}

.screenshot-lightbox {
    position: fixed;
    inset: 0;
    z-index: 3000;
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr) 64px;
    align-items: center;
    gap: 18px;
    padding: 68px 24px 24px;
    color: #fff;
    background: rgba(8, 12, 28, .92);
    backdrop-filter: blur(16px);
    opacity: 0;
    transition: opacity .18s ease;
}

.screenshot-lightbox.is-open {
    opacity: 1;
}

.screenshot-lightbox-open {
    overflow: hidden;
}

.screenshot-lightbox button {
    min-width: 0;
    min-height: 0;
    margin: 0;
    padding: 0;
    font: inherit;
}

.lightbox-stage {
    display: grid;
    grid-column: 2;
    grid-row: 1;
    grid-template-rows: minmax(0, 1fr) auto;
    place-items: center;
    min-width: 0;
    width: min(1180px, 100%);
    height: min(82vh, 820px);
    margin: 0 auto;
}

.lightbox-stage img {
    display: block;
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 14px;
    background: rgba(255, 255, 255, .04);
    box-shadow: 0 28px 80px rgba(0, 0, 0, .42);
}

.lightbox-stage figcaption {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-height: 42px;
    padding-top: 10px;
    color: rgba(255, 255, 255, .76);
    font-size: .76rem;
}

.lightbox-stage figcaption span {
    padding: 4px 9px;
    border-radius: var(--radius-pill);
    background: rgba(255, 255, 255, .12);
    font-variant-numeric: tabular-nums;
}

.lightbox-stage figcaption strong {
    overflow: hidden;
    max-width: 65vw;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.lightbox-close,
.lightbox-nav {
    display: grid;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 50%;
    color: #fff;
    background: rgba(255, 255, 255, .09);
    cursor: pointer;
    transition: background .2s ease, transform .2s ease, border-color .2s ease;
}

.lightbox-close:hover,
.lightbox-close:focus-visible,
.lightbox-nav:hover,
.lightbox-nav:focus-visible {
    border-color: rgba(255, 255, 255, .42);
    background: rgba(255, 255, 255, .18);
    outline: 0;
    transform: scale(1.06);
}

.lightbox-close {
    position: absolute;
    top: 18px;
    right: 22px;
    width: 42px;
    height: 42px;
    font-size: 1.65rem;
    line-height: 1;
}

.lightbox-nav {
    width: 54px;
    height: 54px;
    font-size: 2.2rem;
    line-height: 1;
}

.lightbox-prev {
    grid-column: 1;
    grid-row: 1;
}

.lightbox-next {
    grid-column: 3;
    grid-row: 1;
}

.lightbox-nav[hidden] {
    display: none;
}

.purchase-panel {
    position: sticky;
    top: 104px;
    align-self: start;
    padding: 26px;
}

.price-label {
    color: var(--text-3);
    font-size: .72rem;
}

.purchase-price {
    margin: 3px 0 18px;
    color: var(--brand-deep);
    font-size: 2.5rem;
    font-weight: 900;
}

.purchase-price small {
    font-size: .82rem;
}

.purchase-features {
    margin: 0 0 22px;
    padding: 0;
    list-style: none;
}

.purchase-features li {
    padding: 9px 0;
    border-bottom: 1px solid var(--border);
    color: var(--text-2);
    font-size: .78rem;
}

.purchase-features li::before {
    content: "✓";
    display: inline-grid;
    place-items: center;
    width: 18px;
    height: 18px;
    margin-right: 8px;
    border-radius: 50%;
    color: var(--success-text);
    background: var(--success-soft);
    font-size: .65rem;
}

.secure-download-form label > span {
    display: block;
    margin-bottom: 7px;
    color: var(--text-2);
    font-size: .77rem;
    font-weight: 700;
}

.secure-download-form input {
    width: 100%;
    padding: 12px 13px;
    border: 1px solid var(--border);
    border-radius: 12px;
    outline: 0;
    color: var(--text);
    background: var(--surface-2);
}

.secure-download-form input:focus {
    border-color: var(--brand);
    background: var(--surface);
    box-shadow: var(--ring);
}

.secure-download-form button {
    width: 100%;
    min-width: 0;
    min-height: 48px;
    margin-top: 11px;
    padding: 0 18px;
    border: 0;
    border-radius: var(--radius-pill);
    color: #fff;
    background: var(--brand-grad);
    box-shadow: var(--shadow-brand);
    cursor: pointer;
    font-weight: 800;
}

.secure-download-form button:hover:not(:disabled) {
    box-shadow: var(--shadow-brand-lg);
}

.secure-download-form button:disabled {
    opacity: .55;
    cursor: wait;
}

.download-message {
    min-height: 20px;
    margin-top: 11px;
    color: var(--text-2);
    font-size: .72rem;
    line-height: 1.55;
}

.security-note {
    margin: 18px 0 0;
    padding: 12px;
    border: 1px solid var(--brand-soft-2);
    border-radius: 11px;
    color: var(--text-2);
    background: var(--brand-soft);
    font-size: .68rem;
    line-height: 1.6;
}

.comments-panel {
    margin-top: 25px;
    padding: 30px 32px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-md);
}

.comments-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.comments-heading > div > span {
    color: var(--brand-deep);
    font-size: .63rem;
    font-weight: 900;
    letter-spacing: .15em;
}

.comments-heading h2 {
    margin: 5px 0 0;
    color: var(--text);
    background: none;
    -webkit-text-fill-color: initial;
    font-size: 1.35rem;
}

.comments-heading h2 small {
    display: inline-grid;
    place-items: center;
    min-width: 25px;
    height: 25px;
    margin-left: 5px;
    padding: 0 7px;
    border-radius: var(--radius-pill);
    color: var(--brand-deep);
    background: var(--brand-soft);
    font-size: .68rem;
    vertical-align: 3px;
}

.comment-profile-button {
    min-height: 38px;
    padding: 0 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    color: var(--text-2);
    background: var(--surface-2);
    cursor: pointer;
    font-size: .75rem;
    font-weight: 800;
}

.comment-profile-button:hover {
    color: var(--brand-deep);
    border-color: var(--brand-soft-2);
    background: var(--brand-soft);
}

.comment-identity {
    margin-top: 18px;
    color: var(--text-3);
    font-size: .72rem;
}

.comment-form {
    margin-top: 10px;
    padding: 13px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface-2);
    transition: border-color .2s var(--ease), box-shadow .2s var(--ease), background .2s var(--ease);
}

.comment-form:focus-within {
    border-color: var(--brand-soft-2);
    background: var(--surface);
    box-shadow: var(--ring);
}

.comment-form textarea {
    display: block;
    width: 100%;
    min-height: 92px;
    padding: 4px;
    resize: vertical;
    border: 0;
    outline: 0;
    color: var(--text);
    background: transparent;
    font: inherit;
    font-size: .84rem;
    line-height: 1.7;
}

.comment-form textarea::placeholder {
    color: var(--text-3);
}

.comment-form-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
}

.comment-form-footer > span {
    color: var(--text-3);
    font-size: .72rem;
}

.comment-form-footer > span.success { color: var(--success-text); }
.comment-form-footer > span.error { color: var(--danger-text); }

.comment-form-footer button {
    min-height: 38px;
    padding: 0 19px;
    border: 0;
    border-radius: var(--radius-pill);
    color: #fff;
    background: var(--brand-grad);
    box-shadow: var(--shadow-brand);
    cursor: pointer;
    font-weight: 800;
}

.comment-form-footer button:disabled {
    opacity: .58;
    cursor: wait;
}

.comment-list {
    display: grid;
    margin-top: 18px;
}

.comment-item {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 13px;
    padding: 18px 3px;
    border-top: 1px solid var(--border);
}

.comment-avatar {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border: 1px solid var(--brand-soft-2);
    border-radius: 13px;
    color: var(--brand-deep);
    background: linear-gradient(145deg, var(--brand-soft), var(--surface));
    font-size: .85rem;
    font-weight: 900;
}

.comment-item header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
}

.comment-item strong {
    color: var(--text);
    font-size: .82rem;
}

.comment-item time {
    color: var(--text-3);
    font-size: .65rem;
}

.comment-item p {
    margin: 6px 0 0;
    color: var(--text-2);
    font-size: .8rem;
    line-height: 1.75;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.comments-empty {
    margin-top: 18px;
    padding: 38px 18px;
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius-md);
    color: var(--text-3);
    background: var(--surface-2);
    text-align: center;
    font-size: .78rem;
}

.identity-panel {
    width: min(510px, 100%);
}

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

.edit-existing-wrap > .field-label {
    display: block;
    margin-bottom: 7px;
    color: var(--text-2);
    font-size: .79rem;
    font-weight: 700;
}

.edit-existing-wrap > .field-label small {
    color: var(--text-3);
    font-weight: 500;
}

.edit-existing-images {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.edit-existing-image {
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface-2);
    box-shadow: var(--shadow-sm);
    cursor: pointer;
}

.edit-existing-image img {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
}

.edit-existing-image > span {
    display: flex !important;
    align-items: center;
    gap: 7px;
    margin: 0 !important;
    padding: 9px;
    border-top: 1px solid var(--border);
    color: var(--text-2) !important;
    font-size: .67rem !important;
}

.edit-existing-image input {
    width: auto;
    accent-color: var(--brand);
}

@keyframes lib-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-18px); }
}

@keyframes lib-console-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes lib-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: .35; }
}

@media (max-width: 1100px) {
    .library-hero {
        grid-template-columns: 1fr;
        min-height: auto;
        text-align: center;
    }

    .library-hero-copy > p {
        margin-inline: auto;
    }

    .hero-actions,
    .hero-trust {
        justify-content: center;
    }

    .hero-console {
        display: none;
    }

    .featured-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .plugin-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 760px) {
    .library-hero {
        gap: 0;
        padding: 24px 8px 30px;
    }

    .library-hero h1 {
        font-size: clamp(2.25rem, 12vw, 3.25rem);
    }

    .library-hero-copy > p {
        font-size: .92rem;
    }

    .hero-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .hero-actions button {
        width: 100%;
    }

    .hero-trust {
        gap: 8px 13px;
    }

    .console-body {
        padding: 22px;
    }

    .notice-board {
        grid-template-columns: 42px 1fr;
        margin-bottom: 58px;
        padding: 16px;
    }

    .notice-icon {
        width: 38px;
        height: 38px;
    }

    .featured-grid,
    .plugin-grid {
        grid-template-columns: 1fr;
    }

    .featured-card {
        grid-template-columns: 125px 1fr;
    }

    .market-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .search-box {
        max-width: none;
    }

    .sort-tabs {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
    }

    .sort-tabs a {
        text-align: center;
    }

    .section-heading {
        align-items: flex-start;
        flex-direction: column;
    }

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

    .full-field {
        grid-column: auto;
    }

    .modal-panel {
        padding: 28px 18px 22px;
    }

    .credential-row {
        grid-template-columns: 1fr;
    }

    .credential-row button {
        min-height: 44px;
    }

    .library-modal {
        padding: 10px;
    }

    .modal-panel {
        max-height: calc(100vh - 20px);
    }

    .ledger-row {
        grid-template-columns: 31px 1fr;
    }

    .ledger-row > b {
        grid-column: 2;
    }

    .plugin-cover {
        height: 210px;
    }

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

    .detail-header {
        padding: 30px 22px;
    }

    .detail-header-actions {
        align-items: flex-start;
    }

    .detail-disclaimer {
        max-width: 100%;
        font-size: .68rem;
    }

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

    .purchase-panel {
        position: static;
    }

    .detail-main {
        padding: 23px;
    }

    .comments-panel {
        padding: 23px;
    }

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

    .screenshot-grid {
        grid-template-columns: 1fr;
    }

    .screenshot-grid button > span {
        opacity: 1;
        transform: none;
    }

    .screenshot-lightbox {
        grid-template-columns: 44px minmax(0, 1fr) 44px;
        gap: 7px;
        padding: 62px 8px 14px;
    }

    .lightbox-nav {
        width: 42px;
        height: 42px;
        font-size: 1.8rem;
    }

    .lightbox-close {
        top: 12px;
        right: 12px;
        width: 40px;
        height: 40px;
    }

    .lightbox-stage {
        height: min(78vh, 720px);
    }
}

@media (max-width: 480px) {
    .hero-console {
        display: none;
    }

    .library-hero {
        padding-top: 24px;
    }

    .hero-actions {
        grid-template-columns: 1fr;
    }

    .comments-heading,
    .comment-form-footer,
    .comment-item header {
        align-items: flex-start;
        flex-direction: column;
    }

    .comment-profile-button,
    .comment-form-footer button {
        width: 100%;
    }

    .edit-existing-images {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    .library-shell *,
    .library-modal *,
    .screenshot-lightbox * {
        animation: none !important;
        scroll-behavior: auto !important;
    }
}
