/* 设计稿基准宽度 375px，尺寸换算：px ÷ 3.75 = vw */

:root {
  --color-primary: #f5266a;
  --color-page-bg: #f5f5f5;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 3.75vw;
  height: 100%;
  overflow-x: visible;
  overflow-y: hidden;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  color: #000;
  height: 100%;
  background: var(--color-page-bg);
  overflow-x: visible;
  overflow-y: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ========== 密钥入口（entry 为唯一入口） ========== */
body.locked .page {
  visibility: hidden;
}

html.is-authenticated .page {
  visibility: visible;
}

.entry-lock {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.55);
  padding: 5.33vw;
}

html.is-authenticated .entry-lock,
.entry-lock[hidden] {
  display: none !important;
}

body.locked .entry-lock:not([hidden]) {
  display: flex;
}

.entry-lock__dialog {
  width: 100%;
  max-width: 78.67vw;
  background: #fff;
  border-radius: 4.27vw;
  padding: 7.47vw 6.4vw 6.4vw;
  text-align: center;
  box-shadow: 0 2.67vw 8vw rgba(0, 0, 0, 0.15);
  box-sizing: border-box;
}

.entry-lock__dialog h1 {
  font-size: 4.8vw;
  font-weight: 600;
  color: #111;
  margin-bottom: 2.13vw;
  line-height: 1.3;
}

.entry-lock__hint {
  font-size: 3.47vw;
  color: #666;
  margin-bottom: 5.33vw;
  line-height: 1.5;
  padding: 0 1.07vw;
}

.entry-lock__form {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 3.2vw;
  width: 100%;
  margin-bottom: 2.13vw;
}

.entry-lock__input {
  display: block;
  width: 100%;
  height: 12.8vw;
  padding: 0 4vw;
  border: 1px solid #ddd;
  border-radius: 2.13vw;
  font-size: 5.33vw;
  text-align: center;
  letter-spacing: 1.07vw;
  outline: none;
  box-sizing: border-box;
  -webkit-appearance: none;
  appearance: none;
  background: #fff;
}

.entry-lock__input:focus {
  border-color: var(--color-primary);
}

.entry-lock__button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 12.8vw;
  padding: 0;
  background: var(--color-primary);
  color: #fff;
  border: none;
  border-radius: 2.13vw;
  font-size: 4.27vw;
  font-weight: 600;
  cursor: pointer;
  box-sizing: border-box;
}

.entry-lock__button:active {
  opacity: 0.88;
}

.entry-lock__error {
  min-height: 5.33vw;
  font-size: 3.2vw;
  color: var(--color-primary);
  line-height: 1.4;
  margin: 0;
  padding: 0 1.07vw;
}

button,
a {
  border: none;
  background: none;
  cursor: pointer;
  padding: 0;
  font: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

.page {
  position: relative;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--color-page-bg);
}

/* ========== 全屏斜向水印（JS 网格：水平成行，竖直成列对齐） ========== */
.watermark {
  position: fixed;
  top: 11.5vw;
  left: 0;
  z-index: 99;
  pointer-events: none;
  overflow: visible;
}

.watermark-grid {
  position: absolute;
  top: 0;
  left: 0;
  overflow: visible;
}

.watermark-item {
  position: absolute;
  font-size: 12px;
  line-height: 1;
  color: #d6d6d6;
  white-space: nowrap;
  letter-spacing: 0;
  user-select: none;
}

/* ========== 顶部导航 ========== */
.header {
  position: relative;
  z-index: 100;
  width: 100vw;
  background: var(--color-primary);
  flex-shrink: 0;
}

.nav-bar {
  width: 100vw;
  height: 11.5vw;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4vw;
  position: relative;
}

.nav-back {
  width: 10.67vw;
  height: 10.67vw;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
  tap-highlight-color: transparent;
  outline: none;
  user-select: none;
}

.nav-back:focus,
.nav-back:focus-visible,
.nav-back:active {
  outline: none;
  box-shadow: none;
  background: transparent;
  opacity: 1;
}

.nav-back svg {
  width: 3.2vw;
  height: 5.33vw;
}

.nav-title {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-size: 4.8vw;
  font-weight: 600;
  color: #fff;
  letter-spacing: 0.27vw;
  white-space: nowrap;
  line-height: 1;
}

.nav-placeholder {
  width: 10.67vw;
  flex-shrink: 0;
}

/* ========== 主内容 ========== */
.main {
  position: relative;
  z-index: 1;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  background: var(--color-page-bg);
}

.slogan {
  margin-top: 6.4vw;
  font-size: 5.33vw;
  font-weight: 600;
  color: var(--color-primary);
  text-align: center;
  letter-spacing: 0.13vw;
  line-height: 1.4;
  flex-shrink: 0;
}

.device-img {
  width: 100vw;
  margin-top: 10vw;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  flex-shrink: 0;
}

.device-img img {
  width: 100%;
  height: auto;
  object-fit: contain;
  object-position: top center;
}

/* ========== 底部按钮 ========== */
.footer {
  position: relative;
  z-index: 1;
  flex-shrink: 0;
  margin-top: 15vw;
  padding: 0 5vw 8vw;
  background: var(--color-page-bg);
}

.btn-open {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 14.6vw;
  background: var(--color-primary);
  border-radius: 7.3vw;
  font-size: 5.2vw;
  font-weight: 500;
  color: #fff;
  letter-spacing: 0.13vw;
  line-height: 1;
  -webkit-tap-highlight-color: transparent;
  tap-highlight-color: transparent;
  outline: none;
  user-select: none;
}

.btn-open:focus,
.btn-open:focus-visible,
.btn-open:active {
  outline: none;
  box-shadow: none;
}

.btn-open:active {
  opacity: 0.88;
}
