:root {
    --primary-color: #4285f4;
    --secondary-color: #34a853;
    --accent-color: #fbbc05;
    --dark-color: #202124;
    --light-color: #f8f9fa;
    --gray-color: #dadce0;
    --text-color: #3c4043;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --card-hover-color: #f1f3f4;
    --active-tag-bg: #e8f0fe;
    --active-tag-color: #1a73e8;
}

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

body {
    font-family: 'Noto Sans SC', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--light-color);
    overflow-x: hidden;
}

.page-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding-bottom: 3rem;
}

header {
    background: linear-gradient(135deg, var(--primary-color), #5c6bc0);
    color: white;
    padding: 2rem 0;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.subtitle {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    opacity: 0.9;
}

.header-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1.5rem;
}

.prompt-type-button {
    background-color: rgba(255, 255, 255, 0.2);
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    color: white;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.prompt-type-button:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

.prompt-type-button.active {
    background-color: white;
    color: var(--primary-color);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.main-content {
    flex: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
    width: 100%;
    margin-bottom: 4rem;
}

.search-section {
    margin-bottom: 2rem;
}

.search-container {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
}

.search-input {
    width: 100%;
    padding: 1rem 1rem 1rem 3rem;
    border: 2px solid var(--gray-color);
    border-radius: 50px;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.search-icon {
    position: absolute;
    left: 1.2rem;
    top: 50%;
    transform: translateY(-50%);
    color: #9aa0a6;
    font-size: 1.2rem;
}

.clear-search {
    position: absolute;
    right: 1.2rem;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: #9aa0a6;
    cursor: pointer;
    font-size: 1rem;
}

.filter-title {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    font-weight: 500;
}

.filters {
    margin-bottom: 2rem;
}

.tags-container {
    overflow-x: auto;
    padding-bottom: 0.5rem;
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    padding: 0.5rem 0;
}

.tag {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    background-color: white;
    border-radius: 50px;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--gray-color);
}

.tag:hover {
    background-color: var(--card-hover-color);
    transform: translateY(-2px);
}

.tag.active {
    background-color: var(--active-tag-bg);
    color: var(--active-tag-color);
    border-color: var(--active-tag-color);
    font-weight: 500;
    box-shadow: 0 3px 8px rgba(26, 115, 232, 0.15);
}

.all-tags {
    background-color: #f1f3f4;
    font-weight: 500;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

h2 {
    font-size: 1.8rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.view-controls {
    display: none;
}

.view-control {
    display: none;
}

.loading-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 0;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(66, 133, 244, 0.3);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
    margin-bottom: 1rem;
}

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

.cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    width: 100%;
    margin-top: 2rem;
}

.cards-container.list-view {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.prompt-card {
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
    border: 1px solid var(--gray-color);
}

.prompt-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.12);
    border-color: var(--primary-color);
}

.list-view .prompt-card {
    flex-direction: row;
}

.card-content {
    padding: 16px;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--dark-color);
    margin: 0;
    line-height: 1.4;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.card-views {
    font-size: 0.8rem;
    color: #70757a;
    white-space: nowrap;
    margin-left: 10px;
}

.card-description {
    color: var(--text-color);
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 16px;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

.list-view .card-description {
    -webkit-line-clamp: 2;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
}

.card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.card-tag {
    background-color: var(--active-tag-bg);
    color: var(--active-tag-color);
    font-size: 0.75rem;
    padding: 3px 8px;
    border-radius: 4px;
    white-space: nowrap;
}

.no-results {
    text-align: center;
    padding: 3rem 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.no-results i {
    font-size: 3rem;
    color: #dadce0;
    margin-bottom: 1rem;
}

.no-results p {
    font-size: 1.2rem;
    color: #5f6368;
    margin-bottom: 1.5rem;
}

#resetFilters {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 5px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

#resetFilters:hover {
    background-color: #3367d6;
}

.prompt-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.prompt-modal.active {
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: white;
    border-radius: 12px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.2);
    animation: modalAppear 0.3s ease;
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #f1f3f4;
}

.modal-header h3 {
    font-size: 1.5rem;
    font-weight: 600;
}

.close-modal {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #5f6368;
    transition: color 0.3s ease;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.close-modal:hover {
    color: var(--dark-color);
    background-color: #f1f3f4;
}

.modal-body {
    padding: 1.5rem;
}

#modalDescription {
    margin-bottom: 2rem;
    line-height: 1.8;
    white-space: pre-line;
}

.modal-actions {
    display: flex;
    justify-content: center;
    margin-top: 1.5rem;
}

.action-button {
    flex: 1;
    padding: 0.8rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.copy-button {
    width: 100%;
    max-width: 250px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0.8rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.copy-button:hover {
    background-color: #3367d6;
}

.copy-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.copy-button i {
    font-size: 1.1rem;
}

.copy-button.success {
    background-color: var(--secondary-color);
}

.card-content .view-details-btn {
    background-color: transparent;
    border: none;
    color: var(--primary-color);
    cursor: pointer;
    font-size: 1.1rem;
    transition: all 0.2s ease;
    padding: 0.5rem;
    border-radius: 50%;
}

.card-content .view-details-btn:hover {
    background-color: var(--active-tag-bg);
    transform: scale(1.1);
}

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

.card-button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    flex: 1;
    text-align: center;
}

.card-button:hover {
    background-color: #3367d6;
}

.favorite-button {
    display: none;
}

.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    opacity: 0;
    visibility: hidden;
    z-index: 99;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background-color: #3367d6;
    transform: translateY(-5px);
}

/* 响应式设计 */
@media screen and (max-width: 768px) {
    h1 {
        font-size: 2rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .header-buttons {
        flex-direction: column;
        gap: 0.8rem;
    }
    
    .cards-container {
        grid-template-columns: 1fr;
    }
    
    .list-view .prompt-card {
        flex-direction: column;
        padding-right: 0;
    }
    
    .tag {
        padding: 0.4rem 0.8rem;
        font-size: 0.9rem;
    }
    
    .modal-content {
        width: 95%;
    }
    
    .back-to-top {
        bottom: 1rem;
        right: 1rem;
        width: 40px;
        height: 40px;
    }
}

@media screen and (max-width: 480px) {
    .main-content {
        padding: 1.5rem 0.8rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    .search-input {
        padding: 0.8rem 0.8rem 0.8rem 2.5rem;
        font-size: 1rem;
    }
    
    .search-icon {
        left: 0.8rem;
    }
    
    .tags {
        gap: 0.5rem;
    }
    
    .view-control {
        width: 36px;
        height: 36px;
    }
}

/* 列表/网格视图切换 */
.grid-view {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

@media (min-width: 1200px) {
    .grid-view {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (min-width: 992px) and (max-width: 1199px) {
    .grid-view {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 768px) and (max-width: 991px) {
    .grid-view {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 767px) {
    .grid-view {
        grid-template-columns: 1fr;
    }
}

.list-view {
    grid-template-columns: 1fr;
}

.list-view .prompt-card {
    flex-direction: row;
}

.list-view .card-content {
    display: flex;
    flex-direction: row;
    align-items: center;
    padding: 16px 24px;
}

.list-view .card-header, 
.list-view .card-description,
.list-view .card-footer {
    padding: 0 16px;
}

.list-view .card-header {
    width: 25%;
    margin-bottom: 0;
}

.list-view .card-description {
    width: 45%;
    margin-bottom: 0;
}

.list-view .card-footer {
    width: 30%;
    margin-top: 0;
}

/* 修复卡片中按钮的样式 */
.copy-prompt-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background-color 0.3s;
    display: flex;
    align-items: center;
    gap: 4px;
}

.copy-prompt-btn:hover {
    background-color: #3367d6;
}

.view-details-btn {
    background-color: transparent;
    border: none;
    color: var(--primary-color);
    padding: 6px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.view-details-btn:hover {
    background-color: var(--active-tag-bg);
}

/* 加载时的占位卡片 */
.placeholder-card {
    background-color: #f5f5f5;
    border-radius: 12px;
    height: 200px;
    animation: pulse 1.5s infinite alternate;
}

@keyframes pulse {
    0% {
        opacity: 0.6;
    }
    100% {
        opacity: 1;
    }
}

/* AI绘图提示词卡片样式 */
.image-prompt-card {
    display: flex;
    flex-direction: column;
    background-color: white;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px var(--shadow-color);
    margin-bottom: 20px;
    break-inside: avoid;
}

.image-prompt-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.image-prompt-thumbnail {
    width: 100%;
    height: 180px;
    overflow: hidden;
    position: relative;
}

.image-prompt-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.image-prompt-card:hover .image-prompt-thumbnail img {
    transform: scale(1.05);
}

.image-prompt-content {
    padding: 15px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.image-prompt-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--dark-color);
}

.image-prompt-text {
    font-size: 0.9rem;
    color: var(--text-color);
    margin-bottom: 1rem;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    line-height: 1.5;
    flex: 1;
}

.image-prompt-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
}

.image-prompt-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 10px;
}

.image-prompt-tag {
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 50px;
    background-color: var(--active-tag-bg);
    color: var(--active-tag-color);
}

/* 绘图提示词分类标签样式 */
.drawing-tags-container {
    overflow-x: auto;
    padding-bottom: 0.5rem;
    display: none;
}

.drawing-tags-container.active {
    display: block;
}

/* 修改模态框中的图片样式 */
.modal-image {
    width: 100%;
    max-height: 400px;
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #f5f5f5;
    border-radius: 8px;
    overflow: hidden;
}

.modal-image img {
    max-width: 100%;
    max-height: 400px;
    object-fit: contain;
    display: block;
}

/* 调整提示词文本区域 */
.modal-prompt-text {
    white-space: pre-wrap;
    font-family: monospace;
    background-color: #f7f7f7;
    padding: 15px;
    border-radius: 8px;
    max-height: 200px;
    overflow-y: auto;
    font-size: 0.9rem;
    line-height: 1.5;
} 