/* LinkedDonors v8
   列表頁 1:1 復刻 officialmodelsny.com/new-york/main（實測：Aileron；墨色 #212529；
   5 欄網格 卡 296×416 間距 10px 行距 520px 頁邊 40px；懸停層 #212529 0.3s，
   標籤 10px/12px 字距 1px + 值 13px/16px 700 白字；名字 18px/700；副行 16px/400）
   詳情頁 1:1 復刻 metromodels.com 模特頁（實測：黑帶 582px 高、照片 439×585、
   名字 Baskerville 32/700 白、參數 Baskerville Italic 20px/40px、
   分頁籤 16px 大寫 選中 700、圖庫 3 欄 gap 25px 頁邊 7.25%） */

@font-face { font-family: "Aileron"; src: url("./fonts/Aileron-Regular.otf") format("opentype"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Aileron"; src: url("./fonts/Aileron-Italic.otf") format("opentype"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Aileron"; src: url("./fonts/Aileron-SemiBold.otf") format("opentype"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Aileron"; src: url("./fonts/Aileron-Bold.otf") format("opentype"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Aileron"; src: url("./fonts/Aileron-Black.otf") format("opentype"); font-weight: 900; font-style: normal; font-display: swap; }

:root {
  --ink: #212529;
  --paper: #fff;
  --muted: #9aa0a6;
  --hair: #e9ecef;
  --disabled: #cdd2d6;
  --sans: "Aileron", -apple-system, "Helvetica Neue", Helvetica, Arial, "PingFang TC", "Microsoft JhengHei", sans-serif;
  --serif: Baskerville, "Libre Baskerville", "Times New Roman", Georgia, serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--sans);
  font-size: 16px;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
img { display: block; }
.ic { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.loading {
  min-height: 60vh; display: flex; flex-direction: column; gap: 10px;
  align-items: center; justify-content: center;
  font-size: 13px; letter-spacing: 4px; font-weight: 600;
}
.loading i { font-style: normal; letter-spacing: 0; font-weight: 400; color: var(--muted); font-size: 14px; }
.loading a { text-decoration: underline; text-underline-offset: 3px; }

/* ============ 品牌字標（LinkedDonors：黑 Linked + 品牌蓝 Donors，用站內 Aileron Black 統一氣質） ============ */
:root { --brand-blue: #009ada; }
.brand {
  font-family: var(--sans);
  font-weight: 900; font-size: 24px; letter-spacing: -0.6px; line-height: 1;
  white-space: nowrap;
}
.brand b, .brand i { font-weight: 900; font-style: normal; }
.brand b { color: var(--ink); }
.brand i { color: var(--brand-blue); }

/* ============ 列表頁 顶栏 ============ */
.topbar { background: var(--paper); border-bottom: 1px solid var(--hair); position: sticky; top: 0; z-index: 40; }
.topbar-in {
  display: flex; align-items: center; gap: 36px;
  padding: 18px 40px;
}
.mainnav { display: flex; gap: 28px; margin: 0 auto; overflow-x: auto; scrollbar-width: none; }
.mainnav::-webkit-scrollbar { display: none; }
.mainnav a {
  font-size: 16px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.3px;
  color: var(--ink); white-space: nowrap; padding: 2px 0;
}
.mainnav a.on { text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 1.5px; }
.mainnav a:hover { text-decoration: underline; text-underline-offset: 6px; }
.top-right { display: flex; align-items: center; gap: 16px; }
.top-right .tr-fav { display: inline-flex; align-items: center; gap: 4px; }
.top-right .tr-fav i { font-style: normal; font-size: 12px; font-weight: 700; }
.top-right button, .top-right a { color: var(--ink); display: inline-flex; }
.tr-logout { font-size: 11px; letter-spacing: 1px; color: var(--muted) !important; }
.tr-logout:hover { color: var(--ink) !important; text-decoration: underline; text-underline-offset: 3px; }

/* ============ 首頁（IMG Models 式全屏視頻首屏） ============ */
.home { position: fixed; inset: 0; overflow: hidden; background: #000; color: #fff; }
.home-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.home-shade {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.38), rgba(0, 0, 0, 0.06) 32%, rgba(0, 0, 0, 0.5) 88%);
}
.home-top {
  position: absolute; top: 0; left: 0; right: 0;
  display: flex; align-items: center; justify-content: space-between;
  padding: 32px 46px;
}
.home-brand { font-size: 42px; letter-spacing: -1.2px; cursor: default; }
.home-brand b, .home-brand i { color: #fff; }
.home-nav { display: flex; align-items: center; gap: 32px; }
.home-nav a, .home-nav button {
  color: #fff; font-size: 14px; font-weight: 600; letter-spacing: 1.5px; text-transform: uppercase;
}
.home-nav a:hover, .home-nav button:hover { text-decoration: underline; text-underline-offset: 6px; }
.home-bottom { position: absolute; left: 46px; bottom: 44px; }
.home-kicker { font-size: 15px; letter-spacing: 2px; font-weight: 600; margin-bottom: 14px; }
.home-menu { display: flex; flex-direction: column; }
.home-menu a {
  font-size: 34px; font-weight: 800; letter-spacing: 0.5px; line-height: 1.4;
  color: rgba(255, 255, 255, 0.6); text-transform: uppercase;
  transition: color 0.18s;
}
.home-menu a:hover { color: #fff; }
.home-caption { margin-top: 28px; font-size: 10px; letter-spacing: 2.5px; color: rgba(255, 255, 255, 0.72); text-transform: uppercase; }

/* 登入框 */
.login-mask {
  position: fixed; inset: 0; z-index: 75; background: rgba(0, 0, 0, 0.55);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.login-box { position: relative; background: #fff; color: var(--ink); width: 100%; max-width: 400px; padding: 42px 40px 34px; }
.login-box h2 { font-size: 22px; font-weight: 900; margin-top: 8px; }
.login-field { display: block; margin-top: 20px; }
.login-field span { display: block; font-size: 10px; letter-spacing: 2px; color: var(--muted); font-weight: 600; margin-bottom: 6px; }
.login-field input {
  width: 100%; border: 0; border-bottom: 1px solid var(--ink); border-radius: 0;
  background: transparent; font-family: var(--sans); font-size: 15px; padding: 6px 2px;
}
.login-err { color: #c0392b; font-size: 12px; margin-top: 14px; }
.login-btn {
  width: 100%; margin-top: 26px; background: var(--ink); color: #fff;
  padding: 13px; font-size: 13px; letter-spacing: 2px; font-weight: 600;
}
.login-btn:hover { background: #000; }
.login-btn:disabled { opacity: 0.6; cursor: default; }

/* ============ 身高滑條（A–Z 條的身高版：按住左右拖動，游標丝滑吸附檔位） ============ */
.alpha-strip {
  display: flex; justify-content: center;
  padding: 16px 40px 6px;
}
.strip-track {
  position: relative; display: flex; gap: 26px;
  padding: 2px 2px 8px;
  user-select: none; -webkit-user-select: none; touch-action: none;
  cursor: grab;
}
.strip-track:active { cursor: grabbing; }
.strip-track button {
  font-size: 13.33px; font-weight: 400; color: var(--ink);
  padding: 0 1px; line-height: 1.5; cursor: inherit;
}
.strip-track button.dim { color: var(--disabled); }
.strip-track button.on { font-weight: 700; }
.strip-ind {
  position: absolute; bottom: 0; left: 0; height: 2px; width: 0;
  background: var(--ink); will-change: transform, width;
  transition: transform 0.32s cubic-bezier(0.22, 0.61, 0.36, 1), width 0.32s cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* ============ 篩選行（精卵庫功能，貼官方版式的極簡風） ============ */
.filter-row {
  display: flex; align-items: flex-end; justify-content: center; flex-wrap: wrap;
  gap: 14px 26px; padding: 14px 40px 26px;
}
.f-sel { display: flex; flex-direction: column; gap: 3px; }
.f-sel span {
  font-size: 10px; letter-spacing: 2px; color: var(--muted); font-weight: 600;
}
.f-sel input {
  font-family: var(--sans); font-size: 13px; color: var(--ink);
  border: 0; border-bottom: 1px solid var(--ink); background: transparent;
  padding: 4px 2px; border-radius: 0; outline-offset: 2px;
}
.f-q input { min-width: 180px; font-weight: 400; }

/* 自定義下拉 */
.f-dd { position: relative; }
.dd-btn {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  font-size: 13px; font-weight: 700; color: var(--ink);
  border-bottom: 1px solid var(--ink); padding: 4px 2px; min-width: 118px;
  text-align: left;
}
.dd-btn em { font-style: normal; }
.dd-chev { width: 12px; height: 12px; opacity: 0.65; transition: transform 0.22s ease; flex: 0 0 auto; }
.f-dd.open .dd-chev { transform: rotate(180deg); }
.dd-pop {
  position: absolute; top: calc(100% + 8px); left: 0; z-index: 35;
  min-width: calc(100% + 26px); background: var(--paper);
  border: 1px solid var(--hair); box-shadow: 0 14px 34px rgba(33, 37, 41, 0.1);
  padding: 5px 0; white-space: nowrap;
  animation: ddIn 0.18s ease;
}
@keyframes ddIn { from { opacity: 0; transform: translateY(-5px); } }
.dd-pop button {
  display: block; width: 100%; text-align: left;
  font-size: 13px; line-height: 1.4; color: var(--ink);
  padding: 8px 16px;
}
.dd-pop button:hover { background: #f4f5f6; }
.dd-pop button.on { font-weight: 700; }
.dd-pop button.on::after { content: " ✓"; font-size: 11px; }
.f-clear {
  font-size: 11px; letter-spacing: 1.5px; font-weight: 600; color: var(--muted);
  border-bottom: 1px solid transparent; padding: 3px 0; text-transform: uppercase;
}
.f-clear:hover { color: var(--ink); border-color: var(--ink); }
.f-count { font-size: 11px; letter-spacing: 1px; color: var(--muted); padding-bottom: 3px; }

/* ============ 模特牆網格 ============ */
.wall-wrap { padding: 6px 40px 70px; min-height: 40vh; }
.wall {
  display: grid;
  grid-template-columns: repeat(5, 1fr); /* 對齊參考站：一行固定 5 個 */
  gap: 40px 10px;
}
@media screen and (max-width: 1280px) { .wall { grid-template-columns: repeat(4, 1fr); } }
@media screen and (max-width: 1024px) { .wall { grid-template-columns: repeat(3, 1fr); } .dm-sim-track .mcard { flex-basis: calc((100% - 40px) / 3); } }
.mcard-media {
  position: relative; display: block; overflow: hidden;
  aspect-ratio: 296 / 416; background: #f1f3f4;
}
.mcard-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.mcard-media.noimg, .mcard-empty {
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: 100%; color: var(--disabled);
}
.mcard-empty .ic { width: 34px; height: 34px; }

/* 懸停參數層 —— 用戶指定必須保留的功能 */
.mcard-overlay {
  position: absolute; inset: 0; background: rgb(33, 37, 41);
  opacity: 0; transition: opacity 0.3s;
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  padding: 18px 12px; overflow: hidden;
}
.mcard-media:hover .mcard-overlay, .mcard-media:focus-visible .mcard-overlay { opacity: 0.76; }
.mcard-overlay p { text-shadow: 0 1px 8px rgba(0, 0, 0, 0.45); }
.ol-k {
  font-size: 10px; line-height: 12px; letter-spacing: 2px; font-weight: 400;
  color: #fff; text-align: center;
}
.ol-v {
  font-size: 13px; line-height: 16px; font-weight: 700; color: #fff;
  text-align: center; margin-bottom: 10px; max-width: 100%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ol-v:last-child { margin-bottom: 0; }

.mcard-name {
  display: flex; align-items: baseline; justify-content: space-between; gap: 8px;
  margin-top: 14px;
}
.mcard-name a {
  font-size: 18px; line-height: 22px; font-weight: 700; color: var(--ink);
  letter-spacing: 0.2px;
}
.mcard-name a:hover { text-decoration: underline; text-underline-offset: 4px; }
.mcard-acts { display: inline-flex; align-items: center; gap: 10px; }
.mcard-heart, .mcard-dl { color: var(--ink); opacity: 0.75; display: inline-flex; }
.mcard-heart:hover, .mcard-dl:hover { opacity: 1; }
.mcard-heart .ic, .mcard-dl .ic { width: 16px; height: 16px; }
.mcard-heart.hearted .ic, .hearted .ic { fill: var(--ink); stroke: var(--ink); }
.mcard-heart.hearted, .dm-icons .hearted { opacity: 1; }
.mcard-sub {
  display: flex; align-items: center; gap: 6px; margin-top: 4px;
  font-size: 16px; line-height: 24px; font-weight: 400; color: var(--ink);
}
.mcard-sub .ic { width: 15px; height: 15px; opacity: 0.85; }

.wall-empty {
  text-align: center; padding: 90px 20px; color: var(--muted);
  display: flex; flex-direction: column; gap: 18px; align-items: center;
  font-size: 15px;
}

.wish-wrap { padding-top: 30px; }
.wish-head {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 16px; margin-bottom: 26px;
}
.wish-title { font-size: 22px; font-weight: 900; letter-spacing: 1px; }
.wish-title span { font-size: 13px; font-weight: 400; color: var(--muted); letter-spacing: 0.5px; margin-left: 10px; }
.wish-actions { display: flex; gap: 12px; }
.wish-btn {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12px; letter-spacing: 1px; font-weight: 600;
  border: 1px solid var(--ink); padding: 9px 18px; color: var(--ink);
  transition: background 0.18s, color 0.18s;
}
.wish-btn .ic { width: 15px; height: 15px; }
.wish-btn:hover { background: #f4f5f6; }
.wish-btn.primary { background: var(--ink); color: #fff; }
.wish-btn.primary:hover { background: #000; }
.wish-btn:disabled { opacity: 0.55; cursor: default; }

/* ============ 頁腳（officialmodels 版式：ABOUT + 欄目 + 版權條 + 回頂膠囊鈕） ============ */
.foot {
  position: relative; background: var(--paper); color: var(--ink);
  border-top: 1px solid var(--ink);
  padding: 52px 40px 0; margin-top: 80px;
}
.foot-in {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 40px 70px; flex-wrap: wrap;
}
.foot-about h3 {
  display: flex; align-items: center; gap: 14px;
  font-size: 15px; font-weight: 600; letter-spacing: 2px;
}
.foot .foot-logo { font-size: 24px; }
.foot-about p {
  max-width: 600px; font-size: 15px; line-height: 1.75;
  color: #343a40; margin-top: 18px;
}
.foot-cols { display: flex; gap: 64px; flex-wrap: wrap; padding-top: 4px; padding-right: 90px; }
.foot-cols h4 {
  font-size: 10px; letter-spacing: 2px; color: var(--muted);
  font-weight: 600; margin-bottom: 14px; text-transform: uppercase;
}
.foot-cols p { font-size: 14px; line-height: 2; }
.foot-cols a:hover { text-decoration: underline; text-underline-offset: 4px; }
.foot-follow a { display: inline-flex; align-items: center; gap: 8px; }
.foot-follow .ic { width: 16px; height: 16px; }
.foot-bar {
  display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap;
  margin-top: 56px; padding: 0 0 18px;
  font-size: 10px; letter-spacing: 2px; color: var(--ink);
}
.to-top {
  position: absolute; right: 44px; bottom: 64px;
  width: 46px; height: 66px; border: 1.5px solid var(--ink); border-radius: 26px;
  display: flex; align-items: center; justify-content: center;
  background: var(--paper); color: var(--ink);
  transition: background 0.2s, color 0.2s;
}
.to-top:hover { background: var(--ink); color: #fff; }

/* ============ 詳情頁（metromodels 骨架） ============ */
/* 首屏鎖定：header + 分類行 + 黑帶 hero + 分頁籤 + 底部黑條 = 100vh，圖庫在折疊線下 */
.dm-screen { display: flex; flex-direction: column; height: 100vh; min-height: 660px; max-height: 1300px; }
.dm-top {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: 28px 40px 14px; background: var(--paper);
}
.dm-logo { justify-self: center; font-size: 32px; }
.dm-icons { display: flex; gap: 22px; align-items: center; }
.dm-icons-r { justify-self: end; }
.dm-icons a, .dm-icons button { color: var(--ink); display: inline-flex; }
.dm-cats {
  display: flex; justify-content: center; gap: 32px; flex-wrap: wrap;
  padding: 12px 20px 22px;
}
.dm-cats a {
  font-size: 13px; font-weight: 600; letter-spacing: 0.5px; text-transform: uppercase;
  color: var(--ink);
}
.dm-cats a.on, .dm-cats a:hover { text-decoration: underline; text-underline-offset: 5px; }

/* 黑帶 hero：左照片 · 右名字+參數（Baskerville）；內容收在 1600 居中容器裡，照片位置按原站比例 */
.dm-hero {
  background: #000; color: #fff;
  flex: 1 1 0; min-height: 0;
  display: flex; overflow: hidden;
}
.dm-hero-in {
  display: flex; align-items: stretch;
  width: 100%; max-width: 1600px; margin: 0 auto;
}
.dm-photo {
  aspect-ratio: 439 / 585; height: 100%;
  max-width: 44vw; margin-left: 17.4%;
  flex: 0 0 auto; overflow: hidden;
}
.dm-photo img { width: 100%; height: 100%; object-fit: cover; }
.dm-info {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
  padding: 56px 24px 40px;
}

/* 底部「類似的捐贈人檔案」（RELATED NEWS 對位：邊距對齊圖庫 7.25%，右上 ←→ 輪播切換） */
.dm-similar {
  padding: 34px 7.25% 26px;
  border-top: 1px solid var(--hair);
}
.dm-sim-head { display: flex; align-items: center; gap: 14px; margin-bottom: 26px; }
.dm-sim-head h2 { font-size: 15px; font-weight: 700; letter-spacing: 3px; }
.dm-sim-head span { font-size: 13px; color: var(--muted); }
.sim-arrows { margin-left: auto; display: flex; gap: 22px; }
.sim-arrows button { color: var(--ink); display: inline-flex; opacity: 0.85; }
.sim-arrows button:hover { opacity: 1; }
.sim-arrows .ic { width: 26px; height: 26px; stroke-width: 1.4; }
.dm-sim-track {
  display: flex; gap: 20px;
  overflow-x: auto;
  scrollbar-width: none;
}
.dm-sim-track::-webkit-scrollbar { display: none; }
.dm-sim-track .mcard { flex: 0 0 calc((100% - 60px) / 4); }
.dm-name {
  font-family: var(--serif); font-size: 32px; font-weight: 700; letter-spacing: 1px;
  text-transform: uppercase; display: flex; align-items: center; gap: 14px;
}
.dm-name button { color: #fff; opacity: 0.9; display: inline-flex; }
.dm-name button:hover { opacity: 1; }
.dm-name .ic { width: 19px; height: 19px; }
.dm-stats { list-style: none; margin-top: 42px; text-align: center; }
.dm-stats li {
  font-family: var(--serif); font-style: italic; font-size: 20px; line-height: 40px;
}
.dm-stats .lab { text-transform: uppercase; }
.dm-stats .val { font-style: italic; }
.dm-unit { margin-top: 20px; font-family: var(--serif); font-style: italic; font-size: 20px; }
.dm-unit i { margin: 0 6px; opacity: 0.7; }
.dm-unit button { color: #fff; opacity: 0.55; font-family: var(--serif); font-style: italic; font-size: 20px; }
.dm-unit button.on { opacity: 1; text-decoration: underline; text-underline-offset: 4px; }

/* 分頁籤 */
.dm-tabs {
  display: flex; justify-content: center; gap: 56px; flex-wrap: wrap;
  padding: 44px 24px 26px;
}
.dm-tabs button {
  font-size: 16px; font-weight: 400; letter-spacing: 0.5px; text-transform: uppercase;
  color: var(--ink); display: inline-flex; align-items: baseline; gap: 7px;
}
.dm-tabs button i { font-style: normal; font-size: 12px; color: var(--muted); }
.dm-tabs button.on { font-weight: 700; }
.dm-tabs button.on i { color: var(--ink); }
.dm-tabs button:hover { text-decoration: underline; text-underline-offset: 6px; }

/* 圖庫：3 欄 gap 25px 頁邊 7.25%
   保底高度：分頁內容少（如 BIO 只有兩三條）時不塌陷，下方候選人照片位置穩定、不上浮搶注意力 */
.dm-body {
  min-height: 620px; padding: 44px 0 60px;
  transition: opacity 0.22s ease, transform 0.22s ease;
}
.dm-body.fading { opacity: 0; transform: translateY(10px); }
.dm-gallery {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 25px;
  padding: 6px 7.25% 0;
}
.dm-cell { position: relative; display: block; overflow: hidden; aspect-ratio: 434 / 525; background: #f1f3f4; padding: 0; }
.dm-cell img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 0.35s; }
.dm-cell:hover img { transform: scale(1.03); }

/* 內容分頁 */
.dm-narrow { max-width: 720px; margin: 10px auto 0; padding: 0 24px; }
.dm-wide { max-width: 900px; }
.dm-lead {
  font-family: var(--serif); font-style: italic; font-size: 24px; line-height: 1.55;
  text-align: center; margin: 18px 0 8px;
}
.dm-sec { margin-top: 34px; }
.dm-sec-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 16px; }
.dm-sec-head .en {
  font-size: 13px; font-weight: 700; letter-spacing: 3px; text-transform: uppercase;
}
.dm-sec-head .zh { font-size: 13px; color: var(--muted); }
.dm-hl { list-style: none; margin-top: 22px; }
.dm-hl li {
  display: flex; gap: 10px; align-items: flex-start;
  font-size: 15px; line-height: 1.7; padding: 7px 0; border-bottom: 1px solid var(--hair);
}
.dm-hl .ic { width: 15px; height: 15px; margin-top: 5px; flex: 0 0 auto; }
.dm-quote { margin: 30px 0; text-align: center; }
.q-kicker { font-size: 10px; letter-spacing: 3px; color: var(--muted); font-weight: 600; margin-bottom: 10px; text-transform: uppercase; }
.q-text { font-family: var(--serif); font-style: italic; font-size: 20px; line-height: 1.7; }
.kv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px 30px; }
.kv span { display: block; font-size: 10px; letter-spacing: 2px; color: var(--muted); font-weight: 600; margin-bottom: 3px; }
.kv p { font-size: 15px; line-height: 1.55; }
.dm-srcnote { margin-top: 30px; font-size: 12px; color: var(--muted); letter-spacing: 0.5px; }

.tbl-scroll { overflow-x: auto; }
.dm-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.dm-table th {
  text-align: left; font-size: 10px; letter-spacing: 2px; color: var(--muted);
  font-weight: 600; padding: 8px 12px 8px 0; border-bottom: 1px solid var(--ink);
  white-space: nowrap;
}
.dm-table td { padding: 10px 12px 10px 0; border-bottom: 1px solid var(--hair); vertical-align: top; }

/* ============ 燈箱 ============ */
.lb-mask {
  position: fixed; inset: 0; z-index: 90; background: rgba(0, 0, 0, 0.94);
  display: flex; align-items: center; justify-content: center;
}
.lb-mask figure { max-width: 86vw; max-height: 90vh; text-align: center; }
.lb-mask img { max-width: 86vw; max-height: 84vh; object-fit: contain; margin: 0 auto; }
.lb-mask figcaption { color: #b9bec3; font-size: 12px; letter-spacing: 2px; margin-top: 12px; }
.lb-x { position: absolute; top: 22px; right: 26px; color: #fff; }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); color: #fff; padding: 18px; }
.lb-nav .ic { width: 30px; height: 30px; stroke-width: 1.2; }
.lb-prev { left: 12px; }
.lb-next { right: 12px; }

/* ============ 顧問彈窗 · toast ============ */
.modal-mask {
  position: fixed; inset: 0; z-index: 80; background: rgba(33, 37, 41, 0.55);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
/* color 顯式鎖墨色：首頁 .home{color:#fff} 場景下彈窗白底才不會繼承成白字 */
.modal { background: var(--paper); color: var(--ink); max-width: 420px; width: 100%; padding: 40px 38px 34px; position: relative; }
.modal-x { position: absolute; top: 14px; right: 14px; color: var(--ink); }
.modal-kicker { font-size: 10px; letter-spacing: 4px; font-weight: 700; color: var(--muted); }
.modal h2 { font-size: 24px; font-weight: 900; margin: 8px 0 12px; color: var(--ink); }
.modal-rows p span { color: var(--ink); }
.modal-p { font-size: 14px; line-height: 1.7; color: #495057; }
.modal-rows { margin: 20px 0 6px; }
.modal-rows p { display: flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 600; padding: 9px 0; border-bottom: 1px solid var(--hair); }
.modal-fine { font-size: 11px; color: var(--muted); margin-top: 16px; line-height: 1.6; }

.toast {
  position: fixed; left: 50%; bottom: 34px; transform: translateX(-50%);
  background: var(--ink); color: #fff; font-size: 13px; letter-spacing: 1px;
  padding: 10px 22px; z-index: 95;
}

/* ============ 列印視圖（A4 檔案 / PDF 生成源） ============ */
.print-mode { background: #f1f3f4; }
.print-doc {
  max-width: 794px; margin: 0 auto; background: #fff; color: #212529;
  padding: 52px 56px; font-size: 13px; line-height: 1.65;
}
.print-actions { display: flex; justify-content: space-between; padding: 14px 0 22px; }
.print-actions a { text-decoration: underline; text-underline-offset: 3px; font-size: 13px; }
.print-actions button { border: 1px solid var(--ink); padding: 7px 18px; font-size: 13px; font-weight: 600; }
.print-head { display: flex; justify-content: space-between; align-items: flex-end; border-bottom: 2px solid #212529; padding-bottom: 16px; }
.print-brand { font-family: var(--sans); font-weight: 900; font-size: 24px; letter-spacing: -0.6px; }
.print-brand b, .print-brand i { font-weight: 900; font-style: normal; }
.print-brand b { color: #212529; }
.print-brand i { color: var(--brand-blue); }
.print-head h1 { font-size: 17px; letter-spacing: 2px; text-align: right; }
.print-head h1 em { font-style: normal; font-size: 10px; letter-spacing: 3px; color: #868e96; display: block; }
.print-head p { font-size: 11px; color: #868e96; text-align: right; margin-top: 4px; }
/* 上下區塊的標籤欄固定同寬 → 全文值欄左緣對齊（左右格式上下對稱） */
.print-hero { display: flex; gap: 26px; margin: 26px 0 8px; align-items: flex-start; }
.print-hero .print-kv { flex: 1; }
.print-cover { width: 230px; height: 305px; object-fit: cover; flex: 0 0 auto; }
.print-kv { border-collapse: collapse; width: 100%; table-layout: fixed; }
.print-kv th { width: 132px; text-align: left; font-size: 9px; letter-spacing: 2px; color: #868e96; padding: 6px 14px 6px 0; white-space: nowrap; vertical-align: top; font-weight: 600; }
.print-kv td { padding: 6px 0; border-bottom: 1px solid #f1f3f4; overflow-wrap: break-word; }
.print-lead { font-family: var(--serif); font-style: italic; font-size: 16px; margin: 18px 0; }
.print-sec { margin-top: 24px; break-inside: avoid; }
.print-sec h2 { font-size: 12px; letter-spacing: 3px; border-bottom: 1px solid #212529; padding-bottom: 6px; margin-bottom: 10px; }
.print-sec ul { padding-left: 18px; }
.print-quote b { display: block; font-size: 10px; letter-spacing: 2px; color: #868e96; }
.print-quote { margin-bottom: 10px; }
.print-kv-grid tr { break-inside: avoid; }
.print-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.print-grid img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; }
.print-foot { margin-top: 34px; border-top: 1px solid #212529; padding-top: 12px; font-size: 10px; color: #868e96; }
.print-doc .dm-table th, .print-doc .dm-table td { font-size: 12px; }

.print-doc-set { margin-bottom: 30px; }
@media print {
  .no-print { display: none !important; }
  .print-mode, .print-doc { background: #fff; }
  .print-doc { max-width: none; padding: 0; }
  .print-doc-set { margin-bottom: 0; break-after: page; page-break-after: always; }
  .print-doc-set:last-child { break-after: auto; page-break-after: auto; }
  @page { size: A4; margin: 14mm 13mm; }
}

/* ============ 管理後台（沿用前台版式語言） ============ */
.tr-role { font-size: 11px; letter-spacing: 1px; color: var(--muted); }
.nav-admin { color: var(--brand-blue) !important; }
.adm-wrap { padding: 26px 40px 80px; max-width: 1520px; margin: 0 auto; }
.adm-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; margin-bottom: 18px; }
.adm-head h1 { font-size: 21px; font-weight: 900; letter-spacing: 0.5px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.adm-head h1 span { font-size: 12px; font-weight: 400; color: var(--muted); letter-spacing: 0.5px; }
.adm-back { display: inline-flex; color: var(--ink); }
.adm-tools { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.adm-tools input[type="search"] {
  font-family: var(--sans); font-size: 13px; border: 0; border-bottom: 1px solid var(--ink);
  padding: 6px 2px; min-width: 220px; background: transparent; border-radius: 0;
}
.adm-filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.chip {
  font-size: 12px; letter-spacing: 1px; padding: 7px 14px;
  border: 1px solid var(--hair); color: var(--ink); background: var(--paper);
}
.chip.on { border-color: var(--ink); background: var(--ink); color: #fff; }
.badge {
  font-style: normal; font-size: 10px; letter-spacing: 1.5px; padding: 3px 8px;
  border: 1px solid var(--hair); color: var(--muted); white-space: nowrap;
}
.badge.ok { border-color: var(--ink); color: var(--ink); font-weight: 700; }
.badge.off { background: #f1f3f4; color: var(--muted); text-decoration: line-through; }

.adm-table { border-top: 1px solid var(--ink); }
.adm-row {
  display: grid; grid-template-columns: 64px 1.2fr 0.5fr 0.8fr 0.5fr 0.8fr 0.8fr 0.8fr 0.6fr;
  gap: 12px; align-items: center;
  padding: 10px 4px; border-bottom: 1px solid var(--hair);
  font-size: 13px; cursor: pointer;
}
.adm-row:hover { background: #fafbfb; }
.adm-row-head { cursor: default; font-size: 10px; letter-spacing: 2px; color: var(--muted); font-weight: 600; }
.adm-row-head:hover { background: none; }
.adm-thumb img { width: 52px; height: 64px; object-fit: cover; display: block; }
.adm-no b { display: block; font-size: 14px; }
.adm-no small { color: var(--muted); }
.adm-act { text-align: right; display: flex; gap: 10px; justify-content: flex-end; }
.adm-act a, .adm-act button { color: var(--ink); font-size: 12px; text-decoration: underline; text-underline-offset: 3px; white-space: nowrap; }
.adm-act button.adm-act-del { color: #c92a2a; }
/* 多選批量操作：複選框獨立成列（遠離編號防誤點） */
.adm-table > .adm-row { grid-template-columns: 28px 64px 1.2fr 0.5fr 0.8fr 0.5fr 0.8fr 0.8fr 0.8fr 0.6fr; }
.adm-ckcell { display: flex; align-items: center; justify-content: center; align-self: stretch; cursor: pointer; }
.adm-ck { width: 16px; height: 16px; accent-color: var(--ink); cursor: pointer; border-radius: 3px; }
.adm-ckcell:hover .adm-ck { outline: 3px solid #e9ecef; outline-offset: 1px; border-radius: 3px; }
.adm-bulkbar {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  margin: 12px 0 2px; padding: 10px 16px;
  background: var(--ink); color: #fff; font-size: 13px;
}
.adm-bulkbar b { letter-spacing: 1px; }
.adm-bulkbar button { color: #fff; font-size: 12px; text-decoration: underline; text-underline-offset: 3px; }
.adm-bulkbar button:hover { opacity: 0.8; }
.adm-bulkbar button.bulk-del { color: #ffa8a8; }

/* 後台自定義下拉（與前台 f-dd 同款視覺；原生 select 隱藏做值載體） */
.dd-native-hidden { display: none !important; }
.adm-dd { display: inline-block; position: relative; vertical-align: middle; }
.adm-dd .dd-btn { min-width: 150px; font-weight: 400; font-size: 13px; border-bottom: 1px solid var(--hair); padding: 5px 2px; }
.adm-dd .dd-btn:hover { border-bottom-color: var(--ink); }
.adm-dd .dd-pop { z-index: 60; max-height: 320px; overflow-y: auto; }
/* 行內緊湊款（檔案總覽人種 / 帳號權限組） */
.adm-dd-sm { display: block; margin-top: 4px; }
.adm-dd-sm .dd-btn { min-width: 106px; max-width: 130px; font-size: 11px; color: #495057; padding: 2px 0; border-bottom-color: var(--hair); }
.adm-dd-sm .dd-btn em { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.adm-dd-sm .dd-pop button { font-size: 12px; padding: 7px 14px; }
.adm-empty { padding: 34px 0; color: var(--muted); font-size: 14px; }
.adm-users .adm-row { grid-template-columns: 1fr 0.9fr 1.6fr 1.2fr 0.7fr 1.2fr; cursor: default; }
.adm-users input, .adm-users select {
  width: 100%; font-family: var(--sans); font-size: 13px; border: 0;
  border-bottom: 1px solid var(--hair); padding: 4px 2px; background: transparent; border-radius: 0;
}

.adm-sec { border-top: 1px solid var(--ink); padding: 22px 0 30px; margin-top: 8px; }
.adm-sec h2 { font-size: 13px; font-weight: 700; letter-spacing: 3px; margin-bottom: 18px; }
.adm-sec h2 span { font-size: 11px; font-weight: 400; letter-spacing: 0.5px; color: var(--muted); margin-left: 10px; }
.adm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px 26px; margin-bottom: 16px; }
.adm-field span { display: block; font-size: 10px; letter-spacing: 2px; color: var(--muted); font-weight: 600; margin-bottom: 5px; }
.adm-field input, .adm-field select, .adm-field textarea {
  width: 100%; font-family: var(--sans); font-size: 14px; color: var(--ink);
  border: 0; border-bottom: 1px solid var(--ink); background: transparent;
  padding: 5px 2px; border-radius: 0; resize: vertical;
}
.adm-wide { display: block; margin: 14px 0; }
.adm-label { display: block; font-size: 10px; letter-spacing: 2px; color: var(--muted); font-weight: 600; margin: 16px 0 8px; }
.adm-quote-row, .adm-price-row { display: flex; gap: 12px; margin-bottom: 8px; align-items: center; }
.adm-quote-row .q-kicker, .adm-price-row .pr-date { flex: 0 0 180px; }
.adm-quote-row input, .adm-price-row input {
  font-family: var(--sans); font-size: 13px; border: 0; border-bottom: 1px solid var(--hair);
  padding: 5px 2px; flex: 1; background: transparent; border-radius: 0;
}
.adm-kv-del { display: inline-flex; color: var(--muted); flex: 0 0 auto; }
.adm-kv-del:hover { color: var(--ink); }
.adm-kv-del .ic { width: 13px; height: 13px; }
.adm-add { font-size: 12px; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.adm-details { border: 1px solid var(--hair); margin-bottom: 10px; }
.adm-details summary { padding: 10px 14px; font-size: 13px; font-weight: 700; cursor: pointer; list-style: none; }
.adm-details summary::before { content: "▸ "; color: var(--muted); }
.adm-details[open] summary::before { content: "▾ "; }
.adm-kv { padding: 4px 14px 14px; }
.adm-kv-row { display: flex; gap: 12px; margin-bottom: 6px; align-items: center; }
.adm-kv-row .adm-kv-k { flex: 0 0 220px; }
.adm-kv-row input {
  font-family: var(--sans); font-size: 13px; border: 0; border-bottom: 1px solid var(--hair);
  padding: 4px 2px; flex: 1; background: transparent; border-radius: 0;
}
.adm-save-row { display: flex; justify-content: flex-end; align-items: center; gap: 14px; margin-top: 18px; }
.adm-save-row span { font-size: 12px; color: var(--muted); }

.adm-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.adm-photo { position: relative; margin: 0; }
.adm-photo img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; display: block; cursor: pointer; }
.adm-photo.is-hidden img { opacity: 0.3; }
.adm-photo.is-suspect img { outline: 2px solid #c0392b; outline-offset: -2px; }
.adm-photo.is-cover img { outline: 2px solid var(--ink); outline-offset: -2px; }
.p-tag {
  position: absolute; top: 6px; left: 6px; font-size: 10px; letter-spacing: 1px;
  background: rgba(33, 37, 41, 0.85); color: #fff; padding: 2px 7px; font-style: normal; font-weight: 600;
}
.p-tag.cover { background: var(--ink); }
.adm-photo .p-btns {
  position: absolute; left: 0; right: 0; bottom: 0; display: flex; flex-wrap: wrap; gap: 1px;
  opacity: 0; transition: opacity 0.15s;
}
.adm-photo:hover .p-btns { opacity: 1; }
.p-btns button { flex: 1 1 auto; font-size: 11px; padding: 5px 4px; background: rgba(33, 37, 41, 0.88); color: #fff; }
.p-btns button:hover { background: #000; }
.p-btns button.p-del { background: rgba(201, 42, 42, 0.9); }
.p-btns button.p-del:hover { background: #a51111; }
.adm-addphoto { display: inline-flex; margin-top: 16px; cursor: pointer; }
.adm-originals { display: flex; flex-direction: column; gap: 2px; }
.adm-orig {
  display: flex; align-items: center; gap: 12px; padding: 10px 4px;
  border-bottom: 1px solid var(--hair); font-size: 14px;
}
.adm-orig:hover { background: #fafbfb; }
.adm-orig span { color: var(--muted); font-size: 12px; }
.adm-biz { background: #fafbfb; margin: 8px -18px 0; padding: 22px 18px 30px; }

.adm-drop {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  border: 1.5px dashed var(--disabled); padding: 46px 20px; cursor: pointer; text-align: center;
  margin: 6px 0 16px; transition: border-color 0.15s, background 0.15s;
}
.adm-drop.over, .adm-drop:hover { border-color: var(--ink); background: #fafbfb; }
.adm-drop b { font-size: 15px; letter-spacing: 1px; }
.adm-drop span { font-size: 12px; color: var(--muted); }
.adm-uplist { display: flex; flex-direction: column; gap: 4px; }
.adm-upitem { display: flex; align-items: center; gap: 14px; font-size: 13px; padding: 7px 2px; border-bottom: 1px solid var(--hair); }
.adm-upitem span { color: var(--muted); font-size: 12px; margin-left: auto; }

/* 裁切彈窗 */
.crop-mask { position: fixed; inset: 0; z-index: 85; background: rgba(0, 0, 0, 0.75); display: flex; align-items: center; justify-content: center; padding: 24px; }
.crop-box { background: #fff; padding: 22px; max-width: min(920px, 94vw); max-height: 94vh; overflow: auto; }
.crop-tip { font-size: 12px; color: var(--muted); margin-bottom: 12px; letter-spacing: 0.5px; }
.crop-stage { position: relative; display: inline-block; touch-action: none; user-select: none; -webkit-user-select: none; cursor: crosshair; }
.crop-stage img { max-width: min(860px, 88vw); max-height: 64vh; display: block; pointer-events: none; }
.crop-sel {
  position: absolute; border: 1.5px solid #fff; outline: 1px solid rgba(33, 37, 41, 0.9);
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.45); cursor: move;
}
.crop-cover { margin-right: auto; font-size: 13px; display: flex; gap: 8px; align-items: center; }

/* 後台所有原生下拉統一版式：去系統樣式 + 細底線 + 自繪箭頭 */
.adm-field select, .adm-users select, .adm-wrap select {
  appearance: none; -webkit-appearance: none;
  background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23212529' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") right 2px center / 13px no-repeat;
  padding-right: 22px; cursor: pointer;
}
.adm-field select:focus, .adm-users select:focus { outline: none; border-bottom-color: var(--brand-blue); }

/* 詞條未保存浮條 */
.dirty-bar {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%);
  z-index: 60; display: flex; align-items: center; gap: 18px;
  background: var(--ink); color: #fff; padding: 10px 12px 10px 22px;
  font-size: 13px; letter-spacing: 1px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}
.dirty-bar[hidden] { display: none; } /* display:flex 會蓋掉 hidden 屬性的 display:none，必須顯式關閉 */
.dirty-bar .wish-btn { border-color: #fff; background: #fff; color: var(--ink); }
.dirty-bar .wish-btn:hover { background: #e9ecef; }
/* 列表行的疑似重複提示 */
.adm-dupe { display: block; color: #c92a2a; font-size: 11px; letter-spacing: 0.5px; margin-top: 3px; }
.adm-dupe a { color: #c92a2a; text-decoration: underline; }
/* 姓名/暱稱 · 優選星標 · 影片 */
.adm-name { font-style: normal; font-weight: 600; color: #495057; font-size: 13px; margin-left: 4px; }
.adm-star { font-style: normal; font-size: 12px; }
.dm-nick { font-size: 0.5em; font-weight: 600; color: var(--muted, #868e96); letter-spacing: 2px; margin-left: 10px; vertical-align: middle; }
.wish-btn.on-star { background: var(--ink); color: #fff; }
.dm-cell.dm-video { background: #000; }
.dm-cell.dm-video video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.adm-videos { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin-top: 12px; }
.adm-videocell { aspect-ratio: 16/10; background: #000; }
.adm-videocell video { width: 100%; height: 100%; object-fit: contain; display: block; }

/* 疑似重複橫幅 */
.dupe-banner {
  border: 1px solid var(--ink); background: #fffbe8;
  padding: 12px 16px; font-size: 13px; margin-bottom: 16px; line-height: 1.6;
}

/* 型別 chips 分組 */
.chip-group { display: inline-flex; gap: 10px; }
.chip-sep { width: 1px; background: var(--hair); margin: 2px 6px; }

/* 卡片勾選 */
.mcard-imgwrap { position: relative; }
.mcard-pick {
  position: absolute; top: 10px; left: 10px; z-index: 2;
  width: 26px; height: 26px; border-radius: 50%;
  border: 1.5px solid #fff; background: rgba(33,37,41,0.35);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity 0.15s;
}
.mcard-imgwrap:hover .mcard-pick, .mcard-pick.on { opacity: 1; }
.mcard-pick .ic { width: 15px; height: 15px; stroke: #fff; }
.mcard-pick.on { background: var(--ink); border-color: var(--ink); }
.mcard.picked .mcard-media { outline: 2px solid var(--ink); outline-offset: -2px; }

/* 批量下載選項 */
.dl-choices { display: flex; flex-direction: column; gap: 12px; margin-top: 8px; }
.dl-choices .wish-btn { justify-content: center; }

/* 篩選結果批量操作條 */
.batch-bar {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px;
  padding: 0 40px 18px;
}
.batch-hint { font-size: 12px; letter-spacing: 0.5px; color: var(--muted); }
.batch-acts { display: flex; gap: 12px; }
.batch-acts .wish-btn { font-size: 12px; }
.batch-acts .wish-btn .ic { width: 15px; height: 15px; }
.sh-once { display: flex; align-items: flex-start; gap: 8px; font-size: 12px; color: #495057; line-height: 1.6; margin-top: 18px; cursor: pointer; }
.sh-once input { accent-color: var(--ink); margin-top: 2px; flex: 0 0 auto; }

/* API 接入頁 */
.adm-keys .adm-row { grid-template-columns: 1fr 1.4fr 1.6fr 0.7fr 0.5fr 0.9fr 1fr; cursor: default; }
.adm-keys .adm-row:hover { background: none; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 12px; color: var(--muted); }
.scope-checks { display: flex; flex-direction: column; gap: 4px; font-size: 13px; padding-top: 2px; }
.scope-checks input { accent-color: var(--ink); margin-right: 6px; }
.api-doc { font-size: 13px; line-height: 1.8; }
.api-doc code { font-family: ui-monospace, Menlo, monospace; background: #f1f3f4; padding: 1px 6px; font-size: 12px; }
.api-doc pre {
  background: var(--ink); color: #e9ecef; padding: 18px 20px; margin: 14px 0;
  overflow-x: auto; font-family: ui-monospace, Menlo, monospace; font-size: 12px; line-height: 1.6;
}
.key-reveal { margin-top: 16px; padding: 16px; border: 1px solid var(--ink); background: #fafbfb; }
.key-reveal .share-row input { font-family: ui-monospace, Menlo, monospace; }

/* 分享彈窗 */
.share-block { margin-top: 22px; }
.share-label { font-size: 11px; letter-spacing: 1px; color: var(--muted); line-height: 1.6; margin-bottom: 8px; }
.share-row { display: flex; gap: 10px; align-items: center; }
.share-row input {
  flex: 1; font-family: var(--sans); font-size: 12px; color: var(--ink);
  border: 0; border-bottom: 1px solid var(--hair); background: transparent;
  padding: 6px 2px; border-radius: 0; min-width: 0;
}
.share-row .wish-btn { white-space: nowrap; }
.dl-file-list { display: grid; gap: 8px; margin-top: 16px; }
.dl-file-btn {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  gap: 14px; text-align: left;
}
.dl-file-btn span { overflow-wrap: anywhere; }
.dl-file-btn.done { border-color: #2f7d50; color: #2f7d50; background: #f2faf5; }

/* 垃圾桶 / 危險操作 / 操作紀錄 */
.badge.trash { border-color: #c0392b; color: #c0392b; }
.wish-btn.danger { border-color: #c0392b; color: #c0392b; }
.wish-btn.danger:hover { background: #c0392b; color: #fff; }
.trash-banner { background: #fdf0ee; border-color: #c0392b; }
.adm-audit .adm-row { grid-template-columns: 140px 120px 150px 160px 1fr; cursor: default; }
.adm-audit .adm-row:hover { background: none; }
.adm-audit .adm-row a { text-decoration: underline; text-underline-offset: 3px; }
.audit-detail { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }

/* 權限矩陣 */
.perm-matrix { border-top: 1px solid var(--ink); overflow-x: auto; }
.pm-row {
  display: grid; grid-template-columns: 180px repeat(11, minmax(76px, 1fr)) 70px;
  gap: 8px; align-items: center; padding: 9px 4px;
  border-bottom: 1px solid var(--hair); font-size: 12px;
}
.pm-head { font-size: 10px; letter-spacing: 1px; color: var(--muted); font-weight: 600; }
.pm-head span { line-height: 1.4; }
.pm-name input {
  width: 100%; font-family: var(--sans); font-size: 13px; font-weight: 700;
  border: 0; border-bottom: 1px solid var(--hair); background: transparent; padding: 3px 2px; border-radius: 0;
}
.pm-name small { color: var(--muted); }
.pm-row input[type="checkbox"] { width: 15px; height: 15px; accent-color: var(--ink); cursor: pointer; }
.pm-row .adm-act button { color: var(--ink); font-size: 12px; text-decoration: underline; text-underline-offset: 3px; }

/* ============ 響應式 ============ */
@media screen and (max-width: 1100px) {
  .dm-photo { margin-left: 6%; }
  .dm-tabs { gap: 34px; }
}
@media screen and (max-width: 860px) {
  .topbar-in { padding: 14px 18px; gap: 14px; }
  .brand { font-size: 22px; }
  .mainnav { gap: 14px; }
  .mainnav a { font-size: 12px; }
  .top-right { gap: 10px; }
  .f-q { flex: 1 1 100%; }
  .f-q input { width: 100%; }
  .filter-row { justify-content: flex-start; }
  .alpha-strip, .filter-row, .batch-bar { padding-left: 18px; padding-right: 18px; }
  .batch-bar { padding-bottom: 14px; }
  .batch-acts { width: 100%; }
  .batch-acts .wish-btn { flex: 1; justify-content: center; }
  .wall-wrap { padding: 6px 18px 50px; }
  .wall { grid-template-columns: repeat(2, 1fr); gap: 26px 8px; }
  .mcard-name a { font-size: 15px; line-height: 19px; }
  .mcard-sub { font-size: 13px; }
  .dm-screen { height: auto; min-height: auto; max-height: none; }
  .dm-hero { flex: none; min-height: 0; }
  .dm-hero-in { flex-direction: column; }
  .dm-photo { aspect-ratio: auto; height: auto; width: 100%; max-width: none; margin: 0; }
  .dm-photo img { min-height: 0; max-height: 72vh; }
  .dm-similar { padding: 24px 12px 10px; }
  .dm-sim-track { gap: 10px; }
  .dm-sim-track .mcard { flex-basis: calc((100% - 10px) / 2); }
  .wish-head { gap: 12px; }
  .wish-actions { width: 100%; }
  .dm-info { padding: 34px 18px; }
  .dm-stats { margin-top: 24px; }
  .dm-stats li { font-size: 17px; line-height: 34px; }
  .dm-gallery { grid-template-columns: repeat(2, 1fr); gap: 10px; padding: 6px 12px 0; }
  .dm-tabs { gap: 20px; padding: 30px 14px 20px; }
  .dm-tabs button { font-size: 13px; }
  .dm-top { padding: 12px 14px; }
  .dm-logo { font-size: 24px; }
  .print-hero { flex-direction: column; }
  .home-top { padding: 20px 18px; }
  .home-brand { font-size: 28px; }
  .home-nav { gap: 16px; }
  .home-nav a, .home-nav button { font-size: 12px; }
  .home-bottom { left: 18px; bottom: 30px; right: 18px; }
  .home-menu a { font-size: 26px; }
}

/* ---- 手機強化（≤640）：頂欄換行橫滑、後台表格橫滑、詳情分頁橫滑 ---- */
@media screen and (max-width: 640px) {
  /* 頂欄：logo + 圖標一行；主導航移到第二行可橫滑 */
  .topbar-in { flex-wrap: wrap; gap: 10px 14px; padding: 12px 16px; }
  .brand { font-size: 22px; margin-right: auto; }
  .top-right { order: 2; gap: 16px; }
  .mainnav { order: 3; flex-basis: 100%; margin: 0; justify-content: flex-start; gap: 20px; padding-bottom: 2px; }
  .mainnav a { font-size: 13px; }
  .tr-role { display: none; }

  /* 前台頁腳 */
  .foot { padding: 40px 20px 0; }
  .foot-cols { gap: 30px 40px; padding-right: 0; }
  .to-top { right: 20px; bottom: 44px; }

  /* 詳情頁：分類/分頁橫向可滑，不擠壓 */
  .dm-cats, .dm-tabs { justify-content: flex-start; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .dm-cats::-webkit-scrollbar, .dm-tabs::-webkit-scrollbar { display: none; }
  .dm-cats { padding: 10px 16px 16px; gap: 22px; }
  .dm-tabs button, .dm-cats a { white-space: nowrap; flex: 0 0 auto; }
  .dm-name { font-size: 26px; }
  .dm-gallery { grid-template-columns: repeat(2, 1fr); }
  .dm-sim-head { flex-wrap: wrap; }
  .sim-arrows { margin-left: auto; }

  /* 分享 / 裁切彈窗 */
  .modal, .login-box { padding: 34px 24px 28px; }
  .share-row { flex-wrap: wrap; }
  .share-row input { flex-basis: 100%; }
  .share-row .wish-btn { flex: 1 1 auto; justify-content: center; }
  .dl-file-btn { min-height: 50px; }
  .crop-box { padding: 16px; }

  /* ===== 後台：整體收窄；固定列表格改橫向滑動（min-width 保排版） ===== */
  .adm-wrap { padding: 18px 14px 70px; }
  .adm-head { gap: 12px; }
  .adm-head h1 { font-size: 18px; }
  .adm-tools { width: 100%; }
  .adm-tools input[type="search"] { min-width: 0; flex: 1; }
  .adm-filters { gap: 8px; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 4px; scrollbar-width: none; }
  .adm-filters::-webkit-scrollbar { display: none; }
  .adm-filters .chip, .adm-filters .chip-group { flex: 0 0 auto; white-space: nowrap; }
  .adm-table { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .adm-table > .adm-row { min-width: 680px; }
  .adm-users .adm-row, .adm-keys .adm-row { min-width: 760px; }
  .perm-matrix { -webkit-overflow-scrolling: touch; }
  .adm-grid { grid-template-columns: 1fr; }
  .adm-biz { margin-left: -14px; margin-right: -14px; padding: 20px 14px 26px; }
  .adm-photos { grid-template-columns: repeat(2, 1fr); }
  .adm-newuser, .adm-newkey { grid-template-columns: 1fr; }
  .api-doc pre { font-size: 11px; }
  .dirty-bar { left: 12px; right: 12px; transform: none; bottom: 14px; justify-content: space-between; }
}

/* 超窄機型（≤380）：圖墻仍 2 列但間距更緊 */
@media screen and (max-width: 380px) {
  .wall { gap: 20px 6px; }
  .brand { font-size: 20px; }
  .mainnav { gap: 16px; }
}
