/* workshop-plot.css — 剧情卡工坊 */
.plot-card-badge {
    position: absolute;
    right: 2px;
    bottom: 2px;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border: 2px solid var(--bg-card, #fff);
    border-radius: 8px;
    background: var(--primary);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    line-height: 16px;
    text-align: center;
}

.plot-card-item .card-avatar {
    position: relative;
}

.plot-detail-hero {
    background-position: center;
    background-size: cover;
}

.plot-detail-cover {
    border-radius: 16px;
}

.plot-detail-text {
    white-space: pre-wrap;
    word-break: break-word;
}

.plot-detail-stats {
    grid-template-columns: repeat(4, 1fr);
}

.plot-detail-actions {
    flex-wrap: wrap;
}

.plot-detail-character-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.plot-detail-character {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    padding: 11px;
    border-radius: 14px;
    background: var(--bg-body);
}

.plot-detail-character-avatar {
    width: 46px;
    height: 46px;
    flex: 0 0 auto;
    border-radius: 50%;
    background-color: var(--active-bg);
    background-position: center;
    background-size: cover;
}

.plot-detail-character-info {
    min-width: 0;
    flex: 1;
}

.plot-detail-character-name {
    color: var(--text-main);
    font-size: 14px;
    font-weight: 700;
}

.plot-detail-character-role {
    margin-top: 2px;
    color: var(--primary);
    font-size: 11px;
    font-weight: 600;
}

.plot-detail-character-intro {
    display: -webkit-box;
    margin-top: 5px;
    overflow: hidden;
    color: var(--text-sub);
    font-size: 12px;
    line-height: 1.55;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.plot-qrcode-container {
    position: relative;
}

.plot-qrcode-avatar {
    background-position: center;
    background-size: cover;
}

.plot-publish-sheet,
.plot-owned-sheet,
.plot-publish-confirm-sheet {
    box-sizing: border-box;
    max-height: min(84vh, 720px);
    max-height: min(84dvh, 720px);
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px));
}

.plot-sheet-primary,
.plot-sheet-cancel {
    display: block;
    width: calc(100% - 28px);
    min-height: 44px;
    margin: 10px 14px 0;
    border: 0;
    border-radius: 13px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
}

.plot-sheet-primary {
    background: var(--primary);
    color: #fff;
}

.plot-sheet-primary:disabled {
    opacity: .55;
}

.plot-sheet-cancel {
    background: var(--bg-body);
    color: var(--text-sub);
}

.plot-owned-loading,
.plot-owned-empty {
    margin: 10px 14px 16px;
    padding: 30px 16px;
    border-radius: 14px;
    background: var(--bg-body);
    color: var(--text-sub);
    font-size: 13px;
    text-align: center;
}

.plot-owned-list {
    max-height: 54vh;
    margin: 0 9px;
    overflow-y: auto;
    border-radius: 14px;
    background: var(--bg-body);
}

.plot-owned-item {
    display: flex;
    width: 100%;
    align-items: center;
    gap: 11px;
    padding: 11px 12px;
    border: 0;
    background: transparent;
    color: inherit;
    font-family: inherit;
    text-align: left;
}

.plot-owned-item + .plot-owned-item {
    border-top: .5px solid var(--border-light);
}

.plot-owned-avatar {
    width: 46px;
    height: 46px;
    flex: 0 0 auto;
    border-radius: 13px;
    background-color: var(--active-bg);
    background-position: center;
    background-size: cover;
}

.plot-owned-info {
    display: block;
    min-width: 0;
    flex: 1;
}

.plot-owned-name,
.plot-owned-meta {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.plot-owned-name {
    color: var(--text-main);
    font-size: 14px;
    font-weight: 700;
}

.plot-owned-meta {
    margin-top: 4px;
    color: var(--text-sub);
    font-size: 11px;
}

.plot-owned-status {
    flex: 0 0 auto;
    padding: 5px 9px;
    border-radius: 10px;
    background: var(--primary);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
}

.plot-owned-status.published {
    background: var(--active-bg);
    color: var(--text-sub);
}

.plot-owned-status.pending {
    background: rgba(245, 158, 11, 0.12);
    color: #d97706;
}

.plot-publish-preview {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 4px 14px 16px;
    padding: 13px;
    border-radius: 14px;
    background: var(--bg-body);
}

.plot-publish-avatar {
    width: 54px;
    height: 54px;
    flex: 0 0 auto;
    border-radius: 15px;
    background-position: center;
    background-size: cover;
}

.plot-publish-info {
    min-width: 0;
    flex: 1;
}

.plot-publish-name {
    overflow: hidden;
    color: var(--text-main);
    font-size: 16px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.plot-publish-meta {
    margin-top: 4px;
    color: var(--text-sub);
    font-size: 12px;
}

.plot-publish-label {
    display: block;
    margin: 0 16px 7px;
    color: var(--text-main);
    font-size: 13px;
    font-weight: 600;
}

.plot-publish-input {
    display: block;
    width: calc(100% - 28px);
    height: 44px;
    margin: 0 14px;
    padding: 0 13px;
    border: 1px solid var(--border-light);
    border-radius: 12px;
    outline: none;
    background: var(--bg-body);
    color: var(--text-main);
    font-family: inherit;
    font-size: 14px;
}

@media (max-width: 360px) {
    .plot-detail-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* 剧情卡发布分类选择 */
.plot-publish-category-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 16px 2px 10px;
}
.plot-publish-category-head .plot-publish-label {
    margin: 0;
    color: var(--text-main);
    font-size: 13px;
    font-weight: 700;
}
.plot-publish-category-head .plot-publish-label span {
    color: var(--text-time);
    font-size: 11px;
    font-weight: 500;
}
.plot-publish-category-count {
    color: var(--text-time);
    font-size: 11px;
}
.plot-publish-category-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    margin: 0 2px 9px;
}
.plot-category-chip {
    min-width: 72px;
    min-height: 38px;
    padding: 8px 15px;
    border: 1px solid var(--border-light);
    border-radius: 999px;
    background: var(--bg-card);
    color: var(--text-sub);
    font-size: 13px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    cursor: pointer;
    transition: transform .15s, color .18s, background .18s, border-color .18s;
}
.plot-category-chip:active { transform: scale(.95); }
.plot-category-chip.active {
    border-color: var(--primary);
    background: var(--primary);
    color: #fff;
    box-shadow: 0 5px 14px rgba(232,96,60,.20);
}
.plot-category-chip.plot-category-add {
    border-style: dashed;
    background: transparent;
    color: var(--text-sub);
}
.plot-category-chip.plot-category-add svg {
    width: 15px;
    height: 15px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
}
.plot-publish-custom-category-row {
    align-items: center;
    gap: 7px;
    margin: 4px 2px 10px;
}
.plot-publish-custom-category-row .plot-publish-input {
    min-width: 0;
    flex: 1;
    margin: 0;
}
.plot-publish-custom-category-row button {
    min-height: 38px;
    padding: 0 12px;
    border: 0;
    border-radius: 10px;
    background: var(--primary);
    color: #fff;
    font-size: 12px;
    font-weight: 650;
}
.plot-publish-custom-category-row button.cancel {
    background: var(--active-bg);
    color: var(--text-sub);
}

/* 作者下架按钮仅保留文字 */
.plot-owner-offline-btn {
    justify-content: center;
    gap: 0;
}
