:root {
  --bg: #ffffff;
  --text: #1d1d1f;
  --secondary: #6e6e73;
  --border: #d2d2d7;
  --card: #f5f5f7;
  --accent: #007aff;
  --accent-pressed: #0062cc;
  --error: #ff3b30;
  --radius: 14px;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 4px 16px rgba(0, 0, 0, 0.04);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display",
    "Helvetica Neue", Helvetica, Arial, "PingFang HK", "PingFang TC",
    "Hiragino Sans CNS", "Noto Sans TC", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  min-height: 100dvh;
  line-height: 1.47;
}

.page {
  max-width: 560px;
  margin: 0 auto;
  padding: 48px 24px 64px;
}

.header {
  margin-bottom: 36px;
}

.header h1 {
  margin: 0;
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.subtitle {
  margin: 8px 0 0;
  color: var(--secondary);
  font-size: 17px;
}

.field-block {
  margin-bottom: 28px;
}

.input-wrap {
  display: flex;
  align-items: center;
  background: var(--card);
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 14px 16px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  box-shadow: var(--shadow);
}

.input-wrap:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.15);
  background: #fff;
}

#amount {
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 32px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
  width: 100%;
  min-width: 0;
  font-variant-numeric: tabular-nums;
}

#amount::placeholder {
  color: #c7c7cc;
  font-weight: 500;
}

.error {
  margin: 10px 0 0;
  font-size: 14px;
  color: var(--error);
}

.cards {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 18px 18px 20px;
  box-shadow: var(--shadow);
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.card-head h2 {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.copy-btn {
  appearance: none;
  border: 0;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: 980px;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s ease, opacity 0.15s ease, transform 0.1s ease;
}

.copy-btn:hover:not(:disabled) {
  background: var(--accent-pressed);
}

.copy-btn:active:not(:disabled) {
  transform: scale(0.97);
}

.copy-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.copy-btn.copied {
  background: #34c759;
}

.copy-btn.failed {
  background: var(--error);
}

.output {
  margin: 0;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.4;
  word-break: break-word;
  min-height: 1.4em;
  color: var(--text);
}

.output.is-empty {
  color: #c7c7cc;
  font-weight: 500;
}

@media (max-width: 480px) {
  .page {
    padding: 36px 20px 48px;
  }

  .header h1 {
    font-size: 28px;
  }

  #amount {
    font-size: 28px;
  }

  .output {
    font-size: 19px;
  }
}
