:root {
  color-scheme: light;
  --bg: #f7f7f5;
  --panel: #ffffff;
  --line: #e8e8e1;
  --line-strong: #d5d5cc;
  --text: #1a1a18;
  --muted: #76746e;
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.035);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

h1,
p {
  margin: 0;
}

.page-shell {
  width: min(1100px, calc(100% - 24px));
  margin: 0 auto;
  padding: 16px 0 28px;
}

.topbar {
  padding: 10px 2px 16px;
}

.topbar h1 {
  font-size: 26px;
  line-height: 1.2;
  letter-spacing: -0.03em;
}

.uploader {
  margin-bottom: 18px;
}

.dropzone {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 260px;
  padding: 28px;
  text-align: center;
  cursor: pointer;
  background: var(--panel);
  border: 1px dashed var(--line-strong);
  border-radius: 16px;
  box-shadow: var(--shadow);
  transition: border-color 0.18s ease, background 0.18s ease;
}

.dropzone.is-disabled {
  cursor: not-allowed;
}

.dropzone.is-uploading {
  background: #efefeb;
  border-color: #c8c8bf;
}

.dropzone:hover,
.dropzone.is-dragover {
  border-color: #bcbcb3;
  background: #fcfcfb;
}

.dropzone-title {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.dropzone-subtitle {
  margin-top: 10px;
  color: var(--muted);
  font-size: 14px;
}

.dropzone-default,
.dropzone-progress,
.dropzone-success {
  display: grid;
  justify-items: center;
}

.dropzone-progress,
.dropzone-success {
  gap: 12px;
}

.progress-ring {
  position: relative;
  width: 132px;
  height: 132px;
}

.progress-ring-svg {
  width: 132px;
  height: 132px;
  transform: rotate(-90deg);
}

.progress-ring-track,
.progress-ring-fill {
  fill: none;
  stroke-width: 8;
}

.progress-ring-track {
  stroke: #ddddd6;
}

.progress-ring-fill {
  stroke: #1d1d1b;
  stroke-linecap: round;
  stroke-dasharray: 326.73;
  stroke-dashoffset: 326.73;
  transition: stroke-dashoffset 0.12s linear;
}

.progress-ring-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.progress-size {
  color: var(--muted);
  font-size: 14px;
}

.success-ring {
  width: 132px;
  height: 132px;
}

.success-ring-svg {
  width: 132px;
  height: 132px;
}

.success-ring-circle,
.success-ring-check {
  fill: none;
  stroke: #1d1d1b;
}

.success-ring-circle {
  stroke-width: 8;
  stroke-linecap: round;
  stroke-dasharray: 326.73;
  stroke-dashoffset: 326.73;
  animation: success-circle 0.75s ease-in-out forwards;
}

.success-ring-check {
  stroke-width: 8;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 120;
  stroke-dashoffset: 120;
  animation: success-check 0.5s ease-out forwards 0.68s;
}

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

@keyframes success-circle {
  from {
    stroke-dashoffset: 326.73;
  }

  to {
    stroke-dashoffset: 653.46;
  }
}

@keyframes success-check {
  from {
    stroke-dashoffset: 120;
  }

  to {
    stroke-dashoffset: 0;
  }
}

.message {
  min-height: 22px;
  margin: 10px 2px 0;
  color: var(--muted);
  font-size: 14px;
}

.message.is-error {
  color: #b04343;
}

.copy-toast {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(20, 20, 18, 0.12);
  z-index: 1000;
}

.copy-toast-card {
  display: grid;
  justify-items: center;
  gap: 12px;
  min-width: 180px;
  padding: 22px 20px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(232, 232, 225, 0.95);
  border-radius: 18px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(8px);
}

.gallery {
  display: grid;
  gap: 14px;
}

.result-item {
  display: grid;
  grid-template-columns: minmax(0, 340px) minmax(0, 1fr);
  gap: 16px;
  padding: 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.result-preview {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: contain;
  display: block;
  background: #fbfbfa;
  border: 1px solid var(--line);
  border-radius: 14px;
}

.result-actions {
  display: grid;
  align-content: start;
  gap: 10px;
  min-width: 0;
}

.result-actions-group {
  display: grid;
  gap: 6px;
}

.copy-label {
  color: var(--muted);
  font-size: 13px;
}

.copy-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.result-copy-input {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fcfcfb;
  color: var(--text);
  font: inherit;
}

.copy-button {
  min-width: 76px;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f3f3f1;
  color: var(--text);
  font: inherit;
  cursor: pointer;
}

.copy-button:hover {
  background: #ededeb;
}

@media (max-width: 860px) {
  .page-shell {
    width: min(100%, calc(100% - 16px));
    padding: 8px 0 16px;
  }

  .topbar {
    padding: 10px 2px 12px;
  }

  .dropzone {
    min-height: 180px;
    padding: 22px 18px;
  }

  .dropzone-title {
    font-size: 18px;
  }

  .progress-ring,
  .progress-ring-svg {
    width: 116px;
    height: 116px;
  }

  .success-ring,
  .success-ring-svg {
    width: 116px;
    height: 116px;
  }

  .copy-toast-card {
    width: min(100%, 220px);
  }

  .result-item {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .copy-row {
    grid-template-columns: 1fr;
  }

  .copy-button {
    min-height: 46px;
  }
}
