* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { width: 100%; height: 100%; overflow: hidden; }
body { background: #060d0b; color: #dcebe4; font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif; }
#cv { position: fixed; inset: 0; width: 100%; height: 100%; }

.title {
  position: fixed; top: 22px; left: 100px; right: 100px; text-align: center; z-index: 2; pointer-events: none;
  color: rgba(220, 245, 235, 0.75); font-size: 16px; font-weight: 400; letter-spacing: 8px; transition: opacity 1s;
}
.title small { display: block; margin-top: 6px; font-size: 11px; letter-spacing: 3px; color: rgba(160, 200, 185, 0.5); }
.hint {
  position: fixed; top: 74px; left: 0; right: 0; text-align: center; z-index: 2; pointer-events: none;
  color: rgba(160, 200, 185, 0.45); font-size: 11px; letter-spacing: 1px; transition: opacity 1s;
}

.tabs {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 5;
  display: flex; gap: 4px; padding: 5px;
  background: rgba(10, 24, 20, 0.6); border: 1px solid rgba(143, 179, 165, 0.22);
  border-radius: 30px; backdrop-filter: blur(14px); transition: opacity 1.2s;
}
.tabs button {
  padding: 11px 26px; border: none; border-radius: 22px; cursor: pointer;
  background: transparent; color: #9fc4b5; font-size: 14px; letter-spacing: 3px; transition: all .3s;
}
.tabs button.active { background: rgba(111, 216, 173, 0.2); color: #eaf6ef; }

.vis-bar {
  position: fixed; bottom: 84px; left: 50%; transform: translateX(-50%); z-index: 4;
  display: flex; gap: 6px; padding: 7px 9px;
  background: rgba(10, 24, 20, 0.5); border: 1px solid rgba(143, 179, 165, 0.18);
  border-radius: 30px; backdrop-filter: blur(12px); transition: opacity 1.2s;
}
.vis-bar button {
  padding: 8px 14px; border: none; border-radius: 20px; cursor: pointer;
  background: transparent; color: #9fc4b5; font-size: 12px; letter-spacing: 1px; transition: all .3s; white-space: nowrap;
}
.vis-bar button.active { background: rgba(111, 216, 173, 0.18); color: #eaf6ef; }
.vis-bar .fs { opacity: .6; }

.breath-text {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
  z-index: 2; color: rgba(230, 250, 240, 0.9); font-size: 22px; letter-spacing: 10px;
  pointer-events: none; opacity: 0; transition: opacity .8s; text-align: center;
}
.breath-text small { display: block; margin-top: 14px; font-size: 34px; letter-spacing: 2px; color: #6fd8ad; }

.panel {
  position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%); z-index: 4;
  width: min(500px, calc(100vw - 28px));
  max-height: calc(100vh - 200px); overflow-y: auto;
  display: none; flex-direction: column; gap: 12px;
  padding: 16px;
  background: rgba(10, 24, 20, 0.62); border: 1px solid rgba(143, 179, 165, 0.2);
  border-radius: 20px; backdrop-filter: blur(14px); transition: opacity 1.2s;
}
.panel.show { display: flex; }
.card { background: rgba(255,255,255,0.03); border: 1px solid rgba(143,179,165,0.14); border-radius: 14px; padding: 14px; }
.card h2 { font-size: 13px; color: #a9d3c2; margin-bottom: 12px; letter-spacing: 2px; font-weight: 400; }
.presets { display: flex; flex-wrap: wrap; gap: 8px; }
.preset {
  flex: 1 1 30%; padding: 10px 4px; border-radius: 11px; cursor: pointer;
  border: 1px solid rgba(143,179,165,0.22); background: rgba(255,255,255,0.03);
  color: #dcebe4; font-size: 13px; transition: all .25s;
}
.preset .ic { display: block; font-size: 19px; margin-bottom: 2px; }
.preset.active { background: rgba(90,200,160,.16); border-color: #5ac8a0; }
.ch { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.ch:last-child { margin-bottom: 0; }
.ch label { width: 72px; font-size: 12px; color: #b9d6ca; flex-shrink: 0; }
input[type=range] {
  flex: 1; -webkit-appearance: none; height: 4px; border-radius: 2px;
  background: rgba(143,179,165,.3); outline: none; cursor: pointer;
}
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 15px; height: 15px; border-radius: 50%;
  background: #6fd8ad; box-shadow: 0 0 8px rgba(111,216,173,.5);
}
.timer-btns { display: flex; gap: 8px; }
.timer-btns button {
  flex: 1; padding: 9px 0; border-radius: 9px; cursor: pointer; font-size: 12px;
  border: 1px solid rgba(143,179,165,.28); background: transparent; color: #b9d6ca;
}
.timer-btns button.active { background: rgba(90,200,160,.16); border-color: #5ac8a0; color: #eaf6ef; }
.timer-text { margin-top: 10px; font-size: 12px; color: #8fb3a5; text-align: center; min-height: 16px; }
.note { text-align: center; font-size: 11px; color: #5f8377; line-height: 1.7; }

body.idle .tabs, body.idle .vis-bar, body.idle .title, body.idle .hint, body.idle .panel { opacity: 0; }

.lang {
  position: fixed; top: 18px; right: 56px; z-index: 6;
  display: flex;
  border: 1px solid rgba(143,179,165,.3);
  border-radius: 17px;
  overflow: hidden;
  background: rgba(10,24,20,.5);
  backdrop-filter: blur(10px);
}
.lang a {
  padding: 7px 11px; font-size: 12px; color: #9fc4b5;
  text-decoration: none; letter-spacing: 0.5px; line-height: 18px;
}
.lang a[aria-current="page"] {
  background: rgba(111,216,173,.22); color: #eaf6ef;
}

.about-btn {
  position: fixed; top: 18px; right: 16px; z-index: 6;
  width: 34px; height: 34px; border-radius: 50%; cursor: pointer;
  border: 1px solid rgba(143,179,165,.3); background: rgba(10,24,20,.5);
  color: #9fc4b5; font-size: 15px; backdrop-filter: blur(10px);
}
.about-mask {
  position: fixed; inset: 0; z-index: 20; display: none;
  background: rgba(4,10,8,.72); backdrop-filter: blur(6px);
}
.about-mask.show { display: flex; align-items: center; justify-content: center; }
.about-card {
  width: min(480px, calc(100vw - 36px)); max-height: 78vh; overflow-y: auto;
  background: rgba(14,32,27,.96); border: 1px solid rgba(143,179,165,.25);
  border-radius: 20px; padding: 26px 24px; line-height: 1.9; font-size: 14px; color: #c9e2d6;
}
.about-card h3 { color: #eaf6ef; letter-spacing: 4px; margin-bottom: 4px; font-size: 18px; font-weight: 500; }
.about-card .en { color: #6fd8ad; font-size: 12px; letter-spacing: 2px; margin-bottom: 16px; }
.about-card h4 { color: #a9d3c2; margin: 16px 0 6px; font-size: 14px; letter-spacing: 1px; font-weight: 500; }
.about-card p { margin-bottom: 8px; }
.about-card .fine { font-size: 12px; color: #5f8377; margin-top: 16px; }
.about-card .close {
  margin-top: 18px; width: 100%; padding: 10px; border-radius: 12px; cursor: pointer;
  border: 1px solid rgba(143,179,165,.35); background: transparent; color: #b9d6ca; font-size: 14px;
}
.about-card b { color: #eaf6ef; }

.seo-copy { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* H5：避开左右角控件、拉开底部两层栏，并兼顾安全区 */
@media (max-width: 520px) {
  .title {
    top: calc(12px + env(safe-area-inset-top, 0px));
    left: 12px; right: 120px;
    font-size: 13px; letter-spacing: 3px; line-height: 1.3;
    text-align: center;
  }
  .title small {
    margin-top: 3px; font-size: 10px; letter-spacing: 1px;
  }
  .hint {
    top: calc(66px + env(safe-area-inset-top, 0px));
    left: 14px; right: 14px;
    font-size: 10px; letter-spacing: 0.4px; line-height: 1.35;
    text-align: center;
  }
  .lang {
    top: calc(12px + env(safe-area-inset-top, 0px));
    right: calc(48px + env(safe-area-inset-right, 0px));
    left: auto;
  }
  .lang a { padding: 6px 9px; font-size: 11px; line-height: 16px; }
  .about-btn {
    top: calc(12px + env(safe-area-inset-top, 0px));
    right: calc(10px + env(safe-area-inset-right, 0px));
    width: 32px; height: 32px;
  }

  .tabs {
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    padding: 4px;
  }
  .tabs button {
    padding: 10px 20px; font-size: 13px; letter-spacing: 2px;
  }

  .vis-bar {
    bottom: calc(78px + env(safe-area-inset-bottom, 0px));
    left: 10px; right: 10px;
    width: auto; max-width: none;
    transform: none;
    justify-content: space-between;
    gap: 2px; padding: 5px 6px;
    overflow-x: auto; -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .vis-bar::-webkit-scrollbar { display: none; }
  .vis-bar button {
    flex: 1 1 auto;
    min-width: 0;
    padding: 7px 6px; font-size: 11px; letter-spacing: 0;
  }
  .vis-bar .fs { flex: 0 0 auto; padding: 7px 8px; }

  .panel {
    bottom: calc(78px + env(safe-area-inset-bottom, 0px));
    left: 12px; right: 12px;
    width: auto; max-width: none;
    transform: none;
    max-height: calc(100vh - 170px - env(safe-area-inset-bottom, 0px) - env(safe-area-inset-top, 0px));
    padding: 12px;
  }
  .preset { flex: 1 1 40%; font-size: 12px; padding: 8px 4px; }
  .ch label { width: 56px; }
  .breath-text { font-size: 18px; letter-spacing: 6px; }
  .breath-text small { font-size: 28px; }
}
