:root {
  color-scheme: dark;
  --bg: #050b16;
  --panel: rgba(10, 22, 40, .88);
  --panel-strong: #0b1a2f;
  --line: rgba(117, 209, 255, .17);
  --line-strong: rgba(66, 217, 255, .55);
  --text: #edf8ff;
  --muted: #8ea6bc;
  --cyan: #37ddff;
  --blue: #4e7cff;
  --violet: #8f6cff;
  --green: #39e6a5;
  --danger: #ff6d8c;
  --shadow: 0 28px 80px rgba(0, 0, 0, .34);
  font-family: Inter, "Segoe UI", "Microsoft YaHei", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    linear-gradient(rgba(55, 221, 255, .028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(55, 221, 255, .028) 1px, transparent 1px),
    radial-gradient(circle at 20% 0%, rgba(65, 104, 255, .16), transparent 28rem),
    radial-gradient(circle at 90% 28%, rgba(55, 221, 255, .10), transparent 26rem),
    var(--bg);
  background-size: 38px 38px, 38px 38px, auto, auto, auto;
}

button, input, textarea, select { font: inherit; }
button { border: 0; }
button, input[type="file"] { touch-action: manipulation; }
.hidden { display: none !important; }

.ambient {
  position: fixed;
  z-index: -1;
  width: 26rem;
  height: 26rem;
  border-radius: 50%;
  filter: blur(110px);
  opacity: .16;
  pointer-events: none;
}
.ambient-one { top: -8rem; right: 8%; background: var(--cyan); }
.ambient-two { bottom: 8%; left: -8rem; background: var(--violet); }

.login-view {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 18px;
}

.login-panel {
  width: min(460px, 100%);
  position: relative;
  padding: 42px;
  border: 1px solid var(--line-strong);
  border-radius: 28px;
  background: linear-gradient(145deg, rgba(13, 29, 53, .96), rgba(6, 15, 29, .93));
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,.05), 0 0 70px rgba(55,221,255,.08);
  overflow: hidden;
}
.login-panel::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 160px;
  height: 2px;
  background: linear-gradient(90deg, var(--cyan), transparent);
}
.login-panel::after {
  content: "";
  position: absolute;
  right: -90px;
  top: -90px;
  width: 210px;
  height: 210px;
  border: 1px solid rgba(55,221,255,.16);
  border-radius: 50%;
  box-shadow: 0 0 0 24px rgba(55,221,255,.025), 0 0 0 48px rgba(55,221,255,.018);
}
.brand-mark, .brand-orb {
  display: grid;
  place-items: center;
  color: #03101a;
  background: var(--cyan);
  box-shadow: 0 0 28px rgba(55,221,255,.38);
  font-weight: 900;
  letter-spacing: -.05em;
}
.brand-mark { width: 64px; height: 64px; border-radius: 18px; margin-bottom: 26px; font-size: 20px; }
.login-copy { position: relative; z-index: 1; }
.kicker, .section-kicker {
  display: block;
  color: var(--cyan);
  letter-spacing: .2em;
  font-size: 11px;
  font-weight: 800;
}
.login-copy h1 { margin: 8px 0 10px; font-size: clamp(34px, 7vw, 48px); letter-spacing: -.045em; }
.login-copy p { color: var(--muted); line-height: 1.7; margin: 0 0 28px; }
.login-form { display: grid; gap: 16px; position: relative; z-index: 1; }
.login-button { width: 100%; margin-top: 4px; }
.security-note { display: flex; align-items: center; gap: 9px; color: var(--muted); margin-top: 24px; font-size: 12px; }

.shell { width: min(1260px, calc(100% - 36px)); margin: 0 auto; padding: 24px 0 52px; }
.topbar {
  position: sticky;
  top: 14px;
  z-index: 20;
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(6, 15, 29, .82);
  backdrop-filter: blur(18px);
  box-shadow: 0 14px 40px rgba(0,0,0,.22);
}
.brand-inline, .topbar-right { display: flex; align-items: center; gap: 12px; }
.brand-orb { width: 40px; height: 40px; border-radius: 12px; font-size: 13px; }
.brand-inline div { display: grid; gap: 2px; }
.brand-inline strong { font-size: 16px; }
.brand-inline small { color: var(--muted); font-size: 9px; letter-spacing: .13em; }
.system-chip, .role-chip, .user-name {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #bad0e3;
  background: rgba(255,255,255,.025);
  font-size: 12px;
}
.role-chip { color: var(--cyan); border-color: rgba(55,221,255,.28); font-weight: 800; }
.role-chip.admin { color: #c9bfff; border-color: rgba(143,108,255,.38); }
.pulse-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(57,230,165,.08), 0 0 12px rgba(57,230,165,.7); }

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 28px;
  padding: 48px;
  margin-bottom: 22px;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: linear-gradient(135deg, rgba(15,35,64,.95), rgba(7,17,33,.92));
  box-shadow: var(--shadow);
  overflow: hidden;
}
.hero::after {
  content: "";
  position: absolute;
  width: 420px;
  height: 420px;
  border: 1px solid rgba(55,221,255,.11);
  border-radius: 50%;
  right: -180px;
  top: -245px;
  box-shadow: 0 0 0 34px rgba(55,221,255,.022), 0 0 0 68px rgba(55,221,255,.016);
}
.hero h1 { margin: 10px 0 12px; font-size: clamp(36px, 5vw, 58px); letter-spacing: -.055em; line-height: 1.05; }
.hero p { margin: 0; max-width: 690px; color: #9eb6cb; font-size: 17px; line-height: 1.7; }
.hero-status { display: grid; grid-template-columns: repeat(3, minmax(95px,1fr)); gap: 10px; align-self: center; }
.hero-status div, .link-stats div, .summary div {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255,255,255,.022);
}
.hero-status div { display: grid; gap: 8px; min-width: 105px; padding: 18px 16px; }
.hero-status span, .link-stats span, .summary span { color: var(--muted); font-size: 12px; }
.hero-status strong { color: var(--cyan); font-size: 20px; letter-spacing: .04em; }
.privacy { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; color: #a9bfd2; font-size: 13px; }
.shield { color: var(--green); text-shadow: 0 0 12px rgba(57,230,165,.7); }

.card {
  position: relative;
  margin: 0 0 22px;
  padding: 36px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--panel);
  box-shadow: 0 20px 58px rgba(0,0,0,.22), inset 0 1px 0 rgba(255,255,255,.025);
  overflow: hidden;
}
.card-edge { position: absolute; left: 0; top: 34px; width: 2px; height: 74px; background: var(--cyan); box-shadow: 0 0 18px var(--cyan); }
.admin-card { border-color: rgba(143,108,255,.28); }
.admin-card .card-edge { background: var(--violet); box-shadow: 0 0 18px var(--violet); }
.section-title { display: flex; align-items: flex-start; gap: 18px; margin-bottom: 28px; }
.section-title .step {
  flex: 0 0 50px;
  height: 50px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(55,221,255,.45);
  border-radius: 15px;
  color: var(--cyan);
  background: rgba(55,221,255,.07);
  box-shadow: inset 0 0 18px rgba(55,221,255,.06), 0 0 20px rgba(55,221,255,.08);
  font-weight: 900;
  font-size: 20px;
}
.admin-card .step { color: #c9bfff; border-color: rgba(143,108,255,.5); background: rgba(143,108,255,.08); }
.section-title h2 { margin: 4px 0 6px; font-size: 25px; letter-spacing: -.03em; }
.section-title p { margin: 0; color: var(--muted); line-height: 1.6; }
.section-kicker { font-size: 9px; }

label { display: grid; gap: 9px; color: #c5d7e6; font-size: 13px; font-weight: 700; }
input, textarea, select {
  width: 100%;
  color: var(--text);
  border: 1px solid rgba(123,169,204,.22);
  border-radius: 13px;
  outline: none;
  background: rgba(2,10,20,.7);
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}
input, select { min-height: 48px; padding: 0 14px; }
textarea { padding: 16px; resize: vertical; line-height: 1.6; min-height: 188px; }
input::placeholder, textarea::placeholder { color: #536b80; }
input:focus, textarea:focus, select:focus { border-color: var(--cyan); background: rgba(3,14,27,.9); box-shadow: 0 0 0 3px rgba(55,221,255,.09), 0 0 22px rgba(55,221,255,.08); }
input[readonly] { color: #91a9bd; background: rgba(255,255,255,.02); }

.grid { display: grid; gap: 18px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.wide { grid-column: 1 / -1; }
.actions, .import-row, .batch-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-top: 18px; }

button {
  min-height: 45px;
  padding: 0 20px;
  border-radius: 12px;
  cursor: pointer;
  color: var(--text);
  font-weight: 800;
  transition: transform .16s ease, border-color .16s ease, background .16s ease, box-shadow .16s ease;
}
button:hover:not(:disabled) { transform: translateY(-1px); }
button:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }
button.primary { color: #03131f; background: var(--cyan); box-shadow: 0 0 24px rgba(55,221,255,.18); }
button.primary:hover:not(:disabled) { box-shadow: 0 0 30px rgba(55,221,255,.32); }
button.secondary { border: 1px solid rgba(55,221,255,.28); background: rgba(55,221,255,.07); }
button.ghost { border: 1px solid var(--line); background: rgba(255,255,255,.025); color: #b8ccdc; }
button.compact { min-height: 34px; padding: 0 13px; border-radius: 999px; font-size: 12px; }
button:disabled { cursor: not-allowed; opacity: .35; }

.file-input { flex: 1 1 420px; min-height: 46px; padding: 6px; color: var(--muted); }
.file-input::file-selector-button { height: 34px; margin-right: 12px; padding: 0 14px; border: 1px solid var(--line); border-radius: 9px; color: var(--text); background: rgba(255,255,255,.04); cursor: pointer; }
.hint { margin: 13px 0 0; color: var(--muted); font-size: 12px; line-height: 1.65; }
.link-stats, .summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 22px; }
.link-stats div, .summary div { display: grid; gap: 8px; padding: 17px 18px; }
.link-stats strong, .summary strong { font-size: 25px; color: var(--text); }
.danger-text { color: var(--danger) !important; }
.notice { margin-top: 14px; padding: 13px 15px; border: 1px solid rgba(255,109,140,.24); border-radius: 12px; color: #ffb0c1; background: rgba(255,109,140,.06); line-height: 1.6; }

.folder-row { display: grid; grid-template-columns: minmax(0,1fr) auto auto; align-items: end; gap: 12px; }
.folder-example { display: flex; align-items: center; gap: 12px; margin-top: 15px; color: var(--muted); font-size: 12px; }
.folder-example code { color: #a8dff0; border: 1px solid var(--line); border-radius: 9px; padding: 7px 10px; background: rgba(55,221,255,.035); }
.status { min-height: 18px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.status.success { color: var(--green); }
.status.error { color: var(--danger); }

.batch-actions { margin-top: 0; }
.batch-message { margin-top: 14px; }
.progress-track { height: 8px; margin: 18px 0; overflow: hidden; border: 1px solid var(--line); border-radius: 99px; background: rgba(0,0,0,.25); }
.progress-bar { width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--blue), var(--cyan)); box-shadow: 0 0 18px rgba(55,221,255,.5); transition: width .24s ease; }
.jobs { display: grid; gap: 10px; max-height: 570px; overflow: auto; padding-right: 4px; }
.job { display: grid; grid-template-columns: 42px minmax(0,1fr) auto; gap: 14px; align-items: center; padding: 15px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.02); }
.job-index { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; color: var(--cyan); background: rgba(55,221,255,.07); font-weight: 900; }
.job-body { display: grid; gap: 5px; min-width: 0; }
.job-body strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.job-body span, .job-body small, .job-state small { color: var(--muted); font-size: 11px; }
.job-body small { color: #ff9bb1; white-space: normal; }
.job-state { display: grid; justify-items: end; gap: 5px; color: #b8cbdc; font-size: 12px; }
.job-download { display: inline-flex; align-items: center; justify-content: center; min-height: 28px; padding: 5px 9px; border: 1px solid rgba(55,221,255,.32); border-radius: 8px; color: var(--cyan); background: rgba(55,221,255,.08); text-decoration: none; font-size: 11px; font-weight: 800; }
.job-download:hover { border-color: rgba(55,221,255,.72); background: rgba(55,221,255,.15); }
.job.completed .job-state span { color: var(--green); }
.job.processing .job-state span, .job.retrying .job-state span { color: var(--cyan); }
.job.failed .job-state span, .job.partial .job-state span { color: var(--danger); }
.empty { padding: 42px 16px; text-align: center; color: #637d93; border: 1px dashed var(--line); border-radius: 14px; }

footer { display: flex; justify-content: space-between; gap: 16px; color: #587187; font-size: 10px; letter-spacing: .14em; padding: 8px 4px; }

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; padding: 36px 28px; }
  .hero-status { grid-template-columns: repeat(3, 1fr); }
  .folder-row { grid-template-columns: 1fr 1fr; }
  .folder-row label { grid-column: 1 / -1; }
  .topbar { align-items: flex-start; }
  .topbar-right { justify-content: flex-end; flex-wrap: wrap; }
  .user-name { display: none; }
}

@media (max-width: 680px) {
  .shell { width: min(100% - 20px, 1260px); padding-top: 10px; }
  .topbar { position: static; border-radius: 16px; padding: 12px; }
  .brand-inline small, .system-chip { display: none; }
  .hero { padding: 30px 22px; border-radius: 20px; }
  .hero h1 { font-size: 36px; }
  .hero-status { grid-template-columns: 1fr; }
  .hero-status div { display: flex; justify-content: space-between; align-items: center; }
  .card { padding: 26px 18px; border-radius: 18px; }
  .section-title { gap: 13px; }
  .section-title .step { flex-basis: 42px; height: 42px; border-radius: 12px; }
  .section-title h2 { font-size: 22px; }
  .grid.two, .link-stats, .summary { grid-template-columns: 1fr 1fr; }
  .folder-row { grid-template-columns: 1fr; }
  .folder-row label { grid-column: auto; }
  .folder-example { align-items: flex-start; flex-direction: column; }
  .folder-example code { width: 100%; overflow-wrap: anywhere; }
  .job { grid-template-columns: 38px minmax(0,1fr); }
  .job-state { grid-column: 2; justify-items: start; grid-auto-flow: column; justify-content: start; }
  .login-panel { padding: 32px 24px; border-radius: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}
