* { margin:0; padding:0; box-sizing:border-box; }
body { font-family:'Segoe UI',system-ui,sans-serif; background:#f5f6fa; color:#333; }

/* 屏幕阅读器专用（用于无障碍 label 关联） */
.sr-only { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }

.app { display:flex; min-height:100vh; }

/* 侧边栏 */
.sidebar { width:200px; background:#1a5276; color:#fff; display:flex; flex-direction:column; }
.logo { padding:20px; font-size:20px; font-weight:bold; border-bottom:1px solid rgba(255,255,255,0.1); }
.nav-menu { list-style:none; padding:10px 0; flex:1; }
.nav-item { padding:14px 20px; cursor:pointer; transition:0.2s; border-left:3px solid transparent; }
.nav-item:hover, .nav-item.active { background:rgba(255,255,255,0.1); border-left-color:#fff; }
.nav-footer { padding:15px; border-top:1px solid rgba(255,255,255,0.1); }
.btn-export { width:100%; padding:10px; background:#27ae60; color:#fff; border:none; border-radius:4px; cursor:pointer; }
.btn-export:hover { background:#219a52; }

/* 主内容 */
.main-content { flex:1; padding:30px; overflow:auto; }
.page { display:none; }
.page.active { display:block; }
h1 { margin-bottom:20px; font-size:24px; color:#1a5276; }

/* 统计卡片 */
.stats-cards { display:flex; gap:20px; margin-bottom:30px; }
.stat-card { background:#fff; padding:25px 30px; border-radius:8px; box-shadow:0 2px 8px rgba(0,0,0,0.08); min-width:180px; }
.stat-label { color:#888; font-size:14px; margin-bottom:8px; }
.stat-value { font-size:32px; font-weight:bold; color:#1a5276; }

/* Tab */
.upload-tabs, .query-tabs, .maintain-tabs { display:flex; gap:8px; margin-bottom:20px; border-bottom:2px solid #e0e0e0; }
.tab-btn { padding:10px 20px; background:none; border:none; cursor:pointer; font-size:14px; color:#666; border-bottom:2px solid transparent; margin-bottom:-2px; }
.tab-btn.active { color:#1a5276; border-bottom-color:#1a5276; font-weight:bold; }
.tab-content { display:none; }
.tab-content.active { display:block; }

/* 上传卡片 */
.upload-card { background:#fff; padding:25px; border-radius:8px; box-shadow:0 2px 8px rgba(0,0,0,0.08); margin-bottom:20px; }
.upload-card h3 { margin-bottom:8px; color:#333; }
.tip { color:#888; font-size:13px; margin-bottom:15px; }
.drop-zone { border:2px dashed #ccc; border-radius:8px; padding:40px; text-align:center; cursor:pointer; transition:0.2s; background:#fafafa; }
.drop-zone:hover, .drop-zone.dragover { border-color:#1a5276; background:#f0f7ff; }
.drop-text { color:#888; font-size:14px; }
.progress-bar { height:6px; background:#e0e0e0; border-radius:3px; margin-top:12px; overflow:hidden; display:none; }
.progress-bar.show { display:block; }
.progress-fill { height:100%; width:0%; background:#1a5276; transition:width 0.3s; }
.result { margin-top:12px; font-size:13px; }
.result.success { color:#27ae60; }
.result.error { color:#e74c3c; }

/* 查询表单 */
.query-form { background:#fff; padding:25px; border-radius:8px; box-shadow:0 2px 8px rgba(0,0,0,0.08); margin-bottom:20px; }
.form-row { display:flex; gap:15px; flex-wrap:wrap; margin-bottom:15px; }
.form-group { flex:1; min-width:200px; }
.form-group label { display:block; margin-bottom:6px; font-size:13px; color:#555; font-weight:500; }
.form-group input, .form-group select { width:100%; padding:10px 12px; border:1px solid #ddd; border-radius:4px; font-size:14px; }
.btn-primary { padding:10px 24px; background:#1a5276; color:#fff; border:none; border-radius:4px; cursor:pointer; font-size:14px; }
.btn-primary:hover { background:#154a6b; }
.btn-secondary { padding:10px 24px; background:#95a5a6; color:#fff; border:none; border-radius:4px; cursor:pointer; }
.btn-danger { padding:8px 16px; background:#e74c3c; color:#fff; border:none; border-radius:4px; cursor:pointer; font-size:13px; }
.btn-danger:hover { background:#c0392b; }
.btn-small { padding:4px 10px; font-size:12px; border-radius:3px; cursor:pointer; border:none; }
.btn-edit { background:#f39c12; color:#fff; }
.btn-del { background:#e74c3c; color:#fff; }

.query-summary { margin-bottom:15px; font-size:14px; color:#555; }

/* 表格 */
.table-wrap { background:#fff; border-radius:8px; box-shadow:0 2px 8px rgba(0,0,0,0.08); overflow-x:auto; -webkit-overflow-scrolling:touch; }
.scrollbar-top { overflow-x:auto; overflow-y:hidden; min-height:12px; border-radius:8px 8px 0 0; background:#d0d0d0; }
.scrollbar-top .scrollbar-inner { height:1px; }
.data-table { width:100%; border-collapse:collapse; font-size:13px; }
.data-table th { background:#f8f9fa; padding:12px; text-align:left; font-weight:600; color:#555; border-bottom:2px solid #e0e0e0; white-space:nowrap; }
.data-table td { padding:10px 12px; border-bottom:1px solid #f0f0f0; vertical-align:middle; }
.data-table tr:hover { background:#f8f9fa; }
.data-table img { max-width:80px; max-height:80px; border-radius:4px; object-fit:cover; }

/* 图片结果 */
.image-result { text-align:center; padding:30px; }
.image-result img { max-width:400px; max-height:400px; border-radius:8px; box-shadow:0 4px 16px rgba(0,0,0,0.15); }
.image-result .no-image { color:#888; font-size:16px; }

/* 图片网格 */
.image-grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(150px, 1fr)); gap:15px; }
.image-grid-item { background:#fff; border-radius:8px; overflow:hidden; box-shadow:0 2px 8px rgba(0,0,0,0.08); position:relative; }
.image-grid-item img { width:100%; height:120px; object-fit:cover; }
.image-grid-item .img-label { padding:8px; font-size:12px; text-align:center; word-break:break-all; }
.image-grid-item .img-del { position:absolute; top:5px; right:5px; width:24px; height:24px; background:#e74c3c; color:#fff; border:none; border-radius:50%; cursor:pointer; font-size:14px; line-height:24px; text-align:center; }

/* 图片预览 */
.image-preview { display:flex; flex-wrap:wrap; gap:10px; margin-top:15px; }
.image-preview-item { width:80px; height:80px; border-radius:4px; overflow:hidden; position:relative; }
.image-preview-item img { width:100%; height:100%; object-fit:cover; }
.image-preview-item .img-code { position:absolute; bottom:0; left:0; right:0; background:rgba(0,0,0,0.6); color:#fff; font-size:10px; padding:2px 4px; text-align:center; }

/* 工具栏 */
.toolbar { display:flex; justify-content:space-between; align-items:center; margin-bottom:15px; }
.toolbar input { padding:8px 12px; border:1px solid #ddd; border-radius:4px; width:300px; }

/* 分页 */
.pagination { display:flex; justify-content:center; gap:5px; margin-top:15px; }
.pagination button { padding:6px 12px; border:1px solid #ddd; background:#fff; cursor:pointer; border-radius:4px; }
.pagination button.active { background:#1a5276; color:#fff; border-color:#1a5276; }

/* 弹窗 */
.modal { display:none; position:fixed; top:0; left:0; right:0; bottom:0; background:rgba(0,0,0,0.5); z-index:1000; justify-content:center; align-items:center; }
.modal.show { display:flex; }
.modal-content { background:#fff; border-radius:8px; width:600px; max-width:90%; max-height:80vh; overflow:auto; }
.modal-header { padding:20px; border-bottom:1px solid #eee; display:flex; justify-content:space-between; align-items:center; }
.modal-header h3 { margin:0; }
.close { font-size:24px; cursor:pointer; color:#888; }
.modal-body { padding:20px; }
.modal-body .form-group { margin-bottom:15px; }
.modal-footer { padding:15px 20px; border-top:1px solid #eee; text-align:right; }
.modal-footer button { margin-left:10px; }

/* 响应式 - 手机端适配 */
@media (max-width:768px) {
  .app { flex-direction:column; }
  .sidebar { width:100%; flex-direction:row; flex-wrap:wrap; padding:10px; }
  .logo { width:100%; padding:10px; font-size:16px; border-bottom:none; }
  .nav-menu { display:flex; flex-direction:row; flex-wrap:wrap; padding:5px; flex:none; }
  .nav-item { padding:8px 12px; font-size:13px; border-left:none; border-bottom:2px solid transparent; }
  .nav-item:hover, .nav-item.active { border-left-color:transparent; border-bottom-color:#fff; }
  .nav-footer { display:flex; gap:8px; padding:10px; width:100%; border-top:none; }
  .btn-export { width:auto; flex:1; padding:8px; font-size:12px; }

  .main-content { padding:15px; }
  h1 { font-size:20px; }

  .stats-cards { flex-direction:column; gap:12px; }
  .stat-card { padding:18px 20px; min-width:auto; }
  .stat-value { font-size:28px; }

  .form-row { flex-direction:column; gap:10px; }
  .form-group { min-width:auto; }

  .upload-tabs, .query-tabs, .maintain-tabs { flex-wrap:wrap; gap:4px; }
  .tab-btn { padding:8px 12px; font-size:13px; }

  .drop-zone { padding:25px 15px; }
  .drop-text { font-size:13px; }

  .image-grid { grid-template-columns:repeat(auto-fill, minmax(120px, 1fr)); gap:10px; }
  .image-grid-item img { height:100px; }

  .toolbar { flex-direction:column; gap:10px; align-items:stretch; }
  .toolbar input { width:100%; }

  .data-table { font-size:12px; min-width:600px; }
  .data-table th, .data-table td { padding:8px; }

  .modal-content { width:95%; max-height:90vh; }
}

/* ================== 登录页 ================== */
.login-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(135deg, #1a5276 0%, #2c3e50 100%);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2000;
}
.login-card {
  background: #fff;
  border-radius: 12px;
  width: 380px;
  max-width: 90%;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  overflow: hidden;
}
.login-header {
  background: #1a5276;
  color: #fff;
  text-align: center;
  padding: 30px 20px 20px;
}
.login-icon { font-size: 40px; margin-bottom: 10px; }
.login-header h2 { margin: 0 0 5px; font-size: 22px; }
.login-header p { margin: 0; font-size: 14px; opacity: 0.8; }
.login-body { padding: 30px; }
.login-form-group { margin-bottom: 20px; }
.login-form-group label {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  color: #555;
  font-weight: 500;
}
.login-form-group input {
  width: 100%;
  padding: 12px 15px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 15px;
  transition: border-color 0.2s;
  outline: none;
}
.login-form-group input:focus {
  border-color: #1a5276;
}
.login-error {
  display: none;
  background: #fff0f0;
  color: #e74c3c;
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 13px;
  margin-bottom: 15px;
  border: 1px solid #fdd;
}
.login-btn {
  width: 100%;
  padding: 14px;
  background: #1a5276;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.2s;
}
.login-btn:hover { background: #154360; }
.login-btn:disabled { background: #95a5a6; cursor: not-allowed; }

/* 侧边栏用户信息 */
.user-info {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 0;
  margin-bottom: 10px;
  border-bottom: 1px solid rgba(255,255,255,0.15);
  font-size: 13px;
}
.user-avatar { font-size: 20px; }
.user-name { flex: 1; font-weight: 500; }
.user-role {
  font-size: 11px;
  background: rgba(255,255,255,0.15);
  padding: 2px 8px;
  border-radius: 10px;
}
.btn-logout {
  width: 100%;
  padding: 10px;
  background: #c0392b;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  margin-top: 8px;
  font-size: 13px;
}
.btn-logout:hover { background: #a93226; }

/* 订单查询图片缩略图 */
.order-thumb { max-width:60px; max-height:60px; border-radius:4px; object-fit:cover; cursor:pointer; transition:transform 0.2s; }
.order-thumb:hover { transform:scale(1.1); }

/* 图片放大弹窗 */
.lightbox { display:none; position:fixed; top:0; left:0; right:0; bottom:0; background:rgba(0,0,0,0.85); z-index:3000; justify-content:center; align-items:center; flex-direction:column; }
.lightbox.show { display:flex; }
.lightbox img { max-width:90vw; max-height:80vh; border-radius:8px; box-shadow:0 10px 40px rgba(0,0,0,0.5); }
.lightbox-close { position:absolute; top:20px; right:30px; font-size:40px; color:#fff; cursor:pointer; opacity:0.8; transition:opacity 0.2s; }
.lightbox-close:hover { opacity:1; }
#lightbox-caption { color:#fff; margin-top:15px; font-size:16px; opacity:0.9; }
