/* ===== Props Library Styles ===== */

/* 变量定义 */
:root {
    --props-accent: #10b981;
    --props-accent-light: rgba(16, 185, 129, 0.15);
}

/* 主布局 */
.props-main {
    display: flex;
    flex: 1;
    overflow: hidden;
    background: var(--bg-darkest, var(--bg-primary));
}

/* 左侧分类导航 */
.props-sidebar {
    width: 280px;
    flex-shrink: 0;
    background: var(--bg-dark, var(--bg-secondary));
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 16px;
    overflow-y: auto;
}

.props-sidebar .sidebar-section {
    margin-bottom: 16px;
}

.props-sidebar .sidebar-title,
.sidebar-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary, white);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.props-sidebar .sidebar-filters,
.sidebar-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.props-sidebar .sidebar-filter-btn,
.sidebar-filter-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: transparent;
    border: none;
    color: var(--text-secondary, rgba(255, 255, 255, 0.7));
    border-radius: 6px;
    text-align: left;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.15s ease;
}

.props-sidebar .sidebar-filter-btn:hover,
.sidebar-filter-btn:hover {
    background: var(--bg-hover, rgba(255, 255, 255, 0.05));
    color: var(--text-primary, white);
}

.props-sidebar .sidebar-filter-btn.active,
.sidebar-filter-btn.active {
    background: var(--props-accent-light);
    color: var(--props-accent);
}

/* 右侧内容区 */
.props-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
}

.props-content__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    background: var(--bg-darkest, var(--bg-primary));
    border-bottom: 1px solid var(--border-color);
}

.props-content__header h2 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary, white);
}

.props-content__header h2 svg {
    color: var(--props-accent);
}

.props-content__header .search-box {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--bg-input, var(--bg-secondary));
    border: 1px solid var(--border-color);
    border-radius: 6px;
    width: 240px;
}

.props-content__header .search-box svg {
    color: var(--text-muted, rgba(255, 255, 255, 0.4));
}

.props-content__header .search-box input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary, white);
    font-size: 13px;
    outline: none;
}

.props-content__header .search-box input::placeholder {
    color: var(--text-muted, rgba(255, 255, 255, 0.4));
}

.props-content__actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Tabs */
.props-tabs {
    display: flex;
    gap: 0;
    background: var(--bg-dark, var(--bg-secondary));
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
}

.props-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-secondary, rgba(255, 255, 255, 0.6));
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.props-tab:hover {
    color: var(--text-primary, white);
}

.props-tab.active {
    color: var(--props-accent);
    border-bottom-color: var(--props-accent);
}

.props-tab__count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    background: var(--bg-input, rgba(255, 255, 255, 0.1));
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted, rgba(255, 255, 255, 0.5));
}

.props-tab.active .props-tab__count {
    background: var(--props-accent);
    color: white;
}

/* 内容滚动区 */
.props-content__main,
.props-content-wrapper {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px 100px; /* 增加底部padding，避免被固定分页组件遮挡 */
    display: flex;
    flex-direction: column;
    min-height: 0;
}

/* 道具网格 */
.props-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

/* 道具卡片 */
.props-card {
    background: var(--bg-secondary, #1a1c23);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}

.props-card:not(.props-card--create):hover {
    border-color: var(--props-accent);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.props-card--create {
    background: transparent;
    border: 2px dashed var(--border-color) !important;
    border-radius: 12px;
    min-height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
}

.props-card--create:hover {
    border: 2px dashed var(--props-accent) !important;
    background: var(--props-accent-light);
    transform: none;
    box-shadow: none;
}

.props-card__create-content {
    text-align: center;
}

.props-card__create-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--props-accent) 0%, #059669 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
    color: white;
    transition: transform 0.3s;
}

.props-card--create:hover .props-card__create-icon {
    transform: scale(1.1);
}

.props-card__create-text {
    color: var(--props-accent);
    font-size: 14px;
    font-weight: 600;
}

/* 道具图片 */
.props-card__image {
    width: 100%;
    height: 160px;
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    /* 透明背景格子 */
    background-image: 
        linear-gradient(45deg, #2a2a2a 25%, transparent 25%),
        linear-gradient(-45deg, #2a2a2a 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #2a2a2a 75%),
        linear-gradient(-45deg, transparent 75%, #2a2a2a 75%);
    background-size: 16px 16px;
    background-position: 0 0, 0 8px, 8px -8px, -8px 0px;
}

.props-card__image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.props-card__image-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
}

.props-card__image-placeholder span {
    font-size: 11px;
}

.props-card__badges {
    position: absolute;
    top: 8px;
    left: 8px;
    display: flex;
    gap: 6px;
}

.props-card__overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    opacity: 0;
    transition: opacity 0.2s;
}

.props-card:hover .props-card__overlay {
    opacity: 1;
}

.props-card__overlay-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.9);
    border: none;
    border-radius: 8px;
    color: #333;
    cursor: pointer;
    transition: all 0.2s;
}

.props-card__overlay-btn:hover {
    background: white;
    transform: scale(1.1);
}

.props-card__overlay-btn--danger:hover {
    background: var(--danger);
    color: white;
}

/* 道具信息 */
.props-card__info {
    padding: 12px;
}

.props-card__name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.props-card__meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.props-card__tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    background: var(--accent-bg);
    color: var(--accent);
    border-radius: 4px;
    font-size: 11px;
}

/* 徽章 */
.props-card .badge {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 4px;
}

.props-card .badge--official {
    background: var(--props-accent);
    color: white;
}

/* 加载状态 */
.props-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.props-loading p {
    margin-top: 12px;
}

/* 空状态 */
.props-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    color: var(--text-muted);
}

.props-empty h3 {
    margin-top: 16px;
    margin-bottom: 8px;
    color: var(--text-secondary);
}

/* 加载更多 */
.props-load-more {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    color: var(--text-muted);
    font-size: 13px;
}

/* ===== 创建弹窗 ===== */
.props-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.props-modal {
    width: 560px;
    max-width: 90vw;
    max-height: 90vh;
    background: var(--bg-secondary, #1a1c23);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.props-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
}

.props-modal__header h2 {
    font-size: 18px;
    font-weight: 600;
}

.props-modal__close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
}

.props-modal__close:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.props-modal__body {
    padding: 24px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.props-modal__footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
}

/* 表单 */
.props-form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.props-form-group label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}

.props-form-group .required {
    color: var(--danger);
}

.props-form-group input,
.props-form-group textarea,
.props-form-group select {
    padding: 10px 14px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
    transition: border-color 0.2s;
}

.props-form-group input:focus,
.props-form-group textarea:focus,
.props-form-group select:focus {
    outline: none;
    border-color: var(--accent);
}

.props-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* 按钮 */
.props-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.props-btn--primary {
    background: var(--accent);
    color: white;
}

.props-btn--primary:hover:not(:disabled) {
    background: var(--accent-hover);
}

.props-btn--primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.props-btn--secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.props-btn--secondary:hover {
    background: var(--bg-hover);
}

/* AI生成状态 */
.props-ai-status {
    padding: 16px;
    background: var(--bg-primary);
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.props-ai-status__progress {
    display: flex;
    align-items: center;
    gap: 12px;
}

.props-ai-status__icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-bg);
    border-radius: 8px;
    color: var(--accent);
}

.props-ai-status__icon.success {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
}

.props-ai-status__icon.error {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.props-ai-status__text {
    flex: 1;
}

.props-ai-status__message {
    font-size: 14px;
    color: var(--text-primary);
}

.props-ai-progress-bar {
    height: 4px;
    background: var(--bg-tertiary);
    border-radius: 2px;
    margin-top: 12px;
    overflow: hidden;
}

.props-ai-progress-bar__fill {
    height: 100%;
    background: var(--accent);
    border-radius: 2px;
    transition: width 0.3s;
}

/* 生成结果预览 */
.props-ai-result {
    padding: 16px;
    background: var(--bg-primary);
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.props-ai-result__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.props-ai-result__title {
    font-weight: 600;
    color: #22c55e;
}

.props-ai-result__preview {
    width: 100%;
    height: 200px;
    background: var(--bg-tertiary);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background-image: 
        linear-gradient(45deg, #2a2a2a 25%, transparent 25%),
        linear-gradient(-45deg, #2a2a2a 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #2a2a2a 75%),
        linear-gradient(-45deg, transparent 75%, #2a2a2a 75%);
    background-size: 16px 16px;
    background-position: 0 0, 0 8px, 8px -8px, -8px 0px;
}

.props-ai-result__preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* Spinner */
.spin {
    animation: spin 1s linear infinite;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-top-color: var(--props-accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    display: inline-block;
}

.spinner--small {
    width: 16px;
    height: 16px;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ===== 响应式 ===== */
@media (max-width: 1200px) {
    .props-sidebar {
        width: 240px;
    }
}

@media (max-width: 1024px) {
    .props-sidebar {
        width: 200px;
    }
    
    .props-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    }
}

@media (max-width: 768px) {
    .props-main {
        flex-direction: column;
    }
    
    .props-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        padding: 16px;
    }
    
    .props-content__main,
    .props-content-wrapper {
        padding: 16px;
    }
    
    .props-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    }
    
    .props-form-row {
        grid-template-columns: 1fr;
    }
    
    .props-modal {
        width: 95%;
        max-width: none;
    }
}

@media (max-width: 600px) {
    .props-sidebar {
        display: none;
    }
}

/* ===== 图片放大预览 ===== */
.image-preview-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

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

.image-preview-container {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: scaleIn 0.25s ease;
}

@keyframes scaleIn {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.image-preview-close {
    position: absolute;
    top: -50px;
    right: 0;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 10px;
    border-radius: 50%;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-preview-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

.image-preview-title {
    color: #fff;
    margin-bottom: 16px;
    font-size: 18px;
    font-weight: 500;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.image-preview-img {
    max-width: 90vw;
    max-height: 75vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    background: repeating-conic-gradient(#333 0% 25%, #444 0% 50%) 50% / 20px 20px;
}

.image-preview-actions {
    margin-top: 20px;
    display: flex;
    gap: 12px;
}

.image-preview-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s;
}

.image-preview-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
}

/* 响应式 */
@media (max-width: 768px) {
    .image-preview-title {
        font-size: 14px;
    }
    
    .image-preview-close {
        top: -45px;
        padding: 8px;
    }
    
    .image-preview-img {
        max-height: 70vh;
    }
}

