/* ===== 基础 ===== */
:root { --maxw: 1100px; --btn-bg:#f8fafc; --btn-bd:#d1d5db; --btn-tx:#111827; --btn-bg-hover:#f3f4f6; }
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial,
               "PingFang SC","Hiragino Sans GB","Microsoft YaHei", sans-serif;
  color: #111827;
  background: #f9fafb;
  line-height: 1.5;
}
/* 顶部导航 */
.top-nav {
  display: flex;
  justify-content: flex-start;
  gap: 16px;
  padding: 12px;
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
  max-width: var(--maxw);
  margin: 0 auto;
}
.tab {
  background: none;
  border: none;
  padding: 8px 16px;
  font-size: 14px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  color: #374151;
}
.tab:hover {
  border-color: #93c5fd;
}
.tab.active {
  border-color: #3b82f6;
  color: #111827;
}
.tab-content { display: none; }
.tab-content.active { display: block; }

.about-main {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 24px 12px;
  line-height: 1.6;
  color: #374151;

}
.about-main p { margin-bottom: 1em; }
.about-main h2 {
  font-size: 16px;
  margin: 24px 0 8px;
}
.about-main ul {
  margin: 0 0 1em 1.2em;
  padding-left: 1.2em;
}
.about-main .tag-note {
  font-size: 14px;
  color: #6b7280;
  margin-bottom: 8px;
}
.about-main pre.keywords {
  white-space: pre-wrap;
  word-break: break-word;
  background: #f3f4f6;
  padding: 8px;
  border-radius: 4px;
  font-size: 13px;
  margin-top: 4px;
}
.about-main ul.tag-keys > li { margin-bottom: 12px; }

header, main, footer { max-width: var(--maxw); margin: 0 auto; padding: 12px; }
header h1 { margin: 8px 0 12px; line-height: 1.2; }

/* ===== 统一按钮风格 ===== */
button { cursor: pointer; }
.btn {
  height: 44px;
  padding: 0 14px;
  font-size: 14px;
  line-height: 42px;
  border-radius: 12px;
  border: 1px solid var(--btn-bd);
  background: var(--btn-bg);
  color: var(--btn-tx);
}
.btn:hover { background: var(--btn-bg-hover); }
.btn:disabled { opacity: .6; cursor: not-allowed; }
.btn-secondary { background: #fff; }

/* 让交互更有手感：过渡 & 轻微提升 */
#bilingual-toggle,
#reset {
  transition: background-color .15s ease, border-color .15s ease,
              box-shadow .15s ease, transform .06s ease;
}

/* 悬停：颜色更亮一点，边框提亮，加轻微阴影与 1px 上浮 */
#bilingual-toggle:hover,
#reset:hover {
  background: #eef2ff;              /* 略带蓝感的浅底 */
  border-color: #93c5fd;            /* 与现有 hover 体系协调 */
  box-shadow: 0 2px 6px rgba(59,130,246,.15);
  transform: translateY(-1px);
}

/* 按下：回落一点，模拟按压 */
#bilingual-toggle:active,
#reset:active {
  transform: translateY(0);
  box-shadow: 0 1px 3px rgba(0,0,0,.12) inset;
}

/* 键盘导航的可见焦点（更易用） */
#bilingual-toggle:focus-visible,
#reset:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(59,130,246,.45);
  border-color: #60a5fa;
}

/* 避免禁用态也出现动画或阴影 */
#bilingual-toggle:disabled,
#reset:disabled {
  transform: none;
  box-shadow: none;
}

/* 用户偏好减少动效时，关闭位移动画（无障碍） */
@media (prefers-reduced-motion: reduce) {
  #bilingual-toggle,
  #reset {
    transition: background-color .15s ease, border-color .15s ease, box-shadow .15s ease;
  }
  #bilingual-toggle:hover,
  #reset:hover,
  #bilingual-toggle:active,
  #reset:active {
    transform: none;
  }
}


/* ===== 控件区域：三排网格 ===== */
.controls { display: grid; gap: 12px; }
.controls .row { display: grid; gap: 12px; align-items: center; }

/* 第 1 排：关键词 + 期刊 */
.row-top { grid-template-columns: minmax(340px, 1fr) minmax(220px, 320px); }

/* 第 2 排：提示 + 起始 + 终止 + 快捷时间 + 双语 + 重置
   两个日期输入用 1fr 1fr 等分，保证视觉等宽 */
.row-actions {
  grid-template-columns: auto 1fr 1fr auto auto auto;
}

.date-input,
#date_from, #date_to {
  width: 100%;
  min-width: 0;           /* 防止 placeholder 影响布局 */
  /* 可选：等宽数字，让日期更整齐 */
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}


/* 第 3 排：tag 按钮单独成行 */
.row-tags {
  grid-template-columns: auto 1fr;
  align-items: start;
}

/* 输入控件统一 */
.controls select,
.controls input[type="date"],
.controls input[type="text"],
.controls input[type="search"],
#q, #journal, #date_from, #date_to, #bilingual-toggle, #reset, .range-btn {
  height: 44px;
  padding: 0 14px;
  font-size: 14px;
  line-height: 42px;
  border-radius: 12px;
  border: 1px solid #d1d5db;
  background: #fff;
}

/* 快捷时间按钮并排紧凑 */
.quick-range { display: inline-flex; gap: 8px; flex-wrap: nowrap; }
.quick-range .range-btn { white-space: nowrap; }

/* 日期提示与输入 */
.date-hint { color: #374151; font-size: 14px; white-space: nowrap; }
#date_from, #date_to { width: 100%; }
#bilingual-toggle { white-space: nowrap; }

/* ===== tag 按钮筛选 ===== */
.tag-filter-hint { color:#374151; font-size:14px; line-height: 44px; }
.tag-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.tag-btn {
  border-radius: 999px;
  border: 1px solid #d1d5db;
  background: #fff;
  position: relative;
}
.tag-btn::before {
  content: "";
  position: absolute;
  inset: 2px;
  border-radius: 999px;
  background: var(--tag-bg, #e5e7eb);
  opacity: .25;
}
.tag-btn.is-active {
  border-color: transparent;
  background: var(--tag-bg, #e5e7eb);
  color: #0b1021;
}

/* 类型按钮筛选（样式与 tag 按钮一致） */
.type-filter-hint { color:#374151; font-size:14px; line-height: 44px; }
.type-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.type-btn {
  height: 44px;
  padding: 0 14px;
  font-size: 14px;
  line-height: 42px;
  border-radius: 999px;
  border: 1px solid #d1d5db;
  background: #fff;
  position: relative;
}
.type-btn.is-active {
  border-color: transparent;
  background: #e5e7eb;
  color: #0b1021;
}

/* 窄屏换行（可复用 row-tags 的模式） */
@media (max-width: 980px) {
  .row-types { grid-template-columns: 1fr; }
}

/* 列表与卡片 */
#stats { color: #374151; font-size: 13px; margin-top: 8px; }
#list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 12px;
}
.card { border: 1px solid #e5e7eb; border-radius: 12px; padding: 12px; background: #fff; transition: border-color .2s, box-shadow .2s; }
.card:hover { border-color: #3b82f6; box-shadow: 0 2px 8px rgba(0,0,0,.05); }
.title { font-weight: 600; margin-bottom: 6px; }
.meta  { color: #6b7280; font-size: 12px; margin-bottom: 6px; }
.abs   { color: #111827; }

/* DOI 徽章 */
.badge {
  display: inline-block;
  padding: 2px 6px;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  font-size: 11px;
  margin-right: 6px;
}

/* 结果卡片内的 tag chips（彩色）*/
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.tag-chip {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  color: #0b1021;
  background: var(--tag-bg, #e5e7eb);
  border: 1px solid rgba(0,0,0,.06);
}

/* 分页 */
.pager { display: flex; align-items: center; gap: 10px; justify-content: center; margin: 20px 0; }

/* 双语文本细节 */
.t-en, .a-en { opacity: .85; }
.t-cn + .t-en, .a-cn + .a-en { margin-top: .25rem; }

.t-en + .t-cn,
.a-en + .a-cn {
  margin-top: .50rem;  /* 中英文之间多留一些空隙 */
}

/* 响应式 */
@media (max-width: 980px) {
  .row-top { grid-template-columns: 1fr; }
  .row-actions { grid-template-columns: 1fr 1fr; }
  .row-tags { grid-template-columns: 1fr; }
  .quick-range { order: -1; }
}
@media (max-width: 600px) {
  .row-actions { grid-template-columns: 1fr; }
  .quick-range { justify-content: flex-start; }
}

/* 关键词高亮 */
mark { background: #fff3a3; padding: 0 .08em; border-radius: 2px; }

/* 页脚访问量条 */
.site-stats { margin-top: 8px; color: #6b7280; font-size: 12px; }

/* 数据库最近更新时间条 */
.db-updated{
  margin: 4px 0 10px;
  color: #6b7280;
  font-size: 12px;
}
#pageinfo, #pagecount {
  font-size: 14px;
  color: #374151;
}

/* 回到顶部按钮 */
.back-to-top {
  position: fixed;
  right: 50px;
  bottom: 80px;
  z-index: 1000;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: #4b5563;   /* 深灰 */
  color: white;
  font-size: 20px;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
  display: none;         /* 默认隐藏，滚动后显示 */
}
.back-to-top:hover {
  background: #374151;   /* hover 更深 */
  transform: translateY(-2px);
}
.back-to-top:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.5); /* focus 环绕 */
}
.back-to-top:active svg {
  transform: scale(0.9);       /* 点击时缩小一点 */
}
.back-to-top svg {
  width: 60%;   /* 占按钮宽度的 60% */
  height: 60%;  /* 保持比例缩放 */
  fill: currentColor; /* 跟随按钮文字颜色 */
}

.goto-input{width:5rem;margin-left:.5rem;}