/* ============ 广慈时光诊所 · 全局基底 ============ */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --ink: #3a2f26;
  --paper: #f5ecd9;
  --paper-2: #efe3c8;
  --gold: #b08d4f;
  --red: #9e3b2e;
  --shadow: 0 10px 30px rgba(60, 40, 20, .18);
  --radius: 16px;
  font-size: 16px;
}

html, body {
  height: 100%;
  font-family: "Noto Serif SC", "Songti SC", "STSong", "SimSun", serif;
  color: var(--ink);
  background: #2a2118;
}

body {
  overflow: hidden;
}

/* 纸张纹理背景 */
.screen {
  display: none;
  position: fixed;
  inset: 0;
  overflow-y: auto;
  background:
    radial-gradient(circle at 20% 10%, rgba(255,255,255,.5), transparent 60%),
    repeating-linear-gradient(0deg, rgba(120,90,50,.04) 0 2px, transparent 2px 6px),
    linear-gradient(160deg, #f7f0de, #ecdfc2);
}
.screen.active { display: block; }

button { font-family: inherit; cursor: pointer; }
em { font-style: normal; }

/* ============ 按钮 ============ */
.btn {
  border: 1.5px solid var(--gold);
  border-radius: 999px;
  padding: .7rem 1.6rem;
  font-size: 1rem;
  letter-spacing: .12em;
  transition: transform .15s, box-shadow .15s, background .2s;
}
.btn:active { transform: scale(.96); }
.btn-primary {
  background: linear-gradient(135deg, #b04632, #8d3325);
  color: #fff7e8;
  border-color: #8d3325;
  box-shadow: 0 6px 18px rgba(158,59,46,.35);
}
.btn-primary:hover { box-shadow: 0 8px 22px rgba(158,59,46,.5); }
.btn-ghost {
  background: rgba(255,252,244,.8);
  color: var(--ink);
}
.btn-ghost:hover { background: #fff; }
.btn-icon { padding: .7rem .9rem; }
.btn-back {
  background: none;
  border: none;
  font-size: 1.05rem;
  color: var(--ink);
  padding: .4rem .6rem;
  opacity: .8;
}
.btn-back:hover { opacity: 1; }
.btn-album-top em {
  font-style: normal;
  background: var(--red);
  color: #fff;
  border-radius: 999px;
  padding: .05rem .5rem;
  font-size: .82rem;
  margin-left: .25rem;
}

/* ============ 首页 ============ */
#screen-home {
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}
#screen-home.active { display: flex; }

.home-paper {
  position: relative;
  width: min(680px, 100%);
  background: rgba(255, 250, 238, .92);
  border: 1px solid var(--gold);
  border-radius: 20px;
  box-shadow: var(--shadow);
  padding: 2.6rem 2.2rem 2rem;
  text-align: center;
}
.home-paper::before {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px dashed rgba(176,141,79,.55);
  border-radius: 14px;
  pointer-events: none;
}
.home-seal {
  display: inline-block;
  border: 2px solid var(--red);
  color: var(--red);
  border-radius: 6px;
  padding: .15rem .7rem;
  font-size: .85rem;
  letter-spacing: .3em;
  margin-bottom: 1rem;
  transform: rotate(-2deg);
}
.home-title {
  font-size: clamp(2.1rem, 6vw, 3.2rem);
  letter-spacing: .18em;
  color: #7c2c20;
  text-shadow: 0 2px 0 rgba(176,141,79,.25);
}
.home-sub {
  margin-top: .4rem;
  color: var(--gold);
  letter-spacing: .25em;
  font-size: .95rem;
}
.home-desc {
  margin: 1.4rem auto 0;
  line-height: 2;
  font-size: 1.02rem;
  max-width: 30em;
}
.hl { color: var(--red); font-weight: bold; }

.home-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .8rem;
  margin: 1.6rem 0 .4rem;
  flex-wrap: wrap;
}
.step {
  background: var(--paper-2);
  border: 1px solid rgba(176,141,79,.5);
  border-radius: 12px;
  padding: .6rem 1rem;
  font-size: .95rem;
  white-space: nowrap;
}
.step-num {
  color: var(--red);
  font-weight: bold;
  margin-right: .4rem;
}
.step-arrow { color: var(--gold); }

.fact-bar {
  margin: 1.4rem auto 0;
  background: rgba(176,141,79,.12);
  border-left: 4px solid var(--gold);
  border-radius: 8px;
  padding: .55rem .9rem;
  font-size: .9rem;
  text-align: left;
  min-height: 2.3em;
  line-height: 1.5;
}
.fact-tag {
  color: #fff;
  background: var(--gold);
  border-radius: 4px;
  font-size: .75rem;
  padding: .05rem .4rem;
  margin-right: .5rem;
  letter-spacing: .1em;
}

.home-btns {
  margin-top: 1.8rem;
  display: flex;
  gap: .8rem;
  justify-content: center;
  flex-wrap: wrap;
}
.home-foot {
  margin-top: 1rem;
  font-size: .75rem;
  color: rgba(58,47,38,.55);
  letter-spacing: .05em;
}
.home-disclaimer {
  margin-top: 1.4rem;
  font-size: .8rem;
  line-height: 1.6;
  color: #8a5a10;
  background: rgba(176,141,79,.1);
  border-left: 3px solid var(--gold);
  border-radius: 6px;
  padding: .5rem .8rem;
  text-align: left;
}

/* 用户状态栏 */
.user-bar {
  display: flex;
  align-items: center;
  gap: .8rem;
  background: linear-gradient(135deg, rgba(255,250,235,.9), rgba(247,236,210,.9));
  border: 1px solid rgba(176,141,79,.5);
  border-radius: 14px;
  padding: .6rem .9rem;
  margin: 1rem 0;
  box-shadow: 0 3px 12px rgba(80,55,25,.1);
}
.user-avatar {
  font-size: 1.6rem;
  flex: none;
}
.user-info { flex: 1; min-width: 0; }
.user-name { font-weight: bold; font-size: .95rem; display: flex; align-items: center; gap: .4rem; }
.user-level {
  background: linear-gradient(135deg, var(--gold), #d4943a);
  color: #fff;
  font-size: .7rem;
  padding: .1rem .45rem;
  border-radius: 999px;
  font-weight: bold;
}
.exp-bar {
  position: relative;
  height: 12px;
  background: rgba(120,90,50,.18);
  border-radius: 999px;
  margin-top: .3rem;
  overflow: hidden;
}
.exp-bar i {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #5cb85c, #9ad44a);
  border-radius: 999px;
  transition: width .4s ease;
}
.exp-bar em {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .68rem;
  font-style: normal;
  color: #5a4a2a;
  font-weight: bold;
}

/* 昵称弹窗 */
.modal-nick { max-width: 380px; text-align: center; }
.nick-desc { font-size: .88rem; color: rgba(58,47,38,.7); line-height: 1.7; margin-bottom: 1rem; }
.nick-input {
  width: 100%;
  padding: .7rem 1rem;
  font-size: 1rem;
  border: 2px solid rgba(176,141,79,.5);
  border-radius: 10px;
  background: rgba(255,255,255,.7);
  text-align: center;
  outline: none;
  transition: border-color .2s;
}
.nick-input:focus { border-color: var(--red); }
.nick-suggest {
  margin: .8rem 0 1.2rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: .35rem;
  font-size: .8rem;
  color: rgba(58,47,38,.6);
}
.nick-suggest .btn { padding: .25rem .6rem; font-size: .78rem; }

.lantern {
  position: fixed;
  top: -10px;
  width: 46px;
  height: 70px;
  background: radial-gradient(circle at 50% 40%, #d96a4f, #a32);
  border-radius: 50% 50% 46% 46%;
  box-shadow: 0 0 30px rgba(200,80,50,.5);
  opacity: .5;
  pointer-events: none;
}
.lantern::after {
  content: "";
  position: absolute;
  bottom: -12px; left: 50%;
  transform: translateX(-50%);
  width: 4px; height: 14px;
  background: #7c2c20;
}
.lantern { left: 4%; }

/* ============ 顶栏 ============ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .8rem 1.2rem;
  background: rgba(247,240,222,.92);
  border-bottom: 1px solid rgba(176,141,79,.4);
  backdrop-filter: blur(6px);
}
.topbar h2 {
  font-size: 1.15rem;
  letter-spacing: .18em;
  color: #7c2c20;
}

/* ============ 时空门 ============ */
.doors-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.3rem;
  max-width: 1080px;
  margin: 0 auto;
  padding: 1.8rem 1.4rem 3rem;
}
.door {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  min-height: 340px;
  border: 1px solid rgba(176,141,79,.55);
  box-shadow: var(--shadow);
  background-size: cover;
  background-position: center;
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  text-align: left;
  isolation: isolate;
  transition: transform .25s, box-shadow .25s;
}
.door:hover { transform: translateY(-6px); box-shadow: 0 18px 40px rgba(50,30,10,.35); }
.door-fallback,
.door::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
}
.door-scene {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
}
.door-scene img,
.door-scene svg {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transition: transform .4s ease;
}
.door-scene svg { display: none; }
.door-svg-fallback svg { display: block; }
.door:hover .door-scene img,
.door:hover .door-scene svg { transform: scale(1.08); }
.door-fallback {
  z-index: -2;
  transition: background .3s;
}
.door[data-era="qing"] .door-fallback { background: linear-gradient(160deg, #6e352b, #2f1a14); }
.door[data-era="minguo"] .door-fallback { background: linear-gradient(160deg, #346b5e, #15302b); }
.door[data-era="bashi"] .door-fallback { background: linear-gradient(160deg, #d98242, #7a3f1c); }
.door[data-era="now"] .door-fallback { background: linear-gradient(160deg, #2f8fad, #123b52); }
.door::after { background: linear-gradient(180deg, rgba(10,8,6,.05) 30%, rgba(10,8,6,.82) 100%); z-index: 0; }
.door-body { position: relative; z-index: 1; padding: 1.3rem; }
.door-year {
  font-size: 2.3rem;
  font-weight: bold;
  letter-spacing: .1em;
  opacity: .95;
}
.door-title { font-size: 1.35rem; letter-spacing: .15em; margin-top: .15rem; }
.door-sub { font-size: .85rem; opacity: .82; margin-top: .25rem; letter-spacing: .05em; }
.door-cta {
  display: inline-block;
  margin-top: .9rem;
  border: 1px solid rgba(255,255,255,.75);
  border-radius: 999px;
  padding: .3rem 1rem;
  font-size: .85rem;
  letter-spacing: .2em;
}
.door-done {
  position: absolute;
  top: .9rem; right: .9rem;
  z-index: 2;
  background: rgba(255,255,255,.92);
  color: var(--red);
  border-radius: 999px;
  font-size: .75rem;
  padding: .15rem .6rem;
}

/* ============ 诊室对话 ============ */
/* 保持 .screen 的 position:fixed;inset:0 铺满视口，勿用 relative 覆盖（否则内容不足时下方露出深色 body 底色） */
#screen-chat { display: none; }
#screen-chat.active { display: flex; flex-direction: column; }

/* 诊室年代背景：复用上海地标 SVG，低透明度铺底 + 缓动漂浮 */
.era-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  opacity: 0;
  transition: opacity .6s ease;
}
#screen-chat.active .era-bg { opacity: 1; }
.era-bg svg, .era-bg img {
  width: 120%;
  height: 120%;
  position: absolute;
  top: -10%;
  left: -10%;
  object-fit: cover;
  filter: blur(1px) brightness(.72) saturate(.92);
  transform-origin: center;
  animation: bgFloat 22s ease-in-out infinite;
}
.era-svg-fallback { display: block; position: absolute; inset: 0; }
.era-svg-fallback svg { display: block; }
@keyframes bgFloat {
  0%, 100% { transform: scale(1.02) translate(0, 0); }
  50% { transform: scale(1.08) translate(-1.5%, -1%); }
}
.chat-veil {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  /* 中心微微透出年代照片，四周收为干净浅米白，避免两侧出现脏棕色块 */
  background: radial-gradient(ellipse at 50% 28%, rgba(250,246,236,.42), rgba(248,243,232,.94) 80%);
}
#screen-chat > *:not(.era-bg):not(.chat-veil) { position: relative; z-index: 2; }

/* 打字机光标 */
.caret {
  display: inline-block;
  width: 2px;
  height: 1.05em;
  margin-left: 2px;
  background: var(--ink);
  vertical-align: text-bottom;
  animation: blink 1s steps(2) infinite;
  opacity: .7;
}
@keyframes blink { 50% { opacity: 0; } }

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .8rem;
  padding: .7rem max(1.1rem, calc(50% - 380px));
  background: rgba(255,251,240,.95);
  border-bottom: 1px solid rgba(176,141,79,.4);
}
.doctor-meta { display: flex; align-items: center; gap: .7rem; }
.doctor-avatar {
  width: 48px; height: 48px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--gold);
  background: var(--paper-2);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.doctor-avatar img {
  width: 100%; height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}
.medallion {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #f7ecd4;
  font-size: 1.25rem;
  font-weight: bold;
  letter-spacing: 0;
  text-shadow: 0 1px 3px rgba(0,0,0,.3);
  box-shadow: inset 0 0 0 2px rgba(247,236,212,.35), 0 2px 8px rgba(60,40,20,.25);
}
.msg-avatar.medallion {
  font-size: 1rem;
  border-color: rgba(247,236,212,.5);
}
.doctor-name { font-weight: bold; font-size: 1.05rem; }
.doctor-place { font-size: .78rem; opacity: .65; }

/* 诊室顶部免责横幅：低饱和暖白，与四个年代配色都协调 */
.disclaimer-bar {
  display: flex;
  align-items: center;
  gap: .55rem;
  background: rgba(255,251,240,.9);
  border-bottom: 1px solid rgba(176,141,79,.35);
  padding: .5rem max(1rem, calc(50% - 380px));
  font-size: .82rem;
  line-height: 1.5;
  color: #6d5636;
}
.disclaimer-bar .disc-icon {
  flex: none;
  color: #b07a2a;
  font-size: 1rem;
}
/* 单行精简免责条：时空门等非问诊页使用 */
.disclaimer-bar.slim { padding: .35rem max(1rem, calc(50% - 380px)); font-size: .76rem; }

/* 图鉴/影院页顶部免责小字 */
.screen-disclaimer {
  max-width: 780px;
  margin: .6rem auto 0;
  padding: 0 1rem;
  font-size: .76rem;
  line-height: 1.6;
  color: #9a7a4a;
}

/* 问诊输入栏下方常驻免责小字 */
.chat-foot-disclaimer {
  max-width: 760px;
  width: 100%;
  margin: 0 auto;
  padding: 0 1rem .5rem;
  font-size: .68rem;
  line-height: 1.5;
  color: #ad8a55;
  text-align: center;
}

.bubble-disclaimer {
  display: block;
  margin-top: .55rem;
  padding-top: .5rem;
  border-top: 1px dashed rgba(120,90,50,.35);
  font-size: .74rem;
  line-height: 1.55;
  color: #9a7a4a;
  letter-spacing: .02em;
}

.bubble-emergency {
  background: #fff0f0 !important;
  border: 2px solid #c0392b !important;
  color: #7b1f1f !important;
  font-weight: 500;
  box-shadow: 0 4px 14px rgba(192,57,43,.22);
}

/* 就医呼救关键词：红色加粗，急症泡内用更深红+下划线 */
.red-urgent { color: #c0392b; font-weight: 700; }
.bubble-emergency .red-urgent {
  color: #a01515;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* 急症泡内的短免责 */
.emergency-disc {
  display: block;
  margin-top: .5rem;
  padding-top: .45rem;
  border-top: 1px dashed rgba(160,21,21,.4);
  font-size: .72rem;
  line-height: 1.55;
  font-weight: normal;
  color: #a35040;
  letter-spacing: .02em;
}

.chat-scroll { flex: 1; overflow-y: auto; padding: 1.2rem 0 .4rem; }
.chat-msgs {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  flex-direction: column;
  gap: .9rem;
}
.msg { display: flex; gap: .6rem; max-width: 88%; animation: rise .3s ease; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.msg.user { align-self: flex-end; flex-direction: row-reverse; }
.msg-avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  background: var(--paper-2);
  border: 1px solid rgba(176,141,79,.5);
  overflow: hidden;
}
.msg.user .msg-avatar { background: #7c2c20; color: #fff; border-color: #7c2c20; }
.bubble {
  padding: .75rem 1rem;
  border-radius: 14px;
  line-height: 1.75;
  font-size: .98rem;
  white-space: pre-wrap;
}
.msg.doctor .bubble {
  background: rgba(255,253,246,.96);
  border: 1px solid rgba(176,141,79,.4);
  border-top-left-radius: 4px;
  box-shadow: 0 3px 10px rgba(80,55,25,.08);
}
.msg.user .bubble {
  background: #7c2c20;
  color: #fff7e8;
  border-top-right-radius: 4px;
}
.bubble .card-inline {
  display: block;
  margin-top: .7rem;
  border: 1px dashed var(--gold);
  border-radius: 10px;
  padding: .55rem .8rem;
  font-size: .85rem;
  color: #8a6a2f;
  background: rgba(176,141,79,.1);
}
.typing { display: inline-flex; gap: 4px; }
.typing i {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--gold);
  animation: blink 1.2s infinite;
}
.typing i:nth-child(2) { animation-delay: .2s; }
.typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 60%, 100% { opacity: .25; } 30% { opacity: 1; } }

/* 快捷问题 */
.chat-chips {
  max-width: 760px;
  width: 100%;
  margin: 0 auto;
  padding: .4rem 1rem;
  display: flex;
  gap: .5rem;
  overflow-x: auto;
  scrollbar-width: none;
}
.chat-chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none;
  border: 1px solid rgba(176,141,79,.6);
  background: rgba(255,252,244,.9);
  border-radius: 999px;
  padding: .42rem .95rem;
  font-size: .85rem;
  color: var(--ink);
  white-space: nowrap;
}
.chip:hover { background: #fff; border-color: var(--red); }

/* 兜底回答后的话题引导条 */
.bubble-guide { background: rgba(255,252,244,.94); }
.guide-tip { font-size: .85rem; color: #8a5a10; }
.guide-btns { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .55rem; }
.guide-btn {
  border: 1px solid rgba(176,141,79,.6);
  background: rgba(255,250,238,.92);
  border-radius: 999px;
  padding: .32rem .75rem;
  font-size: .82rem;
  color: var(--ink);
  transition: background .2s, border-color .2s, transform .15s;
}
.guide-btn:hover { background: #fff; border-color: var(--red); transform: translateY(-1px); }
.guide-btn:active { transform: scale(.95); }

/* 输入栏 */
.chat-inputbar {
  display: flex;
  gap: .6rem;
  padding: .8rem 1rem 1rem;
  max-width: 760px;
  width: 100%;
  margin: 0 auto;
}
#chat-input {
  flex: 1;
  resize: none;
  border: 1.5px solid rgba(176,141,79,.6);
  border-radius: 14px;
  padding: .7rem .95rem;
  font-family: inherit;
  font-size: .98rem;
  line-height: 1.5;
  max-height: 110px;
  background: rgba(255,253,246,.95);
  color: var(--ink);
}
#chat-input:focus { outline: none; border-color: var(--red); }
.btn-send {
  flex: none;
  align-self: flex-end;
  border: none;
  border-radius: 14px;
  padding: .7rem 1.4rem;
  background: linear-gradient(135deg, #b04632, #8d3325);
  color: #fff7e8;
  letter-spacing: .15em;
  box-shadow: 0 4px 14px rgba(158,59,46,.3);
}
.btn-send:disabled { opacity: .5; cursor: not-allowed; }

/* 各年代强调色（聊天气泡与头部） */
#screen-chat[data-era="qing"] { background: linear-gradient(160deg, #f7f0de, #e9d9bd); }
#screen-chat[data-era="qing"] .doctor-avatar { border-color: #9e3b2e; }
#screen-chat[data-era="minguo"] { background: linear-gradient(160deg, #f7f0de, #dce9e2); }
#screen-chat[data-era="bashi"] { background: linear-gradient(160deg, #f7f0de, #f7e3cf); }
#screen-chat[data-era="now"] { background: linear-gradient(160deg, #f4f8fa, #d7eaf1); }

/* ============ 图鉴 ============ */
.album-progress {
  max-width: 1080px;
  margin: 1.2rem auto 0;
  padding: 0 1.4rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}
.album-progress-bar {
  flex: 1;
  height: 10px;
  border-radius: 999px;
  background: rgba(176,141,79,.2);
  overflow: hidden;
}
.album-progress-bar i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #c9a25e, var(--red));
  transition: width .5s;
}
.album-progress span { font-size: .88rem; white-space: nowrap; }

.album-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.1rem;
  max-width: 1080px;
  margin: 1.2rem auto 3rem;
  padding: 0 1.4rem;
}
.compare-card {
  position: relative;
  border-radius: 14px;
  padding: 1.1rem 1.05rem 1rem;
  background: rgba(255,253,246,.97);
  border: 1px solid rgba(176,141,79,.5);
  box-shadow: 0 5px 16px rgba(80,55,25,.1);
}
.compare-card .cc-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  margin-bottom: .6rem;
}
.cc-topic { font-weight: bold; letter-spacing: .08em; }
.cc-era {
  font-size: .72rem;
  border-radius: 4px;
  padding: .1rem .45rem;
  color: #fff;
  white-space: nowrap;
}
.cc-row {
  position: relative;
  border-radius: 8px;
  padding: .55rem .7rem;
  font-size: .84rem;
  line-height: 1.65;
}
.cc-old { background: rgba(122,90,50,.1); border: 1px dashed rgba(122,90,50,.45); }
.cc-now { background: rgba(31,111,139,.08); border: 1px dashed rgba(31,111,139,.4); margin-top: .55rem; }
.cc-label { font-weight: bold; margin-right: .35rem; }
.cc-old .cc-label { color: #7a5a32; }
.cc-now .cc-label { color: #1f6f8b; }
.cc-arrow { text-align: center; color: var(--red); font-size: .9rem; margin: .15rem 0; }

/* 未获得卡片：灰印 */
.card-locked {
  filter: grayscale(1);
  opacity: .45;
  user-select: none;
}
.card-locked .cc-row { color: transparent; position: relative; min-height: 2.4em; }
.card-locked .cc-row::after {
  content: "？";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(58,47,38,.4);
  font-size: 1.2rem;
}
.card-locked .cc-label, .card-locked .cc-arrow { visibility: hidden; }

/* 新卡弹窗动效 */
.compare-card.reveal { animation: deal .55s cubic-bezier(.2,1.2,.4,1); }
@keyframes deal {
  from { opacity: 0; transform: rotateY(60deg) scale(.8); }
  to { opacity: 1; transform: none; }
}

/* ============ 弹窗 ============ */
.modal-mask {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(30,20,12,.55);
  align-items: center;
  justify-content: center;
  padding: 1.2rem;
}
.modal-mask.show { display: flex; }
.modal-card {
  width: min(560px, 100%);
  max-height: 88vh;
  overflow-y: auto;
  background: #fdf8ec;
  border: 1px solid var(--gold);
  border-radius: 18px;
  padding: 1.6rem;
  box-shadow: 0 24px 60px rgba(0,0,0,.4);
  animation: rise .3s ease;
}
.modal-title {
  text-align: center;
  font-size: 1.2rem;
  letter-spacing: .2em;
  color: #7c2c20;
  margin-bottom: 1.1rem;
}
.modal-btns { display: flex; justify-content: center; gap: .8rem; margin-top: 1.3rem; flex-wrap: wrap; }

.modal-settings label {
  display: block;
  font-size: .85rem;
  margin: .8rem 0 .3rem;
  color: #6b5a44;
  letter-spacing: .08em;
}
.modal-settings input, .modal-settings select {
  width: 100%;
  border: 1.5px solid rgba(176,141,79,.6);
  border-radius: 10px;
  padding: .6rem .8rem;
  font-family: inherit;
  font-size: .92rem;
  background: #fffdf6;
  color: var(--ink);
}
.modal-settings input:focus, .modal-settings select:focus { outline: none; border-color: var(--red); }
.settings-tip {
  font-size: .82rem;
  line-height: 1.7;
  color: #6b5a44;
  background: rgba(176,141,79,.1);
  border-radius: 10px;
  padding: .7rem .9rem;
}

/* ============ Toast ============ */
.toast {
  position: fixed;
  left: 50%;
  bottom: 26%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(40,28,18,.92);
  color: #fff7e8;
  padding: .7rem 1.3rem;
  border-radius: 999px;
  font-size: .9rem;
  letter-spacing: .08em;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s, transform .3s;
  z-index: 80;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ============ 科普影院 ============ */
.cinema-wrap {
  max-width: 1100px;
  margin: 1.2rem auto 3rem;
  padding: 0 1.2rem;
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 1.3rem;
}
.cinema-player { background: rgba(20,16,10,.06); border-radius: 18px; padding: 1rem; }
.cinema-screen {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  border-radius: 12px;
  overflow: hidden;
  background: #1a1410;
  cursor: pointer;
}
.cinema-stage {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity .8s ease, transform 1s ease;
  transform: scale(1.04);
}
.cinema-stage svg { width: 100%; height: 100%; display: block; }
.cinema-stage img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.cinema-stage.on { opacity: .85; }
/* 容器同时挂了 .cinema-stage 类，必须强制可见，否则整层被 opacity:0 吞掉 */
#cinema-stage { opacity: 1 !important; }
.cinema-screen.playing .cinema-stage.on { animation: cinemaPan 14s ease-in-out infinite; }
@keyframes cinemaPan {
  0%, 100% { transform: scale(1.05) translate(0,0); }
  50% { transform: scale(1.15) translate(-2%, -1.5%); }
}
.cinema-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,.1) 0%, rgba(0,0,0,.2) 55%, rgba(0,0,0,.78) 100%);
  pointer-events: none;
}
.cinema-caption {
  position: absolute;
  left: 6%;
  right: 6%;
  bottom: 9%;
  color: #fff7e8;
  font-size: clamp(.95rem, 2.4vw, 1.3rem);
  line-height: 1.7;
  text-align: center;
  text-shadow: 0 2px 10px rgba(0,0,0,.8);
  opacity: 0;
  transition: opacity .4s ease;
}
.cinema-screen.playing .cinema-caption { opacity: 1; }
.cinema-chip {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0,0,0,.55);
  color: #fff;
  padding: .6rem 1.4rem;
  border-radius: 999px;
  font-size: .95rem;
  letter-spacing: .1em;
  pointer-events: none;
  transition: opacity .3s;
}
.cinema-screen.playing .cinema-chip { opacity: 0; }
.cinema-progress {
  height: 6px;
  background: rgba(120,90,50,.2);
  border-radius: 999px;
  overflow: hidden;
  margin-top: .8rem;
}
.cinema-progress i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--gold), var(--red));
  transition: width .25s linear;
}
.cinema-btns { display: flex; justify-content: center; gap: .7rem; margin-top: .8rem; flex-wrap: wrap; }
.cinema-meta { text-align: center; font-size: .82rem; color: rgba(58,47,38,.65); margin-top: .5rem; }

.cinema-list { display: flex; flex-direction: column; gap: .8rem; }
.cinema-item {
  display: flex;
  gap: .7rem;
  align-items: center;
  background: rgba(255,251,240,.9);
  border: 1px solid rgba(176,141,79,.45);
  border-radius: 12px;
  padding: .7rem;
  cursor: pointer;
  transition: transform .2s, box-shadow .2s;
}
.cinema-item:hover { transform: translateY(-3px); box-shadow: 0 8px 20px rgba(80,55,25,.15); }
.cinema-item.active { border-color: var(--red); box-shadow: 0 0 0 2px rgba(158,59,46,.25); }
.cinema-thumb {
  flex: none;
  width: 92px; height: 52px;
  border-radius: 8px;
  overflow: hidden;
  background: #1a1410;
}
.cinema-thumb svg { width: 100%; height: 100%; display: block; opacity: .85; }
.cinema-item-info { flex: 1; min-width: 0; }
.cinema-item-title { font-weight: bold; font-size: .95rem; }
.cinema-item-sub { font-size: .78rem; opacity: .65; margin-top: .15rem; }
.cinema-item-era { font-size: .7rem; color: var(--red); margin-top: .2rem; }

@media (max-width: 820px) {
  .cinema-wrap { grid-template-columns: 1fr; }
  .cinema-list { flex-direction: row; overflow-x: auto; padding-bottom: .4rem; }
  .cinema-item { flex: none; width: 240px; }
}

/* ============ 窄屏适配 ============ */
@media (max-width: 560px) {
  .home-paper { padding: 2rem 1.2rem 1.4rem; }
  .topbar h2 { font-size: 1rem; letter-spacing: .1em; }
  .door { min-height: 280px; }
  .msg { max-width: 94%; }
  .doctor-place { display: none; }
  .btn-back { font-size: .95rem; padding: .3rem; }
}

/* ============ AI医生模式徽章（诊室免责栏右侧） ============ */
.ai-badge {
  flex: none;
  margin-left: auto;
  border: 1px solid rgba(176,141,79,.65);
  background: rgba(255,252,244,.95);
  color: #6d5636;
  border-radius: 999px;
  font-size: .74rem;
  padding: .18rem .65rem;
  white-space: nowrap;
  transition: background .2s, border-color .2s, transform .15s;
}
.ai-badge:hover { background: #fff; border-color: var(--red); }
.ai-badge:active { transform: scale(.95); }
.ai-badge.on {
  border-color: #2f6b5e;
  background: rgba(47,107,94,.12);
  color: #2f6b5e;
}
@media (max-width: 560px) {
  .disclaimer-bar { flex-wrap: wrap; }
  .ai-badge { font-size: .7rem; padding: .15rem .5rem; }
}

/* ============ 医事科普馆 ============ */
.science-notice {
  padding: .7rem max(1rem, calc(50% - 380px)) 0;
  font-size: .8rem;
  color: #8a5a10;
  line-height: 1.6;
}
.era-tabs {
  display: flex;
  gap: .55rem;
  padding: .8rem max(1rem, calc(50% - 380px)) .2rem;
}
.era-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .05rem;
  border: 1.5px solid rgba(176,141,79,.55);
  background: rgba(255,252,244,.92);
  border-radius: 14px;
  padding: .5rem .2rem;
  transition: transform .15s, box-shadow .2s, background .2s;
}
.era-tab:active { transform: scale(.96); }
.era-tab-year { font-weight: bold; letter-spacing: .05em; }
.era-tab-name { font-size: .74rem; opacity: .7; }
.era-tab.active {
  background: var(--tab-accent, var(--red));
  border-color: var(--tab-accent, var(--red));
  color: #fff7e8;
  box-shadow: 0 5px 14px rgba(60,40,20,.25);
}
.era-tab.active .era-tab-name { opacity: .85; }

.science-wrap {
  max-width: 780px;
  margin: 0 auto;
  padding: .8rem 1rem 1.5rem;
}
.science-intro {
  display: flex;
  gap: .8rem;
  align-items: flex-start;
  background: rgba(255,250,238,.92);
  border: 1px solid rgba(176,141,79,.5);
  border-left: 4px solid var(--card-accent, var(--red));
  border-radius: 14px;
  padding: .9rem 1rem;
  box-shadow: 0 4px 12px rgba(80,55,25,.08);
  margin-bottom: 1rem;
}
.si-avatar {
  width: 46px; height: 46px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff7e8;
  font-size: 1.2rem;
  flex: none;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.25);
}
.si-body { flex: 1; min-width: 0; }
.si-doctor { font-weight: bold; letter-spacing: .04em; }
.si-place { font-size: .78rem; opacity: .65; margin-top: .1rem; }
.si-facts { font-size: .82rem; line-height: 1.75; margin-top: .5rem; color: #6d5636; }

.science-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: .9rem;
}
.science-card {
  background: rgba(255,253,246,.96);
  border: 1px solid rgba(176,141,79,.4);
  border-top: 3px solid var(--card-accent, var(--red));
  border-radius: var(--radius);
  padding: .9rem 1rem;
  box-shadow: 0 4px 12px rgba(80,55,25,.08);
  animation: rise .3s ease;
}
.sc-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .5rem;
  margin-bottom: .55rem;
}
.sc-topic { font-weight: bold; letter-spacing: .06em; }
.sc-era {
  color: #fff7e8;
  font-size: .72rem;
  border-radius: 999px;
  padding: .12rem .6rem;
  white-space: nowrap;
}
.sc-doctor {
  background: rgba(122,90,50,.07);
  border: 1px dashed rgba(122,90,50,.4);
  border-radius: 10px;
  padding: .6rem .75rem;
  font-size: .86rem;
  line-height: 1.75;
}
.sc-doctor-label {
  display: block;
  font-weight: bold;
  font-size: .78rem;
  color: #7a5a32;
  margin-bottom: .2rem;
}
.sc-row {
  font-size: .85rem;
  line-height: 1.7;
  border-radius: 10px;
  padding: .5rem .7rem;
  margin-top: .55rem;
}
.sc-old { background: rgba(122,90,50,.1); border: 1px dashed rgba(122,90,50,.45); }
.sc-now { background: rgba(31,111,139,.08); border: 1px dashed rgba(31,111,139,.4); }
.sc-label { font-weight: bold; margin-right: .3rem; }
.sc-old .sc-label { color: #7a5a32; }
.sc-now .sc-label { color: #1f6f8b; }
.sc-arrow { text-align: center; color: var(--red); font-size: .8rem; margin-top: .45rem; }
.science-foot {
  text-align: center;
  font-size: .78rem;
  color: #9a7a4a;
  line-height: 1.7;
  padding: 1.2rem .5rem 1.5rem;
}
@media (max-width: 560px) {
  .era-tabs { flex-wrap: wrap; }
  .era-tab { min-width: 44%; }
  .science-grid { grid-template-columns: 1fr; }
}
