/* ===== 知行学资源搜索平台 样式 ===== */
:root {
  --primary: #1f5fbf;
  --primary-dark: #17498f;
  --primary-light: #e8f0fc;
  --accent: #e67817;
  --text: #26303d;
  --text-sub: #6b7686;
  --border: #dde4ee;
  --bg: #f4f7fb;
  --card: #ffffff;
  --radius: 10px;
  --shadow: 0 2px 10px rgba(31, 60, 110, 0.08);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: inherit; cursor: pointer; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* ===== 顶栏 ===== */
.topbar { background: var(--primary-dark); color: #cfe0f7; font-size: 12px; }
.topbar .container { display: flex; justify-content: flex-end; align-items: center; height: 32px; }
.topbar a { color: #cfe0f7; margin-left: 16px; }

.header { background: linear-gradient(135deg, #1f5fbf 0%, #2d7dd2 100%); color: #fff; }
.header .container { display: flex; align-items: center; justify-content: space-between; height: 72px; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand .logo {
  width: 44px; height: 44px; border-radius: 10px; background: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; color: var(--primary); font-weight: 700;
}
.brand h1 { font-size: 22px; font-weight: 600; letter-spacing: 1px; }
.brand .sub { font-size: 12px; opacity: .85; }
.nav { display: flex; gap: 4px; }
.nav a {
  color: #fff; padding: 8px 16px; border-radius: 6px; font-size: 15px;
}
.nav a:hover, .nav a.active { background: rgba(255,255,255,.18); text-decoration: none; }

/* ===== 首页搜索区 ===== */
.hero {
  background: linear-gradient(135deg, #1f5fbf 0%, #2d7dd2 55%, #3b9ad9 100%);
  padding: 56px 0 72px; color: #fff; text-align: center;
}
.hero h2 { font-size: 30px; font-weight: 600; margin-bottom: 8px; letter-spacing: 2px; }
.hero p.slogan { opacity: .9; margin-bottom: 32px; font-size: 15px; }
.note { max-width: 1100px; margin: 14px auto 0; text-align: center; color: var(--text-sub); font-size: 13px; }
.note b { color: var(--accent); }
.search-box { max-width: 860px; margin: 0 auto; }
.search-tabs { display: flex; gap: 6px; justify-content: flex-start; margin-bottom: 0; }
.search-tabs button {
  border: none; background: rgba(255,255,255,.22); color: #fff;
  padding: 8px 18px; border-radius: 8px 8px 0 0; font-size: 14px;
}
.search-tabs button.active { background: #fff; color: var(--primary); font-weight: 600; }
.search-main {
  display: flex; background: #fff; border-radius: 0 10px 10px 10px; overflow: hidden;
  box-shadow: 0 6px 24px rgba(10,40,90,.25);
}
.search-main select {
  border: none; padding: 0 14px; font-size: 14px; color: var(--text);
  background: #f2f6fc; outline: none; border-right: 1px solid var(--border); min-width: 110px;
}
.search-main input {
  flex: 1; border: none; padding: 0 18px; font-size: 16px; height: 56px; outline: none; color: var(--text);
}
.search-main .btn-search {
  border: none; background: var(--accent); color: #fff; font-size: 17px;
  padding: 0 40px; font-weight: 600; letter-spacing: 4px;
}
.search-main .btn-search:hover { background: #d06a0e; }
.search-links { margin-top: 12px; font-size: 13px; text-align: left; }
.search-links a { color: #ffe9c8; margin-right: 18px; }
.hot-words { margin-top: 10px; text-align: left; font-size: 13px; opacity: .92; }
.hot-words a { color: #fff; margin-right: 14px; text-decoration: underline dotted; }

/* ===== 统计条 ===== */
.stats { margin-top: -36px; position: relative; z-index: 2; }
.stats .row { display: flex; gap: 16px; }
.stat-card {
  flex: 1; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 20px 24px; text-align: center;
}
.stat-card .num { font-size: 26px; font-weight: 700; color: var(--primary); }
.stat-card .num span { font-size: 14px; font-weight: 400; margin-left: 2px; }
.stat-card .label { color: var(--text-sub); font-size: 13px; margin-top: 2px; }

/* ===== 区块 ===== */
.section { margin: 40px 0; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 16px; }
.section-head h3 { font-size: 20px; font-weight: 600; }
.section-head h3::before { content: ""; display: inline-block; width: 4px; height: 18px; background: var(--primary); margin-right: 10px; border-radius: 2px; vertical-align: -2px; }
.section-head .more { font-size: 13px; color: var(--text-sub); }

/* 分类浏览 */
.clc-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.clc-item {
  background: var(--card); border: 1px solid var(--border); border-radius: 8px;
  padding: 12px 14px; cursor: pointer; transition: all .15s;
}
.clc-item:hover { border-color: var(--primary); box-shadow: var(--shadow); }
.clc-item .code {
  display: inline-block; width: 26px; height: 26px; line-height: 26px; text-align: center;
  background: var(--primary-light); color: var(--primary); font-weight: 700; border-radius: 6px; margin-right: 8px;
}
.clc-item .cnt { float: right; color: var(--text-sub); font-size: 12px; margin-top: 4px; }
.clc-item .browse { float: right; color: var(--primary); font-size: 12px; margin: 4px 12px 0 0; font-weight: 600; }
.clc-item .browse:hover { text-decoration: underline; }
.clc-sub { display: none; margin-top: 10px; padding-top: 8px; border-top: 1px dashed var(--border); font-size: 12px; }
.clc-item.open .clc-sub { display: block; }
.clc-sub .lv2 { margin-bottom: 6px; }
.clc-sub .lv2 > b { color: var(--text); }
.clc-sub .lv3 { color: var(--text-sub); padding-left: 12px; }
.clc-sub .lv3 a { color: var(--text-sub); margin-right: 10px; }
.clc-sub .lv3 a:hover { color: var(--primary); }

/* 功能特色 */
.feature-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.feature-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; }
.feature-card .icon { font-size: 30px; margin-bottom: 10px; }
.feature-card h4 { font-size: 16px; margin-bottom: 6px; }
.feature-card p { color: var(--text-sub); font-size: 13px; }

/* 新书 */
.book-shelf { display: grid; grid-template-columns: repeat(6, 1fr); gap: 16px; }
.shelf-item { text-align: center; }
.shelf-item .cover {
  height: 150px; border-radius: 6px; display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 15px; font-weight: 600; padding: 12px; line-height: 1.5;
  box-shadow: 0 4px 10px rgba(20,50,100,.18); margin-bottom: 8px;
  writing-mode: vertical-rl; letter-spacing: 3px; cursor: pointer;
}
.shelf-item .t { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shelf-item .a { font-size: 12px; color: var(--text-sub); }

/* ===== 结果页 ===== */
.result-layout { display: flex; gap: 20px; margin-top: 24px; align-items: flex-start; }
.facets { width: 240px; flex-shrink: 0; }
.facet-box { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 14px; overflow: hidden; }
.facet-box h4 { background: #f0f5fc; padding: 10px 14px; font-size: 14px; }
.facet-box ul { list-style: none; padding: 8px 14px 12px; }
.facet-box li { padding: 4px 0; font-size: 13px; display: flex; justify-content: space-between; }
.facet-box li a { color: var(--text); }
.facet-box li a.on { color: var(--primary); font-weight: 700; }
.facet-box li .c { color: var(--text-sub); font-size: 12px; }
.results { flex: 1; min-width: 0; }
.result-bar {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 12px 18px; display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; flex-wrap: wrap; gap: 10px;
}
.result-bar .info b { color: var(--accent); }
.re-search { display: flex; }
.re-search input { border: 1px solid var(--border); border-radius: 6px 0 0 6px; padding: 6px 10px; width: 200px; outline: none; }
.re-search button { border: 1px solid var(--primary); background: var(--primary); color: #fff; border-radius: 0 6px 6px 0; padding: 6px 14px; }
.result-item {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 18px; display: flex; gap: 16px; margin-bottom: 14px;
}
.result-item .cover {
  width: 88px; height: 120px; flex-shrink: 0; border-radius: 4px; color: #fff;
  display: flex; align-items: center; justify-content: center; text-align: center;
  font-size: 13px; font-weight: 600; padding: 8px; writing-mode: vertical-rl; letter-spacing: 2px; cursor: pointer;
}
.result-item .meta { flex: 1; min-width: 0; }
.result-item h4 { font-size: 17px; margin-bottom: 4px; }
.result-item h4 .tag { font-size: 11px; padding: 2px 8px; border-radius: 4px; margin-left: 8px; vertical-align: 2px; font-weight: 400; }
.tag.e { background: #e7f6ec; color: #1d9d55; }
.tag.p { background: #fdf1e3; color: #d3760f; }
.result-item .sub { color: var(--text-sub); font-size: 13px; margin-bottom: 6px; }
.result-item .abs { font-size: 13px; color: #45505f; margin-bottom: 8px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.result-item .ops { display: flex; gap: 10px; }
.result-item .ops a, .result-item .ops button {
  font-size: 12px; padding: 4px 12px; border-radius: 5px; border: 1px solid var(--primary);
  color: var(--primary); background: #fff;
}
.result-item .ops a:hover, .result-item .ops button:hover { background: var(--primary-light); text-decoration: none; }
mark { background: #ffe9a8; color: #b3560c; padding: 0 1px; }
.empty { text-align: center; padding: 60px 0; color: var(--text-sub); background: var(--card); border-radius: var(--radius); }
.loadmore { text-align: center; padding: 22px 0 8px; }
.loadmore .btn-ghost { font-size: 15px; padding: 10px 26px; }

/* 搜索模式切换 */
.mode-tabs { display: flex; gap: 0; margin-top: 24px; border-bottom: 2px solid var(--primary); }
.mode-tabs button {
  border: none; background: transparent; padding: 10px 24px; font-size: 15px; color: var(--text-sub);
  border-radius: 8px 8px 0 0;
}
.mode-tabs button.active { background: var(--primary); color: #fff; font-weight: 600; }
.mode-panel { background: var(--card); border-radius: 0 0 10px 10px; box-shadow: var(--shadow); padding: 20px; }
.simple-line { display: flex; gap: 10px; }
.simple-line select, .adv-row select {
  border: 1px solid var(--border); border-radius: 6px; padding: 8px 10px; outline: none; background: #fff;
}
.simple-line input { flex: 1; border: 1px solid var(--border); border-radius: 6px; padding: 8px 14px; font-size: 15px; outline: none; }
.btn-primary { background: var(--primary); color: #fff; border: none; border-radius: 6px; padding: 8px 28px; font-size: 15px; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-ghost { background: #fff; color: var(--primary); border: 1px solid var(--primary); border-radius: 6px; padding: 8px 20px; }
.adv-row { display: flex; gap: 10px; margin-bottom: 10px; align-items: center; }
.adv-row .bool { width: 90px; }
.adv-row .field { width: 130px; }
.adv-row input { flex: 1; border: 1px solid var(--border); border-radius: 6px; padding: 8px 12px; outline: none; }
.adv-row .rm { border: none; background: #fceaea; color: #c0392b; border-radius: 6px; width: 32px; height: 32px; }
.pro-area textarea {
  width: 100%; height: 90px; border: 1px solid var(--border); border-radius: 6px; padding: 10px 12px;
  font-family: Consolas, Menlo, monospace; font-size: 14px; outline: none; resize: vertical;
}
.pro-tip { font-size: 12px; color: var(--text-sub); margin: 8px 0 12px; }
.pro-tip code { background: #eef3fb; padding: 1px 6px; border-radius: 4px; color: var(--primary); margin: 0 2px; }

/* ===== 详情页 ===== */
.detail-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 28px; margin-top: 24px; display: flex; gap: 28px; }
.detail-card .cover {
  width: 170px; height: 230px; border-radius: 6px; flex-shrink: 0; color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 19px; font-weight: 600;
  writing-mode: vertical-rl; letter-spacing: 5px; padding: 14px; box-shadow: 0 8px 20px rgba(20,50,100,.25);
}
.detail-meta { flex: 1; }
.detail-meta h2 { font-size: 24px; margin-bottom: 10px; }
.detail-meta table { border-collapse: collapse; font-size: 14px; margin-bottom: 14px; }
.detail-meta td { padding: 4px 24px 4px 0; vertical-align: top; }
.detail-meta td.k { color: var(--text-sub); white-space: nowrap; }
.detail-ops { display: flex; gap: 12px; flex-wrap: wrap; }
.detail-ops button { padding: 9px 22px; border-radius: 6px; font-size: 14px; border: 1px solid var(--primary); background: #fff; color: var(--primary); }
.detail-ops button.main { background: var(--primary); color: #fff; }
.detail-ops button.orange { background: var(--accent); border-color: var(--accent); color: #fff; }

.tabs-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); margin: 20px 0 40px; overflow: hidden; }
.tabs-nav { display: flex; border-bottom: 1px solid var(--border); background: #f7fafd; }
.tabs-nav button { border: none; background: transparent; padding: 14px 26px; font-size: 15px; color: var(--text-sub); border-bottom: 3px solid transparent; }
.tabs-nav button.active { color: var(--primary); font-weight: 600; border-bottom-color: var(--primary); background: #fff; }
.tab-pane { display: none; padding: 24px; }
.tab-pane.active { display: block; }

/* 试读 */
.preview-tabs { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.preview-tabs button { border: 1px solid var(--border); background: #fff; border-radius: 20px; padding: 6px 18px; font-size: 13px; }
.preview-tabs button.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.preview-page {
  border: 1px solid var(--border); border-radius: 8px; min-height: 360px; padding: 36px 48px;
  background: #fffdf8; box-shadow: inset 0 0 30px rgba(180,160,120,.08);
  font-size: 15px; line-height: 2;
}
.preview-page h3 { text-align: center; margin-bottom: 18px; }
.preview-page .center { text-align: center; }
.preview-page .toc-line { display: flex; }
.preview-page .toc-line .dots { flex: 1; border-bottom: 1px dotted #999; margin: 0 6px 8px; }

/* 馆藏 */
.holding-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.holding-table th, .holding-table td { border: 1px solid var(--border); padding: 8px 12px; text-align: left; }
.holding-table th { background: #f0f5fc; }
.holding-table .ok { color: #1d9d55; }
.badge-blue { background: var(--primary-light); color: var(--primary); border-radius: 4px; padding: 1px 8px; font-size: 12px; }

/* 被引 */
.cite-summary { display: flex; gap: 16px; margin-bottom: 20px; }
.cite-summary .cs { flex: 1; background: #f5f9ff; border-radius: 8px; padding: 16px; text-align: center; }
.cite-summary .cs b { font-size: 24px; color: var(--primary); display: block; }
.bar-chart { display: flex; align-items: flex-end; gap: 14px; height: 180px; padding: 0 10px; border-bottom: 2px solid var(--border); }
.bar-chart .bar { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; }
.bar-chart .bar i { display: block; width: 60%; background: linear-gradient(180deg, #4a8fe0, #1f5fbf); border-radius: 4px 4px 0 0; }
.bar-chart .bar span { font-size: 12px; color: var(--text-sub); margin-top: 6px; }
.bar-chart .bar b { font-size: 12px; color: var(--primary); }
.cite-list { margin-top: 20px; }
.cite-list li { padding: 8px 0; border-bottom: 1px dashed var(--border); font-size: 13px; list-style: none; }

/* 词典 */
.dict-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.dict-box { border: 1px solid var(--border); border-radius: 8px; padding: 16px; }
.dict-box h5 { color: var(--primary); margin-bottom: 10px; font-size: 14px; }
.word-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.word-tags span { background: #eef3fb; border-radius: 14px; padding: 3px 14px; font-size: 13px; color: #33507e; cursor: pointer; }
.word-tags span:hover { background: var(--primary); color: #fff; }

/* 知识点 */
.kp-item { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; margin-bottom: 14px; }
.kp-item h4 { font-size: 16px; margin-bottom: 8px; }
.kp-item .frag { font-size: 14px; color: #45505f; background: #fafcff; border-left: 3px solid var(--primary); padding: 10px 14px; border-radius: 0 6px 6px 0; margin-bottom: 10px; }
.kp-item .src { font-size: 12px; color: var(--text-sub); }
.kp-item .ops { margin-top: 10px; display: flex; gap: 10px; }
.kp-item .ops button { font-size: 12px; border: 1px solid var(--primary); color: var(--primary); background: #fff; border-radius: 5px; padding: 4px 14px; }

/* ===== 弹窗 ===== */
.modal-mask {
  display: none; position: fixed; inset: 0; background: rgba(15,30,60,.5); z-index: 99;
  align-items: center; justify-content: center;
}
.modal-mask.show { display: flex; }
.modal { background: #fff; border-radius: 12px; width: 520px; max-width: 92vw; max-height: 86vh; overflow: auto; }
.modal .m-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 22px; border-bottom: 1px solid var(--border); }
.modal .m-head h4 { font-size: 17px; }
.modal .m-head .x { border: none; background: none; font-size: 20px; color: var(--text-sub); }
.modal .m-body { padding: 22px; }
.modal .m-foot { padding: 14px 22px; border-top: 1px solid var(--border); text-align: right; }
.form-row { margin-bottom: 14px; }
.form-row label { display: block; font-size: 13px; color: var(--text-sub); margin-bottom: 4px; }
.form-row input, .form-row textarea, .form-row select {
  width: 100%; border: 1px solid var(--border); border-radius: 6px; padding: 8px 12px; font-size: 14px; outline: none;
}
.form-row input[readonly] { background: #f5f8fc; color: #55617a; }
.form-tip { font-size: 12px; color: #1d9d55; margin-top: 4px; }
.auto-badge { font-size: 11px; background: #e7f6ec; color: #1d9d55; border-radius: 4px; padding: 1px 6px; margin-left: 6px; }

/* 阅读器弹窗 */
.reader { width: 760px; }
.reader-body { font-size: 15px; line-height: 2.1; padding: 10px 6px; }
.reader-body p { margin-bottom: 12px; }
.reader-toolbar { display: flex; gap: 10px; margin-bottom: 12px; }
.reader-toolbar button { font-size: 12px; border: 1px solid var(--primary); color: var(--primary); background: #fff; border-radius: 5px; padding: 4px 14px; }
.select-tip { font-size: 12px; color: var(--text-sub); margin-bottom: 8px; }

/* toast */
#toast {
  position: fixed; left: 50%; top: 18%; transform: translateX(-50%);
  background: rgba(20,30,50,.88); color: #fff; padding: 10px 26px; border-radius: 8px;
  font-size: 14px; z-index: 999; display: none;
}

/* footer */
.footer { background: #17325e; color: #9db4d8; padding: 28px 0; margin-top: 50px; font-size: 13px; text-align: center; }
.footer b { color: #d7e5fa; }

/* 面包屑 */
.crumb { margin-top: 18px; font-size: 13px; color: var(--text-sub); }

@media (max-width: 900px) {
  .clc-grid { grid-template-columns: repeat(2, 1fr); }
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .book-shelf { grid-template-columns: repeat(3, 1fr); }
  .result-layout { flex-direction: column; }
  .facets { width: 100%; }
  .detail-card { flex-direction: column; }
  .stats .row { flex-wrap: wrap; }
  .stat-card { flex-basis: 45%; }
  .dict-grid { grid-template-columns: 1fr; }
}
