/* ===== 创作工具页面 - Premium Design ===== */

/* 页面头部 */
.creator-header {
    margin-bottom: 40px;
    padding-top: 8px;
    position: relative;
}

.creator-header::after {
    content: '';
    position: absolute;
    bottom: -20px;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(to right, transparent, var(--border-light), transparent);
    opacity: 0.5;
}

.creator-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 14px;
    background: rgba(59, 130, 246, 0.08);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 20px;
    font-size: 12px;
    color: var(--accent);
    font-weight: 500;
    margin-bottom: 16px;
    letter-spacing: 0.3px;
    animation: fadeSlideIn 0.5s ease-out;
}

.creator-badge svg {
    opacity: 0.7;
}

.creator-title {
    font-size: 34px;
    font-weight: 700;
    letter-spacing: -1px;
    margin-bottom: 10px;
    color: var(--text-primary);
    line-height: 1.2;
    animation: fadeSlideIn 0.5s ease-out 0.05s both;
}

.creator-subtitle {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.7;
    max-width: 520px;
    animation: fadeSlideIn 0.5s ease-out 0.1s both;
}

@keyframes fadeSlideIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 区块通用 */
.creator-section {
    margin-bottom: 40px;
    animation: sectionIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.creator-section:nth-child(1) { animation-delay: 0.1s; }
.creator-section:nth-child(2) { animation-delay: 0.2s; }
.creator-section:nth-child(3) { animation-delay: 0.3s; }

/* ===== 行业标签 + 提示词左右布局 ===== */
.creator-main-layout {
    display: flex;
    gap: 24px;
    align-items: stretch;
}

.creator-main-left {
    flex: 0 0 33.333%;
    max-width: 33.333%;
    display: flex;
    flex-direction: column;
}

.creator-main-left .creator-section-title {
    height: 38.5px;
    display: flex;
    align-items: center;
    margin-bottom: 16px;
}

.creator-main-right {
    flex: 0 0 calc(66.667% - 24px);
    max-width: calc(66.667% - 24px);
    display: flex;
    flex-direction: column;
}

@keyframes sectionIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.creator-section-title {
    font-size: 17px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
    letter-spacing: -0.3px;
}

/* ===== 分类标签区 ===== */
.creator-tags-groups {
    display: flex;
    flex-direction: column;
    flex: 1;
}

/* 行业标签容器（左侧面板，纵向排列标签） */
.creator-subtags-combined {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 18px 12px;
    background: var(--bg-card);
    border-radius: 14px;
    border: 1px solid var(--border);
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
    height: 266px;
}

.creator-subtags-combined::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.02) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.creator-subtags-combined:hover {
    border-color: var(--border-light);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
}

.creator-subtags-combined:hover::before {
    opacity: 1;
}

/* 气泡标签容器 - 随机散布 */
.creator-tag-group-inline {
    position: relative;
    width: 100%;
    height: 100%;
}

/* 气泡标签 - 圆形大小不一，绝对定位 */
.subtag-chip.bubble {
    width: var(--bubble-size, 72px);
    height: var(--bubble-size, 72px);
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    color: var(--text-secondary);
    font-size: var(--bubble-font, 12px);
    cursor: pointer;
    font-family: inherit;
    white-space: nowrap;
    position: absolute;
    left: var(--bubble-x, 0);
    top: var(--bubble-y, 0);
    z-index: 1;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.06);
    transition: background 0.4s, border-color 0.4s, color 0.4s, box-shadow 0.4s;
    will-change: transform;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    line-height: 1.2;
    animation-name: var(--float-name, bubbleFloat1);
    animation-duration: var(--float-dur, 4s);
    animation-delay: var(--float-delay, 0s);
    animation-iteration-count: infinite;
    animation-timing-function: ease-in-out;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

.subtag-chip.bubble:focus {
    outline: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.subtag-chip.bubble:focus-visible {
    outline: 2px solid rgba(59, 130, 246, 0.5);
    outline-offset: 2px;
}

.subtag-chip.bubble::after {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: inherit;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.4s;
    pointer-events: none;
}

.subtag-chip.bubble:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
}

.subtag-chip.bubble.selected {
    background: linear-gradient(135deg, #f97316, #ea580c);
    border-color: rgba(249, 115, 22, 0.8);
    color: #fff;
    box-shadow: 0 2px 12px rgba(249, 115, 22, 0.3);
    outline: none;
}

.subtag-chip.bubble.selected:focus {
    outline: none;
    box-shadow: 0 2px 12px rgba(249, 115, 22, 0.3);
}

.subtag-chip.bubble.selected::after {
    opacity: 1;
    animation: bubbleGlow 2s ease-in-out infinite;
}

/* 气泡浮动动画（小幅度，不超出容器） */
@keyframes bubbleFloat1 {
    0%, 100% { transform: translate(0, 0); }
    20% { transform: translate(3px, -4px); }
    40% { transform: translate(-2px, 3px); }
    60% { transform: translate(4px, -2px); }
    80% { transform: translate(-1px, 4px); }
}

@keyframes bubbleFloat2 {
    0%, 100% { transform: translate(0, 0); }
    25% { transform: translate(-3px, 4px); }
    50% { transform: translate(2px, -5px); }
    75% { transform: translate(-2px, 2px); }
}

@keyframes bubbleFloat3 {
    0%, 100% { transform: translate(0, 0); }
    30% { transform: translate(2px, 3px); }
    60% { transform: translate(-4px, -2px); }
    90% { transform: translate(2px, 4px); }
}

@keyframes bubbleFloat4 {
    0%, 100% { transform: translate(0, 0); }
    20% { transform: translate(-3px, -3px); }
    40% { transform: translate(4px, 2px); }
    60% { transform: translate(-2px, 4px); }
    80% { transform: translate(2px, -3px); }
}

@keyframes bubbleFloat5 {
    0%, 100% { transform: translate(0, 0); }
    33% { transform: translate(3px, -3px); }
    66% { transform: translate(-2px, 4px); }
}

@keyframes bubbleFloat6 {
    0%, 100% { transform: translate(0, 0); }
    25% { transform: translate(-4px, 2px); }
    50% { transform: translate(2px, -3px); }
    75% { transform: translate(3px, 3px); }
}

/* 选中气泡发光动画 */
@keyframes bubbleGlow {
    0%, 100% { box-shadow: 0 0 12px rgba(249, 115, 22, 0.4), 0 0 24px rgba(249, 115, 22, 0.15); }
    50% { box-shadow: 0 0 20px rgba(249, 115, 22, 0.6), 0 0 40px rgba(249, 115, 22, 0.3); }
}

/* 减弱动画偏好 */
@media (prefers-reduced-motion: reduce) {
    .subtag-chip.bubble {
        animation: none;
    }
}

/* ===== 提示词输入区 ===== */
.creator-prompt-section {
    position: relative;
}

.creator-prompt-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.creator-prompt-header .creator-section-title {
    margin-bottom: 0;
}

.creator-prompt-actions {
    display: flex;
    gap: 8px;
}

/* 按钮 */
.creator-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 20px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    border: none;
    font-family: inherit;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.creator-btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at var(--ripple-x, 50%) var(--ripple-y, 50%), rgba(255,255,255,0.15) 0%, transparent 60%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.creator-btn:active::after {
    opacity: 1;
}

.creator-btn-sm {
    padding: 5px 12px;
    font-size: 12px;
    border-radius: 8px;
}

.creator-btn-primary {
    background: linear-gradient(135deg, var(--accent) 0%, #2563eb 100%);
    color: #fff;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.2);
}

.creator-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.35);
}

.creator-btn-primary:active {
    transform: translateY(0) scale(0.97);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.2);
}

.creator-btn-match {
    background: rgba(59, 130, 246, 0.1);
    color: var(--accent);
    border: 1px solid rgba(59, 130, 246, 0.25);
}

.creator-btn-match:hover {
    background: rgba(59, 130, 246, 0.18);
    border-color: rgba(59, 130, 246, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.15);
}

.creator-btn-match:active {
    transform: translateY(0) scale(0.97);
}

.creator-btn-secondary {
    background: var(--bg-card);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.creator-btn-secondary:hover {
    border-color: var(--border-light);
    color: var(--text-primary);
    background: var(--bg-card-hover);
    transform: translateY(-1px);
}

.creator-btn-secondary:active {
    transform: translateY(0) scale(0.97);
}

.creator-btn-save {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #fff;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.2);
}

.creator-btn-save:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.35);
}

.creator-btn-save:active {
    transform: translateY(0) scale(0.97);
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.2);
}

/* 输入框 */
.creator-prompt-wrapper {
    position: relative;
}

.creator-prompt-input {
    width: 100%;
    min-height: 100px;
    padding: 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    color: var(--text-primary);
    font-size: 14px;
    line-height: 2;
    resize: vertical;
    font-family: inherit;
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
}

.creator-prompt-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1), 0 4px 20px rgba(0, 0, 0, 0.15);
    background: rgba(21, 21, 21, 1);
}

.creator-prompt-input::placeholder {
    color: var(--text-muted);
}

/* 结构提示 */
.creator-prompt-structure {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

.prompt-structure-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 6px;
    background: rgba(59, 130, 246, 0.08);
    color: var(--accent);
    font-size: 12px;
    font-weight: 500;
}

.prompt-structure-tag .structure-label {
    opacity: 0.7;
    font-weight: 400;
}

/* ===== 匹配推荐区 ===== */
.creator-match-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
}

.creator-match-header .creator-section-title {
    margin-bottom: 0;
}

.creator-match-count {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
}

/* 匹配图片网格 */
.creator-match-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 18px;
}

.creator-match-empty {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    color: var(--text-muted);
    text-align: center;
}

.creator-match-empty svg {
    opacity: 0.2;
    margin-bottom: 16px;
}

.creator-match-empty p {
    font-size: 14px;
}

/* 匹配卡片 */
.match-card {
    position: relative;
    border-radius: 14px;
    overflow: hidden;
    background: var(--bg-card);
    border: 1px solid var(--border);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: pointer;
    opacity: 0;
    transform: translateY(16px) scale(0.96);
    animation: cardReveal 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes cardReveal {
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.match-card:hover {
    transform: translateY(-6px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.2);
}

.match-card:active {
    transform: translateY(-2px) scale(1.0);
    transition-duration: 0.1s;
}

.match-card-img-wrapper {
    position: relative;
    width: 100%;
    padding-top: 100%;
    overflow: hidden;
}

.match-card-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.match-card:hover .match-card-img {
    transform: scale(1.08);
}

/* 匹配度标签 */
.match-card-score {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 4px 10px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: rgba(255, 255, 255, 0.9);
    font-size: 11px;
    font-weight: 600;
    z-index: 2;
    letter-spacing: 0.3px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.3s ease;
}

.match-card:hover .match-card-score {
    background: rgba(0, 0, 0, 0.7);
}

.match-card-score.high {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.85) 0%, rgba(37, 99, 235, 0.9) 100%);
    border-color: rgba(255, 255, 255, 0.15);
}

/* 收藏按钮 - 右上角 */
.match-card-fav {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 3;
    opacity: 0;
    transform: scale(0.8);
}

.match-card:hover .match-card-fav {
    opacity: 1;
    transform: scale(1);
}

.match-card-fav:hover {
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    transform: scale(1.12) !important;
}

.match-card-fav.favorited {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.2);
    opacity: 1;
    transform: scale(1);
}

.match-card-fav.favorited:hover {
    background: rgba(239, 68, 68, 0.25);
    transform: scale(1.12) !important;
}

/* 标签 - 左下角 */
.match-card-tags-overlay {
    position: absolute;
    bottom: 52px;
    left: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    z-index: 2;
    max-width: calc(100% - 16px);
    opacity: 0;
    transform: translateY(6px);
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.match-card:hover .match-card-tags-overlay {
    opacity: 1;
    transform: translateY(0);
}

.match-card-tag-overlay {
    padding: 2px 10px;
    border-radius: 20px;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: rgba(255, 255, 255, 0.85);
    font-size: 10px;
    white-space: nowrap;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.match-card-tag-overlay.matched {
    background: rgba(59, 130, 246, 0.6);
    border-color: rgba(59, 130, 246, 0.3);
    color: #fff;
}

/* 一键填写 - 底部渐变区域 */
.match-card-bottom-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 10px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.75) 0%, rgba(0, 0, 0, 0.3) 60%, transparent 100%);
    display: flex;
    justify-content: flex-start;
    z-index: 2;
    opacity: 0;
    transform: translateY(4px);
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.match-card:hover .match-card-bottom-bar {
    opacity: 1;
    transform: translateY(0);
}

.match-card-fill-btn {
    padding: 6px 20px;
    border-radius: 8px;
    border: none;
    background: var(--accent);
    color: #fff;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    font-family: inherit;
    letter-spacing: 0.3px;
}

.match-card-fill-btn:hover {
    background: #2563eb;
    transform: scale(1.04);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.match-card-fill-btn:active {
    transform: scale(0.98);
}

/* 加载更多 */
.creator-match-more {
    text-align: center;
    margin-top: 28px;
}

/* ===== 弹窗 ===== */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.88);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal-overlay.active {
    display: flex;
    animation: overlayIn 0.3s ease-out;
}

@keyframes overlayIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.creator-modal {
    max-width: 90vw;
    max-height: 90vh;
    width: auto;
    animation: modalIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.92) translateY(10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.creator-modal .modal-body {
    display: flex;
    align-items: center;
    justify-content: center;
}

.creator-modal .modal-img {
    max-width: 90vw;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5);
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: rgba(255, 255, 255, 0.8);
    font-size: 22px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 10;
    line-height: 1;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    transform: rotate(90deg) scale(1.05);
}

/* ===== Toast 优化 ===== */
.toast {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(-40px);
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: var(--bg-elevated);
    border: 1px solid var(--success);
    border-radius: 12px;
    color: var(--success);
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(16, 185, 129, 0.1);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 2000;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* ===== 响应式 ===== */
@media (max-width: 1024px) {
    .creator-match-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 14px;
    }
}

@media (max-width: 768px) {
    .creator-main-layout {
        flex-direction: column;
    }
    .creator-main-left,
    .creator-main-right {
        flex: none;
        max-width: 100%;
    }
    .creator-subtags-combined {
        flex: none;
    }
    .creator-tag-group-inline {
        align-items: center;
    }

    .creator-header {
        padding-top: 0;
    }

    .creator-title {
        font-size: 26px;
    }

    .creator-subtitle {
        font-size: 14px;
    }

    .creator-subtags {
        padding: 12px;
        gap: 6px;
    }

    .subtag-chip.bubble {
        --bubble-size: var(--bubble-size-m, 58px) !important;
        font-size: 11px;
    }

    .creator-prompt-input {
        min-height: 100px;
        padding: 16px;
    }

    .creator-prompt-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .creator-prompt-actions {
        flex-wrap: wrap;
    }

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

    .match-card-bottom-bar {
        opacity: 1;
        transform: translateY(0);
    }

    .match-card-fav {
        opacity: 1;
        transform: scale(1);
    }

    .match-card-tags-overlay {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 480px) {
    .creator-match-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .creator-btn {
        padding: 7px 14px;
        font-size: 12px;
    }

    .creator-badge {
        font-size: 11px;
        padding: 4px 10px;
    }
}
