/* ==========================================================================
   TKFFF · 设计系统
   Design tokens 提取自 tkfff.com（主色 #4C89EF / 圆角 8-16px / 背景 #F2F6FC）
   ========================================================================== */
:root {
  --brand: #4C89EF;
  --brand-dark: #2F6FD8;
  --brand-light: #EDF3FB;
  --brand-ghost: #F3F7FA;
  --purple-a: #C17DFD;
  --purple-b: #8F60FF;
  --purple-c: #8946F2;
  --red: #F54646;
  --orange: #FF8A3D;
  --green: #28C445;

  --text-1: #26282C;
  --text-2: #333333;
  --text-3: #6E6E86;
  --text-4: #9A9AAE;
  --text-5: #C0C4CE;

  --bg: #F2F6FC;
  --surface: #FFFFFF;
  --line: #EDEFF5;
  --line-strong: #E1E6F0;

  --r-sm: 4px;
  --r: 8px;
  --r-lg: 16px;
  --r-pill: 9999px;

  --shadow-sm: 0 2px 8px rgba(31, 47, 84, .04);
  --shadow: 0 12px 32px 4px rgba(0, 0, 0, .04), 0 8px 20px rgba(0, 0, 0, .05);
  --shadow-hover: 0 14px 36px rgba(76, 137, 239, .16);

  --container: 1240px;
  --sidebar: 190px;
  --header-h: 62px;

  --font: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Helvetica, "Hiragino Sans GB", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text-2);
  font-size: 14px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input { font-family: inherit; outline: none; border: none; }
::selection { background: rgba(76, 137, 239, .18); }

/* 滚动条 */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #D7DEEA; border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: #C0C9DA; }
::-webkit-scrollbar-track { background: transparent; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 20px; }

/* ============ Header ============ */
.header {
  position: sticky; top: 0; z-index: 100;
  height: var(--header-h);
  background: rgba(255, 255, 255, .92);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.header-inner { height: 100%; display: flex; align-items: center; gap: 26px; }
.logo { display: flex; align-items: center; gap: 9px; flex-shrink: 0; }
.logo-mark {
  width: 32px; height: 32px; border-radius: 9px;
  background: linear-gradient(135deg, var(--brand) 0%, var(--purple-b) 100%);
  display: grid; place-items: center;
  color: #fff; font-weight: 800; font-size: 15px; letter-spacing: -.5px;
  box-shadow: 0 4px 12px rgba(76, 137, 239, .3);
}
.logo-text { font-size: 17px; font-weight: 700; color: var(--text-1); letter-spacing: -.2px; }
.logo-text em { font-style: normal; color: var(--brand); }
.logo-sub { font-size: 11px; color: var(--text-4); margin-left: 2px; font-weight: 400; }

.nav { display: flex; align-items: center; gap: 2px; flex: 1; }
.nav a {
  padding: 7px 13px; border-radius: var(--r-pill);
  font-size: 14px; color: var(--text-3); font-weight: 500;
  transition: all .18s;
}
.nav a:hover { color: var(--brand); background: var(--brand-light); }
.nav a.on { color: #fff; background: var(--brand); box-shadow: 0 4px 10px rgba(76, 137, 239, .28); }

.header-search {
  display: flex; align-items: center; gap: 7px;
  width: 230px; height: 36px; padding: 0 6px 0 13px;
  background: var(--bg); border: 1px solid transparent;
  border-radius: var(--r-pill); transition: all .18s;
}
.header-search:focus-within { background: #fff; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(76, 137, 239, .1); }
.header-search input { flex: 1; background: none; font-size: 13px; color: var(--text-2); }
.header-search input::placeholder { color: var(--text-5); }
.header-search button {
  width: 26px; height: 26px; border-radius: 50%; background: var(--brand);
  display: grid; place-items: center; color: #fff; flex-shrink: 0;
}

/* ============ Layout ============ */
.layout { display: flex; gap: 20px; align-items: flex-start; padding: 20px 0 56px; }
.sidebar {
  width: var(--sidebar); flex-shrink: 0;
  position: sticky; top: calc(var(--header-h) + 20px);
  background: var(--surface); border-radius: var(--r-lg);
  padding: 10px; box-shadow: var(--shadow-sm);
  max-height: calc(100vh - var(--header-h) - 40px); overflow-y: auto;
}
.sidebar-title {
  font-size: 12px; color: var(--text-4); font-weight: 600;
  padding: 6px 10px 8px; letter-spacing: .4px;
}
.side-item {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 10px; border-radius: var(--r);
  font-size: 13.5px; color: var(--text-3); cursor: pointer;
  transition: all .16s; margin-bottom: 1px;
}
.side-item:hover { background: var(--brand-light); color: var(--brand); }
.side-item.on { background: var(--brand); color: #fff; font-weight: 600; }
.side-item.on .side-count { background: rgba(255, 255, 255, .24); color: #fff; }
.side-emoji { font-size: 15px; line-height: 1; }
.side-count {
  margin-left: auto; font-size: 11px; padding: 1px 6px;
  background: var(--bg); border-radius: var(--r-pill); color: var(--text-4);
}
.main { flex: 1; min-width: 0; }

/* ============ Hero ============ */
.hero {
  position: relative; overflow: hidden;
  background: linear-gradient(120deg, #4C89EF 0%, #6B7BF7 45%, #8F60FF 100%);
  border-radius: var(--r-lg); padding: 34px 36px 30px;
  color: #fff; margin-bottom: 18px;
}
.hero::after {
  content: ''; position: absolute; right: -70px; top: -90px;
  width: 300px; height: 300px; border-radius: 50%;
  background: rgba(255, 255, 255, .09);
}
.hero::before {
  content: ''; position: absolute; right: 80px; bottom: -110px;
  width: 200px; height: 200px; border-radius: 50%;
  background: rgba(255, 255, 255, .07);
}
.hero-tag {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; padding: 4px 11px; border-radius: var(--r-pill);
  background: rgba(255, 255, 255, .18); margin-bottom: 12px;
  backdrop-filter: blur(4px);
}
.hero h1 { font-size: 27px; margin: 0 0 9px; font-weight: 700; letter-spacing: -.4px; }
.hero p { font-size: 14px; opacity: .9; margin: 0 0 20px; max-width: 620px; line-height: 1.7; }
.hero-search {
  display: flex; max-width: 560px; height: 46px;
  background: #fff; border-radius: var(--r-pill); padding: 5px 5px 5px 20px;
  position: relative; z-index: 2; box-shadow: 0 8px 24px rgba(20, 40, 90, .16);
}
.hero-search input { flex: 1; font-size: 14.5px; color: var(--text-2); }
.hero-search button {
  padding: 0 24px; border-radius: var(--r-pill); color: #fff; font-size: 14px; font-weight: 600;
  background: linear-gradient(135deg, var(--brand) 0%, var(--purple-b) 100%);
  transition: filter .18s;
}
.hero-search button:hover { filter: brightness(1.08); }
.hero-hot { margin-top: 13px; font-size: 12.5px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; position: relative; z-index: 2; }
.hero-hot span { opacity: .72; }
.hero-hot a {
  padding: 3px 10px; background: rgba(255, 255, 255, .16);
  border-radius: var(--r-pill); transition: background .16s;
}
.hero-hot a:hover { background: rgba(255, 255, 255, .3); }

/* ============ Stats ============ */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
.stat {
  background: var(--surface); border-radius: var(--r-lg); padding: 16px 18px;
  box-shadow: var(--shadow-sm); position: relative; overflow: hidden;
  transition: transform .2s, box-shadow .2s;
}
.stat:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.stat-num { font-size: 25px; font-weight: 700; color: var(--text-1); line-height: 1.2; letter-spacing: -.5px; }
.stat-num em { font-style: normal; font-size: 13px; color: var(--text-4); font-weight: 500; margin-left: 3px; }
.stat-label { font-size: 12.5px; color: var(--text-4); margin-top: 3px; }
.stat-bar { position: absolute; left: 0; top: 0; bottom: 0; width: 3px; border-radius: 0 3px 3px 0; }

/* ============ Section ============ */
.section { background: var(--surface); border-radius: var(--r-lg); padding: 20px 22px 22px; margin-bottom: 18px; box-shadow: var(--shadow-sm); }
.section-head { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.section-head h2 { font-size: 18px; margin: 0; font-weight: 700; color: var(--text-1); letter-spacing: -.2px; }
.section-head .bar { width: 4px; height: 17px; border-radius: 3px; background: linear-gradient(180deg, var(--brand), var(--purple-b)); }
.section-head .desc { font-size: 12.5px; color: var(--text-4); margin-left: 2px; }
.section-more { margin-left: auto; font-size: 13px; color: var(--text-4); display: flex; align-items: center; gap: 3px; transition: color .16s; }
.section-more:hover { color: var(--brand); }

/* ============ 词条卡片 ============ */
.term-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: 12px; }
.term-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); padding: 14px 15px;
  transition: all .2s; cursor: pointer; position: relative; overflow: hidden;
}
.term-card::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 0;
  background: linear-gradient(180deg, var(--brand), var(--purple-b)); transition: width .2s;
}
.term-card:hover { border-color: transparent; box-shadow: var(--shadow-hover); transform: translateY(-2px); }
.term-card:hover::before { width: 3px; }
.term-card h3 { font-size: 15px; margin: 0 0 6px; font-weight: 600; color: var(--text-1); display: flex; align-items: center; gap: 7px; }
.term-card p {
  font-size: 12.5px; color: var(--text-3); margin: 0; line-height: 1.6;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.term-card .meta { display: flex; align-items: center; gap: 7px; margin-top: 10px; font-size: 11.5px; color: var(--text-5); }

.badge {
  font-size: 10.5px; padding: 1px 7px; border-radius: var(--r-pill);
  font-weight: 600; letter-spacing: .2px; white-space: nowrap;
}
.badge-auth { background: #E8F5EC; color: #1D9E4B; }
.badge-draft { background: #FFF3E4; color: #E08421; }
.badge-proposal { background: #F0F1F5; color: #8B8B99; }
.badge-cat { background: var(--brand-light); color: var(--brand); }

/* ============ 分类栏目（首页） ============ */
.cat-block { margin-bottom: 20px; }
.cat-block-head {
  display: flex; align-items: center; gap: 9px; margin-bottom: 11px; padding-bottom: 9px;
  border-bottom: 1px dashed var(--line-strong);
}
.cat-block-head .emoji {
  width: 28px; height: 28px; border-radius: var(--r); background: var(--brand-light);
  display: grid; place-items: center; font-size: 15px;
}
.cat-block-head h3 { font-size: 16px; margin: 0; font-weight: 700; color: var(--text-1); }
.cat-block-head .cnt { font-size: 12px; color: var(--text-4); }
.cat-block-head a.all { margin-left: auto; font-size: 12.5px; color: var(--brand); }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; background: var(--brand-ghost); border-radius: var(--r-pill);
  font-size: 13px; color: var(--text-2); cursor: pointer;
  transition: all .16s; border: 1px solid transparent;
}
.chip:hover { background: #fff; border-color: var(--brand); color: var(--brand); box-shadow: 0 3px 10px rgba(76, 137, 239, .14); }
.chip i { font-style: normal; font-size: 11px; color: var(--text-5); }
.chip:hover i { color: var(--brand); }

/* ============ 文章卡片 ============ */
.article-list { display: flex; flex-direction: column; gap: 2px; }
.article-item {
  display: flex; gap: 13px; padding: 12px; border-radius: var(--r);
  transition: background .16s; cursor: pointer;
}
.article-item:hover { background: var(--brand-ghost); }
.article-thumb {
  width: 122px; height: 76px; border-radius: var(--r); object-fit: cover;
  background: var(--bg); flex-shrink: 0;
}
.article-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.article-body h4 {
  font-size: 14.5px; margin: 0 0 5px; font-weight: 600; color: var(--text-1); line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.article-item:hover .article-body h4 { color: var(--brand); }
.article-body p {
  font-size: 12.5px; color: var(--text-4); margin: 0; line-height: 1.55;
  display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden;
}
.article-meta { display: flex; align-items: center; gap: 9px; margin-top: auto; padding-top: 7px; font-size: 11.5px; color: var(--text-5); }
.article-meta .tag { background: var(--brand-light); color: var(--brand); padding: 1px 7px; border-radius: var(--r-sm); }

/* ============ 词条详情 ============ */
.crumb { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--text-4); margin-bottom: 14px; flex-wrap: wrap; }
.crumb a:hover { color: var(--brand); }
.crumb .sep { color: var(--text-5); }

.entry-head {
  background: var(--surface); border-radius: var(--r-lg); padding: 26px 28px;
  box-shadow: var(--shadow-sm); margin-bottom: 16px; position: relative; overflow: hidden;
}
.entry-head::after {
  content: ''; position: absolute; right: -50px; top: -60px; width: 190px; height: 190px;
  border-radius: 50%; background: linear-gradient(135deg, rgba(76, 137, 239, .07), rgba(143, 96, 255, .05));
}
.entry-head h1 { font-size: 27px; margin: 0 0 12px; font-weight: 700; color: var(--text-1); letter-spacing: -.4px; position: relative; }
.entry-def {
  font-size: 15.5px; color: var(--text-2); line-height: 1.8; margin: 0 0 16px;
  padding: 13px 17px; background: var(--brand-light); border-left: 3px solid var(--brand);
  border-radius: 0 var(--r) var(--r) 0; position: relative;
}
.entry-facts { display: flex; flex-wrap: wrap; gap: 8px; position: relative; }
.fact {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px;
  padding: 5px 12px; background: var(--bg); border-radius: var(--r-pill); color: var(--text-3);
}
.fact b { color: var(--text-2); font-weight: 600; }

.prose { font-size: 14.5px; line-height: 1.85; color: var(--text-2); }
.prose p { margin: 0 0 13px; }
.evidence-list { display: flex; flex-direction: column; gap: 10px; }
.evidence {
  padding: 13px 16px; background: var(--brand-ghost); border-radius: var(--r);
  font-size: 13.5px; line-height: 1.75; color: var(--text-2);
  border-left: 3px solid var(--line-strong); transition: border-color .18s;
}
.evidence:hover { border-left-color: var(--brand); }
.evidence-src {
  display: flex; align-items: center; gap: 6px; margin-top: 8px;
  font-size: 11.5px; color: var(--text-4);
}
.evidence-src a { color: var(--brand); }
.evidence-src a:hover { text-decoration: underline; }

.rel-row { display: flex; flex-wrap: wrap; gap: 8px; }
.rel-link {
  display: inline-flex; align-items: center; gap: 5px; padding: 6px 13px;
  background: #fff; border: 1px solid var(--line-strong); border-radius: var(--r-pill);
  font-size: 13px; color: var(--text-2); transition: all .16s; cursor: pointer;
}
.rel-link:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-light); }
.rel-link::before { content: '⟡'; font-size: 10px; color: var(--text-5); }
.rel-link:hover::before { color: var(--brand); }

/* ============ 文章详情 ============ */
.doc { background: var(--surface); border-radius: var(--r-lg); padding: 30px 34px 36px; box-shadow: var(--shadow-sm); }
.doc h1 { font-size: 25px; line-height: 1.45; margin: 0 0 14px; color: var(--text-1); font-weight: 700; }
.doc-meta {
  display: flex; align-items: center; gap: 12px; padding-bottom: 16px;
  border-bottom: 1px solid var(--line); margin-bottom: 20px; font-size: 12.5px; color: var(--text-4);
}
.doc-meta img { width: 30px; height: 30px; border-radius: 50%; }
.doc-meta .au { color: var(--text-2); font-weight: 600; font-size: 13px; }
.doc-summary {
  background: linear-gradient(135deg, #F5F8FE, #FBF7FF); border-radius: var(--r);
  padding: 16px 19px; margin-bottom: 22px; border: 1px solid #E9EFFB;
}
.doc-summary h4 { margin: 0 0 9px; font-size: 13px; color: var(--brand); font-weight: 700; display: flex; align-items: center; gap: 6px; }
.doc-summary ul { margin: 0; padding-left: 19px; }
.doc-summary li { font-size: 13.5px; line-height: 1.75; color: var(--text-2); margin-bottom: 5px; }
.doc-body { font-size: 15px; line-height: 1.95; color: #3A3D45; }
.doc-body p { margin: 0 0 16px; }
.doc-foot { margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--text-4); }
.doc-foot a { color: var(--brand); }

/* ============ 搜索 ============ */
.search-box {
  display: flex; height: 46px; background: #fff; border-radius: var(--r-pill);
  padding: 5px 5px 5px 20px; box-shadow: var(--shadow-sm); margin-bottom: 16px;
  border: 1px solid var(--line);
}
.search-box input { flex: 1; font-size: 14.5px; }
.search-box button { padding: 0 26px; border-radius: var(--r-pill); background: var(--brand); color: #fff; font-weight: 600; }
.res-tabs { display: flex; gap: 6px; margin-bottom: 14px; }
.res-tab {
  padding: 6px 15px; border-radius: var(--r-pill); font-size: 13px;
  background: #fff; color: var(--text-3); cursor: pointer; border: 1px solid var(--line);
  transition: all .16s;
}
.res-tab.on { background: var(--brand); color: #fff; border-color: var(--brand); }
mark { background: rgba(255, 214, 0, .35); color: inherit; padding: 0 2px; border-radius: 2px; }

/* ============ 规范页 ============ */
.spec-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.spec-card { padding: 17px 19px; background: var(--brand-ghost); border-radius: var(--r); border: 1px solid var(--line); }
.spec-card h4 { margin: 0 0 7px; font-size: 14.5px; color: var(--text-1); display: flex; align-items: center; gap: 7px; }
.spec-card p { margin: 0; font-size: 13px; color: var(--text-3); line-height: 1.7; }
.code {
  background: #1E2430; color: #C8D3E8; border-radius: var(--r); padding: 15px 17px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px; line-height: 1.75; overflow-x: auto; white-space: pre;
}
.code .k { color: #7FB3FF; }
.code .s { color: #9FE0A0; }
.code .c { color: #6B7688; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.tbl th, table.tbl td { padding: 10px 13px; text-align: left; border-bottom: 1px solid var(--line); }
table.tbl th { background: var(--brand-ghost); color: var(--text-3); font-weight: 600; font-size: 12.5px; }
table.tbl td:first-child { font-weight: 600; color: var(--text-1); white-space: nowrap; }

/* ============ 通用 ============ */
.empty { text-align: center; padding: 60px 20px; color: var(--text-4); }
.empty-icon { font-size: 40px; margin-bottom: 10px; opacity: .5; }
.loading { text-align: center; padding: 50px; color: var(--text-4); font-size: 13px; }
.spinner {
  width: 26px; height: 26px; border: 2.5px solid var(--line-strong); border-top-color: var(--brand);
  border-radius: 50%; margin: 0 auto 12px; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.fade { animation: fade .3s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.pager { display: flex; justify-content: center; gap: 6px; margin-top: 20px; }
.pager button {
  min-width: 34px; height: 34px; padding: 0 11px; border-radius: var(--r);
  background: #fff; border: 1px solid var(--line); font-size: 13px; color: var(--text-3);
  transition: all .16s;
}
.pager button:hover:not(:disabled) { border-color: var(--brand); color: var(--brand); }
.pager button.on { background: var(--brand); color: #fff; border-color: var(--brand); }
.pager button:disabled { opacity: .4; cursor: not-allowed; }

/* ============ Footer ============ */
.footer { background: #262A33; color: #9AA3B4; padding: 30px 0 24px; margin-top: 30px; }
.footer-inner { display: flex; gap: 44px; flex-wrap: wrap; }
.footer h5 { color: #E6EAF2; font-size: 13.5px; margin: 0 0 11px; font-weight: 600; }
.footer a { color: #9AA3B4; font-size: 12.5px; line-height: 2; display: block; transition: color .16s; }
.footer a:hover { color: var(--brand); }
.footer-brand { max-width: 320px; }
.footer-brand p { font-size: 12.5px; line-height: 1.8; margin: 10px 0 0; }
.footer-bottom {
  margin-top: 24px; padding-top: 16px; border-top: 1px solid #333944;
  font-size: 12px; color: #6E7686; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px;
}

/* ============ 响应式 ============ */
@media (max-width: 1080px) {
  .sidebar { display: none; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .spec-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .nav, .header-search { display: none; }
  .hero { padding: 24px 20px; }
  .hero h1 { font-size: 21px; }
  .term-grid { grid-template-columns: 1fr; }
  .article-thumb { width: 96px; height: 62px; }
  .doc { padding: 20px 18px 26px; }
  .doc h1 { font-size: 20px; }
  .entry-head { padding: 20px 18px; }
  .entry-head h1 { font-size: 22px; }
}
