:root {
  /* 中国传统色 —— palette */
  --c-zhusha: #FF461F;   /* 朱砂 */
  --c-yanzhi: #9D2933;   /* 胭脂 */
  --c-yinzhu: #E34D59;   /* 银朱 */
  --c-zaohong: #7C1823;  /* 枣红 */
  --c-ehuang: #FFF143;   /* 鹅黄 */
  --c-tenghuang: #FFBF37;/* 藤黄 */
  --c-qiuxiang: #D9B611; /* 秋香 */
  --c-zhuqing: #789262;  /* 竹青 */
  --c-shilv: #57C3C2;    /* 石绿 */
  --c-doulv: #A7C080;    /* 豆绿 */
  --c-dailan: #4A4266;   /* 黛蓝 */
  --c-yuebai: #D6ECF0;   /* 月白 */
  --c-tianqing: #B0D8E0; /* 天青 */
  --c-dianqing: #177CB0; /* 靛青 */
  --c-ouhe: #E4C6D0;     /* 藕荷 */
  --c-dingxiang: #CCA4E3;/* 丁香 */
  --c-mose: #161823;     /* 墨色 */
  --c-xuan: #3E3A39;     /* 玄 */
  --c-su: #F5F2E9;       /* 素 / 宣纸 */

  /* 角色 */
  --ink: #161823;
  --paper: #F5F2E9;
  --accent: #FF461F;
  --heading: #4A4266;
  --muted: #6b6b72;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Georgia, "Songti SC", "SimSun", serif;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.6;
}

/* 导航 */
nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1.5rem;
  background: var(--ink);
  color: var(--paper);
}
nav .brand {
  font-weight: bold;
  color: var(--paper);
  text-decoration: none;
}
nav .links a {
  color: var(--paper);
  text-decoration: none;
  margin-left: 1rem;
  opacity: 0.85;
}
nav .links a:hover {
  opacity: 1;
  color: var(--c-ehuang);
}

/* 主内容 */
main {
  max-width: 960px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

h1, h2, h3 { color: var(--heading); }

/* 色板墙 */
.wall {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.75rem;
}
.hue-group {
  margin-bottom: 2rem;
}
.hue-group h2 {
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  padding-bottom: 0.25rem;
}
.swatch {
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 6px;
  overflow: hidden;
}
.swatch .chip { height: 96px; }
.swatch .meta {
  padding: 0.5rem 0.6rem;
  background: #fff;
}
.swatch .name { font-weight: bold; }
.swatch .english { font-style: italic; color: var(--heading); }
.swatch .pinyin { color: var(--muted); font-size: 0.85rem; }
.swatch .hex {
  font-family: ui-monospace, monospace;
  font-size: 0.8rem;
  color: var(--muted);
}
.swatch .note {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 0.25rem;
}
.swatch[data-hex] {
  position: relative;
  cursor: pointer;
}

/* 故事页 */
.story {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 6px;
}
.story-swatch {
  width: 96px;
  height: 96px;
  border-radius: 6px;
  flex-shrink: 0;
}
.story-body h2 {
  margin: 0 0 0.25rem;
}
.story .pinyin {
  font-weight: normal;
  font-size: 0.9rem;
  color: var(--muted);
}
.story .hex {
  font-family: ui-monospace, monospace;
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 0.5rem;
}
.story p {
  margin: 0;
}

/* 色系筛选 */
.filter {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}
.filter-btn {
  padding: 0.35em 0.9em;
  font: inherit;
  border: 1px solid rgba(0, 0, 0, 0.15);
  background: #fff;
  border-radius: 99px;
  cursor: pointer;
}
.filter-btn.active {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

/* 关于页 */
#sources li {
  margin-bottom: 0.75rem;
}
#sources .note {
  color: var(--muted);
  font-size: 0.9rem;
}

/* 颜色详情弹窗 */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
}
.modal-backdrop.open {
  display: flex;
}
.modal {
  background: #fff;
  border-radius: 10px;
  padding: 1.5rem;
  max-width: 360px;
  width: 90%;
  position: relative;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}
.modal-close {
  position: absolute;
  top: 0.5rem;
  right: 0.75rem;
  font-size: 1.5rem;
  background: none;
  border: none;
  cursor: pointer;
}
.modal-swatch {
  height: 120px;
  border-radius: 8px;
  margin-bottom: 1rem;
}
.modal-english {
  font-style: italic;
  color: var(--heading);
}
.modal-note {
  font-style: italic;
  color: var(--muted);
}
.modal-symbolism {
  margin: 0.5rem 0 0;
}
.modal-pinyin,
.modal-hex,
.modal-rgb {
  color: var(--muted);
  font-size: 0.9rem;
}
.modal-copy {
  margin-top: 1rem;
  padding: 0.5em 1.2em;
  font: inherit;
  background: var(--ink);
  color: var(--paper);
  border: none;
  border-radius: 99px;
  cursor: pointer;
}

/* 页脚 */
footer {
  text-align: center;
  padding: 1.5rem;
  color: var(--muted);
  font-size: 0.9rem;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}
