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

:root {
    --bg: #f6f6f6;
    --text: #222;
    --muted: #666;
    --card: #ffffff;
    --accent: #2c7be5;
    --border: #e5e5e8;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.65;
}

a {
    color: var(--accent);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.container {
    max-width: 980px;
    margin: 0 auto;
    padding: 0 18px;
}

/* Global Navigation */
.global-nav {
    background: #fff;
    border-bottom: 1px solid #e5e5e8;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 1rem 0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.global-nav .nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    gap: 2rem;
}

.global-nav-item {
    color: #666;
    text-decoration: none;
    font-size: 1rem;
    font-weight: 500;
    transition: color 0.2s;
    padding: 0.5rem 0;
}

.global-nav-item:hover {
    color: #2c7be5;
}

.global-nav-item.active {
    color: #2c7be5;
    font-weight: 600;
}

/* Header */
.header {
    background: #fff;
    color: var(--text);
    padding: 28px 0 14px;
    text-align: center;
    border-bottom: 1px solid var(--border);
}

.logo {
    font-size: 2.1rem;
    font-weight: 800;
    margin-bottom: 8px;
    letter-spacing: 0.2px;
}

.tagline {
    font-size: 1.05rem;
    opacity: 0.85;
    color: var(--muted);
}

/* Navbar */
.navbar {
    background: #fff;
    border-bottom: 1px solid var(--border);
    padding: 12px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-content {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.nav-item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.8em 1.2em;
    text-decoration: none;
    color: #fff;
    border-radius: 30px;
    transition: background 0.2s ease;
    font-size: 0.95rem;
    font-weight: 500;
    border: none;
    background: rgba(29,43,76,0.85);
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(29,43,76,0.08);
}

.nav-item:hover {
    background: rgba(29,43,76,1);
    color: #fff;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(29,43,76,0.12);
}

.nav-item.active {
    background: rgba(29,43,76,1);
    color: #fff;
    box-shadow: 0 2px 8px rgba(29,43,76,0.12);
}

/* Main */
.main {
    padding: 30px 0;
    min-height: calc(100vh - 300px);
}

/* Search */
.search-box {
    margin-bottom: 16px;
}

.header-search {
    margin-top: 12px;
    display: block;
}

.search-box form {
    display: flex;
    gap: 10px;
    max-width: 720px;
    margin: 0 auto;
}

.search-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid var(--border);
    background: #fff;
    color: var(--text);
    border-radius: 12px;
    font-size: 1rem;
    transition: border-color 0.15s, background 0.15s;
    box-shadow: none;
}

.search-input:focus {
    outline: none;
    border-color: var(--accent);
    background: #fff;
}

.search-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.8em 1.6em;
    background: rgba(29,43,76,0.85);
    color: #fff;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    transition: background 0.2s ease;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(29,43,76,0.08);
}

.search-btn:hover {
    background: rgba(29,43,76,1);
    color: #fff;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(29,43,76,0.12);
}

.search-result {
    margin-bottom: 20px;
    color: var(--muted);
}

/* Prompt Grid */
.prompt-grid {
    column-count: 3;
    column-gap: 18px;
    margin-bottom: 40px;
}

.prompt-card {
    display: block;
    width: 100%;
    break-inside: avoid;
    -webkit-column-break-inside: avoid;
    -moz-column-break-inside: avoid;
    page-break-inside: avoid;
    margin-bottom: 18px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.04);
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
    will-change: transform;
    backface-visibility: hidden;
}

.prompt-card:hover {
    transform: translate3d(0, -3px, 0);
    box-shadow: 0 10px 28px rgba(0,0,0,0.08);
    border-color: #d9dce3;
}

.prompt-card.match {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(44,123,229,0.14);
}

.prompt-thumb {
    width: 100%;
    border-radius: 10px;
    overflow: hidden;
    background: #f3f3f3;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 200px;
}

.prompt-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.prompt-thumb.detail { height: auto; }
.prompt-thumb.detail img {
    width: 100%;
    height: auto;
    max-height: 560px;
    object-fit: contain;
    opacity: 1; /* 详情页直接显示，避免 fade-in 默认透明 */
}

.fade-in { opacity: 0; transition: opacity 300ms ease; }
.fade-in.loaded { opacity: 1; }

.prompt-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 10px;
    gap: 10px;
}

.prompt-title {
    font-size: 1.08rem;
    margin: 0;
    flex: 1;
}

.prompt-title a {
    color: #1f2933;
    text-decoration: none;
    transition: opacity 0.15s, color 0.15s;
}

.prompt-title a:hover {
    color: var(--accent);
}

.prompt-category {
    background: #f6f8fc;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 0.82rem;
    color: #1f2933;
    border: 1px solid #e1e6ef;
    white-space: nowrap;
}

.prompt-desc {
    color: #3b3b3b;
    margin-bottom: 10px;
    line-height: 1.6;
    word-break: break-word;
    overflow-wrap: anywhere;
    display: -webkit-box;
    line-clamp: 3;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.prompt-meta {
    display: flex;
    gap: 12px;
    font-size: 0.88rem;
    color: #7a7a7a;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.card-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 12px;
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0.8em 1.2em;
    border-radius: 30px;
    border: none;
    background: rgba(29,43,76,0.85);
    color: #fff;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: background 0.2s ease;
    text-decoration: none;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(29,43,76,0.08);
}

.btn-icon:hover {
    background: rgba(29,43,76,1);
    color: #fff;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(29,43,76,0.12);
}

.like-btn[aria-pressed="true"] {
    border-color: #5b7cff;
    background: #e8edff;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--muted);
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 40px;
    flex-wrap: wrap;
}

.page-link {
    padding: 10px 14px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    text-decoration: none;
    color: #3a3a3a;
    transition: all 0.15s;
}

.page-link:hover {
    background: #f4f7ff;
    border-color: var(--accent);
    color: #1a3f74;
}

.page-link.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

/* Detail Page */
.detail-page {
    max-width: 900px;
    margin: 0 auto;
    background: #fff;
    border-radius: 14px;
    padding: 32px;
    border: 1px solid var(--border);
    box-shadow: 0 12px 32px rgba(0,0,0,0.06);
}

.back-link {
    display: inline-block;
    margin-bottom: 20px;
    color: var(--accent);
    text-decoration: none;
    font-size: 0.95rem;
    transition: opacity 0.2s;
}

.back-link:hover {
    text-decoration: underline;
}

.detail-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.detail-title {
    font-size: 1.9rem;
    margin: 12px 0;
    color: var(--text);
}

.detail-meta {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 12px;
}

.meta-badge {
    background: #f4f7ff;
    color: #1f2933;
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 0.9rem;
    border: 1px solid #e1e6ef;
}

.detail-description {
    margin-bottom: 30px;
    padding: 20px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    color: var(--muted);
    line-height: 1.8;
}

.prompt-content {
    margin-bottom: 30px;
}

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

.content-header h2 {
    font-size: 1.2rem;
    color: var(--text);
}

.copy-btn {
    padding: 9px 16px;
    background: var(--accent);
    color: #fff;
    border: 1px solid var(--accent);
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.15s, border-color 0.15s, opacity 0.2s;
}

.copy-btn:hover {
    background: #2268c8;
    border-color: #2268c8;
}

.content-box {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    line-height: 1.75;
    color: var(--text);
    white-space: pre-wrap;
    word-wrap: break-word;
}

.detail-tags {
    margin-bottom: 30px;
}

.detail-tags h3 {
    font-size: 1.05rem;
    margin-bottom: 12px;
    color: var(--text);
}

.tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag {
    background: rgba(255,255,255,0.05);
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 0.88rem;
    color: var(--muted);
    border: 1px solid rgba(255,255,255,0.08);
}

.detail-actions {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.08);
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.8em 2.2em;
    border-radius: 30px;
    background: rgba(29,43,76,0.85);
    color: #fff;
    text-decoration: none;
    font-weight: 500;
    font-size: 1.1rem;
    line-height: 1.5;
    cursor: pointer;
    transition: background 0.2s ease;
    border: none;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(29,43,76,0.08);
}

.btn-secondary:hover {
    background: rgba(29,43,76,1);
    color: #fff;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(29,43,76,0.12);
}

/* Footer */
.footer {
    background: #fff;
    color: #666;
    padding: 30px 0;
    text-align: center;
    margin-top: 60px;
    border-top: 1px solid #eee;
}

.footer p {
    margin: 5px 0;
}

.floating-top {
    position: fixed;
    right: 24px;
    bottom: 24px;
    padding: 10px 14px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.06);
    color: var(--text);
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transition: opacity 200ms ease;
}

.floating-top.visible {
    opacity: 1;
    pointer-events: auto;
}

/* Responsive */
@media (max-width: 768px) {
    .logo {
        font-size: 2rem;
    }
    .container { padding: 0 14px; }
    .prompt-grid { column-count: 1; }
    
    .detail-page {
        padding: 20px;
    }
    
    .detail-title {
        font-size: 1.6rem;
    }
    
    .search-box form {
        flex-direction: column;
    }
}

@media (min-width: 768px) and (max-width: 1023px) {
    .container { padding: 0 16px; }
    .prompt-grid { column-count: 2; }
}

@media (min-width: 1024px) and (max-width: 1399px) {
    .prompt-grid { column-count: 3; }
}

@media (min-width: 1400px) {
    .prompt-grid { column-count: 4; }
}
.skeleton-card {
    display: block;
    width: 100%;
    height: 180px;
    border-radius: 14px;
    margin-bottom: 20px;
    break-inside: avoid;
    -webkit-column-break-inside: avoid;
    -moz-column-break-inside: avoid;
    background: linear-gradient(90deg, #f0f0f0 0%, #e9e9e9 50%, #f0f0f0 100%);
    background-size: 200% 100%;
    animation: pulse 1.2s linear infinite;
}

@keyframes pulse {
    0% { background-position: 0% 0%; }
    100% { background-position: 200% 0%; }
}
.prompt-thumb.is-placeholder .placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, #f0f0f0 0%, #e9e9e9 50%, #f0f0f0 100%);
    background-size: 200% 100%;
    animation: pulse 1.2s linear infinite;
}
.prompt-card.appear {
    transform: translate3d(0, -2px, 0);
    box-shadow: 0 10px 26px rgba(0,0,0,0.12);
}
