:root {
  --ink: #17131f;
  --muted: #70677d;
  --line: #e7dff0;
  --panel: #fffaf8;
  --panel-strong: #ffffff;
  --accent: #7f3cf4;
  --accent-dark: #35136e;
  --gold: #f2b94b;
  --orange: #f28a1a;
  --green: #0f9279;
  --shadow: 0 24px 70px rgba(24, 12, 46, 0.22);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% 0%, rgba(127, 60, 244, 0.42), transparent 34vw),
    radial-gradient(circle at 88% 8%, rgba(242, 185, 75, 0.2), transparent 32vw),
    linear-gradient(180deg, #160b2b 0%, #f5f0e8 430px, #f7f3ee 100%);
  color: var(--ink);
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Microsoft YaHei", sans-serif;
}

button,
select,
textarea {
  font: inherit;
}

.app {
  width: min(100%, 820px);
  margin: 0 auto;
  padding: 24px 14px 44px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 2px 18px;
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  background: linear-gradient(135deg, #fff 0%, #eadfff 18%, #7f3cf4 70%, #2b0d5f 100%);
  color: #fff;
  font-size: 26px;
  font-weight: 950;
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.24);
}

.eyebrow {
  margin: 0 0 5px;
  color: #f8dc8a;
  font-size: 13px;
  font-weight: 850;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  color: #fff;
  font-size: 34px;
  line-height: 1.08;
  letter-spacing: 0;
}

h2 {
  font-size: 17px;
}

.subhead {
  max-width: 520px;
  margin-top: 8px;
  color: rgba(255, 255, 255, 0.76);
  font-size: 14px;
  line-height: 1.5;
}

.ip-strip {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 128px;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
  padding: 12px 12px 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.06)),
    rgba(14, 7, 28, 0.72);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(12px);
}

.ip-copy {
  color: #fff;
}

.ip-copy strong {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
}

.ip-copy p {
  margin-top: 6px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 13px;
  line-height: 1.45;
}

.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #35e7bf;
  box-shadow: 0 0 0 5px rgba(53, 231, 191, 0.14);
}

.mascot-frame {
  height: 82px;
  overflow: hidden;
  border-radius: 8px;
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(127, 60, 244, 0.14);
}

.mascot-frame img {
  width: 210px;
  height: 150px;
  object-fit: cover;
  object-position: 8% 14%;
  transform: translate(-12px, -20px);
}

.composer,
.results,
.history {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(255, 250, 248, 0.98)),
    var(--panel);
  border: 1px solid rgba(225, 211, 236, 0.9);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.composer {
  padding: 16px;
}

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

.field span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

textarea,
select {
  width: 100%;
  border: 1px solid #ddd0eb;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  outline: none;
}

textarea {
  min-height: 168px;
  padding: 13px;
  line-height: 1.65;
  resize: vertical;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

select {
  height: 44px;
  padding: 0 12px;
}

textarea:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(127, 60, 244, 0.14);
}

.controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}

.switch-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 14px 0;
}

.switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 750;
}

.switch input {
  position: absolute;
  opacity: 0;
}

.switch span {
  position: relative;
  width: 42px;
  height: 24px;
  border-radius: 999px;
  background: #d9d0c4;
  transition: 0.18s ease;
}

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

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

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

.primary-btn,
.ghost-btn,
.copy-btn,
.link-btn {
  border: 0;
  cursor: pointer;
}

.primary-btn {
  width: 100%;
  min-height: 48px;
  border-radius: 8px;
  background: linear-gradient(135deg, #8a45ff, #5b19d7 58%, #31106a);
  color: #fff;
  font-weight: 900;
  box-shadow: 0 16px 34px rgba(91, 25, 215, 0.34);
}

.primary-btn:active,
.ghost-btn:active,
.copy-btn:active {
  transform: translateY(1px);
}

.ghost-btn {
  min-width: 58px;
  min-height: 36px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--accent-dark);
  font-weight: 850;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.14);
}

.results,
.history {
  margin-top: 14px;
  padding: 14px;
}

.section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.section-title p,
.link-btn {
  color: var(--muted);
  font-size: 13px;
}

.link-btn {
  background: transparent;
  padding: 0;
  font-weight: 800;
}

.result-list,
.history-list {
  display: grid;
  gap: 10px;
}

.draft-card,
.empty-state,
.history-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
}

.draft-card {
  overflow: hidden;
}

.draft-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(90deg, rgba(127, 60, 244, 0.1), rgba(242, 185, 75, 0.12)),
    #fff8ed;
}

.badge {
  color: #6a27db;
  font-size: 13px;
  font-weight: 900;
}

.copy-btn {
  min-height: 32px;
  border-radius: 8px;
  padding: 0 10px;
  background: #15111f;
  color: #fff;
  font-size: 13px;
  font-weight: 800;
}

.draft-text {
  white-space: pre-wrap;
  padding: 13px;
  line-height: 1.72;
  font-size: 15px;
}

.empty-state {
  padding: 14px;
  color: var(--muted);
}

.empty-state strong {
  display: block;
  color: var(--ink);
  margin-bottom: 6px;
}

.history-item {
  padding: 11px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.history-item strong {
  display: block;
  color: var(--ink);
  margin-bottom: 5px;
}

@media (max-width: 520px) {
  .app {
    padding: 14px 10px 32px;
  }

  h1 {
    font-size: 26px;
  }

  .brand-mark {
    width: 46px;
    height: 46px;
    font-size: 23px;
  }

  .topbar {
    align-items: flex-start;
  }

  .controls {
    grid-template-columns: 1fr;
  }

  .section-title {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .ip-strip {
    grid-template-columns: 1fr 94px;
  }

  .mascot-frame {
    height: 76px;
  }

  .mascot-frame img {
    width: 184px;
    height: 132px;
  }
}
