*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, 'PingFang TC', 'Helvetica Neue', Arial, sans-serif;
  background: #f5f3ef;
  color: #1a1a1a;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ====== STICKY WRAPPER (header + nav 一起固定) ====== */
.sticky-top {
  position: sticky;
  top: 0;
  z-index: 100;
}

/* ====== HEADER ====== */
.site-header {
  background: #0d0d0d;
  padding: 12px 20px 10px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.site-header::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg,
    #E84545 0%, #E8A800 16%, #7CB518 33%,
    #00827F 50%, #2851A3 66%, #7B5EA7 83%, #C21E56 100%);
}
.header-inner {
  position: relative;
  z-index: 1;
}
.site-title {
  /* clamp 讓手機縮放、桌機放大，white-space 強制一行 */
  font-size: clamp(18px, 5.5vw, 30px);
  font-weight: 200;
  color: #ffffff;
  letter-spacing: clamp(0.25em, 1.2vw, 0.45em);
  text-indent: clamp(0.25em, 1.2vw, 0.45em);
  text-transform: uppercase;
  white-space: nowrap;
  line-height: 1;
}
.site-sub {
  font-size: 10px;
  color: rgba(255,255,255,0.38);
  letter-spacing: 0.2em;
  margin-top: 5px;
  text-indent: 0.2em;
}

/* ====== NAV ====== */
.nav {
  display: flex;
  background: #1a1a1a;
  border-bottom: 1px solid #2a2a2a;
}
.nav-btn {
  flex: 1;
  padding: 14px 0;
  color: #666;
  text-align: center;
  font-size: 13px;
  letter-spacing: 0.14em;
  cursor: pointer;
  border: none;
  background: none;
  transition: color 0.2s;
  text-transform: uppercase;
}
.nav-btn.active {
  color: #fff;
  border-bottom: 2px solid #fff;
}

/* ====== PAGES ====== */
.page {
  display: none;
  padding: 24px 16px 48px;
  max-width: 480px;
  margin: 0 auto;
  width: 100%;
}
.page.active { display: block; }

/* ====== COLOR PAGE ====== */
.color-hero {
  display: flex;
  justify-content: center;
  margin: 28px 0 12px;
}

/* Pantone card — white frame + square swatch */
.pantone-card {
  width: 180px;
  background: #ffffff;
  padding: 14px 14px 0;
  box-shadow:
    0 1px 3px rgba(0,0,0,.08),
    0 8px 24px rgba(0,0,0,.14),
    0 24px 48px rgba(0,0,0,.08);
  border-radius: 3px;
}
.pantone-card.pop { animation: cardpop 0.4s cubic-bezier(.36,.07,.19,.97); }
@keyframes cardpop {
  0%   { transform: scale(1) rotate(0deg); }
  30%  { transform: scale(1.05) rotate(-1deg); }
  60%  { transform: scale(0.98) rotate(0.5deg); }
  100% { transform: scale(1) rotate(0deg); }
}
.p-swatch {
  width: 100%;
  aspect-ratio: 1 / 1;
  display: block;
  background: #e8e5e0;
  transition: background-color 0.4s ease;
}
.p-info {
  padding: 12px 0 18px;
}
.p-brand {
  font-size: 7.5px;
  letter-spacing: 0.28em;
  color: rgba(0,0,0,0.28);
  text-transform: uppercase;
  margin-bottom: 9px;
}
.p-name {
  font-size: 15px;
  font-weight: 700;
  color: #111;
  margin-bottom: 5px;
  letter-spacing: 0.02em;
  min-height: 20px;
}
.p-hex {
  font-size: 12px;
  color: #999;
  font-family: 'Courier New', monospace;
  letter-spacing: 0.06em;
  min-height: 16px;
}

.draw-btn {
  display: block;
  width: 100%;
  padding: 15px;
  background: #111;
  color: #fff;
  border: none;
  border-radius: 2px;
  font-size: 14px;
  letter-spacing: 0.18em;
  cursor: pointer;
  margin-top: 20px;
  transition: opacity 0.2s;
  text-transform: uppercase;
}
.draw-btn:hover { opacity: 0.75; }

.action-row {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}
.action-btn {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 12px;
  border: 1.5px solid #333;
  background: transparent;
  color: #333;
  border-radius: 2px;
  font-size: 13px;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.action-btn svg { flex: 0 0 auto; }
.action-btn:hover { background: #111; color: #fff; border-color: #111; }
.action-btn.ok { background: #388e3c; border-color: #388e3c; color: #fff; }

/* ====== COLLAGE PAGE ====== */
.sec-label {
  font-size: 10px;
  letter-spacing: 0.26em;
  color: #aaa;
  text-transform: uppercase;
  margin: 28px 0 10px;
}
.sec-label:first-child { margin-top: 8px; }

.color-row {
  display: flex;
  gap: 10px;
  align-items: center;
  width: 100%;
}
input[type="color"] {
  flex: 0 0 48px;
  width: 48px;
  height: 48px;
  border: none;
  padding: 2px;
  border-radius: 6px;
  cursor: pointer;
  background: none;
}
.txt-input {
  flex: 1;
  min-width: 0;
  padding: 12px;
  border: 1.5px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  background: #fff;
  outline: none;
  font-family: 'Courier New', monospace;
  letter-spacing: 0.05em;
  width: 100%;
}
.txt-input:focus { border-color: #555; }
.color-name-hint {
  font-size: 11px;
  color: #aaa;
  letter-spacing: 0.12em;
  margin-top: 6px;
  min-height: 16px;
  margin-left: 58px; /* 對齊 hex 輸入框：picker 48px + gap 10px */
}

.upload-zone {
  display: block;
  width: 100%;
  border: 2px dashed #ccc;
  border-radius: 10px;
  padding: 28px 16px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  background: #fff;
}
.upload-zone:hover { border-color: #555; background: #fafaf8; }
.upload-zone input { display: none; }
.upload-icon { font-size: 28px; margin-bottom: 6px; display: block; }
.upload-sub { font-size: 13px; color: #bbb; }
.upload-count { font-size: 12px; color: #bbb; margin-top: 4px; }

.thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
  width: 100%;
}
.thumb-wrap { position: relative; }
.thumb-img {
  width: 76px;
  height: 76px;
  object-fit: cover;
  border-radius: 6px;
  display: block;
}
.thumb-x {
  position: absolute;
  top: -5px; right: -5px;
  width: 20px; height: 20px;
  background: #d32f2f;
  border: none;
  border-radius: 50%;
  color: #fff;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

/* 縮圖可拖拉排序（SortableJS）*/
.thumb-wrap {
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}
/* 拖曳中被選取的縮圖 */
.thumb-chosen { cursor: grabbing; }
.thumb-drag {
  box-shadow: 0 8px 20px rgba(0,0,0,0.28);
  opacity: 0.98;
}
/* 拖曳時原位留下的半透明佔位（ghost）*/
.thumb-ghost { opacity: 0.35; }
.thumb-ghost .thumb-img { filter: grayscale(0.3); }
/* 已調整構圖標記 */
.thumb-edited {
  position: absolute;
  bottom: -4px; left: -4px;
  width: 18px; height: 18px;
  background: #111;
  color: #fff;
  font-size: 10px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}
/* 縮圖區操作說明 */
.thumbs-hint {
  font-size: 12px;
  color: #aaa;
  margin: 8px 0 0;
  display: flex;
  align-items: center;
  gap: 5px;
}
.thumbs-hint svg { flex: 0 0 auto; }
/* 產生後的拼圖：可點擊調整每格構圖 */
#previewCanvas.editable { cursor: pointer; }

/* ====== 構圖編輯器（縮放 + 平移）====== */
.crop-editor {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.72);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.crop-panel {
  background: #fff;
  border-radius: 16px;
  width: 100%;
  max-width: 420px;
  padding: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}
.crop-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.crop-title { font-size: 16px; font-weight: 600; color: #111; }
.crop-head-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}
.crop-icon-btn {
  border: 1px solid #e2ded7;
  background: #fff;
  color: #444;
  cursor: pointer;
  padding: 6px 12px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  transition: background 0.15s, border-color 0.15s;
}
.crop-icon-btn:hover { background: #f0ede8; border-color: #d5d0c8; }
.crop-icon-btn:active { background: #e6e2db; }
.crop-icon-label { line-height: 1; }
.crop-close {
  border: none;
  background: none;
  font-size: 24px;
  line-height: 1;
  color: #888;
  cursor: pointer;
  padding: 0 4px;
}
.crop-stage {
  /* 實際寬高由 JS(sizeCropCanvas) 依格子比例算出並設定 */
  margin: 0 auto;
  border-radius: 12px;
  overflow: hidden;
  background: #000;
  touch-action: none;
}
#cropCanvas {
  width: 100%;
  height: 100%;
  display: block;
  cursor: grab;
  touch-action: none;
}
#cropCanvas:active { cursor: grabbing; }
.crop-hint {
  font-size: 12px;
  color: #999;
  text-align: center;
  margin: 10px 0 6px;
}
.crop-zoom-row {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #888;
  margin-bottom: 14px;
}
.crop-zoom-row input[type="range"] {
  flex: 1;
  accent-color: #111;
}
.crop-actions {
  display: flex;
  gap: 10px;
}
.crop-btn {
  flex: 1;
  padding: 12px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: 1.5px solid #ddd;
}
.crop-btn.ghost { background: #fff; color: #555; }
.crop-btn.primary { background: #111; color: #fff; border-color: #111; }

.layout-row {
  display: flex;
  gap: 8px;
  width: 100%;
}
.layout-tile {
  flex: 1;
  min-width: 0;
  padding: 10px 4px 8px;
  border: 1.5px solid #ddd;
  border-radius: 6px;
  font-size: 11px;
  text-align: center;
  cursor: pointer;
  color: #bbb;
  background: #fff;
  transition: all 0.2s;
  letter-spacing: 0.05em;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.layout-tile.on {
  border-color: #111;
  color: #111;
  background: #f0ede8;
}
.layout-icon {
  width: 32px;
  height: 32px;
  display: block;
}

/* ====== COLOR SCORE DIALOG ====== */
.score-dialog-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  /* 手機：貼底（bottom-sheet）；桌機由 media query 改為置中 */
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  animation: overlayIn 0.2s ease;
}
@keyframes overlayIn { from { opacity: 0; } to { opacity: 1; } }

.score-dialog {
  width: 100%;
  max-width: 480px;              /* 隨網頁寬度縮放，桌機最寬 480 */
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  background: #f5f3ef;
  border-radius: 16px 16px 0 0;  /* 手機貼底：只有上緣圓角 */
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.2);
  animation: sheetUp 0.28s cubic-bezier(.16, 1, .3, 1);
  padding-bottom: env(safe-area-inset-bottom); /* 避開 iPhone 底部橫條 */
}
@keyframes sheetUp { from { transform: translateY(100%); } to { transform: translateY(0); } }

.score-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px 12px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.07);
  flex: 0 0 auto;
}
.score-dialog-title {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: #111;
}
.score-dialog-close {
  width: 32px;
  height: 32px;
  border: none;
  background: rgba(0, 0, 0, 0.05);
  border-radius: 50%;
  font-size: 22px;
  line-height: 1;
  color: #666;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}
.score-dialog-close:hover { background: rgba(0, 0, 0, 0.12); }

.score-dialog-body {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 14px 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.score-row {
  display: flex;
  gap: 14px;
  align-items: stretch;
  background: #fff;
  border: 1px solid #efece7;
  border-radius: 14px;
  padding: 12px;
  overflow: hidden;           /* 內容不外溢卡片 */
}
/* 縮圖：固定寬高框，圖片在框內水平置中、保留真實比例（不裁切不變形）
   → 每列框寬一致，分數起點固定對齊。左右留白透明（不要灰底），
   圓角套在圖片上、陰影用 drop-shadow 貼合圖形。 */
.score-thumb {
  flex: 0 0 60px;              /* 固定寬度，確保分數起點對齊 */
  width: 60px;
  height: 72px;
  object-fit: contain;        /* 完整顯示、不裁切、不變形；短邊透明留白 */
  align-self: center;
  border-radius: 8px;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,0.18)); /* 貼合圖片形狀的陰影 */
}
.score-info {
  flex: 1 1 auto;
  min-width: 0;               /* 允許收縮，避免長講評把卡片撐破 */
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.score-top {
  display: flex;
  align-items: baseline;
  gap: 8px;
  width: 100%;                /* 讓主色點的 margin-left:auto 能推到最右 */
}
.score-num {
  font-size: 26px;
  font-weight: 800;
  color: #1a1a1a;
  line-height: 1;
  letter-spacing: -0.02em;
}
.score-num-unit {
  font-size: 12px;
  font-weight: 600;
  color: #b3ada3;
  margin-left: -3px;
}
.score-dot {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  display: inline-block;
  margin-left: auto;           /* 主色點推到最右，與分數分列兩端 */
  align-self: center;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
}
.score-comment {
  font-size: 13px;
  color: #6b6b6b;
  margin-top: 6px;
  line-height: 1.5;
  overflow-wrap: anywhere;    /* 長講評正確換行，不外溢卡片 */
}

/* 桌機 / 大螢幕：改為置中彈窗，四角圓角 */
@media (min-width: 600px) {
  .score-dialog-overlay {
    align-items: center;
    padding: 20px;
  }
  .score-dialog {
    border-radius: 14px;
    animation: dialogPop 0.22s cubic-bezier(.16, 1, .3, 1);
  }
  @keyframes dialogPop {
    from { transform: scale(0.96); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
  }
}

.preview-wrap { margin-top: 20px; }
#previewCanvas {
  width: 100%;
  border-radius: 10px;
  display: none;
  box-shadow:
    0 2px 8px rgba(0,0,0,.08),
    0 8px 28px rgba(0,0,0,.14);
}
.canvas-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}
/* 次要行動列：刷新色塊 + 色彩評分，兩顆等寬並排 */
.canvas-actions-row {
  display: flex;
  gap: 10px;
}
.mini-btn {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 13px 10px;
  background: transparent;
  color: #444;
  border: 1.5px solid #ccc;
  border-radius: 2px;
  font-size: 13px;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.mini-btn:not(:disabled):hover { background: #111; color: #fff; border-color: #111; }
.mini-btn:disabled { opacity: 0.4; cursor: default; }
.mini-btn svg { flex: 0 0 auto; }
/* 主行動：儲存／分享，滿版最醒目 */
.dl-btn {
  width: 100%;
  padding: 14px;
  background: #2e7d32;
  color: #fff;
  border: none;
  border-radius: 2px;
  font-size: 14px;
  letter-spacing: 0.14em;
  cursor: pointer;
  text-transform: uppercase;
  transition: opacity 0.2s;
}
.dl-btn:hover { opacity: 0.82; }

/* 評分中的按鈕 loading 狀態 */
.mini-btn.scoring {
  opacity: 0.6;
  pointer-events: none;
}
.mini-btn.scoring svg { animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ====== 整體總評卡片（拼圖下方主畫面）====== */
.overall-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 14px;
  padding: 16px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
  animation: overallIn 0.3s ease;
}
@keyframes overallIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
.overall-main {
  display: flex;
  align-items: center;
  gap: 14px;
}
.overall-score-box {
  flex: 0 0 auto;
  display: flex;
  align-items: baseline;
  gap: 2px;
}
.overall-score {
  font-size: 40px;
  font-weight: 800;
  line-height: 1;
  color: #111;
  letter-spacing: -0.02em;
}
.overall-score-unit {
  font-size: 14px;
  color: #999;
}
.overall-comment {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  line-height: 1.6;
  color: #444;
}
.overall-detail-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 100%;
  padding: 11px;
  background: transparent;
  color: #555;
  border: 1.5px solid #ddd;
  border-radius: 8px;
  font-size: 13px;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: all 0.2s;
}
.overall-detail-btn:hover { background: #f0ede8; border-color: #bbb; color: #111; }
.overall-detail-btn svg { flex: 0 0 auto; }

/* 小螢幕：分數與總評若太擠，允許總評換行不擠壓分數 */
@media (max-width: 360px) {
  .overall-score { font-size: 34px; }
  .overall-comment { font-size: 12px; }
}

/* ====== FOOTER ====== */
.site-footer {
  text-align: center;
  padding: 20px 20px 32px;
  font-size: 11px;
  color: #bbb;
  letter-spacing: 0.04em;
  line-height: 1.6;
}

/* ====== TOAST ====== */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  background: #333;
  color: #fff;
  padding: 10px 22px;
  border-radius: 24px;
  font-size: 13px;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
  z-index: 999;
  white-space: nowrap;
}
.toast.show { opacity: 1; }

/* ====== NAV / HEADER 連結化（三頁獨立 URL） ====== */
.site-title-link {
  display: block;
  text-decoration: none;
  color: inherit;
}
.site-title { display: block; }
.site-sub { display: block; }
.nav .nav-btn {
  display: block;
  text-align: center;
  text-decoration: none;
  line-height: inherit;
}

/* ====== 關於頁 / 顏色詳情 共用排版 ====== */
.about-page { padding-bottom: 8px; }

.about-section,
.color-detail,
.color-index {
  max-width: 680px;
  margin: 0 auto;
  padding: 30px 22px 4px;
}
.color-detail,
.color-index {
  border-top: 1px solid #e5e1d8;
  margin-top: 30px;
}

.about-section h1,
.color-detail h2,
.color-index h2 {
  font-size: 19px;
  font-weight: 700;
  color: #1a1a1a;
  letter-spacing: 0.02em;
  line-height: 1.45;
  margin-bottom: 12px;
}
.about-section h2,
.color-detail h3 {
  font-size: 15px;
  font-weight: 700;
  color: #1a1a1a;
  margin: 26px 0 8px;
}
.about-section p,
.about-section li,
.color-detail p,
.color-index-lead {
  font-size: 13.5px;
  line-height: 1.85;
  color: #55504a;
  letter-spacing: 0.01em;
}
.about-section p + p,
.color-detail p + p { margin-top: 10px; }
.about-section ol { margin: 10px 0 0 1.15em; }
.about-section li { margin-bottom: 7px; }
.about-section li::marker { color: #a09a90; }

/* 色彩數值表 */
.color-values {
  width: 100%;
  border-collapse: collapse;
  margin-top: 4px;
}
.color-values th,
.color-values td {
  text-align: left;
  padding: 8px 0;
  font-size: 13px;
  border-bottom: 1px solid #eceae4;
  vertical-align: middle;
}
.color-values th {
  width: 76px;
  font-weight: 600;
  color: #8a8377;
  letter-spacing: 0.04em;
}
.color-values td { color: #33302b; }
.color-values code {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 13px;
  letter-spacing: 0.03em;
}

/* CTA 連結 */
.color-cta {
  margin: 26px 0 4px;
}
.color-cta a {
  display: inline-block;
  font-size: 13.5px;
  font-weight: 600;
  color: #1a1a1a;
  text-decoration: none;
  border-bottom: 1.5px solid #1a1a1a;
  padding-bottom: 2px;
}
.color-cta a:hover { opacity: 0.6; }

/* 顏色圖鑑格狀清單 */
.color-index-lead { margin-bottom: 16px; }
.color-grid {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
  margin: 0;
  padding: 0;
}
.color-grid a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 9px;
  background: #fff;
  border: 1px solid #eceae4;
  border-radius: 6px;
  text-decoration: none;
  transition: border-color .15s ease, transform .15s ease;
}
.color-grid a:hover {
  border-color: #c9c4b8;
  transform: translateY(-1px);
}
.cg-chip {
  width: 22px;
  height: 22px;
  border-radius: 4px;
  flex-shrink: 0;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.08);
}
.cg-name {
  font-size: 12.5px;
  font-weight: 600;
  color: #1a1a1a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cg-hex {
  margin-left: auto;
  font-family: ui-monospace, Menlo, monospace;
  font-size: 10px;
  color: #a09a90;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}

/* FAQ 摺疊 */
.about-details { border-top: 1px solid #ece8e0; }
.about-details:last-of-type { border-bottom: 1px solid #ece8e0; }
.about-details > summary {
  list-style: none;
  cursor: pointer;
  padding: 13px 26px 13px 0;
  font-size: 14px;
  font-weight: 600;
  color: #1a1a1a;
  position: relative;
  line-height: 1.5;
}
.about-details > summary::-webkit-details-marker { display: none; }
.about-details > summary::after {
  content: '';
  position: absolute;
  right: 6px;
  top: 50%;
  width: 7px;
  height: 7px;
  border-right: 2px solid #a09a90;
  border-bottom: 2px solid #a09a90;
  transform: translateY(-70%) rotate(45deg);
  transition: transform .2s ease;
}
.about-details[open] > summary::after { transform: translateY(-30%) rotate(-135deg); }
.about-details > div { padding: 0 0 14px; }
/* ====== 相似色摺疊區（顏色頁） ====== */
.similar-details {
  margin-top: 22px;
  border-top: 1px solid #ece8e0;
  border-bottom: 1px solid #ece8e0;
}
.similar-details > div { padding-bottom: 4px; }
.similar-details .color-grid {
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  margin-bottom: 12px;
}

/* ====== 關於頁的色彩圖鑑 ====== */
.gallery-note {
  font-size: 12.5px !important;
  color: #8a8377 !important;
  margin-top: 6px;
}
.gallery-grid { margin-top: 14px; }

/* ====== 色彩數值：每列複製鈕 ====== */
.color-values td.cv-act {
  width: 34px;
  text-align: right;
  padding-right: 0;
}
.copy-val {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid #e2ded5;
  border-radius: 6px;
  background: #fff;
  color: #a09a90;
  cursor: pointer;
  transition: color .15s ease, border-color .15s ease, background .15s ease;
  -webkit-tap-highlight-color: transparent;
}
.copy-val:hover {
  color: #55504a;
  border-color: #c9c4b8;
}
.copy-val:active { background: #f5f3ef; }
.copy-val:focus-visible {
  outline: 2px solid #55504a;
  outline-offset: 2px;
}

/* 複製成功 → 打勾 */
.copy-val.ok {
  color: #2e8b57;
  border-color: #2e8b57;
  background: #fff;
}
.copy-val.ok svg { display: none; }
.copy-val.ok::after {
  content: '';
  width: 5px;
  height: 9px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translate(-1px, -1px);
}
.copy-val.fail {
  color: #c94b4b;
  border-color: #c94b4b;
}

/* ====== 關於頁：跳至圖鑑的錨點連結 ====== */
.jump-link { margin-top: 16px; }
.jump-link a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 600;
  color: #1a1a1a;
  text-decoration: none;
  padding: 8px 15px;
  border-radius: 20px;
  /* 彩虹漸層框線：與 .site-header::before 同一組色
     border 透明 + 兩層 background，內層填底色、外層透出漸層當邊框 */
  border: 2.5px solid transparent;
  background-image:
    linear-gradient(#fff, #fff),
    linear-gradient(95deg,
      #E84545 -4%, #E8A800 15%, #7CB518 32%,
      #00827F 50%, #2851A3 67%, #7B5EA7 84%, #C21E56 104%);
  background-origin: border-box;
  -webkit-background-clip: padding-box, border-box;
  background-clip: padding-box, border-box;
  transition: transform .15s ease, box-shadow .15s ease;
}
.jump-link a:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 12px rgba(0,0,0,.10);
}
.jump-link a:active { transform: translateY(0); }
.jump-link .jl-arrow {
  transition: transform .15s ease;
}
.jump-link a:hover .jl-arrow { transform: translateY(2px); }
/* 錨點跳轉時，避開固定在頂端的 header + nav */
#gallery { scroll-margin-top: 130px; }

/* ====== 分享按鈕（次要動作，與上排的複製／儲存做區別） ====== */
.share-btn {
  border-color: #cfcabf;
  color: #6b665e;
}
.share-btn:hover {
  border-color: #333;
  color: #333;
}
