﻿:root {
  --primary: #ff7aa2;
  --primary-dark: #ef5f8d;
  --primary-soft: #ffd6e3;
  --bg: #fff7fa;
  --card: #ffffff;
  --text: #2b2b2b;
  --muted: #888888;
  --line: #ffe1ea;
  --success: #35c759;
  --danger: #ff4d6d;
  --shadow: 0 12px 30px rgba(255, 122, 162, 0.14);
  --radius: 18px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 10% -10%, rgba(255, 122, 162, 0.22), transparent 32%),
    radial-gradient(circle at 92% 2%, rgba(255, 214, 227, 0.68), transparent 28%),
    var(--bg);
}

button,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
  border: 0;
}

.app-shell {
  width: 100%;
  max-width: 520px;
  min-height: 100vh;
  margin: 0 auto;
  padding: 14px 14px calc(88px + var(--safe-bottom));
}

.hero {
  position: relative;
  overflow: hidden;
  padding: 20px 18px 16px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: linear-gradient(135deg, #fff, #fff1f6 70%, #ffe6ee);
  box-shadow: var(--shadow);
}

.hero::after {
  content: "";
  position: absolute;
  right: -34px;
  top: -46px;
  width: 120px;
  height: 120px;
  border-radius: 999px;
  background: rgba(255, 122, 162, 0.18);
}

.hero__top {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--primary-dark);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 6px;
  font-size: 28px;
  line-height: 1.12;
  letter-spacing: -0.02em;
}

.hero__subtitle {
  position: relative;
  z-index: 1;
  margin: 0 0 16px;
  color: #6f5961;
  font-size: 14px;
}

.icon-btn,
.small-btn,
.primary-btn,
.copy-btn,
.secondary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  transition: transform 0.12s ease, opacity 0.12s ease, background 0.12s ease;
}

.icon-btn:active,
.small-btn:active,
.primary-btn:active,
.copy-btn:active,
.secondary-btn:active,
.nav-btn:active,
.chip:active {
  transform: scale(0.97);
}

.install-btn {
  position: relative;
  z-index: 2;
  width: 36px;
  height: 36px;
  color: #fff;
  background: var(--primary);
  font-size: 24px;
  box-shadow: 0 8px 18px rgba(255, 122, 162, 0.26);
}

.stats-grid {
  display: none;
}

.stat-card {
  padding: 10px 8px;
  border: 1px solid rgba(255, 122, 162, 0.16);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
  text-align: center;
  backdrop-filter: blur(10px);
}

.stat-card span {
  display: block;
  font-size: 16px;
  font-weight: 800;
  color: var(--text);
  white-space: nowrap;
}

.stat-card small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.main {
  padding-top: 16px;
}

.page {
  display: none;
}

.page.is-active {
  display: block;
  animation: fadeUp 0.18s ease;
}

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

.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin: 4px 2px 12px;
}

.section-head h2 {
  margin: 0 0 4px;
  font-size: 21px;
}

.section-head p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.small-btn {
  flex-shrink: 0;
  min-height: 34px;
  padding: 0 14px;
  color: var(--primary-dark);
  background: #fff;
  border: 1px solid var(--line);
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 6px 16px rgba(255, 122, 162, 0.08);
}

.small-btn.danger {
  color: var(--danger);
}

.chip-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  overflow: visible;
  padding: 2px 2px 12px;
}

.chip-row.is-quick-filter {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.chip {
  width: 100%;
  min-height: 34px;
  padding: 0 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #7a6068;
  background: rgba(255, 255, 255, 0.86);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chip.is-active {
  color: #fff;
  border-color: var(--primary);
  background: var(--primary);
  box-shadow: 0 8px 18px rgba(255, 122, 162, 0.25);
}

.card-list,
.history-list {
  display: grid;
  gap: 12px;
}

.copy-card {
  position: relative;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: 0 8px 24px rgba(255, 122, 162, 0.08);
}

.copy-card.is-used {
  border-color: rgba(53, 199, 89, 0.28);
  background: linear-gradient(180deg, #fff, #fbfffc);
}

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

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 800;
}

.used-badge {
  color: var(--success);
  font-size: 12px;
  font-weight: 800;
}

.card-content {
  margin: 0;
  color: var(--text);
  font-size: 16px;
  line-height: 1.7;
  word-break: break-word;
}

.card-meta {
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
}

.card-actions {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr;
  gap: 9px;
  margin-top: 14px;
}

.copy-btn {
  min-height: 42px;
  color: #fff;
  background: var(--primary);
  font-weight: 800;
  box-shadow: 0 9px 18px rgba(255, 122, 162, 0.24);
}

.copy-btn.is-copied {
  background: var(--success);
  box-shadow: 0 9px 18px rgba(53, 199, 89, 0.18);
}

.secondary-btn {
  min-height: 42px;
  color: #775761;
  background: #fff6f9;
  border: 1px solid var(--line);
  font-weight: 800;
}

.secondary-btn.is-fav {
  color: #ff9f0a;
  background: #fff8e8;
  border-color: #ffe6ad;
}

.empty-state {
  padding: 28px 20px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.72);
  text-align: center;
  color: var(--muted);
}

.empty-state strong {
  display: block;
  margin-bottom: 6px;
  color: var(--text);
  font-size: 16px;
}

.history-item {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 8px 20px rgba(255, 122, 162, 0.06);
}

.history-item__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.history-item time {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.history-item p {
  margin: 0;
  line-height: 1.65;
  font-size: 15px;
}

.settings-form,
.import-box {
  display: grid;
  gap: 12px;
}

.field,
.switch-card,
.import-box {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 8px 20px rgba(255, 122, 162, 0.06);
}

.field {
  display: grid;
  gap: 8px;
}

.field span,
.switch-card strong,
.import-box h3 {
  font-size: 14px;
  font-weight: 800;
}

.field select,
.import-box textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--text);
  background: #fff8fb;
  outline: none;
}

.field select {
  height: 42px;
  padding: 0 12px;
}

.import-box {
  margin-top: 12px;
}

.import-box h3 {
  margin: 0 0 4px;
}

.import-box p,
.switch-card small {
  display: block;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.import-box textarea {
  resize: vertical;
  min-height: 110px;
  padding: 12px;
  line-height: 1.5;
}

.import-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.switch-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.switch {
  position: relative;
  flex-shrink: 0;
  width: 52px;
  height: 30px;
}

.switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.switch span {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #eadde2;
  transition: background 0.16s ease;
}

.switch span::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.14);
  transition: transform 0.16s ease;
}

.switch input:checked + span {
  background: var(--primary);
}

.switch input:checked + span::after {
  transform: translateX(22px);
}

.primary-btn {
  width: 100%;
  min-height: 46px;
  color: #fff;
  background: var(--primary);
  font-weight: 900;
  box-shadow: 0 10px 22px rgba(255, 122, 162, 0.24);
}

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 20;
  width: 100%;
  max-width: 520px;
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 8px 10px calc(8px + var(--safe-bottom));
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(18px);
  box-shadow: 0 -10px 24px rgba(255, 122, 162, 0.10);
}

.nav-btn {
  min-height: 52px;
  border-radius: 16px;
  color: #8d757c;
  background: transparent;
  font-size: 11px;
  font-weight: 800;
}

.nav-btn span,
.nav-btn b {
  display: block;
}

.nav-btn span {
  margin-bottom: 2px;
  font-size: 18px;
}

.nav-btn b {
  font-weight: 800;
}

.nav-btn.is-active {
  color: var(--primary-dark);
  background: #fff1f6;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(86px + var(--safe-bottom));
  z-index: 50;
  max-width: min(88vw, 420px);
  padding: 12px 16px;
  border-radius: 999px;
  color: #fff;
  background: rgba(43, 43, 43, 0.92);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.16);
  transform: translate(-50%, 12px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
  font-size: 14px;
}

.toast.is-show {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (max-width: 360px) {
  .app-shell {
    padding-left: 10px;
    padding-right: 10px;
  }

  .hero {
    padding: 18px 14px 14px;
  }

  h1 {
    font-size: 25px;
  }

  .chip {
    font-size: 11px;
    padding: 0 4px;
  }

  .card-actions {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 760px) {
  .app-shell {
    padding-top: 22px;
  }
}
