/* ============================================================
   40J 换算工具页组件样式
   与 retro.css 共用纸感底色 / 墨色文字 / 细线分隔 / 无圆角
   仅保留换算页专属组件，旧版蓝紫渐变已移除
   ============================================================ */

/* ---------- 标题 ---------- */
.card-header h3 {
  font-size: 1.08rem;
  letter-spacing: .04em;
}

.card-header h3 i {
  color: var(--accent);
  margin-right: .3rem;
}

/* ---------- 单位分组标题 ---------- */
html body .card-body .row h5 {
  margin: .15rem 0 .6rem;
  padding-bottom: .3rem;
  border-bottom: 1px dashed var(--rule-strong);
  font-size: .86rem;
  font-weight: 600;
  letter-spacing: .08em;
}

/* ---------- 单位列表 ---------- */
html body .list-group {
  border: 1px solid var(--rule);
  background: var(--surface);
}

html body .list-group-item {
  padding: .42rem .7rem !important;
  font-size: .86rem;
  border-color: var(--rule) !important;
  background: transparent !important;
  transition: background-color .15s ease;
}

html body .list-group-item:hover {
  background: var(--paper-deep) !important;
}

/* 列表右侧的换算结果 */
html body .list-group-item .badge {
  background: transparent !important;
  color: var(--accent);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: .82rem;
  font-weight: 600;
  letter-spacing: 0;
  padding: 0;
  white-space: nowrap;
}

/* ---------- 公式块 / 单位徽章（各页复用同一外观） ---------- */
.formula-box,
.unit-badge,
.unit-chip,
.quick-convert-item,
.temp-formula,
.mass-formula,
.area-formula,
.pressure-formula {
  display: inline-block;
  max-width: 100%;
  margin: 0 .4rem .4rem 0;
  padding: .32rem .6rem;
  background: var(--paper-deep);
  border: 1px solid var(--rule);
  border-left: 3px solid var(--rule-strong);
  border-radius: 0;
  box-shadow: none;
  color: var(--ink-soft);
  font-size: .84rem;
  line-height: 1.55;
  vertical-align: top;
  word-break: break-word;
}

.highlight,
.formula-highlight {
  color: var(--accent);
  font-weight: 700;
}

/* ---------- 快速换算 / 速查区 ---------- */
.quick-convert,
.quick-ref {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-top: 2px solid var(--accent);
  border-radius: 0;
  box-shadow: none;
  padding: .7rem .85rem;
  margin-bottom: .9rem;
}

.quick-convert h4,
.quick-convert h5,
.quick-ref h5 {
  margin: 0 0 .5rem;
  font-size: .9rem;
  letter-spacing: .04em;
}

.quick-convert h4 i,
.quick-convert h5 i,
.quick-ref h5 i {
  color: var(--accent);
}

/* ---------- 说明块 ---------- */
.note-box {
  background: var(--paper-deep);
  border: 1px solid var(--rule);
  border-left: 3px solid var(--gold);
  border-radius: 0;
  padding: .6rem .85rem;
  color: var(--ink-soft);
  font-size: .84rem;
}

.note-box h5 {
  margin: 0 0 .4rem;
  font-size: .88rem;
}

.note-box ul {
  margin: 0;
  padding-left: 0;
}

.note-box li {
  margin-bottom: .2rem;
  padding-left: 1rem;
  position: relative;
}

.note-box li:last-child {
  margin-bottom: 0;
}

.note-box li::before {
  content: "·";
  position: absolute;
  left: .25rem;
  color: var(--accent);
  font-weight: 700;
}

/* ---------- 换算表区域 ---------- */
html body .tab-content {
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
}

/* 页面内的大标题统一为细线分隔的小节标题 */
html body .card-body h2 {
  margin: 1.3rem 0 .7rem !important;
  padding-top: .7rem;
  border-top: 1px solid var(--rule);
  font-size: 1.02rem;
  letter-spacing: .08em;
  text-align: left !important;
}

html body .card-body h2 i {
  color: var(--accent);
  margin-right: .3rem;
}

/* 嵌套的说明卡片 */
html body .card-body>.card {
  margin-bottom: .8rem;
}

html body .card-body>.card:last-of-type {
  margin-bottom: 0;
}

/* 列表/卡片内的说明文字 */
.card-body p,
.note-box p {
  color: var(--ink-soft);
  font-size: .86rem;
}

.card-body ol,
.card-body ul {
  color: var(--ink-soft);
  font-size: .86rem;
}

/* ---------- 汇率页 ---------- */
.fx-result {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--accent);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  word-break: break-all;
}

.fx-rate-line {
  font-size: .86rem;
  color: var(--ink-soft);
}

.fx-swap {
  min-width: 40px;
}

/* ---------- 相关推荐 ---------- */
.relate {
  margin-top: 1.2rem;
  padding-top: .8rem;
  border-top: 1px solid var(--rule);
}

.relate-title {
  margin-bottom: .5rem;
  font-family: Georgia, "Songti SC", "STSong", "SimSun", serif;
  font-size: .95rem;
  font-weight: 600;
  letter-spacing: .06em;
}

.relate-item {
  display: inline-block;
  margin: 0 .4rem .4rem 0;
}

.relate-item a {
  display: inline-block;
  padding: .3rem .6rem;
  background: var(--paper-deep);
  border: 1px solid var(--rule);
  color: var(--ink-soft);
  font-size: .82rem;
  text-decoration: none;
}

.relate-item a:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--paper);
  text-decoration: none;
}

/* ---------- 小屏 ---------- */
@media (max-width: 576px) {
  .formula-box,
  .unit-badge,
  .unit-chip,
  .quick-convert-item,
  .temp-formula,
  .mass-formula,
  .area-formula,
  .pressure-formula {
    display: block;
    margin-right: 0;
  }

  .fx-result {
    font-size: 1.1rem;
  }
}
