:root {
  color-scheme: light;
  --green: #24684f;
  --green-dark: #1b5240;
  --green-tint: #edf5f0;
  --green-line: #cfe4d8;
  --border: #d8dedb;
  --border-soft: #e6eae8;
  --text: #1f2a26;
  --muted: #6b7570;
  --bg: #f6f7f6;
  --card: #ffffff;
  --red: #c62828;
  --red-tint: #fdeceb;
  --radius: 12px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  font-size: 18px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* Top bar */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: calc(12px + env(safe-area-inset-top)) 16px 12px;
  background: var(--card);
  border-bottom: 1px solid var(--border-soft);
}
.brand { font-weight: 700; font-size: 21px; }
.lang-toggle {
  flex: none;
  font: inherit;
  font-size: 17px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  color: var(--muted);
  cursor: pointer;
}
.lang-toggle .sep { margin: 0 4px; color: var(--border); }
.lang-toggle [data-lang].active { color: var(--green); font-weight: 650; }

main {
  flex: 1;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: 16px 16px calc(24px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Cards */
.card {
  background: var(--card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 22px 18px;
  display: flex;
  flex-direction: column;
}
.card h1 { font-size: 26px; font-weight: 700; margin: 0 0 6px; line-height: 1.25; }
.card h2 { font-size: 22px; font-weight: 700; margin: 0 0 12px; }
.hint { color: var(--muted); font-size: 17px; margin: 0 0 6px; }

.field-label {
  display: block;
  font-size: 18px;
  font-weight: 650;
  margin: 24px 0 10px;
}
.optional { color: var(--muted); font-weight: 400; font-size: 16px; }

/* Highlight chips */
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 48px;
  padding: 10px 16px;
  font: inherit;
  font-size: 18px;
  color: var(--text);
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
  transition: background-color .15s, border-color .15s, color .15s, transform .08s ease;
}
.chip:hover { border-color: var(--green); }
.chip:active { transform: scale(.97); }
.chip svg {
  width: 18px;
  height: 18px;
  margin-left: -4px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  display: none;
}
.chip[aria-pressed="true"] { background: var(--green); border-color: var(--green); color: #fff; }
.chip[aria-pressed="true"] svg { display: block; }
.chips.invalid .chip { border-color: var(--red); }

/* Inputs */
.input {
  width: 100%;
  font: inherit;
  font-size: 19px;
  color: var(--text);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.input:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(36, 104, 79, .15); }
.select {
  height: 60px;
  padding: 0 46px 0 16px;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231f2a26' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 22px;
}
.select.placeholder { color: var(--muted); }
.textarea { min-height: 110px; padding: 14px 16px; line-height: 1.5; resize: vertical; }
.textarea::placeholder { color: #9aa39f; }

/* Buttons */
.btn-primary,
.btn-secondary {
  margin-top: 30px;
  min-height: 62px;
  width: 100%;
  padding: 10px 16px;
  font: inherit;
  font-size: 22px;
  font-weight: 700;
  border-radius: 8px;
  cursor: pointer;
}
.btn-primary { color: #fff; background: var(--green); border: 2px solid var(--green); }
.btn-primary:hover { background: var(--green-dark); border-color: var(--green-dark); }
.btn-secondary { color: var(--green); background: var(--card); border: 2px solid var(--green); }
.btn-secondary:hover { background: var(--green-tint); }
.btn-link {
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  text-align: center;
  margin-top: 12px;
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 54px;
  padding: 8px 12px;
  font: inherit;
  font-size: 18px;
  font-weight: 650;
  color: var(--green);
  background: var(--card);
  border: 1.5px solid var(--green);
  border-radius: 8px;
  cursor: pointer;
}
.btn-outline:hover { background: var(--green-tint); }
.btn-outline svg { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn-outline.copied { background: var(--green); color: #fff; }

/* Result */
.result { scroll-margin-top: 16px; }
.review-box {
  background: var(--green-tint);
  border: 1px solid var(--green-line);
  border-radius: 10px;
  padding: 16px 18px;
  font-size: 19px;
  line-height: 1.6;
  white-space: pre-wrap;
  user-select: text;
  -webkit-user-select: text;
}
.review-box.fresh { animation: fade .3s ease; }
@keyframes fade { from { opacity: .3; } }
.review-count { color: var(--muted); font-size: 15px; text-align: right; margin: 6px 0 14px; }
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.platform-title {
  text-align: center;
  font-weight: 650;
  color: var(--muted);
  margin: 26px 0 0;
}
.platform-title + .btn-link { margin-top: 12px; }

.note { text-align: center; color: var(--muted); font-size: 15px; margin: 0; padding: 0 8px; }

/* Alerts */
.alert {
  display: flex;
  gap: 12px;
  margin-top: 14px;
  padding: 16px;
  border-radius: 10px;
  background: var(--red-tint);
  border: 2px solid var(--red);
  color: var(--red);
}
.alert.shake { animation: shake .45s ease; }
.alert-icon { flex: none; width: 32px; height: 32px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.alert-body strong { display: block; font-size: 22px; line-height: 1.3; }
.alert-body p { margin: 6px 0 0; font-size: 18px; color: #8e1f1f; }
@keyframes shake {
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}
