/* ============================================================
   Creawith Author Page - 高定画廊级视觉规范 (100% 贯通防割裂版)
   路径：assets/css/creawith-author.css
   ============================================================ */

/* 主容器解绑：只覆盖作者画廊，不影响全站其他 .creator-page 使用场景。 */
.creator-gallery-page.creator-page {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    opacity: 1;
    animation: none;
}

/* 1. 全贯通 Hero Banner (100% Full-Bleed · 无圆角防割裂) */
.creator-gallery-hero {
    position: relative;
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    margin-right: calc(-50vw + 50%);
    height: clamp(240px, 28vw, 420px);
    overflow: hidden;
    background: #f8f9fa;
    border-radius: 0 !important; /* ⭐ 彻底抹除圆角，绝杀 4 角割裂感 */
}

.creator-cover {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    border-radius: 0 !important; /* ⭐ 彻底抹除圆角 */
    transition: filter 0.3s ease;
}

/* 🌟 核心对齐：完全复用首页 Hero 大图 (creawith-hero.css) 占位画板与胶片微噪声质感 */
.creator-cover--empty {
    position: relative;
    background: linear-gradient(135deg, #f8f9fa 0%, #f1f3f5 100%) !important; /* 冷调柔光画布底色 */
}

/* 电影胶片级灰度微噪声肌理：建立实体画布微肌理 */
.creator-cover--empty::before {
    content: "";
    position: absolute;
    inset: 0;
    opacity: 0.14;
    mix-blend-mode: overlay;
    pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

.creator-cover-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.02) 0%, rgba(0, 0, 0, 0.12) 100%);
    pointer-events: none;
}

/* 封面控制组件 */
.creator-cover-controls {
    position: absolute;
    right: 40px;
    bottom: 20px;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 10px;
}

.creator-cover-action {
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 999px;
    font-size: 12.5px;
    font-weight: 600;
    color: #111111;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    transition: background 0.2s ease, transform 0.15s ease, opacity 0.15s ease;
}

.creator-cover-action:hover {
    background: #ffffff;
    transform: translateY(-1px);
}

.creator-cover-action.is-confirming {
    background: #8b3434;
    color: #ffffff;
    border-color: #8b3434;
}

.creator-cover-action[aria-busy="true"] {
    cursor: wait;
    opacity: 0.56;
}

.creator-cover-progress {
    width: 80px;
    height: 4px;
    accent-color: #111111;
}

.creator-cover-status {
    font-size: 12px;
    color: #555555;
    text-shadow: none;
}

.creator-cover-status.is-error {
    color: #8b3434;
}

/* 2. Top Runway：Profile 与 Tabs，1480px 外宽 / 1400px 净宽 */
.creator-content-container {
    width: min(100%, 1480px);
    margin: 0 auto;
    padding: 0 40px;
    box-sizing: border-box;
}

/* Bottom Runway：Sort、Grid 与 Pagination，1920px 外宽 / 1840px 净宽 */
.creator-gallery-section {
    width: min(100%, 1920px);
    margin: 0 auto;
    padding: 0 40px 96px;
    box-sizing: border-box;
}

/* 3. Profile 四角平衡资料区：左侧信息撑高，右侧操作与成果上下分置。 */
.creator-profile-section {
    display: grid;
    grid-template-columns: 132px minmax(0, 1fr) auto;
    gap: 32px;
    align-items: stretch;
    min-height: 176px;
    padding-top: 32px;
    padding-bottom: 36px;
    border-bottom: 1px solid rgba(17, 17, 17, 0.06);
}

.creator-avatar-frame {
    width: 132px;
    height: 132px;
    border-radius: 50%;
    position: relative;
    z-index: 5;
    flex-shrink: 0;
}

.creator-avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 3.5px solid #ffffff;
    box-shadow: 0 8px 24px rgba(17, 17, 17, 0.08);
    box-sizing: border-box;
    display: block;
}

/* 主元资料流 */
.creator-main-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-width: 0;
}

.creator-identity-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.creator-name {
    font-size: 26px;
    font-weight: 750;
    color: #111111;
    letter-spacing: -0.02em;
    margin: 0;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

/* 复用 creawith-header.css 的 badge 规范 */
.creator-name .user-premium-badge {
    font-size: 9.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 3px 6px;
    border-radius: 4px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
}

.creator-name .badge-creator {
    background: rgba(17, 17, 17, 0.06);
    color: #444444;
}

.creator-id-row {
    width: fit-content;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 32px;
    margin-top: 8px;
}

.creator-id-badge {
    color: #5f5f5f;
    font-size: 12px;
    font-weight: 650;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.035em;
}

.creator-id-copy {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-height: 32px;
    padding: 0 6px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: #777777;
    font: inherit;
    font-size: 12px;
    cursor: pointer;
    transition: color 160ms ease, background-color 160ms ease;
}

.creator-id-copy svg {
    width: 15px;
    height: 15px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.45;
}

.creator-id-copy.is-copied {
    color: #277f70;
}

.creator-id-copy-status {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

.creator-id-copy:focus-visible,
.creator-relation-link:focus-visible {
    outline: 2px solid rgba(75, 175, 159, 0.72);
    outline-offset: 3px;
}

@media (hover: hover) and (pointer: fine) {
    .creator-id-copy:hover {
        color: #111111;
        background: rgba(17, 17, 17, 0.045);
    }
}

.creator-relations {
    display: flex;
    align-items: center;
    gap: 20px;
    min-height: 28px;
    margin-top: 2px;
}

.creator-relation-link {
    display: inline-flex;
    align-items: baseline;
    gap: 5px;
    color: #4f4f4f;
    font-size: 13px;
    font-weight: 550;
    line-height: 1.3;
    text-decoration: none;
    border-radius: 7px;
    transition: color 160ms ease;
}

.creator-relation-count {
    color: #171717;
    font-variant-numeric: tabular-nums;
    font-weight: 700;
}

@media (hover: hover) and (pointer: fine) {
    .creator-relation-link:hover {
        color: #111111;
    }
}

.creator-bio {
    font-size: 14px;
    color: #666666;
    margin: 12px 0 0;
    line-height: 1.5;
    max-width: 600px;
}

.creator-details-trigger {
    background: transparent;
    border: none;
    padding: 0;
    font-size: 13px;
    font-weight: 600;
    color: #111111;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 8px;
    width: fit-content;
    transition: opacity 0.2s ease;
}

.creator-details-trigger:hover {
    opacity: 0.7;
}

/* 右侧四角锚点：操作在上，成果统计维持原右侧区域并沉底。 */
.creator-side-matrix {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: space-between;
    gap: 32px;
    min-width: 220px;
    padding: 2px 0 4px;
}

.creator-stats-matrix {
    display: flex;
    align-items: center;
    gap: 24px;
}

.stat-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.stat-box .stat-num {
    font-size: 16px;
    font-weight: 700;
    color: #111111;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}

.stat-box .stat-label {
    font-size: 11px;
    color: #777777;
}

.creator-profile-action {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    width: fit-content;
    max-width: 100%;
}

.cw-author-follow-control__button,
.creator-edit-profile-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: max-content;
    max-width: 100%;
    height: 38px;
    padding: 0 24px;
    box-sizing: border-box;
    border-radius: 999px;
    background: #111111;
    color: #ffffff;
    border: 1px solid #111111;
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, opacity 0.2s ease;
}

.cw-author-follow-control__button.followed,
.cw-author-follow-control__button.is-following {
    background: transparent;
    color: #555555;
    border-color: rgba(17, 17, 17, 0.15);
}

.cw-author-follow-control__button.is-confirming {
    background: #8b3434;
    border-color: #8b3434;
    color: #ffffff;
}

.cw-author-follow-control__button[aria-busy="true"] {
    cursor: wait;
    opacity: 0.58;
}

.cw-author-follow-control__button:hover,
.creator-edit-profile-link:hover {
    background: #262626;
    border-color: #262626;
    color: #ffffff;
}

.cw-author-follow-control__button:focus-visible,
.creator-edit-profile-link:focus-visible {
    outline: 2px solid rgba(75, 175, 159, 0.72);
    outline-offset: 3px;
}

.creator-follow-status {
    min-height: 14px;
    color: #888888;
    font-size: 11px;
    line-height: 1.3;
    text-align: right;
}

.creator-follow-status.is-error {
    color: #8b3434;
}

/* 4. 二级 Navigation Tabs (作品 & 收藏) */
.creator-profile-tabs {
    display: flex;
    align-items: center;
    gap: 32px;
    margin-top: 32px;
    margin-bottom: 32px;
    border-bottom: 1px solid rgba(17, 17, 17, 0.05);
}

.creator-profile-tab {
    position: relative;
    min-height: 44px;
    padding: 13px 0 11px;
    box-sizing: border-box;
    font-size: 16px;
    font-weight: 500;
    color: #707070;
    text-decoration: none;
    transition: color 0.2s ease;
}

.creator-profile-tab:hover {
    color: #111111;
}

.creator-profile-tab.is-active {
    color: #111111;
    font-weight: 700;
}

.creator-profile-tab.is-active::after {
    content: "";
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background: #111111;
}

.creator-gallery-live-status {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

/* 5. 作品排序组件 */
.creator-gallery-controls {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    min-height: 44px;
    margin-bottom: 20px;
}

.creator-sort-control {
    position: relative;
    display: inline-flex;
    justify-content: flex-end;
}

.creator-sort-trigger.cw-sort-switcher {
    width: auto;
    min-width: 112px;
    padding: 0 14px 0 40px;
    justify-content: flex-start;
    background: rgba(17, 17, 17, 0.045) !important;
    color: #333333;
}

.creator-sort-trigger .cw-sort-line {
    left: 12px;
}

.creator-sort-trigger-label {
    overflow: hidden;
    max-width: 13ch;
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.creator-sort-trigger[aria-expanded="true"] {
    background: rgba(17, 17, 17, 0.08) !important;
    color: #111111;
}

/* 7 列画廊基线：1840px 净宽时普通卡片约 245.7px。 */
.creator-gallery-page #cw-main-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 20px;
    width: 100%;
    margin: 0;
}

.creator-gallery-panel {
    position: relative;
    min-height: 120px;
}

.creator-gallery-page #cw-main-grid .work-card.layout-wide {
    grid-column: span 2;
}

/* 搜索结果页同源空状态，不带分类 Token。 */
.creator-empty-state.cw-search-empty {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 420px;
    padding: 60px 20px;
    box-sizing: border-box;
    text-align: center;
}

.creator-empty-state .cw-search-empty-illustration {
    width: 200px;
    height: 200px;
    margin-bottom: 24px;
    background: url("../img/empty-search.png") center / contain no-repeat;
}

.creator-empty-state .empty-title {
    margin: 0 0 10px;
    color: #1c1c1c;
    font-size: 22px;
    font-weight: 680;
    letter-spacing: -0.02em;
}

.creator-empty-state .empty-desc {
    max-width: 38ch;
    margin: 0;
    color: #666666;
    font-size: 14px;
    line-height: 1.65;
}

.creator-empty-state .empty-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    margin-top: 22px;
    padding: 0 18px;
    border-radius: 10px;
    background: #111111;
    color: #ffffff;
    font-size: 13px;
    font-weight: 650;
    text-decoration: none;
    transition: background-color 160ms ease, transform 140ms ease;
}

.creator-empty-state .empty-cta:focus-visible {
    outline: 2px solid rgba(75, 175, 159, 0.72);
    outline-offset: 3px;
}

.creator-empty-state .empty-cta:active {
    transform: scale(0.97);
}

@media (hover: hover) and (pointer: fine) {
    .creator-empty-state .empty-cta:hover {
        background: #2a2a2a;
    }
}

/* 6. 画廊 Modal 弹窗 */
.cw-author-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.25s;
}

.cw-author-modal-overlay.is-active {
    opacity: 1;
    visibility: visible;
}

.cw-author-modal-card {
    position: relative;
    width: min(90%, 520px);
    background: #ffffff;
    border-radius: 20px;
    padding: 32px;
    box-shadow: 0 20px 48px rgba(0, 0, 0, 0.12);
    transform: translateY(12px) scale(0.97);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.cw-author-modal-overlay.is-active .cw-author-modal-card {
    transform: translateY(0) scale(1);
}

.cw-modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: rgba(17, 17, 17, 0.04);
    font-size: 18px;
    color: #555;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.18s ease;
}

.cw-modal-close:hover {
    background: rgba(17, 17, 17, 0.08);
    color: #111;
}

.cw-modal-sub {
    font-family: ui-monospace, monospace;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: #aaaaaa;
}

.cw-modal-title {
    font-size: 20px;
    font-weight: 750;
    color: #111111;
    margin: 4px 0 20px;
}

.cw-modal-section {
    margin-bottom: 20px;
}

.cw-modal-section h4 {
    font-size: 12px;
    font-weight: 600;
    color: #999;
    margin: 0 0 8px;
}

.cw-modal-section p {
    font-size: 14px;
    color: #333;
    line-height: 1.6;
    margin: 0;
}

.cw-modal-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    padding: 16px 0;
    border-top: 1px solid rgba(17, 17, 17, 0.06);
    border-bottom: 1px solid rgba(17, 17, 17, 0.06);
    margin: 20px 0;
}

.cw-modal-grid dt {
    font-size: 11px;
    color: #aaaaaa;
    margin-bottom: 2px;
}

.cw-modal-grid dd {
    font-size: 13.5px;
    font-weight: 600;
    color: #111111;
    margin: 0;
}

.cw-modal-socials {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.cw-modal-social-btn {
    padding: 6px 14px;
    border-radius: 8px;
    background: rgba(17, 17, 17, 0.04);
    font-size: 12.5px;
    color: #333333;
    text-decoration: none;
    transition: background 0.18s ease;
}

.cw-modal-social-btn:hover {
    background: rgba(17, 17, 17, 0.08);
    color: #111111;
}

/* 画廊列数按跑道净宽降级，保持卡片密度而不改作品卡片本体。 */
@media (max-width: 1799px) {
    .creator-gallery-page #cw-main-grid {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }
}

@media (max-width: 1399px) {
    .creator-gallery-page #cw-main-grid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }
}

@media (max-width: 1099px) {
    .creator-gallery-page #cw-main-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

/* 响应式降级 */
@media (max-width: 900px) {
    .creator-profile-section {
        grid-template-columns: 1fr;
        align-items: flex-start;
        gap: 20px;
        min-height: 0;
    }

    .creator-side-matrix {
        align-items: flex-start;
        flex-direction: row;
        justify-content: space-between;
        width: 100%;
        margin-top: 12px;
    }

    .creator-gallery-page #cw-main-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .creator-gallery-controls {
        justify-content: flex-end;
        align-items: center;
    }
}

@media (max-width: 640px) {
    .creator-gallery-hero {
        height: clamp(220px, 58vw, 300px);
    }

    .creator-cover-controls {
        right: 16px;
        bottom: 14px;
        gap: 6px;
    }

    .creator-cover-action {
        min-height: 40px;
        padding-inline: 13px;
    }

    .creator-content-container {
        padding: 0 16px;
    }

    .creator-gallery-section {
        padding: 0 16px 64px;
    }

    .creator-profile-section {
        gap: 14px;
        padding-top: 24px;
        padding-bottom: 26px;
    }

    .creator-avatar-frame {
        width: 96px;
        height: 96px;
    }

    .creator-name {
        max-width: 100%;
        flex-wrap: wrap;
        gap: 7px;
        font-size: 22px;
    }

    .creator-bio {
        max-width: 100%;
    }

    .creator-side-matrix {
        flex-direction: column;
        align-items: flex-start;
        gap: 14px;
        margin-top: 6px;
    }

    .creator-stats-matrix {
        width: 100%;
        justify-content: flex-start;
        gap: 28px;
    }

    .stat-box {
        align-items: flex-start;
    }

    .creator-profile-action {
        width: 100%;
        align-items: flex-start;
    }

    .cw-author-follow-control__button,
    .creator-edit-profile-link {
        min-width: 112px;
        min-height: 44px;
    }

    .creator-profile-tabs {
        gap: 28px;
        margin-top: 24px;
        margin-bottom: 24px;
    }

    .creator-gallery-controls {
        margin-bottom: 16px;
    }

    .creator-gallery-page #cw-main-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .creator-gallery-page #cw-main-grid .work-card.layout-wide {
        grid-column: span 1;
    }

    .creator-empty-state.cw-search-empty {
        min-height: 340px;
        padding: 40px 12px;
    }

    .creator-empty-state .cw-search-empty-illustration {
        width: 160px;
        height: 160px;
        margin-bottom: 18px;
    }

    .creator-empty-state .empty-title {
        font-size: 20px;
    }

}

@media (prefers-reduced-motion: reduce) {
    .creator-id-copy,
    .creator-relation-link,
    .creator-sort-trigger,
    .creator-empty-state .empty-cta {
        transition-duration: 0.01ms !important;
    }

    .creator-empty-state .empty-cta:active {
        transform: none;
    }

}
