/* Creator Page Styles */
.creator-page {
    display: flex;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 100;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 20px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-subtle);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--text-primary);
}

.sidebar-logo-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.sidebar-logo-icon svg {
    width: 18px;
    height: 18px;
    stroke: var(--bg-primary);
}

.sidebar-logo-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    color: var(--text-secondary);
}

.sidebar-toggle svg {
    width: 20px;
    height: 20px;
}

.sidebar-nav {
    padding: 16px 12px;
    flex: 1;
}

.sidebar-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 10px;
    transition: all 0.3s ease;
    margin-bottom: 4px;
}

.sidebar-nav-item:hover {
    background: var(--bg-card);
    color: var(--text-primary);
}

.sidebar-nav-item.active {
    background: rgba(0, 240, 255, 0.1);
    color: var(--accent-primary);
}

.sidebar-nav-item svg {
    width: 20px;
    height: 20px;
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--border-subtle);
    position: relative;
}

.sidebar-coins {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: linear-gradient(135deg, rgba(0, 240, 255, 0.08), rgba(123, 45, 255, 0.08));
    border: 1px solid rgba(0, 240, 255, 0.2);
    border-radius: 10px;
    margin-bottom: 12px;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.sidebar-coins:hover {
    background: linear-gradient(135deg, rgba(0, 240, 255, 0.15), rgba(123, 45, 255, 0.15));
    border-color: rgba(0, 240, 255, 0.4);
    transform: translateY(-2px);
}

.sidebar-coins svg {
    width: 18px;
    height: 18px;
    stroke: var(--accent-primary);
}

.coins-amount {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 1rem;
    color: var(--accent-primary);
}

.coins-label {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-card);
    border-radius: 10px;
    cursor: pointer;
}

.user-avatar {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-tertiary));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--bg-primary);
}

.user-info {
    flex: 1;
    min-width: 0;
}

.user-name {
    font-weight: 500;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-plan {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.user-menu-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: var(--text-muted);
}

.user-menu-btn svg {
    width: 18px;
    height: 18px;
}

.user-dropdown {
    position: absolute;
    bottom: 100%;
    left: 16px;
    right: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: 8px;
    margin-bottom: 8px;
    display: none;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.user-dropdown.active {
    display: block;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 8px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.dropdown-item:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.dropdown-item svg {
    width: 18px;
    height: 18px;
}

.dropdown-divider {
    height: 1px;
    background: var(--border-subtle);
    margin: 8px 0;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 32px 48px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.content-section {
    display: none;
    flex: 1;
}

.content-section.active {
    display: flex;
    flex-direction: column;
}

.content-section.active#createSection {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.content-section.active#canvasSection {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#createSection .chat-container {
    flex: 1;
    height: calc(100vh - 200px);
    min-height: 500px;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.section-header {
    margin-bottom: 32px;
}

.section-header h1 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.75rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.section-header p {
    color: var(--text-secondary);
}

/* Mode Selection */
.mode-selection {
    display: flex;
    gap: 16px;
    margin-bottom: 32px;
}

.mode-btn {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 24px;
    background: var(--bg-card);
    border: 2px solid var(--border-subtle);
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
}

.mode-btn:hover {
    border-color: rgba(255, 255, 255, 0.15);
    background: var(--bg-card-hover);
}

.mode-btn.active {
    border-color: var(--accent-primary);
    background: rgba(0, 240, 255, 0.05);
}

.mode-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.mode-icon.cyan {
    background: rgba(0, 240, 255, 0.15);
}

.mode-icon.cyan svg {
    stroke: var(--accent-primary);
}

.mode-icon.pink {
    background: rgba(255, 45, 117, 0.15);
}

.mode-icon.pink svg {
    stroke: var(--accent-secondary);
}

.mode-icon.green {
    background: rgba(0, 255, 136, 0.15);
}

.mode-icon.green svg {
    stroke: #00ff88;
}

.mode-icon svg {
    width: 24px;
    height: 24px;
}

.mode-title {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 4px;
}

.mode-desc {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* Creator Panels */
.creator-panel {
    display: none;
}

.creator-panel.active {
    display: block;
}

.panel-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
}

.panel-left,
.panel-right {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.panel-right {
    position: sticky;
    top: 32px;
    height: fit-content;
}

/* Upload Zone */
.upload-zone {
    background: var(--bg-card);
    border: 2px dashed var(--border-subtle);
    border-radius: 16px;
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.upload-zone:hover,
.upload-zone.dragover {
    border-color: var(--accent-primary);
    background: rgba(0, 240, 255, 0.05);
}

.upload-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.upload-zone-icon {
    width: 56px;
    height: 56px;
    background: rgba(0, 240, 255, 0.1);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.upload-zone-icon svg {
    width: 28px;
    height: 28px;
    stroke: var(--accent-primary);
}

.upload-zone-text {
    font-size: 1rem;
    color: var(--text-primary);
}

.upload-zone-hint {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.upload-preview {
    position: absolute;
    inset: 0;
    display: none;
    border-radius: 14px;
    overflow: hidden;
}

.upload-preview.active {
    display: block;
}

.upload-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.remove-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    background: rgba(0, 0, 0, 0.6);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.remove-btn:hover {
    background: var(--accent-secondary);
}

.remove-btn svg {
    width: 16px;
    height: 16px;
    stroke: white;
}

/* Form Elements */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
}

.form-textarea {
    width: 100%;
    padding: 14px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: inherit;
    resize: vertical;
    min-height: 100px;
    transition: all 0.3s ease;
}

.form-textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(0, 240, 255, 0.1);
}

.form-textarea::placeholder {
    color: var(--text-muted);
}

.form-select {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.3s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238a8a9a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
}

.form-select:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.form-select option {
    color: var(--text-secondary);
    background: var(--bg-card);
}

.form-row-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* Suggestion Tags */
.prompt-suggestions {
    margin-top: 8px;
}

.suggestion-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.suggestion-tag {
    padding: 8px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 20px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.suggestion-tag:hover {
    background: rgba(0, 240, 255, 0.1);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

/* Preview Area */
.preview-area {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    aspect-ratio: 16/9;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.preview-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    color: var(--text-muted);
}

.preview-placeholder svg {
    width: 48px;
    height: 48px;
    opacity: 0.5;
}

.preview-result {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.preview-result img {
    width: 100%;
    height: auto;
    max-height: 300px;
    object-fit: contain;
    border-radius: 12px;
    background: var(--bg-secondary);
}

.preview-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.preview-actions .btn {
    flex: 1;
    padding: 10px 16px;
    font-size: 0.9rem;
}

.generate-btn {
    width: 100%;
    padding: 16px 24px;
    font-size: 1rem;
}

/* Projects Grid */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.project-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
}

.project-card:hover {
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-4px);
}

.project-card.empty {
    border-style: dashed;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
}

.project-thumbnail {
    aspect-ratio: 16/9;
    display: flex;
    align-items: center;
    justify-content: center;
}

.project-thumbnail svg {
    width: 48px;
    height: 48px;
    stroke: var(--text-muted);
    opacity: 0.5;
}

.project-info {
    padding: 16px;
}

.project-title {
    font-weight: 500;
    margin-bottom: 8px;
}

.project-meta {
    display: flex;
    gap: 12px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
}

.empty-state svg {
    width: 32px;
    height: 32px;
}

/* History List */
.history-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.history-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    transition: all 0.3s ease;
}

.history-item:hover {
    border-color: rgba(255, 255, 255, 0.1);
}

.history-thumb {
    width: 80px;
    height: 45px;
    background: linear-gradient(135deg, rgba(0, 240, 255, 0.1), rgba(123, 45, 255, 0.1));
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.history-thumb svg {
    width: 24px;
    height: 24px;
    stroke: var(--text-muted);
}

.history-info {
    flex: 1;
    min-width: 0;
}

.history-title {
    font-weight: 500;
    margin-bottom: 4px;
}

.history-time {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.history-actions {
    display: flex;
    gap: 8px;
}

.icon-btn {
    width: 36px;
    height: 36px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: all 0.3s ease;
}

.icon-btn:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
    border-color: rgba(255, 255, 255, 0.15);
}

.icon-btn svg {
    width: 18px;
    height: 18px;
}

/* Favorites Empty */
.favorites-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    text-align: center;
    color: var(--text-muted);
}

.favorites-empty svg {
    width: 64px;
    height: 64px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.favorites-empty p {
    font-size: 1.1rem;
    margin-bottom: 8px;
    color: var(--text-secondary);
}

.favorites-empty span {
    font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 1200px) {
    .panel-grid {
        grid-template-columns: 1fr;
    }
    
    .panel-right {
        position: static;
    }
}

@media (max-width: 900px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .sidebar-toggle {
        display: block;
    }
    
    .main-content {
        margin-left: 0;
        padding: 24px;
    }
}

@media (max-width: 600px) {
    .mode-selection {
        flex-direction: column;
    }
    
    .form-row-split {
        grid-template-columns: 1fr;
    }
    
    .projects-grid {
        grid-template-columns: 1fr;
    }
}

/* Chat Container - Dialog Mode */
.chat-container {
    height: 100%;
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid var(--border-subtle);
}

.chat-header {
    padding: 24px 32px;
    border-bottom: 1px solid var(--border-subtle);
    background: linear-gradient(135deg, rgba(0, 240, 255, 0.03), rgba(123, 45, 255, 0.03));
}

.chat-header h1 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.chat-header p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.chat-messages {
    flex: 1;
    min-height: 0;
    max-height: calc(100% - 180px);
    overflow-y: auto;
    padding: 24px 32px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Messages */
.message {
    display: flex;
    gap: 16px;
    max-width: 85%;
}

.message.user {
    flex-direction: row-reverse;
    align-self: flex-end;
}

.message-bot {
    align-self: flex-start;
}

.message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-tertiary));
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.message-avatar svg {
    width: 18px;
    height: 18px;
    stroke: var(--bg-primary);
}

.message-content {
    padding: 16px 20px;
    border-radius: 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
}

.message.user .message-content {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-tertiary));
    border: none;
    color: var(--bg-primary);
}

.message-content p {
    margin-bottom: 12px;
    line-height: 1.6;
}

.message-content p:last-child {
    margin-bottom: 0;
}

.message-content ul {
    margin: 12px 0;
    padding-left: 20px;
}

.message-content li {
    margin-bottom: 8px;
    line-height: 1.5;
}

.message-content strong {
    color: var(--accent-primary);
}

.message.user .message-content strong {
    color: var(--bg-primary);
}

/* Generated Result Message */
.message-result {
    flex-direction: column;
    max-width: 100%;
}

.message-result .message-content {
    padding: 0;
    background: transparent;
    border: none;
}

.result-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.result-item {
    border-radius: 12px;
    overflow: hidden;
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
}

.result-item img,
.result-item video {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
    display: block;
}

.result-item-info {
    padding: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.result-item-title {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.result-item-actions {
    display: flex;
    gap: 8px;
}

.result-item-actions button {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s;
}

.result-item-actions button:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.result-item-actions button svg {
    width: 18px;
    height: 18px;
}

/* Loading Message */
.message.loading .message-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.loading-dots {
    display: flex;
    gap: 4px;
}

.loading-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-primary);
    animation: loading-dot 1.4s infinite ease-in-out;
}

.loading-dots span:nth-child(1) { animation-delay: 0s; }
.loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.loading-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes loading-dot {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.5; }
    40% { transform: scale(1); opacity: 1; }
}

/* Chat Input Area */
.chat-input-area {
    padding: 20px 24px;
    border-top: 1px solid var(--border-subtle);
    background: var(--bg-secondary);
}

/* Mode Tabs */
.mode-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.mode-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.mode-tab svg {
    width: 18px;
    height: 18px;
}

.mode-tab:hover {
    border-color: var(--accent-primary);
    color: var(--text-primary);
}

.mode-tab.active {
    background: linear-gradient(135deg, rgba(0, 240, 255, 0.1), rgba(123, 45, 255, 0.1));
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

/* VIP-only Mode Tab */
.mode-tab[data-vip-only="true"] {
    position: relative;
}

.mode-tab[data-vip-only="true"] .vip-badge {
    font-size: 0.65rem;
    padding: 2px 5px;
    background: linear-gradient(135deg, #ffd700, #ff8c00);
    color: #000;
    border-radius: 4px;
    font-weight: 600;
    margin-left: 4px;
}

.mode-tab.vip-disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.mode-tab.vip-disabled:hover {
    border-color: var(--border-subtle);
    color: var(--text-secondary);
}

.mode-tab.vip-disabled .vip-badge {
    background: rgba(255, 215, 0, 0.3);
}

/* External Link Mode Tab */
.mode-tab.external-link {
    text-decoration: none;
}

.mode-tab.external-link:hover {
    border-color: #ff00aa;
    color: #ff00aa;
}

/* Attachment Preview */
.attachment-preview {
    margin-bottom: 12px;
}

.attachment-item {
    position: relative;
    display: inline-block;
}

.attachment-item img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--border-subtle);
}

.remove-attachment {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--accent-secondary);
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.remove-attachment svg {
    width: 12px;
    height: 12px;
}

/* Options Panel */
.options-panel {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.option-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.option-group label {
    font-size: 0.8rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.option-select {
    padding: 6px 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 0.85rem;
    cursor: pointer;
}

.option-select:focus {
    outline: none;
    border-color: var(--accent-primary);
}

/* Input Row */
.input-row {
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

.attach-btn {
    width: 88px;
    height: 88px;
    border-radius: 10px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.attach-btn:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.attach-btn svg {
    width: 24px;
    height: 24px;
}

.textarea-wrapper {
    flex: 1;
    position: relative;
}

.chat-input {
    width: 100%;
    padding: 12px 16px;
    padding-bottom: 44px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: inherit;
    resize: none;
    min-height: 88px;
    max-height: 240px;
    line-height: 1.5;
}

.chat-input:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.chat-input::placeholder {
    color: var(--text-muted);
}

.send-btn {
    width: 88px;
    height: 88px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-tertiary));
    border: none;
    color: var(--bg-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.send-btn:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.4);
}

.send-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.send-btn svg {
    width: 24px;
    height: 24px;
}

/* Polish Button */
.polish-btn {
    position: absolute;
    bottom: 8px;
    right: 8px;
    height: 32px;
    padding: 0 12px;
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.polish-btn:hover:not(:disabled) {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    background: rgba(99, 102, 241, 0.08);
}

.polish-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.polish-btn svg {
    width: 14px;
    height: 14px;
}

.polish-btn.loading {
    pointer-events: none;
    opacity: 0.7;
}

.polish-btn.loading svg {
    display: none;
}

.polish-btn.loading::after {
    content: '';
    width: 14px;
    height: 14px;
    border: 2px solid var(--text-secondary);
    border-top-color: transparent;
    border-radius: 50%;
    animation: polishSpin 0.6s linear infinite;
}

@keyframes polishSpin {
    to { transform: rotate(360deg); }
}

/* Quick Suggestions */
.quick-suggestions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.suggestion-label {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.quick-tag {
    padding: 6px 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    color: var(--text-secondary);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.quick-tag:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

/* Responsive for Chat */
@media (max-width: 768px) {
    .chat-container {
        border-radius: 0;
        height: calc(100vh - 80px);
    }
    
    .chat-header {
        padding: 16px 20px;
    }
    
    .chat-messages {
        padding: 16px 20px;
    }
    
    .chat-input-area {
        padding: 16px;
    }
    
    .mode-tabs {
        flex-wrap: wrap;
    }
    
    .mode-tab {
        flex: 1 1 calc(50% - 4px);
    }
    
    .options-panel {
        flex-direction: column;
    }
    
    .option-group {
        width: 100%;
    }
    
    .option-select {
        flex: 1;
    }
}

/* VIP Badge */
.vip-badge {
    font-size: 0.65rem;
    padding: 2px 6px;
    background: linear-gradient(135deg, #ffd700, #ff8c00);
    color: #000;
    border-radius: 4px;
    font-weight: 700;
    margin-left: auto;
}

/* AI Canvas Styles */
.ai-canvas-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 64px);
    background: var(--bg-card);
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--border-subtle);
}

.canvas-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-subtle);
}

.toolbar-left,
.toolbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.toolbar-center {
    flex: 1;
    text-align: center;
}

.canvas-title {
    font-weight: 600;
    font-size: 1rem;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-tertiary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.tool-btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.tool-btn:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
    border-color: var(--accent-primary);
}

.tool-btn.active {
    background: rgba(0, 240, 255, 0.1);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.tool-btn svg {
    width: 18px;
    height: 18px;
}

.toolbar-divider {
    width: 1px;
    height: 24px;
    background: var(--border-subtle);
    margin: 0 8px;
}

.canvas-workspace {
    display: flex;
    flex: 1;
    overflow: hidden;
    min-width: 0;
}

.canvas-layers-panel {
    width: 200px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
}

.layers-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-subtle);
    font-weight: 600;
    font-size: 0.85rem;
}

.layer-add-btn {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    background: var(--accent-primary);
    border: none;
    color: var(--bg-primary);
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.layers-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.layer-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.layer-item:hover {
    background: var(--bg-card);
}

.layer-item.active {
    background: rgba(0, 240, 255, 0.1);
    color: var(--accent-primary);
}

.layer-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.layer-visibility {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    opacity: 0.7;
}

.layer-visibility:hover {
    opacity: 1;
}

.canvas-main {
    flex: 1;
    position: relative;
    overflow: hidden;
    background: var(--bg-primary);
    min-width: 0;
}

.canvas-viewport {
    width: 100%;
    height: 100%;
    overflow: auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

#mainCanvas {
    background: #1a1a2e;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.5);
    max-width: 100%;
    height: auto;
}

.canvas-minimap {
    position: absolute;
    right: 16px;
    bottom: 16px;
    width: 150px;
    height: 100px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    overflow: hidden;
    z-index: 10;
}

#minimapCanvas {
    width: 100%;
    height: 100%;
    pointer-events: auto;
}

.minimap-viewport {
    position: absolute;
    border: 2px solid var(--accent-primary);
    background: rgba(0, 240, 255, 0.1);
    cursor: move;
    user-select: none;
}

.canvas-minimap {
    cursor: crosshair;
}

.canvas-properties-panel {
    width: 280px;
    background: var(--bg-secondary);
    border-left: 1px solid var(--border-subtle);
    overflow-y: auto;
    padding: 16px;
}

.properties-section {
    margin-bottom: 24px;
}

.properties-section h4 {
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.property-row {
    margin-bottom: 12px;
}

.property-row label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.property-row input[type="number"],
.property-row select,
.property-row textarea {
    width: 100%;
    padding: 8px 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 0.85rem;
}

.property-row input[type="number"]:focus,
.property-row select:focus,
.property-row textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.property-row textarea {
    min-height: 80px;
    resize: vertical;
}

.property-row input[type="color"] {
    width: 100%;
    height: 36px;
    padding: 2px;
    border-radius: 6px;
    cursor: pointer;
}

.btn-block {
    width: 100%;
}

/* VIP Modal */
.vip-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.vip-modal.active {
    display: flex;
}

.vip-modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 20px;
    padding: 32px;
    text-align: center;
    max-width: 400px;
    width: 90%;
}

.vip-modal-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    background: linear-gradient(135deg, #ffd700, #ff8c00);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.vip-modal-icon svg {
    width: 32px;
    height: 32px;
    stroke: #000;
}

.vip-modal-content h3 {
    font-size: 1.5rem;
    margin-bottom: 8px;
}

.vip-modal-content > p {
    color: var(--text-muted);
    margin-bottom: 24px;
}

.vip-modal-features {
    text-align: left;
    margin-bottom: 24px;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-subtle);
}

.feature-item:last-child {
    border-bottom: none;
}

.feature-item svg {
    width: 20px;
    height: 20px;
    stroke: #00ff88;
}

.feature-item span {
    color: var(--text-secondary);
}

/* AI Modal */
.ai-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.ai-modal.active {
    display: flex;
}

.ai-modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 20px;
    padding: 24px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.ai-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.ai-modal-header h3 {
    font-size: 1.2rem;
}

.ai-modal-close {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--bg-secondary);
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ai-modal-close:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.ai-modal-result {
    text-align: center;
}

.ai-modal-result img {
    max-width: 100%;
    border-radius: 12px;
    margin-bottom: 16px;
}

.ai-result-actions {
    display: flex;
    gap: 12px;
}

.ai-result-actions .btn {
    flex: 1;
}

.ai-modal-loading {
    text-align: center;
    padding: 40px;
}

.ai-modal-loading .loading-spinner {
    width: 48px;
    height: 48px;
    margin: 0 auto 16px;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-subtle);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.ai-modal-loading p {
    color: var(--text-muted);
}

/* Loading States */
.projects-loading,
.history-loading,
.favorites-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: var(--text-muted);
    gap: 12px;
    grid-column: 1 / -1;
}

.projects-loading .loading-spinner,
.history-loading .loading-spinner,
.favorites-loading .loading-spinner {
    width: 32px;
    height: 32px;
}

/* Empty States */
.projects-empty,
.history-empty,
.favorites-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
    color: var(--text-muted);
    grid-column: 1 / -1;
}

.projects-empty svg,
.history-empty svg {
    width: 48px;
    height: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.projects-empty p,
.history-empty p {
    font-size: 1.1rem;
    margin-bottom: 8px;
    color: var(--text-secondary);
}

.projects-empty span,
.history-empty span {
    font-size: 0.9rem;
}

/* Project Actions */
.project-actions {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid var(--border-subtle);
}

.project-actions .icon-btn {
    flex: 1;
}

/* History Item Active States */
.history-item .icon-btn.active {
    color: var(--accent-secondary);
}

.history-item .icon-btn.active:hover {
    background: rgba(255, 45, 117, 0.1);
}

/* History Thumb Image */
.history-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

/* Favorites Grid */
.favorites-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.favorite-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.favorite-card:hover {
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-4px);
}

.favorite-thumb {
    aspect-ratio: 16/9;
    background: linear-gradient(135deg, rgba(0, 240, 255, 0.1), rgba(123, 45, 255, 0.1));
    display: flex;
    align-items: center;
    justify-content: center;
}

.favorite-thumb svg {
    width: 48px;
    height: 48px;
    stroke: var(--text-muted);
    opacity: 0.5;
}

.favorite-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.favorite-info {
    padding: 16px;
}

.favorite-title {
    font-weight: 500;
    margin-bottom: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.favorite-meta {
    display: flex;
    gap: 12px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.favorite-actions {
    display: flex;
    gap: 8px;
    padding: 0 16px 16px;
}

.favorite-actions .icon-btn {
    flex: 1;
}

/* Project Meta Type */
.project-type {
    background: rgba(0, 240, 255, 0.1);
    color: var(--accent-primary);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
}

.favorite-type {
    background: rgba(255, 45, 117, 0.1);
    color: var(--accent-secondary);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
}

/* Credit Confirmation Modal */
.credit-confirm-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.credit-confirm-modal.active {
    opacity: 1;
    visibility: visible;
}

.credit-confirm-content {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    padding: 32px;
    width: 90%;
    max-width: 400px;
    text-align: center;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.credit-confirm-modal.active .credit-confirm-content {
    transform: scale(1);
}

.credit-confirm-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 20px;
    background: linear-gradient(135deg, rgba(0, 240, 255, 0.2), rgba(123, 45, 255, 0.2));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.credit-confirm-icon svg {
    width: 32px;
    height: 32px;
    color: var(--accent-primary);
}

.credit-confirm-content h3 {
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.credit-confirm-info {
    background: var(--bg-input);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 20px;
}

.confirm-detail {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
}

.confirm-detail:not(:last-child) {
    border-bottom: 1px solid var(--border-subtle);
}

.detail-label {
    color: var(--text-muted);
}

.detail-value {
    color: var(--text-primary);
    font-weight: 500;
}

.credit-confirm-cost {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 4px;
    margin-bottom: 12px;
}

.cost-label {
    color: var(--text-muted);
    margin-right: 8px;
}

.cost-value {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.cost-unit {
    color: var(--text-muted);
    font-size: 1rem;
}

.credit-confirm-balance {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 24px;
}

.credit-confirm-balance span {
    color: var(--accent-primary);
    font-weight: 600;
}

.credit-confirm-actions {
    display: flex;
    gap: 12px;
}

.credit-confirm-actions .btn {
    flex: 1;
    padding: 14px 24px;
    font-size: 1rem;
}

.credit-confirm-actions .btn-secondary {
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
}

.credit-confirm-actions .btn-secondary:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.credit-confirm-actions .btn-primary {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border: none;
    color: white;
}

.credit-confirm-actions .btn-primary:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.credit-confirm-actions .btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.insufficient-balance {
    color: #ff6b6b;
}
/* 删除按钮样式 */
.delete-btn:hover {
    background: #fee2e2;
    color: #dc2626;
    border-color: #dc2626;
}

.delete-btn svg {
    color: inherit;
}

/* ===================== AI 文案生成样式 ===================== */
.textgen-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    padding: 24px;
    max-width: 1400px;
    margin: 0 auto;
}

.textgen-form {
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    padding: 24px;
}

.textgen-type-selector {
    margin-bottom: 20px;
}

.textgen-type-selector label {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.textgen-types {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.textgen-type-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 14px 10px;
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
}

.textgen-type-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--border-medium);
}

.textgen-type-btn.active {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border-color: transparent;
    color: white;
}

.textgen-type-btn svg {
    width: 22px;
    height: 22px;
}

.textgen-type-btn span {
    font-size: 0.8rem;
    font-weight: 500;
}

.textgen-prompt-section {
    margin-bottom: 20px;
}

.textgen-prompt-section label {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.textgen-prompt {
    width: 100%;
    min-height: 160px;
    padding: 16px;
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 0.95rem;
    line-height: 1.6;
    resize: vertical;
    transition: border-color 0.3s ease;
}

.textgen-prompt:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.textgen-prompt::placeholder {
    color: var(--text-muted);
}

.textgen-options {
    display: flex;
    gap: 20px;
    margin-bottom: 24px;
}

.textgen-option {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
}

.textgen-option label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

.textgen-option input[type="range"] {
    flex: 1;
    height: 4px;
    background: var(--bg-input);
    border-radius: 2px;
    cursor: pointer;
}

.textgen-option select {
    padding: 8px 12px;
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.85rem;
    cursor: pointer;
}

.textgen-option select:focus {
    outline: none;
    border-color: var(--accent-primary);
}

#temperatureValue {
    min-width: 30px;
    font-size: 0.85rem;
    color: var(--accent-primary);
    font-weight: 600;
}

.textgen-submit {
    width: 100%;
    padding: 16px;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.textgen-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* 文案生成结果 */
.textgen-result {
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    min-height: 400px;
}

.textgen-result-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-subtle);
}

.textgen-result-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.textgen-result-actions {
    display: flex;
    gap: 8px;
}

.textgen-result-actions .btn-icon {
    padding: 8px;
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
}

.textgen-result-actions .btn-icon:hover {
    background: var(--bg-hover);
    color: var(--accent-primary);
    border-color: var(--accent-primary);
}

.textgen-result-content {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
}

.textgen-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-muted);
    text-align: center;
}

.textgen-placeholder svg {
    margin-bottom: 16px;
    opacity: 0.5;
}

.textgen-placeholder p {
    font-size: 0.95rem;
}

.textgen-result-content .generated-text {
    font-size: 1rem;
    line-height: 1.8;
    color: var(--text-primary);
    white-space: pre-wrap;
    word-break: break-word;
}

.textgen-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-secondary);
}

.textgen-loading .loading-spinner {
    margin-bottom: 16px;
}

.textgen-error {
    color: #ef4444;
    text-align: center;
    padding: 20px;
}

/* 复制成功提示 */
.copy-success {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--accent-primary);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 0.9rem;
    z-index: 1000;
    animation: fadeInUp 0.3s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* 响应式 */
@media (max-width: 900px) {
    .textgen-container {
        grid-template-columns: 1fr;
    }
    
    .textgen-types {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .textgen-types {
        grid-template-columns: 1fr;
    }

    .textgen-options {
        flex-direction: column;
        gap: 16px;
    }
}

/* ===================== 素材专区样式 ===================== */
#materialsSection {
    flex: 1;
    display: none;
    flex-direction: column;
}

#materialsSection.active {
    display: flex;
}

.materials-container {
    flex: 1;
    padding: 0;
}

.materials-filters {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.filter-tabs {
    display: flex;
    gap: 8px;
    background: var(--bg-card);
    padding: 4px;
    border-radius: 10px;
    border: 1px solid var(--border-subtle);
}

.filter-tab {
    padding: 10px 20px;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-tab:hover {
    color: var(--text-primary);
}

.filter-tab.active {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
}

.filter-search input {
    padding: 10px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 0.9rem;
    min-width: 250px;
}

.filter-search input:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.filter-search input::placeholder {
    color: var(--text-muted);
}

.materials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.material-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
}

.material-card:hover {
    border-color: rgba(0, 240, 255, 0.3);
    transform: translateY(-4px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.material-preview {
    position: relative;
    aspect-ratio: 16/10;
    background: linear-gradient(135deg, rgba(0, 240, 255, 0.05), rgba(123, 45, 255, 0.05));
    overflow: hidden;
}

.material-preview img,
.material-preview video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.material-type-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.material-type-badge.image {
    background: rgba(99, 102, 241, 0.9);
    color: white;
}

.material-type-badge.video {
    background: rgba(236, 72, 153, 0.9);
    color: white;
}

.material-info {
    padding: 16px;
}

.material-title {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-primary);
    margin-bottom: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.material-meta {
    display: flex;
    gap: 12px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.material-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

.material-tag {
    padding: 2px 8px;
    background: var(--bg-secondary);
    border-radius: 4px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.material-actions {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid var(--border-subtle);
}

.material-actions .btn {
    flex: 1;
    padding: 8px 12px;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.material-actions .btn svg {
    width: 16px;
    height: 16px;
}

.materials-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: var(--text-muted);
    gap: 12px;
    grid-column: 1 / -1;
}

.materials-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    text-align: center;
    color: var(--text-muted);
    grid-column: 1 / -1;
}

.materials-empty svg {
    width: 64px;
    height: 64px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.materials-empty p {
    font-size: 1.1rem;
    margin-bottom: 8px;
    color: var(--text-secondary);
}

.materials-empty span {
    font-size: 0.9rem;
}

.materials-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 32px;
}

.materials-pagination button {
    padding: 8px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s;
}

.materials-pagination button:hover:not(:disabled) {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.materials-pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.materials-pagination button.active {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
}

/* 素材预览弹窗 */
.material-preview-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.material-preview-modal.active {
    display: flex;
}

.preview-content {
    max-width: 90vw;
    max-height: 90vh;
    position: relative;
}

.preview-content img,
.preview-content video {
    max-width: 100%;
    max-height: 85vh;
    border-radius: 12px;
    background: var(--bg-card);
}

.preview-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    border-radius: 0 0 12px 12px;
}

.preview-info h3 {
    font-size: 1.2rem;
    margin-bottom: 8px;
}

.preview-info p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 16px;
}

.preview-actions {
    display: flex;
    gap: 12px;
}

.preview-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.preview-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.preview-close svg {
    width: 24px;
    height: 24px;
}

/* 响应式 */
@media (max-width: 768px) {
    .materials-filters {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-tabs {
        justify-content: center;
    }

    .filter-search input {
        width: 100%;
    }

    .materials-grid {
        grid-template-columns: 1fr;
    }
}

/* ===================== 数字人 iframe 嵌入样式 ===================== */
.iframe-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-primary);
    z-index: 2000;
    display: none;
    flex-direction: column;
    animation: iframeFadeIn 0.3s ease;
}

.iframe-container.active {
    display: flex;
}

@keyframes iframeFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.iframe-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-subtle);
}

.iframe-header h2 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
}

.iframe-close-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-hover);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.iframe-close-btn:hover {
    background: rgba(255, 71, 87, 0.2);
}

.iframe-close-btn svg {
    width: 20px;
    height: 20px;
    stroke: var(--text-secondary);
}

.iframe-content {
    flex: 1;
    overflow: hidden;
}

.iframe-content iframe {
    width: 100%;
    height: 100%;
    border: none;
    background: var(--bg-primary);
}
