:root {
  --brand: #4f83cc;        /* 主色：柔和蓝 */
  --brand-light: #7dabea;  /* 亮色：更浅的雾蓝 */
  --bg: #ffffff;
  --bg-card: #f7f9fc;
  --text: #222222;
  --text2: #555555;
  --text3: #999999;
  --border: #e5e7eb;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,.08);
  --max-width: 900px;
  --gap: 1rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121212;
    --bg-card: #1e1e1e;
    --text: #e5e7eb;
    --text2: #9ca3af;
    --text3: #6b7280;
    --border: #2a2a2a;
  }
}

/* ===== 重置 ===== */
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }

/* ===== 布局 ===== */
.container { width: 90%; max-width: var(--max-width); margin: auto; }

/* 顶部导航 */
.top-bar {
  background: linear-gradient(90deg, var(--brand) 0%, var(--brand-light) 100%);
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 10;
}
.top-bar__inner {
  display: flex;
  align-items: center;
  gap: var(--gap);
  padding: .75rem 0;
}
.logo img { height: 32px; }
.search-form {
  flex: 1 1 auto;
  display: flex;
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.search-input {
  flex: 1;
  border: 0;
  padding: .6rem .8rem;
  font-size: 1rem;
}
.search-btn {
  border: 0;
  background: var(--brand);
  color: #fff;
  padding: 0 .8rem;
  cursor: pointer;
  font-size: 1.2rem;
}
.help-link { color: #fff; font-size: .9rem; white-space: nowrap; }

/* 统计栏 */
.summary { padding: .8rem 0; background: var(--bg-card); border-bottom: 1px solid var(--border); }
.summary-txt { font-size: .9rem; color: var(--text2); }
.export-link { margin-left: .5rem; }

/* 结果卡片 */
.result-list { padding: 1.2rem 0; }
.result-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 1rem 1.2rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow);
  transition: transform .2s;
}
.result-card:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,.12); }
.result-title { font-size: 1.1rem; margin-bottom: .3rem; }
.result-meta { font-size: .85rem; color: var(--text2); margin-bottom: .5rem; }
.result-preview { font-size: .95rem; color: var(--text2); margin-bottom: .6rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.result-id { font-size: .8rem; color: var(--text3); }

/* 分页 */
.pagination { padding: 1.2rem 0 2rem; text-align: center; }
.pagination-btn {
  display: inline-block;
  padding: .5rem 1rem;
  margin: 0 .3rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
}
.pagination-btn:hover { background: var(--brand); color: #fff; text-decoration: none; }

/* 页脚 */
.footer { padding: 1.5rem 0; font-size: .85rem; color: var(--text3); text-align: center; border-top: 1px solid var(--border); }

/* 响应式 */
@media (max-width: 768px) {
  .top-bar__inner { flex-wrap: wrap; }
  .search-form { width: 100%; order: 3; margin-top: .5rem; }
  .result-card { padding: .8rem 1rem; }
}

/* ========= 详情页追加 ========= */
.breadcrumb {
  font-size: .85rem;
  color: var(--text2);
}
.breadcrumb a { color: var(--brand); }
.breadcrumb .sep { margin: 0 .4rem; }

.detail-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 1.5rem;
  padding: 1.5rem 0;
}
.meta-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 1.2rem;
  box-shadow: var(--shadow);
  align-self: start;
}
.case-title {
  font-size: 1.2rem;
  margin-bottom: 1rem;
  line-height: 1.4;
}
.meta-list { font-size: .9rem; }
.meta-list dt {
  float: left;
  clear: left;
  width: 70px;
  color: var(--text2);
  margin-bottom: .5rem;
}
.meta-list dd {
  margin-left: 80px;
  margin-bottom: .5rem;
  word-break: break-word;
}
.meta-list .break-word { word-break: break-all; }

.fulltext-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 1.5rem 2rem;
  box-shadow: var(--shadow);
}
.fulltext-title {
  font-size: 1.1rem;
  margin-bottom: 1rem;
  padding-bottom: .5rem;
  border-bottom: 1px solid var(--border);
}
.fulltext-body {
  line-height: 1.8;
  color: var(--text);
  white-space: pre-wrap;
}
.fulltext-body p { margin: 1em 0; text-indent: 2em; }

/* 响应式：小屏叠栏 */
@media (max-width: 768px) {
  .detail-grid { grid-template-columns: 1fr; }
  .fulltext-card { padding: 1rem; }
}

/* 打印时隐藏无关元素 */
@media print {
  .top-bar, .footer, .breadcrumb { display: none; }
  .detail-grid { grid-template-columns: 1fr; box-shadow: none; }
  .meta-card, .fulltext-card { box-shadow: none; border: 1px solid #ccc; }
}