/* 全局暗黑背景 */
body { 
    background: #121212; 
    color: #e0e0e0; 
    margin: 0; 
    font-family: 'Microsoft YaHei', sans-serif; 
}

/* ==============================
   1. 电脑端 (Desktop) 默认样式 
   ============================== */

/* Header 样式 */
header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(26, 26, 26, 0.95); 
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    
    padding: 25px 40px 25px 40px; 
    
    display: flex; 
    justify-content: space-between; 
}

.header-left { flex: 1; margin-right: 40px; }

.gradient-title {
    background: linear-gradient(90deg, #FFC300, #FF5733);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    margin: 0 0 8px 0; 
    font-size: 32px; 
    font-weight: 800;
}

.header-subtitle {
    font-size: 17px;
    color: #999; 
    margin: 0 0 20px 0; 
    font-weight: 400;
    letter-spacing: 0.5px;
    line-height: 1.5;
}

/* 搜索区域 */
.search-area { 
    display: flex; 
    flex-direction: column; 
    gap: 22px; 
    width: 100%;
    margin-bottom: 0; 
}

#searchInput {
    padding: 0 12px; 
    background: #333; border: 1px solid #555; 
    color: #fff; border-radius: 5px; 
    width: 100%; 
    max-width: 450px;
    outline: none;
    font-size: 14px; 
    height: 30px;   
    line-height: 30px;
}

/* 标签行容器 */
.tags-wrapper {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    width: 100%;
}

/* 标签列表 */
#tagFilters {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    flex: 1; 
    max-height: 30px; 
    overflow: hidden;
    transition: max-height 0.3s ease;
}

#tagFilters.expanded { max-height: 500px; }

.tag-btn {
    background: #2a2a2a; border: 1px solid #444; color: #aaa;
    padding: 4px 12px; font-size: 13px; cursor: pointer; 
    border-radius: 20px; transition: 0.3s; white-space: nowrap; 
    height: 28px; box-sizing: border-box;
}
.tag-btn.active, .tag-btn:hover { background: #FF5733; color: #fff; border-color: #FF5733; }

.tag-toggle-btn {
    background: transparent; border: none; color: #FF5733;
    font-size: 13px; cursor: pointer; padding: 5px 0; 
    height: 28px; display: flex; align-items: center;
    font-weight: bold; white-space: nowrap; flex-shrink: 0; 
}

/* 广告位样式 */
.header-ad {
    display: flex;
    flex-direction: row; 
    align-items: center;
    gap: 12px; 
    
    position: absolute; 
    right: 40px; 
    top: 15px; 
}

.ad-item {
    display: block; 
    width: 500px; 
    height: 130px;  
    background: #222; border-radius: 6px; overflow: hidden;
    position: relative; transition: 0.3s;
    text-decoration: none; border: 1px solid transparent; 
}
.ad-item:hover { border-color: #FF5733; transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.3); }
.ad-item img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* 列表布局 */
#gridContainer {
    display: grid; grid-template-columns: repeat(6, 1fr); 
    gap: 20px; 
    padding: 10px 30px 30px 30px; 
    margin-top: 10px; 
}
/* 响应式网格 */
@media(max-width:1600px){ #gridContainer{grid-template-columns: repeat(5,1fr);} }
@media(max-width:1400px){ #gridContainer{grid-template-columns: repeat(4,1fr);} }
@media(max-width:1100px){ #gridContainer{grid-template-columns: repeat(3,1fr);} }
@media(max-width:800px){ #gridContainer{grid-template-columns: repeat(2,1fr);} }

/* === 核心动效 === */
@keyframes fadeInUp {
    from { opacity: 0; margin-top: 50px; }
    to { opacity: 1; margin-top: 0; }
}

.card {
    background: #1e1e1e; border-radius: 10px; overflow: hidden; 
    border: 1px solid #333; cursor: pointer; 
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    animation: fadeInUp 0.6s ease-out forwards; opacity: 0; 
}
.card:hover { 
    border-color: #FFC300; transform: translateY(-8px); 
    box-shadow: 0 15px 30px rgba(255, 195, 0, 0.15), 0 5px 15px rgba(0,0,0,0.5); 
}
.card img { width: 100%; aspect-ratio: 1/1; object-fit: cover; transition: transform 0.5s ease; }
.card:hover img { transform: scale(1.05); }
.card-info { padding: 12px; }
.c-title { font-weight: bold; margin-bottom: 8px; font-size: 15px; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;}
.c-tag { font-size: 12px; color: #888; background: #252525; padding: 3px 6px; border-radius: 4px; }


/* ==============================
   2. 移动端 (Mobile) 深度优化 
   ============================== */
@media (max-width: 768px) {
    header { flex-direction: column; padding: 15px; position: relative; height: auto; }
    .header-left { margin-right: 0; width: 100%; margin-bottom: 15px; }
    .gradient-title { font-size: 24px; margin-bottom: 5px; }
    .header-subtitle { font-size: 13px; margin-bottom: 15px; }
    #searchInput { max-width: 100%; }
    .header-ad {
        position: static; width: 100%; margin-top: 15px; margin-bottom: 0;
        display: flex; flex-direction: row; overflow-x: auto; padding-bottom: 5px; justify-content: flex-start; 
    }
    .ad-item { width: 100%; height: auto; aspect-ratio: 500 / 130; flex-shrink: 0; }
    #gridContainer { grid-template-columns: repeat(2, 1fr) !important; gap: 10px; padding: 15px; }
    .modal-content { width: 90%; height: 85vh; border-radius: 12px; }
    .modal-scroll-inner { padding: 20px; }
}


/* ==============================
   3. 通用样式 (弹窗、滚动条等)
   ============================== */
.modal { 
    display: none; position: fixed; top:0; left:0; width:100%; height:100%; 
    background: rgba(0,0,0,0.85); z-index: 999; backdrop-filter: blur(5px);
    animation: fadeInBg 0.3s ease-out;
}
@keyframes fadeInBg { from { opacity: 0; } to { opacity: 1; } }

.modal-content {
    background: #222; width: 960px; height: 820px; 
    position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
    border-radius: 16px; border: 1px solid #444; box-shadow: 0 20px 50px rgba(0,0,0,0.9);
    display: flex; flex-direction: column; overflow: hidden; 
    animation: modalZoomIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}
@keyframes modalZoomIn {
    from { opacity: 0; transform: translate(-50%, -45%) scale(0.9); }
    to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

.modal-scroll-inner {
    padding: 40px 40px 30px 40px; 
    width: 100%; height: 100%; overflow-y: auto; box-sizing: border-box;
}
.close { 
    position: absolute; right: 20px; top: 15px; 
    font-size: 28px; color: #aaa; cursor: pointer; z-index: 20;
    width: 36px; height: 36px; text-align: center; line-height: 36px; 
    border-radius: 50%; background: rgba(0,0,0,0.3); transition: 0.3s;
}
.close:hover { background: #FF5733; color: white; transform: rotate(90deg); }

#m-title { font-size: 24px; color: #fff; font-weight: 700; line-height: 1.3; margin: 0 0 18px 0; }

/* === 修改点：弹窗内的标签样式 (橙色块) === */
.tags-container { margin-bottom: 25px; display: flex; flex-wrap: wrap; gap: 8px;}
.tags-container span { 
    display: inline-block; 
    background: #FF5733; /* 橙色背景 */
    color: #fff;         /* 白色文字 */
    padding: 4px 12px; 
    border-radius: 50px; 
    font-size: 12px;     
    font-weight: 500; 
    border: none;
}

.section-header { font-size: 18px; font-weight: 700; color: #e0e0e0; margin-bottom: 12px; padding-left: 10px; border-left: 4px solid #FF5733; }
.image-display-box { width: 100%; margin-bottom: 25px; display: flex; flex-direction: column; gap: 20px; }
.image-display-box img { display: block; width: 100%; height: auto; object-fit: contain; border-radius: 8px; border: 1px solid #444; background: #1a1a1a; }
.prompt-section { width: 100%; display: flex; flex-direction: column; gap: 20px; }
.prompt-box { background: #1a1a1a; border-radius: 8px; border: 1px solid #333; overflow: hidden; }
.pb-header { background: #252525; padding: 10px 15px; border-bottom: 1px solid #333; display: flex; justify-content: space-between; align-items: center; }
.p-label { color: #FFC300; font-size: 13px; font-weight: bold;}
.mini-copy-btn { background: #333; color: #ccc; border: 1px solid #555; padding: 4px 12px; border-radius: 4px; font-size: 12px; cursor: pointer; transition: all 0.2s; }
.mini-copy-btn:hover { background: #FF5733; color: white; border-color: #FF5733; }
.p-content { padding: 15px; color: #d0d0d0; line-height: 1.6; font-size: 14px; white-space: pre-wrap; font-family: Consolas, 'Courier New', monospace; background: #121212; }
.modal-scroll-inner::-webkit-scrollbar { width: 6px; }
.modal-scroll-inner::-webkit-scrollbar-thumb { background: #555; border-radius: 3px; }
.modal-scroll-inner::-webkit-scrollbar-track { background: transparent; }
@media(max-width: 900px), (max-height: 750px) { .modal-content { width: 95%; height: 90vh; } }
#loading { text-align: center; padding: 20px; color: #666; }

/* === 激活码全屏拦截弹窗 === */
#authOverlay {
    display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.95); z-index: 99999; backdrop-filter: blur(15px);
    justify-content: center; align-items: center; flex-direction: column;
}
.auth-box {
    background: #1e1e1e; padding: 40px; border-radius: 16px; border: 1px solid #333;
    text-align: center; width: 90%; max-width: 400px; box-shadow: 0 20px 50px rgba(0,0,0,0.8);
    animation: fadeInUp 0.5s ease-out;
}
.auth-icon { font-size: 40px; margin-bottom: 20px; }
.auth-title { font-size: 20px; font-weight: bold; color: #fff; margin-bottom: 10px; }
.auth-desc { font-size: 14px; color: #888; margin-bottom: 25px; line-height: 1.5; }
.auth-input {
    width: 100%; padding: 12px; background: #2a2a2a; border: 1px solid #444; border-radius: 8px;
    color: #fff; font-size: 16px; text-align: center; margin-bottom: 20px; outline: none; transition: 0.3s; box-sizing: border-box;
}
.auth-input:focus { border-color: #FF5733; box-shadow: 0 0 10px rgba(255, 87, 51, 0.2); }
.auth-btn {
    width: 100%; padding: 12px; background: linear-gradient(90deg, #FFC300, #FF5733);
    border: none; border-radius: 8px; color: white; font-size: 16px; font-weight: bold; cursor: pointer; transition: 0.3s;
}
.auth-btn:hover { transform: translateY(-2px); box-shadow: 0 5px 15px rgba(255, 87, 51, 0.3); }
.auth-error { color: #ff4d4f; font-size: 13px; margin-top: 15px; display: none; }