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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #f5f5f5;
    margin: 0;
    padding: 0;
    color: #333;
    font-size: 14px;
    width: 100%;
    box-sizing: border-box;
}

.container {
    width: 100%;
    margin: 0 auto;
    padding: 0 20px;
    box-sizing: border-box;
}

/* 顶部导航栏 */
.header {
    background-color: #4CAF50;
    color: white;
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    box-sizing: border-box;
    margin: 0 auto;
}

.logo {
    font-size: 20px;
    font-weight: bold;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 14px;
}

.user-info a {
    color: white;
    text-decoration: none;
    padding: 5px 10px;
    background-color: rgba(255,255,255,0.2);
    border-radius: 3px;
}

/* 导航菜单 */
.nav-menu {
    background-color: #f8f9fa;
    padding: 5px 20px;
    border-bottom: 1px solid #dee2e6;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    width: 100%;
    box-sizing: border-box;
    margin: 0 auto;
}

.nav-menu::-webkit-scrollbar {
    height: 4px;
}

.nav-menu::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.nav-menu::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 2px;
}

.nav-menu ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 5px;
    white-space: nowrap;
    flex-wrap: nowrap;
}

.nav-menu li {
    display: inline-block;
    flex-shrink: 0;
}

.nav-menu a {
    display: inline-block;
    padding: 5px 12px;
    color: #495057;
    text-decoration: none;
    border-radius: 3px;
    font-size: 14px;
}

.nav-menu a:hover {
    background-color: #e9ecef;
}

.nav-menu a.active {
    background-color: #45a049;
    color: white;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* 下载管理选项卡样式 - 提高优先级 */
.content .download-tabs {
    margin: 20px 0 !important;
    border-bottom: 1px solid #dee2e6 !important;
}
.content .download-tabs ul {
    list-style: none !important;
    display: flex !important;
    margin: 0 !important;
    padding: 0 !important;
    flex-direction: row !important;
    justify-content: flex-start !important;
    align-items: center !important;
}
.content .download-tabs li {
    margin-right: 5px !important;
    display: inline-block !important;
}
.content .download-tabs a {
    display: inline-block !important;
    padding: 10px 20px !important;
    text-decoration: none !important;
    color: #495057 !important;
    border: 1px solid #dee2e6 !important;
    border-bottom: none !important;
    border-radius: 5px 5px 0 0 !important;
    background-color: #f8f9fa !important;
    margin-bottom: -1px !important;
}
.content .download-tabs a.active {
    background-color: white !important;
    color: #4CAF50 !important;
    font-weight: bold !important;
}

/* 旧导航样式，保持兼容性 */
nav {
    background-color: white;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    border: 1px solid #e9ecef;
}

.nav-links {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: nowrap;
    width: 100%;
}

.nav-links > * {
    flex-shrink: 0;
}

/* 搜索容器 */
.search-container {
    margin-left: auto;
    display: flex;
    align-items: center;
    width: auto;
}

.search-container form {
    display: flex;
    gap: 10px;
    align-items: center;
}

.search-input {
    width: 350px;
    max-width: calc(100% - 100px);
    flex: 1 1 auto;
    padding: 8px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
    outline: none;
    background-color: white;
}

.search-input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.search-btn {
    padding: 8px 15px;
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(76, 175, 80, 0.2);
}

.search-btn:hover {
    transform: translateY(-1px);
    background: #45a049;
    box-shadow: 0 3px 10px rgba(76, 175, 80, 0.3);
}

/* 管理员链接 */
.nav-menu a.admin-link {
    position: relative;
    padding-right: 25px;
}

.nav-menu a.admin-link .pending-count {
    position: absolute;
    top: -8px;
    right: -5px;
    background-color: #dc3545;
    color: white;
    font-size: 12px;
    font-weight: bold;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* 内容区域 */
.content {
    background-color: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    width: 100%;
    box-sizing: border-box;
}

.content-section {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

/* 页脚 */
footer {
    margin-top: 20px;
    text-align: center;
    color: #666;
    font-size: 12px;
    padding: 10px;
    border-top: 1px solid #eee;
}

/* 按钮样式 */
.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    text-decoration: none;
    font-size: 14px;
    transition: background-color 0.3s;
    text-align: center;
    min-height: 44px;
    min-width: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
    max-width: 150px;
    margin: 0;
}

.btn-primary {
    background-color: #4CAF50;
    color: white;
}

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

.btn-secondary {
    background-color: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background-color: #5a6268;
}

.btn-danger {
    background-color: #dc3545;
    color: white;
}

.btn-danger:hover {
    background-color: #c82333;
}

/* 管理中心内容 */
.admin-content {
    display: flex;
    gap: 20px;
    margin-top: 20px;
}

.left-column {
    flex: 1;
    background-color: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    border-left: 4px solid #4CAF50;
}

.right-column {
    flex: 1;
    background-color: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    border-left: 4px solid #4CAF50;
}

.right-column h3 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #333;
    font-size: 18px;
    font-weight: 600;
}

/* 服务器统计网格 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-top: 10px;
}

.stat-item {
    background-color: white;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.stat-label {
    font-weight: bold;
    margin-bottom: 5px;
    color: #666;
    font-size: 14px;
}

.stat-value {
    font-size: 18px;
    color: #333;
    font-weight: 500;
}

/* 管理员选项网格 */
.admin-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-top: 10px;
}

.admin-option {
    background-color: white;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
    min-height: 180px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

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

.admin-option-icon {
    font-size: 30px;
    margin-bottom: 10px;
}

.admin-option-title {
    font-weight: bold;
    margin-bottom: 5px;
    color: #333;
}

.admin-option-description {
    font-size: 14px;
    color: #666;
    margin-bottom: 10px;
    flex-grow: 1;
}

/* 统计容器 */
.stats {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .header {
        flex-direction: column;
        gap: 10px;
        padding: 15px;
    }
    
    .nav-menu {
        padding: 10px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .nav-menu ul {
        flex-direction: row;
        gap: 5px;
        align-items: center;
        overflow-x: auto;
        white-space: nowrap;
        padding: 5px 0;
    }
    
    .nav-links {
        flex-direction: row;
        gap: 10px;
        align-items: center;
        overflow-x: auto;
        white-space: nowrap;
        padding: 5px 0;
    }
    
    .search-container {
        margin-left: 0;
        width: 100%;
        justify-content: center;
    }
    
    .search-input {
        width: 200px;
    }
    
    .admin-content {
        flex-direction: column;
    }
    
    .admin-options {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    /* 移动端按钮优化 */
    .btn {
        padding: 6px 12px;
        font-size: 12px;
        min-height: 36px;
        max-width: 150px;
    }
    
    /* 管理选项按钮优化 */
    .admin-option .btn {
        padding: 5px 10px;
        font-size: 11px;
        min-height: 32px;
        max-width: 120px;
    }
    
    /* 上传页面按钮优化 */
    .upload-area .btn {
        padding: 8px 15px;
        font-size: 12px;
        min-height: 38px;
    }
    
    /* 文件列表按钮保持原有小尺寸 */
    .file-actions .btn {
        padding: 4px 8px;
        font-size: 11px;
        min-height: 28px;
        min-width: 36px;
        margin: 0 2px;
    }
}

/* 上传页面样式 */
.upload-form {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    margin-bottom: 20px;
}

.upload-form h2 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #333;
    font-size: 24px;
}

.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

input[type="file"] {
    display: block;
    margin-bottom: 10px;
    padding: 10px;
    border: 2px dashed #ddd;
    border-radius: 5px;
    width: 100%;
    background-color: #f9f9f9;
}

input[type="file"]:hover {
    border-color: #4CAF50;
}

select {
    display: block;
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
}

/* 拖拽上传区域样式 */
.drop-area {
    border: 2px dashed #ddd;
    border-radius: 10px;
    padding: 40px;
    text-align: center;
    background-color: #f9f9f9;
    transition: all 0.3s ease;
    margin: 20px 0;
    cursor: pointer;
}

.drop-area:hover {
    border-color: #4CAF50;
    background-color: #e8f5e9;
}

.drop-area.drag-over {
    border-color: #4CAF50;
    background-color: #e8f5e9;
    transform: scale(1.02);
    box-shadow: 0 8px 15px rgba(0,0,0,0.1);
}

.drop-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.drop-icon {
    font-size: 48px;
    margin-bottom: 15px;
    color: #4CAF50;
}

.drop-content h3 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 20px;
}

.drop-content p {
    margin: 5px 0;
    color: #666;
}

.drop-hint {
    font-size: 12px;
    color: #888;
    margin-top: 15px;
}

/* 消息样式 */
.message {
    padding: 10px;
    border-radius: 3px;
    margin-bottom: 20px;
}

.message-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* 最大文件大小信息 */
.max-size-info {
    font-size: 14px;
    color: #666;
    margin-top: 10px;
}

/* 文件列表样式 */
.file-list-container {
    background-color: #f9f9f9;
    border: 1px solid #eee;
    border-radius: 5px;
    padding: 15px;
    margin: 20px 0;
}

.file-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.file-list-header h3 {
    margin: 0;
    color: #333;
    font-size: 18px;
}

.btn-sm {
    padding: 5px 10px;
    font-size: 12px;
}

.selected-files {
    max-height: 300px;
    overflow-y: auto;
}

.file-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    margin-bottom: 8px;
    background-color: white;
    border: 1px solid #eee;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.file-item:hover {
    background-color: #e8f5e9;
    border-color: #4CAF50;
    transform: translateX(5px);
}

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

.file-icon-small {
    font-size: 20px;
    margin-right: 10px;
    color: #4CAF50;
}

.file-name {
    font-weight: 500;
    color: #333;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

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

.remove-file {
    background: none;
    border: none;
    color: #dc3545;
    cursor: pointer;
    font-size: 16px;
    padding: 5px;
    transition: color 0.2s ease;
}

.remove-file:hover {
    color: #c82333;
}

/* 上传进度条样式 */
.upload-progress {
    background-color: #f9f9f9;
    border: 1px solid #eee;
    border-radius: 5px;
    padding: 15px;
    margin: 20px 0;
}

.progress-label {
    font-weight: bold;
    margin-bottom: 10px;
    color: #333;
}

.progress-bar-container {
    width: 100%;
    height: 20px;
    background-color: #eee;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-bar {
    height: 100%;
    background-color: #4CAF50;
    border-radius: 10px;
    width: 0%;
    transition: width 0.3s ease;
}

.progress-text {
    text-align: center;
    font-weight: bold;
    color: #333;
    font-size: 14px;
}

.form-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
}

.form-actions .btn {
    flex: 1;
    width: 100%;
    max-width: none;
    padding: 10px;
    font-size: 16px;
    border-radius: 5px;
    border: none;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    display: block;
    box-sizing: border-box;
}

.form-actions .btn-primary {
    background-color: #4CAF50;
    color: white;
}

.form-actions .btn-secondary {
    background-color: #2196F3;
    color: white;
}