
:root{
  --bg:#f5f6f2;--card:#fff;--text:#17202a;--muted:#667085;--line:#e7e8e4;
  --soft:#eef6f5;--brand:#4b9e91;--brand2:#467ca2;--shadow:0 10px 32px rgba(31,41,55,.07);
  --radius:20px;
}
*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{margin:0;font-family:"Noto Sans TC","Microsoft JhengHei",system-ui,-apple-system,sans-serif;background:var(--bg);color:var(--text)}
a{color:inherit}
button,input,select{font:inherit}
button{cursor:pointer}
.wrap{
  max-width:1240px;
  margin-left:auto;
  margin-right:auto;
  padding-left:18px;
  padding-right:18px;
}
.topbar{position:sticky;top:0;z-index:30;background:rgba(245,246,242,.88);backdrop-filter:blur(14px);border-bottom:1px solid rgba(231,232,228,.85)}
.topbar .inner{max-width:1240px;margin:auto;padding:12px 18px;display:flex;align-items:center;justify-content:space-between;gap:14px}
.brand{display:flex;align-items:center;gap:10px;font-weight:900;text-decoration:none}
.logo{width:34px;height:34px;border-radius:10px;background:conic-gradient(from 45deg,#dcefa8,#59b7c2,#5c98cc,#be8fa1,#f2c29b,#fff3a8,#dcefa8);box-shadow:inset 0 0 0 3px #fff}
.nav{display:flex;gap:16px;font-size:14px;color:#475467}
.nav a{text-decoration:none}
.topbar-actions{display:flex;align-items:center;gap:18px}
.workkit-back{
  color:#7b817c;
  font-size:12px;
  font-weight:700;
  text-decoration:none;
  white-space:nowrap;
}
.workkit-back:hover{color:#4d6f63}
.hero{padding:44px 0 20px}
.hero-grid{display:grid;grid-template-columns:1.15fr .85fr;gap:22px;align-items:stretch}
.hero-card,.panel,.adbox{background:var(--card);border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow)}
.hero-card{padding:30px}
.kicker{font-size:13px;color:#2f6f67;background:#e9f5f2;border:1px solid #d5ebe5;padding:6px 10px;border-radius:999px;display:inline-block;font-weight:700}
h1{font-size:clamp(32px,5vw,58px);line-height:1.05;margin:14px 0 14px;letter-spacing:-.04em}
.hero p{color:var(--muted);font-size:16px;margin:0 0 20px}
.searchbar{display:flex;gap:10px}
.searchbar input{flex:1;min-width:0;padding:14px 16px;border:1px solid var(--line);border-radius:14px;background:#fbfcfb}
.primary{border:0;border-radius:14px;padding:13px 17px;background:linear-gradient(135deg,var(--brand),var(--brand2));color:#fff;font-weight:800}
.secondary{border:1px solid var(--line);border-radius:12px;padding:10px 12px;background:#f7f8f6;color:#334155;font-weight:700}
.hero-preview{padding:22px;display:flex;flex-direction:column;gap:16px}
.preview-swatch{flex:1;min-height:180px;border-radius:16px;background:#5dbca8;box-shadow:inset 0 0 0 1px rgba(0,0,0,.08)}
.preview-code{display:flex;justify-content:space-between;gap:14px;align-items:center}
.preview-code strong{font-size:24px}
.preview-code span{color:var(--muted);font-size:13px}
.adbox{margin:18px 0;padding:16px;min-height:94px;display:flex;align-items:center;justify-content:center;color:#98a2b3;background:linear-gradient(180deg,#fafafa,#f7f7f7);font-size:13px}
.main-grid{display:grid;grid-template-columns:.95fr 1.05fr;gap:20px;margin:20px 0}
.panel{padding:22px}
.panel h2{margin:0 0 6px;font-size:23px}
.panel .sub{margin:0 0 18px;color:var(--muted);font-size:14px}
.picker-layout{display:grid;grid-template-columns:150px 1fr;gap:18px}
.big-picker{position:relative}
.big-picker input[type=color]{width:150px;height:150px;border:0;padding:0;background:transparent;border-radius:18px;overflow:hidden;cursor:pointer}
.big-picker input[type=color]::-webkit-color-swatch-wrapper{padding:0}
.big-picker input[type=color]::-webkit-color-swatch{border:0;border-radius:18px}
.fields{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.field label{display:block;font-size:12px;color:var(--muted);margin-bottom:5px}
.field input{width:100%;padding:11px 12px;border:1px solid var(--line);border-radius:11px}
.slider-row{display:grid;grid-template-columns:24px 1fr 68px;gap:9px;align-items:center;margin:10px 0}
.slider-row input[type=range]{width:100%}
.slider-row input[type=number]{width:68px;padding:8px;border:1px solid var(--line);border-radius:9px}
.results{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.resultbox{padding:13px;border:1px solid var(--line);border-radius:14px;background:#fafbfa}
.resultbox .label{font-size:11px;color:var(--muted);text-transform:uppercase}
.resultbox .value{font-weight:800;margin-top:4px;word-break:break-all}
.nearest{margin-top:12px;padding:12px 14px;background:#eff7f5;border:1px solid #d8ebe6;border-radius:13px;font-size:14px}
.harmonies{display:grid;gap:14px}
.harmony{border:1px solid var(--line);border-radius:16px;overflow:hidden}
.harmony-title{padding:10px 12px;font-weight:800;font-size:14px;background:#fafbfa}
.harmony-swatches{display:flex;height:78px}
.harmony-swatches button{flex:1;border:0;position:relative}
.harmony-swatches button span{position:absolute;bottom:6px;left:7px;background:rgba(255,255,255,.82);padding:3px 5px;border-radius:6px;font-size:10px}
.section{margin:30px 0}
.section-head{display:flex;align-items:end;justify-content:space-between;gap:16px;margin-bottom:14px}
.section-head h2{margin:0;font-size:27px}
.section-head p{margin:5px 0 0;color:var(--muted);font-size:14px}
.filters{display:flex;gap:8px;flex-wrap:wrap;margin:12px 0 16px}
.filter{border:1px solid var(--line);background:#fff;border-radius:999px;padding:8px 12px;font-size:13px}
.filter.active{background:#1f2937;color:white;border-color:#1f2937}
.cards{display:grid;grid-template-columns:repeat(4,1fr);gap:14px}
.color-card{border:1px solid var(--line);border-radius:17px;background:#fff;overflow:hidden;box-shadow:0 5px 18px rgba(31,41,55,.045)}
.color-card .swatch{height:108px;border:0;width:100%;display:block}
.color-card .body{padding:12px}
.color-card .names{display:flex;justify-content:space-between;gap:8px}
.color-card .zh{font-weight:900}
.color-card .en{font-size:11px;color:var(--muted);text-align:right}
.color-card code{display:inline-block;margin-top:8px;background:#f4f5f3;padding:4px 7px;border-radius:7px;font-size:12px}
.card-actions{display:flex;gap:7px;margin-top:10px}
.card-actions button{font-size:12px;padding:7px 8px}
.more-wrap{text-align:center;margin-top:18px}
.info-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:14px}
.info-card{background:#fff;border:1px solid var(--line);border-radius:17px;padding:18px}
.info-card h3{margin:0 0 8px}
.info-card p{margin:0;color:var(--muted);font-size:14px}
.footer{margin-top:42px;border-top:1px solid var(--line);padding:28px 0 42px;color:var(--muted);font-size:13px}
.footer-inner{display:flex;justify-content:space-between;gap:20px;flex-wrap:wrap}
.toast{position:fixed;right:18px;bottom:18px;background:#111827;color:#fff;padding:11px 14px;border-radius:12px;opacity:0;transform:translateY(10px);transition:.2s;pointer-events:none;z-index:99}
.toast.show{opacity:1;transform:none}
@media (max-width:900px){
  .hero-grid,.main-grid{grid-template-columns:1fr}
  .cards{grid-template-columns:repeat(3,1fr)}
  .hero-preview{min-height:280px}
}
@media (max-width:660px){
  .nav{display:none}
  .topbar-actions{gap:0}
  .workkit-back{font-size:11px}
  .hero{padding-top:24px}
  .hero-card{padding:22px}
  .searchbar{flex-direction:column}
  .picker-layout{grid-template-columns:1fr}
  .big-picker input[type=color]{width:100%;height:120px}
  .fields,.results{grid-template-columns:1fr 1fr}
  .cards{grid-template-columns:repeat(2,1fr)}
  .info-grid{grid-template-columns:1fr}
  .section-head{align-items:start;flex-direction:column}
}
@media (max-width:420px){
  .fields,.results{grid-template-columns:1fr}
  .cards{grid-template-columns:1fr 1fr}
  .color-card .swatch{height:88px}
  .color-card .en{display:none}
}


/* ===== MuMing refined UI ===== */
:root{
  --bg:#F7F7F4;
  --card:#FFFFFF;
  --text:#202421;
  --muted:#7B817C;
  --line:#E8E9E5;
  --brand:#6F8D80;
  --brand2:#7896A7;
  --shadow:0 6px 22px rgba(32,36,33,.045);
  --radius:16px;
}

body{
  letter-spacing:.01em;
}

.topbar{
  background:rgba(247,247,244,.94);
}

.topbar .inner{
  padding-top:10px;
  padding-bottom:10px;
}

.brand{
  font-size:16px;
  letter-spacing:.04em;
}

.logo{
  width:28px;
  height:28px;
  border-radius:8px;
  box-shadow:inset 0 0 0 2px #fff;
}

.hero{
  padding:28px 0 12px;
}

.hero-grid{
  grid-template-columns:1.35fr .65fr;
  gap:16px;
}

.hero-card{
  padding:24px;
  border-radius:18px;
  box-shadow:none;
}

.hero h1{
  font-size:clamp(30px,4vw,46px);
  margin:12px 0 10px;
  line-height:1.08;
}

.hero p{
  font-size:14px;
  max-width:720px;
  margin-bottom:16px;
}

.hero-preview{
  padding:16px;
  min-height:220px;
}

.preview-swatch{
  min-height:118px;
  border-radius:12px;
}

.preview-code strong{
  font-size:20px;
}

.adbox{
  min-height:70px;
  margin:14px 0;
  border-radius:14px;
  box-shadow:none;
}

.main-grid{
  gap:16px;
  margin:16px 0;
}

.panel{
  border-radius:16px;
  padding:18px;
  box-shadow:none;
}

.panel h2{
  font-size:20px;
}

.picker-layout{
  grid-template-columns:112px 1fr;
  gap:15px;
}

.big-picker input[type=color]{
  width:112px;
  height:112px;
  border-radius:14px;
}

.results{
  gap:8px;
}

.resultbox{
  padding:10px 12px;
  border-radius:11px;
}

.harmonies{
  gap:10px;
}

.harmony{
  border-radius:12px;
}

.harmony-title{
  padding:8px 10px;
  font-size:12px;
}

.harmony-swatches{
  height:56px;
}

.section{
  margin:24px 0;
}

.section-head h2{
  font-size:22px;
}

.filters{
  gap:6px;
  margin:10px 0 14px;
}

.filter{
  padding:6px 10px;
  font-size:12px;
}

/* Dense, elegant color library */
.cards{
  grid-template-columns:repeat(6,1fr);
  gap:10px;
}

.color-card{
  border-radius:13px;
  box-shadow:none;
  transition:transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}

.color-card:hover{
  transform:translateY(-2px);
  box-shadow:0 8px 20px rgba(31,41,55,.07);
  border-color:#D9DCD7;
}

.color-card .swatch{
  height:66px;
}

.color-card .body{
  padding:9px 10px 10px;
}

.color-card .names{
  display:block;
}

.color-card .zh{
  font-size:13px;
  line-height:1.3;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.color-card .en{
  margin-top:2px;
  text-align:left;
  font-size:9px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.color-card code{
  margin-top:6px;
  padding:2px 5px;
  font-size:10px;
  border-radius:5px;
}

.card-actions{
  margin-top:7px;
  gap:5px;
}

.card-actions button{
  padding:5px 6px;
  font-size:10px;
  border-radius:7px;
}

.info-grid{
  gap:10px;
}

.info-card{
  padding:14px;
  border-radius:14px;
}

.footer{
  margin-top:30px;
  padding-top:22px;
}

@media (max-width:1100px){
  .cards{grid-template-columns:repeat(5,1fr);}
}

@media (max-width:900px){
  .hero-grid{grid-template-columns:1fr;}
  .hero-preview{display:grid;grid-template-columns:1fr auto;align-items:center;min-height:auto}
  .preview-swatch{min-height:100px}
  .cards{grid-template-columns:repeat(4,1fr);}
}

@media (max-width:660px){
  .hero{padding-top:18px}
  .hero-card{padding:18px}
  .hero h1{font-size:30px}
  .picker-layout{grid-template-columns:1fr}
  .big-picker input[type=color]{width:100%;height:90px}
  .cards{grid-template-columns:repeat(3,1fr);gap:8px}
  .color-card .swatch{height:58px}
  .color-card .body{padding:8px}
  .card-actions{display:grid;grid-template-columns:1fr}
  .card-actions button:nth-child(2){display:none}
}

@media (max-width:420px){
  .cards{grid-template-columns:repeat(3,1fr)}
  .color-card .swatch{height:52px}
  .color-card .zh{font-size:12px}
}


/* ===== V1.2 compact-first UX ===== */
.compact-first{padding-top:22px}
.compact-picker-panel{padding:18px 20px}
.compact-picker-head{
  display:flex;justify-content:space-between;gap:18px;align-items:center;margin-bottom:16px
}
.compact-title{
  font-size:clamp(25px,3.2vw,38px);
  margin:10px 0 6px;
  letter-spacing:-.035em;
  line-height:1.08
}
.compact-current{display:flex;align-items:center;gap:12px;min-width:180px}
.compact-current input[type=color]{
  width:62px;height:62px;border:0;padding:0;background:transparent;border-radius:14px;overflow:hidden;cursor:pointer
}
.compact-current input[type=color]::-webkit-color-swatch-wrapper{padding:0}
.compact-current input[type=color]::-webkit-color-swatch{border:0;border-radius:14px}
.compact-current strong{display:block;font-size:19px}
.compact-current span{display:block;color:var(--muted);font-size:12px;margin-top:2px}

.compact-controls{
  display:grid;
  grid-template-columns:1.05fr 1.3fr 1.3fr 1.3fr;
  gap:10px;
  align-items:end
}
.compact-hex .input-copy{display:grid;grid-template-columns:1fr auto;gap:6px}
.compact-hex input{height:42px}
.icon-copy,.mini-copy{
  border:1px solid var(--line);background:#f7f8f6;color:#344054;border-radius:9px;font-weight:800
}
.icon-copy{padding:0 11px}
.rgb-control{
  display:grid;grid-template-columns:20px 1fr 108px;gap:8px;align-items:center
}
.channel-label{font-weight:900;font-size:15px;text-align:center}
.rgb-control input[type=range]{width:100%}
.number-copy{display:grid;grid-template-columns:54px 48px;gap:5px}
.number-copy input{min-width:0;width:54px;padding:8px;border:1px solid var(--line);border-radius:9px}
.mini-copy{padding:0 5px;font-size:11px}

.compact-results{
  display:grid;grid-template-columns:repeat(4,1fr);gap:8px;margin-top:14px
}
.result-chip{
  text-align:left;border:1px solid var(--line);background:#fbfbfa;border-radius:12px;padding:10px 12px;color:var(--text)
}
button.result-chip{cursor:pointer}
button.result-chip:hover{background:#f4f7f5;border-color:#d8e0dc}
.result-chip span{display:block;color:var(--muted);font-size:10px;text-transform:uppercase;letter-spacing:.05em}
.result-chip strong{display:block;font-size:16px;margin-top:3px}
.result-chip small{display:block;color:#98a2b3;font-size:9px;margin-top:2px}
.result-chip.static{cursor:default}
.compact-nearest{margin-top:9px;padding:9px 11px;font-size:12px}

.lower-hero{padding:18px 0 10px}
.search-title{font-size:28px;margin:9px 0 8px;letter-spacing:-.03em}
.lower-hero .hero-card{min-height:0}
.lower-hero .hero-preview{min-height:190px}
.lower-hero .preview-swatch{min-height:92px}

/* Harmony cards: preserve style, add RGB copy details */
.harmony-swatches{
  height:auto;
  min-height:72px
}
.harmony-swatches button{
  min-height:72px;
  padding:0;
  display:flex;
  align-items:flex-end;
  justify-content:flex-start
}
.harmony-color-meta{
  width:100%;
  background:rgba(255,255,255,.88);
  backdrop-filter:blur(3px);
  padding:5px 6px;
  text-align:left;
  line-height:1.2
}
.harmony-color-meta b{display:block;font-size:10px}
.harmony-color-meta em{display:block;font-size:9px;font-style:normal;color:#667085;margin-top:2px}
.harmony-color-meta i{display:inline-block;font-size:8px;font-style:normal;color:#98a2b3;margin-top:2px}
.harmony-swatches button:hover .harmony-color-meta{background:rgba(255,255,255,.96)}

@media(max-width:1000px){
  .compact-controls{grid-template-columns:1fr 1fr}
  .compact-hex{grid-column:1/-1}
}
@media(max-width:700px){
  .compact-picker-head{align-items:flex-start}
  .compact-current{min-width:0}
  .compact-current input[type=color]{width:54px;height:54px}
  .compact-controls{grid-template-columns:1fr}
  .compact-hex{grid-column:auto}
  .rgb-control{grid-template-columns:20px 1fr 105px}
  .compact-results{grid-template-columns:1fr 1fr}
  .lower-hero .hero-preview{display:none}
}
@media(max-width:420px){
  .compact-picker-panel{padding:15px}
  .compact-picker-head{display:block}
  .compact-current{margin-top:12px}
  .compact-results{grid-template-columns:1fr 1fr}
  .result-chip strong{font-size:14px}
}


/* ===== V1.3 clearer search + individual RGB copy ===== */

.search-only-card{
  display:grid;
  grid-template-columns:minmax(260px,.8fr) minmax(420px,1.2fr);
  gap:22px;
  align-items:end;
  padding:20px 22px;
}
.search-only-copy .search-title{
  margin-bottom:6px;
}
.search-only-copy p{
  margin:0;
}
.searchbar-wide{
  width:100%;
}
.searchbar-wide input{
  min-height:48px;
}

/* Recommended palettes */
.harmony-swatches{
  display:flex;
  min-height:108px;
  height:auto;
}
.harmony-color{
  flex:1;
  min-width:0;
  border:0;
  padding:0;
  display:flex;
  align-items:flex-end;
  cursor:pointer;
  position:relative;
}
.harmony-color-meta{
  width:100%;
  background:rgba(255,255,255,.93);
  backdrop-filter:blur(4px);
  padding:8px 9px 9px;
  text-align:left;
}
.harmony-hex-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:6px;
}
.harmony-hex-row b{
  font-size:11px;
  color:#26312d;
}
.harmony-hex-row span{
  font-size:8px;
  color:#98a2b3;
  white-space:nowrap;
}
.rgb-chips{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:4px;
  margin-top:6px;
}
.rgb-chip{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:3px;
  min-width:0;
  padding:4px 3px;
  background:#f7f8f7;
  border:1px solid #e7e9e6;
  border-radius:6px;
  cursor:pointer;
  user-select:none;
  transition:background .12s ease,border-color .12s ease;
}
.rgb-chip:hover{
  background:#edf4f1;
  border-color:#d4e2dd;
}
.rgb-chip i{
  font-style:normal;
  font-size:8px;
  color:#7d8782;
}
.rgb-chip strong{
  font-size:9px;
  color:#26312d;
  overflow:hidden;
  text-overflow:ellipsis;
}
.harmony-color:hover .harmony-color-meta{
  background:rgba(255,255,255,.98);
}

@media(max-width:800px){
  .search-only-card{
    grid-template-columns:1fr;
    gap:14px;
  }
}
@media(max-width:620px){
  .harmony-swatches{
    overflow-x:auto;
    scroll-snap-type:x proximity;
  }
  .harmony-color{
    min-width:145px;
    scroll-snap-align:start;
  }
}


/* ===== V1.4 harmony card cleanup ===== */

/* remove the previous "button contains metadata" layout */
.harmony{
  overflow:hidden;
  border-radius:14px;
  background:#fff;
}
.harmony-title{
  padding:10px 13px;
  font-size:13px;
  font-weight:900;
  background:#fbfbfa;
  border-bottom:1px solid var(--line);
}

.harmony-grid{
  display:grid;
  grid-template-columns:repeat(var(--harmony-count, 3), minmax(0,1fr));
  width:100%;
}

/* Make each actual child occupy an equal fraction regardless of count */
.harmony-grid{
  grid-template-columns:repeat(auto-fit,minmax(150px,1fr));
}

.harmony-color-card{
  min-width:0;
  background:#fff;
  border-right:1px solid var(--line);
}
.harmony-color-card:last-child{
  border-right:0;
}

.harmony-swatch{
  display:block;
  width:100%;
  height:74px;
  border:0;
  padding:0;
  cursor:pointer;
  transition:filter .15s ease;
}
.harmony-swatch:hover{
  filter:brightness(.97);
}

.harmony-info{
  padding:8px 9px 9px;
  background:#fff;
}

.harmony-hex{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  margin-bottom:7px;
}
.harmony-hex strong{
  font-size:12px;
  letter-spacing:.015em;
}
.text-copy{
  border:0;
  background:transparent;
  color:#8a938e;
  padding:2px 0;
  font-size:9px;
  font-weight:700;
}
.text-copy:hover{
  color:#4d6f63;
}

.rgb-copy-row{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:5px;
}
.rgb-copy-btn{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:4px;
  min-width:0;
  height:30px;
  padding:0 5px;
  border:1px solid #e4e7e4;
  border-radius:8px;
  background:#f7f8f7;
  color:#2b332f;
}
.rgb-copy-btn span{
  font-size:9px;
  color:#7d8782;
  font-weight:800;
}
.rgb-copy-btn strong{
  font-size:11px;
}
.rgb-copy-btn:hover{
  background:#edf5f1;
  border-color:#cfe0d8;
}
.rgb-copy-btn:active{
  transform:translateY(1px);
}

/* Delete visual impact from old harmony styles */
.harmony-swatches,
.harmony-color-meta,
.harmony-hex-row,
.rgb-chips,
.rgb-chip{
  all:unset;
}

@media(max-width:720px){
  .harmony-grid{
    display:flex;
    overflow-x:auto;
    scroll-snap-type:x proximity;
  }
  .harmony-color-card{
    flex:0 0 165px;
    scroll-snap-align:start;
  }
  .harmony-swatch{
    height:64px;
  }
}
