/* =============================================
   共用樣式模組 - 深色玻璃風格
   檔案：common.css
   ============================================= */

/* ===== CSS 變數 ===== */
:root {
  --amber-gold: #d4af37;
  --bg: #0a0a0c;
  --ink: #e2e8f0;
  --muted: #94a3b8;
  --line: rgba(255,255,255,0.12);
  --shadow: 0 14px 34px rgba(0,0,0,.4);
  --primary: #d4af37;
  --primary2: #c9a227;
  --ok: #22c55e;
  --danger: #ef4444;
  --radius: 16px;

  --chip: rgba(212,175,55,0.12);
  --chipLine: rgba(212,175,55,0.25);
}

/* ===== 基礎重置 ===== */
* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Microsoft JhengHei", "PingFang TC", "Noto Sans TC", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
}

/* ===== 背景底圖 ===== */
.master-bg {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(to bottom, rgba(10,10,12,.85), rgba(10,10,12,.95)),
    url('https://images.unsplash.com/photo-1503149779833-1de50ebe5f8a?q=80&w=2000');
  background-size: cover;
  background-position: center;
  z-index: -1;
}

/* ===== 玻璃卡片效果 ===== */
.glass-card {
  background: rgba(255,255,255,0.05);
  backdrop-filter: blur(14px) saturate(150%);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
  border: 1px solid rgba(255,255,255,0.18);
}

/* ===== 容器 ===== */
.wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 16px 100px;
}

/* ===== 頂部工具列 ===== */
.topbar {
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px;
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 10px;
  z-index: 50;
  flex-wrap: wrap;
}

.left-actions,
.right-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

/* ===== 按鈕系統 ===== */
.btn {
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.08);
  color: var(--ink);
  padding: 10px 14px;
  border-radius: 12px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: .18s;
  user-select: none;
  white-space: nowrap;
  font-size: 13px;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 18px rgba(0,0,0,.3);
  background: rgba(255,255,255,0.12);
}

.btn:disabled {
  opacity: .5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-gold {
  background: rgba(212,175,55,0.15);
  border-color: rgba(212,175,55,0.35);
  color: var(--amber-gold);
}
.btn-gold:hover {
  background: rgba(212,175,55,0.25);
}

.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #0a0a0c;
  box-shadow: 0 10px 18px rgba(212,175,55,.25);
  font-weight: 800;
}
.btn-primary:hover {
  background: var(--primary2);
  border-color: var(--primary2);
  box-shadow: 0 12px 22px rgba(212,175,55,.30);
}

.btn-dark {
  background: rgba(255,255,255,0.15);
  border-color: rgba(255,255,255,0.25);
  color: #fff;
}

.btn-ghost {
  background: rgba(255,255,255,0.05);
  border-color: rgba(255,255,255,0.12);
  color: var(--muted);
}

.btn-danger {
  background: rgba(239,68,68,0.15);
  border-color: rgba(239,68,68,0.25);
  color: #fca5a5;
}

.btn-mini {
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 800;
}

/* ===== 搜尋框（Glow Effect）===== */
.search {
  position: relative;
  width: min(320px, 55vw);
}

.search-bar {
  position: relative;
  display: flex;
  align-items: center;
  background-color: #1a1a1e;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  padding: 4px 6px 4px 4px;
  overflow: hidden;
  transition: all 0.3s ease;
}

.search-bar:hover {
  border-color: rgba(212,175,55,0.3);
  box-shadow: 0 0 20px rgba(212,175,55,0.15);
}

.search-bar:focus-within {
  border-color: rgba(212,175,55,0.5);
  box-shadow: 0 0 30px rgba(212,175,55,0.25);
}

.search-input {
  width: 100%;
  border: none;
  background: none;
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  padding: 10px 12px;
  outline: none;
}

.search-input::placeholder {
  color: var(--muted);
}

.search-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  background: rgba(212,175,55,0.15);
  border: 1px solid rgba(212,175,55,0.25);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.search-icon svg {
  width: 16px;
  height: 16px;
  fill: var(--amber-gold);
  transition: all 0.3s ease;
}

.search-icon:hover {
  background: rgba(212,175,55,0.25);
  border-color: rgba(212,175,55,0.4);
}

.search-icon:hover svg {
  transform: scale(1.1);
}

.search-bar:focus-within .search-icon {
  background: rgba(212,175,55,0.3);
  border-color: rgba(212,175,55,0.5);
}

/* 發光背景效果 */
.search .glow {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 200%;
  border-radius: 100px;
  background: radial-gradient(circle, rgba(212,175,55,0.08), transparent);
  transition: all 0.5s ease;
  transform: translate(-50%, -50%) scale(0);
  z-index: -1;
  pointer-events: none;
}

.search:hover .glow {
  transform: translate(-50%, -50%) scale(1);
}

.search:focus-within .glow {
  transform: translate(-50%, -50%) scale(1.3);
  background: radial-gradient(circle, rgba(212,175,55,0.12), transparent);
}

/* 簡易版搜尋框（向後兼容，不需要改 HTML）*/
.search input:not(.search-input) {
  width: 100%;
  border: none;
  background: none;
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  padding: 10px 12px;
  outline: none;
}

.search input:not(.search-input)::placeholder {
  color: var(--muted);
}

/* 如果 .search 內只有 input，自動套用樣式 */
.search:not(:has(.search-bar)) {
  display: flex;
  align-items: center;
  background-color: #1a1a1e;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  padding: 0 12px;
  transition: all 0.3s ease;
}

.search:not(:has(.search-bar)):hover {
  border-color: rgba(212,175,55,0.3);
  box-shadow: 0 0 20px rgba(212,175,55,0.15);
}

.search:not(:has(.search-bar)):focus-within {
  border-color: rgba(212,175,55,0.5);
  box-shadow: 0 0 30px rgba(212,175,55,0.25);
}

/* ===== 面板 ===== */
.panel {
  margin-top: 14px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
}

/* ===== 狀態指示 ===== */
.status {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
  padding: 10px 2px 0;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #475569;
}
.dot.ok { background: var(--ok); }
.dot.bad { background: var(--danger); }

/* ===== 表格 ===== */
.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255,255,255,0.03);
}

.table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: rgba(212,175,55,0.08);
  border-bottom: 1px solid var(--line);
  padding: 12px 10px;
  text-align: left;
  font-size: 11px;
  color: var(--amber-gold);
  letter-spacing: .12em;
  text-transform: uppercase;
  white-space: nowrap;
}

.table tbody td {
  border-bottom: 1px solid var(--line);
  padding: 10px;
  font-size: 13px;
  color: var(--ink);
  background: rgba(255,255,255,0.02);
  vertical-align: middle;
}

.table tbody tr:nth-child(odd) td { background: rgba(255,255,255,0.02); }
.table tbody tr:nth-child(even) td { background: rgba(255,255,255,0.04); }
.table tbody tr:hover td { background: rgba(212,175,55,0.08) !important; }
.table tbody tr:last-child td { border-bottom: 0; }

.table th.col-hide,
.table td.col-hide { display: none; }

/* 簡易表格（用於表單顯示） */
.table-form {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin-top: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
}

.table-form tr + tr td,
.table-form tr + tr th {
  border-top: 1px solid var(--line);
}

.table-form th,
.table-form td {
  padding: 12px;
  text-align: left;
  vertical-align: middle;
  background: rgba(255,255,255,0.02);
}

.table-form th {
  width: 180px;
  color: var(--muted);
  font-weight: 800;
  background: rgba(212,175,55,0.04);
}

/* ===== 表單元素 ===== */
.in,
.sel {
  width: 100%;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.06);
  color: var(--ink);
  padding: 10px;
  border-radius: 12px;
  outline: none;
  font-size: 14px;
}

.in:focus,
.sel:focus {
  border-color: rgba(212,175,55,0.5);
  box-shadow: 0 0 0 3px rgba(212,175,55,.15);
}

.in::placeholder {
  color: var(--muted);
}

.sel option {
  background: #1a1a1e;
  color: var(--ink);
}

.label-text {
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 6px;
  font-weight: 600;
}

/* ===== Modal 彈窗 ===== */
.modal-back {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 900;
  padding: 16px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.modal {
  width: min(680px, 100%);
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(20,20,24,0.98);
  backdrop-filter: blur(20px);
  box-shadow: 0 50px 140px rgba(0,0,0,.5);
  overflow: hidden;
}

.modal-head {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: rgba(212,175,55,0.05);
}

.modal-head b {
  color: var(--amber-gold);
  letter-spacing: .06em;
}

.modal-body {
  padding: 14px;
  display: grid;
  gap: 10px;
}

.modal-foot {
  padding: 12px 14px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  background: rgba(212,175,55,0.03);
}

/* ===== 卡片網格（橫向列表）===== */
.grid {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

@media (max-width: 640px) {
  .search { width: 100%; }
  .topbar { position: static; }
}

/* ===== 卡片樣式（橫向）===== */
.card {
  background: rgba(255,255,255,0.06);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 14px;
  box-shadow: 0 8px 20px rgba(0,0,0,.25);
  overflow: hidden;
  display: flex;
  flex-direction: row;
  align-items: stretch;
  min-height: 120px;
  transition: .18s;
  cursor: pointer;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(0,0,0,.35);
  border-color: rgba(212,175,55,0.3);
}

.card.active {
  border-color: var(--amber-gold);
  box-shadow: 0 0 0 2px var(--amber-gold), 0 12px 30px rgba(0,0,0,.35);
}

@media (max-width: 640px) {
  .card {
    flex-direction: column;
    min-height: auto;
  }
}

.card-hd {
  padding: 16px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  background: rgba(212,175,55,0.06);
  gap: 10px;
}

.card-hd .sub {
  font-size: 13px;
  color: var(--muted);
  font-weight: 700;
}

.card-hd .sub .v {
  color: var(--amber-gold);
  font-weight: 800;
}

/* ===== 縮圖（橫向卡片用）===== */
.thumb {
  width: 140px;
  min-width: 140px;
  height: auto;
  min-height: 120px;
  background: linear-gradient(135deg, rgba(212,175,55,.1), rgba(10,10,12,0.5));
  border-right: 1px solid var(--line);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
  user-select: none;
  position: absolute;
  inset: 0;
}

.thumb .noimg,
.thumb .fallback {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-weight: 800;
  letter-spacing: .08em;
  font-size: 11px;
}

@media (max-width: 640px) {
  .thumb {
    width: 100%;
    min-width: auto;
    height: 160px;
    min-height: 160px;
    border-right: none;
    border-bottom: 1px solid var(--line);
  }
}

/* ===== 卡片內容（橫向）===== */
.card-body {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 0;
  justify-content: center;
}

.card-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--amber-gold);
  line-height: 1.3;
}

.card-info-line {
  font-size: 14px;
  color: #fff;
  font-weight: 500;
  margin-top: 4px;
}

.card-info {
  font-size: 13px;
  color: var(--muted);
}

.card-note {
  font-size: 13px;
  color: var(--muted);
}

.card-more {
  color: var(--amber-gold);
  font-size: 12px;
  font-weight: 700;
  margin-top: 4px;
  cursor: pointer;
}

/* 卡片右側區域（日期）*/
.card-right {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 14px 16px;
  width: 120px;
  min-width: 120px;
  border-left: 1px solid var(--line);
  background: rgba(212,175,55,0.03);
}

.card-right .card-date {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.card-right .card-stage {
  margin-top: 8px;
  padding: 6px 14px;
  border-radius: 14px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  text-align: center;
  min-width: 80px;
}

/* 展示中 - 金色 */
.card-stage.stage-display {
  background: rgba(212,175,55,0.15);
  border: 1px solid rgba(212,175,55,0.4);
  color: #d4af37;
}

/* 新上架 - 綠色 */
.card-stage.stage-new {
  background: rgba(34,197,94,0.15);
  border: 1px solid rgba(34,197,94,0.4);
  color: #22c55e;
}

/* 預約看車 - 藍色 */
.card-stage.stage-booking {
  background: rgba(59,130,246,0.15);
  border: 1px solid rgba(59,130,246,0.4);
  color: #3b82f6;
}

/* 整備中 - 橘色 */
.card-stage.stage-repair {
  background: rgba(249,115,22,0.15);
  border: 1px solid rgba(249,115,22,0.4);
  color: #f97316;
}

/* 已交車 - 紫色 */
.card-stage.stage-sold {
  background: rgba(168,85,247,0.15);
  border: 1px solid rgba(168,85,247,0.4);
  color: #a855f7;
}

/* 預設 - 灰色 */
.card-stage.stage-default {
  background: rgba(148,163,184,0.15);
  border: 1px solid rgba(148,163,184,0.4);
  color: #94a3b8;
}

@media (max-width: 640px) {
  .card {
    flex-direction: column;
  }
  .thumb {
    width: 100%;
    min-width: auto;
    height: 160px;
    min-height: 160px;
    border-right: none;
    border-bottom: 1px solid var(--line);
  }
  .card-right {
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
    border-left: none;
    border-top: 1px solid var(--line);
    min-width: auto;
    width: 100%;
    padding: 10px 14px;
  }
}

.card-row {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.card-cell {
  padding: 0 12px;
  font-size: 13px;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-cell:first-child {
  min-width: 90px;
  color: var(--muted);
}

.card-cell:nth-child(2) {
  min-width: 110px;
}

.card-cell:nth-child(3) {
  min-width: 85px;
}

.card-cell:nth-child(4) {
  min-width: 130px;
  font-weight: 700;
}

.card-cell:nth-child(5) {
  min-width: 50px;
}

.card-cell.card-price {
  min-width: 100px;
  color: var(--amber-gold);
  font-weight: 700;
}

.card-cell:nth-child(7) {
  min-width: 70px;
}

.card-cell.card-note {
  flex: 1;
  min-width: 120px;
  color: var(--muted);
}

.card-cell:last-child {
  min-width: auto;
  padding-right: 14px;
}

.card-edit-btn {
  pointer-events: auto;
}

.card-more {
  color: var(--amber-gold);
  font-size: 12px;
  font-weight: 700;
  padding: 8px 12px;
  cursor: pointer;
}

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.card h3 {
  margin: 0;
  font-size: 16px;
  letter-spacing: .01em;
  line-height: 1.3;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 980px) {
  .card-row {
    flex-wrap: wrap;
    gap: 4px 0;
  }
  .card-cell {
    min-width: auto !important;
    padding: 4px 10px;
  }
  .card-cell.card-note {
    width: 100%;
    padding-top: 6px;
  }
}

/* 卡片展開詳細資料區域 */
.card-detail {
  display: none;
  width: 100%;
  border-top: 1px solid var(--line);
  background: rgba(0,0,0,0.3);
  padding: 16px 20px;
  gap: 20px;
}

.card.expanded {
  flex-wrap: wrap;
}

.card.expanded .card-detail {
  display: flex;
  flex-wrap: wrap;
}

.card-detail-img {
  width: 180px;
  min-width: 180px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
}

.card-detail-img img {
  width: 100%;
  height: auto;
  display: block;
}

.card-detail-info {
  flex: 1;
  min-width: 280px;
}

.card-detail-info h3 {
  margin: 0 0 12px;
  color: var(--amber-gold);
  font-size: 18px;
}

/* 展開區域的功能按鈕 */
.card-detail-btns {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.btn-tab {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  color: var(--muted);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.btn-tab:hover {
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.25);
  color: #fff;
}

.btn-tab-active {
  background: rgba(212,175,55,0.15);
  border-color: rgba(212,175,55,0.5);
  color: var(--amber-gold);
}

.btn-tab-active:hover {
  background: rgba(212,175,55,0.25);
  border-color: rgba(212,175,55,0.6);
  color: var(--amber-gold);
}

.card-detail-table {
  width: 100%;
  border-collapse: collapse;
}

.card-detail-table tr {
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.card-detail-table tr:last-child {
  border-bottom: none;
}

.card-detail-table th {
  text-align: left;
  padding: 8px 12px 8px 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  width: 90px;
  white-space: nowrap;
}

.card-detail-table td {
  padding: 8px 0;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}

.card-detail-table .highlight {
  color: var(--amber-gold);
}

/* 分頁內容 */
.tab-content {
  margin-top: 12px;
}

/* 分頁工具列 */
.tab-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: rgba(212,175,55,0.06);
  border: 1px solid var(--line);
  border-radius: 10px;
  margin-bottom: 12px;
}

.tab-toolbar-info {
  font-size: 13px;
}

/* 基本資料圖片 */
.basic-img-wrap {
  margin-bottom: 14px;
}

.basic-img {
  width: 200px;
  height: 140px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: rgba(212,175,55,0.05);
  display: flex;
  align-items: center;
  justify-content: center;
}

.basic-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.basic-img .noimg {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

/* 基本資料編輯區域 */
.basic-edit .in,
.basic-edit .sel {
  background: rgba(255,255,255,0.08);
  color: #fff;
  border: 1px solid var(--line);
}

.basic-edit .in:focus,
.basic-edit .sel:focus {
  border-color: rgba(212,175,55,0.5);
  box-shadow: 0 0 0 3px rgba(212,175,55,.15);
}

.tab-empty {
  color: var(--muted);
  padding: 20px;
  text-align: center;
  font-size: 13px;
}

/* 照片網格 */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.photo-item {
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--line);
  aspect-ratio: 4/3;
}

.photo-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

@media (max-width: 768px) {
  .photo-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .card-detail {
    flex-direction: column;
  }
  .card-detail-img {
    width: 100%;
    min-width: auto;
    max-width: 200px;
  }
}

/* 卡片描述文字 */
.card-desc {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 閱讀更多連結 */
.card-more {
  color: var(--amber-gold);
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
}

/* ===== 標籤 ===== */
.badge {
  background: rgba(212,175,55,0.2);
  color: var(--amber-gold);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  padding: 4px 10px;
  white-space: nowrap;
}

.chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding-top: 2px;
}

.chip {
  background: var(--chip);
  border: 1px solid var(--chipLine);
  color: var(--amber-gold);
  font-size: 11px;
  font-weight: 700;
  border-radius: 999px;
  padding: 4px 10px;
  white-space: nowrap;
}

/* ===== 分隔線 ===== */
.hr {
  height: 1px;
  background: var(--line);
  margin: 2px 0;
}

/* ===== 行內顯示 ===== */
.row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.row span {
  color: var(--muted);
  font-size: 12px;
}

.row b {
  color: #fff;
}

/* ===== 展開編輯區 ===== */
.expand-editor {
  margin-top: 14px;
  border-radius: 16px;
  overflow: hidden;
  display: none;
  animation: slideDown .3s ease;
}

.expand-editor.show {
  display: block;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

.expand-editor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  background: rgba(212,175,55,0.08);
  border-bottom: 1px solid var(--line);
}

.expand-editor-head-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.expand-editor-head b {
  font-size: 15px;
  color: var(--amber-gold);
  letter-spacing: .04em;
}

.expand-editor-head .subtitle {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}

.expand-editor-body {
  background: rgba(10,10,12,0.6);
}

.expand-editor iframe {
  width: 100%;
  height: 70vh;
  min-height: 500px;
  border: 0;
  background: transparent;
  display: block;
}

/* ===== 分頁標籤 ===== */
.tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 2px;
  align-items: center;
  justify-content: flex-end;
}

.tab {
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.08);
  color: var(--ink);
  padding: 10px 12px;
  border-radius: 999px;
  font-weight: 800;
  cursor: pointer;
  transition: .15s;
  user-select: none;
  font-size: 13px;
  white-space: nowrap;
}

.tab:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 18px rgba(0,0,0,.3);
  background: rgba(255,255,255,0.12);
}

.tab.on {
  background: rgba(212,175,55,0.15);
  border-color: rgba(212,175,55,0.35);
  color: var(--amber-gold);
}

/* ===== 圖片框 ===== */
.imgbox {
  padding: 14px 16px 0;
}

.imgframe {
  width: 100%;
  aspect-ratio: 16/9;
  border-radius: 16px;
  border: 1px solid var(--line);
  overflow: hidden;
  background: rgba(212,175,55,0.05);
  position: relative;
}

.imgframe img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.imgframe .fallback {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-weight: 800;
  letter-spacing: .5px;
}

/* ===== 圖片網格（照片牆） ===== */
.grid-photo {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

@media (max-width: 980px) {
  .grid-photo { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  .grid-photo { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.tile {
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 10px 26px rgba(0,0,0,.3);
  position: relative;
}

.tile .thumb {
  width: 100%;
  height: auto;
  aspect-ratio: 4/3;
  background: rgba(212,175,55,0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  border-bottom: 1px solid var(--line);
}

.tile-foot {
  padding: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.tile-foot .path {
  max-width: 70%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  color: var(--muted);
  font-weight: 700;
}

/* ===== 大圖預覽 ===== */
.viewer {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1200;
  padding: 14px;
}

.viewer .box {
  max-width: 90vw;
  max-height: 90vh;
  position: relative;
  background: rgba(20,20,24,0.95);
  border-radius: 18px;
  border: 1px solid var(--line);
  overflow: hidden;
  box-shadow: 0 40px 100px rgba(0,0,0,.5);
}

.viewer .box img {
  display: block;
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
}

.viewer .box .close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 10;
}

.viewer .cap {
  padding: 10px 14px;
  background: rgba(0,0,0,0.6);
  color: var(--muted);
  font-size: 12px;
  word-break: break-all;
}

/* ===== 提示訊息 ===== */
.hint {
  background: rgba(212,175,55,0.08);
  border: 1px dashed rgba(212,175,55,0.35);
  padding: 10px 12px;
  border-radius: 12px;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.45;
}

/* ===== Toast 通知 ===== */
.toast {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 1200;
  display: none;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(20,20,24,0.95);
  backdrop-filter: blur(10px);
  box-shadow: 0 18px 50px rgba(0,0,0,.4);
  padding: 10px 12px;
  color: var(--ink);
  font-size: 13px;
  align-items: center;
  gap: 10px;
}

.toast.show {
  display: flex;
}

.spinner {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  border: 2px solid rgba(255,255,255,.15);
  border-top-color: var(--amber-gold);
  animation: spin .7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ===== 特效按鈕（Glow Effect）===== */
.btn-glow {
  cursor: pointer;
  padding: 0.8em 1.2em;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  background: #1a1a1e;
  background-size: cover;
  background-blend-mode: overlay;
  border-radius: 0.6em;
  outline: 1px solid rgba(255,255,255,0.15);
  border: 0;
  box-shadow: 0 0 1em 0.5em rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease-in-out;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
}

.btn-glow:hover {
  transform: scale(1.05);
  box-shadow: 0 0 1.2em 0.5em rgba(212, 175, 55, 0.15);
  background: radial-gradient(
    circle at bottom,
    rgba(212, 175, 55, 0.35) 0%,
    #1a1a1e 70%
  );
  outline: 1px solid rgba(212, 175, 55, 0.4);
}

.btn-glow:active {
  transform: scale(0.98);
}

.btn-glow .icon {
  fill: currentColor;
  width: 1em;
  height: 1em;
}

/* 金色發光版本 */
.btn-glow-gold {
  background: linear-gradient(180deg, #2a2520, #1a1a1e);
  outline: 1px solid rgba(212, 175, 55, 0.3);
  color: var(--amber-gold);
}

.btn-glow-gold:hover {
  box-shadow: 0 0 1.5em 0.6em rgba(212, 175, 55, 0.2);
  background: radial-gradient(
    circle at bottom,
    rgba(212, 175, 55, 0.5) 0%,
    #1a1a1e 60%
  );
  outline: 1px solid rgba(212, 175, 55, 0.6);
}

/* 藍色發光版本 */
.btn-glow-blue {
  background: linear-gradient(180deg, #1a2030, #1a1a1e);
  outline: 1px solid rgba(59, 130, 246, 0.3);
  color: #60a5fa;
}

.btn-glow-blue:hover {
  box-shadow: 0 0 1.5em 0.6em rgba(59, 130, 246, 0.15);
  background: radial-gradient(
    circle at bottom,
    rgba(59, 130, 246, 0.4) 0%,
    #1a1a1e 60%
  );
  outline: 1px solid rgba(59, 130, 246, 0.5);
}

/* 紅色發光版本（危險操作）*/
.btn-glow-red {
  background: linear-gradient(180deg, #2a1a1a, #1a1a1e);
  outline: 1px solid rgba(239, 68, 68, 0.3);
  color: #f87171;
}

.btn-glow-red:hover {
  box-shadow: 0 0 1.5em 0.6em rgba(239, 68, 68, 0.15);
  background: radial-gradient(
    circle at bottom,
    rgba(239, 68, 68, 0.4) 0%,
    #1a1a1e 60%
  );
  outline: 1px solid rgba(239, 68, 68, 0.5);
}

/* 綠色發光版本（成功操作）*/
.btn-glow-green {
  background: linear-gradient(180deg, #1a2a1a, #1a1a1e);
  outline: 1px solid rgba(34, 197, 94, 0.3);
  color: #4ade80;
}

.btn-glow-green:hover {
  box-shadow: 0 0 1.5em 0.6em rgba(34, 197, 94, 0.15);
  background: radial-gradient(
    circle at bottom,
    rgba(34, 197, 94, 0.4) 0%,
    #1a1a1e 60%
  );
  outline: 1px solid rgba(34, 197, 94, 0.5);
}

/* 大尺寸發光按鈕 */
.btn-glow-lg {
  padding: 1em 1.8em;
  font-size: 15px;
  border-radius: 0.8em;
}

/* 小尺寸發光按鈕 */
.btn-glow-sm {
  padding: 0.5em 0.9em;
  font-size: 12px;
  border-radius: 0.5em;
}

/* ===== 光掃按鈕（Shine Sweep Effect）===== */
.btn-shine {
  display: inline-flex;
  overflow: hidden;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  background: #1a1a1e;
  color: #fff;
  border: 0;
  outline: 1px solid rgba(255,255,255,0.15);
  box-shadow: 0 4px 14px rgba(0,0,0,0.25);
  padding: 10px 16px;
  border-radius: 10px;
  cursor: pointer;
  position: relative;
  transition: all 0.3s ease-out;
}

.btn-shine::before {
  content: '';
  position: absolute;
  right: 0;
  top: -50%;
  height: 200%;
  width: 30px;
  transform: translateX(50px) rotate(12deg);
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
  transition: transform 0.8s ease-out;
  pointer-events: none;
}

.btn-shine:hover {
  outline: 1px solid rgba(255,255,255,0.25);
  box-shadow: 0 0 0 2px rgba(255,255,255,0.1), 0 6px 20px rgba(0,0,0,0.3);
}

.btn-shine:hover::before {
  transform: translateX(-250px) rotate(12deg);
}

.btn-shine:active {
  transform: scale(0.98);
}

.btn-shine .icon {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

/* 金色光掃 */
.btn-shine-gold {
  background: linear-gradient(135deg, #2a2520 0%, #1a1a1e 100%);
  color: var(--amber-gold);
  outline: 1px solid rgba(212,175,55,0.3);
}

.btn-shine-gold::before {
  background: linear-gradient(90deg, transparent, rgba(212,175,55,0.25), transparent);
}

.btn-shine-gold:hover {
  outline: 1px solid rgba(212,175,55,0.5);
  box-shadow: 0 0 0 2px rgba(212,175,55,0.15), 0 6px 20px rgba(0,0,0,0.3);
}

/* 藍色光掃 */
.btn-shine-blue {
  background: linear-gradient(135deg, #1a2030 0%, #1a1a1e 100%);
  color: #60a5fa;
  outline: 1px solid rgba(59,130,246,0.3);
}

.btn-shine-blue::before {
  background: linear-gradient(90deg, transparent, rgba(59,130,246,0.25), transparent);
}

.btn-shine-blue:hover {
  outline: 1px solid rgba(59,130,246,0.5);
  box-shadow: 0 0 0 2px rgba(59,130,246,0.15), 0 6px 20px rgba(0,0,0,0.3);
}

/* 主要按鈕（實心金色）*/
.btn-shine-primary {
  background: linear-gradient(135deg, var(--amber-gold) 0%, #b8962e 100%);
  color: #0a0a0c;
  outline: none;
  box-shadow: 0 4px 14px rgba(212,175,55,0.3);
}

.btn-shine-primary::before {
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.35), transparent);
}

.btn-shine-primary:hover {
  box-shadow: 0 0 0 2px rgba(212,175,55,0.4), 0 6px 24px rgba(212,175,55,0.35);
}

/* 危險按鈕（紅色）*/
.btn-shine-danger {
  background: linear-gradient(135deg, #2a1a1a 0%, #1a1a1e 100%);
  color: #f87171;
  outline: 1px solid rgba(239,68,68,0.3);
}

.btn-shine-danger::before {
  background: linear-gradient(90deg, transparent, rgba(239,68,68,0.25), transparent);
}

.btn-shine-danger:hover {
  outline: 1px solid rgba(239,68,68,0.5);
  box-shadow: 0 0 0 2px rgba(239,68,68,0.15), 0 6px 20px rgba(0,0,0,0.3);
}

/* 尺寸變化 */
.btn-shine-lg {
  padding: 12px 24px;
  font-size: 15px;
  border-radius: 12px;
}

.btn-shine-sm {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: 8px;
}

/* 帶計數/徽章的按鈕 */
.btn-shine .btn-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 8px;
  padding-left: 8px;
  border-left: 1px solid rgba(255,255,255,0.15);
}

.btn-shine .btn-badge .star {
  width: 14px;
  height: 14px;
  fill: currentColor;
  opacity: 0.5;
  transition: all 0.3s ease;
}

.btn-shine:hover .btn-badge .star {
  opacity: 1;
  fill: #fbbf24;
}

.btn-shine .btn-badge .count {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.05em;
}

/* ===== 工具類別 ===== */
.v { font-weight: 800; color: #fff; }
.muted { color: var(--muted); font-weight: 700; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.hidden { display: none !important; }
.view-hide { display: none !important; }

/* 編輯模式切換 */
.editOnly { display: none; }
.viewOnly { display: block; }
.editing .editOnly { display: block; }
.editing .viewOnly { display: none; }

/* 隱藏 iframe */
.hidden-iframe {
  display: none;
  width: 0;
  height: 0;
  border: 0;
}

/* ===== 響應式調整 ===== */
@media (max-width: 920px) {
  .topbar { position: static; }
  .wrap { padding-top: 12px; }
}

@media (max-width: 640px) {
  .table-form th { width: 120px; }
  .btn { padding: 10px 12px; }
  .card-hd { align-items: flex-start; }
}