/* Material Symbols 中文站 - 主样式 */
@font-face {
  font-family: 'MS Outlined';
  src: url('/assets/fonts/MaterialSymbolsOutlined_FILLGRADopszwght.woff2') format('woff2');
  font-display: swap;
}
@font-face {
  font-family: 'MS Rounded';
  src: url('/assets/fonts/MaterialSymbolsRounded_FILLGRADopszwght.woff2') format('woff2');
  font-display: swap;
}
@font-face {
  font-family: 'MS Sharp';
  src: url('/assets/fonts/MaterialSymbolsSharp_FILLGRADopszwght.woff2') format('woff2');
  font-display: swap;
}

:root {
  --brand: #1a73e8;
  --brand-hover: #1557b0;
  --bg: #ffffff;
  --surface: #f8f9fa;
  --card: #ffffff;
  --text: #202124;
  --text-2: #5f6368;
  --text-3: #80868b;
  --border: #dadce0;
  --border-light: #e8eaed;
  --radius: 8px;
  --shadow-card: 0 1px 2px 0 rgba(60,64,67,.3), 0 1px 3px 1px rgba(60,64,67,.15);
  --shadow-card-hover: 0 1px 3px 0 rgba(60,64,67,.3), 0 4px 8px 2px rgba(60,64,67,.15);
  --header-h: 64px;
  --filter-h: auto;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: 'Google Sans', 'ProductSans', system-ui, -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg); color: var(--text); line-height: 1.5;
}
a { color: inherit; text-decoration: none; }
.wrap { max-width: 1280px; margin: 0 auto; padding: 0 24px; }
code, pre { font-family: 'Roboto Mono', ui-monospace, Consolas, monospace; }

/* 图标基类 */
.ms-icon {
  font-family: 'MS Outlined';
  font-weight: normal; font-style: normal;
  line-height: 1; letter-spacing: normal; text-transform: none;
  display: inline-block; white-space: nowrap; word-wrap: normal;
  direction: ltr; -webkit-font-smoothing: antialiased;
  user-select: none;
}
body[data-style="rounded"] .ms-icon { font-family: 'MS Rounded'; }
body[data-style="sharp"] .ms-icon { font-family: 'MS Sharp'; }

/* ===== Header ===== */
.site-header {
  background: var(--bg); border-bottom: 1px solid var(--border-light);
  position: sticky; top: 0; z-index: 200;
  height: var(--header-h);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 100%; }
.logo {
  font-size: 1.25rem; font-weight: 500; color: var(--text);
  display: flex; align-items: center; gap: 10px;
}
.logo img { vertical-align: middle; }
.logo span { color: var(--text-2); font-weight: 400; font-size: .95rem; }
.top-nav { display: flex; gap: 8px; }
.top-nav a {
  padding: 8px 16px; border-radius: 20px; font-size: .875rem;
  color: var(--text-2); transition: background .15s;
}
.top-nav a:hover { background: var(--surface); color: var(--text); }

/* ===== Sticky Filter Bar ===== */
.filter-bar {
  position: sticky; top: var(--header-h); z-index: 190;
  background: var(--bg); border-bottom: 1px solid var(--border-light);
  padding: 12px 0 0;
}
.filter-inner {
  display: flex; align-items: center; gap: 16px;
  margin-bottom: 10px;
}

/* 搜索 */
.filter-search {
  position: relative; flex: 1; max-width: 480px;
}
.filter-search input {
  width: 100%; height: 44px; border: 1px solid var(--border);
  border-radius: 22px; padding: 0 44px 0 18px; font-size: .9375rem;
  outline: none; background: var(--surface); color: var(--text);
  transition: border-color .2s, box-shadow .2s;
}
.filter-search input:focus {
  border-color: var(--brand); background: #fff;
  box-shadow: 0 1px 4px rgba(26,115,232,.15);
}
.filter-search input::placeholder { color: var(--text-3); }
.filter-search-icon {
  position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
  font-size: 1.25rem; color: var(--text-3); pointer-events: none;
}
.search-results {
  position: absolute; left: 0; right: 0; top: 52px; background: #fff;
  border-radius: var(--radius); box-shadow: var(--shadow-card-hover);
  max-height: 420px; overflow-y: auto; text-align: left; z-index: 210;
}
.search-results .sr-item {
  display: flex; align-items: center; gap: 14px;
  padding: 10px 20px; cursor: pointer; transition: background .1s;
}
.search-results .sr-item:hover { background: var(--surface); }
.search-results .glyph { font-size: 1.5rem; width: 32px; text-align: center; color: var(--text-2); }
.search-results .sr-name { flex: 1; font-size: .9rem; }
.search-results .sr-cat { color: var(--text-3); font-size: .8rem; }

/* Style Switcher */
.style-switcher {
  display: inline-flex; background: var(--surface); border-radius: 20px;
  padding: 3px; gap: 2px; flex-shrink: 0;
}
.style-btn {
  border: none; background: transparent; padding: 7px 16px;
  cursor: pointer; font-size: .8125rem; color: var(--text-2);
  border-radius: 18px; transition: all .15s; font-weight: 500;
  white-space: nowrap;
}
.style-btn:hover { color: var(--text); }
.style-btn.active { background: var(--brand); color: #fff; }

/* Category Chips - 横向滚动 */
.cat-chips-wrap { position: relative; }
.cat-chips-wrap::after {
  content: ''; position: absolute; top: 0; right: 0; bottom: 0; width: 48px;
  background: linear-gradient(90deg, transparent, var(--bg));
  pointer-events: none; z-index: 1;
}
.cat-chips {
  display: flex; flex-wrap: nowrap; gap: 8px;
  padding: 0 0 12px; overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin; scrollbar-color: var(--border) transparent;
}
.cat-chips::-webkit-scrollbar { height: 4px; }
.cat-chips::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
.cat-chips::-webkit-scrollbar-track { background: transparent; }
.chip {
  border: 1px solid var(--border); background: #fff; border-radius: 20px;
  padding: 6px 16px; font-size: .8125rem; cursor: pointer;
  color: var(--text-2); transition: all .15s; font-weight: 500;
  white-space: nowrap; flex-shrink: 0;
}
.chip small { color: var(--text-3); font-weight: 400; margin-left: 4px; }
.chip-icon { font-size: 1rem; vertical-align: -2px; margin-right: 2px; }
.chip:hover { border-color: var(--brand); color: var(--brand); background: #e8f0fe; }
.chip.active { background: #e8f0fe; border-color: var(--brand); color: var(--brand); }

/* ===== Category Sections（默认分组视图） ===== */
.cat-sections { padding: 8px 0 32px; }
.cat-section { margin-bottom: 32px; }
.cat-section-head {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 0; border-bottom: 1px solid var(--border-light);
  margin-bottom: 12px;
}
.cat-section-head .cat-sec-icon { font-size: 1.4rem; color: var(--brand); }
.cat-section-head h2 { font-size: 1.125rem; font-weight: 500; flex: 1; }
.cat-section-head .cat-sec-count { font-size: .8125rem; color: var(--text-3); }
.cat-section-head .cat-sec-more {
  font-size: .8125rem; color: var(--brand); font-weight: 500;
  padding: 4px 12px; border-radius: 16px; transition: background .15s;
}
.cat-section-head .cat-sec-more:hover { background: #e8f0fe; }

/* ===== Icon Grid ===== */
.icons-section { padding: 8px 0; min-height: 200px; }
.icons-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
  gap: 4px;
}
.cv-auto { content-visibility: auto; contain-intrinsic-size: auto 600px; }

.icon-card {
  position: relative;
  background: var(--card); border-radius: var(--radius);
  padding: 18px 6px 10px;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  cursor: pointer; transition: all .15s;
  border: 1px solid transparent;
  text-decoration: none;
}
.icon-card:hover {
  background: var(--surface); border-color: var(--border-light);
  box-shadow: var(--shadow-card);
}
.card-glyph { font-size: 26px; color: var(--text-2); transition: color .15s; }
.icon-card:hover .card-glyph { color: var(--brand); }
.card-name {
  font-size: .7rem; color: var(--text-2); text-align: center;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-weight: 500;
}

/* 复制角标 */
.card-copy {
  position: absolute; top: 4px; right: 4px;
  width: 26px; height: 26px; border-radius: 50%;
  border: none; background: transparent; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity .15s, background .15s;
  font-size: .85rem; color: var(--text-3);
}
.icon-card:hover .card-copy { opacity: 1; }
.card-copy:hover { background: var(--border-light); color: var(--brand); }

.load-more { text-align: center; margin: 20px 0 10px; }
.btn-more {
  border: 1px solid var(--border); color: var(--text-2); background: #fff;
  padding: 10px 32px; border-radius: 24px; cursor: pointer;
  font-size: .875rem; font-weight: 500; transition: all .15s;
}
.btn-more:hover { background: var(--surface); border-color: var(--text-3); }
.btn-more[disabled] { opacity: .45; cursor: default; }

/* ===== Detail Page ===== */
.crumbs { padding: 20px 0 8px; font-size: .875rem; color: var(--text-3); }
.crumbs a { color: var(--text-2); }
.crumbs a:hover { color: var(--brand); }

.detail-cols { display: grid; grid-template-columns: 400px 1fr; gap: 32px; align-items: start; }
.preview-pane {
  background: var(--card); border-radius: var(--radius); padding: 32px;
  text-align: center; position: sticky; top: 88px;
  border: 1px solid var(--border-light);
}
.glyph-stage-wrap {
  background: var(--surface); border-radius: var(--radius);
  padding: 48px 0; display: flex; justify-content: center; align-items: center;
  min-height: 220px;
}
.icon-preview {
  font-size: 96px; color: var(--text);
  font-variation-settings: 'FILL' var(--f, 0), 'wght' var(--w, 400), 'GRAD' var(--g, 0), 'opsz' var(--o, 48);
}

.axes { margin-top: 24px; text-align: left; }
.axis-row {
  display: grid; grid-template-columns: 120px 1fr 50px;
  gap: 12px; align-items: center; margin-bottom: 12px;
}
.axis-row label { font-size: .8125rem; color: var(--text-2); font-weight: 500; }
.axis-row input[type=range] { width: 100%; accent-color: var(--brand); height: 4px; }
.axis-row output {
  font-size: .8125rem; color: var(--text);
  font-family: 'Roboto Mono', ui-monospace, Consolas, monospace;
}
.hint-classic { color: var(--text-3); font-size: .875rem; margin-top: 16px; }

.info-pane h1.icon-title {
  font-size: 2rem; font-weight: 400; word-break: break-all;
  color: var(--text); margin-bottom: 4px;
}
.icon-sub { color: var(--text-2); margin: 4px 0 16px; font-size: .9375rem; }
.kw-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.kw-chips .chip { cursor: default; font-size: .8125rem; }

.code-tabs {
  background: #1e1e1e; border-radius: var(--radius); overflow: hidden; margin-bottom: 20px;
}
.tab-btns {
  display: flex; align-items: center; gap: 2px;
  padding: 8px 12px 0; border-bottom: 1px solid #333;
}
.tab-btn {
  border: none; background: transparent; color: #9aa0a6;
  padding: 8px 16px; cursor: pointer; font-size: .8125rem;
  border-radius: 8px 8px 0 0; font-weight: 500; transition: all .15s;
}
.tab-btn:hover { color: #e8eaed; }
.tab-btn.active { background: #333; color: #e8eaed; }
.tab-copy { margin-left: auto; margin-bottom: 6px; }
.tab-pane {
  display: none; color: #e8eaed; padding: 16px; font-size: .8125rem;
  overflow-x: auto; white-space: pre-wrap; word-break: break-all; line-height: 1.6;
}
.tab-pane.active { display: block; }

.copy-row { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-copy {
  background: var(--brand); color: #fff; border: none; border-radius: 20px;
  padding: 10px 24px; font-size: .875rem; cursor: pointer;
  font-weight: 500; transition: background .15s;
}
.btn-copy:hover { background: var(--brand-hover); }
.btn-copy.ok { background: #16a34a; }
.btn-copy.big { padding: 12px 28px; }

.related { margin-top: 40px; }
.related h2 { font-size: 1.125rem; font-weight: 500; margin-bottom: 16px; }
.related h2 small { color: var(--text-3); font-weight: 400; }
.rel-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 4px; }

/* ===== Footer ===== */
.site-footer {
  border-top: 1px solid var(--border-light); margin-top: 48px;
  padding: 28px 0; color: var(--text-3); font-size: .8125rem; text-align: center;
}
.site-footer p { margin: 4px 0; }
.site-footer a { color: var(--brand); }

/* ===== Back to Top ===== */
#back-top {
  position: fixed; right: 24px; bottom: 32px; z-index: 90;
  width: 48px; height: 48px; border-radius: 50%;
  border: 1px solid var(--border); background: #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-card); font-size: 1.2rem;
  opacity: 0; visibility: hidden; transform: translateY(12px);
  transition: all .25s ease;
}
#back-top.show { opacity: 1; visibility: visible; transform: translateY(0); }
#back-top:hover { box-shadow: var(--shadow-card-hover); transform: translateY(-2px); }

/* ===== Toast ===== */
.toast {
  position: fixed; top: 80px; right: 24px; z-index: 9999;
  background: #323232; color: #fff;
  padding: 12px 24px; border-radius: 8px;
  font-size: .875rem; font-weight: 500;
  box-shadow: 0 4px 12px rgba(0,0,0,.25);
  opacity: 0; visibility: hidden; transform: translateY(-8px);
  transition: all .25s ease; pointer-events: none;
}
.toast.show { opacity: 1; visibility: visible; transform: translateY(0); }

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .detail-cols { grid-template-columns: 1fr; }
  .preview-pane { position: static; }
  .filter-inner { flex-wrap: wrap; }
  .filter-search { max-width: 100%; order: 1; flex: 1 1 100%; }
  .style-switcher { order: 2; flex: 1 1 100%; justify-content: center; display: flex; }
}
@media (max-width: 640px) {
  :root { --header-h: 52px; }
  .wrap { padding: 0 16px; }
  .logo { font-size: 1rem; gap: 8px; }
  .logo img { width: 22px; height: 22px; }
  .top-nav a { padding: 6px 12px; font-size: .8125rem; border-radius: 16px; background: var(--surface); color: var(--text-2); }
  .filter-bar { padding: 8px 0 0; }
  .filter-inner { gap: 8px; }
  .filter-search input { height: 40px; font-size: .875rem; }
  .style-btn { padding: 6px 12px; font-size: .75rem; }
  .chip { padding: 5px 10px; font-size: .75rem; }
  .chip-icon { font-size: .875rem; }
  .icon-preview { font-size: 72px; }
}
