.palette-page { min-height: 100vh; background: #eeece7; }
.topbar nav a.is-active { color: #f3c62d; }
.palette-main { width: min(1500px, calc(100% - 64px)); margin: 0 auto; padding: 58px 0 70px; }
.palette-heading { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 40px; padding-bottom: 38px; border-bottom: 1px solid #bbb8b0; }
.palette-heading h1 { margin: 0; font: 700 clamp(3.5rem, 7vw, 7.6rem)/.8 "Noto Sans TC", sans-serif; letter-spacing: 0; }
.palette-heading h1 span { color: #087d91; }
.palette-summary { display: grid; justify-items: end; padding-bottom: 4px; }
.palette-summary strong { font: 700 3rem/1 "Space Grotesk", sans-serif; }
.palette-summary span { margin: 5px 0 18px; color: #6d7074; font-size: .76rem; }
.palette-summary a { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; padding: 0 16px; color: #fff; background: #17191d; font-size: .78rem; font-weight: 800; }
.palette-toolbar { display: flex; align-items: end; gap: 8px; padding: 22px 0; }
.palette-toolbar label { display: grid; flex: 1; max-width: 520px; gap: 6px; color: #666a70; font-size: .68rem; font-weight: 700; }
.palette-toolbar input { height: 42px; padding: 0 13px; color: #17191d; background: #fff; border: 1px solid #c8c5be; border-radius: 0; outline: none; }
.palette-toolbar input:focus { border-color: #087d91; box-shadow: 0 0 0 3px rgba(0,169,198,.12); }
.palette-toolbar button { min-height: 42px; padding: 0 14px; color: #17191d; background: transparent; border: 1px solid #aaa79f; font-size: .74rem; font-weight: 800; }
.archive-layout { display: grid; grid-template-columns: minmax(330px, .72fr) minmax(580px, 1.28fr); min-height: 690px; background: #fff; border: 1px solid #c8c5be; box-shadow: 0 18px 54px rgba(30,31,34,.08); }
.record-browser { min-width: 0; padding: 14px; background: #f6f5f1; border-right: 1px solid #d1cec7; }
.record-list { display: grid; gap: 8px; }
.record-card { display: grid; grid-template-columns: 112px minmax(0, 1fr); min-height: 116px; padding: 0; overflow: hidden; color: #17191d; background: #fff; border: 1px solid #d5d2cb; text-align: left; }
.record-card:hover, .record-card:focus-visible, .record-card.is-active { border-color: #17191d; box-shadow: inset 4px 0 0 #f3c62d; outline: none; }
.record-card img { width: 112px; height: 100%; object-fit: cover; background: #ddd; }
.record-card-copy { display: grid; align-content: center; min-width: 0; padding: 12px 14px; }
.record-card-copy small { color: #85888c; font-size: .62rem; }
.record-card-copy strong { margin: 4px 0 7px; overflow: hidden; font-size: .88rem; text-overflow: ellipsis; white-space: nowrap; }
.record-card-meta { display: flex; align-items: center; gap: 7px; color: #5c6065; font: 700 .69rem "Space Grotesk", sans-serif; }
.record-card-meta i { width: 13px; height: 13px; background: var(--record-color); border: 1px solid rgba(0,0,0,.2); }
.record-empty { padding: 56px 24px; text-align: center; }
.record-empty strong { font-size: 1.2rem; }
.record-empty p { color: #74777b; font-size: .8rem; line-height: 1.65; }
.record-empty a { color: #087d91; font-size: .8rem; font-weight: 800; }
.record-detail { min-width: 0; padding: clamp(26px, 4vw, 56px); color: #fff; background: #25282e; }
.detail-placeholder { display: grid; place-content: center; min-height: 570px; color: #a3a7ae; text-align: center; }
.detail-placeholder span { color: #f3c62d; font: 700 4rem/1 "Space Grotesk", sans-serif; }
.detail-placeholder h2 { margin: 14px 0 6px; color: #fff; }
.detail-placeholder p { margin: 0; font-size: .78rem; }
.detail-top { display: grid; grid-template-columns: minmax(250px, .9fr) 1.1fr; gap: 30px; }
.detail-photo { position: relative; min-height: 270px; overflow: hidden; background: #14161a; }
.detail-photo img { width: 100%; height: 100%; min-height: 270px; object-fit: cover; }
.detail-sample { position: absolute; left: var(--sample-x); top: var(--sample-y); width: 28px; height: 28px; background: var(--sample-color); border: 2px solid #fff; border-radius: 50%; box-shadow: 0 0 0 2px #111; transform: translate(-50%, -50%); }
.detail-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.detail-header p { margin: 0; color: #9499a2; font: 600 .64rem "Space Grotesk", sans-serif; }
.detail-header h2 { margin: 6px 0 0; font-size: clamp(1.4rem, 3vw, 2.35rem); line-height: 1.18; }
.detail-swatch { display: grid; place-items: end start; flex: 0 0 92px; height: 92px; padding: 10px; color: var(--sample-text); background: var(--sample-color); font: 700 .72rem "Space Grotesk", sans-serif; }
.detail-meta { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin: 28px 0 0; }
.detail-meta div { padding-top: 10px; border-top: 1px solid #464a52; }
.detail-meta span, .direction-block > span { display: block; color: #92969e; font-size: .64rem; }
.detail-meta strong { display: block; margin-top: 3px; font-size: .78rem; }
.direction-block { margin: 30px 0; padding: 18px 20px; color: #17191d; background: #f3c62d; }
.direction-block h3 { margin: 5px 0 7px; font-size: 1.08rem; }
.direction-block p { margin: 0; color: #4c452a; font-size: .72rem; line-height: 1.65; }
.detail-table { width: 100%; }
.detail-table th, .detail-table td { border-color: #454951; }
.detail-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.detail-actions button, .detail-actions a { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 0 14px; color: #fff; background: transparent; border: 1px solid #6c717a; font-size: .74rem; font-weight: 800; }
.detail-actions .danger { margin-left: auto; color: #ffb0aa; border-color: #84504d; }
.archive-status { min-height: 28px; padding: 10px 2px 0; color: #707378; font-size: .7rem; }

@media (max-width: 980px) {
  .palette-main { width: min(100% - 28px, 1500px); padding-top: 36px; }
  .archive-layout { grid-template-columns: 1fr; }
  .record-browser { border-right: 0; border-bottom: 1px solid #d1cec7; }
  .record-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 660px) {
  .palette-main { width: 100%; padding: 28px 14px 50px; }
  .palette-heading { grid-template-columns: 1fr; gap: 28px; }
  .palette-heading h1 { font-size: 4rem; }
  .palette-summary { justify-items: start; }
  .palette-toolbar { align-items: stretch; flex-wrap: wrap; }
  .palette-toolbar label { flex-basis: 100%; max-width: none; }
  .palette-toolbar button { flex: 1; }
  .archive-layout { border-left: 0; border-right: 0; }
  .record-list { grid-template-columns: 1fr; }
  .record-card { grid-template-columns: 94px minmax(0, 1fr); }
  .record-card img { width: 94px; }
  .record-detail { padding: 24px 18px; }
  .detail-top { grid-template-columns: 1fr; }
  .detail-photo, .detail-photo img { min-height: 220px; }
  .detail-actions .danger { margin-left: 0; }
}
