:root {
  --page: #d7d5cf;
  --bg: #f6f3ee;
  --surface: rgba(255, 255, 255, 0.82);
  --surface-solid: #fffdf9;
  --ink: #24211f;
  --muted: #80766e;
  --line: rgba(57, 47, 40, 0.12);
  --accent: #7b5a42;
  --tab: rgba(255, 255, 255, 0.72);
  --shadow: 0 18px 48px rgba(64, 52, 44, 0.16);
  --soft-shadow: 0 10px 26px rgba(64, 52, 44, 0.12);
}

body.dark {
  --page: #27302e;
  --bg: #14110f;
  --surface: rgba(42, 36, 31, 0.78);
  --surface-solid: #241f1b;
  --ink: #fffaf2;
  --muted: #b9aea4;
  --line: rgba(255, 246, 235, 0.12);
  --accent: #b9967a;
  --tab: rgba(38, 33, 29, 0.76);
  --shadow: 0 22px 58px rgba(0, 0, 0, 0.32);
  --soft-shadow: 0 12px 34px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--page);
  font-family: Inter, "PingFang SC", "Noto Sans SC", "Microsoft YaHei", system-ui, sans-serif;
}

button,
input,
textarea {
  font: inherit;
}

button {
  color: inherit;
  cursor: pointer;
}

.stage {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 28px;
}

.phone {
  position: relative;
  width: min(100%, 430px);
  height: min(920px, calc(100vh - 56px));
  min-height: 760px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.48);
  border-radius: 34px;
  background:
    radial-gradient(circle at 12% 10%, rgba(255, 255, 255, 0.86), transparent 28%),
    linear-gradient(180deg, var(--bg), color-mix(in srgb, var(--bg) 78%, var(--accent)));
  box-shadow: 0 24px 80px rgba(32, 28, 25, 0.28);
}

.view {
  display: none;
  height: 100%;
  overflow: auto;
  padding: 52px 24px 154px;
  scrollbar-width: none;
}

.view::-webkit-scrollbar {
  display: none;
}

.view.active {
  display: block;
}

.hero-head,
.archive-head,
.profile-card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

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

h1 {
  font-size: 42px;
  line-height: 0.98;
  font-weight: 900;
}

.hero-head h2,
.page-head h2,
.archive-head h2 {
  margin-top: 24px;
  font-size: 24px;
  line-height: 1.1;
  font-weight: 900;
}

.hero-head p,
.page-head p,
.archive-head p,
.template-card p,
.profile-card p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.48;
}

.head-actions {
  display: flex;
  gap: 10px;
  padding-top: 6px;
}

.circle-button,
.soft-button,
.profile-card button,
.map-head button {
  border: 1px solid var(--line);
  background: var(--surface);
  backdrop-filter: blur(14px);
  box-shadow: var(--soft-shadow);
}

.circle-button {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 50%;
}

svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.summary-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.summary-pill,
.chips button,
.calendar-title button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  box-shadow: 0 4px 12px rgba(64, 52, 44, 0.08);
}

.summary-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 13px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.summary-pill strong {
  color: var(--ink);
}

.summary-pill svg {
  width: 19px;
  height: 19px;
  color: var(--accent);
}

.ticket-stack {
  position: relative;
  height: 228px;
  margin-top: 36px;
}

.wide-ticket {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 124px;
  height: 138px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 18px;
  background: #eee;
  box-shadow: var(--shadow);
  transition:
    transform 0.22s ease,
    box-shadow 0.22s ease,
    filter 0.22s ease;
}

.wide-ticket img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.interactive {
  cursor: pointer;
}

.interactive:hover,
.interactive:focus-within {
  filter: saturate(1.05);
}

.wide-ticket.interactive:hover {
  transform: translateY(-2px);
  box-shadow: 0 24px 56px rgba(64, 52, 44, 0.2);
}

.wide-ticket.ghost.one.interactive:hover {
  transform: translate(8px, -2px);
}

.wide-ticket.ghost.two.interactive:hover {
  transform: translate(-4px, -2px);
}

.photo-action {
  cursor: zoom-in;
}

.front-ticket {
  z-index: 3;
}

.wide-ticket.ghost {
  position: absolute;
  left: 0;
  right: 0;
  opacity: 0.88;
}

.wide-ticket.ghost.one {
  top: 42px;
  transform: translateX(8px);
}

.wide-ticket.ghost.two {
  top: 83px;
  transform: translateX(-4px);
}

.stub {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 20px 14px;
  color: #fff;
}

.stub::before {
  content: "";
  position: absolute;
  left: -5px;
  top: 10px;
  bottom: 10px;
  width: 8px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.62) 2px, transparent 3px) 0 0 / 8px 12px;
}

.stub strong {
  font-size: 20px;
  line-height: 1;
  word-break: normal;
  overflow-wrap: anywhere;
}

.stub strong.compact {
  font-size: 15px;
  line-height: 0.96;
}

.stub span,
.stub small {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.slate {
  background: #587484;
}

.olive {
  background: #687744;
}

.blue {
  background: #4d7386;
}

.coral {
  background: #b85f4c;
}

.walnut {
  background: #755943;
}

.caption {
  position: absolute;
  left: 14px;
  bottom: 12px;
  max-width: calc(100% - 150px);
  padding: 6px 11px;
  border-radius: 999px;
  color: #2a241f;
  background: rgba(235, 231, 218, 0.72);
  backdrop-filter: blur(8px);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fan-cards {
  position: relative;
  height: 270px;
  margin-top: 24px;
}

.memory-card {
  position: absolute;
  left: 50%;
  top: 8px;
  width: 152px;
  min-height: 220px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-solid);
  box-shadow: var(--soft-shadow);
  transform: translateX(-50%);
  transition:
    transform 0.22s ease,
    box-shadow 0.22s ease,
    filter 0.22s ease;
}

.memory-card.interactive:hover {
  z-index: 5;
  filter: saturate(1.06);
  box-shadow: 0 18px 36px rgba(64, 52, 44, 0.18);
}

.memory-card.rotate-left {
  transform: translateX(-108%) rotate(-9deg);
}

.memory-card.rotate-left.interactive:hover {
  transform: translateX(-108%) rotate(-6deg) translateY(-8px);
}

.memory-card.rotate-right {
  transform: translateX(9%) rotate(10deg);
}

.memory-card.rotate-right.interactive:hover {
  transform: translateX(9%) rotate(7deg) translateY(-8px);
}

.memory-card:not(.rotate-left):not(.rotate-right).interactive:hover {
  transform: translateX(-50%) translateY(-8px);
}

.memory-card small,
.memory-card span {
  display: block;
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.memory-card strong {
  display: block;
  margin-top: 4px;
  font-size: 17px;
  line-height: 1;
}

.memory-card img {
  width: 100%;
  height: 126px;
  margin-top: 10px;
  border-radius: 8px;
  object-fit: cover;
}

.memory-card p {
  margin-top: 8px;
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(210, 204, 191, 0.7);
  color: #342c26;
  font-size: 11px;
  font-weight: 700;
}

.page-head {
  padding-top: 10px;
}

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  height: 54px;
  margin-top: 32px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: rgba(255, 255, 255, 0.46);
}

.segmented button {
  border: 0;
  border-radius: 13px;
  color: var(--muted);
  background: transparent;
  font-weight: 800;
}

.segmented button.active {
  color: var(--accent);
  background: var(--surface-solid);
  box-shadow: 0 8px 20px rgba(64, 52, 44, 0.1);
}

.template-card,
.stats-card,
.map-card,
.menu-card {
  margin-top: 24px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--soft-shadow);
}

.preview-ticket {
  height: 156px;
}

.template-card h3 {
  margin-top: 16px;
  font-size: 20px;
}

.ticket-form {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.ticket-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.54);
  outline: 0;
}

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

textarea {
  min-height: 72px;
  resize: none;
  padding: 12px;
}

.swatches {
  display: flex;
  justify-content: space-between;
}

.swatches button {
  width: 42px;
  height: 42px;
  border: 3px solid var(--surface-solid);
  border-radius: 50%;
  background: var(--swatch);
  box-shadow: 0 5px 14px rgba(64, 52, 44, 0.18);
}

.swatches button.active {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.primary-action {
  min-height: 52px;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(135deg, #8b6449, #6e4b34);
  font-size: 16px;
  font-weight: 900;
  box-shadow: var(--soft-shadow);
}

.soft-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 42px;
  padding: 0 13px;
  border-radius: 999px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.soft-button svg {
  width: 18px;
  height: 18px;
}

.chips {
  display: flex;
  gap: 10px;
  margin-top: 28px;
  overflow: auto;
  scrollbar-width: none;
}

.chips button {
  flex: 0 0 auto;
  padding: 0 18px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.chips button.active,
.calendar-title button.active {
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 13%, var(--surface-solid));
}

.calendar-strip {
  margin-top: 26px;
}

.calendar-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.calendar-title h3 {
  font-size: 24px;
}

.calendar-title div {
  display: flex;
  gap: 6px;
}

.calendar-title button {
  min-height: 34px;
  padding: 0 13px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 5px;
  margin-top: 14px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.4);
}

.days span {
  display: grid;
  min-height: 44px;
  place-items: center;
  border-radius: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.days small {
  font-size: 9px;
}

.days .active {
  color: #fff;
  background: var(--accent);
}

.ticket-list {
  display: grid;
  gap: 16px;
  margin-top: 20px;
}

.ticket-list .wide-ticket {
  height: 128px;
}

.ticket-list .stub {
  padding: 18px 12px;
}

.ticket-list .stub strong {
  font-size: 13px;
  line-height: 1.02;
}

.ticket-list .stub strong.compact {
  font-size: 12px;
}

.ticket-list .wide-ticket.hidden {
  display: none;
}

.profile-card {
  align-items: center;
  margin-top: 22px;
  padding: 18px;
  border-radius: 20px;
  background: transparent;
}

.profile-card img {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
}

.profile-card div {
  flex: 1;
}

.profile-card h2 {
  font-size: 21px;
}

.profile-card button {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 50%;
}

.stats-card h3,
.map-card h3 {
  font-size: 15px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 24px;
  text-align: center;
}

.stats-grid div {
  display: grid;
  gap: 6px;
}

.stats-grid strong {
  font-size: 20px;
}

.stats-grid span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.map-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.map-head button {
  border: 0;
  color: var(--muted);
  background: transparent;
  box-shadow: none;
  font-size: 12px;
  font-weight: 800;
}

.world-map {
  position: relative;
  height: 170px;
  margin-top: 12px;
  border-radius: 15px;
  background:
    radial-gradient(ellipse at 26% 48%, rgba(117, 89, 67, 0.11) 0 18%, transparent 19%),
    radial-gradient(ellipse at 55% 45%, rgba(117, 89, 67, 0.1) 0 22%, transparent 23%),
    radial-gradient(ellipse at 72% 58%, rgba(117, 89, 67, 0.1) 0 16%, transparent 17%),
    rgba(255, 255, 255, 0.36);
}

.world-map span {
  position: absolute;
  width: 10px;
  height: 10px;
  border: 3px solid var(--accent);
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
}

.menu-card {
  display: grid;
  padding: 6px 18px;
}

.menu-card button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  font-weight: 800;
}

.menu-card button:last-child {
  border-bottom: 0;
}

.menu-card span {
  color: var(--muted);
  font-size: 22px;
}

.tabbar {
  position: absolute;
  left: 20px;
  right: 20px;
  bottom: 18px;
  z-index: 10;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  min-height: 72px;
  padding: 6px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 999px;
  background: var(--tab);
  backdrop-filter: blur(22px);
  box-shadow: 0 14px 40px rgba(44, 37, 31, 0.22);
}

.tabbar button {
  display: grid;
  place-items: center;
  gap: 2px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
}

.tabbar button.active {
  color: var(--accent);
  background: rgba(125, 102, 82, 0.14);
}

.tabbar svg {
  width: 25px;
  height: 25px;
  stroke-width: 2.3;
}

.toast {
  position: absolute;
  left: 50%;
  bottom: 126px;
  z-index: 20;
  padding: 10px 16px;
  border-radius: 999px;
  color: #fff;
  background: rgba(36, 33, 31, 0.86);
  font-size: 13px;
  font-weight: 800;
  opacity: 0;
  transform: translate(-50%, 12px);
  transition: 0.24s ease;
}

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

.photo-dialog {
  width: min(380px, calc(100% - 32px));
  max-height: calc(100% - 52px);
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.54);
  border-radius: 24px;
  color: var(--ink);
  background: var(--surface-solid);
  box-shadow: 0 28px 80px rgba(32, 28, 25, 0.34);
}

.photo-dialog::backdrop {
  background: rgba(25, 20, 17, 0.46);
  backdrop-filter: blur(8px);
}

.photo-dialog[open] {
  display: grid;
}

.photo-dialog img {
  width: 100%;
  height: 310px;
  object-fit: cover;
  background: #ddd;
}

.dialog-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.64);
  border-radius: 50%;
  color: #fff;
  background: rgba(20, 16, 13, 0.42);
  backdrop-filter: blur(10px);
  font-size: 24px;
  line-height: 1;
}

.dialog-copy {
  display: grid;
  gap: 10px;
  padding: 18px;
}

.dialog-copy span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.dialog-copy h3 {
  font-size: 24px;
}

.dialog-copy p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.dialog-copy .primary-action {
  margin-top: 4px;
}

@media (max-width: 520px) {
  .stage {
    padding: 0;
  }

  .phone {
    width: 100vw;
    height: 100vh;
    min-height: 700px;
    border: 0;
    border-radius: 0;
  }

  h1 {
    font-size: 40px;
  }
}
