/* FreeTu SidePanel Styles - 侧边栏样式 */

:root {
    --primary: #3b82f6;
    --primary-dark: #2563eb;
    --primary-light: #60a5fa;
    --accent: #fbbf24;
    --accent-dark: #f59e0b;
    --bg-primary: #0a0a0a;
    --bg-secondary: #141414;
    --bg-tertiary: #1a1a1a;
    --bg-hover: #252525;
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --text-tertiary: #666666;
    --border-color: #2a2a2a;
    --border-light: #333333;
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --header-height: 52px;
    --search-height: 56px;
    --tags-height: 44px;
    --footer-height: 40px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    width: 100%;
    height: 100vh;
    overflow: hidden;
}

/* 页面容器 */
.sp-page {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

/* ===== 头部 ===== */
.sp-header {
    height: var(--header-height);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px;
    flex-shrink: 0;
}

.sp-header-btn {
    padding: 6px 12px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 6px;
}

.sp-header-btn:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.sp-header-user {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 10px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 6px;
}

.sp-header-user:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.sp-header-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
}

/* 头像按钮（登录后） */
.sp-header-avatar-btn {
    width: 32px;
    height: 32px;
    padding: 0;
    background: transparent;
    border: 2px solid transparent;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sp-header-avatar-btn:hover {
    border-color: var(--primary);
    transform: scale(1.05);
}

.sp-header-avatar-btn:active {
    transform: scale(0.95);
}

.sp-header-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

/* 用户下拉菜单 */
.sp-user-dropdown {
    position: absolute;
    top: calc(var(--header-height) - 4px);
    left: 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 6px;
    min-width: 140px;
    box-shadow: var(--shadow-md);
    z-index: 1000;
    animation: dropdownFadeIn 0.15s ease;
}

@keyframes dropdownFadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.sp-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 12px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s ease;
    text-align: left;
}

.sp-dropdown-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.sp-dropdown-item svg {
    flex-shrink: 0;
}

.sp-logo {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sp-logo-img {
    width: 28px;
    height: 28px;
    border-radius: 6px;
}

.sp-logo-text {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
}

.sp-header-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.sp-close-btn,
.sp-back-btn {
    height: 32px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 0 8px;
    transition: all 0.2s ease;
}

.sp-close-btn:hover,
.sp-back-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.sp-back-btn span {
    font-size: 13px;
}

/* ===== 更新横幅 ===== */
.sp-update-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 8px 6px 12px;
    background: #fbbf24;
    flex-shrink: 0;
}

.sp-update-banner-link {
    display: flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    flex: 1;
    min-width: 0;
}

.sp-update-banner-link:hover .sp-update-banner-text {
    text-decoration: underline;
}

.sp-update-banner-icon {
    font-size: 16px;
    flex-shrink: 0;
}

.sp-update-banner-text {
    font-size: 12px;
    font-weight: 500;
    color: #4a3500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sp-update-banner-text strong {
    color: #000;
}

.sp-update-banner-close {
    width: 22px;
    height: 22px;
    border: none;
    background: rgba(0, 0, 0, 0.08);
    color: #4a3500;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    line-height: 1;
    flex-shrink: 0;
    transition: background 0.15s ease;
}

.sp-update-banner-close:hover {
    background: rgba(0, 0, 0, 0.18);
}

/* ===== 搜索区域 ===== */
.sp-search-section {
    padding: 12px;
    background: var(--bg-tertiary);
    flex-shrink: 0;
}

.sp-search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.sp-search-icon {
    position: absolute;
    left: 12px;
    color: var(--text-tertiary);
    pointer-events: none;
}

.sp-search-input {
    width: 100%;
    height: 40px;
    padding: 0 32px 0 32px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
    transition: all 0.2s ease;
}

.sp-search-input:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--bg-hover);
}

.sp-search-input::placeholder {
    color: var(--text-tertiary);
}

.sp-clear-btn {
    position: absolute;
    right: 8px;
    width: 20px;
    height: 20px;
    border: none;
    background: transparent;
    color: var(--text-tertiary);
    border-radius: 50%;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.sp-clear-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.sp-clear-btn.visible {
    display: flex;
}

/* ===== 灵感图库标签 ===== */
.sp-tags {
    display: flex;
    gap: 6px;
    margin-top: 8px;
    padding: 4px 0;
    flex-wrap: wrap;
    max-height: 60px;
    overflow: hidden;
}

.sp-tag-text {
    flex-shrink: 0;
    padding: 4px 10px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    color: var(--text-secondary);
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    line-height: 1.4;
}

.sp-tag-text:hover {
    color: var(--primary);
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.06);
}

.sp-tag-text.active {
    color: #fff;
    background: var(--primary);
    border-color: var(--primary);
    font-weight: 500;
}

/* ===== 内容区域 ===== */
.sp-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 12px;
    scrollbar-width: thin;
    scrollbar-color: var(--border-light) var(--bg-tertiary);
    background: var(--bg-tertiary);
}

.sp-content::-webkit-scrollbar {
    width: 6px;
}

.sp-content::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
}

.sp-content::-webkit-scrollbar-thumb {
    background: var(--border-light);
    border-radius: 3px;
}

/* ===== 图片网格 - 单列显示 ===== */
.sp-gallery {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sp-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.25s ease;
    position: relative;
    display: flex;
    flex-direction: column;
}

.sp-card:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.12);
}

.sp-card-image-wrapper {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    background: var(--bg-tertiary);
}

.sp-card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
    cursor: pointer;
}

.sp-card:hover .sp-card-image {
    transform: scale(1.05);
}

.sp-card-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    opacity: 0;
    transition: opacity 0.2s ease;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 10px;
    pointer-events: none; /* 让点击穿透到下层 */
}

.sp-card:hover .sp-card-overlay {
    opacity: 1;
    pointer-events: auto; /* 悬停时恢复按钮点击 */
}

.sp-card-btn {
    pointer-events: auto; /* 按钮始终可点击 */
}

.sp-card-btn {
    width: 90%;
    height: 32px;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.sp-card-btn-primary {
    background: var(--primary);
    color: #fff;
}

.sp-card-btn-primary:hover {
    background: var(--primary-dark);
}

.sp-card-btn-secondary {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    backdrop-filter: blur(4px);
}

.sp-card-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* ===== 编辑页面 ===== */
.sp-edit-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* ===== Prompt Studio 分类编辑器 ===== */
.sp-prompt-studio {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* 分类卡片 */
.sp-prompt-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    overflow: hidden;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.sp-prompt-section:hover {
    border-color: var(--border-light);
}

.sp-prompt-section.disabled .sp-prompt-section-badge,
.sp-prompt-section.disabled .sp-prompt-section-badge svg {
    color: var(--text-tertiary);
}

.sp-prompt-section.disabled .sp-prompt-section-textarea {
    color: var(--text-tertiary);
}

/* 分类头部 */
.sp-prompt-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    transition: background 0.2s ease;
}

.sp-prompt-section-header:hover {
    background: var(--bg-hover);
}

/* 分类标签 */
.sp-prompt-section-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--section-color, var(--text-primary));
}

.sp-prompt-section-badge svg {
    color: var(--section-color, var(--text-primary));
    flex-shrink: 0;
}

/* 分类徽章圆点 */
.sp-prompt-section-badge::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--section-color, var(--text-primary));
    flex-shrink: 0;
}

/* 分类头部右侧（字数 + 开关） */
.sp-prompt-section-header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* 分类内容 */
.sp-prompt-section-body {
    padding: 0 12px 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* 分类输入框 */
.sp-prompt-section-textarea {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 13px;
    line-height: 1.5;
    resize: vertical;
    min-height: 48px;
    max-height: 120px;
    font-family: inherit;
    transition: border-color 0.2s ease;
}

.sp-prompt-section-textarea:focus {
    outline: none;
    border-color: var(--section-color, var(--primary));
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

.sp-prompt-section-textarea::placeholder {
    color: var(--text-tertiary);
}

.sp-prompt-section-count {
    font-size: 11px;
    color: var(--text-tertiary);
}

/* Toggle Switch */
.sp-prompt-section-switch {
    position: relative;
    display: inline-block;
    width: 32px;
    height: 18px;
    cursor: pointer;
}

.sp-prompt-section-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.sp-prompt-section-slider {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--border-light);
    border-radius: 18px;
    transition: background 0.2s ease;
}

.sp-prompt-section-slider::before {
    content: '';
    position: absolute;
    height: 14px;
    width: 14px;
    left: 2px;
    bottom: 2px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s ease;
}

.sp-prompt-section-switch input:checked + .sp-prompt-section-slider {
    background: var(--primary);
}

.sp-prompt-section-switch input:checked + .sp-prompt-section-slider::before {
    transform: translateX(14px);
}

/* ===== 模型和标签 ===== */
.sp-edit-meta {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
}

.sp-edit-meta.hidden { display: none !important; }

.sp-edit-meta-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sp-edit-meta-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    white-space: nowrap;
    min-width: 30px;
}

.sp-edit-meta-select {
    flex: 1;
    height: 34px;
    padding: 0 10px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' stroke='%23666' stroke-width='1.5'%3E%3Cpolyline points='1 1 5 5 9 1'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
}

.sp-edit-meta-select:focus {
    outline: none;
    border-color: var(--primary);
}



/* ===== 合并预览 ===== */
.sp-prompt-preview {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    overflow: hidden;
}

.sp-prompt-preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-color);
}

.sp-prompt-preview-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sp-prompt-preview-title svg {
    color: var(--primary);
}

.sp-prompt-preview-count {
    font-size: 11px;
    color: var(--text-tertiary);
}

.sp-prompt-preview-textarea {
    width: 100%;
    padding: 12px;
    background: var(--bg-primary);
    border: none;
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.6;
    resize: none;
    min-height: 80px;
    font-family: inherit;
}

.sp-prompt-preview-textarea:focus {
    outline: none;
}

.sp-edit-image-wrapper {
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    flex-shrink: 0;
    max-height: 50vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sp-edit-image {
    width: 100%;
    height: auto;
    max-height: 50vh;
    object-fit: contain;
    display: block;
}

.sp-edit-input-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sp-edit-label {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

.sp-edit-textarea {
    width: 100%;
    padding: 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.6;
    resize: vertical;
    min-height: 120px;
    font-family: inherit;
}

.sp-edit-textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.sp-edit-textarea::placeholder {
    color: var(--text-tertiary);
}

.sp-edit-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: auto;
    padding-top: 8px;
}

.sp-edit-btn {
    width: 100%;
    height: 44px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.sp-edit-btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
}

.sp-edit-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.sp-edit-btn-secondary {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.sp-edit-btn-secondary:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.sp-edit-btn-save {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: #fff;
}

.sp-edit-btn-save:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
}

/* ===== 模型切换选项 ===== */
.sp-edit-model-option {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.sp-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-primary);
}

.sp-checkbox input {
    display: none;
}

.sp-checkmark {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border-light);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.sp-checkbox input:checked + .sp-checkmark {
    background: var(--primary);
    border-color: var(--primary);
}

.sp-checkmark::after {
    content: '';
    width: 5px;
    height: 9px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg) translate(-1px, -1px);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.sp-checkbox input:checked + .sp-checkmark::after {
    opacity: 1;
}

.sp-checkbox-text {
    font-weight: 500;
}

.sp-model-hint {
    font-size: 11px;
    color: var(--text-tertiary);
    padding-left: 28px;
}

/* ===== 空状态/加载/无结果 ===== */
.sp-empty,
.sp-loading,
.sp-no-results {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    text-align: center;
}

.sp-empty-icon,
.sp-no-results-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.8;
}

.sp-empty-text,
.sp-no-results-text {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.sp-empty-subtext {
    font-size: 12px;
    color: var(--text-tertiary);
}

.sp-loading-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 12px;
}

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

.sp-no-results-btn {
    margin-top: 16px;
    padding: 8px 16px;
    background: var(--primary);
    border: none;
    border-radius: 6px;
    color: #fff;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.sp-no-results-btn:hover {
    background: var(--primary-dark);
}

/* ===== 底部 ===== */
.sp-footer {
    height: var(--footer-height);
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px;
    flex-shrink: 0;
}

.sp-footer-info {
    font-size: 11px;
    color: var(--text-tertiary);
}

.sp-footer-link {
    font-size: 11px;
    color: var(--primary-light);
    text-decoration: none;
    transition: color 0.2s ease;
}

.sp-footer-link:hover {
    color: var(--primary);
    text-decoration: underline;
}

/* ===== Toast 提示 ===== */
.sp-toast {
    position: fixed;
    top: 16px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    background: var(--bg-tertiary);
    color: var(--text-primary);
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 13px;
    border: none;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
    z-index: 1000;
}

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

.sp-toast.success {
    background: rgba(59, 130, 246, 0.25);
    color: #3b82f6;
}

.sp-toast.error {
    background: rgba(59, 130, 246, 0.25);
    color: #3b82f6;
}

/* ===== 动画 ===== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.sp-card {
    animation: fadeIn 0.3s ease forwards;
}

/* ===== 加载更多文本 ===== */
.sp-load-more-text {
    grid-column: 1 / -1;
    text-align: center;
    padding: 16px 0;
    color: var(--text-tertiary);
    font-size: 13px;
    cursor: pointer;
    transition: color 0.2s ease;
}

.sp-load-more-text:hover {
    color: var(--primary);
}

/* ===== 登录页面 ===== */
.sp-login-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: var(--bg-tertiary);
}

.sp-login-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 32px;
}

.sp-login-logo-img {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    margin-bottom: 16px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.sp-login-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.sp-login-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
}

/* 登录表单 */
.sp-login-form {
    width: 100%;
    max-width: 260px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 20px;
}

.sp-login-input-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sp-login-label {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
}

.sp-login-input {
    width: 100%;
    height: 40px;
    padding: 0 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 13px;
    transition: all 0.2s ease;
}

.sp-login-input:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--bg-hover);
}

.sp-login-input::placeholder {
    color: var(--text-tertiary);
}

.sp-login-submit-btn {
    width: 100%;
    height: 42px;
    margin-top: 8px;
    border: none;
    border-radius: 8px;
    background: var(--primary);
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.sp-login-submit-btn:hover {
    background: var(--primary-dark);
}

.sp-login-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.sp-login-divider {
    width: 100%;
    max-width: 260px;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    color: var(--text-tertiary);
    font-size: 12px;
}

.sp-login-divider::before,
.sp-login-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

.sp-login-register-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    transition: color 0.2s ease;
}

.sp-login-register-link:hover {
    color: var(--primary);
}

.sp-login-register-link svg {
    transition: transform 0.2s ease;
}

.sp-login-register-link:hover svg {
    transform: translateX(2px);
}

/* 登录按钮加载动画 */
.sp-login-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* ===== 图片卡片 - 现代卡片式设计 ===== */
.sp-card-image-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 2 / 1;
    overflow: hidden;
    background: var(--bg-tertiary);
}

.sp-card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.sp-card:hover .sp-card-image {
    transform: scale(1.04);
}

/* 收藏按钮 - 右上角 */
.sp-card-favorite {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(6px);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 5;
    opacity: 0;
    transform: translateY(-4px);
}

.sp-card:hover .sp-card-favorite,
.sp-card-favorite.active {
    opacity: 1;
    transform: translateY(0);
}

.sp-card-favorite:hover {
    background: rgba(0, 0, 0, 0.65);
    transform: scale(1.12);
}

.sp-card-favorite svg {
    color: #fff;
    transition: all 0.2s ease;
    width: 14px;
    height: 14px;
}

.sp-card-favorite.active svg {
    color: #ef4444;
    fill: #ef4444;
}

/* 卡片信息区 */
.sp-card-info {
    padding: 10px 12px 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* 标签 */
.sp-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.sp-card-tag {
    display: inline-block;
    padding: 3px 8px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    font-size: 11px;
    color: #565656;
    white-space: nowrap;
    font-weight: 400;
    line-height: 1.2;
}

/* 提示词文本（单行截断） */
.sp-card-prompt {
    font-size: 12px;
    color: #565656;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 操作按钮区域 */
.sp-card-bottom {
    display: flex;
    gap: 8px;
    margin-top: 2px;
}

.sp-card-btn {
    flex: 1;
    height: 32px;
    border: none;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.sp-card-btn-primary {
    background: var(--primary);
    color: #fff;
}

.sp-card-btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

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

.sp-card-btn-secondary:hover {
    color: var(--text-primary);
    border-color: var(--text-muted);
}

/* 旧版overlay样式移除 */
.sp-card-overlay {
    display: none;
}

/* ===== 图片预览弹窗 ===== */
.sp-image-modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sp-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(4px);
}

.sp-modal-content {
    position: relative;
    z-index: 1;
    max-width: 90%;
    max-height: 90%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sp-modal-content img {
    max-width: 100%;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.sp-modal-close {
    position: absolute;
    top: -40px;
    right: 0;
    width: 36px;
    height: 36px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.sp-modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

/* ===== 头部右侧按钮组 ===== */
.sp-header-right {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* 新建按钮 */
.sp-new-btn {
    padding: 4px 10px;
    background: var(--primary);
    border: none;
    border-radius: 6px;
    color: #fff;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.sp-new-btn:hover {
    background: var(--primary-dark);
}

/* ===== 编辑页图片上传区 ===== */
.sp-edit-image-wrapper {
    position: relative;
    cursor: pointer;
}

.sp-edit-image-wrapper.empty {
    min-height: 100px;
    background: var(--bg-secondary);
}

.sp-edit-image-wrapper.empty .sp-edit-image {
    display: none;
}

.sp-edit-image-hint {
    display: none;
    position: absolute;
    inset: 0;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 4px;
    font-size: 13px;
    color: var(--text-tertiary);
    pointer-events: none;
}

.sp-edit-image-wrapper.empty .sp-edit-image-hint {
    display: flex;
}

.sp-edit-image-wrapper.drag-over {
    border-color: var(--primary);
    border-style: dashed;
    background: rgba(59, 130, 246, 0.08);
}

/* 提示词卡片（我的提示词） */
.sp-prompt-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: border-color 0.2s ease;
}

.sp-prompt-card:hover {
    border-color: var(--border-light);
}

.sp-prompt-card-image-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 2 / 1;
    overflow: hidden;
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.sp-prompt-card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sp-prompt-card-no-image {
    font-size: 14px;
    color: var(--text-tertiary);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.sp-prompt-card-no-image svg {
    opacity: 0.4;
}

.sp-prompt-card-info {
    padding: 10px 12px 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sp-prompt-card-prompt {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sp-prompt-card-model {
    font-size: 10px;
    color: var(--text-tertiary);
    background: var(--bg-tertiary);
    padding: 2px 8px;
    border-radius: 4px;
    align-self: flex-start;
}

.sp-prompt-card-time {
    font-size: 10px;
    color: var(--text-tertiary);
}

.sp-prompt-card-bottom {
    display: flex;
    gap: 8px;
    margin-top: 4px;
}

.sp-prompt-card-bottom .sp-card-btn {
    flex: 1;
}

.sp-prompt-card-delete {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.4);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 3;
}

.sp-prompt-card:hover .sp-prompt-card-delete {
    opacity: 1;
}
