:root {
  color-scheme: light;
  --bg: #f3f5f1;
  --surface: #ffffff;
  --ink: #17211b;
  --muted: #66736b;
  --faint: #8b968f;
  --line: #dce3dc;
  --line-strong: #c7d2c8;
  --accent: #176b52;
  --accent-dark: #0f513e;
  --accent-soft: #e8f3ed;
  --danger: #b42318;
  --danger-bg: #fff1ef;
  --danger-line: #f2c7c1;
  --shadow: 0 24px 70px rgba(31, 49, 38, 0.1), 0 3px 12px rgba(31, 49, 38, 0.04);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-height: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  padding: 36px 20px;
  display: grid;
  place-items: center;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 8%, rgba(164, 199, 177, 0.28), transparent 32rem),
    radial-gradient(circle at 92% 92%, rgba(214, 198, 164, 0.2), transparent 30rem),
    var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.35;
  background-image: linear-gradient(rgba(38, 65, 48, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(38, 65, 48, 0.035) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, black, transparent 80%);
}

button,
input {
  font: inherit;
}

a {
  color: var(--accent);
}

.shell {
  position: relative;
  width: min(100%, 760px);
  margin: auto;
}

.shell-narrow {
  width: min(100%, 460px);
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  padding: 0 6px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  width: 39px;
  height: 39px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: #f5fff9;
  background: var(--ink);
  box-shadow: 0 6px 18px rgba(23, 33, 27, 0.18);
}

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

.brand-name {
  display: block;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.25;
}

.brand-sub {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.16em;
}

.host-pill {
  padding: 5px 10px;
  border: 1px solid rgba(23, 107, 82, 0.14);
  border-radius: 999px;
  color: var(--accent);
  background: rgba(232, 243, 237, 0.68);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
}

.card {
  padding: clamp(26px, 5vw, 44px);
  border: 1px solid rgba(209, 220, 211, 0.9);
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.card-compact {
  padding: clamp(26px, 7vw, 38px);
}

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 12px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.kicker-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #34a47c;
  box-shadow: 0 0 0 4px rgba(52, 164, 124, 0.12);
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 10px;
  font-size: clamp(29px, 5vw, 40px);
  font-weight: 750;
  letter-spacing: -0.04em;
  line-height: 1.2;
}

h2 {
  margin-bottom: 8px;
  font-size: 24px;
  letter-spacing: -0.03em;
}

.lead {
  max-width: 560px;
  margin-bottom: 28px;
  color: var(--muted);
  font-size: 15px;
}

.dropzone {
  position: relative;
  display: flex;
  min-height: 240px;
  padding: 30px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 1.5px dashed var(--line-strong);
  border-radius: 18px;
  background: #fafbf9;
  cursor: pointer;
  text-align: center;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease,
    box-shadow 160ms ease;
}

.dropzone:hover,
.dropzone.dragging {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.dropzone:hover {
  box-shadow: inset 0 0 0 1px rgba(23, 107, 82, 0.06);
}

.dropzone.dragging {
  transform: scale(1.008);
  box-shadow: 0 0 0 5px rgba(23, 107, 82, 0.09);
}

.dropzone.upload-disabled {
  pointer-events: none;
  opacity: 0.68;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

#fileInput:focus-visible + .dropzone {
  outline: 3px solid rgba(23, 107, 82, 0.24);
  outline-offset: 3px;
}

.drop-icon {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  margin-bottom: 17px;
  border: 1px solid #d8e6dc;
  border-radius: 17px;
  color: var(--accent);
  background: #fff;
  box-shadow: 0 8px 24px rgba(23, 107, 82, 0.08);
}

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

.drop-title {
  margin-bottom: 5px;
  font-size: 17px;
  font-weight: 700;
}

.drop-subtitle {
  color: var(--muted);
  font-size: 13px;
}

.drop-hint {
  margin-top: 18px;
  color: var(--faint);
  font-size: 11px;
}

.file-card {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-top: 16px;
  padding: 14px 15px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.file-badge {
  flex: 0 0 auto;
  padding: 5px 7px;
  border-radius: 7px;
  color: var(--accent);
  background: var(--accent-soft);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.file-copy {
  min-width: 0;
  flex: 1;
}

.file-name {
  display: block;
  overflow: hidden;
  font-size: 14px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-size {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.icon-button {
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  border: 0;
  border-radius: 9px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-size: 21px;
  line-height: 1;
}

.icon-button:hover {
  color: var(--danger);
  background: var(--danger-bg);
}

.upload-actions {
  margin-top: 18px;
}

.progress-copy {
  display: flex;
  justify-content: space-between;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 12px;
}

.progress-copy strong {
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

progress {
  width: 100%;
  height: 8px;
  display: block;
  margin-bottom: 16px;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  background: #e9eee9;
  appearance: none;
}

progress::-webkit-progress-bar {
  border-radius: 999px;
  background: #e9eee9;
}

progress::-webkit-progress-value {
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), #37a77d);
  transition: value 150ms ease;
}

progress::-moz-progress-bar {
  border-radius: 999px;
  background: var(--accent);
}

.button {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border: 1px solid transparent;
  border-radius: 12px;
  color: #fff;
  background: var(--accent);
  box-shadow: 0 7px 18px rgba(23, 107, 82, 0.16);
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  transition: background 150ms ease, transform 150ms ease, box-shadow 150ms ease;
}

.button:hover {
  background: var(--accent-dark);
  box-shadow: 0 9px 22px rgba(23, 107, 82, 0.22);
  transform: translateY(-1px);
}

.button:active {
  transform: translateY(0);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
  box-shadow: none;
  transform: none;
}

.button-block {
  width: 100%;
}

.button-secondary {
  color: var(--ink);
  border-color: var(--line);
  background: #fff;
  box-shadow: none;
}

.button-secondary:hover {
  color: var(--accent);
  border-color: #b8cfbf;
  background: var(--accent-soft);
  box-shadow: none;
}

.text-button {
  padding: 6px 10px;
  border: 0;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-size: 13px;
}

.text-button:hover {
  color: var(--accent);
  background: var(--accent-soft);
}

#uploadButton {
  width: 100%;
}

.alert {
  margin-top: 16px;
  padding: 11px 14px;
  border: 1px solid var(--danger-line);
  border-radius: 11px;
  color: var(--danger);
  background: var(--danger-bg);
  font-size: 13px;
}

.alert:empty {
  display: none;
}

.notice {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-top: 24px;
  padding-top: 19px;
  border-top: 1px solid #edf0ec;
  color: var(--faint);
  font-size: 12px;
}

.notice svg {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  margin-top: 3px;
}

.success-view {
  text-align: center;
}

.success-icon {
  width: 66px;
  height: 66px;
  display: grid;
  place-items: center;
  margin: 4px auto 18px;
  border-radius: 50%;
  color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 0 9px #f4f9f5;
}

.success-icon svg {
  width: 31px;
  height: 31px;
}

.success-view h2 {
  margin-bottom: 7px;
}

.success-view > p {
  color: var(--muted);
  font-size: 14px;
}

.file-details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 24px 0 16px;
  text-align: left;
}

.detail {
  min-width: 0;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fafbf9;
}

.detail-wide {
  grid-column: 1 / -1;
}

.detail dt {
  margin-bottom: 3px;
  color: var(--faint);
  font-size: 11px;
}

.detail dd {
  margin: 0;
  overflow: hidden;
  font-size: 13px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.download-link {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  padding: 9px 10px 9px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f7f9f6;
}

.download-link code {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  color: var(--accent);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.copy-button {
  flex: 0 0 auto;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: #fff;
  cursor: pointer;
  font-size: 11px;
}

.copy-button:hover {
  color: var(--accent);
  border-color: #b8cfbf;
}

.success-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.success-actions .text-button {
  align-self: center;
}

.page-footer {
  margin-top: 19px;
  color: var(--faint);
  font-size: 11px;
  text-align: center;
}

.auth-card {
  text-align: center;
}

.auth-icon {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  margin: 0 auto 18px;
  border: 1px solid #d8e6dc;
  border-radius: 17px;
  color: var(--accent);
  background: var(--accent-soft);
}

.auth-icon svg {
  width: 26px;
  height: 26px;
}

.auth-card h1 {
  font-size: 29px;
}

.auth-card .lead {
  margin-bottom: 25px;
  font-size: 14px;
}

.login-form {
  text-align: left;
}

.field {
  margin-bottom: 16px;
}

.field label {
  display: block;
  margin-bottom: 7px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 650;
}

.field input {
  width: 100%;
  min-height: 47px;
  padding: 11px 13px;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  outline: none;
  color: var(--ink);
  background: #fcfdfb;
  font-size: 14px;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.field input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(23, 107, 82, 0.12);
}

.login-form .button {
  margin-top: 5px;
}

.login-footnote {
  margin: 20px 0 0;
  color: var(--faint);
  font-size: 12px;
}

.state-card {
  text-align: center;
}

.state-card h1 {
  font-size: 30px;
}

.state-card .button {
  margin-top: 8px;
}

.state-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 22px;
}

.logout-form {
  margin-top: 18px;
}

.logout-button {
  padding: 4px 8px;
  border: 0;
  color: var(--faint);
  background: transparent;
  cursor: pointer;
  font-size: 12px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.logout-button:hover {
  color: var(--muted);
}

.error-code {
  display: inline-block;
  margin-bottom: 12px;
  color: var(--accent);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
}

@media (max-width: 600px) {
  body {
    padding: 22px 14px;
  }

  .site-header {
    margin-bottom: 14px;
  }

  .host-pill {
    max-width: 46%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .card {
    border-radius: 21px;
  }

  .dropzone {
    min-height: 215px;
    padding: 24px 16px;
  }

  .file-details {
    grid-template-columns: 1fr;
  }

  .detail-wide {
    grid-column: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
