/* ===== Unicode Emoji 速查表 样式（独立一份；色板与科研导航站、MassCalc、GlycoCalc 一致） =====
   本页主角是一张三千多行的编码表：
   ① 码点与 UTF-8 字节是等宽密排文本，必须 tabular-nums + 等宽字体，否则逐行对不齐；
   ② emoji 字形本身跨平台差异大，给 .glyph 一个覆盖各系统的 emoji 字体栈，字号也要够大；
   ③ 列表很长，右侧内容区独立滚动、表头吸顶，滚动到底自动续渲染（见 app.js）。 */
:root {
  --bg: #f5f6f8;
  --bg-card: #ffffff;
  --bg-hover: #f0f2f5;
  --text: #2c3e50;
  --text-sub: #7f8c9b;
  --border: #e8ebef;
  --accent: #3b82f6;
  --accent-soft: rgba(59, 130, 246, .1);
  --accent-text: #fff;
  --danger: #e2544d;
  --ok: #2f9e5f;
  --shadow: 0 2px 8px rgba(30, 40, 60, .06);
  --bar-bg: #f7f8fa;
  --code-bg: #f4f6f9;
  --tag-bg: #eef2f7;
}

html[data-theme="dark"] {
  --bg: #060a17;
  --bg-card: #0d1424;
  --bg-hover: #1a2336;
  --text: #dce3ec;
  --text-sub: #8794a8;
  --border: #1e2a44;
  --accent: #4d94ff;
  --accent-soft: rgba(77, 148, 255, .16);
  --danger: #ff6b64;
  --ok: #4ade80;
  --shadow: 0 2px 10px rgba(0, 0, 0, .5);
  --bar-bg: #0a1120;
  --code-bg: #101a30;
  --tag-bg: #16213a;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-variant-numeric: tabular-nums;
  transition: background .25s, color .25s;
}
body.modal-open { overflow: hidden; }

/* ===== 顶栏 ===== */
.topbar {
  display: flex; align-items: center; gap: 14px;
  padding: 10px 18px; background: var(--bar-bg);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 50;
}
.topbar .back { color: var(--accent); text-decoration: none; font-size: 14px; white-space: nowrap; }
.topbar .back:hover { text-decoration: underline; }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-mark { width: 34px; height: 34px; border-radius: 8px; background: var(--accent-soft); display: flex; align-items: center; justify-content: center; flex: none; }
.brand-mark img { width: 26px; height: 26px; }
.brand-text h1 { font-size: 17px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-text p { font-size: 12px; color: var(--text-sub); line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.spacer { flex: 1; }
.icon-btn {
  border: 1px solid var(--border); background: var(--bg-card); color: var(--text);
  border-radius: 8px; padding: 6px 10px; cursor: pointer; font-size: 15px; line-height: 1;
}
.icon-btn:hover { background: var(--bg-hover); }
.lang-switch { display: flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.lang-btn {
  border: none; background: var(--bg-card); color: var(--text-sub);
  padding: 6px 10px; font-size: 13px; cursor: pointer; text-decoration: none;
}
.lang-btn + .lang-btn { border-left: 1px solid var(--border); }
.lang-btn.active { background: var(--accent); color: var(--accent-text); }

/* ===== 通用控件 ===== */
.btn {
  border: 1px solid var(--border); background: var(--bg-card); color: var(--text);
  border-radius: 8px; padding: 7px 12px; font-size: 13px; cursor: pointer;
}
.btn:hover { background: var(--bg-hover); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.btn-primary:hover { filter: brightness(1.05); }
.mini {
  border: 1px solid var(--border); background: var(--bg-card); color: var(--text);
  border-radius: 6px; padding: 3px 8px; font-size: 12px; cursor: pointer; line-height: 1.5;
}
.mini:hover { background: var(--bg-hover); }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace; font-size: .92em; }

/* ===== 主体 ===== */
.emoji { max-width: 1400px; margin: 0 auto; padding: 14px 16px 4px; }

.toolbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px;
  padding: 10px 12px; box-shadow: var(--shadow); margin-bottom: 14px;
}
.search { display: flex; align-items: center; gap: 6px; flex: 1 1 320px; min-width: 240px;
  border: 1px solid var(--border); border-radius: 8px; background: var(--bg); padding: 0 8px; }
.search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.search-ico { font-size: 13px; opacity: .7; }
.search input {
  flex: 1; border: none; background: transparent; color: var(--text);
  padding: 8px 0; font-size: 14px; outline: none; min-width: 0;
}
.search input::-webkit-search-cancel-button { display: none; }
.count { font-size: 13px; color: var(--text-sub); white-space: nowrap; }

.layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 14px; align-items: start; }

/* ===== 左侧分类 ===== */
.side {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: var(--shadow); padding: 10px; position: sticky; top: 68px;
  max-height: calc(100vh - 92px); overflow: auto;
}
.side.folded { width: 44px; padding: 10px 6px; overflow: hidden; }
.side.folded .nav, .side.folded .side-head > span:first-child { display: none; }
.side-head { display: flex; align-items: center; gap: 6px; padding: 2px 4px 8px; font-size: 13px; color: var(--text-sub); }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item, .nav-sub {
  display: flex; align-items: center; gap: 8px; width: 100%; text-align: left;
  border: none; background: transparent; color: var(--text); cursor: pointer;
  border-radius: 8px; padding: 6px 8px; font-size: 13px; font-family: inherit;
}
.nav-item:hover, .nav-sub:hover { background: var(--bg-hover); }
.nav-item.active, .nav-sub.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.nav-ico { width: 20px; text-align: center; flex: none; font-size: 15px; line-height: 1; }
.nav-txt { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-n { font-size: 11px; color: var(--text-sub); flex: none; }
.nav-grp { margin-top: 2px; }
.nav-grp > summary {
  display: flex; align-items: center; gap: 8px; cursor: pointer;
  border-radius: 8px; padding: 6px 8px; font-size: 13px; font-weight: 600; list-style: none;
}
.nav-grp > summary::-webkit-details-marker { display: none; }
.nav-grp > summary::after { content: "▸"; color: var(--text-sub); font-size: 11px; transition: transform .15s; }
.nav-grp[open] > summary::after { transform: rotate(90deg); }
.nav-grp > summary:hover { background: var(--bg-hover); }
.nav-grp .nav-sub { padding-left: 30px; font-size: 12.5px; }

/* ===== 列表 ===== */
.content { min-width: 0; }
.table-wrap {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: var(--shadow); overflow: auto; max-height: calc(100vh - 200px);
}
table.data { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.data thead th {
  position: sticky; top: 0; z-index: 2;
  background: var(--bar-bg); border-bottom: 1px solid var(--border);
  text-align: left; font-size: 12px; font-weight: 600; color: var(--text-sub);
  padding: 9px 10px; white-space: nowrap;
}
table.data td { border-bottom: 1px solid var(--border); padding: 6px 10px; vertical-align: middle; }
table.data tbody tr:hover { background: var(--bg-hover); }
table.data tbody tr { cursor: pointer; }
.col-emoji { width: 62px; text-align: center; }
.col-cp { width: 190px; }
.col-utf8 { width: 230px; }
/* 名称列给固定宽度而不是靠自动分配：这张表里有不换行的编码列，容器一窄浏览器就把所有列
   压到最小内容宽度，中文名会竖成一行一个字。 */
.col-namezh { width: 96px; min-width: 96px; }
.col-ver { width: 68px; white-space: nowrap; }
.col-act { width: 78px; text-align: right; white-space: nowrap; }
/* 码点串按空格断行；UTF-8 串没有空格（\xF0\x9F…），靠 overflow-wrap 在放不下时截断，
   两者都比「整行不换行」好：不换行的话一条家庭序列就把表撑出容器 500 多像素。 */
.col-cp code, .col-utf8 code { color: var(--text-sub); }
.col-utf8 code { font-size: 12px; overflow-wrap: anywhere; }

.glyph {
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", "Noto Emoji", "Twemoji Mozilla", "EmojiOne Color", "Android Emoji", sans-serif;
  font-size: 26px; line-height: 1.2; background: none; border: none; cursor: pointer; padding: 2px 4px;
  border-radius: 8px;
}
.glyph:hover { background: var(--accent-soft); }

.empty { text-align: center; color: var(--text-sub); padding: 40px 0; }
.more { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 14px 0; }
.more-note { font-size: 12px; color: var(--text-sub); }

/* ===== 详情弹窗 ===== */
.modal { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal[hidden] { display: none; }
.modal-mask { position: absolute; inset: 0; background: rgba(10, 16, 30, .55); backdrop-filter: blur(2px); }
.modal-box {
  position: relative; width: min(560px, 100%); max-height: calc(100vh - 40px); overflow: auto;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .35);
}
.modal-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--bg-card); }
.modal-head h2 { font-size: 15px; }
.modal-body { padding: 16px 14px 18px; }
.m-preview { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 0 4px; }
.m-glyph, .m-skin {
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", "Noto Emoji", "Twemoji Mozilla", "EmojiOne Color", "Android Emoji", sans-serif;
  font-size: 64px; line-height: 1.1;
}
.m-glyph[data-bg="1"], .m-skin[data-bg="1"] { background: #101828; border-radius: 12px; padding: 4px 10px; }
html[data-theme="dark"] .m-glyph[data-bg="1"], html[data-theme="dark"] .m-skin[data-bg="1"] { background: #f1f5f9; }
.m-name { text-align: center; font-size: 15px; font-weight: 600; margin-top: 6px; }
.m-meta { text-align: center; font-size: 12.5px; color: var(--text-sub); margin-bottom: 12px; }
table.m-table { width: 100%; border-collapse: collapse; font-size: 13px; }
table.m-table th {
  text-align: left; font-weight: 600; color: var(--text-sub); font-size: 12px;
  padding: 7px 8px; border-bottom: 1px solid var(--border); white-space: nowrap; width: 40%;
}
table.m-table td { padding: 7px 8px; border-bottom: 1px solid var(--border); word-break: break-all; }
table.m-table tr:last-child th, table.m-table tr:last-child td { border-bottom: none; }

/* ===== 说明正文 ===== */
.doc {
  max-width: 900px; margin: 24px auto 40px; padding: 0 16px;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 14px;
  box-shadow: var(--shadow); padding: 22px 26px 26px;
}
.doc h2 { font-size: 18px; margin: 22px 0 8px; }
.doc h2:first-child { margin-top: 0; }
.doc p { margin: 8px 0; color: var(--text); }
.doc ul, .doc ol { margin: 8px 0 8px 22px; }
.doc li { margin: 6px 0; }
.doc li b { margin-right: 6px; }
.doc a { color: var(--accent); }
.doc code { background: var(--code-bg); padding: 1px 5px; border-radius: 5px; }
.faq dt { font-weight: 600; margin-top: 14px; }
.faq dd { margin: 4px 0 0; color: var(--text-sub); }
.ver { margin-top: 24px; font-size: 13px; color: var(--text-sub); text-align: center; }
.rel-links { display: flex; flex-wrap: wrap; gap: 8px 16px; list-style: none; margin-left: 0; }
.rel-links li { margin: 0; }
.rel-links a { color: var(--accent); text-decoration: none; }
.rel-links a:hover { text-decoration: underline; }

/* ===== 提示条 ===== */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px);
  background: #1f2937; color: #fff; padding: 10px 18px; border-radius: 10px;
  font-size: 13px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
  z-index: 200; max-width: min(90vw, 560px); word-break: break-all;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ===== 响应式 ===== */
/* 窄屏按「这一行还得让人认出是哪个 emoji」来取舍列：编码信息（码点 / UTF-8 / 版本）
   逐级收进点开的详情弹窗，两个名称列保持可读。 */
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .side { position: static; max-height: none; }
  .table-wrap { max-height: none; }
  .col-utf8 { display: none; }
  .doc { padding: 18px 16px 20px; }
}
@media (max-width: 560px) {
  .col-cp { display: none; }
  .col-ver { display: none; }
  .col-namezh { width: 64px; min-width: 64px; }
  .brand-text p { display: none; }
  .toolbar { padding: 8px; }
}
