/* =====================================================================
   refine.css · 2026-11-01 · 现有美学上的轻量精修（非重构）
   原则：沿用科泰红 #aa2837 + 炭灰 + 工业白；只收敛杂色、柔化阴影、
   统一焦点与交互细节。最后加载，便于整体回退（删掉此文件引用即可）。
   ===================================================================== */

/* ---------- 1. 全局质感 ---------- */
html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; }
::selection { background: rgba(170, 40, 55, .14); color: inherit; }
/* 低优先级的统一焦点环：已有的组件焦点样式仍然优先 */
:where(a, button, input, select, textarea, summary):focus-visible { outline: 2px solid rgba(170, 40, 55, .55); outline-offset: 2px; }

/* ---------- 2. 顶部信息条：绿色徽标醒目友好，电话突出 ---------- */
.utility-bar .wechat-badge {
  background: #07c160;
  color: #fff !important;
  border: none;
  border-radius: 3px;
  padding: 1px 6px;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.4;
  display: inline-block;
  margin-right: 4px;
}

/* ---------- 3. 导航「联系我们」：去掉厚投影，更克制 ---------- */
.nav a.nav-contact-btn { box-shadow: none; letter-spacing: .03em; border-radius: 3px; }
.nav a.nav-contact-btn:hover { box-shadow: 0 4px 12px -6px rgba(170, 40, 55, .55); }

/* ---------- 4. 页头直接搜索栏（标准常规交互，直接输入，回车即搜，轻量下拉） ---------- */
.site-header .header-search-form {
  position: relative;
  display: inline-flex;
  align-items: center;
  width: clamp(210px, 17vw, 270px);
  height: 38px;
  background: #ffffff;
  border: 1px solid #d5d8de;
  border-radius: 4px;
  padding: 0 6px 0 11px;
  box-sizing: border-box;
  transition: border-color .18s ease, box-shadow .18s ease;
}
.site-header .header-search-form:focus-within {
  border-color: #aa2837;
  box-shadow: 0 0 0 3px rgba(170, 40, 55, .12);
}
.site-header .header-search-form > svg {
  flex: none;
  width: 15px;
  height: 15px;
  fill: none;
  stroke: #727780;
  stroke-width: 1.8;
  stroke-linecap: round;
}
.site-header .header-search-form:focus-within > svg {
  stroke: #aa2837;
}
.site-header .header-search-input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0 !important;
  outline: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
  color: #1e2229;
  font: inherit;
  font-size: 13px;
  padding: 0 6px;
  line-height: normal;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.site-header .header-search-input::placeholder {
  color: #8c929c;
  font-size: 12.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.site-header .hs-submit {
  display: none;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 0;
  background: #aa2837;
  color: #ffffff;
  border-radius: 3px;
  cursor: pointer;
}
.site-header .hs-submit svg {
  width: 13px;
  height: 13px;
  stroke: #ffffff;
  stroke-width: 2.2;
}
.site-header .header-search-form:focus-within .hs-submit {
  display: inline-flex;
}

/* 浮动下拉联想列表（轻量挂靠在搜索框下方，非全屏遮罩） */
.header-search-dropdown {
  position: absolute;
  top: calc(100% + 5px);
  right: 0;
  width: max(100%, 320px);
  max-height: 380px;
  overflow-y: auto;
  background: #ffffff;
  border: 1px solid #d5d8de;
  border-radius: 4px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .14);
  z-index: 100;
}
.header-search-dropdown a.suggestion {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid #f0f1f3;
  color: #1e2229;
  font-size: 13px;
  text-decoration: none;
  line-height: 1.4;
  transition: background-color .12s ease;
}
.header-search-dropdown a.suggestion:last-child {
  border-bottom: 0;
}
.header-search-dropdown a.suggestion:hover {
  background: #f5f6f8;
  color: #aa2837;
}
.header-search-dropdown a.suggestion span {
  font: 11px var(--mono, ui-monospace, monospace);
  color: #727782;
  white-space: nowrap;
}

@media (min-width: 1101px) and (max-width: 1320px) {
  .site-header .header-search-form { width: 170px; }
}
@media (max-width: 1100px) {
  .site-header .header-search-form { width: 200px; }
}

/* ---------- 5. 移动端优化：顶部栏邮箱改电话直拨 ---------- */
@media (max-width: 760px) {
  /* 手机端：隐藏邮箱，显示电话/微信，点击直拨 */
  .utility-bar .utility-email { display: none !important; }
  .utility-bar a:first-child { display: inline-flex !important; }
  .utility-bar .utility-wechat-highlight {
    display: inline-flex !important;
    align-items: center;
    font-size: 11px;
    color: #242629;
  }
  .utility-bar .utility-wechat-highlight strong {
    font-size: 12px;
    letter-spacing: .02em;
    color: #aa2837;
  }
  .utility-bar > .wrap > div {
    width: 100%;
    justify-content: center;
  }
  .site-header .header-search-form { width: 135px; height: 32px; padding: 0 6px; }
  .site-header .header-search-input { font-size: 12px; padding: 0 4px; }
  .header-search-dropdown { width: calc(100vw - 32px); right: -60px; }
}

/* ---------- 6. 手机端首页：隐藏元素周期表，只保留标语 + 搜索 ---------- */
@media (max-width: 600px) {
  section.periodic-hero[aria-labelledby="home-periodic-title"] .periodic-toolbar,
  section.periodic-hero[aria-labelledby="home-periodic-title"] .periodic-scroll,
  section.periodic-hero[aria-labelledby="home-periodic-title"] .element-inspector { display: none !important; }
  section.periodic-hero[aria-labelledby="home-periodic-title"] .periodic-panel { padding-top: 0; border-top: 0; }
  /* 搜索在手机上更醒目：从下划线变成完整输入框 */
  section.periodic-hero[aria-labelledby="home-periodic-title"] .hero-search > div {
    border: 1px solid rgba(255, 255, 255, .28); border-radius: 0; padding: 4px 4px 4px 12px; background: rgba(255, 255, 255, .06);
  }
  section.periodic-hero[aria-labelledby="home-periodic-title"] .hero-search input { font-size: 16px; border-radius: 0; }
}

/* ---------- 7. 技术专栏详情页排版、字间距与学术文献质感重构 ---------- */
.article-detail-wrap {
  max-width: 820px !important;
  margin: 0 auto !important;
  padding: 32px 16px 80px !important;
}

.article-header {
  border-bottom: 1px solid #e2e8f0 !important;
  padding-bottom: 24px !important;
  margin-bottom: 32px !important;
}

.article-header h1 {
  font-size: clamp(24px, 3.2vw, 34px) !important;
  font-weight: 700 !important;
  color: #0f172a !important;
  letter-spacing: 0.015em !important;
  line-height: 1.4 !important;
  margin: 0 0 16px !important;
}

.article-body {
  font-size: 16px !important;
  line-height: 1.85 !important;
  color: #334155 !important;
  letter-spacing: 0.018em !important;
  text-align: justify !important;
  text-justify: inter-ideograph !important;
  word-break: break-word !important;
}

.article-body p {
  margin: 0 0 20px !important;
  line-height: 1.85 !important;
  font-size: 16px !important;
  color: #334155 !important;
  letter-spacing: 0.018em !important;
}

.article-body h2,
.article-h2 {
  font-size: 21px !important;
  font-weight: 700 !important;
  color: #0f172a !important;
  margin: 48px 0 18px !important;
  padding: 4px 0 10px !important;
  border-bottom: 2px solid #e2e8f0 !important;
  letter-spacing: 0.02em !important;
  line-height: 1.45 !important;
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
}

.article-body h2::before {
  content: "" !important;
  display: inline-block !important;
  width: 4px !important;
  height: 20px !important;
  background: var(--red, #aa2837) !important;
  border-radius: 2px !important;
  flex-shrink: 0 !important;
}

.article-body h3,
.article-h3 {
  font-size: 17.5px !important;
  font-weight: 600 !important;
  color: #1e293b !important;
  margin: 32px 0 14px !important;
  line-height: 1.5 !important;
  letter-spacing: 0.015em !important;
  display: block !important;
}

.article-body ul,
.article-body ol,
.article-list {
  padding-left: 24px !important;
  margin: 0 0 24px !important;
}

.article-body li,
.article-list li {
  margin-bottom: 10px !important;
  line-height: 1.8 !important;
  color: #334155 !important;
  letter-spacing: 0.015em !important;
}

.article-body strong,
.article-body b {
  font-weight: 600 !important;
  color: #0f172a !important;
}

.article-summary-card {
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
  border-left: 4px solid var(--red, #aa2837) !important;
  border-radius: 4px !important;
  padding: 20px 24px !important;
  margin-bottom: 32px !important;
}

.article-tool-gateway {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  border-left: 4px solid var(--red, #aa2837) !important;
  border-radius: 4px !important;
  padding: 22px 26px !important;
}
