/* ========== 1. 容器与布局 ========== */
.plaza-container {
    padding: 10px 40px; /* 保持你要求的：顶部紧凑，左右宽敞 */
    max-width: 100%;
    margin: 0;
}

/* ========== 2. 搜索栏 (颜色适配深灰蓝) ========== */
.search-section {
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
}
.search-bar {
    display: flex;
    align-items: center;
    background-color: #1a1a20; /* 🔥 变色：不再是死黑，而是深炭色 */
    border: 1px solid #2f2f3d; /* 边框变淡 */
    border-radius: 50px;
    padding: 4px 15px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 600px; 
}
.search-icon { color: #888; margin-right: 10px; font-size: 14px; }
.search-bar input {
    flex: 1;
    background: transparent;
    border: none;
    color: #e0e0e0; /* 字体更亮 */
    font-size: 14px;
    padding: 8px 0;
    outline: none;
    min-width: 0;
}
.btn-search {
    background-color: #6c5ce7;
    color: white;
    border: none;
    border-radius: 20px;
    padding: 6px 18px;
    cursor: pointer;
    font-weight: bold;
    font-size: 13px;
    transition: 0.3s;
    white-space: nowrap; 
    flex-shrink: 0;      
}
.btn-search:hover { background-color: #5649c0; }

/* ========== 3. 筛选区 (颜色适配) ========== */
.filter-section {
    margin-bottom: 25px;
    padding: 0 5px;
}
.filter-row {
    display: flex;
    align-items: center; 
    margin-bottom: 10px;
}
.filter-label {
    width: 70px; 
    color: #b0bec5; /* 标签文字灰白，更柔和 */
    font-size: 14px;
    font-weight: bold;
    flex-shrink: 0; 
}
.filter-options {
    flex: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 8px; 
}
.tag {
    padding: 4px 12px;
    border-radius: 20px;
    background-color: #23232a; /* 🔥 变色：标签底色改为深灰 */
    color: #a0a0a0;
    font-size: 12px;
    cursor: pointer;
    transition: 0.2s;
    border: 1px solid #373740;
    white-space: nowrap; 
}
.tag:hover { background-color: #373740; color: white; }
.tag.active {
    background-color: #6c5ce7; 
    color: white;
    border-color: #6c5ce7;
}

/* ========== 4. 卡片网格区 ========== */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); 
    gap: 20px;
}

.bot-card {
    background-color: #1e1e24; /* 🔥 变色：给卡片加一点点背景，区分层次 */
    border: 1px solid #2f2f3d; /* 微弱边框 */
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    flex-direction: column;
}
.bot-card:hover { 
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.3);
    border-color: #6c5ce7; /* 悬停时边框变紫 */
}

.card-cover {
    height: 180px; 
    width: 100%;
    position: relative;
    border-radius: 12px; /* 保持图片圆角 */
    overflow: hidden;
    margin-bottom: 8px;
}
.card-cover img {
    width: 100%; height: 100%; object-fit: cover;
    transition: transform 0.5s;
}
.bot-card:hover .card-cover img { transform: scale(1.05); }

.card-likes {
    position: absolute;
    top: 8px; right: 8px; 
    background: rgba(0,0,0,0.6);
    color: #45aaf2; 
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    backdrop-filter: blur(2px);
}

.card-body { 
    padding: 0 8px 8px 8px; /*稍微多一点内边距 */
    flex: 1;
    display: flex;
    flex-direction: column;
}
.card-title {
    font-size: 15px; 
    font-weight: bold;
    margin-bottom: 4px; 
    color: #f5f5f5;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.card-desc {
    font-size: 12px; color: #888;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden; 
    line-height: 1.4; 
    height: 34px;
    margin-bottom: 6px;
}

.card-footer {
    display: flex; justify-content: space-between; align-items: center;
    margin-top: auto; 
    padding-top: 4px;
    border-top: 1px solid #2f2f3d;
    padding-left: 8px;
    padding-right: 16px;/* 加一条淡淡的分隔线 */
}
.author-info { display: flex; align-items: center; gap: 6px; }
.author-avatar { width: 26px; height: 26px; border-radius: 50%; border: 1px solid #444; }
.author-name { font-size: 13px; color: #ccc; margin-left: 4px; }
.card-stats { font-size: 13px; color: #45aaf2; }
/* ✅【新增】卡片内部标签的样式 */
.card-tags {
    padding: 0 10px 8px 10px; /* 位置调整 */
    display: flex;
    flex-wrap: wrap;
    gap: 6px; /* 标签之间的间距 */
    margin-top: -4px; /* 稍微向上拉一点，紧凑 */
}

.card-tag {
    background-color: #2c2c35; /* 深灰底色 */
    color: #aebbf0; /* 淡紫色文字，清晰可见 */
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 4px;
    border: 1px solid #3f3f5f;
    white-space: nowrap;
}

/* 修改后的字数显示样式 - 仿文件图标风格 */
.card-word-count {
    margin-left: auto;
    font-size: 12px;
    /* 字体颜色：使用高亮的灰白色，比纯灰更显眼 */
    color: #e3e3e3;    
    display: flex;
    align-items: center;
    gap: 5px;          
    /* 背景色：深色半透明，增加对比度 */
    background: rgba(255, 255, 255, 0.1); 
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 3px 8px;
    border-radius: 6px;
    font-weight: 500;
}

/* 专门控制那个文件图标的颜色 */
.card-word-count i {
    /* 使用淡紫色或亮灰色，配合你的主题 */
    color: #aebbf0; 
    font-size: 13px;
}

/* ========== 🔥 5. 手机端适配 (Mobile) ========== */
@media (max-width: 768px) {
    .plaza-container {
        padding: 10px 15px; 
    }

    .search-bar { padding: 4px 10px; }
    .search-bar input { font-size: 13px; }
    .btn-search { padding: 5px 12px; font-size: 12px; }

    .filter-row {
        flex-direction: column; 
        align-items: flex-start;
        margin-bottom: 15px;
    }
    .filter-label {
        margin-bottom: 8px; 
        color: #7986cb; 
    }
    .filter-options {
        width: 100%;
        overflow-x: auto; 
        padding-bottom: 5px; 
        flex-wrap: nowrap; /* 手机上一行滑过去 */
    }
    .tag {
        font-size: 11px;
        padding: 4px 10px;
        flex-shrink: 0;
    }

    .cards-grid {
        grid-template-columns: repeat(2, 1fr); 
        gap: 10px;
    }
    .card-cover { height: 120px; }
    .card-title { font-size: 13px; }
    .card-desc { display: none; }
}

/* ========== 6. 弹窗 (重构版 - 上下分层) ========== */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.7); backdrop-filter: blur(5px);
    z-index: 999;
    display: flex; justify-content: center; align-items: center;
}
.modal-overlay.hidden { display: none; }

.bot-modal-container {
    background: #1e1e24;
    width: 800px; /* 稍微宽一点 */
    max-width: 90%;
    height: 80vh; /* 🔥 关键：固定高度，占屏幕80% */
    border-radius: 16px;
    border: 1px solid #3f3f5f;
    box-shadow: 0 20px 50px rgba(0,0,0,0.8);
    display: flex;
    flex-direction: column; /* 垂直布局 */
    position: relative;
    overflow: hidden;
}

/* --- 上半区 Header --- */
.bot-modal-header {
    height: 240px; /* 固定高度 */
    flex-shrink: 0; /* 防止被压缩 */
    background-size: cover; 
    background-position: center;
    position: relative;
}
.header-overlay {
    background: linear-gradient(to top, #1e1e24 5%, rgba(30,30,36,0.3) 100%);
    width: 100%; height: 100%;
    padding: 25px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end; /* 内容沉底 */
    position: relative;
}

.bot-big-title { 
    font-size: 28px; color: white; margin: 0 0 10px 0; 
    text-shadow: 0 2px 10px rgba(0,0,0,0.8);
}
.bot-meta-row {
    display: flex; gap: 15px; color: #ddd; font-size: 13px; margin-bottom: 10px;
    text-shadow: 0 1px 4px rgba(0,0,0,0.8);
}
.bot-tags-row {
    display: flex; gap: 8px; flex-wrap: wrap;
}
.modal-tag {
    background: rgba(108, 92, 231, 0.8); /* 紫色半透明 */
    color: white; padding: 2px 8px; border-radius: 4px; font-size: 11px;
    backdrop-filter: blur(4px);
}

.bot-author-badge {
    position: absolute;
    bottom: 25px; right: 25px;
    display: flex; align-items: center; gap: 8px;
    background: rgba(0,0,0,0.6);
    padding: 6px 12px;
    border-radius: 30px;
    border: 1px solid rgba(255,255,255,0.2);
}
.bot-author-badge img { width: 30px; height: 30px; border-radius: 50%; }
.bot-author-badge span { color: white; font-size: 13px; font-weight: bold; }

.modal-close {
    position: absolute; top: 15px; right: 15px;
    color: rgba(255,255,255,0.7); font-size: 28px; cursor: pointer; z-index: 10;
}
.modal-close:hover { color: white; }

/* --- 下半区 Body (滚动核心) --- */
.bot-modal-body {
    flex: 1; /* 占据剩余空间 */
    overflow-y: auto; /* 🔥 关键：内容超出时显示滚动条 */
    padding: 25px;
    background: #1e1e24;
}

/* 滚动条美化 */
.bot-modal-body::-webkit-scrollbar { width: 6px; }
.bot-modal-body::-webkit-scrollbar-thumb { background: #3f3f5f; border-radius: 3px; }
.bot-modal-body::-webkit-scrollbar-track { background: #1e1e24; }

.info-block { margin-bottom: 25px; }
.block-title {
    color: #6c5ce7; font-weight: bold; font-size: 15px; margin-bottom: 10px;
    border-left: 3px solid #6c5ce7; padding-left: 8px;
}
.block-content {
    color: #b0bec5; font-size: 14px; line-height: 1.6;
}
/* 详细设定区域样式增强 */
.detail-html-box {
    background: #23232a;
    padding: 15px; border-radius: 8px;
    border: 1px solid #2f2f3d;
}

/* --- 底部 Footer (悬浮按钮) --- */
.bot-modal-footer {
    padding: 15px 25px;
    border-top: 1px solid #2f2f3d;
    background: #1e1e24;
}
.btn-start-chat {
    width: 100%; padding: 14px; 
    background: #6c5ce7; color: white; border: none; border-radius: 8px; 
    font-size: 16px; font-weight: bold; cursor: pointer;
    transition: 0.2s;
}
.btn-start-chat:hover { background: #5649c0; transform: translateY(-2px); }