:root {
  --navy: #102a38;
  --navy-2: #173847;
  --teal: #2d857d;
  --mint: #72ebd2;
  --paper: #f3f7f7;
  --card: #ffffff;
  --line: #dce6e7;
  --muted: #6f808a;
  --danger: #cc5a4a;
  font-family: "Microsoft YaHei UI", "PingFang SC", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--navy); }
body.locked { overflow: hidden; }

.login-screen {
  position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center;
  padding: 22px; background:
    radial-gradient(circle at 75% 10%, rgba(114,235,210,.24), transparent 34%),
    linear-gradient(135deg, #0b2330, #194454);
}
.login-screen.hidden { display: none; }
.login-card {
  width: min(420px, 100%); padding: 34px; border-radius: 22px; background: white;
  box-shadow: 0 28px 70px rgba(0,0,0,.28);
}
.login-card .brand-icon { margin-bottom: 22px; }
.login-card h1 { margin: 0 0 8px; font-size: 30px; }
.login-card > p:not(.section-label) { color: var(--muted); margin: 0 0 24px; }
.login-card .primary { width: 100%; margin-top: 18px; }
.login-error { display: block; min-height: 20px; margin-top: 12px; color: var(--danger); font-size: 13px; }

.sidebar {
  position: fixed; inset: 0 auto 0 0; width: 270px; padding: 32px 22px;
  display: flex; flex-direction: column; background: var(--navy); color: white;
}
.brand { display: flex; gap: 14px; align-items: center; padding: 4px 10px 34px; }
.brand-icon {
  width: 50px; height: 50px; display: grid; place-items: center; border-radius: 15px;
  background: var(--mint); color: var(--navy); font-size: 22px; font-weight: 900;
}
.brand strong { display: block; font-size: 20px; }
.brand span { display: block; color: #9dc0c9; font-size: 13px; margin-top: 5px; }
nav { display: grid; gap: 8px; }
nav a {
  color: #d9ebee; text-decoration: none; padding: 15px 16px; border-radius: 12px;
  display: flex; align-items: center; gap: 13px; font-weight: 700;
}
nav a span {
  width: 32px; height: 32px; display: grid; place-items: center; border-radius: 9px;
  background: rgba(255,255,255,.08);
}
nav a.active { background: #254d60; box-shadow: inset 4px 0 var(--mint); color: white; }
.rule-card {
  margin-top: auto; padding: 18px; border: 1px solid rgba(255,255,255,.12);
  border-radius: 14px; background: rgba(255,255,255,.04);
}
.rule-card strong { color: var(--mint); font-size: 14px; }
.rule-card p { margin: 10px 0 0; color: #b9d3d9; line-height: 1.7; font-size: 13px; }

main { margin-left: 270px; padding: 28px 38px 60px; max-width: 1700px; }
.hero {
  min-height: 230px; padding: 38px 42px; border-radius: 24px; color: white;
  display: flex; align-items: flex-end; justify-content: space-between;
  background:
    radial-gradient(circle at 80% -10%, rgba(114,235,210,.3), transparent 38%),
    linear-gradient(120deg, #102a38, #214d5b);
  box-shadow: 0 18px 40px rgba(16,42,56,.18);
}
.eyebrow, .section-label {
  color: var(--teal); font-size: 12px; font-weight: 900; letter-spacing: .1em; margin: 0 0 8px;
}
.hero .eyebrow { color: var(--mint); }
.hero h1 { font-size: 42px; line-height: 1.15; margin: 0; }
.subhead { color: #c8dce1; margin: 16px 0 0; }
.hero-stats { display: grid; grid-template-columns: repeat(3, 130px); gap: 12px; }
.hero-stats div {
  padding: 19px; border-radius: 16px; background: rgba(255,255,255,.09);
  border: 1px solid rgba(255,255,255,.12);
}
.hero-stats b { display: block; font-size: 28px; color: var(--mint); }
.hero-stats span { display: block; margin-top: 6px; font-size: 13px; color: #d5e6e9; }
.logout-button {
  position: absolute; top: 20px; right: 22px; padding: 9px 14px;
  color: #d9ebee; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.15);
}
.hero { position: relative; }

.grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 22px; margin-top: 22px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 20px;
  padding: 30px; box-shadow: 0 12px 30px rgba(24,54,65,.07);
}
h2 { margin: 0 0 24px; font-size: 25px; }
.field { display: grid; gap: 9px; flex: 1; }
.field > span, .switch-field > span { font-size: 13px; font-weight: 800; color: #435b67; }
input, select {
  width: 100%; height: 52px; border: 1px solid #cad8dc; border-radius: 12px;
  padding: 0 15px; background: white; color: var(--navy); font-size: 16px; outline: none;
}
input:focus, select:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(45,133,125,.12); }
.row { display: flex; gap: 14px; margin-top: 18px; }
.switch-field { flex: 1; display: grid; gap: 9px; }
.switch-field div {
  height: 52px; border: 1px solid #cad8dc; border-radius: 12px; display: flex;
  align-items: center; gap: 10px; padding: 0 15px;
}
.switch-field input { width: 18px; height: 18px; accent-color: var(--teal); }
.switch-field label { font-size: 14px; }
.notice {
  margin-top: 18px; padding: 13px 15px; border-radius: 10px;
  background: #effaf7; color: #48716d; font-size: 13px;
}
.actions { display: flex; gap: 12px; margin-top: 24px; }
button, .download {
  border: 0; border-radius: 11px; padding: 13px 20px; font-weight: 800;
  cursor: pointer; text-decoration: none; font-size: 14px;
}
button:disabled { cursor: not-allowed; opacity: .45; }
.primary { flex: 1; background: var(--teal); color: white; box-shadow: 0 9px 22px rgba(45,133,125,.22); }
.secondary { background: #eaf0f1; color: var(--navy); }
.status-top, .result-heading { display: flex; justify-content: space-between; align-items: flex-start; }
.badge { padding: 7px 11px; border-radius: 999px; font-size: 12px; font-weight: 800; }
.badge.idle { background: #edf1f2; color: #75868e; }
.badge.running { background: #dcf8ef; color: #197265; }
.badge.queued, .badge.uploading { background: #fff2d8; color: #956314; }
.badge.completed { background: #dff5df; color: #287a35; }
.badge.failed, .badge.stopped { background: #fce8e4; color: var(--danger); }
.progress-ring-wrap { display: flex; align-items: center; gap: 23px; margin: 8px 0 25px; }
.progress-ring {
  --progress: 0deg; width: 112px; height: 112px; flex: 0 0 auto; border-radius: 50%;
  display: grid; place-items: center;
  background: conic-gradient(var(--teal) var(--progress), #e7eeee 0);
  position: relative;
}
.progress-ring::after { content: ""; position: absolute; inset: 10px; border-radius: 50%; background: white; }
.progress-ring strong { position: relative; z-index: 1; font-size: 24px; }
.progress-ring-wrap p { color: var(--muted); margin: 0 0 5px; font-size: 13px; }
.progress-ring-wrap b { display: block; font-size: 26px; }
.progress-ring-wrap span { display: block; color: var(--muted); font-size: 12px; margin-top: 6px; }
.mini-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.mini-stats div { border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.mini-stats span { display: block; color: var(--muted); font-size: 12px; }
.mini-stats b { display: block; margin-top: 6px; font-size: 22px; }
.folder-button { width: 100%; margin-top: 18px; background: var(--navy); color: white; }
.folder-button {
  display: block; border-radius: 11px; padding: 13px 20px; text-align: center;
  font-size: 14px; font-weight: 800; text-decoration: none;
}
.folder-button.disabled { pointer-events: none; opacity: .45; }
.current-item {
  min-height: 40px; margin: 16px 0 0; padding: 12px 14px; border-radius: 10px;
  background: #f4f8f8; color: #4d6570; font-size: 13px; line-height: 1.45;
}
.result-card { margin-top: 22px; }
.result-note {
  margin: -10px 0 20px; color: var(--muted); font-size: 13px; line-height: 1.7;
}
.upload-stats {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px; margin-bottom: 20px;
}
.upload-stats div {
  padding: 18px; border: 1px solid var(--line); border-radius: 13px;
  background: #f7fafa;
}
.upload-stats span { display: block; color: var(--muted); font-size: 12px; }
.upload-stats b { display: block; margin-top: 7px; font-size: 27px; }
.upload-stats .success-stat { background: #effaf4; border-color: #ccead8; }
.upload-stats .success-stat b, .success-text { color: #287a4b; }
.upload-stats .warning-stat { background: #fff6f2; border-color: #f1d3c9; }
.upload-stats .warning-stat b { color: var(--danger); }
.upload-status {
  display: inline-block; padding: 5px 9px; border-radius: 999px;
  background: #fce8e4; color: var(--danger); font-size: 12px; font-weight: 800;
}
.upload-status.partial { background: #fff2d8; color: #956314; }
#uploads table { min-width: 650px; }
#uploads th:first-child, #uploads td:first-child { min-width: 190px; }
.download { border: 1px solid var(--teal); color: var(--teal); background: white; }
.download.disabled { opacity: .45; pointer-events: none; }
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 13px; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 15px 17px; border-bottom: 1px solid var(--line); text-align: left; font-size: 13px; }
th { color: #637782; background: #f6f9f9; }
tr:last-child td { border-bottom: 0; }
.empty { text-align: center; color: var(--muted); padding: 42px; }
.image-grid {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px;
}
.image-grid .empty { grid-column: 1 / -1; }
.image-card {
  overflow: hidden; border: 1px solid var(--line); border-radius: 13px; background: #f7fafa;
}
.image-card img {
  display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: #dfe8e9;
}
.image-card div { padding: 11px 12px 13px; }
.image-card strong, .image-card span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.image-card strong { font-size: 13px; }
.image-card span { margin-top: 5px; color: var(--muted); font-size: 11px; }
.load-more { display: block; margin: 18px auto 0; }
.toast {
  position: fixed; right: 26px; bottom: 26px; padding: 13px 18px; border-radius: 11px;
  background: var(--navy); color: white; transform: translateY(80px); opacity: 0;
  transition: .25s; box-shadow: 0 12px 30px rgba(0,0,0,.2);
}
.toast.show { transform: translateY(0); opacity: 1; }

@media (max-width: 1050px) {
  .sidebar { width: 220px; }
  main { margin-left: 220px; padding: 22px; }
  .hero { align-items: flex-start; flex-direction: column; gap: 28px; }
  .grid { grid-template-columns: 1fr; }
  .image-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 700px) {
  .sidebar { position: static; width: auto; padding: 16px; }
  .brand { padding: 0 0 14px; }
  .brand-icon { width: 42px; height: 42px; border-radius: 12px; }
  nav { display: flex; overflow-x: auto; }
  nav a { flex: 0 0 auto; padding: 10px 12px; }
  nav a span { width: 26px; height: 26px; }
  .rule-card { display: none; }
  main { margin-left: 0; padding: 14px 14px 40px; }
  .hero { min-height: 0; padding: 28px 22px; border-radius: 18px; }
  .hero h1 { font-size: 30px; }
  .hero-stats { width: 100%; grid-template-columns: repeat(3, 1fr); }
  .hero-stats div { padding: 13px 10px; }
  .hero-stats b { font-size: 22px; }
  .card { padding: 21px; border-radius: 16px; }
  .row { flex-direction: column; }
  .image-grid { grid-template-columns: 1fr; }
  .upload-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .upload-card .result-heading { flex-direction: column; gap: 12px; }
  .upload-card .result-note { margin-top: 0; }
  .logout-button { top: 14px; right: 14px; }
}
