/* ==========================================================================
   输入项说明浮层 — 「这个数是什么 / 去哪儿查」
   配合 assets/help.js 使用，颜色全部走 styles.css 的令牌（自动适配深色）
   ========================================================================== */

/* ---------- 触发按钮 ---------- */
.q {
  position: relative;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  padding: 0;
  border: 1px solid var(--hair-strong);
  border-radius: 50%;
  background: transparent;
  color: var(--text-3);
  font-family: inherit;
  font-size: 10px;
  font-weight: 600;
  font-style: normal;
  line-height: 1;
  cursor: pointer;
  vertical-align: 1px;
  -webkit-tap-highlight-color: transparent;
  transition: color 0.16s var(--ease), border-color 0.16s var(--ease), background 0.16s var(--ease);
}

/* 热区放大到 32px，视觉尺寸不变 */
.q::after {
  content: "";
  position: absolute;
  inset: -8px;
  border-radius: 50%;
}

.q:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-weak);
}

.q:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.q[aria-expanded="true"] {
  color: #fff;
  border-color: var(--accent);
  background: var(--accent);
}

/* 收入格：标签与问号同一行，压缩不了文字 */
.inc__head {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.inc__head .inc__label {
  flex: 0 1 auto;
  min-width: 0;
}

/* 扣除行：问号跟在字段名后面，不占固定宽度 */
.ded-row__k .q {
  margin-left: 6px;
}

.subhead .q {
  margin-left: 8px;
  vertical-align: 0;
}

/* 小标题里用来示意「点这个」的问号图形，不是按钮 */
.subhead span b {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border: 1px solid var(--hair-strong);
  border-radius: 50%;
  color: var(--text-2);
  font-size: 9px;
  font-weight: 600;
  line-height: 1;
  vertical-align: -1px;
}

/* ---------- 浮层 ---------- */
.help-mask {
  position: fixed;
  inset: 0;
  z-index: 399;
  background: rgba(0, 0, 0, 0.32);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  animation: help-fade 0.18s var(--ease);
}

.help-pop {
  position: fixed;
  z-index: 400;
  top: 0;
  left: 0;
  width: min(360px, calc(100vw - 24px));
}

.help-pop__card {
  display: flex;
  flex-direction: column;
  max-height: min(70vh, 520px);
  border: 1px solid var(--hair-strong);
  border-radius: 15px;
  background: var(--bg-elevated);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  outline: none;
  animation: help-in 0.18s var(--ease);
}

.help-pop__bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 14px 11px;
  border-bottom: 1px solid var(--hair);
}

.help-pop__title {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.1px;
}

.help-pop__x {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  margin: -2px -2px -2px 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--chip);
  color: var(--text-2);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.16s var(--ease), color 0.16s var(--ease);
}

.help-pop__x:hover {
  background: var(--chip-hover);
  color: var(--text);
}

.help-pop__body {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 12px 14px 15px;
}

/* ---------- 内容块 ---------- */
.help-sec + .help-sec {
  margin-top: 13px;
}

.help-sec__t {
  display: block;
  margin-bottom: 5px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.6px;
  color: var(--text-3);
  text-transform: uppercase;
}

.help-sec ul,
.help-sec ol {
  margin: 0;
  padding-left: 15px;
  font-size: 12.5px;
  line-height: 1.62;
  color: var(--text-2);
}

.help-sec li + li {
  margin-top: 3px;
}

.help-sec--exc ul {
  color: var(--text-3);
}

.help-sec--src {
  padding: 10px 11px;
  border-radius: 10px;
  background: var(--inset);
}

.help-sec--src .help-sec__t {
  color: var(--accent);
}

.help-sec--src ol {
  padding-left: 16px;
  color: var(--text);
}

.help-sec--src li + li {
  margin-top: 6px;
}

/* 七项标准：术语 + 说明两列 */
.help-dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 5px 10px;
  margin: 0;
  font-size: 12.5px;
  line-height: 1.5;
}

.help-dl dt {
  color: var(--text);
  white-space: nowrap;
}

.help-dl dd {
  margin: 0;
  color: var(--text-2);
}

.help-note {
  margin: 13px 0 0;
  padding-top: 11px;
  border-top: 1px solid var(--hair);
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--text-3);
}

.help-note::before {
  content: "注意：";
  font-weight: 600;
  color: var(--text-2);
}

/* ---------- 动效 ---------- */
@keyframes help-in {
  from { opacity: 0; transform: translateY(-4px) scale(0.985); }
  to   { opacity: 1; transform: none; }
}

@keyframes help-fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ---------- 小屏：底部抽屉 ---------- */
@media (max-width: 780px) {
  .help-pop.is-sheet {
    top: auto;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
  }

  .help-pop.is-sheet .help-pop__card {
    max-height: 76vh;
    border-radius: 18px 18px 0 0;
    border-bottom: 0;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    animation: help-up 0.22s var(--ease);
  }

  .help-pop.is-sheet .help-pop__body {
    padding-bottom: 20px;
  }

  .help-pop.is-sheet .help-pop__bar::before {
    content: "";
    position: absolute;
    top: 6px;
    left: 50%;
    width: 34px;
    height: 4px;
    margin-left: -17px;
    border-radius: 999px;
    background: var(--hair-strong);
  }

  .help-pop.is-sheet .help-pop__bar {
    position: relative;
    padding-top: 17px;
  }

  @keyframes help-up {
    from { transform: translateY(14px); opacity: 0; }
    to   { transform: none; opacity: 1; }
  }
}

@media (prefers-reduced-motion: reduce) {
  .help-pop__card,
  .help-mask {
    animation: none;
  }
}

/* ---------- 打印 ---------- */
@media print {
  .q,
  .help-pop,
  .help-mask {
    display: none !important;
  }
}
