/* ========== 1. 全局重置与基础变量 ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 全站配色变量，想改颜色直接改这里就行 */
:root {
    --bg-color: #f8f7f4;        /* 暖米白背景 */
    --card-bg: #ffffff;         /* 卡片白底 */
    --text-main: #111827;       /* 主标题深黑 */
    --text-sub: #6b7280;        /* 辅助文字中灰 */
    --text-light: #9ca3af;      /* 最弱文字浅灰 */
    --border-color: #e5e7eb;    /* 边框分割线 */
    --primary-color: #d97706;   /* 主按钮橙棕色 */
    --accent-color: #0ea5e9;    /* 高亮天蓝色 */
    --shadow: 0 4px 12px rgba(0,0,0,0.06);
    --shadow-hover: 0 8px 24px rgba(0,0,0,0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: inherit;
}

/* ========== 2. 顶部导航栏（全站通用） ========== */
.nav-bar {
    background-color: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-main);
}

.nav-menu {
    display: flex;
    gap: 32px;
    list-style: none;
}

.nav-menu li a {
    font-size: 15px;
    color: var(--text-sub);
    padding: 20px 0;
    position: relative;
    transition: color 0.2s;
}

/* 当前页面导航高亮 */
.nav-menu li a.active {
    color: var(--text-main);
    font-weight: 500;
}

.nav-menu li a.active::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--text-main);
}

.nav-menu li a:hover {
    color: var(--text-main);
}

/* ========== 3. 页面通用容器 ========== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

.page-header {
    text-align: center;
    margin-bottom: 40px;
}

.page-title {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 12px;
}

.page-desc {
    color: var(--text-sub);
    font-size: 15px;
    max-width: 600px;
    margin: 0 auto;
}

/* ========== 4. 筛选工具栏 ========== */
.filter-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.filter-left {
    display: flex;
    gap: 12px;
}

.filter-btn {
    padding: 8px 16px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    color: var(--text-sub);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-btn.active {
    background: var(--text-main);
    color: #fff;
    border-color: var(--text-main);
}

.filter-right {
    display: flex;
    gap: 12px;
    align-items: center;
    color: var(--text-sub);
    font-size: 14px;
}

/* 搜索框样式 */
.search-input {
    padding: 8px 14px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    color: var(--text-main);
    font-size: 14px;
    outline: none;
    transition: all 0.2s;
    width: 200px;
}

.search-input:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(14, 165, 233, 0.15);
}

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

/* ========== 5. 瀑布流卡片通用样式 ========== */
.masonry-grid {
    column-count: 4;
    column-gap: 16px;
}

.prompt-card {
    break-inside: avoid;
    margin-bottom: 16px;
    background: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: var(--shadow);
}

.prompt-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.prompt-card img {
    width: 100%;
    display: block;
}

.cover-placeholder {
    width: 100%;
    aspect-ratio: 16/10;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    padding: 12px;
    text-shadow: 0 1px 3px rgba(0,0,0,0.3);
    min-height: 160px;
}

.card-bottom {
    padding: 12px 14px;
}

.card-title {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 6px;
}

.card-tag {
    display: inline-block;
    padding: 2px 8px;
    background: #f3f4f6;
    border-radius: 12px;
    font-size: 12px;
    color: var(--text-sub);
}

.video-badge {
    font-size: 11px;
    color: #fff;
    background: #ef4444;
    padding: 2px 8px;
    border-radius: 999px;
    font-weight: 600;
    margin-left: 6px;
}

/* ========== 6. 详情弹窗样式 ========== */
.modal-mask {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 999;
    padding: 20px;
}

.modal-mask.show {
    display: flex;
}

.modal-container {
    width: 100%;
    max-width: 1000px;
    background: var(--bg-color);
    border-radius: 16px;
    display: flex;
    overflow: hidden;
    position: relative;
    max-height: 90vh;
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 16px;
    font-size: 28px;
    cursor: pointer;
    color: var(--text-sub);
    z-index: 10;
    line-height: 1;
}

.modal-close:hover {
    color: var(--text-main);
}

/* 左侧图片区 */
.modal-left {
    width: 50%;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-left img {
    width: 100%;
    max-height: 90vh;
    object-fit: contain;
}

.modal-left video {
    width: 100%;
    height: 100%;
    max-height: 90vh;
    object-fit: contain;
    background: #000;
}

/* 右侧信息区 */
.modal-right {
    width: 50%;
    padding: 40px 30px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    overflow-y: auto;
}

.modal-category {
    color: var(--accent-color);
    font-size: 13px;
    font-weight: 500;
}

.modal-title {
    font-size: 22px;
    font-weight: 600;
    line-height: 1.4;
}

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

.modal-tags span {
    padding: 4px 10px;
    background: #f3f4f6;
    border-radius: 20px;
    font-size: 12px;
    color: var(--text-sub);
}

.prompt-box {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--card-bg);
}

.prompt-header {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    color: var(--text-sub);
}

.copy-btn-small {
    border: none;
    background: transparent;
    color: var(--accent-color);
    cursor: pointer;
    font-size: 13px;
}

#modalPrompt {
    width: 100%;
    height: 220px;
    border: none;
    padding: 14px;
    font-size: 13px;
    line-height: 1.7;
    resize: none;
    outline: none;
    font-family: "Consolas", "Monaco", monospace;
    color: var(--text-main);
}

.copy-btn-main {
    width: 100%;
    padding: 12px;
    background: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    cursor: pointer;
    margin-top: auto;
    transition: background 0.2s;
}

.copy-btn-main:hover {
    background: #b45309;
}

/* ========== 7. 工具卡片网格样式 ========== */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.tool-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--shadow);
    transition: all 0.25s ease;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.tool-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.tool-logo {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 700;
    color: var(--primary-color);
}

.tool-name {
    font-size: 16px;
    font-weight: 600;
}

.tool-desc {
    font-size: 13px;
    color: var(--text-sub);
    line-height: 1.5;
    flex: 1;
}

.tool-link {
    text-align: center;
    padding: 8px;
    color: var(--primary-color);
    font-size: 14px;
    font-weight: 500;
    border-top: 1px solid var(--border-color);
    padding-top: 12px;
}

/* ========== 8. 首页专区入口卡片 ========== */
.home-entries {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-top: 40px;
}

.entry-card {
    background: var(--card-bg);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    cursor: pointer;
}

.entry-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-hover);
}

.entry-cover {
    height: 160px;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    color: #fff;
}

.entry-card:nth-child(2) .entry-cover {
    background: linear-gradient(135deg, #0ea5e9, #0284c7);
}

.entry-card:nth-child(3) .entry-cover {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
}

.entry-content {
    padding: 20px;
}

.entry-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 8px;
}

.entry-desc {
    font-size: 14px;
    color: var(--text-sub);
}

/* ========== 9. 最近上传作品区块 ========== */
.recent-works-section {
    margin-top: 60px;
}

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

.section-title {
    font-size: 24px;
    font-weight: 700;
}

.view-more-link {
    font-size: 14px;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.view-more-link:hover {
    color: var(--accent-color);
}

/* 首页作品搜索栏 */
.home-search-bar {
    display: flex;
    justify-content: center;
    margin-bottom: 24px;
}

.home-search-bar .search-input {
    width: 100%;
    max-width: 400px;
}

/* 首页作品卡片 */
.home-work-card {
    break-inside: avoid;
    margin-bottom: 16px;
    background: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.25s ease;
    box-shadow: var(--shadow);
    cursor: pointer;
}

.home-work-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.home-work-card img {
    width: 100%;
    display: block;
}

.home-card-info {
    padding: 10px 12px;
}

.home-card-title {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-main);
    display: block;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

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

.home-card-tag {
    display: inline-block;
    padding: 2px 8px;
    background: #f3f4f6;
    border-radius: 12px;
    font-size: 11px;
    color: var(--text-sub);
}

/* 来源标签（图片/视频）样式区分 */
.type-badge-image {
    background: #dbeafe;
    color: #1e40af;
}

.type-badge-video {
    background: #fce7f3;
    color: #9d174d;
}

/* ========== 9. 页脚 ========== */
.footer {
    border-top: 1px solid var(--border-color);
    margin-top: 60px;
    padding: 40px 0;
    background: var(--card-bg);
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 32px;
}

.footer-logo {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 12px;
}

.footer-desc {
    color: var(--text-sub);
    font-size: 14px;
    max-width: 300px;
}

.footer-column h4 {
    font-size: 15px;
    margin-bottom: 16px;
    font-weight: 600;
}

.footer-column ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.footer-column ul li a {
    font-size: 14px;
    color: var(--text-sub);
    transition: color 0.2s;
}

.footer-column ul li a:hover {
    color: var(--text-main);
}

.footer-bottom {
    max-width: 1200px;
    margin: 32px auto 0;
    padding: 24px 20px 0;
    border-top: 1px solid var(--border-color);
    text-align: center;
    color: var(--text-light);
    font-size: 13px;
}

/* ========== 10. 响应式适配（手机/平板） ========== */
@media (max-width: 992px) {
    .masonry-grid { column-count: 3; }
    .tools-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
    .masonry-grid { column-count: 2; }
    .tools-grid { grid-template-columns: repeat(2, 1fr); }
    .home-entries { grid-template-columns: 1fr; }
    
    .modal-container { flex-direction: column; }
    .modal-left, .modal-right { width: 100%; }
    .modal-left { max-height: 40vh; }
    
    .nav-menu { gap: 16px; }
    .nav-menu li a { font-size: 14px; }
    
    .page-title { font-size: 24px; }
}

@media (max-width: 480px) {
    .masonry-grid { column-count: 1; }
    .tools-grid { grid-template-columns: 1fr; }
}