@import url("https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@600;700&family=Noto+Sans+SC:wght@300;400;500;700&display=swap");

:root {
  --gold: #c9a24a;
  --gold-soft: #e8d5a3;
  --ink: #1a1a1a;
  --cream: #f7f1e6;
  --panel: rgba(250, 246, 238, 0.94);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --font-display: "Cormorant Garamond", serif;
  --font-body: "Noto Sans SC", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  height: 100%;
  background: #0d0d0d;
  font-family: var(--font-body);
  color: var(--ink);
  overflow: hidden;
}
button,
a {
  font-family: inherit;
}
#app {
  position: relative;
  width: 100%;
  height: 100%;
}

/* —— Elevator video gate —— */
.lift {
  position: absolute;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  background: #0a0a0a;
  transition: opacity 0.7s var(--ease), visibility 0.7s;
  overflow: hidden;
}
.lift.is-open {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.lift__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #0a0a0a;
}
.lift__ui {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
  padding: 1.4rem 1.6rem;
  border-radius: 16px;
  background: rgba(10, 10, 10, 0.42);
  border: 1px solid rgba(201, 162, 74, 0.35);
  backdrop-filter: blur(8px);
  transition: opacity 0.35s var(--ease), transform 0.35s var(--ease);
}
.lift.is-playing .lift__ui {
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
}
.lift__floor {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.8rem;
  color: var(--gold);
  letter-spacing: 0.22em;
}
.lift__hint {
  margin: 0 0 0.35rem;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.85rem;
  letter-spacing: 0.18em;
}
.lift__btn {
  appearance: none;
  border: 1px solid var(--gold);
  background: rgba(201, 162, 74, 0.18);
  color: var(--gold-soft);
  padding: 0.7rem 1.4rem;
  letter-spacing: 0.12em;
  cursor: pointer;
  transition: background 0.25s, transform 0.25s;
}
.lift__btn:hover {
  background: rgba(201, 162, 74, 0.32);
  transform: translateY(-1px);
}
.lift__btn:disabled {
  opacity: 0.55;
  cursor: wait;
}
.lift__skip {
  position: absolute;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 5;
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.45);
  background: rgba(0, 0, 0, 0.45);
  color: rgba(255, 255, 255, 0.92);
  padding: 0.55rem 1.05rem;
  font-size: 0.82rem;
  letter-spacing: 0.12em;
  border-radius: 999px;
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: background 0.2s, border-color 0.2s, opacity 0.3s;
}
.lift__skip:hover {
  background: rgba(0, 0, 0, 0.62);
  border-color: var(--gold);
  color: var(--gold-soft);
}
.lift.is-open .lift__skip {
  opacity: 0;
  pointer-events: none;
}

/* —— Chrome —— */
.chrome {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.1rem;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.35), transparent);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s;
}
#app.is-inside .chrome {
  opacity: 1;
  pointer-events: auto;
}
.chrome__back,
.chrome__title {
  color: #fff;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.45);
}
.chrome__back {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(6px);
  padding: 0.4rem 0.75rem;
  font-size: 0.78rem;
  cursor: pointer;
  border-radius: 999px;
}
.chrome__title {
  margin: 0;
  font-weight: 500;
  font-size: 1rem;
  letter-spacing: 0.08em;
}
.chrome__spacer {
  width: 5.5rem;
}

/* —— Scene —— */
.scene {
  position: absolute;
  inset: 0;
  opacity: 0;
  transform: scale(1.03);
  transition: opacity 0.9s var(--ease) 0.35s, transform 1.1s var(--ease) 0.35s;
  overflow: hidden;
}
#app.is-inside .scene {
  opacity: 1;
  transform: none;
}
.scene__bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  user-select: none;
  animation: sceneBreath 14s ease-in-out infinite alternate;
}
@keyframes sceneBreath {
  from {
    transform: scale(1);
  }
  to {
    transform: scale(1.035);
  }
}

/* —— Pins：默认不展示，鼠标滑入热区再提示 —— */
.pin {
  --x: 50%;
  --y: 50%;
  --hit: 7.5rem;
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: var(--hit);
  height: var(--hit);
  transform: translate(-50%, -50%);
  z-index: 5;
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
#app.is-inside .pin {
  pointer-events: auto;
}
.pin__dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(201, 162, 74, 0.22);
  box-shadow: none;
  flex-shrink: 0;
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease), background 0.25s, box-shadow 0.25s;
}
.pin__label {
  position: absolute;
  left: calc(50% + 0.85rem);
  top: 50%;
  transform: translateY(-50%) translateX(6px);
  white-space: nowrap;
  background: rgba(247, 241, 230, 0.95);
  border: 1px solid rgba(201, 162, 74, 0.45);
  color: #3a2f1c;
  padding: 0.35rem 0.7rem;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  border-radius: 999px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.22s var(--ease), transform 0.22s var(--ease), visibility 0.22s;
}
.pin:hover .pin__dot,
.pin:focus-visible .pin__dot {
  opacity: 1;
  transform: scale(1);
  background: var(--gold);
  box-shadow: 0 0 0 8px rgba(201, 162, 74, 0.18);
}
.pin:hover .pin__label,
.pin:focus-visible .pin__label {
  opacity: 1;
  visibility: visible;
  transform: translateY(-50%) translateX(0);
}
@media (hover: none) {
  /* 触屏：保留淡点提示可点区域 */
  .pin__dot {
    opacity: 0.55;
    transform: scale(1);
    background: rgba(201, 162, 74, 0.55);
  }
}

.fab-chat {
  position: absolute;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 6;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  text-decoration: none;
  color: #fff;
  font-size: 0.95rem;
  background: linear-gradient(145deg, #3b82f6, #1d4ed8);
  box-shadow: 0 10px 28px rgba(37, 99, 235, 0.45);
  transition: transform 0.25s;
}
.fab-chat:hover {
  transform: scale(1.06);
}

/* —— Sheet —— */
.overlay {
  position: absolute;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(4px);
}
.overlay[hidden] {
  display: none !important;
}
.sheet {
  width: min(680px, 100%);
  max-height: min(78vh, 720px);
  overflow: auto;
  background: var(--panel);
  border: 1px solid rgba(201, 162, 74, 0.35);
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  animation: sheetIn 0.4s var(--ease);
}
@keyframes sheetIn {
  from {
    transform: translateY(12px) scale(0.98);
    opacity: 0;
  }
  to {
    transform: none;
    opacity: 1;
  }
}
.sheet__head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 1.2rem 0.75rem;
  border-bottom: 1px solid rgba(201, 162, 74, 0.2);
  position: sticky;
  top: 0;
  background: var(--panel);
}
.sheet__kicker {
  margin: 0 0 0.25rem;
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  color: var(--gold);
}
.sheet__kicker:empty {
  display: none;
}
.sheet__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.55rem;
}
.sheet__sub {
  margin: 0.3rem 0 0;
  font-size: 0.85rem;
  color: #6b5d45;
  line-height: 1.45;
}
.sheet__sub:empty {
  display: none;
}
.sheet__close {
  appearance: none;
  width: 2rem;
  height: 2rem;
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: transparent;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.1rem;
}
.sheet__body {
  padding: 1rem 1.2rem 1.4rem;
  font-size: 0.9rem;
  line-height: 1.7;
  color: #3f3528;
}
.sheet__body .lead {
  margin: 0 0 0.9rem;
}
.cards {
  display: grid;
  gap: 0.55rem;
}
.card {
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid rgba(201, 162, 74, 0.2);
  border-radius: 10px;
  padding: 0.75rem 0.85rem;
}
.card h3 {
  margin: 0 0 0.35rem;
  font-size: 0.82rem;
  color: #8a6d2f;
  font-weight: 600;
}
.card p,
.card ul {
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.6;
}
.card ul {
  padding-left: 1.05rem;
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}
.btn {
  appearance: none;
  text-decoration: none;
  border: 1px solid var(--gold);
  background: linear-gradient(135deg, rgba(201, 162, 74, 0.25), rgba(201, 162, 74, 0.08));
  color: #5c4a22;
  padding: 0.55rem 1rem;
  font-size: 0.82rem;
  border-radius: 999px;
  cursor: pointer;
}
.btn:hover {
  background: rgba(201, 162, 74, 0.35);
}
.btn--ghost {
  background: transparent;
  border-color: rgba(92, 74, 34, 0.28);
  color: #6b5d45;
}
.btn.is-disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* —— 本地模型列表 —— */
.model-list {
  display: grid;
  gap: 0.5rem;
}
.model-item {
  appearance: none;
  width: 100%;
  text-align: left;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.65rem;
  align-items: start;
  padding: 0.75rem 0.85rem;
  border-radius: 12px;
  border: 1px solid rgba(201, 162, 74, 0.22);
  background: rgba(255, 255, 255, 0.62);
  cursor: pointer;
  transition: border-color 0.2s, transform 0.2s, background 0.2s;
  color: inherit;
}
.model-item:hover {
  border-color: rgba(201, 162, 74, 0.55);
  background: #fff8ea;
  transform: translateY(-1px);
}
.model-item.is-chat {
  border-color: rgba(201, 162, 74, 0.5);
  box-shadow: inset 0 0 0 1px rgba(201, 162, 74, 0.12);
}
.model-item__no {
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: var(--gold);
  line-height: 1.2;
  padding-top: 0.1rem;
}
.model-item__main {
  display: grid;
  gap: 0.2rem;
  min-width: 0;
}
.model-item__title {
  font-size: 0.95rem;
  font-weight: 600;
  color: #3a2f1c;
}
.model-item__blurb {
  font-size: 0.78rem;
  line-height: 1.5;
  color: #6b5d45;
}
.model-item__meta {
  font-size: 0.7rem;
  color: #8a7b63;
}
.model-item__badge {
  font-size: 0.68rem;
  padding: 0.22rem 0.5rem;
  border-radius: 999px;
  border: 1px solid rgba(201, 162, 74, 0.35);
  color: #7a6430;
  white-space: nowrap;
  align-self: start;
}
.model-item.is-chat .model-item__badge {
  background: rgba(201, 162, 74, 0.2);
  border-color: var(--gold);
  color: #5c4a22;
}

/* —— 聊天弹窗 —— */
.chat-modal {
  position: absolute;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(5px);
}
.chat-modal[hidden] {
  display: none !important;
}
.chat-modal__panel {
  width: min(1080px, 96vw);
  height: min(820px, 90vh);
  background: #f7f1e6;
  border: 1px solid rgba(201, 162, 74, 0.4);
  border-radius: 14px;
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: sheetIn 0.35s var(--ease);
}
.chat-modal__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid rgba(201, 162, 74, 0.22);
  background: rgba(250, 246, 238, 0.98);
}
.chat-modal__kicker {
  margin: 0 0 0.15rem;
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  color: var(--gold);
}
.chat-modal__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.25rem;
}
.chat-modal__panel--native {
  background: #f3eee4;
}
.chat-modal__head-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}
.chat-reset {
  appearance: none;
  border: 1px solid rgba(92, 74, 34, 0.25);
  background: transparent;
  color: #6b5d45;
  font-size: 0.75rem;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  cursor: pointer;
}
.chat-thread {
  flex: 1;
  overflow: auto;
  padding: 1rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.35), transparent 40%),
    #efe8db;
}
.chat-row {
  display: flex;
  max-width: 92%;
}
.chat-row--user {
  align-self: flex-end;
}
.chat-row--assistant {
  align-self: flex-start;
}
.chat-bubble {
  padding: 0.7rem 0.9rem;
  border-radius: 14px;
  font-size: 0.88rem;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
}
.chat-row--user .chat-bubble {
  background: linear-gradient(135deg, #d4af37, #b8922e);
  color: #1f180c;
  border-bottom-right-radius: 4px;
}
.chat-row--assistant .chat-bubble {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(201, 162, 74, 0.25);
  color: #3f3528;
  border-bottom-left-radius: 4px;
}
.chat-bubble.is-typing {
  opacity: 0.7;
}
.chat-composer {
  border-top: 1px solid rgba(201, 162, 74, 0.22);
  padding: 0.65rem 0.9rem 0.8rem;
  background: rgba(250, 246, 238, 0.98);
}
.chat-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.55rem;
}
.chat-chip {
  appearance: none;
  border: 1px solid rgba(201, 162, 74, 0.35);
  background: rgba(255, 255, 255, 0.7);
  color: #5c4a22;
  font-size: 0.72rem;
  padding: 0.3rem 0.55rem;
  border-radius: 999px;
  cursor: pointer;
  max-width: 100%;
  text-align: left;
}
.chat-chip:hover {
  background: #fff8ea;
}
.chat-composer__row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.55rem;
  align-items: end;
}
.chat-composer textarea {
  width: 100%;
  resize: none;
  border: 1px solid rgba(201, 162, 74, 0.35);
  border-radius: 12px;
  padding: 0.65rem 0.75rem;
  font: inherit;
  font-size: 0.88rem;
  background: #fff;
  color: #3f3528;
  outline: none;
}
.chat-composer textarea:focus {
  border-color: var(--gold);
}
.chat-send {
  height: 42px;
  padding: 0 1.1rem;
}
.chat-status {
  margin: 0.45rem 0 0;
  font-size: 0.72rem;
  color: #8a7b63;
  min-height: 1em;
}
.chat-status.is-error {
  color: #a45a5a;
}
.sheet__body code {
  font-size: 0.78em;
  padding: 0.1em 0.35em;
  border-radius: 4px;
  background: rgba(201, 162, 74, 0.15);
}
.note {
  margin: 0.75rem 0 0;
  font-size: 0.75rem;
  color: #8a7b63;
}
.note.warn {
  color: #a45a5a;
}
.quote {
  margin: 0.9rem 0 0;
  padding: 0.7rem 0.85rem;
  border-left: 3px solid var(--gold);
  background: rgba(255, 255, 255, 0.5);
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: #5c4a22;
}
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.75rem;
}
.tag {
  font-size: 0.7rem;
  padding: 0.25rem 0.5rem;
  border-radius: 999px;
  border: 1px solid rgba(201, 162, 74, 0.35);
  color: #7a6430;
}
.qlist {
  margin: 0.6rem 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.35rem;
}
.qlist li {
  font-size: 0.8rem;
  padding: 0.45rem 0.6rem;
  background: rgba(255, 255, 255, 0.55);
  border-radius: 8px;
  border-left: 2px solid var(--gold);
}
.credit {
  margin-top: 0.9rem;
  font-size: 0.72rem;
  color: #8a7b63;
}
.toast {
  position: absolute;
  left: 50%;
  bottom: 5rem;
  transform: translateX(-50%) translateY(10px);
  z-index: 70;
  background: rgba(30, 24, 16, 0.92);
  color: #f7f1e6;
  padding: 0.65rem 1rem;
  border-radius: 999px;
  font-size: 0.8rem;
  opacity: 0;
  visibility: hidden;
  transition: 0.3s var(--ease);
  max-width: 90vw;
}
.toast.show {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 720px) {
  .pin__label {
    font-size: 0.72rem;
    padding: 0.28rem 0.55rem;
  }
  .chrome__title {
    font-size: 0.85rem;
  }
}
@media (prefers-reduced-motion: reduce) {
  .scene__bg,
  .pin__dot {
    animation: none !important;
  }
}
