:root {
  color-scheme: light;
  --bg: #f4f7f6;
  --panel: #ffffff;
  --text: #17211f;
  --muted: #62706b;
  --line: #dce5e1;
  --accent: #0f766e;
  --accent-strong: #0b5d57;
  --danger: #b42318;
  --shadow: 0 24px 60px rgba(19, 38, 35, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Microsoft YaHei", sans-serif;
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.12), transparent 32%),
    linear-gradient(315deg, rgba(25, 105, 146, 0.1), transparent 28%),
    var(--bg);
  color: var(--text);
}

button,
input {
  font: inherit;
}

.app {
  width: min(100%, 760px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 48px 20px;
  display: grid;
  place-items: center;
}

.panel {
  width: 100%;
  background: var(--panel);
  border: 1px solid rgba(220, 229, 225, 0.9);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: clamp(24px, 5vw, 40px);
}

.heading {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 32px;
}

.mark {
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #e4f3ef;
  color: var(--accent);
}

.mark svg,
button svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

h1 {
  margin: 0;
  font-size: clamp(28px, 6vw, 42px);
  line-height: 1.1;
  font-weight: 750;
}

p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.form {
  margin-bottom: 24px;
}

label,
.label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 650;
}

.input-row {
  display: grid;
  grid-template-columns: 1fr 48px;
  gap: 10px;
}

input {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: #fbfdfc;
  letter-spacing: 0;
}

input:focus,
button:focus-visible {
  outline: 3px solid rgba(15, 118, 110, 0.22);
  outline-offset: 2px;
}

.icon-button,
.copy-button {
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}

.icon-button {
  min-height: 48px;
  display: grid;
  place-items: center;
  color: var(--muted);
  background: #edf3f1;
}

.icon-button:hover {
  color: var(--text);
  background: #e2ebe8;
}

.error {
  min-height: 24px;
  margin-top: 8px;
  color: var(--danger);
  font-size: 14px;
}

.code-area {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: end;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfa;
}

.code {
  display: block;
  min-height: 60px;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: clamp(40px, 12vw, 64px);
  line-height: 1;
  font-weight: 800;
  letter-spacing: 0;
  color: var(--text);
}

.copy-button {
  min-height: 48px;
  padding: 0 18px;
  display: inline-flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  color: white;
  background: var(--accent);
  font-weight: 700;
}

.copy-button:hover:not(:disabled) {
  background: var(--accent-strong);
}

.copy-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.timer {
  margin-top: 18px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  color: var(--muted);
  font-size: 14px;
}

.progress {
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent) var(--value, 0%), #dfe8e5 0);
}

@media (max-width: 560px) {
  .app {
    padding: 20px 14px;
  }

  .heading,
  .code-area {
    grid-template-columns: 1fr;
  }

  .code-area {
    align-items: stretch;
  }

  .copy-button {
    width: 100%;
  }
}
