* {
  box-sizing: border-box;
}

:root {
  --paper: #fff7e9;
  --paper-deep: #f8ead4;
  --card: rgba(255, 252, 245, 0.94);
  --ink: #1f1a17;
  --muted: #8b7965;
  --orange: #ff7a12;
  --orange-deep: #df5b00;
  --yellow: #ffd36d;
  --mint: #77cfa8;
  --line: rgba(166, 126, 78, 0.2);
  --shadow: 0 18px 44px rgba(121, 79, 33, 0.17);
}

body {
  margin: 0;
  min-width: 320px;
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  color: var(--ink);
  background:
    linear-gradient(rgba(255, 255, 255, 0.72), rgba(255, 248, 232, 0.82)),
    radial-gradient(circle at 20% 18%, rgba(255, 211, 109, 0.32), transparent 34%),
    linear-gradient(135deg, #fff9ed, #f7dfbe);
}

button {
  font: inherit;
}

.store-shell {
  width: min(1560px, calc(100% - 32px));
  margin: 0 auto;
  padding: 22px 0 30px;
}

.store-header {
  display: grid;
  grid-template-columns: 280px 1fr 360px;
  align-items: start;
  gap: 24px;
  min-height: 148px;
}

.library-status {
  grid-column: 3;
  justify-self: end;
  margin: -82px 0 0;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #6d5a45;
  background: rgba(255, 255, 255, 0.72);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.4;
}

.library-status[data-state="online"] {
  color: #276d54;
  border-color: rgba(119, 207, 168, 0.52);
  background: rgba(232, 255, 244, 0.86);
}

.library-status[data-state="loading"] {
  color: var(--orange-deep);
  background: #fff0d7;
}

.library-status[data-state="error"] {
  color: #9a3b1e;
  background: #fff0e8;
}

.brand-block,
.header-actions,
.section-heading,
.shelf-head,
.ticket-top,
.ticket-actions {
  display: flex;
  align-items: center;
}

.brand-block {
  gap: 14px;
}

.brand-logo {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  box-shadow: 0 10px 22px rgba(255, 122, 18, 0.2);
}

.brand-name {
  margin: 0 0 4px;
  font-size: 24px;
  font-weight: 900;
}

.brand-subtitle {
  margin: 0;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 4px;
}

.title-block {
  text-align: center;
}

.spark-label {
  display: inline-flex;
  margin: 0 0 4px;
  padding: 7px 16px;
  border: 2px solid rgba(255, 122, 18, 0.45);
  border-radius: 999px;
  color: var(--orange-deep);
  background: rgba(255, 255, 255, 0.72);
  font-weight: 900;
}

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

h1 {
  margin-bottom: 8px;
  font-size: clamp(42px, 5.2vw, 76px);
  line-height: 1;
  letter-spacing: 0;
}

.subtitle {
  margin-bottom: 0;
  color: #43342b;
  font-size: 20px;
  line-height: 1.5;
}

.header-actions {
  justify-content: flex-end;
  gap: 10px;
}

.header-actions button,
.shelf-head button {
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 13px;
  color: #5f4c39;
  background: rgba(255, 255, 255, 0.64);
}

.workbench {
  display: grid;
  grid-template-columns: minmax(330px, 0.96fr) minmax(390px, 0.9fr) minmax(390px, 1.04fr);
  align-items: start;
  gap: 22px;
}

.control-panel,
.gacha-panel,
.result-card,
.shelf-panel {
  border: 1px solid var(--line);
  border-radius: 26px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.control-panel,
.result-card {
  display: flex;
  flex-direction: column;
  height: 660px;
  padding: 26px;
  overflow: hidden;
}

.control-panel {
  overflow-y: auto;
  scrollbar-color: rgba(255, 122, 18, 0.38) transparent;
  scrollbar-width: thin;
}

.section-heading {
  gap: 10px;
  margin-bottom: 18px;
}

.section-heading img {
  width: 42px;
  height: 42px;
  border-radius: 50%;
}

h2 {
  margin-bottom: 0;
  font-size: 24px;
  line-height: 1.2;
}

.capsule-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.capsule-card {
  display: grid;
  gap: 8px;
  min-height: 178px;
  padding: 10px;
  border: 2px solid rgba(255, 122, 18, 0.25);
  border-radius: 16px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.72);
  cursor: pointer;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.capsule-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 22px rgba(220, 116, 20, 0.14);
}

.capsule-card.is-selected {
  border-color: var(--orange);
  box-shadow: 0 0 0 4px rgba(255, 122, 18, 0.12), 0 14px 26px rgba(220, 116, 20, 0.18);
}

.capsule-card img {
  width: 100%;
  aspect-ratio: 1 / 0.78;
  object-fit: cover;
  border-radius: 12px;
  background: #fff4df;
}

.capsule-card strong {
  font-size: 18px;
}

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

.selection-status {
  display: inline-flex;
  margin: 18px 0 24px;
  padding: 9px 14px;
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.72);
  line-height: 1.5;
}

.selection-status.is-filled {
  color: var(--orange-deep);
  background: #fff0d7;
  font-weight: 800;
}

.direction-preview {
  padding-top: 22px;
  border-top: 1px dashed rgba(166, 126, 78, 0.28);
}

.direction-preview h2 {
  margin-bottom: 14px;
}

.direction-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.direction-pill {
  min-height: 42px;
  padding: 0 19px;
  border: 1px solid rgba(166, 126, 78, 0.2);
  border-radius: 999px;
  color: #6b5746;
  background: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.direction-pill:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 122, 18, 0.55);
}

.direction-pill.is-selected {
  border-color: var(--orange);
  color: #ffffff;
  background: var(--orange);
  font-weight: 800;
}

.direction-empty {
  width: 100%;
  margin: 0;
  padding: 14px 16px;
  border: 1px dashed rgba(166, 126, 78, 0.28);
  border-radius: 16px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.58);
  line-height: 1.7;
}

.theme-selector {
  position: relative;
  margin-top: 18px;
  padding: 15px 16px;
  border: 1px solid rgba(255, 122, 18, 0.18);
  border-radius: 18px;
  background: rgba(255, 248, 235, 0.82);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.theme-selector label {
  display: block;
  margin-bottom: 10px;
  color: #4f3927;
  font-weight: 900;
}

.theme-selector input {
  width: 100%;
  min-height: 44px;
  padding: 0 15px;
  border: 1px solid rgba(166, 126, 78, 0.28);
  border-radius: 999px;
  outline: none;
  color: #332820;
  background: #fffdf8;
  font: inherit;
}

.theme-selector input:focus {
  border-color: rgba(255, 122, 18, 0.72);
  box-shadow: 0 0 0 4px rgba(255, 122, 18, 0.12);
}

.theme-selector input:disabled {
  cursor: not-allowed;
  opacity: 0.62;
  background: rgba(255, 255, 255, 0.52);
}

.theme-search-results {
  max-height: 210px;
  margin-top: 8px;
  padding: 6px;
  overflow-y: auto;
  border: 1px solid rgba(166, 126, 78, 0.2);
  border-radius: 12px;
  background: #fffdf8;
  box-shadow: 0 12px 28px rgba(112, 68, 26, 0.14);
}

.theme-search-results.is-hidden {
  display: none;
}

.theme-search-results button {
  display: grid;
  width: 100%;
  gap: 3px;
  padding: 9px 10px;
  border: 0;
  border-radius: 8px;
  text-align: left;
  color: #4f3927;
  background: transparent;
  cursor: pointer;
}

.theme-search-results button:hover,
.theme-search-results button.is-selected {
  color: var(--orange-deep);
  background: #fff0d7;
}

.theme-search-results button strong {
  font-size: 13px;
}

.theme-search-results button span,
.theme-search-empty {
  color: #91755d;
  font-size: 11px;
  line-height: 1.45;
}

.theme-search-empty {
  margin: 0;
  padding: 10px;
  text-align: center;
}

.fixed-theme-selection {
  display: grid;
  grid-template-columns: 9px minmax(0, 1fr);
  gap: 9px;
  align-items: start;
  margin-top: 11px;
  padding: 10px 12px;
  border: 1px solid rgba(22, 163, 74, 0.18);
  border-radius: 12px;
  background: rgba(240, 253, 244, 0.76);
}

.fixed-theme-dot {
  width: 8px;
  height: 8px;
  margin-top: 5px;
  border-radius: 50%;
  background: #22a95b;
}

.fixed-theme-selection strong {
  display: block;
  color: #25633f;
  font-size: 13px;
}

.theme-selector .fixed-theme-selection p {
  margin: 3px 0 0;
  color: #55705f;
  font-size: 12px;
  line-height: 1.5;
}

.fixed-theme-selection.is-empty {
  border-color: rgba(166, 126, 78, 0.18);
  background: rgba(255, 255, 255, 0.58);
}

.fixed-theme-selection.is-empty .fixed-theme-dot {
  background: #c4ac91;
}

.fixed-theme-selection.is-empty strong,
.theme-selector .fixed-theme-selection.is-empty p {
  color: #8a7158;
}

.theme-selector .supplement-label {
  margin: 12px 0 7px;
  color: #6f5339;
  font-size: 13px;
}

.theme-selector textarea {
  display: block;
  width: 100%;
  min-height: 68px;
  max-height: 100px;
  padding: 10px 12px;
  resize: vertical;
  border: 1px solid rgba(166, 126, 78, 0.28);
  border-radius: 12px;
  outline: none;
  color: #332820;
  background: #fffdf8;
  font: inherit;
  line-height: 1.55;
}

.theme-selector textarea:focus {
  border-color: rgba(255, 122, 18, 0.72);
  box-shadow: 0 0 0 4px rgba(255, 122, 18, 0.12);
}

.theme-selector textarea:disabled {
  cursor: not-allowed;
  opacity: 0.56;
  background: rgba(255, 255, 255, 0.52);
}

.theme-selector > p {
  margin: 9px 0 0;
  color: #8a7158;
  font-size: 13px;
  line-height: 1.6;
}

.keyword-locator {
  margin-top: 18px;
  padding: 15px 16px;
  border: 1px solid rgba(255, 122, 18, 0.18);
  border-radius: 18px;
  background: rgba(255, 248, 235, 0.82);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.keyword-locator label {
  display: block;
  margin-bottom: 10px;
  color: #4f3927;
  font-weight: 900;
}

.keyword-locator input {
  width: 100%;
  min-height: 44px;
  padding: 0 15px;
  border: 1px solid rgba(166, 126, 78, 0.28);
  border-radius: 999px;
  outline: none;
  color: #332820;
  background: #fffdf8;
  font: inherit;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.keyword-locator input::placeholder {
  color: rgba(124, 101, 78, 0.58);
}

.keyword-locator input:focus {
  border-color: rgba(255, 122, 18, 0.72);
  box-shadow: 0 0 0 4px rgba(255, 122, 18, 0.12);
  background: #ffffff;
}

.keyword-locator input:disabled {
  cursor: not-allowed;
  opacity: 0.62;
  background: rgba(255, 255, 255, 0.52);
}

.keyword-shortcuts {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 10px;
}

.keyword-shortcuts button {
  min-height: 30px;
  padding: 4px 11px;
  border: 1px solid rgba(255, 122, 18, 0.24);
  border-radius: 999px;
  color: #8a572e;
  background: rgba(255, 255, 255, 0.76);
  font-size: 12px;
  cursor: pointer;
  transition: border-color 0.18s ease, color 0.18s ease, background 0.18s ease;
}

.keyword-shortcuts button:hover:not(:disabled) {
  border-color: var(--orange);
  color: var(--orange-deep);
  background: #fff7e9;
}

.keyword-shortcuts button.is-selected {
  border-color: var(--orange);
  color: #ffffff;
  background: var(--orange);
  font-weight: 800;
}

.keyword-shortcuts button:disabled {
  cursor: not-allowed;
  opacity: 0.46;
}

.keyword-preview {
  display: grid;
  grid-template-columns: 9px minmax(0, 1fr);
  gap: 9px;
  align-items: start;
  margin-top: 11px;
  padding: 10px 12px;
  border: 1px solid rgba(22, 163, 74, 0.18);
  border-radius: 12px;
  background: rgba(240, 253, 244, 0.76);
}

.keyword-preview-dot {
  width: 8px;
  height: 8px;
  margin-top: 5px;
  border-radius: 50%;
  background: #22a95b;
}

.keyword-preview strong {
  display: block;
  color: #25633f;
  font-size: 13px;
  line-height: 1.45;
}

.keyword-locator .keyword-preview p {
  margin-top: 3px;
  color: #55705f;
  font-size: 12px;
  line-height: 1.5;
}

.keyword-preview.is-empty {
  border-color: rgba(166, 126, 78, 0.18);
  background: rgba(255, 255, 255, 0.58);
}

.keyword-preview.is-empty .keyword-preview-dot {
  background: #c4ac91;
}

.keyword-preview.is-empty strong,
.keyword-locator .keyword-preview.is-empty p {
  color: #8a7158;
}

.keyword-preview.is-custom {
  border-color: rgba(255, 122, 18, 0.22);
  background: rgba(255, 244, 223, 0.78);
}

.keyword-preview.is-custom .keyword-preview-dot {
  background: var(--orange);
}

.keyword-preview.is-custom strong,
.keyword-locator .keyword-preview.is-custom p {
  color: #8a572e;
}

.primary-theme-picker {
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px dashed rgba(255, 122, 18, 0.3);
  border-radius: 12px;
  background: rgba(255, 250, 240, 0.76);
}

.primary-theme-picker.is-hidden {
  display: none;
}

.primary-theme-picker > span {
  display: block;
  margin-bottom: 7px;
  color: #72563d;
  font-size: 12px;
  font-weight: 800;
}

.primary-theme-picker > div {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.primary-theme-picker button {
  min-height: 30px;
  padding: 4px 11px;
  border: 1px solid rgba(166, 126, 78, 0.24);
  border-radius: 999px;
  color: #76593f;
  background: #ffffff;
  font-size: 12px;
  cursor: pointer;
}

.primary-theme-picker button.is-selected {
  border-color: var(--orange);
  color: #ffffff;
  background: var(--orange);
  font-weight: 800;
}

.keyword-locator p {
  margin: 9px 0 0;
  color: #8a7158;
  font-size: 13px;
  line-height: 1.6;
}

.helper-note {
  margin: 18px 0 0;
  padding: 14px 16px;
  border-radius: 16px;
  color: #7c654e;
  background: #fff4df;
  line-height: 1.7;
}

.gacha-panel {
  position: relative;
  display: grid;
  justify-items: center;
  align-content: start;
  height: 660px;
  padding: 18px 14px 28px;
  overflow: hidden;
}

.machine-tag {
  position: relative;
  z-index: 2;
  margin: 0;
  padding: 7px 26px;
  border: 2px solid rgba(255, 122, 18, 0.45);
  border-radius: 12px;
  color: var(--orange-deep);
  background: #fff4df;
  font-size: 18px;
  font-weight: 900;
}

.gacha-panel h2 {
  position: relative;
  z-index: 2;
  margin: 12px 0 -12px;
  color: #5f4c39;
  font-size: 18px;
}

.machine-stage {
  position: relative;
  width: min(100%, 520px);
  isolation: isolate;
}

.gacha-machine {
  display: block;
  width: 100%;
  max-height: 560px;
  object-fit: contain;
  object-position: center top;
  filter: drop-shadow(0 22px 32px rgba(157, 92, 20, 0.2));
}

.gacha-finish-toast {
  position: absolute;
  left: 50%;
  bottom: 24px;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  padding: 8px 24px 8px 14px;
  border: 2px solid rgba(255, 122, 18, 0.18);
  border-radius: 17px;
  color: var(--ink);
  background: rgba(255, 252, 245, 0.98);
  box-shadow: 0 14px 28px rgba(132, 82, 34, 0.22);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 14px) scale(0.96);
  transition: opacity 0.24s ease, transform 0.24s ease;
  white-space: nowrap;
}

.gacha-finish-toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0) scale(1);
}

.gacha-finish-toast img {
  width: 42px;
  height: 42px;
  border-radius: 50%;
}

.gacha-finish-toast strong {
  color: var(--orange-deep);
  font-size: 22px;
}

.gacha-finish-toast span {
  font-size: 20px;
  font-weight: 900;
}

.gacha-finish-toast i {
  color: var(--orange);
  font-style: normal;
  font-size: 22px;
}

.gacha-knob {
  position: absolute;
  left: 50%;
  bottom: 7.2%;
  --knob-size: clamp(152px, 41%, 214px);
  width: var(--knob-size);
  height: var(--knob-size);
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: #ffffff;
  background: transparent;
  transform: translateX(-50%);
  transform-origin: 50% 50%;
  cursor: not-allowed;
  z-index: 3;
  transition: filter 0.18s ease, transform 0.18s ease;
}

.gacha-knob.is-ready {
  cursor: pointer;
}

.gacha-knob.is-ready:hover:not(:disabled) {
  filter: drop-shadow(0 0 16px rgba(255, 122, 18, 0.28));
}

.gacha-knob.is-ready:active:not(:disabled) {
  transform: translateX(-50%) scale(0.985);
}

.gacha-knob.is-spinning {
  cursor: wait;
  filter: drop-shadow(0 0 18px rgba(255, 122, 18, 0.38));
  transform: translateX(-50%);
}

.gacha-knob:focus-visible {
  outline: 3px solid rgba(255, 122, 18, 0.58);
  outline-offset: 7px;
}

.knob-text {
  position: absolute;
  left: 50%;
  top: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 74px;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 999px;
  color: #ffffff;
  background: rgba(255, 122, 18, 0.74);
  backdrop-filter: blur(3px);
  font-size: 14px;
  font-weight: 900;
  box-shadow: 0 8px 18px rgba(101, 48, 7, 0.22);
  transform: translate(-50%, -50%);
  transition: background 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease, opacity 0.18s ease;
  pointer-events: none;
  white-space: nowrap;
}

.gacha-knob:disabled .knob-text {
  opacity: 0.82;
  background: rgba(255, 122, 18, 0.5);
}

.gacha-knob.is-ready .knob-text {
  background: rgba(255, 122, 18, 0.86);
  box-shadow: 0 10px 22px rgba(255, 122, 18, 0.38);
}

.gacha-knob.is-ready:hover:not(:disabled) .knob-text {
  background: rgba(255, 97, 0, 0.92);
  transform: translate(-50%, -50%) scale(1.03);
}

.gacha-knob.is-ready:active:not(:disabled) .knob-text {
  transform: translate(-50%, -50%) scale(0.96);
}

.gacha-knob.is-spinning .knob-text {
  animation: knob-label-pulse 0.95s ease both;
  background: var(--orange-deep);
}

@keyframes knob-label-pulse {
  0% {
    transform: translate(-50%, -50%) scale(1);
  }

  45% {
    transform: translate(-50%, -50%) scale(1.08);
  }

  100% {
    transform: translate(-50%, -50%) scale(1);
  }
}

.ticket-top {
  justify-content: space-between;
  margin-bottom: 16px;
}

.ticket-top h2 {
  font-size: 25px;
}

.ticket-top span {
  color: var(--muted);
  font-size: 13px;
}

.ticket-fields {
  flex: 1;
  margin: 0;
  padding-right: 10px;
  overflow-y: auto;
  scrollbar-color: rgba(255, 122, 18, 0.45) rgba(255, 244, 223, 0.8);
  scrollbar-width: thin;
}

.ticket-fields div {
  display: grid;
  grid-template-columns: 105px 1fr;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px dashed rgba(166, 126, 78, 0.26);
}

.ticket-fields dt {
  color: #6a5540;
  font-weight: 800;
}

.ticket-fields .lockable-label {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  align-content: flex-start;
}

.field-lock {
  min-height: 24px;
  padding: 2px 7px;
  border: 1px solid rgba(166, 126, 78, 0.28);
  border-radius: 6px;
  color: #8a7158;
  background: rgba(255, 255, 255, 0.72);
  font-size: 11px;
  line-height: 1.2;
  cursor: pointer;
}

.field-lock:hover:not(:disabled) {
  border-color: var(--orange);
  color: var(--orange-deep);
}

.field-lock.is-locked {
  border-color: var(--orange);
  color: #ffffff;
  background: var(--orange);
  font-weight: 800;
}

.field-lock:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.field-reroll {
  display: inline-grid;
  place-items: center;
  width: 25px;
  height: 25px;
  padding: 0;
  border: 1px solid rgba(255, 122, 18, 0.28);
  border-radius: 50%;
  color: var(--orange-deep);
  background: rgba(255, 255, 255, 0.78);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.field-reroll:hover:not(:disabled) {
  border-color: var(--orange);
  background: #fff3df;
  transform: rotate(28deg);
}

.field-reroll:disabled {
  cursor: not-allowed;
  opacity: 0.35;
}

.ticket-fields dd {
  margin: 0;
  color: #332820;
  line-height: 1.65;
}

#ticketThemeSource {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  background: #fff0d3;
  color: #e95f00;
  font-weight: 800;
}

.ticket-actions {
  flex-shrink: 0;
  gap: 14px;
  margin-top: 18px;
}

.ticket-actions button {
  flex: 1;
  min-height: 52px;
  border: 2px solid var(--orange);
  border-radius: 16px;
  color: var(--orange-deep);
  background: #fff7ec;
  font-weight: 900;
}

.ticket-actions button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.ticket-actions button:first-child {
  color: #ffffff;
  background: var(--orange);
}

.copy-status {
  min-height: 22px;
  margin: 10px 0 0;
  color: var(--orange-deep);
  font-size: 14px;
  font-weight: 800;
}

.shelf-panel {
  margin-top: 22px;
  padding: 22px 26px 26px;
}

.shelf-head {
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

.shelf-head h2 {
  margin-bottom: 6px;
}

.shelf-head p {
  margin-bottom: 0;
  color: var(--muted);
}

.shelf-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.shelf-head button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.shelf-empty {
  margin: 0;
  padding: 22px;
  border: 1px dashed rgba(166, 126, 78, 0.26);
  border-radius: 18px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.58);
  line-height: 1.7;
}

.shelf-empty.is-hidden {
  display: none;
}

.shelf-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(220px, 1fr));
  gap: 16px;
}

.shelf-item {
  position: relative;
  display: grid;
  grid-template-columns: 124px 1fr;
  gap: 14px;
  min-height: 148px;
  padding: 12px;
  border: 1px solid rgba(166, 126, 78, 0.18);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
}

.shelf-item img {
  width: 124px;
  height: 124px;
  border-radius: 12px;
  object-fit: cover;
}

.shelf-item span {
  display: inline-flex;
  margin-bottom: 8px;
  padding: 4px 9px;
  border-radius: 999px;
  color: #ffffff;
  background: var(--orange);
  font-size: 12px;
  font-weight: 900;
}

.shelf-item h3 {
  margin-bottom: 7px;
  font-size: 17px;
  line-height: 1.35;
}

.shelf-item p {
  margin-bottom: 15px;
  color: #6a5540;
}

.shelf-item time {
  color: var(--muted);
}

.shelf-item button {
  position: absolute;
  right: 10px;
  top: 10px;
  width: 30px;
  height: 30px;
  border: 1px solid rgba(255, 122, 18, 0.25);
  border-radius: 50%;
  color: var(--orange-deep);
  background: rgba(255, 252, 245, 0.9);
  cursor: pointer;
  font-weight: 900;
}

@media (max-width: 1200px) {
  .store-header,
  .workbench {
    grid-template-columns: 1fr;
  }

  .title-block {
    text-align: left;
  }

  .header-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .library-status {
    grid-column: 1 / -1;
    justify-self: start;
    margin: -10px 0 0;
  }

  .gacha-panel {
    height: auto;
    min-height: 620px;
  }

  .gacha-finish-toast {
    bottom: 24px;
  }

  .result-card {
    height: auto;
    max-height: none;
  }

  .ticket-fields {
    overflow: visible;
    padding-right: 0;
  }

  .shelf-list {
    grid-template-columns: repeat(2, minmax(220px, 1fr));
  }
}

@media (max-width: 720px) {
  .store-shell {
    width: min(100% - 20px, 1560px);
    padding-top: 12px;
  }

  .brand-block {
    align-items: flex-start;
  }

  .brand-logo {
    width: 58px;
    height: 58px;
    border-radius: 14px;
  }

  .brand-name {
    font-size: 20px;
  }

  .brand-subtitle {
    letter-spacing: 2px;
  }

  h1 {
    font-size: 38px;
  }

  .subtitle {
    font-size: 16px;
  }

  .control-panel,
  .result-card,
  .shelf-panel {
    padding: 18px;
    border-radius: 20px;
  }

  .capsule-grid,
  .shelf-list {
    grid-template-columns: 1fr;
  }

  .capsule-card {
    grid-template-columns: 96px 1fr;
    align-items: center;
    min-height: 118px;
  }

  .capsule-card img {
    grid-row: span 2;
    height: 92px;
    aspect-ratio: auto;
  }

  .machine-stage {
    width: min(100%, 380px);
  }

  .gacha-finish-toast {
    bottom: 24px;
    max-width: calc(100% - 28px);
    min-height: 48px;
    padding: 7px 14px 7px 10px;
  }

  .gacha-finish-toast img {
    width: 34px;
    height: 34px;
  }

  .gacha-finish-toast strong,
  .gacha-finish-toast span {
    font-size: 15px;
  }

  .ticket-fields div {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .ticket-actions,
  .shelf-item {
    grid-template-columns: 1fr;
  }

  .ticket-actions {
    flex-direction: column;
  }

  .shelf-item img {
    width: 100%;
    height: auto;
    aspect-ratio: 3 / 2;
  }
}
