/* ========================================
   Flow Time - 计时应用样式
   ======================================== */

/* ---------- 基础重置 ---------- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  overflow: hidden;
  font-family: 'Cormorant Garamond', Georgia, serif;
  background: var(--bg);
  color: var(--t1);
  -webkit-font-smoothing: antialiased;
  -webkit-user-select: none;
  user-select: none;
}

/* ---------- CSS变量 ---------- */
:root {
  /* 基础变量 */
  --bg: #0a0a0a;
  --sf: #141414;
  --sf2: #1e1e1e;
  --bd: rgba(255, 255, 255, .08);
  --t1: #f8f5f0;
  --t2: #d0c8b8;
  --t3: #8a8278;
  --ac: #c8a050;
  --ac2: #e0c878;
  --ac3: #a08030;
  --gr: #5cb87a;
  --R: 716.3;

  /* 计时器变量 */
  --ring-color: #c8a050;
  --ring-glow: rgba(200, 160, 80, .18);
  --dot-color: #e8d090;
  --ring-inner-bg: #1a1810;
  --ring-gradient-start: #e8d090;
  --ring-gradient-end: #907030;
}

/* ---------- 主题定义 ---------- */
.theme-silver {
  --bg: #0f1020;
  --sf: #1a1b30;
  --sf2: #252640;
  --bd: rgba(140, 160, 180, .12);
  --t1: #f8fafc;
  --t2: #cbd5e1;
  --t3: #94a3b8;
  --ac: #94a3b8;
  --ac2: #cbd5e1;
  --ac3: #64748b;
  --ring-color: #94a3b8;
  --ring-glow: rgba(148, 163, 184, .18);
  --dot-color: #cbd5e1;
  --ring-inner-bg: #151625;
  --ring-gradient-start: #cbd5e1;
  --ring-gradient-end: #64748b;
}

.theme-green {
  --bg: #102010;
  --sf: #1a2a1a;
  --sf2: #253525;
  --bd: rgba(82, 130, 45, .12);
  --t1: #f0f5f0;
  --t2: #c8d5c8;
  --t3: #8a9a8a;
  --ac: #52822d;
  --ac2: #6aa33d;
  --ac3: #3d6a1d;
  --ring-color: #6aa33d;
  --ring-glow: rgba(106, 163, 61, .18);
  --dot-color: #8ac35d;
  --ring-inner-bg: #152515;
  --ring-gradient-start: #8ac35d;
  --ring-gradient-end: #3d6a1d;
}

.theme-purple {
  --bg: #1e102e;
  --sf: #2a1a3a;
  --sf2: #362546;
  --bd: rgba(138, 95, 216, .12);
  --t1: #f5f0f8;
  --t2: #d8c8e0;
  --t3: #a898b8;
  --ac: #8a5fd8;
  --ac2: #a886e0;
  --ac3: #6a40b8;
  --ring-color: #a886e0;
  --ring-glow: rgba(168, 134, 224, .18);
  --dot-color: #c8a8f0;
  --ring-inner-bg: #251535;
  --ring-gradient-start: #c8a8f0;
  --ring-gradient-end: #6a40b8;
}

.theme-light {
  --bg: #f8fafc;
  --sf: #f1f5f9;
  --sf2: #e2e8f0;
  --bd: rgba(148, 163, 184, .15);
  --t1: #1e293b;
  --t2: #475569;
  --t3: #64748b;
  --ac: #64748b;
  --ac2: #94a3b8;
  --ac3: #475569;
  --ring-color: #64748b;
  --ring-glow: rgba(100, 116, 139, .2);
  --dot-color: #94a3b8;
  --ring-inner-bg: #f1f5f9;
  --ring-gradient-start: #94a3b8;
  --ring-gradient-end: #475569;
}

.theme-pink {
  --bg: #28101a;
  --sf: #351a25;
  --sf2: #422530;
  --bd: rgba(244, 114, 182, .12);
  --t1: #fdf5f8;
  --t2: #f0d0dc;
  --t3: #c0a0ac;
  --ac: #f472b6;
  --ac2: #f9a8d4;
  --ac3: #db2777;
  --ring-color: #f9a8d4;
  --ring-glow: rgba(249, 168, 212, .18);
  --dot-color: #fcd3e8;
  --ring-inner-bg: #301520;
  --ring-gradient-start: #fcd3e8;
  --ring-gradient-end: #db2777;
}

.theme-sakura {
  --bg: #fff5f8;
  --sf: #ffe0e8;
  --sf2: #ffccd8;
  --bd: rgba(251, 113, 133, .25);
  --t1: #4c1d33;
  --t2: #7c4d5f;
  --t3: #ac7d8f;
  --ac: #fb7185;
  --ac2: #fca5b5;
  --ac3: #e11d48;
  --ring-color: #ffffff;
  --ring-glow: rgba(255, 255, 255, .35);
  --dot-color: #fff8fa;
  --ring-inner-bg: #ffe0e8;
  --ring-gradient-start: #ffffff;
  --ring-gradient-end: #fca5b5;
}

.theme-peach {
  --bg: #f9a8d4;
  --sf: #fcd3e8;
  --sf2: #fde9f3;
  --bd: rgba(255, 255, 255, .3);
  --t1: #7c2d12;
  --t2: #9c4d32;
  --t3: #bc6d52;
  --ac: #ffffff;
  --ac2: #fff8fa;
  --ac3: #ffd0e0;
  --ring-color: #ffffff;
  --ring-glow: rgba(255, 255, 255, .35);
  --dot-color: #fff8fa;
  --ring-inner-bg: #fcd3e8;
  --ring-gradient-start: #ffffff;
  --ring-gradient-end: #f9a8d4;
}

/* ---------- 布局 ---------- */
.app {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  transition: transform .3s ease-out;
}

.bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at 15% 85%, rgba(212, 168, 83, .05) 0%, transparent 50%),
              radial-gradient(ellipse at 85% 15%, rgba(90, 60, 20, .03) 0%, transparent 50%),
              var(--bg);
}

.bg::after {
  content: '';
  position: absolute;
  inset: 0;
  opacity: .015;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 128px 128px;
}

.sw {
  position: relative;
  width: 100%;
  height: 100%;
  z-index: 1;
  overflow: hidden;
  margin: 0 auto;
  transition: all .5s cubic-bezier(.32, .72, 0, 1);
}

.pg {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 1.25rem;
  gap: .6rem;
  transition: transform .45s cubic-bezier(.32, .72, 0, 1);
  overflow-y: auto;
  overflow-x: hidden;
}

.pg::-webkit-scrollbar {
  display: none;
}

/* ---------- 品牌标识 ---------- */
.brand {
  text-align: center;
  flex-shrink: 0;
  padding: .2rem 0;
}

.brand h1 {
  font-size: clamp(1.8rem, 6vw, 2.8rem);
  font-weight: 300;
  letter-spacing: .25em;
  text-transform: uppercase;
  line-height: 1;
}

.brand .sub {
  font-family: 'DM Mono', monospace;
  font-size: clamp(.45rem, 1.2vw, .58rem);
  letter-spacing: .4em;
  text-transform: uppercase;
  color: var(--t3);
  margin-top: .2rem;
}

/* ---------- 模式卡片 ---------- */
.modes {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  width: 100%;
  flex-shrink: 0;
}

.card {
  position: relative;
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .7rem .85rem;
  background: var(--sf);
  border: 1px solid var(--bd);
  border-radius: 12px;
  cursor: pointer;
  transition: all .25s;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(212, 168, 83, .04), transparent);
  opacity: 0;
  transition: opacity .25s;
}

.card:hover {
  border-color: rgba(255, 255, 255, .08);
  transform: translateY(-1px);
}

.card:hover::before {
  opacity: 1;
}

.card:active {
  transform: scale(.98);
  border-color: rgba(212, 168, 83, .1);
}

.card.running::after {
  content: '';
  position: absolute;
  top: 0;
  left: 12%;
  right: 12%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--ac), transparent);
  opacity: .5;
}

.card-ico {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--sf2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}

.card-ico svg {
  width: 17px;
  height: 17px;
  stroke: var(--ac);
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.card-body {
  position: relative;
  z-index: 1;
  min-width: 0;
}

.card-title {
  font-size: clamp(.82rem, 2.2vw, .95rem);
  font-weight: 500;
  letter-spacing: .015em;
}

.card-desc {
  font-family: 'DM Mono', monospace;
  font-size: clamp(.4rem, 1.1vw, .52rem);
  color: var(--t3);
  letter-spacing: .02em;
  margin-top: .05rem;
}

.card .gear {
  position: relative;
  z-index: 2;
  margin-left: auto;
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: none;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .2s;
}

.card .gear svg {
  width: 14px;
  height: 14px;
  stroke: var(--t3);
  fill: none;
  stroke-width: 1.5;
  transition: stroke .2s;
}

.card .gear:hover {
  background: var(--sf2);
}

.card .gear:hover svg {
  stroke: var(--t2);
}

.card .gear:active {
  background: rgba(212, 168, 83, .08);
}

/* ---------- 主页进度条 ---------- */
.home-bar {
  display: none;
  align-items: center;
  gap: .6rem;
  padding: .55rem .85rem;
  background: var(--sf);
  border: 1px solid var(--bd);
  border-radius: 12px;
  cursor: pointer;
  flex-shrink: 0;
  transition: all .25s;
  width: 100%;
  position: relative;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0, 0, 0, .1);
}

.home-bar:hover {
  border-color: rgba(255, 255, 255, .08);
}

.home-bar:active {
  background: var(--sf2);
}

.home-bar .hb-time {
  font-family: 'DM Mono', monospace;
  font-size: clamp(.9rem, 2.8vw, 1.15rem);
  letter-spacing: .04em;
  position: relative;
  z-index: 1;
}

.home-bar .hb-label {
  font-family: 'DM Mono', monospace;
  font-size: clamp(.4rem, 1.1vw, .5rem);
  color: var(--t3);
  letter-spacing: .08em;
  text-transform: uppercase;
  position: relative;
  z-index: 1;
}

.home-bar .hb-hint {
  font-family: 'DM Mono', monospace;
  font-size: clamp(.35rem, 1vw, .45rem);
  color: var(--ac);
  letter-spacing: .06em;
  text-transform: uppercase;
  margin-left: auto;
  position: relative;
  z-index: 1;
}

.home-bar .hb-arrow {
  width: 14px;
  height: 14px;
  stroke: var(--t3);
  fill: none;
  stroke-width: 1.5;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}

.home-bar .hb-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 1.5px;
  background: var(--ac);
  opacity: .35;
  transition: width .3s linear;
  border-radius: 0 1px 0 0;
}

/* ---------- 分隔线和快捷按钮 ---------- */
.divider {
  width: 40px;
  height: 1px;
  background: var(--bd);
  flex-shrink: 0;
  margin: .1rem 0;
}

.quick-row {
  display: flex;
  gap: .4rem;
  flex-shrink: 0;
  width: 100%;
  justify-content: center;
  flex-wrap: wrap;
}

.quick-btn {
  background: var(--sf);
  border: 1px solid var(--bd);
  border-radius: 8px;
  padding: .4rem .6rem;
  cursor: pointer;
  text-align: center;
  transition: all .2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  flex: 0 0 auto;
}

.quick-btn:hover {
  border-color: rgba(255, 255, 255, .08);
}

.quick-btn:active {
  transform: scale(.93);
  background: var(--sf2);
  border-color: rgba(212, 168, 83, .1);
}

.quick-btn .qt {
  font-family: 'DM Mono', monospace;
  font-size: clamp(.7rem, 2vw, .88rem);
  color: var(--t1);
  line-height: 1.1;
}

.quick-btn .ql {
  font-family: 'DM Mono', monospace;
  font-size: clamp(.3rem, .8vw, .38rem);
  color: var(--t3);
  letter-spacing: .06em;
  text-transform: uppercase;
  margin-top: .08rem;
}

/* ---------- 计时器页面 ---------- */
.timer-page {
  justify-content: space-between;
  padding-top: 1.2rem;
  padding-bottom: max(1.5rem, env(safe-area-inset-bottom, 1.5rem));
  transition: all .5s cubic-bezier(.32, .72, 0, 1);
}

.timer-page.immersive {
  padding: 0;
}

.timer-top {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  flex-shrink: 0;
  position: relative;
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
  transition: all .3s ease-out;
}

.timer-bottom {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .8rem;
  justify-content: center;
  flex-shrink: 0;
  width: 100%;
  margin-top: 2rem;
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
  transition: all .3s ease-out;
}

.timer-page.immersive .timer-top {
  opacity: 0;
  transform: rotate(-180deg) scale(.95);
  pointer-events: none;
}

.timer-page.immersive .timer-bottom {
  opacity: 0;
  transform: rotate(180deg) scale(.95);
  pointer-events: none;
}

.timer-page.immersive .timer-center {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.timer-page.immersive .ring-wrap {
  width: clamp(320px, 90vw, 500px);
  height: clamp(320px, 90vw, 500px);
}

.timer-page.immersive .ring-center {
  width: 100vmax;
  height: 100vmax;
  border-radius: 0;
  z-index: 10;
}

.timer-page.immersive .digits {
  font-size: clamp(3rem, 15vmin, 5.5rem);
}

.timer-page.immersive .immersive-hint {
  opacity: 0;
}

.timer-page.immersive ~ .dots {
  display: none;
}

/* ---------- 悬浮按钮 ---------- */
.floating-back-btn,
.floating-orientation-btn {
  display: none;
  position: fixed;
  font-family: 'DM Mono', monospace;
  font-size: clamp(.5rem, 1.3vw, .6rem);
  color: var(--t3);
  letter-spacing: .1em;
  text-transform: uppercase;
  cursor: pointer;
  padding: .4rem .6rem;
  border-radius: 6px;
  background: none;
  border: none;
  z-index: 1001;
  transition: color .2s ease, background .2s ease;
}

.floating-back-btn {
  bottom: 1rem;
  right: 1rem;
}

.floating-orientation-btn {
  top: 1rem;
  right: 1rem;
  align-items: center;
  justify-content: center;
}

.floating-theme-btn {
  display: flex;
  position: fixed;
  top: 1rem;
  left: 1rem;
  font-family: 'DM Mono', monospace;
  font-size: clamp(.5rem, 1.3vw, .6rem);
  color: var(--t3);
  letter-spacing: .1em;
  text-transform: uppercase;
  cursor: pointer;
  padding: .4rem .6rem;
  border-radius: 6px;
  background: none;
  border: none;
  align-items: center;
  justify-content: center;
  z-index: 1001;
}

body.timer-active .floating-back-btn,
body.timer-active .floating-orientation-btn {
  display: flex;
}

.floating-back-btn:hover,
.floating-orientation-btn:hover,
.floating-theme-btn:hover {
  color: var(--t2);
  background: var(--sf);
}

.floating-back-btn:active,
.floating-orientation-btn:active,
.floating-theme-btn:active {
  color: var(--t1);
}

.orientation-icon,
.theme-icon,
.back-icon {
  width: 16px;
  height: 16px;
  fill: currentColor;
  stroke: none;
  transition: transform .3s ease;
}

.floating-orientation-btn.rotated .orientation-icon,
.floating-theme-btn.rotated .theme-icon,
.floating-back-btn.rotated .back-icon {
  transform: rotate(90deg);
}

/* 沉浸模式动画 */
.floating-theme-btn,
.floating-orientation-btn,
.floating-back-btn {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
  transition: all .3s ease-out .2s;
}

body.immersive-active .floating-theme-btn {
  opacity: 0;
  transform: rotate(-180deg) scale(.95);
  pointer-events: none;
  transition: all .3s ease-out;
}

body.immersive-active .floating-orientation-btn,
body.immersive-active .floating-back-btn {
  opacity: 0;
  transform: rotate(180deg) scale(.95);
  pointer-events: none;
  transition: all .3s ease-out;
}

/* ---------- 主题菜单 ---------- */
.theme-menu {
  position: fixed;
  top: 3.5rem;
  left: 1rem;
  background: var(--sf);
  border: 1px solid var(--bd);
  border-radius: 12px;
  padding: 10px;
  z-index: 1002;
  min-width: 160px;
  display: flex;
  flex-direction: column;
  gap: .2rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .15);
  opacity: 0;
  transform: translateY(-10px) scale(0.95);
  pointer-events: none;
  transition: opacity .25s ease, transform .25s cubic-bezier(.16, 1, .3, 1);
  transform-origin: top left;
}

.theme-menu.show {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.theme-option {
  display: flex;
  align-items: center;
  padding: .3rem .4rem;
  cursor: pointer;
  transition: all .2s;
  border-radius: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: .8rem;
}

.theme-option:hover {
  background: var(--sf2);
}

.theme-color {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 6px;
  border: 1px solid rgba(255, 255, 255, .2);
  flex-shrink: 0;
}

.theme-option:nth-child(6) .theme-color,
.theme-option:nth-child(8) .theme-color {
  border: 1px solid rgba(0, 0, 0, .1);
}

.theme-option:last-child {
  border-top: 1px solid var(--bd);
  margin-top: .2rem;
  padding-top: .4rem;
  font-size: .75rem;
}

/* ---------- 状态徽章 ---------- */
.badge {
  font-family: 'DM Mono', monospace;
  font-size: clamp(.48rem, 1.3vw, .6rem);
  letter-spacing: .25em;
  text-transform: uppercase;
  padding: .2rem .85rem;
  background: var(--sf);
  border: 1px solid var(--bd);
  border-radius: 100px;
  transition: all .4s;
}

.badge.brk {
  color: var(--gr);
  border-color: rgba(92, 184, 122, .1);
}

@keyframes badge-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(212, 168, 83, 0); }
  50% { box-shadow: 0 0 8px 1px rgba(212, 168, 83, .08); }
}

.badge.running {
  animation: badge-glow 3s ease-in-out infinite;
}

/* ---------- 计时器中心区域 ---------- */
.timer-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  flex: 1;
  justify-content: center;
}

.ring-wrap {
  position: relative;
  width: clamp(200px, 55vw, 280px);
  height: clamp(200px, 55vw, 280px);
  flex-shrink: 0;
  aspect-ratio: 1/1;
  transition: all .5s cubic-bezier(.32, .72, 0, 1);
}

.ring-center {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 60vmin;
  height: 60vmin;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  background: var(--ring-inner-bg);
  border-radius: 50%;
  transition: all .5s cubic-bezier(.32, .72, 0, 1);
  z-index: 1;
}

.digits {
  font-family: 'DM Mono', monospace;
  font-size: clamp(1.8rem, 8vmin, 3.2rem);
  font-weight: 300;
  letter-spacing: .04em;
  transition: all .5s cubic-bezier(.32, .72, 0, 1);
  text-shadow: 0 2px 8px rgba(0, 0, 0, .3);
  white-space: nowrap;
}

.digits.done {
  color: var(--ac);
  animation: digit-blink 1.4s ease-in-out infinite;
}

@keyframes digit-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: .35; }
}

.immersive-hint {
  font-family: 'DM Mono', monospace;
  font-size: clamp(.35rem, 1vw, .45rem);
  color: var(--t3);
  letter-spacing: .08em;
  text-align: center;
  margin-top: .5rem;
  opacity: .6;
  transition: opacity .3s ease-out .4s;
}

/* ---------- 阶段信息 ---------- */
.stage-info {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: .35rem;
  margin-top: .45rem;
  animation: stageIn .4s cubic-bezier(.16, 1, .3, 1);
}

.stage-info.show {
  display: flex;
}

.stage-current {
  font-family: 'DM Mono', monospace;
  font-size: clamp(.5rem, 1.4vw, .62rem);
  letter-spacing: .18em;
  text-transform: uppercase;
  position: relative;
  padding: 0 .9rem;
}

.stage-current .sc-label {
  color: var(--t2);
  transition: color .4s;
}

.stage-current.brk .sc-label {
  color: var(--gr);
}

.stage-current::before,
.stage-current::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 12px;
  height: 1px;
  opacity: .3;
}

.stage-current::before {
  left: 0;
  background: linear-gradient(90deg, transparent, var(--t3));
}

.stage-current::after {
  right: 0;
  background: linear-gradient(90deg, var(--t3), transparent);
}

.stage-pips {
  display: flex;
  gap: 5px;
  align-items: center;
}

.pip {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--sf2);
  border: 1px solid var(--bd);
  transition: all .4s;
}

.pip.done {
  background: var(--ac);
  border-color: rgba(212, 168, 83, .3);
  box-shadow: 0 0 4px rgba(212, 168, 83, .2);
}

.pip.now {
  border-color: var(--ac);
  background: rgba(212, 168, 83, .15);
  transform: scale(1.15);
}

.pip.now.brk {
  border-color: var(--gr);
  background: rgba(92, 184, 122, .15);
  box-shadow: 0 0 4px rgba(92, 184, 122, .15);
}

.stage-next {
  font-family: 'DM Mono', monospace;
  font-size: clamp(.38rem, 1vw, .48rem);
  color: var(--t3);
  letter-spacing: .06em;
  display: flex;
  align-items: center;
  gap: .35rem;
}

.stage-next .sn-arrow {
  width: 8px;
  height: 8px;
  stroke: var(--t3);
  fill: none;
  stroke-width: 1.5;
  opacity: .4;
}

.stage-next .sn-name {
  color: var(--t2);
  opacity: .6;
}

.stage-next .sn-dur {
  color: var(--ac);
  opacity: .5;
}

@keyframes stageIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.status {
  font-family: 'DM Mono', monospace;
  font-size: clamp(.45rem, 1.3vw, .6rem);
  color: var(--t3);
  letter-spacing: .12em;
  margin-top: .15rem;
}

/* ---------- 播放控制 ---------- */
.play-btn {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--ac);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .22s;
  box-shadow: 0 4px 16px rgba(212, 168, 83, .2);
}

.play-btn svg {
  width: 22px;
  height: 22px;
  stroke: var(--bg);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.play-btn:hover {
  background: var(--ac2);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(212, 168, 83, .28);
}

.play-btn:active {
  background: var(--ac3);
  transform: scale(.92);
}

.reset-link {
  font-family: 'DM Mono', monospace;
  font-size: clamp(.42rem, 1.1vw, .52rem);
  color: var(--t3);
  letter-spacing: .12em;
  text-transform: uppercase;
  cursor: pointer;
  padding: .3rem .5rem;
  border-radius: 4px;
  transition: all .25s;
  opacity: 0;
  pointer-events: none;
  background: none;
  border: none;
}

.reset-link.visible {
  opacity: 1;
  pointer-events: auto;
}

.reset-link:hover {
  color: var(--t2);
  background: var(--sf);
}

.reset-link:active {
  color: var(--t1);
}

.reset-link.active {
  color: var(--ac);
  background: rgba(212, 168, 83, .08);
}

/* ---------- 页面指示器 ---------- */
.dots {
  position: fixed;
  bottom: max(.6rem, env(safe-area-inset-bottom, .6rem));
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: .35rem;
  z-index: 50;
  pointer-events: none;
  transition: all .5s cubic-bezier(.32, .72, 0, 1);
  opacity: 1;
}

.dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .1);
  transition: all .35s;
}

.dot.on {
  background: var(--ac);
  box-shadow: 0 0 6px rgba(212, 168, 83, .35);
}

/* ---------- 模态框 ---------- */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .65);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s;
  padding: 1rem;
}

.overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.modal {
  background: var(--sf);
  border: 1px solid var(--bd);
  border-radius: 16px;
  padding: 1.4rem 1.2rem;
  width: 100%;
  max-width: 360px;
  transform: translateY(12px) scale(.97);
  transition: transform .35s cubic-bezier(.16, 1, .3, 1);
}

.overlay.open .modal {
  transform: translateY(0) scale(1);
}

.modal h3 {
  font-size: clamp(.95rem, 2.8vw, 1.3rem);
  font-weight: 400;
  text-align: center;
  margin-bottom: 1rem;
  letter-spacing: .04em;
}

.setting-row {
  display: flex;
  align-items: center;
  padding: .7rem 0;
  border-bottom: 1px solid var(--bd);
}

.setting-row:last-of-type {
  border-bottom: none;
}

.setting-label {
  font-family: 'DM Mono', monospace;
  font-size: clamp(.52rem, 1.3vw, .65rem);
  color: var(--t2);
  letter-spacing: .04em;
  flex: 0 0 80px;
}

.stepper {
  display: flex;
  align-items: center;
  gap: 0;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--bd);
  background: var(--sf2);
  flex: 1;
  margin: 0 .5rem;
}

.stepper-btn {
  flex: 1;
  height: 36px;
  border: none;
  background: transparent;
  color: var(--t3);
  font-family: 'DM Mono', monospace;
  font-size: .65rem;
  letter-spacing: .02em;
  cursor: pointer;
  transition: all .18s;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  min-width: 30px;
}

.stepper-btn::after {
  content: '';
  position: absolute;
  right: 0;
  top: 20%;
  bottom: 20%;
  width: 1px;
  background: var(--bd);
}

.stepper-btn:last-child::after {
  display: none;
}

.stepper-btn:hover {
  color: var(--t1);
  background: rgba(255, 255, 255, .03);
}

.stepper-btn:active {
  color: var(--ac);
  background: rgba(212, 168, 83, .08);
}

.stepper-btn.jump {
  font-size: .58rem;
  opacity: .7;
}

.stepper-btn.jump:hover {
  opacity: 1;
}

.stepper-val {
  flex: 0 0 48px;
  height: 36px;
  border: none;
  background: rgba(212, 168, 83, .04);
  color: var(--ac);
  font-family: 'DM Mono', monospace;
  font-size: clamp(.75rem, 1.8vw, .9rem);
  font-weight: 400;
  text-align: center;
  letter-spacing: .04em;
  outline: none;
  -moz-appearance: textfield;
  border-left: 1px solid var(--bd);
  border-right: 1px solid var(--bd);
  transition: background .2s;
}

.stepper-val::-webkit-outer-spin-button,
.stepper-val::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.stepper-val:focus {
  background: rgba(212, 168, 83, .08);
}

.setting-unit {
  font-family: 'DM Mono', monospace;
  font-size: clamp(.48rem, 1.1vw, .58rem);
  color: var(--t3);
  letter-spacing: .06em;
  flex-shrink: 0;
  min-width: 40px;
}

.modal-btn {
  width: 100%;
  margin-top: .5rem;
  padding: .6rem;
  border: 1px solid var(--bd);
  border-radius: 10px;
  background: transparent;
  color: var(--t2);
  font-family: 'DM Mono', monospace;
  font-size: clamp(.55rem, 1.3vw, .68rem);
  letter-spacing: .1em;
  cursor: pointer;
  transition: all .2s;
  text-transform: uppercase;
}

.modal-btn:hover {
  border-color: rgba(255, 255, 255, .1);
  color: var(--t1);
}

.modal-btn:active {
  background: var(--sf2);
}

.modal-btn.ghost {
  border-color: transparent;
  color: var(--t3);
  margin-top: .35rem;
}

/* ---------- 倒计时选择 ---------- */
.cd-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .4rem;
  margin-bottom: .8rem;
}

.cd-grid .quick-btn {
  min-height: 48px;
}

.cd-custom-toggle {
  width: 100%;
  margin-top: .3rem;
  padding: .6rem;
  border: 1px dashed var(--bd);
  border-radius: 10px;
  background: transparent;
  color: var(--t3);
  font-family: 'DM Mono', monospace;
  font-size: clamp(.55rem, 1.3vw, .68rem);
  letter-spacing: .1em;
  cursor: pointer;
  transition: all .25s;
  text-transform: uppercase;
}

.cd-custom-toggle:hover {
  border-color: rgba(255, 255, 255, .1);
  color: var(--t2);
}

.cd-custom-toggle:active {
  background: var(--sf2);
}

.cd-custom-toggle.hide {
  display: none;
}

.cd-custom-panel {
  display: none;
  flex-direction: column;
  gap: .6rem;
  align-items: center;
  animation: cdFade .3s ease;
}

.cd-custom-panel.show {
  display: flex;
}

@keyframes cdFade {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.cd-time-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .6rem;
  width: 100%;
  padding: 1rem;
  border: 1px solid var(--bd);
  border-radius: 12px;
  background: var(--sf2);
}

.cd-custom-panel .cd-big {
  font-family: 'DM Mono', monospace;
  font-size: clamp(1.4rem, 4.5vw, 2rem);
  font-weight: 300;
  color: var(--ac);
  letter-spacing: .06em;
  line-height: 1;
}

.cd-custom-panel .stepper {
  width: 100%;
  max-width: 280px;
}

.cd-custom-panel .cd-unit {
  font-family: 'DM Mono', monospace;
  font-size: clamp(.48rem, 1.1vw, .58rem);
  color: var(--t3);
  letter-spacing: .08em;
  text-align: center;
}

.cd-custom-panel .cd-start {
  width: 100%;
  padding: .55rem;
  border: 1px solid rgba(212, 168, 83, .2);
  border-radius: 10px;
  background: rgba(212, 168, 83, .06);
  color: var(--ac);
  font-family: 'DM Mono', monospace;
  font-size: clamp(.55rem, 1.3vw, .68rem);
  letter-spacing: .1em;
  cursor: pointer;
  transition: all .2s;
  text-transform: uppercase;
}

.cd-custom-panel .cd-start:hover {
  background: rgba(212, 168, 83, .12);
  border-color: rgba(212, 168, 83, .3);
}

.cd-custom-panel .cd-start:active {
  background: rgba(212, 168, 83, .2);
}

@keyframes comp-flash {
  0% { box-shadow: inset 0 0 80px rgba(212, 168, 83, .05); }
  100% { box-shadow: none; }
}

.flash {
  animation: comp-flash 1.2s ease-out;
}

/* ========================================
   响应式样式
   ======================================== */

/* ---------- 横屏模式 ---------- */
@media (orientation: landscape) {
  .sw {
    margin: 0;
  }

  .pg {
    padding: 1rem 2rem;
    gap: .5rem;
  }

  .brand h1 {
    font-size: clamp(1.4rem, 4vh, 2rem);
  }

  .brand .sub {
    font-size: clamp(.38rem, 1vh, .5rem);
  }

  .brand {
    padding: .1rem 0;
  }

  .modes {
    flex-direction: row;
    gap: .5rem;
    max-width: 560px;
  }

  .card {
    flex: 1;
    padding: .55rem .65rem;
    gap: .5rem;
  }

  .card-ico {
    width: 28px;
    height: 28px;
    border-radius: 6px;
  }

  .card-ico svg {
    width: 14px;
    height: 14px;
  }

  .card-title {
    font-size: clamp(.65rem, 1.6vh, .8rem);
  }

  .card-desc {
    font-size: clamp(.32rem, .9vh, .45rem);
  }

  .card .gear {
    width: 24px;
    height: 24px;
  }

  .card .gear svg {
    width: 12px;
    height: 12px;
  }

  .quick-row {
    gap: .35rem;
    max-width: 560px;
  }

  .quick-btn {
    padding: .3rem .5rem;
    min-width: 42px;
  }

  .quick-btn .qt {
    font-size: clamp(.55rem, 1.4vh, .72rem);
  }

  .quick-btn .ql {
    font-size: clamp(.25rem, .7vh, .34rem);
  }

  .timer-page {
    flex-direction: row;
    align-items: center;
    justify-content: space-around;
    padding: 1rem 2rem;
    gap: 1rem;
  }

  .timer-top {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: auto;
    z-index: 5;
  }

  .timer-top {
    transform: translateY(-50%) translateX(0) scale(1);
  }

  .timer-bottom {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    flex: none;
    gap: .8rem;
    width: auto;
    max-width: 120px;
  }

  .timer-page.immersive .timer-top {
    transform: translateY(-50%) rotate(-180deg) scale(.95);
  }

  .timer-page.immersive .timer-bottom {
    transform: translateY(-50%) rotate(180deg) scale(.95);
  }

  .ring-wrap {
    width: clamp(200px, 40vh, 300px);
    height: clamp(200px, 40vh, 300px);
  }

  .digits {
    font-size: clamp(2.5rem, 6vmin, 4rem);
  }

  .status {
    font-size: clamp(.45rem, 1.2vh, .65rem);
  }

  .stage-current {
    font-size: clamp(.5rem, 1.2vh, .65rem);
  }

  .stage-next {
    font-size: clamp(.4rem, 1vh, .55rem);
  }

  /* 横屏悬浮按钮位置 */
  .floating-theme-btn {
    position: fixed !important;
    bottom: 1rem !important;
    left: 1rem !important;
    right: auto !important;
    top: auto !important;
  }

  .floating-orientation-btn {
    position: fixed !important;
    top: 1rem !important;
    left: 1rem !important;
    right: auto !important;
    bottom: auto !important;
  }

  .floating-back-btn {
    position: fixed !important;
    top: 1rem !important;
    right: 1rem !important;
    bottom: auto !important;
    left: auto !important;
  }

  /* 横屏主题菜单 - 从底部左侧弹出 */
  .theme-menu {
    top: auto;
    bottom: 3.5rem;
    left: 1rem;
    transform: translateY(10px) scale(0.95);
    transform-origin: bottom left;
  }

  .theme-menu.show {
    transform: translateY(0) scale(1);
  }

  /* 横屏模态框 */
  .modal {
    max-width: 95vw;
    max-height: 90vh;
    overflow: visible;
  }

  .modal-content {
    display: flex;
    flex-direction: row;
    gap: 1rem;
    align-items: flex-start;
  }

  .cd-grid-section,
  .cd-custom-section {
    flex: 1;
    max-width: 50%;
  }

  .cd-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: .3rem;
  }

  .cd-grid .quick-btn {
    padding: .3rem .5rem;
    min-width: 40px;
    min-height: 44px;
  }

  .cd-grid .quick-btn .qt {
    font-size: clamp(.5rem, 1.3vh, .7rem);
  }

  .cd-grid .quick-btn .ql {
    font-size: clamp(.22rem, .7vh, .32rem);
  }

  .cd-time-container {
    padding: .8rem;
    gap: .4rem;
  }

  .cd-custom-panel .cd-big {
    font-size: clamp(1.2rem, 3.5vh, 1.8rem);
  }

  .cd-custom-panel .stepper {
    max-width: 220px;
  }

  .cd-custom-panel .cd-start {
    padding: .5rem;
    font-size: clamp(.5rem, 1.2vh, .65rem);
  }

  .cd-custom-toggle {
    margin-top: .5rem;
  }

  .cd-custom-panel {
    width: 100%;
  }
}

/* ---------- 小屏幕横屏 ---------- */
@media (orientation: landscape) and (max-height: 380px) {
  .pg {
    padding: .6rem 1.5rem;
    gap: .35rem;
  }

  .brand h1 {
    font-size: 1.1rem;
  }

  .card {
    padding: .4rem .55rem;
    gap: .4rem;
  }

  .card-ico {
    width: 24px;
    height: 24px;
  }

  .card-ico svg {
    width: 12px;
    height: 12px;
  }

  .card-title {
    font-size: .58rem;
  }

  .card-desc {
    font-size: .3rem;
  }

  .quick-btn {
    padding: .25rem .4rem;
    min-width: 38px;
  }

  .quick-btn .qt {
    font-size: .5rem;
  }

  .timer-page {
    padding: 1rem 1.5rem;
    gap: .5rem;
  }

  .ring-wrap {
    width: clamp(120px, 30vh, 180px);
    height: clamp(120px, 30vh, 180px);
  }

  .digits {
    font-size: clamp(1.2rem, 3.5vmin, 2rem);
  }

  .timer-bottom {
    gap: .6rem;
    max-width: 100px;
  }

  .play-btn {
    width: 48px;
    height: 48px;
  }

  .play-btn svg {
    width: 18px;
    height: 18px;
  }

  .reset-link {
    font-size: clamp(.35rem, .9vw, .45rem);
  }

  .status {
    font-size: clamp(.35rem, .9vh, .45rem);
  }

  .stage-current {
    font-size: clamp(.4rem, 1vh, .5rem);
  }

  .stage-next {
    font-size: clamp(.3rem, .8vh, .4rem);
  }

  /* 小屏幕横屏主题菜单 */
  .theme-menu {
    top: auto;
    bottom: 3.5rem;
    left: 1rem;
    transform: translateY(10px) scale(0.95);
    transform-origin: bottom left;
  }

  .theme-menu.show {
    transform: translateY(0) scale(1);
  }

  /* 小屏幕横屏模态框 */
  .modal {
    max-width: 98vw;
    max-height: 95vh;
    padding: 1rem .8rem;
    overflow: visible;
  }

  .modal h3 {
    font-size: clamp(.7rem, 2.2vh, 1rem);
    margin-bottom: .6rem;
  }

  .modal-content {
    gap: .6rem;
  }

  .cd-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: .25rem;
  }

  .cd-grid .quick-btn {
    padding: .2rem .3rem;
    min-width: 32px;
    min-height: 36px;
  }

  .cd-grid .quick-btn .qt {
    font-size: clamp(.38rem, .9vh, .5rem);
  }

  .cd-grid .quick-btn .ql {
    font-size: clamp(.16rem, .4vh, .25rem);
  }

  .cd-time-container {
    padding: .5rem;
    gap: .25rem;
  }

  .cd-custom-panel .cd-big {
    font-size: clamp(.7rem, 2.2vh, 1rem);
  }

  .cd-custom-panel .stepper {
    max-width: 180px;
  }

  .stepper-btn {
    font-size: .5rem;
    height: 28px;
  }

  .stepper-val {
    font-size: clamp(.6rem, 1.3vh, .7rem);
    height: 28px;
  }

  .cd-custom-panel .cd-start {
    padding: .35rem;
    font-size: clamp(.4rem, 1vh, .55rem);
  }

  .cd-custom-toggle {
    padding: .35rem;
    font-size: clamp(.4rem, 1vh, .55rem);
    margin-top: .3rem;
  }

  .modal-btn {
    padding: .35rem;
    font-size: clamp(.4rem, 1vh, .55rem);
  }
}

/* ========================================
   手动横屏模式（通过JS切换）
   ======================================== */

body.manual-landscape .sw {
  margin: 0;
}

body.manual-landscape .pg {
  padding: 1rem 2rem;
  gap: .5rem;
}

body.manual-landscape .brand h1 {
  font-size: clamp(1.4rem, 4vh, 2rem);
}

body.manual-landscape .brand .sub {
  font-size: clamp(.38rem, 1vh, .5rem);
}

body.manual-landscape .brand {
  padding: .1rem 0;
}

body.manual-landscape .modes {
  flex-direction: row;
  gap: .5rem;
  max-width: 560px;
}

body.manual-landscape .card {
  flex: 1;
  padding: .55rem .65rem;
  gap: .5rem;
}

body.manual-landscape .card-ico {
  width: 28px;
  height: 28px;
  border-radius: 6px;
}

body.manual-landscape .card-ico svg {
  width: 14px;
  height: 14px;
}

body.manual-landscape .card-title {
  font-size: clamp(.65rem, 1.6vh, .8rem);
}

body.manual-landscape .card-desc {
  font-size: clamp(.32rem, .9vh, .45rem);
}

body.manual-landscape .card .gear {
  width: 24px;
  height: 24px;
}

body.manual-landscape .card .gear svg {
  width: 12px;
  height: 12px;
}

body.manual-landscape .quick-row {
  gap: .35rem;
  max-width: 560px;
}

body.manual-landscape .quick-btn {
  padding: .3rem .5rem;
  min-width: 42px;
}

body.manual-landscape .quick-btn .qt {
  font-size: clamp(.55rem, 1.4vh, .72rem);
}

body.manual-landscape .quick-btn .ql {
  font-size: clamp(.25rem, .7vh, .34rem);
}

body.manual-landscape .timer-page {
  flex-direction: row;
  align-items: center;
  justify-content: space-around;
  padding: 1rem 2rem;
  gap: 1rem;
}

body.manual-landscape .timer-top {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  width: auto;
  z-index: 5;
  padding: 0;
}

body.manual-landscape .timer-bottom {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  flex: none;
  gap: .8rem;
  width: auto;
  max-width: 120px;
}

body.manual-landscape .badge {
  font-size: clamp(.45rem, 1.2vh, .55rem);
  padding: .2rem .75rem;
}

body.manual-landscape .ring-wrap {
  width: clamp(200px, 40vh, 300px);
  height: clamp(200px, 40vh, 300px);
}

body.manual-landscape .digits {
  font-size: clamp(2.5rem, 6vmin, 4rem);
}

body.manual-landscape .status {
  font-size: clamp(.45rem, 1.2vh, .65rem);
}

body.manual-landscape .stage-current {
  font-size: clamp(.5rem, 1.2vh, .65rem);
}

body.manual-landscape .stage-next {
  font-size: clamp(.4rem, 1vh, .55rem);
}

body.manual-landscape .play-btn {
  width: 72px;
  height: 72px;
}

body.manual-landscape .play-btn svg {
  width: 24px;
  height: 24px;
}

/* 手动横屏沉浸模式 */
body.manual-landscape .timer-top,
body.manual-landscape .timer-bottom {
  transform: translateY(-50%) translateX(0) scale(1);
}

body.manual-landscape .timer-page.immersive .timer-top {
  opacity: 0;
  transform: translateY(-50%) rotate(-180deg) scale(.95);
  pointer-events: none;
}

body.manual-landscape .timer-page.immersive .timer-bottom {
  opacity: 0;
  transform: translateY(-50%) rotate(180deg) scale(.95);
  pointer-events: none;
}

/* 手动横屏悬浮按钮位置 */
body.manual-landscape .floating-theme-btn {
  position: fixed !important;
  top: 1rem !important;
  left: 1rem !important;
  right: auto !important;
  bottom: auto !important;
}

body.manual-landscape .floating-orientation-btn {
  position: fixed !important;
  top: 1rem !important;
  right: 1rem !important;
  left: auto !important;
  bottom: auto !important;
}

body.manual-landscape .floating-back-btn {
  position: fixed !important;
  bottom: 1rem !important;
  right: 1rem !important;
  top: auto !important;
  left: auto !important;
}

/* 手动横屏悬浮按钮动画 */
body.manual-landscape .floating-theme-btn,
body.manual-landscape .floating-orientation-btn,
body.manual-landscape .floating-back-btn {
  transform: scale(1);
}

body.manual-landscape.immersive-active .floating-theme-btn {
  transform: rotate(-180deg) scale(.95);
}

body.manual-landscape.immersive-active .floating-orientation-btn,
body.manual-landscape.immersive-active .floating-back-btn {
  transform: rotate(180deg) scale(.95);
}

/* 手动横屏主题菜单 */
body.manual-landscape .theme-menu {
  top: 3.5rem;
  left: 1rem;
  right: auto;
  margin-top: 0;
  min-width: 140px;
  padding: 8px;
  gap: .15rem;
}

body.manual-landscape .theme-option {
  padding: .25rem .35rem;
  font-size: .75rem;
}

body.manual-landscape .theme-color {
  width: 14px;
  height: 14px;
  margin-right: 5px;
}

body.manual-landscape .theme-option:last-child {
  padding-top: .35rem;
  margin-top: .15rem;
  font-size: .7rem;
}

/* 手动横屏模态框 */
body.manual-landscape .modal {
  max-width: 95vw;
  max-height: 90vh;
  overflow: visible;
}

body.manual-landscape .modal-content {
  display: flex;
  flex-direction: row;
  gap: 1rem;
  align-items: flex-start;
}

body.manual-landscape .cd-grid-section,
body.manual-landscape .cd-custom-section {
  flex: 1;
  max-width: 50%;
}

body.manual-landscape .cd-grid {
  grid-template-columns: repeat(3, 1fr);
  gap: .3rem;
}

body.manual-landscape .cd-grid .quick-btn {
  padding: .3rem .5rem;
  min-width: 40px;
  min-height: 44px;
}

body.manual-landscape .cd-grid .quick-btn .qt {
  font-size: clamp(.5rem, 1.3vh, .7rem);
}

body.manual-landscape .cd-grid .quick-btn .ql {
  font-size: clamp(.22rem, .7vh, .32rem);
}

body.manual-landscape .cd-time-container {
  padding: .8rem;
  gap: .4rem;
}

body.manual-landscape .cd-custom-panel .cd-big {
  font-size: clamp(1.2rem, 3.5vh, 1.8rem);
}

body.manual-landscape .cd-custom-panel .stepper {
  max-width: 220px;
}

body.manual-landscape .cd-custom-panel .cd-start {
  padding: .5rem;
  font-size: clamp(.5rem, 1.2vh, .65rem);
}

body.manual-landscape .cd-custom-toggle {
  margin-top: .5rem;
}

body.manual-landscape .cd-custom-panel {
  width: 100%;
}

/* ---------- 小屏幕手动横屏 ---------- */
@media (max-height: 380px) {
  body.manual-landscape .pg {
    padding: .6rem 1.5rem;
    gap: .35rem;
  }

  body.manual-landscape .brand h1 {
    font-size: 1.1rem;
  }

  body.manual-landscape .card {
    padding: .4rem .55rem;
    gap: .4rem;
  }

  body.manual-landscape .card-ico {
    width: 24px;
    height: 24px;
  }

  body.manual-landscape .card-ico svg {
    width: 12px;
    height: 12px;
  }

  body.manual-landscape .card-title {
    font-size: .58rem;
  }

  body.manual-landscape .card-desc {
    font-size: .3rem;
  }

  body.manual-landscape .quick-btn {
    padding: .25rem .4rem;
    min-width: 38px;
  }

  body.manual-landscape .quick-btn .qt {
    font-size: .5rem;
  }

  body.manual-landscape .timer-page {
    padding: 1rem 1.5rem;
    gap: .5rem;
  }

  body.manual-landscape .timer-top {
    left: .8rem;
  }

  body.manual-landscape .ring-wrap {
    width: clamp(120px, 30vh, 180px);
    height: clamp(120px, 30vh, 180px);
  }

  body.manual-landscape .digits {
    font-size: clamp(1.2rem, 3.5vmin, 2rem);
  }

  body.manual-landscape .timer-bottom {
    right: .8rem;
    gap: .6rem;
    max-width: 100px;
  }

  body.manual-landscape .play-btn {
    width: 48px;
    height: 48px;
  }

  body.manual-landscape .play-btn svg {
    width: 18px;
    height: 18px;
  }

  body.manual-landscape .reset-link {
    font-size: clamp(.35rem, .9vw, .45rem);
  }

  body.manual-landscape .status {
    font-size: clamp(.35rem, .9vh, .45rem);
  }

  body.manual-landscape .stage-current {
    font-size: clamp(.4rem, 1vh, .5rem);
  }

  body.manual-landscape .stage-next {
    font-size: clamp(.3rem, .8vh, .4rem);
  }

  body.manual-landscape .badge {
    font-size: clamp(.4rem, 1.1vh, .5rem);
    padding: .15rem .65rem;
  }

  /* 小屏幕手动横屏主题菜单 */
  body.manual-landscape .theme-menu {
    top: 3.5rem;
    left: 1rem;
    right: auto;
    margin-top: 0;
    padding: 6px;
    min-width: 120px;
    gap: .1rem;
  }

  body.manual-landscape .theme-option {
    padding: .2rem .3rem;
    font-size: .7rem;
  }

  body.manual-landscape .theme-color {
    width: 12px;
    height: 12px;
    margin-right: 4px;
  }

  body.manual-landscape .theme-option:last-child {
    padding-top: .3rem;
    margin-top: .1rem;
    font-size: .65rem;
  }

  /* 小屏幕手动横屏模态框 */
  body.manual-landscape .modal {
    max-width: 98vw;
    max-height: 95vh;
    padding: 1rem .8rem;
    overflow: visible;
  }

  body.manual-landscape .modal h3 {
    font-size: clamp(.7rem, 2.2vh, 1rem);
    margin-bottom: .6rem;
  }

  body.manual-landscape .modal-content {
    gap: .6rem;
  }

  body.manual-landscape .cd-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: .25rem;
  }

  body.manual-landscape .cd-grid .quick-btn {
    padding: .2rem .3rem;
    min-width: 32px;
    min-height: 36px;
  }

  body.manual-landscape .cd-grid .quick-btn .qt {
    font-size: clamp(.38rem, .9vh, .5rem);
  }

  body.manual-landscape .cd-grid .quick-btn .ql {
    font-size: clamp(.16rem, .4vh, .25rem);
  }

  body.manual-landscape .cd-time-container {
    padding: .5rem;
    gap: .25rem;
  }

  body.manual-landscape .cd-custom-panel .cd-big {
    font-size: clamp(.7rem, 2.2vh, 1rem);
  }

  body.manual-landscape .cd-custom-panel .stepper {
    max-width: 180px;
  }

  body.manual-landscape .stepper-btn {
    font-size: .5rem;
    height: 28px;
  }

  body.manual-landscape .stepper-val {
    font-size: clamp(.6rem, 1.3vh, .7rem);
    height: 28px;
  }

  body.manual-landscape .cd-custom-panel .cd-start {
    padding: .35rem;
    font-size: clamp(.4rem, 1vh, .55rem);
  }

  body.manual-landscape .cd-custom-toggle {
    padding: .35rem;
    font-size: clamp(.4rem, 1vh, .55rem);
    margin-top: .3rem;
  }

  body.manual-landscape .modal-btn {
    padding: .35rem;
    font-size: clamp(.4rem, 1vh, .55rem);
  }
}
