:root {
  color-scheme: light;
  --ink: #24190e;
  --muted: #786957;
  --line: rgba(89, 65, 40, 0.14);
  --paper: rgba(255, 253, 248, 0.9);
  --accent: #ff642e;
  --accent-deep: #e74717;
  --accent-soft: #fff0e9;
  --green: #16885c;
  --shadow: 0 18px 50px rgba(71, 44, 19, 0.11);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: #f7f2e9;
}

body {
  min-width: 320px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  color: var(--ink);
  font-family: ui-rounded, "SF Pro Rounded", "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  background:
    radial-gradient(circle at 10% 3%, rgba(255, 174, 97, 0.42), transparent 31%),
    radial-gradient(circle at 94% 18%, rgba(255, 210, 119, 0.36), transparent 29%),
    linear-gradient(165deg, #fffaf1 0%, #f7f1e7 55%, #f3ede4 100%);
}

body::before {
  position: fixed;
  inset: 0;
  pointer-events: none;
  content: "";
  opacity: 0.24;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.13'/%3E%3C/svg%3E");
}

button,
textarea,
a {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.page-shell {
  position: relative;
  width: min(100%, 620px);
  margin: 0 auto;
  padding: max(28px, env(safe-area-inset-top)) 18px max(28px, env(safe-area-inset-bottom));
}

.hero {
  padding: 14px 6px 25px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 17px;
  color: #9d4a22;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.eyebrow::before {
  width: 22px;
  height: 2px;
  border-radius: 999px;
  background: var(--accent);
  content: "";
}

h1 {
  max-width: 420px;
  margin: 0;
  font-family: "Songti SC", "STSong", "Noto Serif SC", serif;
  font-size: clamp(34px, 10vw, 52px);
  font-weight: 800;
  line-height: 1.06;
  letter-spacing: -0.04em;
}

.hero-copy {
  max-width: 450px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.7;
}

.card {
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 26px;
  background: var(--paper);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.converter-card {
  padding: 20px;
}

.field-head,
.result-head,
.actions {
  display: flex;
  align-items: center;
}

.field-head,
.result-head {
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 11px;
}

label,
.result-head h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
}

.paste-button {
  border: 0;
  color: var(--accent-deep);
  background: transparent;
  font-size: 13px;
  font-weight: 750;
  cursor: pointer;
}

.input-wrap {
  position: relative;
}

textarea {
  display: block;
  width: 100%;
  min-height: 146px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 17px;
  outline: none;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.76);
  font-size: 14px;
  line-height: 1.55;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

#source-url {
  padding: 15px 43px 15px 15px;
}

textarea:focus {
  border-color: rgba(255, 100, 46, 0.7);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(255, 100, 46, 0.1);
}

textarea::placeholder {
  color: #a89d90;
}

.clear-button {
  position: absolute;
  top: 11px;
  right: 10px;
  display: grid;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  place-items: center;
  color: #8e8275;
  background: #f1ede6;
  cursor: pointer;
}

.clear-button svg {
  width: 15px;
}

.primary-button,
.secondary-button {
  display: flex;
  min-height: 50px;
  border-radius: 15px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

.primary-button {
  width: 100%;
  margin-top: 16px;
  border: 0;
  color: white;
  background: linear-gradient(135deg, #ff7b3d, var(--accent-deep));
  box-shadow: 0 12px 25px rgba(231, 71, 23, 0.24);
}

.primary-button svg,
.secondary-button svg {
  width: 18px;
}

.primary-button:active,
.secondary-button:active {
  transform: scale(0.98);
}

.primary-button:disabled {
  opacity: 0.65;
  cursor: wait;
}

.status {
  margin: 14px 2px 0;
  font-size: 13px;
  line-height: 1.5;
}

.status.error {
  color: #bd2c2c;
}

.status.success {
  color: var(--green);
}

.result-section {
  margin-top: 15px;
  padding: 20px;
  animation: rise 260ms ease-out both;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.success-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--green);
  font-size: 12px;
  font-weight: 750;
}

.success-badge::before {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22a873;
  box-shadow: 0 0 0 4px rgba(34, 168, 115, 0.12);
  content: "";
}

#result-link {
  min-height: 128px;
  padding: 14px;
  color: #4b4035;
  background: #f7f2ea;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 12px;
  word-break: break-all;
}

.actions {
  gap: 10px;
  margin-top: 12px;
}

.secondary-button {
  flex: 1;
  border: 1px solid var(--line);
}

.secondary-button {
  color: var(--ink);
  background: #fff;
}

.secondary-button.is-copied {
  color: var(--green);
  background: #edfaf5;
}

.privacy-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin: 20px 0 0;
  color: #8b7c6c;
  font-size: 11px;
}

.privacy-note svg {
  width: 14px;
  color: var(--green);
}

.instructions-card {
  margin-top: 22px;
  padding: 22px 20px 23px;
}

.instructions-head {
  margin-bottom: 17px;
}

.instructions-kicker {
  display: block;
  margin-bottom: 6px;
  color: var(--accent-deep);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.14em;
}

.instructions-head h2 {
  margin: 0;
  font-family: "Songti SC", "STSong", "Noto Serif SC", serif;
  font-size: 24px;
  line-height: 1.2;
}

.instructions-list {
  display: grid;
  gap: 14px;
  margin: 0;
  padding: 0;
  counter-reset: instruction;
  list-style: none;
}

.instructions-list li {
  position: relative;
  min-height: 30px;
  padding: 4px 0 0 42px;
  color: #5d5043;
  font-size: 14px;
  line-height: 1.65;
  counter-increment: instruction;
}

.instructions-list li::before {
  position: absolute;
  top: 0;
  left: 0;
  display: grid;
  width: 30px;
  height: 30px;
  border-radius: 10px;
  place-items: center;
  color: var(--accent-deep);
  background: var(--accent-soft);
  font-size: 12px;
  font-weight: 850;
  content: counter(instruction, decimal-leading-zero);
}

[hidden] {
  display: none !important;
}

@media (min-width: 560px) {
  .page-shell {
    padding-top: 52px;
    padding-bottom: 52px;
  }

  .hero {
    padding-left: 12px;
    padding-bottom: 30px;
  }

  .converter-card,
  .result-section {
    padding: 26px;
  }
}

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