/* ==========================================================================
   工业案例库 · 主题样式（css/style.css）
   页面结构：topbar / layout(sidebar + results) / card / pager / footer
   ========================================================================== */

:root {
  --ic-bg: #f4f6f9;
  --ic-surface: #ffffff;
  --ic-ink: #1f2d3d;
  --ic-ink-2: #46586b;
  --ic-muted: #6b7a8c;
  --ic-line: #e3e8ef;
  --ic-accent: #1a6fd4;
  --ic-accent-soft: #eaf2fe;
  --ic-ok: #1f8a4c;
  --ic-ok-soft: #e8f6ee;
  --ic-radius: 10px;
  --ic-shadow: 0 1px 2px rgba(24, 44, 68, .06), 0 6px 18px rgba(24, 44, 68, .05);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--ic-bg);
  color: var(--ic-ink);
  font: 15px/1.7 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC", sans-serif;
}

a {
  color: var(--ic-accent);
  text-decoration: none;
}

a:hover {
  color: #1358ab;
}

b {
  font-weight: 700;
}

/* ---------------- 顶栏 ---------------- */

.topbar {
  background: var(--ic-surface);
  border-bottom: 1px solid var(--ic-line);
  position: sticky;
  top: 0;
  z-index: 20;
}

.topbar-inner {
  width: min(1280px, calc(100% - 40px));
  margin: 0 auto;
  min-height: 68px;
  display: flex;
  align-items: center;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ic-ink);
  flex: none;
}

.brand:hover {
  color: var(--ic-ink);
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 9px;
  background: linear-gradient(135deg, #1a6fd4, #2f8ae8);
  color: #fff;
  font-size: 19px;
  font-weight: 700;
  display: grid;
  place-items: center;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.brand-text strong {
  font-size: 17px;
  letter-spacing: .5px;
}

.brand-text small {
  color: var(--ic-muted);
  font-size: 12px;
}

.search {
  flex: 1 1 auto;
  max-width: 620px;
  display: flex;
  background: #f2f5f9;
  border: 1px solid var(--ic-line);
  border-radius: 8px;
  overflow: hidden;
  transition: border-color .15s, background .15s;
}

.search:focus-within {
  background: #fff;
  border-color: var(--ic-accent);
}

.search input[type="search"] {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  background: transparent;
  padding: 9px 14px;
  font-size: 14px;
  color: var(--ic-ink);
  outline: none;
}

.search button {
  border: 0;
  background: var(--ic-accent);
  color: #fff;
  padding: 0 20px;
  font-size: 14px;
  cursor: pointer;
}

.search button:hover {
  background: #1358ab;
}

.topbar-stats {
  margin-left: auto;
  display: flex;
  gap: 16px;
  color: var(--ic-muted);
  font-size: 13px;
  white-space: nowrap;
}

.topbar-stats b {
  color: var(--ic-ink);
  font-size: 14px;
}

/* ---------------- 布局 ---------------- */

.page {
  width: min(1280px, calc(100% - 40px));
  margin: 22px auto 40px;
}

.layout {
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

/* ---------------- 侧栏筛选 ---------------- */

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: sticky;
  top: 88px;
}

.filter-box {
  background: var(--ic-surface);
  border: 1px solid var(--ic-line);
  border-radius: var(--ic-radius);
  padding: 12px 14px 14px;
}

.filter-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--ic-ink-2);
  letter-spacing: .5px;
  padding-bottom: 8px;
  margin-bottom: 6px;
  border-bottom: 1px solid var(--ic-line);
}

.filter-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 264px;
  overflow: auto;
}

.filter-list.years {
  max-height: 224px;
}

.filter-list li a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 8px;
  border-radius: 6px;
  color: var(--ic-ink-2);
  font-size: 13.5px;
  line-height: 1.45;
}

.filter-list li a:hover {
  background: #f4f7fb;
  color: var(--ic-accent);
}

.filter-list li a.active {
  background: var(--ic-accent-soft);
  color: var(--ic-accent);
  font-weight: 600;
}

.filter-list .count {
  flex: none;
  color: var(--ic-muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.filter-list li a.active .count {
  color: var(--ic-accent);
}

.filter-empty {
  display: block;
  padding: 8px;
  color: var(--ic-muted);
  font-size: 13px;
}

/* 年份两列，避免侧栏过长 */
.filter-list.years {
  display: grid;
  grid-template-columns: 1fr;
  column-gap: 6px;
}

.filter-list.years li a {
  padding: 5px 8px;
}

.filter-list.years .count {
  font-size: 11px;
}

/* ---------------- 结果区 ---------------- */

.results {
  min-width: 0;
}

.results-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 0 4px 12px;
  color: var(--ic-muted);
  font-size: 13.5px;
}

.results-head b {
  color: var(--ic-ink);
  font-size: 15px;
}

.results-head .sep {
  margin: 0 4px;
  color: #c3ccd8;
}

.results-head .reset {
  margin-left: 10px;
  padding: 2px 9px;
  border: 1px solid var(--ic-line);
  border-radius: 20px;
  background: #fff;
  font-size: 12.5px;
  color: var(--ic-muted);
}

.results-head .reset:hover {
  border-color: var(--ic-accent);
  color: var(--ic-accent);
}

.sort {
  display: flex;
  gap: 4px;
  background: #fff;
  border: 1px solid var(--ic-line);
  border-radius: 8px;
  padding: 3px;
}

.sort a {
  padding: 4px 12px;
  border-radius: 6px;
  color: var(--ic-ink-2);
  font-size: 13px;
}

.sort a:hover {
  color: var(--ic-accent);
}

.sort a.active {
  background: var(--ic-accent);
  color: #fff;
}

/* ---------------- 案例卡片 ---------------- */

.card {
  background: var(--ic-surface);
  border: 1px solid var(--ic-line);
  border-radius: var(--ic-radius);
  padding: 18px 20px;
  margin-bottom: 12px;
  box-shadow: var(--ic-shadow);
  transition: border-color .15s, box-shadow .15s;
}

.card:hover {
  border-color: #c9dbf3;
  box-shadow: 0 2px 6px rgba(24, 44, 68, .08), 0 10px 26px rgba(24, 44, 68, .07);
}

.card h3 {
  margin: 0 0 8px;
  font-size: 17px;
  line-height: 1.5;
  font-weight: 700;
}

.card h3 a {
  color: var(--ic-ink);
}

.card h3 a:hover {
  color: var(--ic-accent);
}

.card .meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px;
  color: var(--ic-muted);
  font-size: 13px;
}

.card .meta .dot {
  color: #c3ccd8;
}

.card .meta .affil {
  color: var(--ic-ink-2);
}

.card .abstract {
  margin: 10px 0 12px;
  color: var(--ic-ink-2);
  font-size: 14px;
  line-height: 1.75;
  text-align: justify;
}

.card .tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 4px;
  background: #f1f4f8;
  color: var(--ic-ink-2);
  font-size: 12px;
  line-height: 1.7;
}

.tag.journal {
  background: var(--ic-accent-soft);
  color: var(--ic-accent);
  font-weight: 600;
}

.tag.plain {
  background: transparent;
  border: 1px solid var(--ic-line);
  color: var(--ic-muted);
}

.tag.ok {
  background: var(--ic-ok-soft);
  color: var(--ic-ok);
}

.tag.no {
  background: #f5f6f8;
  color: #9aa7b5;
}

/* 标签可点击态（首页 PDF 全文标签、新闻栏目切换） */
a.tag {
  text-decoration: none;
  transition: background .15s, color .15s;
}

a.tag:hover {
  background: var(--ic-accent-soft);
  color: var(--ic-accent);
}

/* 新闻列表/详情侧栏：子栏目缩进、最新发布标题单行省略 */
.filter-list li a.sub {
  padding-left: 24px;
}

.filter-list.latest li a > span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------------- 分页 ---------------- */

.pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  justify-content: center;
  margin: 22px 0 8px;
}

.pager a,
.pager span {
  min-width: 34px;
  height: 34px;
  padding: 0 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--ic-line);
  border-radius: 7px;
  background: #fff;
  color: var(--ic-ink-2);
  font-size: 13.5px;
  font-variant-numeric: tabular-nums;
}

.pager a:hover {
  border-color: var(--ic-accent);
  color: var(--ic-accent);
}

.pager .current {
  background: var(--ic-accent);
  border-color: var(--ic-accent);
  color: #fff;
  font-weight: 600;
}

.pager .disabled {
  color: #b7c1cd;
  background: #f7f9fb;
}

.pager .ellipsis {
  border: 0;
  background: transparent;
  color: var(--ic-muted);
  min-width: 20px;
  padding: 0;
}

.pager .step {
  padding: 0 14px;
}

/* ---------------- 提示块 ---------------- */

.notice {
  color: var(--ic-ink-2);
}

.notice h3 {
  margin: 0 0 6px;
  font-size: 16px;
}

.notice p {
  margin: 6px 0;
  font-size: 14px;
}

.notice.error h3 {
  color: #c0392b;
}

.notice .hint {
  color: var(--ic-muted);
  font-size: 13px;
}

.notice .reset {
  display: inline-block;
  padding: 4px 12px;
  border: 1px solid var(--ic-accent);
  border-radius: 6px;
}

/* ---------------- 页脚 ---------------- */

.footer {
  border-top: 1px solid var(--ic-line);
  background: var(--ic-surface);
  padding: 20px 0 30px;
  color: var(--ic-muted);
  font-size: 13px;
}

.footer-inner {
  width: min(1280px, calc(100% - 40px));
  margin: 0 auto;
}

.footer p {
  margin: 0 0 6px;
}

.footer-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 16px;
}
.footer-note {
  margin: 0;
  font-size: 12.5px;
}
.footer-clear {
  margin-left: 12px;
  font-size: 12px;
  color: var(--ic-accent);
  text-decoration: none;
}
.footer-clear:hover {
  text-decoration: underline;
}
.footer-nav {
  display: flex;
  gap: 16px;
  font-size: 12.5px;
}
.footer-nav a {
  color: var(--ic-muted);
  text-decoration: none;
}
.footer-nav a:hover {
  color: var(--ic-accent);
}

.footer-bottom {
  margin-top: 10px;
  font-size: 12.5px;
  color: var(--ic-muted);
}
.footer-bottom .sep {
  margin: 0 8px;
  opacity: .4;
}
.footer-bottom a {
  color: var(--ic-muted);
  text-decoration: none;
}
.footer-bottom a:hover {
  color: var(--ic-accent);
}

/* ---------------- 响应式 ---------------- */

@media (max-width: 1080px) {
  .topbar-stats {
    display: none;
  }
}

@media (max-width: 960px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .filter-list {
    max-height: 210px;
  }
}

@media (max-width: 640px) {
  .topbar-inner {
    width: calc(100% - 24px);
    flex-wrap: wrap;
    gap: 10px;
    padding: 10px 0;
  }

  .search {
    order: 3;
    flex-basis: 100%;
    max-width: none;
  }

  .page {
    width: calc(100% - 24px);
    margin-top: 14px;
  }

  .sidebar {
    grid-template-columns: 1fr;
  }

  .card {
    padding: 14px 15px;
  }

  .card h3 {
    font-size: 16px;
  }

  .card .abstract {
    font-size: 13.5px;
  }
}

/* ==========================================================================
   详情页（show.php）
   ========================================================================== */

.crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 0 4px 14px;
  color: var(--ic-muted);
  font-size: 13px;
}

.crumbs a {
  color: var(--ic-ink-2);
}

.crumbs a:hover {
  color: var(--ic-accent);
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 308px;
  gap: 18px;
  align-items: start;
}

.detail-layout .panel {
  background: var(--ic-surface);
  border: 1px solid var(--ic-line);
  border-radius: var(--ic-radius);
  box-shadow: var(--ic-shadow);
  padding: 22px 24px;
  margin-bottom: 16px;
}

.detail-layout .panel:last-child {
  margin-bottom: 0;
}

.panel h2 {
  margin: 0 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--ic-line);
  color: var(--ic-ink-2);
  font-size: 15px;
  letter-spacing: .3px;
}

.article-title {
  margin: 0 0 14px;
  font-size: 24px;
  line-height: 1.45;
  font-weight: 700;
}

.author-line {
  color: var(--ic-ink);
  font-size: 14.5px;
}

.affil-line {
  margin-top: 4px;
  color: var(--ic-muted);
  font-size: 13px;
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px 18px;
  margin-top: 18px;
  padding: 14px 16px;
  background: #f8fafc;
  border: 1px solid var(--ic-line);
  border-radius: 8px;
}

.meta-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 13.5px;
}

.meta-item .k {
  color: var(--ic-muted);
  font-size: 12px;
}

.meta-item .v {
  color: var(--ic-ink);
}

.section-block {
  margin-top: 20px;
}

.abstract-full {
  color: var(--ic-ink-2);
  font-size: 14.5px;
  line-height: 1.85;
  text-align: justify;
}

.abstract-full p {
  margin: 0 0 10px;
}

.kw-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.kw {
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--ic-accent-soft);
  color: var(--ic-accent);
  font-size: 12.5px;
}

.pdf-frame {
  width: 100%;
  height: 720px;
  border: 1px solid var(--ic-line);
  border-radius: 8px;
  background: #f7f9fb;
}

.pdf-hint,
.panel-hint {
  margin: 10px 0 0;
  color: var(--ic-muted);
  font-size: 12.5px;
}

.muted {
  color: var(--ic-muted);
}

.side-item {
  display: flex;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px dashed #eef2f6;
  font-size: 13.5px;
}

.side-item:last-child {
  border-bottom: 0;
}

.side-item .k {
  flex: none;
  width: 62px;
  color: var(--ic-muted);
  font-size: 12.5px;
}

.side-item .v {
  color: var(--ic-ink-2);
}

.side-item .v.small {
  font-size: 12.5px;
  line-height: 1.7;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  border: 1px solid var(--ic-accent);
  border-radius: 7px;
  background: var(--ic-accent);
  color: #fff;
  font-size: 13.5px;
  cursor: pointer;
}

.btn:hover {
  background: #1358ab;
  border-color: #1358ab;
  color: #fff;
}

.btn.block {
  display: flex;
  width: 100%;
  margin-top: 8px;
}

.btn.ghost {
  background: #fff;
  color: var(--ic-accent);
}

.btn.ghost:hover {
  background: var(--ic-accent-soft);
  color: var(--ic-accent);
}

.btn:disabled {
  background: #f2f4f7;
  border-color: var(--ic-line);
  color: #9aa7b5;
  cursor: not-allowed;
}

.related {
  display: flex;
  flex-direction: column;
}

.related a {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px dashed #eef2f6;
  color: var(--ic-ink-2);
  font-size: 13.5px;
  line-height: 1.6;
}

.related a:last-child {
  border-bottom: 0;
}

.related a:hover {
  color: var(--ic-accent);
}

.related .y {
  flex: none;
  color: var(--ic-muted);
  font-size: 12px;
}

@media (max-width: 960px) {
  .detail-layout {
    grid-template-columns: 1fr;
  }

  .pdf-frame {
    height: 520px;
  }
}

@media (max-width: 640px) {
  .detail-layout .panel {
    padding: 16px 15px;
  }

  .article-title {
    font-size: 20px;
  }

  .pdf-frame {
    height: 420px;
  }
}

/* ---------------- 新闻详情页 ---------------- */

/* 详情改为两栏后，主栏占据 detail-layout 第一列，侧栏由 .detail-layout 的 308px 列承载 */
.detail-main {
  min-width: 0;
}

.detail-main .content {
  font-size: 15px;
  line-height: 1.9;
  color: var(--ic-ink-2);
  word-break: break-word;
}

.detail-main .content p {
  margin: 0 0 1em;
}

.detail-main .content img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  margin: 12px 0;
}

.detail-main .content h2,
.detail-main .content h3,
.detail-main .content h4 {
  color: var(--ic-ink);
  margin: 1.5em 0 0.6em;
  line-height: 1.4;
}

.detail-main .content h2 { font-size: 18px; }
.detail-main .content h3 { font-size: 16px; }
.detail-main .content h4 { font-size: 15px; }

.detail-main .content blockquote {
  margin: 1em 0;
  padding: 12px 20px;
  border-left: 4px solid var(--ic-accent);
  background: var(--ic-accent-soft);
  color: var(--ic-ink-2);
  border-radius: 0 6px 6px 0;
}

.detail-main .content ul,
.detail-main .content ol {
  margin: 1em 0;
  padding-left: 1.5em;
}

.detail-main .content li {
  margin-bottom: 0.5em;
}

.detail-main .content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1em 0;
  font-size: 14px;
}

.detail-main .content th,
.detail-main .content td {
  border: 1px solid var(--ic-line);
  padding: 8px 12px;
  text-align: left;
}

.detail-main .content th {
  background: var(--ic-bg);
  font-weight: 600;
}

.detail-main .tags {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px dashed var(--ic-line);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.prevnext {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-top: 20px;
  padding: 16px 20px;
  background: var(--ic-bg);
  border-radius: var(--ic-radius);
  font-size: 14px;
}

.prevnext .prev,
.prevnext .next {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.prevnext .next {
  justify-content: flex-end;
  text-align: right;
}

.prevnext .label {
  flex: none;
  color: var(--ic-muted);
  font-size: 13px;
}

.prevnext a {
  color: var(--ic-ink-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.prevnext a:hover {
  color: var(--ic-accent);
}

.prevnext .disabled {
  color: var(--ic-muted);
}

/* 新闻详情页侧栏的栏目导航与案例详情保持一致的面板样式（列表项沿用 .filter-list） */
@media (max-width: 640px) {
  .prevnext {
    flex-direction: column;
    gap: 12px;
  }

  .prevnext .next {
    justify-content: flex-start;
    text-align: left;
  }
}
