/* 索引云 · 全局设置浮窗（配合 assets/settings.js） */

/* 顶栏齿轮按钮：和导航项同样的尺寸，放在导航最右边 */
.gear-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 32px;
  margin-left: 4px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text-2);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--dur-2) var(--ease),
              color var(--dur-2) var(--ease),
              border-color var(--dur-2) var(--ease),
              box-shadow var(--dur-2) var(--ease),
              transform .34s var(--spring);
}
.gear-btn:hover { background: var(--surface-2); color: var(--text); border-color: var(--line-strong); box-shadow: var(--sh-1); }
.gear-btn:active { transform: scale(.93); }
.gear-btn.on { background: var(--brand-soft); color: var(--brand); border-color: var(--brand); transform: rotate(45deg); box-shadow: 0 0 0 3px var(--brand-ring); }

/* 遮罩 + 浮窗 */
.set-mask {
  position: fixed;
  inset: 0;
  z-index: var(--z-settings, 1200);
  background: rgba(20, 25, 33, .42);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.set-mask.open { display: flex; animation: maskIn var(--dur-2) var(--ease) backwards; }
body.set-locked { overflow: hidden; }

.set-win {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--sh-4);
  width: 100%;
  max-width: 760px;
  height: 540px;
  max-height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: setIn var(--dur-3) var(--ease-out);
}
@keyframes setIn { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }

.set-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 20px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.set-head h2 { font-size: 17px; margin: 0; font-weight: 600; }
.set-x {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px;
  border: none; background: transparent; color: var(--text-2);
  border-radius: 8px; cursor: pointer;
  transition: background var(--dur-2) var(--ease), color var(--dur-2) var(--ease), transform var(--dur-1) var(--ease);
}
.set-x:hover { background: var(--surface-2); color: var(--text); }
.set-x:active { transform: scale(.9) rotate(90deg); }

.set-body { flex: 1; display: flex; min-height: 0; }

/* 面板里的轻提示（试听结果、指定语音等），避免用原生 alert */
.set-tip {
  flex-shrink: 0;
  max-height: 0;
  overflow: hidden;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--text-2);
  background: var(--brand-soft);
  padding: 0 20px;
  white-space: pre-wrap;
  transition: max-height .16s ease, padding .16s ease;
}
.set-tip.show { max-height: 120px; padding: 10px 20px; }

/* 本机没有这一档语音的选项：看起来就知道点了没用 */
.chip.off { opacity: .45; }

.set-nav {
  width: 156px;
  flex-shrink: 0;
  border-right: 1px solid var(--line);
  background: var(--surface-2);
  padding: 12px 10px;
  overflow: auto;
}
.set-tab {
  display: flex; align-items: center; gap: 9px;
  width: 100%;
  padding: 9px 12px;
  margin-bottom: 2px;
  border: none;
  background: transparent;
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 14px;
  color: var(--text-2);
  cursor: pointer;
  text-align: left;
  transition: background var(--dur-2) var(--ease),
              color var(--dur-2) var(--ease),
              box-shadow var(--dur-2) var(--ease),
              transform var(--dur-1) var(--ease);
}
.set-tab:hover { background: rgba(29, 33, 41, .05); color: var(--text); }
.set-tab:active { transform: scale(.975); }
.set-tab.on {
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 600;
  box-shadow: inset 3px 0 0 var(--brand);
  animation: tabIn var(--dur-3) var(--ease-out);
}
@keyframes tabIn {
  from { transform: translateX(-3px); }
  to   { transform: translateX(0); }
}
.set-tab .ic {
  width: 20px; height: 20px; flex-shrink: 0;
  border-radius: 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--text-3);
  font-size: 11px; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background var(--dur-2) var(--ease),
              border-color var(--dur-2) var(--ease),
              color var(--dur-2) var(--ease),
              transform var(--dur-3) var(--spring);
}
.set-tab.on .ic { background: var(--brand); border-color: var(--brand); color: #fff; transform: scale(1.06); }

.set-pane { flex: 1; overflow: auto; padding: 18px 24px 28px; }
.set-desc { font-size: 13px; color: var(--text-3); line-height: 1.7; margin-bottom: 20px; }
.set-group { margin-bottom: 24px; }
.set-group h3 {
  font-size: 14px; margin: 0 0 14px; font-weight: 600;
  padding-bottom: 8px; border-bottom: 1px solid var(--line);
}
.set-item { margin-bottom: 20px; }
.set-item:last-child { margin-bottom: 0; }
.set-item .lab { font-size: 13px; color: var(--text-2); font-weight: 500; margin-bottom: 8px; }
.set-item .hint { font-size: 12px; color: var(--text-3); line-height: 1.75; margin-top: 8px; }
.set-item .hint code {
  background: var(--surface-2); padding: 1px 5px; border-radius: 4px;
  font-size: 11px; font-family: ui-monospace, Consolas, monospace;
}
.set-item .btn-row { margin-top: 10px; }
.set-item a.btn { text-decoration: none; }

@media (max-width: 640px) {
  .set-mask { padding: 12px; }
  .set-win { height: auto; max-height: calc(100vh - 24px); }
  .set-body { flex-direction: column; }
  .set-nav {
    width: auto;
    display: flex;
    gap: 6px;
    border-right: none;
    border-bottom: 1px solid var(--line);
    padding: 10px 12px;
    overflow-x: auto;
  }
  .set-tab { width: auto; white-space: nowrap; margin-bottom: 0; }
  .set-pane { padding: 16px; }
}

/* ---- 设置里的「麦克风测试」盒子（2026-10-14 加）--------------------
   接在「麦克风测试」那颗按钮下面。四行：授权 / 设备 / 音量条 / 试读，底下一条说明。
   ⚠️ 颜色一律走 style.css 的 token，别写死。 */
.mic-test {
  margin-top: 12px;
  padding: 12px 14px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  line-height: 1.7;
}
.mic-test .mt-row { display: flex; align-items: center; gap: 8px; min-height: 22px; }
.mic-test .mt-row + .mt-row { margin-top: 4px; }
.mic-test .mt-k { flex: 0 0 34px; color: var(--text-3); }
.mic-test .mt-v { flex: 1 1 auto; min-width: 0; color: var(--text-2); word-break: break-word; }
.mic-test .mt-lvl { flex: 0 0 64px; text-align: right; font-variant-numeric: tabular-nums; color: var(--text-3); }
.mic-test .mt-bar {
  flex: 1 1 auto; height: 8px; border-radius: 999px; overflow: hidden;
  background: var(--surface-3); border: 1px solid var(--line);
}
.mic-test .mt-bar i {
  display: block; height: 100%; width: 0%;
  background: var(--ok);
  border-radius: 999px;
  transition: width 90ms linear;
}
.mic-test .mt-note {
  margin-top: 10px; padding-top: 9px;
  border-top: 1px dashed var(--line);
  font-size: 12px; color: var(--text-3); line-height: 1.75;
}
