/* ===== 基础重置 ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Open Sans", sans-serif;
    min-height: 100vh;
    background-image: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.6)),
        url("https://images.unsplash.com/photo-1506905925346-21bda4d32df4?ixlib=rb-4.0.3&auto=format&fit=crop&w=2000&q=80");
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;
    color: white;
}

/* ===== 导航栏 ===== */
#navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(30, 40, 20, 0.3);
    backdrop-filter: blur(5px);
    border-bottom: 1px solid rgba(163, 201, 98, 0.3);
    z-index: 1000;
}

.nav-logo h1 a {
    color: #d4c5a2;
    font-size: 24px;
    font-family: 'Ma Shan Zheng', cursive;
    text-decoration: none;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.nav-links {
    display: flex;
    gap: 15px;
    margin-right: 20px;
}

.nav-link {
    color: #e8e0c0;
    text-decoration: none;
    padding: 8px 16px;
    border: 1px solid #a3c962;
    border-radius: 30px;
    transition: all 0.3s ease;
    cursor: pointer;
    background: transparent;
    font-size: 14px;
    font-family: inherit;
}

.nav-link:hover {
    background: #a3c962;
    color: #1a2f1a;
}

/* ===== 返回首页按钮 ===== */
.back-home {
    position: fixed;
    top: 100px;  /* 从80px改为100px，增加20px下移 */
    left: 20px;
    z-index: 100;
}

.back-home a {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 8px 16px;
    background: rgba(44, 62, 44, 0.8);
    backdrop-filter: blur(5px);
    border: 1px solid #a3c962;
    border-radius: 30px;
    color: #e8e0c0;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    font-size: 14px;
}

.back-home a:hover {
    background: #a3c962;
    color: #1a2f1a;
    transform: scale(1.05);
}

/* ===== 管理员按钮区域 ===== */
.admin-actions {
    position: fixed;
    top: 100px;
    right: 20px;
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.admin-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: rgba(30, 40, 20, 0.6);
    backdrop-filter: blur(5px);
    border: 1px solid #a3c962;
    border-radius: 30px;
    color: #e8e0c0;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
    font-size: 14px;
    font-family: inherit;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    width: 140px;
    justify-content: center;
}

.admin-btn:hover {
    background: #a3c962;
    color: #1a2f1a;
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(163, 201, 98, 0.5);
}

/* ===== 主要内容区域 ===== */
.main-content {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 100px 20px 80px;
}

.download-container {
    max-width: 1200px;
    width: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 40px 20px;
    border: 1px solid rgba(163, 201, 98, 0.3);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

h1 {
    font-size: 36px;
    color: #d4c5a2;
    font-family: 'Ma Shan Zheng', cursive;
    text-align: center;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.description {
    text-align: center;
    max-width: 800px;
    margin: 0 auto 40px;
    line-height: 1.8;
    color: #e8e0c0;
}

/* ===== 平台选择器 ===== */
.platform-selector {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 40px;
}

.platform-option {
    padding: 15px 40px;
    border: 2px solid #a3c962;
    border-radius: 40px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 18px;
    font-weight: bold;
    color: #a3c962;
    text-decoration: none;
    display: inline-block;
    background: rgba(0,0,0,0.3);
}

.platform-option:hover,
.platform-option.selected {
    background: #a3c962;
    color: #1a2f1a;
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(163, 201, 98, 0.5);
}

/* ===== 软件列表 ===== */
.software-list {
    margin-top: 30px;
}

.software-item {
    background: rgba(0,0,0,0.3);
    border: 1px solid #a3c962;
    border-radius: 10px;
    padding: 15px 20px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

.software-item:hover {
    transform: translateX(10px);
    background: rgba(163, 201, 98, 0.1);
}

.software-checkbox {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.software-info {
    flex: 1;
}

.software-name {
    font-size: 18px;
    font-weight: bold;
    color: #d4c5a2;
}

.software-version {
    color: #a3c962;
    font-size: 14px;
    margin-left: 10px;
}

.software-size {
    color: #999;
    font-size: 12px;
    margin-left: 10px;
}

.software-actions {
    display: flex;
    gap: 10px;
}

.action-btn {
    padding: 8px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
}

/* 下载按钮 - 透明背景 */
.download-btn {
    background: transparent;
    border: 1px solid #a3c962;
    color: #a3c962;
}

.download-btn:hover {
    background: #a3c962;
    color: #1a2f1a;
}

/* 说明按钮 */
.info-btn {
    background: transparent;
    border: 1px solid #a3c962;
    color: #a3c962;
}

.info-btn:hover {
    background: #a3c962;
    color: #1a2f1a;
}

/* ===== 批量操作 ===== */
.bulk-actions {
    margin-top: 20px;
    padding: 15px;
    background: rgba(163, 201, 98, 0.1);
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 15px;
    backdrop-filter: blur(5px);
}

#downloadSelected {
    padding: 10px 30px;
    background: transparent;
    border: 1px solid #a3c962;
    color: #a3c962;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
}

#downloadSelected:hover {
    background: #a3c962;
    color: #1a2f1a;
}

/* ===== 弹窗样式 ===== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #2a3a2a;
    padding: 30px;
    border-radius: 20px;
    border: 2px solid #a3c962;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #a3c962;
}

.modal-header h2 {
    color: #a3c962;
    font-size: 24px;
}

.modal-close {
    font-size: 28px;
    cursor: pointer;
    color: #a3c962;
    transition: all 0.3s ease;
}

.modal-close:hover {
    color: #ffd700;
    transform: scale(1.1);
}

.modal-body {
    color: #e8e0c0;
    line-height: 1.8;
}

/* ===== 统计图表样式 ===== */
.stats-item {
    margin-bottom: 20px;
}

.stats-label {
    color: #a3c962;
    margin-bottom: 5px;
    font-size: 14px;
}

.stats-bar {
    width: 100%;
    height: 30px;
    background: rgba(0,0,0,0.3);
    border-radius: 5px;
    overflow: hidden;
    position: relative;
}

.stats-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #a3c962, #ffd700);
    transition: width 0.3s ease;
    border-radius: 5px;
}

.stats-value {
    text-align: right;
    color: #e8e0c0;
    margin-top: 5px;
    font-size: 14px;
}

/* 月份切换按钮 */
.month-btn {
    transition: all 0.3s ease;
}

.month-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 10px rgba(163, 201, 98, 0.5);
}

.month-btn.active {
    background: #a3c962 !important;
    color: #1a2f1a !important;
    font-weight: bold;
}

/* 用户统计表格 */
.user-stats-table {
    width: 100%;
    border-collapse: collapse;
    color: #e8e0c0;
}

.user-stats-table th {
    text-align: left;
    padding: 10px;
    color: #a3c962;
    border-bottom: 1px solid #a3c962;
}

.user-stats-table td {
    padding: 10px;
    border-bottom: 1px solid rgba(163, 201, 98, 0.3);
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 60px;
    color: #999;
}

/* ===== 响应式设计 ===== */
@media (max-width: 768px) {
    #navbar {
        padding: 15px 20px;
        flex-direction: column;
        gap: 10px;
    }
    
    .nav-links {
        margin-right: 0;
    }
    
    .admin-actions {
        position: static;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        margin: 10px 0;
    }
    
    .back-home {
        position: static;
        margin: 10px;
        text-align: center;
    }
    
    .platform-selector {
        flex-direction: column;
        align-items: center;
    }
    
    .platform-option {
        width: 200px;
        text-align: center;
    }
    
    .software-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .software-actions {
        width: 100%;
        justify-content: space-between;
    }
    
    .admin-btn {
        width: auto;
    }
}

/* 针对小屏幕设备的优化 */
@media screen and (max-width: 768px) {
  /* 主内容区调整 - 让它在手机上正常显示 */
  .main-content {
    width: 100%;
    padding: 15px;
    margin-top: 60px;  /* 给顶部导航栏留出空间 */
  }

  /* 管理员按钮区域 - 从右边竖列改为顶部横排 */
  .admin-actions {
    position: relative;  /* 移除固定定位 */
    top: auto;
    right: auto;
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 15px;
    margin-top: 70px;  /* 避开顶部导航栏 */
    justify-content: center;
    background: rgba(26, 47, 26, 0.9);
    z-index: 90;
  }

  /* 管理员按钮样式调整 */
  .admin-actions .admin-btn {
    width: calc(50% - 5px);  /* 一行显示两个按钮 */
    margin: 0;
    text-align: center;
    padding: 12px 0;
    font-size: 14px;
  }

  /* 返回首页按钮调整 */
  .back-home {
    position: relative;
    top: auto;
    left: auto;
    margin: 15px;
    padding-top: 10px;
    text-align: left;
  }

  /* 软件列表容器调整 */
  .download-container {
    padding: 15px;
    width: 100%;
  }

  /* 平台选择按钮调整 */
  .platform-selector {
    display: flex;
    gap: 10px;
    margin: 20px 0;
  }

  .platform-option {
    flex: 1;  /* 两个按钮平分宽度 */
    text-align: center;
    padding: 12px 0;
  }

  /* 软件列表项调整 */
  .software-item {
    flex-direction: column;  /* 改为上下排列 */
    align-items: flex-start;
    gap: 10px;
    padding: 15px;
  }

  .software-info {
    width: 100%;
    flex-wrap: wrap;
  }

  .software-actions {
    width: 100%;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
  }

  .software-actions .action-btn {
    flex: 1;  /* 下载和简介按钮平分宽度 */
    max-width: 120px;
    text-align: center;
  }

  /* 批量操作区域调整 */
  .bulk-actions {
    flex-wrap: wrap;
    gap: 10px;
    padding: 15px;
  }

  #selectedCount {
    width: 100%;
    text-align: center;
    order: -1;  /* 移到最前面 */
  }

  /* 弹窗调整 */
  .modal-content {
    width: 90%;
    margin: 20% auto;
    padding: 15px;
  }

  /* 用户统计表格调整 */
  .user-stats-table {
    display: block;
    overflow-x: auto;  /* 允许横向滚动 */
    white-space: nowrap;
  }
  
  .user-stats-table th,
  .user-stats-table td {
    padding: 8px;
    font-size: 14px;
  }
}

/* 更小屏幕的优化 */
@media screen and (max-width: 480px) {
  .admin-actions .admin-btn {
    width: 100%;  /* 超小屏幕按钮占满整行 */
  }
  
  .software-name {
    font-size: 16px;
  }
  
  .software-version,
  .software-size {
    font-size: 12px;
  }
  
  h1 {
    font-size: 24px;
  }
}