:root {
  --background: #ffffff;
  --foreground: #0a0a0a;
  --muted: #737373;
  --muted-surface: #fafafa;
  --border: #e5e5e5;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.06);
  --radius-xl: 1rem;
  --radius-2xl: 1.25rem;
  --font: "Geist", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}

button,
input,
textarea {
  font: inherit;
}

button {
  border: 0;
  background: none;
  color: inherit;
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

img,
svg {
  display: block;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

#app {
  min-height: 100vh;
}

.page {
  position: relative;
  margin: 0 auto;
  display: flex;
  min-height: 100vh;
  max-width: 28rem;
  flex-direction: column;
  padding: 1.5rem 1.5rem 3rem;
}

.page--fork {
  justify-content: space-between;
}

.page--no {
  justify-content: space-between;
}

.app-header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.5rem;
}

.brand-name {
  min-width: 0;
  max-width: 9rem;
  margin: 0 auto;
  word-break: break-word;
  text-align: center;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.35;
}

.back-link {
  justify-self: start;
  padding: 0.5rem 0;
  color: var(--muted);
  font-size: 0.875rem;
  text-align: left;
}

.back-link--placeholder {
  min-height: 2rem;
}

.lang-toggle {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--background);
  box-shadow: var(--shadow-sm);
}

.lang-chip {
  padding: 0.375rem 0.75rem;
  color: rgba(10, 10, 10, 0.7);
  font-size: 0.75rem;
  font-weight: 500;
  transition: background-color 140ms ease, color 140ms ease;
}

.lang-chip.is-active {
  background: var(--foreground);
  color: var(--background);
}

.lang-divider {
  width: 1px;
  height: 1rem;
  background: var(--border);
}

.app-footer {
  margin-top: auto;
  padding-top: 2rem;
  color: var(--muted);
  font-size: 0.6875rem;
  text-align: center;
}

.fork-panel {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  padding: 1rem 0;
  text-align: center;
}

.logo {
  border: 1px solid #d4d4d8;
  background: var(--background);
  object-fit: contain;
  padding: 0.5rem;
}

.logo--hero {
  width: 6rem;
  height: 6rem;
  border-radius: 999px;
}

.logo--compact {
  width: 4rem;
  height: 4rem;
  border-radius: 999px;
}

.hero-title,
.section-title,
.composer-title {
  margin: 0;
  font-weight: 600;
  line-height: 1.25;
}

.hero-title {
  font-size: 1.5rem;
}

.section-title,
.composer-title {
  font-size: 1.25rem;
}

.section-subtitle,
.composer-subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.45;
}

.fork-actions {
  display: flex;
  width: 100%;
  flex-direction: column;
  gap: 1rem;
}

.fork-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.fork-emoji {
  font-size: 3rem;
  line-height: 1;
}

.decision-card {
  width: 100%;
  border-radius: 1rem;
  padding: 1rem 1.5rem;
  text-align: center;
  transition: transform 140ms ease, box-shadow 140ms ease, background-color 140ms ease;
}

.decision-card:hover,
.link-card:hover,
.tag-pill:hover,
.social-card:hover,
.generate-button:hover,
.primary-cta:hover,
.copy-button:hover,
.mini-button:hover {
  transform: translateY(-1px);
}

.decision-card span,
.decision-card small {
  display: block;
}

.decision-card span {
  font-size: 1rem;
  font-weight: 600;
}

.decision-card small {
  margin-top: 0.25rem;
  opacity: 0.9;
  font-size: 0.875rem;
}

.decision-card--yes {
  background: #008000;
  color: #ffffff;
  box-shadow: var(--shadow-sm);
}

.decision-card--no {
  border: 1px solid #ff4757;
  color: #ff4757;
}

.intro {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  text-align: center;
}

.intro--compact {
  margin-top: 1.25rem;
}

.link-cards {
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.link-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 1rem;
  background: var(--background);
  padding: 1rem;
  text-align: left;
  transition: transform 140ms ease, background-color 140ms ease;
}

.link-card:hover,
.social-card:hover,
.copy-button:hover,
.mini-button:hover {
  background: var(--muted-surface);
}

.link-card__icon {
  display: flex;
  width: 3rem;
  height: 3rem;
  flex: 0 0 3rem;
  align-items: center;
  justify-content: center;
}

.link-card__label {
  flex: 1;
  font-size: 1rem;
  font-weight: 600;
}

.link-card__arrow {
  color: var(--muted);
  font-size: 1rem;
}

.socials-panel {
  margin-top: 2rem;
}

.socials-title {
  margin-bottom: 0.75rem;
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 500;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.socials-grid {
  display: grid;
  max-width: 20rem;
  margin: 0 auto;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem 1rem;
  justify-items: center;
}

.social-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.375rem;
  transition: opacity 140ms ease, transform 140ms ease;
}

.social-card:hover {
  opacity: 0.82;
}

.social-icon {
  display: flex;
  width: 4rem;
  height: 4rem;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  color: #ffffff;
  box-shadow: var(--shadow-sm);
}

.social-label {
  color: var(--muted);
  font-size: 0.75rem;
}

.composer {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.composer-intro {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.composer-icon {
  width: 2rem;
  height: 2rem;
}

.surface-panel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  border-radius: 1rem;
  background: var(--muted-surface);
  padding: 1rem;
}

.surface-section-title {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.tag-group {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.tag-group__label,
.field-label {
  color: var(--muted);
  font-size: 0.875rem;
}

.tag-group__items {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
}

.tag-pill {
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--background);
  padding: 0.625rem 0.875rem;
  font-size: 0.875rem;
  line-height: 1.2;
  transition: transform 140ms ease, border-color 140ms ease, background-color 140ms ease;
}

.tag-pill.is-selected {
  border-color: var(--foreground);
  background: #f3f4f6;
}

.field-block {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.text-input,
.text-output {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 0.875rem;
  background: var(--background);
  padding: 0.75rem 0.875rem;
  color: var(--foreground);
  font-size: 1rem;
  line-height: 1.5;
  box-shadow: var(--shadow-sm);
  resize: vertical;
}

.text-input:focus,
.text-output:focus {
  outline: 2px solid var(--accent, #008000);
  outline-offset: 1px;
}

.generate-button,
.primary-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  border-radius: 0.875rem;
  padding: 0.875rem 1rem;
  transition: transform 140ms ease, opacity 140ms ease;
}

.generate-button:disabled,
.primary-cta:disabled,
.mini-button:disabled {
  opacity: 0.55;
  cursor: default;
  transform: none;
}

.generate-button {
  border: 1px solid var(--accent, #008000);
  color: var(--accent, #008000);
  background: var(--background);
  font-size: 0.9375rem;
  font-weight: 500;
}

.output-block {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.output-actions {
  display: flex;
  justify-content: flex-end;
}

.copy-button,
.mini-button {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  border: 1px solid var(--accent, #008000);
  border-radius: 0.75rem;
  padding: 0.625rem 0.875rem;
  color: var(--accent, #008000);
  font-size: 0.875rem;
  font-weight: 500;
  transition: transform 140ms ease, background-color 140ms ease;
}

.cta-block {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.primary-cta {
  background: var(--accent, #008000);
  color: #ffffff;
  box-shadow: var(--shadow-sm);
  font-size: 1rem;
  font-weight: 600;
}

.cta-hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.75rem;
  text-align: center;
}

.photo-stack {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
}

.photo-grid--single {
  grid-template-columns: minmax(0, 1fr);
}

.photo-card {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 0.875rem;
  object-fit: cover;
}

.photo-actions {
  display: flex;
  justify-content: center;
}

.mini-button {
  border-color: var(--border);
  color: var(--foreground);
  background: var(--background);
}

.no-panel {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 1rem;
  justify-content: center;
  padding: 1rem 0;
}

.no-copy {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.thank-you-card {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  border-radius: 1rem;
  background: var(--muted-surface);
  padding: 1rem;
  font-size: 0.9375rem;
  line-height: 1.5;
}

.text-link-button {
  padding: 0.25rem 0;
  color: #ff4757;
  font-size: 0.9375rem;
  text-align: left;
}

.error-copy {
  margin: 0;
  color: #b91c1c;
  font-size: 0.875rem;
}

@media (min-width: 768px) {
  .page {
    padding-bottom: 3.5rem;
  }
}
