/* =========================================================
       1. 全局基础样式 (电脑端默认样式 - 硬朗风格)
       ========================================================= */
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; }
img, video { max-width: 100%; height: auto; }
.app-layout { display: flex; gap: 15px; margin-top: 20px; align-items: stretch; max-width: 100%; }

/* === 侧边栏 (电脑端：灰色背景盒子) === */
.sidebar-menu { 
        width: 220px; flex-shrink: 0; display: flex; flex-direction: column; gap: 8px; 
        background: #f8f9fa; padding: 10px; border-radius: 6px; border: 1px solid #dee2e6; height: auto; 
}
.sidebar-btn { 
        width: 100%; padding: 12px 15px; text-align: left; 
        background-color: #fff; color: #333; border: 1px solid #e0e0e0; border-radius: 4px; 
        cursor: pointer; transition: all 0.2s; font-size: 15px; 
        white-space: nowrap; overflow: hidden; text-overflow: ellipsis; 
}
.sidebar-btn:hover { background-color: #e9ecef; border-color: #b0b0b0; }
.sidebar-btn.active { background-color: #007bff; color: white; border-color: #007bff; font-weight: bold; box-shadow: 0 2px 6px rgba(0,123,255,0.3); }

/* === 内容显示区 (电脑端：带边框) === */
.content-display { flex: 1; background: #fff; border-radius: 6px; border: 1px solid #dee2e6; overflow: hidden; min-width: 0; display: flex; flex-direction: column; }
.category-panel { display: none; flex-direction: column; width: 100%; height: 100%; }
    
/* 视频 */
.video-box { display: flex; height: 500px; border-bottom: 1px solid #e7e7e7; background: #000; width: 100%; }
.player-section { flex: 1; background-color: #000; display: flex; flex-direction: column; justify-content: center; position: relative; min-width: 0; height: 100%; }
.player-section video { width: 100%; height: 100%; object-fit: contain; }
.current-playing-title {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        padding: 10px 15px;
        background: rgba(0,0,0,0.6);
        color: #fff;
        font-size: 14px;
        z-index: 10;
        display: none; 
        display: flex; 
        justify-content: space-between;
        align-items: center;
}
.next-btn {
        cursor: pointer; font-size: 13px; background: rgba(255,255,255,0.2); padding: 4px 10px; border-radius: 4px; transition: background 0.2s;
}
.next-btn:hover { background: rgba(255,255,255,0.4); }

/* 播放列表 */
.playlist-section { width: 280px; flex-shrink: 0; background-color: #f4f5f7; display: flex; flex-direction: column; border-left: 1px solid #e7e7e7; height: 100%; }
.playlist-header { padding: 10px 15px; background-color: #f4f5f7; border-bottom: 1px solid #e7e7e7; font-weight: bold; color: #333; display: flex; justify-content: space-between; align-items: center; }
.playlist-items { flex: 1; overflow-y: auto; padding: 5px 0; }
.playlist-items::-webkit-scrollbar { width: 6px; }
.playlist-items::-webkit-scrollbar-track { background: #f1f1f1; border-radius: 3px; }
.playlist-items::-webkit-scrollbar-thumb { background: #ccc; border-radius: 3px; }
.play-item { padding: 12px 15px; cursor: pointer; font-size: 13px; color: #222; display: flex; align-items: center; transition: background-color 0.2s; border-left: 3px solid transparent; overflow: hidden; }
.play-item:hover { background-color: #e1e4ea; }
.play-item.playing { background-color: #fff; color: #00a1d6; border-left-color: #00a1d6; }
.play-item .icon { margin-right: 8px; color: #999; font-size: 12px; }
.play-item.playing .icon { color: #00a1d6; }
.play-item .text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    
/* 功能按钮 */
.function-toolbar { padding: 15px 20px; background-color: #fff; display: flex; align-items: center; gap: 15px; flex-wrap: wrap; flex: 1; align-content: center; }
.func-btn { display: inline-flex; align-items: center; justify-content: center; padding: 8px 16px; background-color: #f8f9fa; color: #333; border: 1px solid #ced4da; border-radius: 4px; font-size: 14px; cursor: pointer; transition: all 0.2s; text-decoration: none; }
.func-btn:hover { background-color: #e2e6ea; border-color: #adb5bd; }
.func-btn.primary { background-color: #007bff; color: white; border-color: #007bff; }
.func-btn.primary:hover { background-color: #0056b3; }

/* === 软件区 & 留言板 === */
.full-width-zone { margin-top: 20px; background-color: #fff; border: 1px solid #dee2e6; border-radius: 6px; padding: 20px; width: 100%; }
.download-zone { border-top: 3px solid #28a745; }
.guestbook-zone { border-top: 3px solid #ffc107; }
.zone-title { font-size: 16px; font-weight: bold; color: #333; margin-bottom: 15px; display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
    
.software-search-input { padding: 6px 10px; border: 1px solid #ced4da; border-radius: 20px; font-size: 13px; outline: none; width: 200px; transition: all 0.2s; }
.software-search-input:focus { border-color: #28a745; box-shadow: 0 0 0 2px rgba(40, 167, 69, 0.1); width: 240px; }
.exe-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 15px; }
.exe-card { background: #fff; border: 1px solid #e0e0e0; border-radius: 6px; padding: 12px; display: flex; align-items: center; transition: all 0.2s; text-decoration: none; box-shadow: 0 2px 4px rgba(0,0,0,0.02); }
.exe-card:hover { border-color: #28a745; box-shadow: 0 4px 12px rgba(40, 167, 69, 0.15); transform: translateY(-2px); }
.exe-card.hidden { display: none; }
.exe-icon { width: 40px; height: 40px; background: #e8f5e9; color: #28a745; border-radius: 5px; display: flex; align-items: center; justify-content: center; font-size: 20px; margin-right: 12px; flex-shrink: 0; }
.exe-info { flex: 1; min-width: 0; }
.exe-name { font-weight: bold; color: #333; font-size: 14px; margin-bottom: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.exe-meta { font-size: 12px; color: #999; }
.exe-action { color: #ccc; margin-left: 10px; }
.exe-card:hover .exe-action { color: #28a745; }

/* === 留言板 === */
.message-form { margin-bottom: 20px; position: relative; }
.message-input { width: 100%; padding: 10px; border: 1px solid #ced4da; border-radius: 4px; resize: vertical; min-height: 80px; font-size: 14px; margin-bottom: 10px; }
.msg-toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.upload-btn { cursor: pointer; color: #666; font-size: 20px; transition: color 0.2s; }
.upload-btn:hover { color: #007bff; }
.img-preview-box { display: none; width: 100px; height: 100px; position: relative; border: 1px dashed #ccc; border-radius: 6px; overflow: hidden; margin-bottom: 10px; }
.img-preview-box img { width: 100%; height: 100%; object-fit: cover; }
.remove-img-btn { position: absolute; top: 0; right: 0; background: rgba(0,0,0,0.6); color: white; width: 20px; height: 20px; text-align: center; line-height: 20px; cursor: pointer; }
.message-btn { margin-top: 10px; background-color: #ffc107; color: #333; border: 1px solid #ffc107; font-weight: bold; }
.message-btn:hover { background-color: #e0a800; border-color: #d39e00; }
.message-list { display: flex; flex-direction: column; gap: 15px; max-height: 600px; overflow-y: auto; padding-right: 5px; }
.message-list::-webkit-scrollbar { width: 6px; }
.message-list::-webkit-scrollbar-track { background: #f1f1f1; border-radius: 3px; }
.message-list::-webkit-scrollbar-thumb { background: #ccc; border-radius: 3px; }
.msg-item { background: #fdfdfd; border: 1px solid #f0f0f0; padding: 15px; border-radius: 6px; position: relative; }
.msg-header { font-size: 12px; color: #999; margin-bottom: 8px; border-bottom: 1px dashed #eee; padding-bottom: 5px; display: flex; justify-content: space-between; align-items: center; }
.header-actions { display: flex; align-items: center; gap: 12px; }
.action-btn { cursor: pointer; transition: color 0.2s; display: flex; align-items: center; }
.toggle-text-btn { color: #007bff; display: none; font-weight: bold; }
.toggle-text-btn:hover { text-decoration: underline; color: #0056b3; }
.copy-icon-btn { color: #ccc; font-size: 14px; }
.copy-icon-btn:hover { color: #28a745; }
.delete-icon-btn { color: #ccc; font-size: 14px; }
.delete-icon-btn:hover { color: #dc3545; }
.reply-icon-btn { color: #ccc; font-size: 14px; }
.reply-icon-btn:hover { color: #007bff; }
.admin-icon-btn { cursor: pointer; color: #ccc; font-size: 16px; margin-left: 15px; transition: color 0.2s; }
.admin-icon-btn:hover { color: #007bff; }
.admin-icon-btn.delete:hover { color: #dc3545; }
.admin-logged-in { color: #28a745 !important; }
.msg-content { font-size: 14px; color: #333; line-height: 1.6; white-space: pre-wrap; word-break: break-all; transition: max-height 0.3s; }
.msg-content.collapsed { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; text-overflow: ellipsis; }
.msg-image { display: block; max-width: 200px; max-height: 200px; margin-top: 10px; border-radius: 6px; cursor: zoom-in; border: 1px solid #eee; }
.msg-footer-bar { margin-top: 8px; display: none; border-top: 1px solid #f8f9fa; padding-top: 5px; }
.footer-toggle-btn { color: #007bff; font-size: 13px; cursor: pointer; display: inline-block; }
.footer-toggle-btn:hover { text-decoration: underline; color: #0056b3; }
.admin-reply-box { margin-top: 10px; background: #f0f7ff; border-left: 4px solid #007bff; padding: 10px; border-radius: 4px; font-size: 13px; color: #555; }
.reply-title { font-weight: bold; color: #007bff; margin-bottom: 5px; display: block; }
    
/* Modals */
.image-modal-overlay, .visitor-modal-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 10000; align-items: center; justify-content: center; }
.image-modal-overlay { background: rgba(0,0,0,0.9); }
.image-modal-img { max-width: 90%; max-height: 90%; object-fit: contain; }
.image-modal-close { position: absolute; top: 20px; right: 20px; color: white; font-size: 30px; cursor: pointer; }
.visitor-modal { background: #fff; width: 90%; max-width: 800px; max-height: 85vh; border-radius: 8px; display: flex; flex-direction: column; box-shadow: 0 5px 15px rgba(0,0,0,0.3); }
.modal-header { padding: 15px; border-bottom: 1px solid #eee; display: flex; justify-content: space-between; align-items: center; font-weight: bold; font-size: 16px; }
.modal-body { padding: 0; overflow-y: auto; flex: 1; display:flex; flex-direction:column; }
.close-modal-btn { cursor: pointer; font-size: 20px; color: #999; }
.visitor-table { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 10px; }
.visitor-table th, .visitor-table td { padding: 10px; border-bottom: 1px solid #eee; text-align: left; }
.visitor-table th { background-color: #f8f9fa; color: #666; position: sticky; top: 0; }
.chart-container { height: 200px; width: 100%; padding: 10px; background: #fff; border-bottom: 1px solid #eee; flex-shrink: 0; }
    
.back-to-top { position: fixed; bottom: 30px; right: 30px; width: 45px; height: 45px; background: #007bff; color: white; border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: 0 2px 10px rgba(0,0,0,0.2); transition: all 0.3s; opacity: 0; visibility: hidden; z-index: 1000; font-size: 20px; }
.back-to-top.show { opacity: 1; visibility: visible; transform: translateY(0); }
.back-to-top:hover { background: #0056b3; transform: translateY(-3px); }
.empty-state { height: 100%; width: 100%; display: flex; align-items: center; justify-content: center; color: #999; background: #f9f9f9; min-height: 200px; }
     /* ================= 底部页脚样式 ================= */
     /* ================= 底部页脚样式 (PC & Mobile 通用) ================= */
footer {
        display: flex;
        justify-content: center;
        align-items: center;
        flex-wrap: wrap; 
        gap: 20px;       
        padding: 30px 20px; /* 增加一点上下内边距 */
        color: #ffffff; 
        font-size: 14px;
        text-align: center; /* 确保文字居中 */
}

footer p { margin: 0; line-height: 1.5; }

.icp-footer {
        display: flex;
        align-items: center; 
        justify-content: center; /* 确保内部居中 */
        flex-wrap: wrap;     
        gap: 5px;            
}

.icp-footer .separator { margin: 0 5px; opacity: 0.6; }

.icp-footer a {
        color: #ffffff !important;
        text-decoration: none;
        opacity: 0.8;
        display: inline-flex; /* 保持图标和文字在一行 */
        align-items: center;
        transition: opacity 0.2s;
}
    
.icp-footer a:hover { opacity: 1; text-decoration: underline; }

.icp-footer img { width: 18px; height: 18px; margin-right: 4px; }

/* 移动端 */
        /* 移动端 */
@media (max-width: 992px) {
        .index-page { padding-left: 15px !important; padding-right: 15px !important; }
        
        .app-layout { flex-direction: column; margin-top: 15px; gap: 15px; align-items: stretch; }
        
        /* 侧边栏横向滚动 */
        .sidebar-menu { width: 100%; flex-direction: row; overflow-x: auto; background: #f8f9fa; border: 1px solid #dee2e6; border-radius: 6px; padding: 10px; gap: 10px; box-shadow: none; -ms-overflow-style: none; scrollbar-width: none; }
        .sidebar-menu::-webkit-scrollbar { display: none; }
        .sidebar-btn { width: auto; padding: 8px 15px; font-size: 14px; border-radius: 4px; flex-shrink: 0; background: #fff; border: 1px solid #e0e0e0; box-shadow: none; margin: 0; color: #333; }
        .sidebar-btn.active { background: #007bff; color: white; border-color: #007bff; box-shadow: none; transform: none; }
        
        .content-display { border: 1px solid #dee2e6; border-radius: 6px; box-shadow: none; overflow: hidden; width: 100%; }
        
        .video-box { flex-direction: column; height: auto; width: 100%; }
        .player-section { width: 100%; aspect-ratio: 16/9; background: #000; }
        .playlist-section { width: 100%; height: 250px; border-left: none; border-top: 1px solid #e7e7e7; background: #fff; }
        .play-item { padding: 12px 15px; font-size: 14px; }
        
        .function-toolbar { padding: 15px; gap: 10px; justify-content: flex-start; border-top: 1px solid #e7e7e7; }
        .func-btn { flex: 1 1 auto; text-align: center; min-width: 120px; padding: 10px 0; border-radius: 4px; }

        /* ★★★ 修复重点开始：软件资源中心防溢出 ★★★ */
        .full-width-zone { 
            border: 1px solid #dee2e6; 
            box-shadow: none; 
            border-radius: 6px; 
            padding: 15px; 
            width: 100%;            /* 强制宽度 */
            box-sizing: border-box; /* 关键：把padding算在宽度里 */
            overflow: hidden;       /* 保险：切掉溢出内容 */
        }

        .download-zone { border-top: 3px solid #28a745; border-left: none; }
        .guestbook-zone { border-top: 3px solid #ffc107; border-left: none; }

        .exe-grid { 
            display: grid; 
            grid-template-columns: 1fr; /* 强制单列 */
            width: 100%; 
            gap: 10px; 
            box-sizing: border-box; /* 关键 */
        }

        .exe-card { 
            width: 100%; 
            box-sizing: border-box; /* 关键 */
            padding: 10px;
            display: flex;          /* 保持弹性布局 */
            min-width: 0;           /* 解决 flex 子元素文本溢出问题 */
        }
        /* ★★★ 修复重点结束 ★★★ */

        .zone-title { flex-direction: column; align-items: flex-start; gap: 10px; }
        .software-search-input { width: 100%; margin-top: 5px; box-sizing: border-box; }
        footer {
            flex-direction: column; /* 整个页脚上下排列 */
            gap: 12px;              /* 拉开两行文字的间距 */
        }

        .icp-footer {
            flex-direction: column; /* 备案信息内部也上下排列 */
            gap: 8px;               /* 每行备案号之间的间距 */
            width: 100%;            /* 占满宽度 */
        }

        /* 手机上隐藏竖线 "|", 因为已经换行了，不需要分隔符 */
        .icp-footer .separator {
            display: none;
        }
        
        /* 稍微缩小一点字体，防止折行 */
        .icp-footer a, footer p {
            font-size: 12px;
        }
}
/* =========================================================
   2. 主页科技主题覆盖：承接进入动画，但保证文字对比度
   ========================================================= */
.index-page {
    padding: 20px;
    color: var(--tech-text);
}

.index-page > header {
    position: relative;
    overflow: hidden;
    padding: 40px 28px 34px;
    text-align: left;
    color: #ffffff;
    background:
        radial-gradient(620px 260px at 16% 76%, rgba(0, 229, 255, 0.22), transparent 62%),
        radial-gradient(520px 220px at 88% 18%, rgba(255, 45, 120, 0.16), transparent 60%),
        linear-gradient(135deg, rgba(4, 18, 35, 0.98), rgba(6, 31, 56, 0.94));
    border: 1px solid var(--tech-line);
    border-radius: 12px;
    box-shadow: 0 20px 46px rgba(0, 0, 0, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.index-page > header::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(rgba(0, 229, 255, 0.055) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 229, 255, 0.055) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: linear-gradient(90deg, #000 0%, transparent 88%);
}

.index-page > header h1,
.index-page > header p {
    position: relative;
    z-index: 1;
}

.index-page > header h1 {
    margin: 0;
    color: #ffffff;
    font-size: clamp(28px, 4vw, 46px);
    font-weight: 900;
    text-shadow: 0 0 26px rgba(0, 229, 255, 0.42), 0 3px 20px rgba(0, 0, 0, 0.55);
}

.index-page > header p {
    max-width: 760px;
    margin: 12px 0 0;
    color: #c8edff;
    font-size: 16px;
    line-height: 1.7;
}

.sidebar-menu,
.content-display,
.full-width-zone,
.visitor-modal {
    background: var(--tech-panel);
    border-color: var(--tech-line);
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.sidebar-btn,
.func-btn,
.exe-card,
.msg-item {
    background: var(--theme-surface-soft, rgba(10, 30, 52, 0.82));
    color: var(--theme-text, #eaf7ff);
    border-color: var(--theme-border, rgba(0, 229, 255, 0.22));
}

.sidebar-btn:hover,
.func-btn:hover,
.exe-card:hover {
    border-color: var(--tech-line-strong);
    box-shadow: 0 0 22px rgba(0, 229, 255, 0.16);
}

.sidebar-btn.active,
.func-btn.primary {
    color: #02111f;
    background: linear-gradient(90deg, var(--tech-cyan), #7cf7ff);
    border-color: transparent;
    box-shadow: 0 0 24px rgba(0, 229, 255, 0.32);
}

.content-display {
    overflow: hidden;
}

.playlist-section,
.playlist-header,
.function-toolbar {
    background: rgba(247, 252, 255, 0.97);
}

.playlist-header,
.zone-title {
    color: var(--tech-text);
}

.playlist-section .playlist-header,
.playlist-section .play-item {
    color: var(--theme-text, #eaf7ff);
}

.play-item:hover {
    background: rgba(0, 229, 255, 0.16);
}

.play-item.playing {
    color: #ffffff;
    background: rgba(0, 229, 255, 0.18);
    border-left-color: var(--tech-cyan);
}

.download-zone {
    border-top-color: var(--tech-green);
}

.guestbook-zone {
    border-top-color: var(--tech-gold);
}

.software-search-input,
.message-input,
.playlist-section input[type="text"] {
    color: var(--theme-input-text, #f1fbff);
    background: var(--theme-input-bg, rgba(3, 12, 24, 0.78));
    border-color: var(--theme-border, rgba(0, 229, 255, 0.22));
}

.software-search-input:focus,
.message-input:focus,
.playlist-section input[type="text"]:focus {
    border-color: var(--tech-cyan);
    box-shadow: 0 0 0 3px rgba(0, 229, 255, 0.14);
}

.exe-name,
.msg-content {
    color: var(--theme-text, #eaf7ff);
}

.exe-meta,
.msg-header {
    color: var(--theme-muted, #9db6c8);
}

.empty-state {
    color: #d8efff;
    background:
        linear-gradient(rgba(0, 229, 255, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 229, 255, 0.035) 1px, transparent 1px),
        rgba(5, 18, 34, 0.82);
    background-size: 48px 48px;
}

.admin-reply-box {
    color: #15405a;
    background: #eaf8ff;
    border-left-color: var(--tech-cyan);
}

.back-to-top {
    color: #02111f;
    background: var(--tech-cyan);
    box-shadow: 0 0 24px rgba(0, 229, 255, 0.36);
}

.back-to-top:hover {
    color: #02111f;
    background: #7cf7ff;
}

.index-page + footer {
    margin-top: 20px;
    background: transparent;
    border-top: 1px solid var(--tech-line);
    box-shadow: none;
}

@media (max-width: 992px) {
.index-page {
        padding: 15px;
}

.index-page > header {
        padding: 28px 18px 24px;
}

.sidebar-menu,
.content-display,
.full-width-zone {
        background: var(--tech-panel);
        border-color: var(--tech-line);
}

.sidebar-btn.active {
        background: linear-gradient(90deg, var(--tech-cyan), #7cf7ff);
        color: #02111f;
}
}

