:root {
  --ink: #171a1f;
  --ink-soft: #343a43;
  --muted: #68707c;
  --paper: #f4f0e8;
  --paper-strong: #fffdf8;
  --line: #d9d2c6;
  --line-dark: #b9b0a2;
  --orange: #f06424;
  --orange-dark: #bf4312;
  --orange-soft: #ffe1cf;
  --green: #16845b;
  --shadow: 0 24px 70px rgba(41, 35, 27, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(rgba(23, 26, 31, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(23, 26, 31, 0.045) 1px, transparent 1px),
    var(--paper);
  background-size: 32px 32px;
  font-family: "Bahnschrift", "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
  font-size: 16px;
  line-height: 1.5;
  overflow-x: hidden;
}

button,
input {
  font: inherit;
}

a {
  color: inherit;
}

button,
[role="button"],
a {
  -webkit-tap-highlight-color: transparent;
}

[hidden] {
  display: none !important;
}

.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;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  padding: 10px 14px;
  color: white;
  background: var(--ink);
  border-radius: 6px;
  transform: translateY(-140%);
}

.skip-link:focus {
  transform: translateY(0);
}

:focus-visible {
  outline: 3px solid var(--orange);
  outline-offset: 3px;
}

.ambient {
  position: fixed;
  z-index: -1;
  width: 36vw;
  height: 36vw;
  border-radius: 50%;
  filter: blur(2px);
  pointer-events: none;
}

.ambient-one {
  top: -20vw;
  right: -8vw;
  background: radial-gradient(circle, rgba(240, 100, 36, 0.22), transparent 68%);
}

.ambient-two {
  bottom: -24vw;
  left: -12vw;
  background: radial-gradient(circle, rgba(95, 114, 102, 0.17), transparent 68%);
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1240px, calc(100% - 40px));
  min-height: 88px;
  margin: 18px auto 0;
  padding: 16px 18px;
  border: 1px solid rgba(23, 26, 31, 0.14);
  border-radius: 14px;
  background: rgba(255, 253, 248, 0.88);
  box-shadow: 0 12px 36px rgba(55, 46, 34, 0.08);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  color: var(--paper-strong);
  background: var(--ink);
  border-radius: 9px;
  box-shadow: 5px 5px 0 var(--orange);
}

.brand-mark svg {
  width: 27px;
  height: 27px;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-family: "Cascadia Code", "SFMono-Regular", monospace;
  font-size: 15px;
  letter-spacing: 0.12em;
}

.brand small {
  margin-top: 2px;
  color: var(--muted);
  font-family: "Cascadia Code", "SFMono-Regular", monospace;
  font-size: 10px;
  letter-spacing: 0.13em;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.live-pill,
.back-link {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 650;
}

.live-pill {
  gap: 8px;
  padding: 0 14px;
  color: #156342;
  background: #e3f3e9;
  border: 1px solid #b7ddc6;
}

.live-pill.offline {
  color: #8b3517;
  background: #fff0e8;
  border-color: #f2c3ac;
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 5px rgba(22, 132, 91, 0.12);
  animation: live-pulse 2.2s ease-out infinite;
}

.offline .live-dot {
  background: var(--orange-dark);
  box-shadow: none;
  animation: none;
}

.back-link {
  gap: 5px;
  padding: 0 13px;
  text-decoration: none;
  border: 1px solid var(--line);
  transition: border-color 180ms ease, background-color 180ms ease;
}

.back-link:hover {
  background: white;
  border-color: var(--ink);
}

.back-link svg {
  width: 18px;
  height: 18px;
}

.page-shell {
  width: min(1180px, calc(100% - 40px));
  margin: 28px auto 56px;
}

.operations-hero {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(480px, 1.2fr);
  gap: 20px;
  align-items: stretch;
}

.operations-heading {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 180px;
  padding: 24px 26px;
  background: rgba(255, 253, 248, 0.86);
  border: 1px solid var(--line);
  border-left: 5px solid var(--orange);
  border-radius: 14px;
  box-shadow: 0 16px 42px rgba(41, 35, 27, 0.08);
}

.operations-heading h1 {
  margin: 0;
  font-size: clamp(32px, 4vw, 48px);
  line-height: 1;
  letter-spacing: -0.045em;
}

.operations-heading > p:last-child {
  max-width: 520px;
  margin: 16px 0 0;
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1.65;
}

.eyebrow,
.section-kicker,
.board-topline,
.capacity-labels,
.site-footer,
.list-counter span {
  font-family: "Cascadia Code", "SFMono-Regular", monospace;
  letter-spacing: 0.1em;
}

.eyebrow,
.section-kicker {
  margin: 0 0 14px;
  color: var(--orange-dark);
  font-size: 12px;
  font-weight: 750;
}

.hero-notes {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 30px;
}

.hero-notes span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 12px;
  color: var(--ink-soft);
  background: rgba(255, 253, 248, 0.72);
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 13px;
  font-weight: 650;
}

.hero-notes svg {
  width: 17px;
  height: 17px;
  color: var(--orange-dark);
}

.status-board {
  padding: 24px;
  color: #f9f5ed;
  background: var(--ink);
  border-radius: 16px;
  box-shadow: 14px 14px 0 rgba(240, 100, 36, 0.85), var(--shadow);
}

.status-board-compact {
  padding: 18px 20px;
  border-radius: 14px;
  box-shadow: 8px 8px 0 rgba(240, 100, 36, 0.85), var(--shadow);
}

.status-board-compact .metric-grid {
  margin-top: 12px;
}

.status-board-compact .metric {
  min-height: 92px;
  padding: 13px 16px;
}

.status-board-compact .metric strong {
  margin-top: 8px;
  font-size: 28px;
}

.status-board-compact .metric small {
  margin-top: 5px;
}

.status-board-compact .capacity {
  margin-top: 14px;
}

.board-topline,
.capacity-labels {
  display: flex;
  justify-content: space-between;
  color: #aeb4bc;
  font-size: 10px;
}

.metric-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  margin-top: 22px;
  overflow: hidden;
  background: #3d424a;
  border: 1px solid #3d424a;
  border-radius: 10px;
}

.metric {
  min-height: 150px;
  padding: 18px;
  background: #22262d;
}

.metric span,
.metric small,
.metric strong {
  display: block;
}

.metric span {
  color: #b9bec5;
  font-size: 12px;
}

.metric strong {
  margin-top: 18px;
  font-family: "Cascadia Code", "SFMono-Regular", monospace;
  font-size: clamp(30px, 4vw, 44px);
  line-height: 1;
}

.metric small {
  margin-top: 9px;
  color: #8c939d;
  font-size: 11px;
}

.metric-primary strong {
  color: #ff8a53;
}

.capacity {
  margin-top: 24px;
}

.capacity-track,
.progress-track {
  height: 8px;
  overflow: hidden;
  background: #3a3f47;
  border-radius: 999px;
}

.capacity-track span,
.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--orange);
  border-radius: inherit;
  transition: width 260ms ease;
}

.capacity-labels {
  margin-top: 10px;
}

.board-footnote {
  margin: 22px 0 0;
  color: #aeb4bc;
  font-size: 12px;
  line-height: 1.7;
}

.admin-panel,
.files-section,
.public-notice {
  margin-top: 24px;
}

.admin-panel,
.files-section {
  padding: clamp(20px, 2.5vw, 28px);
  background: rgba(255, 253, 248, 0.92);
  border: 1px solid var(--line-dark);
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 16px;
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(27px, 3vw, 36px);
  letter-spacing: -0.035em;
}

.compact-heading {
  align-items: center;
}

.admin-panel .section-heading {
  margin-bottom: 10px;
}

.admin-panel .section-kicker {
  display: none;
}

.admin-panel {
  padding: 18px 20px;
}

.admin-panel .drop-zone {
  min-height: 80px;
  padding: 12px 16px;
}

.admin-panel .drop-icon {
  width: 42px;
  height: 42px;
}

.admin-panel .upload-limit {
  margin-top: 7px;
}

.admin-badge {
  padding: 8px 11px;
  color: #843310;
  background: var(--orange-soft);
  border: 1px solid #efb18e;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 750;
}

.admin-actions,
.login-form {
  display: flex;
  gap: 8px;
  align-items: center;
}

.logout-button,
.login-form button {
  min-height: 42px;
  padding: 0 14px;
  color: var(--ink);
  cursor: pointer;
  background: white;
  border: 1px solid var(--line-dark);
  border-radius: 7px;
  font: inherit;
  font-size: 13px;
  font-weight: 750;
}

.logout-button:hover,
.login-form button:hover {
  color: white;
  background: var(--ink);
}

.drop-zone {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 18px;
  align-items: center;
  min-height: 96px;
  padding: 16px 18px;
  cursor: pointer;
  background:
    linear-gradient(135deg, rgba(240, 100, 36, 0.055), transparent 45%),
    #faf7f0;
  border: 2px dashed #b9ad9e;
  border-radius: 12px;
  transition: border-color 180ms ease, background-color 180ms ease;
}

.drop-zone:hover,
.drop-zone.is-dragging {
  background-color: #fff8ef;
  border-color: var(--orange);
}

.drop-icon {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  color: var(--orange-dark);
  background: var(--orange-soft);
  border-radius: 12px;
}

.drop-icon svg {
  width: 25px;
  height: 25px;
}

.drop-zone strong,
.drop-zone span {
  display: block;
}

.drop-zone strong {
  font-size: 17px;
}

.drop-zone div span {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

.choose-button {
  min-height: 46px;
  padding: 0 18px;
  color: white;
  cursor: pointer;
  background: var(--ink);
  border: 0;
  border-radius: 7px;
  font-weight: 700;
  transition: background-color 180ms ease;
}

.choose-button:hover {
  background: var(--orange-dark);
}

.upload-limit {
  margin: 12px 2px 0;
  color: var(--muted);
  font-size: 12px;
}

.upload-progress {
  margin-top: 20px;
  padding: 18px;
  background: var(--ink);
  border-radius: 10px;
  color: white;
}

.progress-copy {
  display: flex;
  justify-content: space-between;
  gap: 20px;
}

.progress-copy span {
  max-width: 80%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.progress-copy strong {
  color: #ff8a53;
  font-family: "Cascadia Code", "SFMono-Regular", monospace;
}

.progress-track {
  margin-top: 12px;
  background: #424751;
}

.upload-progress p {
  margin: 10px 0 0;
  color: #aeb4bc;
  font-size: 12px;
}

.public-notice {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 20px 22px;
  background: rgba(255, 253, 248, 0.84);
  border: 1px solid var(--line);
  border-left: 5px solid var(--green);
  border-radius: 10px;
}

.notice-icon {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  color: var(--green);
  background: #e3f3e9;
  border-radius: 8px;
}

.notice-icon svg {
  width: 25px;
  height: 25px;
}

.public-notice strong,
.public-notice span {
  display: block;
}

.public-notice span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

.login-form input:not(.sr-only) {
  width: min(220px, 32vw);
  min-height: 42px;
  padding: 0 12px;
  color: var(--ink);
  background: white;
  border: 1px solid var(--line-dark);
  border-radius: 7px;
  font: inherit;
  font-size: 13px;
}

.login-form input:not(.sr-only):focus {
  outline: 3px solid rgba(236, 91, 26, 0.2);
  border-color: var(--orange);
}

.list-counter {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.list-counter strong {
  color: var(--orange-dark);
  font-family: "Cascadia Code", "SFMono-Regular", monospace;
  font-size: 30px;
}

.list-counter span {
  color: var(--muted);
  font-size: 10px;
}

.file-table-header,
.file-download {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 120px 180px 86px;
  align-items: center;
}

.file-table-header {
  padding: 0 68px 10px 14px;
  color: var(--muted);
  font-family: "Cascadia Code", "SFMono-Regular", monospace;
  font-size: 10px;
  letter-spacing: 0.08em;
}

.file-list {
  border-top: 1px solid var(--line-dark);
}

.file-row {
  position: relative;
  border-bottom: 1px solid var(--line);
  transition: background-color 160ms ease;
}

.file-row:hover {
  background: #fff8ef;
}

.file-download {
  min-height: 88px;
  padding: 12px 68px 12px 14px;
  text-decoration: none;
}

.file-download::after {
  content: "";
  position: absolute;
  inset: 0;
}

.file-download:focus-visible::after {
  outline: 3px solid var(--orange);
  outline-offset: -3px;
}

.file-main {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  min-width: 0;
}

.file-identity {
  min-width: 0;
}

.file-type {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  color: #fff;
  background: var(--ink-soft);
  border-radius: 9px;
  font-family: "Cascadia Code", "SFMono-Regular", monospace;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.05em;
}

.file-type.image { background: #b84f1f; }
.file-type.archive { background: #6f5a2f; }
.file-type.document { background: #315f7e; }
.file-type.video { background: #664b78; }
.file-type.audio { background: #417254; }

.file-identity strong,
.file-identity small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-identity strong {
  font-size: 15px;
}

.file-identity small {
  margin-top: 5px;
  color: var(--muted);
  font-family: "Cascadia Code", "SFMono-Regular", monospace;
  font-size: 10px;
}

.file-size,
.file-time {
  color: var(--ink-soft);
  font-family: "Cascadia Code", "SFMono-Regular", monospace;
  font-size: 12px;
}

.download-action {
  display: inline-flex;
  align-items: center;
  justify-self: end;
  gap: 6px;
  color: var(--orange-dark);
  font-size: 13px;
  font-weight: 750;
}

.download-action svg {
  width: 18px;
  height: 18px;
}

.delete-button {
  position: absolute;
  z-index: 2;
  top: 50%;
  right: 14px;
  display: grid;
  width: 40px;
  height: 40px;
  padding: 0;
  place-items: center;
  color: #8b3517;
  cursor: pointer;
  background: #fff0e8;
  border: 1px solid #efc0a8;
  border-radius: 7px;
  transform: translateY(-50%);
  transition: color 160ms ease, background-color 160ms ease, border-color 160ms ease;
}

.delete-button:hover {
  color: white;
  background: #9e3511;
  border-color: #9e3511;
}

.delete-button svg {
  width: 19px;
  height: 19px;
}

.empty-state {
  padding: 40px 20px 30px;
  text-align: center;
}

.empty-state > span {
  display: grid;
  width: 72px;
  height: 72px;
  margin: 0 auto 18px;
  place-items: center;
  color: var(--orange-dark);
  background: var(--orange-soft);
  border-radius: 14px;
}

.empty-state svg {
  width: 36px;
  height: 36px;
}

.empty-state strong {
  display: block;
  font-size: 20px;
}

.empty-state p {
  margin: 7px 0 0;
  color: var(--muted);
}

.about-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.8fr);
  gap: clamp(30px, 6vw, 72px);
  align-items: end;
  margin-top: 40px;
  padding: 38px 6px 12px;
  border-top: 1px solid var(--line-dark);
}

.about-section h2 {
  max-width: 700px;
  margin: 0;
  font-size: clamp(34px, 5vw, 62px);
  line-height: 1;
  letter-spacing: -0.05em;
}

.about-section h2 span {
  color: var(--orange);
}

.about-copy > p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1.75;
}

.about-copy .hero-notes {
  margin-top: 20px;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto 28px;
  padding-top: 18px;
  color: var(--muted);
  border-top: 1px solid var(--line-dark);
  font-size: 10px;
}

.toast {
  position: fixed;
  z-index: 80;
  right: 22px;
  bottom: 22px;
  max-width: min(420px, calc(100% - 44px));
  padding: 14px 16px;
  color: white;
  background: var(--ink);
  border-left: 5px solid var(--orange);
  border-radius: 8px;
  box-shadow: var(--shadow);
  font-size: 14px;
}

.toast.error {
  border-left-color: #d8422b;
}

.reveal {
  animation: reveal-up 620ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.reveal-two { animation-delay: 90ms; }
.reveal-three { animation-delay: 160ms; }
.reveal-four { animation-delay: 220ms; }

@keyframes reveal-up {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes live-pulse {
  0% { box-shadow: 0 0 0 0 rgba(22, 132, 91, 0.35); }
  70% { box-shadow: 0 0 0 7px rgba(22, 132, 91, 0); }
  100% { box-shadow: 0 0 0 0 rgba(22, 132, 91, 0); }
}

@media (max-width: 900px) {
  .operations-hero,
  .about-section {
    grid-template-columns: 1fr;
  }

  .file-table-header {
    display: none;
  }

  .file-download {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "identity action"
      "size time";
    gap: 8px 20px;
    min-height: 108px;
    padding-right: 64px;
  }

  .file-main { grid-area: identity; }
  .file-size { grid-area: size; padding-left: 68px; }
  .file-time { grid-area: time; justify-self: end; }
  .download-action { grid-area: action; }
}

@media (max-width: 660px) {
  .site-header {
    width: min(100% - 24px, 1240px);
    min-height: 74px;
    margin-top: 12px;
    padding: 12px;
  }

  .brand-mark {
    width: 42px;
    height: 42px;
    box-shadow: 3px 3px 0 var(--orange);
  }

  .brand small,
  .live-pill {
    display: none;
  }

  .back-link {
    width: 42px;
    padding: 0;
    justify-content: center;
  }

  .back-link svg {
    width: 20px;
    height: 20px;
  }

  .back-link {
    font-size: 0;
  }

  .page-shell {
    width: min(100% - 24px, 1180px);
    margin-top: 22px;
  }

  .operations-heading {
    min-height: 0;
    padding: 20px;
  }

  .status-board {
    padding: 18px;
    box-shadow: 8px 8px 0 rgba(240, 100, 36, 0.85), var(--shadow);
  }

  .metric {
    min-height: 130px;
    padding: 14px;
  }

  .metric strong {
    font-size: 28px;
  }

  .admin-panel,
  .files-section,
  .public-notice {
    margin-top: 18px;
  }

  .admin-panel,
  .files-section {
    padding: 18px;
    border-radius: 12px;
  }

  .drop-zone {
    grid-template-columns: auto 1fr;
    padding: 16px;
  }

  .choose-button {
    grid-column: 1 / -1;
    width: 100%;
  }

  .public-notice {
    grid-template-columns: auto 1fr;
  }

  .login-form {
    grid-column: 1 / -1;
    width: 100%;
  }

  .login-form input:not(.sr-only) {
    width: 100%;
    min-width: 0;
  }

  .login-form button {
    flex: 0 0 auto;
  }

  .section-heading {
    align-items: flex-start;
  }

  .section-heading h2 {
    font-size: 30px;
  }

  .about-section {
    gap: 22px;
    margin-top: 28px;
    padding-top: 28px;
  }

  .about-section h2 {
    font-size: clamp(34px, 11vw, 48px);
  }

  .list-counter {
    display: block;
    text-align: right;
  }

  .list-counter strong,
  .list-counter span {
    display: block;
  }

  .file-download {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "identity identity"
      "size time";
    padding: 14px 54px 14px 4px;
  }

  .download-action {
    display: none;
  }

  .file-size {
    padding-left: 68px;
  }

  .delete-button {
    right: 4px;
  }

  .site-footer {
    display: grid;
    gap: 8px;
    width: min(100% - 24px, 1180px);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
