/* ===== 基础重置 ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif; background: #f0f2f5; color: #333; font-size: 14px; line-height: 1.6; }
a { color: #1890ff; text-decoration: none; }
a:hover { color: #40a9ff; }

/* ===== 登录页 ===== */
.login-wrapper { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
.login-box { background: #fff; border-radius: 8px; padding: 40px; width: 380px; box-shadow: 0 10px 40px rgba(0,0,0,0.2); }
.login-box h1 { text-align: center; color: #1890ff; margin-bottom: 8px; font-size: 24px; }
.login-subtitle { text-align: center; color: #999; margin-bottom: 30px; }
.error-msg { color: #ff4d4f; margin-top: 10px; text-align: center; min-height: 20px; }

/* ===== 表单 ===== */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; margin-bottom: 4px; font-weight: 500; color: #555; }
.form-control { width: 100%; padding: 8px 12px; border: 1px solid #d9d9d9; border-radius: 4px; font-size: 14px; transition: border-color 0.2s; }
.form-control:focus { outline: none; border-color: #1890ff; box-shadow: 0 0 0 2px rgba(24,144,255,0.1); }
select.form-control { appearance: auto; }

/* ===== 按钮 ===== */
.btn { display: inline-block; padding: 6px 16px; border: 1px solid #d9d9d9; border-radius: 4px; background: #fff; color: #333; cursor: pointer; font-size: 14px; transition: all 0.2s; text-align: center; }
.btn:hover { border-color: #1890ff; color: #1890ff; }
.btn-primary { background: #1890ff; color: #fff; border-color: #1890ff; }
.btn-primary:hover { background: #40a9ff; color: #fff; }
.btn-warning { background: #faad14; color: #fff; border-color: #faad14; }
.btn-warning:hover { background: #ffc53d; color: #fff; }
.btn-danger { background: #ff4d4f; color: #fff; border-color: #ff4d4f; }
.btn-danger:hover { background: #ff7875; color: #fff; }
.btn-success { background: #52c41a; color: #fff; border-color: #52c41a; }
.btn-sm { padding: 2px 10px; font-size: 12px; }
.btn-block { display: block; width: 100%; padding: 10px; }

/* ===== 导航 ===== */
.top-nav { display: flex; align-items: center; background: #001529; color: #fff; padding: 0 24px; height: 56px; position: sticky; top: 0; z-index: 100; }
.nav-brand { font-size: 18px; font-weight: 600; margin-right: 32px; white-space: nowrap; }
.nav-tabs { display: flex; flex: 1; gap: 4px; overflow-x: auto; }
.nav-tab { color: rgba(255,255,255,0.65); padding: 8px 16px; border-radius: 4px; cursor: pointer; transition: all 0.2s; white-space: nowrap; font-size: 14px; }
.nav-tab:hover { color: #fff; background: rgba(255,255,255,0.1); }
.nav-tab.active { color: #fff; background: #1890ff; }
.nav-right { margin-left: auto; }
.nav-right .btn { color: rgba(255,255,255,0.85); border-color: rgba(255,255,255,0.3); background: transparent; }
.nav-right .btn:hover { color: #fff; border-color: #fff; }

/* ===== 内容区 ===== */
.content { max-width: 1400px; margin: 24px auto; padding: 0 24px; }
.tab-content { display: none; background: #fff; border-radius: 8px; padding: 24px; box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.tab-content.active { display: block; }
h2 { margin-bottom: 20px; color: #1a1a1a; font-size: 20px; }
h3 { margin: 16px 0 12px; color: #333; font-size: 16px; }

/* ===== 统计卡片 ===== */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card { background: #fff; border: 1px solid #f0f0f0; border-radius: 8px; padding: 20px; text-align: center; }
.stat-value { font-size: 32px; font-weight: 600; color: #1890ff; }
.stat-label { font-size: 13px; color: #999; margin-top: 4px; }
.stat-success .stat-value { color: #52c41a; }
.stat-danger .stat-value { color: #ff4d4f; }
.stat-info .stat-value { color: #722ed1; }

/* ===== 进度条 ===== */
.progress-section { margin-top: 16px; }
.progress-bar { height: 24px; background: #f0f0f0; border-radius: 12px; overflow: hidden; margin: 8px 0; }
.progress-fill { height: 100%; background: linear-gradient(90deg, #1890ff, #52c41a); border-radius: 12px; transition: width 0.5s; }
#progress-text { font-size: 14px; color: #666; }

/* ===== 徽章 ===== */
.badge { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 12px; }
.badge-success { background: #f6ffed; color: #52c41a; border: 1px solid #b7eb8f; }
.badge-warning { background: #fffbe6; color: #faad14; border: 1px solid #ffe58f; }
.badge-danger { background: #fff2f0; color: #ff4d4f; border: 1px solid #ffccc7; }
.badge-info { background: #e6f7ff; color: #1890ff; border: 1px solid #91d5ff; }
.badge-default { background: #f5f5f5; color: #999; border: 1px solid #d9d9d9; }

/* ===== 表格 ===== */
.table-wrapper { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; margin-top: 12px; }
.data-table th, .data-table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid #f0f0f0; font-size: 13px; }
.data-table th { background: #fafafa; font-weight: 600; color: #555; white-space: nowrap; }
.data-table tr:hover { background: #f5f8ff; }
.data-table td img { max-width: 60px; max-height: 60px; border-radius: 4px; }

/* ===== Section Header ===== */
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; flex-wrap: wrap; gap: 12px; }
.section-header h2 { margin-bottom: 0; }
.header-actions { display: flex; gap: 8px; }

/* ===== 上传表单 ===== */
.upload-form { background: #fafafa; border: 1px solid #f0f0f0; border-radius: 8px; padding: 20px; margin-bottom: 16px; }
.upload-form-inline { background: #fafafa; border: 1px solid #f0f0f0; border-radius: 8px; padding: 20px; margin-bottom: 20px; }

/* ===== 截图网格 ===== */
.screenshot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; margin-top: 20px; }
.screenshot-card { border: 1px solid #f0f0f0; border-radius: 8px; padding: 12px; text-align: center; }
.screenshot-card img { max-width: 100%; height: 120px; object-fit: cover; border-radius: 4px; }
.screenshot-card .ss-order { font-weight: 600; margin-top: 8px; }
.screenshot-card .ss-actions { margin-top: 8px; }

/* ===== 日志 ===== */
.log-section { margin-top: 20px; }
.log-controls { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.log-viewer { background: #1e1e1e; color: #d4d4d4; padding: 16px; border-radius: 8px; font-family: 'Consolas', 'Courier New', monospace; font-size: 13px; line-height: 1.8; max-height: 400px; overflow-y: auto; white-space: pre-wrap; word-wrap: break-word; }

/* ===== 任务状态 ===== */
.task-status-section { padding: 16px; background: #f9f9f9; border-radius: 8px; margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }

/* ===== 设置 ===== */
.settings-section { margin-bottom: 24px; padding: 20px; background: #fafafa; border-radius: 8px; border: 1px solid #f0f0f0; }
.settings-section h3 { margin-top: 0; }

/* ===== 弹窗 ===== */
.modal { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); display: flex; align-items: center; justify-content: center; z-index: 1000; }
.modal-content { background: #fff; border-radius: 8px; padding: 24px; width: 450px; max-width: 90vw; max-height: 90vh; overflow-y: auto; }
.modal-content h3 { margin-bottom: 20px; }
.modal-actions { display: flex; gap: 8px; margin-top: 20px; }

/* ===== 历史记录 ===== */
.history-section { margin-top: 24px; }

/* ===== 响应式 ===== */
@media (max-width: 768px) {
  .top-nav { flex-wrap: wrap; height: auto; padding: 12px; }
  .nav-tabs { width: 100%; order: 3; margin-top: 8px; }
  .nav-tab { padding: 6px 10px; font-size: 13px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .section-header { flex-direction: column; align-items: flex-start; }
  .modal-content { width: 95vw; }
}

/* ===== 设置页面增强 ===== */
.settings-section { margin-bottom: 28px; padding: 20px; background: #fafbfc; border: 1px solid #e8e8e8; border-radius: 8px; }
.settings-section h3 { margin-top: 0; color: #1890ff; border-bottom: 1px solid #e8e8e8; padding-bottom: 10px; margin-bottom: 16px; }
.setting-hint { color: #888; font-size: 13px; margin-bottom: 16px; }
.form-row { display: flex; gap: 16px; margin-bottom: 0; }
.form-group-half { flex: 1; }
.form-group small { display: block; color: #999; font-size: 12px; margin-top: 4px; }
@media (max-width: 768px) {
  .form-row { flex-direction: column; gap: 0; }
}

/* v4.2 上传明细状态徽章 */
.st-badge{display:inline-block;padding:2px 10px;border-radius:12px;font-size:12px;font-weight:600;white-space:nowrap;}
.st-badge.ok{background:#e6f7e6;color:#1a7f1a;border:1px solid #b7e6b7;}
.st-badge.fail{background:#fdeaea;color:#c0392b;border:1px solid #f5b7b7;}
.st-badge.wait{background:#fff6e0;color:#b9770e;border:1px solid #f5d78e;}
