/* ============================================================
   settings.css —— 设置面板（设计图 5）、更多设置、选择字体页（设计图 4）
   ============================================================ */

/* ---------- 通用步进器 ---------- */

.stepper {
  display: flex;
  align-items: center;
  gap: 8px;
}

.stepper-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 54px;
  height: 36px;
  /* 按设计图是圆角方块，不是全胶囊：胶囊只用在翻页选项与字体入口上 */
  border-radius: 10px;
  background: var(--ui-chip);
  color: var(--ui-chip-text);
  font-size: 16px;
}

.stepper-btn:disabled {
  opacity: 0.35;
}

.stepper-value {
  min-width: 40px;
  text-align: center;
  font-size: 16px;
  color: var(--ui-text);
  font-variant-numeric: tabular-nums;
}

/* ---------- 设置面板 ---------- */

.panel-settings .row {
  gap: 8px;
}

.entry-chip {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: none;
  margin-left: auto;
  max-width: 42vw;
  padding: 9px 14px;
  border-radius: 999px;
  background: var(--ui-chip);
  color: var(--ui-chip-text);
  font-size: 15px;
}

.entry-chip-name {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.entry-chip-arrow {
  flex: none;
  color: var(--ui-sub);
  font-size: 15px;
}

/* 背景色块 */

.swatch-group {
  display: flex;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.swatch {
  position: relative;
  flex: 1;
  min-width: 0;
  height: 40px;
  border-radius: 14px;
  border: 1.5px solid var(--ui-line);
  /* 具体色值由 JS 按主题配置写到 --swatch-bg，样式文件里不重复一份颜色 */
  background: var(--swatch-bg);
  display: flex;
  align-items: center;
  justify-content: center;
}

.swatch.is-active {
  box-shadow: inset 0 0 0 2px var(--ui-accent);
  border-color: var(--ui-accent);
}

.swatch-moon {
  width: 16px;
  height: 16px;
  stroke: #C9CDD2;
  stroke-width: 1.6;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* 底部三个次级入口 */

.panel-extra {
  display: flex;
  align-items: center;
  padding: 12px 8px;
}

.panel-extra .icon-btn {
  gap: 5px;
  font-size: 13px;
}

.panel-extra .icon-btn svg {
  width: 22px;
  height: 22px;
}

/* ---------- 更多设置面板 ---------- */

.panel-more .row-label {
  width: 4.5em;
}

/* 更多设置面板顶部返回栏：复用"选择字体"页的返回按钮，恢复回到设置面板的入口 */
.panel-more-head {
  display: flex;
  align-items: center;
  padding: 4px 12px 0;
}

.convert-group {
  max-width: 60%;
}

/* ---------- 选择字体页 ---------- */

.sheet-full {
  position: absolute;
  inset: 0;
  z-index: 70;
  display: flex;
  flex-direction: column;
  background: var(--read-bg);
  color: var(--ui-text);
  transform: translateY(100%);
  /* visibility 延迟到收起动画结束才生效，否则关闭时会瞬间消失、看不到下滑动画 */
  transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1), visibility 0s linear 0.3s;
  visibility: hidden;
}

.sheet-full.is-open {
  transform: translateY(0);
  visibility: visible;
  transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
}

.sheet-head {
  flex: none;
  display: flex;
  align-items: center;
  padding: calc(env(safe-area-inset-top) + 12px) 12px 12px;
}

.sheet-back {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  color: var(--ui-text);
}

.sheet-back svg {
  width: 24px;
  height: 24px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sheet-title {
  flex: 1;
  margin-right: 40px;
  text-align: center;
  font-size: 18px;
  font-weight: 600;
}

.sheet-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 6px 16px calc(env(safe-area-inset-bottom) + 24px);
}

.font-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.font-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 62px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1.5px solid var(--ui-line);
  background: transparent;
  color: var(--ui-text);
  text-align: left;
}

.font-card.is-active {
  border-color: var(--ui-accent);
  background: var(--ui-accent-soft);
}

.font-card-name {
  font-size: 17px;
  line-height: 1.35;
  /* 字体预览族由 JS 按字体配置写到 --card-font */
  font-family: var(--card-font, inherit);
}

/* 行尾右侧区域：提示文案 + 开关 */
.row-end {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--ui-sub);
}

.font-card-size {
  flex: none;
  font-size: 12px;
  color: var(--ui-sub);
}

.font-card-check {
  flex: none;
  width: 20px;
  height: 20px;
  stroke: var(--ui-accent);
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  visibility: hidden;
}

.font-card.is-active .font-card-size {
  display: none;
}

.font-card.is-active .font-card-check {
  visibility: visible;
}
