/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 头部样式 */
header {
    background-color: #2c3e50;
    color: white;
    padding: 20px 0;
    margin-bottom: 30px;
}

header h1 {
    font-size: 28px;
    margin-bottom: 10px;
    margin-left: 10px;
}

/* 管理员登录表单样式 */
.admin-login {
    margin-top: 15px;
}

/* 管理员登出按钮样式 */
.admin-logout {
    margin-top: 15px;
    margin-left:10px;
}

.btn-logout {
    background-color: #e74c3c;
    color: white;
    padding: 3px 6px;
    font-size: 14px;
    border-radius: 4px;
    text-decoration: none;
    transition: background-color 0.3s;
}

.admin-login form {
    display: flex;
    gap: 10px;
    align-items: center;
}

.admin-login input[type="password"] {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    width: 200px;
}

.admin-login button {
    background-color: #e74c3c;
    color: white;
    border: none;
    padding: 8px 16px;
    font-size: 14px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.admin-login button:hover {
    background-color: #c0392b;
}

nav {
    display: flex;
    gap: 20px;
}

nav a {
    color: white;
    text-decoration: none;
    padding: 5px 10px;
    border-radius: 4px;
    transition: background-color 0.3s;
}

nav a:hover {
    background-color: #34495e;
}

/* 主内容样式 */
main {
    background-color: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

section {
    margin-bottom: 30px;
}

section h2 {
    font-size: 24px;
    margin-bottom: 20px;
    color: #2c3e50;
    border-bottom: 2px solid #3498db;
    padding-bottom: 10px;
}

/* 版本信息样式 */
.version-display {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid #3498db;
    display: flex;
    align-items: center;
    gap: 20px;
}

.version-number {
    font-size: 32px;
    font-weight: bold;
    color: #3498db;
}



/* 表单样式 */
.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #555;
}

input[type="text"] {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    transition: border-color 0.3s;
}

input[type="text"]:focus {
    outline: none;
    border-color: #3498db;
}

/* 发布区域样式 */
.publish-section {
    margin-top: 20px;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.publish-form {
    display: inline-block;
}

/* 按钮样式 */
.btn-publish,
.btn-download {
    display: inline-block;
    background-color: #3498db;
    color: white;
    border: none;
    padding: 12px 24px;
    font-size: 16px;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.3s;
}

.btn-publish:hover,
.btn-download:hover {
    background-color: #2980b9;
}

/* 下载列表样式 */
.downloads-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* 版本分组样式 */
.version-group {
    margin-bottom: 30px;
    padding: 20px;
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-left: 4px solid #3498db;
}

.version-title {
    font-size: 20px;
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #ecf0f1;
}

.download-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 8px;
    transition: transform 0.2s;
}

.download-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* 管理员登录页面样式 */
.admin-login-container {
    max-width: 500px;
    margin: 0 auto;
}

.login-section {
    background-color: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-top: 40px;
}

.login-section h2 {
    text-align: center;
    color: #333;
    margin-bottom: 25px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.form-group label {
    font-weight: 500;
    color: #555;
}

.form-group input {
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

.btn-login {
    padding: 10px 16px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: background-color 0.3s;
}

.btn-login:hover {
    background-color: #45a049;
}

.error-message {
    color: #d32f2f;
    background-color: #ffebee;
    padding: 10px;
    border-radius: 4px;
    margin-top: 15px;
    text-align: center;
}

.file-info {
    display: flex;
    align-items: center;
}

.file-name {
    font-size: 16px;
    font-weight: bold;
    color: #333;
}

.file-size {
    font-size: 14px;
    color: #666;
    margin-left: 10px;
    font-weight: normal;
}

/* 表格样式 */
.stats-section {
    width: 100%;
    overflow-x: auto; /* 添加水平滚动条以防表格过宽 */
}

.stats-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed; /* 使用固定布局确保列宽均匀分布 */
}

.stats-table th,
.stats-table td {
    padding: 12px;
    text-align: center; /* 将文本对齐方式改为居中 */
    border-bottom: 1px solid #ddd;
    word-wrap: break-word; /* 允许长文本换行 */
    white-space: normal; /* 允许文本正常换行 */
}

/* 为不同列设置适当的宽度 */
.stats-table th:nth-child(1),
.stats-table td:nth-child(1) {
    width: 40%; /* 文件名列宽 */
}

.stats-table th:nth-child(2),
.stats-table td:nth-child(2) {
    width: 15%; /* 下载量列宽 */
}

.stats-table th:nth-child(3),
.stats-table td:nth-child(3) {
    width: 15%; /* 文件大小列宽 */
}

.stats-table th:nth-child(4),
.stats-table td:nth-child(4) {
    width: 30%; /* 最后修改时间列宽 */
}

.stats-table th {
    background-color: #f8f9fa;
    font-weight: bold;
    color: #2c3e50;
    position: sticky;
    top: 0;
    z-index: 1;
}

.stats-table tr:hover {
    background-color: #f8f9fa;
}

/* 无数据提示样式 */
.no-files,
.no-stats {
    text-align: center;
    color: #777;
    padding: 40px;
    font-style: italic;
}

/* 底部样式 */
footer {
    text-align: center;
    padding: 20px 0;
    color: #777;
    font-size: 14px;
    border-top: 1px solid #ddd;
}

/* 编译日志样式 */
.compilation-logs {
    margin-top: 20px;
}

.compilation-logs h3 {
    font-size: 18px;
    margin-bottom: 15px;
    color: #2c3e50;
}

.compilation-logs .logs-container {
    /* 使用height代替max-height确保固定高度 */
    height: 500px !important;
    /* 溢出时显示滚动条 */
    overflow-y: auto !important;
    /* 样式美化 */
    background-color: #f8f9fa !important;
    border: 1px solid #ddd !important;
    border-radius: 6px !important;
    padding: 15px !important;
    font-family: 'Courier New', Courier, monospace !important;
    font-size: 14px !important;
    line-height: 1.5 !important;
    /* 确保容器不会被内容拉伸 */
    flex-shrink: 0 !important;
    /* 确保样式优先级 */
    display: block !important;
    position: relative !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

/* 自定义滚动条 */
.compilation-logs .logs-container::-webkit-scrollbar {
    width: 8px !important;
}

.compilation-logs .logs-container::-webkit-scrollbar-track {
    background: #f1f1f1 !important;
    border-radius: 4px !important;
}

.compilation-logs .logs-container::-webkit-scrollbar-thumb {
    background: #888 !important;
    border-radius: 4px !important;
}

.compilation-logs .logs-container::-webkit-scrollbar-thumb:hover {
    background: #555 !important;
}

.log-entry {
    margin-bottom: 8px;
    padding: 5px 0;
}

.log-entry:last-child {
    margin-bottom: 0;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    header h1 {
        font-size: 24px;
    }
    
    main {
        padding: 20px;
    }
    
    section h2 {
        font-size: 20px;
    }
    
    .version-number {
        font-size: 24px;
    }
    
    .download-item {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }
    
    .btn-download {
        align-self: stretch;
        text-align: center;
    }
    
    .stats-table {
        font-size: 14px;
    }
    
    .stats-table th,
    .stats-table td {
        padding: 8px;
    }
    
    /* 响应式调整日志容器 */
    .compilation-logs .logs-container {
        height: 300px !important; /* 小屏幕上使用固定高度 */
        padding: 10px !important;
        font-size: 13px !important;
        /* 确保在小屏幕上也不会被拉伸 */
        flex-shrink: 0 !important;
        display: block !important;
    }
}