/* MARU × LION 角色介紹頁 — 與主站同一套品牌色 */

:root {
  --navy: #18324b;
  --navy-deep: #10243a;
  --paper: #fbf6ec;
  --paper-2: #f3e9d8;
  --ink: #23303c;
  --ink-soft: #5d6b78;
  --coral: #e8703a;
  --coral-deep: #cf5c28;
  --gold: #e3b23c;
  --line: rgba(24, 50, 75, .16);
  --shadow-sm: 0 2px 6px rgba(24, 50, 75, .08);
  --shadow-md: 0 10px 30px rgba(24, 50, 75, .12);
}

* { box-sizing: border-box; }
html { color-scheme: light; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.7 "PingFang TC", "Microsoft JhengHei", "Noto Sans TC", -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
:focus-visible { outline: 3px solid var(--coral); outline-offset: 2px; border-radius: 4px; }
img { max-width: 100%; }
a { color: inherit; }

/* ---------- 頂列 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 64px; padding: 10px clamp(16px, 4vw, 48px);
  background: var(--navy); color: #fff;
  box-shadow: var(--shadow-sm);
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-weight: 800; font-size: 15px; letter-spacing: .02em;
  text-decoration: none; min-height: 44px;
}
.brand-mark {
  width: 26px; height: 26px; border-radius: 50%;
  background: radial-gradient(circle at 35% 32%, #f6d47c, var(--gold) 70%);
  border: 2px solid rgba(255,255,255,.85);
  box-shadow: inset -3px -3px 0 rgba(24,50,75,.25);
}
.topnav { display: flex; gap: 8px; align-items: center; }
.topnav a {
  display: inline-flex; align-items: center; min-height: 40px;
  padding: 6px 14px; border-radius: 999px;
  font-size: 14px; font-weight: 700; text-decoration: none;
}
.ghost-link { color: #ffe9c4; border: 1.5px solid rgba(255,233,196,.5); }
.ghost-link:hover { border-color: #ffe9c4; }
.home-link { background: var(--coral); color: #fff; }
.home-link:hover { background: var(--coral-deep); }

/* ---------- 版面 ---------- */
main { width: min(1080px, 100%); margin: 0 auto; padding: 34px clamp(16px, 4vw, 48px) 28px; display: grid; gap: 30px; }

.kicker { margin: 0; color: var(--coral); font-weight: 800; font-size: 13px; letter-spacing: .12em; }
h1 { margin: 8px 0 0; font-size: clamp(30px, 4.6vw, 44px); line-height: 1.25; letter-spacing: -.01em; }
h2 { margin: 0; font-size: clamp(20px, 3vw, 26px); }

/* ---------- 頁首 ---------- */
.pagehead {
  display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(18px, 4vw, 44px);
  align-items: center;
}
.lede { margin: 14px 0 0; color: var(--ink-soft); font-size: 16.5px; }
.pagehead-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.pagehead-art { margin: 0; }
.pagehead-art img {
  display: block; width: 100%; height: auto;
  border-radius: 20px; border: 2.5px solid var(--gold);
  box-shadow: var(--shadow-md);
}
.pagehead-art figcaption { margin-top: 8px; text-align: center; font-size: 13px; color: var(--ink-soft); }

/* ---------- 按鈕 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 46px; padding: 10px 22px;
  border-radius: 999px; font-weight: 800; font-size: 15px;
  text-decoration: none; border: 2px solid transparent;
  transition: transform .15s ease, box-shadow .15s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.btn-primary { background: var(--coral); color: #fff; }
.btn-primary:hover { background: var(--coral-deep); }
.btn-ghost { border-color: var(--line); color: var(--navy); background: #fff; }

/* ---------- 角色速覽列 ---------- */
.char-nav {
  display: flex; flex-wrap: wrap; gap: 10px;
  padding: 16px clamp(16px, 3vw, 24px);
  background: #fff; border: 1.5px solid var(--line); border-radius: 18px;
  box-shadow: var(--shadow-sm);
}
.char-jump {
  display: inline-flex; align-items: center; gap: 7px;
  min-height: 42px; padding: 7px 16px;
  border-radius: 999px; text-decoration: none;
  font-size: 14px; font-weight: 800; color: var(--navy);
  background: color-mix(in srgb, var(--jc) 14%, #fff);
  border: 1.5px solid color-mix(in srgb, var(--jc) 35%, #fff);
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.char-jump:hover {
  transform: translateY(-1px);
  background: color-mix(in srgb, var(--jc) 24%, #fff);
  box-shadow: var(--shadow-sm);
}
.char-emoji { font-size: 17px; line-height: 1; }

/* ---------- 角色档案卡 ---------- */
.profile-card {
  display: grid; grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr); gap: clamp(16px, 3vw, 30px);
  background: #fff; border: 1.5px solid var(--line); border-radius: 22px;
  padding: clamp(16px, 3vw, 28px);
  box-shadow: var(--shadow-md);
  position: relative; overflow: hidden;
}
.maru-card { border-top: 6px solid var(--coral); }
.lion-card { border-top: 6px solid var(--navy); }
.bianbian-card { border-top: 6px solid #e78fb3; }  /* 粉紅領巾 */
.xiaonuo-card  { border-top: 6px solid #5cb89a; }  /* 薄荷綠蝴蝶結 */
.meili-card    { border-top: 6px solid #9b8ec4; }  /* 薰衣草紫絲巾 */
.xiaohuang-card{ border-top: 6px solid var(--gold); } /* 紅項圈金鈴鐺 */

.profile-art { position: relative; align-self: start; }
.profile-art img {
  display: block; width: 100%; height: auto;
  border-radius: 16px; border: 1.5px solid var(--line);
}
.profile-tag {
  position: absolute; top: 10px; left: 10px;
  background: var(--navy); color: #fff;
  font-size: 11.5px; font-weight: 700; letter-spacing: .08em;
  padding: 4px 10px; border-radius: 999px;
}
.profile-kicker { margin: 0 0 6px; color: var(--ink-soft); font-size: 12px; font-weight: 800; letter-spacing: .14em; }
.profile-info h2 { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.profile-role {
  font-size: 13px; font-weight: 800; color: #fff;
  background: var(--coral); border-radius: 999px; padding: 3px 12px;
}
.lion-card .profile-role { background: var(--navy); }
.bianbian-card .profile-role { background: #e78fb3; }
.xiaonuo-card .profile-role { background: #5cb89a; }
.meili-card .profile-role { background: #9b8ec4; }
.xiaohuang-card .profile-role { background: var(--gold); }

/* 英文名發音鈕 */
.speak-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 50%;
  border: 1.5px solid var(--line); background: var(--paper-2);
  font-size: 15px; line-height: 1; cursor: pointer;
  transition: transform .15s ease, background .15s ease, box-shadow .15s ease;
  vertical-align: middle; flex-shrink: 0;
}
.speak-btn:hover {
  transform: translateY(-1px) scale(1.06);
  background: #fff; box-shadow: var(--shadow-sm);
}
.speak-btn:active { transform: scale(.94); }
.speak-btn.speaking { background: var(--coral); animation: speak-pulse .9s ease infinite; }
@keyframes speak-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(232, 112, 58, .45); }
  50% { box-shadow: 0 0 0 8px rgba(232, 112, 58, 0); }
}

.profile-facts { margin: 16px 0 0; display: grid; gap: 9px; }
.profile-facts > div {
  display: grid; grid-template-columns: 64px 1fr; gap: 10px; align-items: baseline;
  border-bottom: 1.5px dashed var(--line); padding-bottom: 8px;
}
.profile-facts > div:last-child { border-bottom: 0; padding-bottom: 0; }
.profile-facts dt { font-size: 13px; font-weight: 800; color: var(--ink-soft); }
.profile-facts dd { margin: 0; font-size: 15px; }

/* ---------- 表情圖鑑 ---------- */
.expr { margin-top: 18px; }
.expr h3 { margin: 0 0 10px; font-size: 14px; letter-spacing: .06em; color: var(--ink-soft); }
.expr img {
  display: block; width: 100%; height: auto;
  border-radius: 14px; border: 1.5px solid var(--line);
}
.expr-labels {
  list-style: none; margin: 10px 0 0; padding: 0;
  display: flex; flex-wrap: wrap; gap: 8px;
  font-size: 13px; font-weight: 700; color: var(--navy);
}
.expr-labels li {
  background: var(--paper-2); border-radius: 999px; padding: 4px 12px;
}

/* ---------- 本尊照片 ---------- */
.real-photo { margin-top: 18px; }
.real-photo h3 { margin: 0 0 10px; font-size: 14px; letter-spacing: .06em; color: var(--ink-soft); }
.real-photo-frame {
  margin: 0; position: relative;
  display: block; width: 100%; aspect-ratio: 1 / 1;
  border-radius: 14px; border: 1.5px solid var(--line); overflow: hidden;
  background: var(--paper-2);
}
.real-photo-frame img {
  display: block; width: 100%; height: 100%; object-fit: cover;
}
.real-photo-frame figcaption {
  position: absolute; left: 10px; bottom: 10px;
  background: rgba(24, 50, 75, .78); color: #fff;
  font-size: 12px; font-weight: 700; letter-spacing: .05em;
  padding: 4px 12px; border-radius: 999px;
}
.photo-empty {
  display: flex; align-items: center; justify-content: center;
  border-style: dashed; border-color: var(--line);
}
.photo-placeholder {
  font-size: 15px; font-weight: 700; color: var(--ink-soft);
  letter-spacing: .04em; text-align: center; padding: 0 12px;
}

/* ---------- 友誼卡 ---------- */
.duo h2 { text-align: center; }
.duo-card {
  margin-top: 14px; text-align: center;
  background: linear-gradient(160deg, #fff, var(--paper-2));
  border: 1.5px solid var(--line); border-radius: 20px;
  padding: clamp(20px, 4vw, 34px);
  box-shadow: var(--shadow-sm);
  font-size: 16.5px; line-height: 2;
}
.duo-line { font-weight: 900; color: var(--navy); font-size: 19px; }

/* ---------- 頁尾 ---------- */
.site-foot { text-align: center; color: var(--ink-soft); font-size: 14px; padding: 8px 0 18px; }
.foot-note a { color: var(--navy); font-weight: 700; text-decoration: none; border-bottom: 1.5px solid var(--gold); }

/* ---------- 進場動畫 ---------- */
.reveal { animation: rise .55s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ---------- 響應式 ---------- */
@media (max-width: 860px) {
  .pagehead { grid-template-columns: 1fr; }
  .pagehead-art { order: -1; }
  .profile-card { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .topbar { flex-wrap: wrap; padding-bottom: 12px; }
  .profile-facts > div { grid-template-columns: 54px 1fr; }
  .pagehead-actions .btn { flex: 1 1 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .reveal { animation: none; }
  html { scroll-behavior: auto; }
}

/* ---------- 三視圖旋轉展示 ---------- */
.profile-art.is-playing { aspect-ratio: 1 / 1; }
.profile-art.is-playing > img,
.profile-art.is-playing .profile-tag { display: none; }
.profile-turntable {
  display: none;
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;             /* 1:1 影片對 1:1 容器，不裁角色 */
  border-radius: 16px; border: 1.5px solid var(--line);
  background: #f0eae0;
}
.profile-art.is-playing .profile-turntable { display: block; }
.turntable-btn, .turntable-sound {
  position: absolute; bottom: 12px; z-index: 2;
  border: 0; border-radius: 999px; cursor: pointer;
  font-weight: 800; font-size: 13px; padding: 8px 14px;
  background: rgba(26, 42, 66, .88); color: #fff;
  box-shadow: 0 3px 10px rgba(0, 0, 0, .18);
  transition: transform .15s ease, background .15s ease;
}
.turntable-btn { right: 12px; }
.turntable-sound {
  right: 150px; font-size: 12px;
  background: rgba(255, 255, 255, .94); color: var(--navy);
}
.turntable-sound[hidden] { display: none; }
.turntable-btn:hover, .turntable-sound:hover { transform: translateY(-1px); }
.turntable-btn:focus-visible, .turntable-sound:focus-visible {
  outline: 3px solid var(--gold); outline-offset: 2px;
}
@media (max-width: 480px) {
  .turntable-btn, .turntable-sound { font-size: 11.5px; padding: 7px 11px; }
  .turntable-sound { right: 128px; }
}
