/* 法易 - 无障碍样式：大字模式、色盲模式、焦点可见、跳过链接 */
:root {
  --a11y-focus-ring: 2px solid var(--legal-main, #2c5282);
  --a11y-focus-offset: 2px;
}

/* 键盘焦点可见（不影响鼠标点击） */
*:focus {
  outline: none;
}
*:focus-visible {
  outline: var(--a11y-focus-ring);
  outline-offset: var(--a11y-focus-offset);
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: var(--a11y-focus-ring);
  outline-offset: var(--a11y-focus-offset);
}

/* 跳过主内容链接（默认隐藏，获得焦点时显示） */
.skip-link {
  position: absolute;
  top: -100px;
  left: 0.5rem;
  z-index: 9999;
  padding: 0.75rem 1rem;
  background: var(--legal-dark, #1e3a5f);
  color: #fff;
  font-size: 1rem;
  border-radius: 0.5rem;
  transition: top 0.2s ease;
}
.skip-link:focus {
  top: 0.5rem;
  outline: 2px solid #fff;
  outline-offset: 2px;
}

/* ---------- 大字模式 ---------- */
body.a11y-large-text {
  font-size: 118%;
}
body.a11y-large-text .section-title,
body.a11y-large-text h1,
body.a11y-large-text h2,
body.a11y-large-text h3 {
  font-size: 1.35em;
}
body.a11y-large-text .btn-primary,
body.a11y-large-text .btn-secondary,
body.a11y-large-text .btn-outline,
body.a11y-large-text .nav-link,
body.a11y-large-text .input-field {
  font-size: 1.05rem;
  padding: 0.6rem 1.2rem;
}
body.a11y-large-text .section-desc,
body.a11y-large-text .prose,
body.a11y-large-text p {
  font-size: 1.1rem;
  line-height: 1.65;
}

/* ---------- 色盲友好模式（高对比 + 减少红绿依赖） ---------- */
body.a11y-colorblind {
  filter: contrast(1.08);
}
body.a11y-colorblind .btn-primary,
body.a11y-colorblind .nav-link.active,
body.a11y-colorblind .sim-scene-btn.active,
body.a11y-colorblind .sim-role-btn.active {
  background-color: #1e3a5f;
  border-color: #1e3a5f;
  color: #fff;
}
body.a11y-colorblind .risk-dim-fill.high,
body.a11y-colorblind .text-red-600 {
  color: #b22222;
  background-color: #b22222;
}
body.a11y-colorblind a {
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* 无障碍设置浮动按钮 */
.a11y-trigger {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9998;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  background: var(--legal-main, #2c5282);
  color: #fff;
  border: 2px solid #fff;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, background 0.2s ease;
}
.a11y-trigger:hover {
  background: var(--legal-dark, #1e3a5f);
  transform: scale(1.05);
}
.a11y-trigger:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}
.a11y-trigger svg {
  width: 1.5rem;
  height: 1.5rem;
}

/* 无障碍设置面板 */
.a11y-panel {
  position: fixed;
  bottom: 4.5rem;
  right: 1.5rem;
  z-index: 9997;
  width: 320px;
  max-width: calc(100vw - 3rem);
  background: #fff;
  border-radius: 0.75rem;
  box-shadow: 0 10px 40px rgba(0,0,0,0.15);
  border: 1px solid #e5e7eb;
  padding: 1rem 1.25rem;
  display: none;
}
.a11y-panel.is-open {
  display: block;
}
.a11y-panel h3 {
  margin: 0 0 0.75rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--legal-dark, #1e3a5f);
}
.a11y-panel .a11y-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}
.a11y-panel .a11y-option label {
  font-size: 0.9rem;
  cursor: pointer;
  margin: 0;
}
.a11y-panel input[type="checkbox"] {
  width: 1.1rem;
  height: 1.1rem;
  cursor: pointer;
}
.a11y-panel .a11y-voice-hint {
  font-size: 0.8rem;
  color: #6b7280;
  margin-top: 0.5rem;
}
