/* ============================================================
   记忆屏保 style.css
   黑底大字轮播 · iOS PWA 全屏适配（iPhone 15 Pro: 393×852）
   ============================================================ */

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

/* hidden 属性必须真正隐藏（否则会被下方 display:flex 覆盖） */
[hidden] { display: none !important; }

html, body {
  height: 100%;
  background: #000; /* 关键：页面背景统一深色，避免 iOS PWA 底部白条 */
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", sans-serif;
  color: #fff;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
}

/* ======== 屏保层 ======== */
.screensaver {
  position: fixed;
  inset: 0;
  background: #000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* 顶部时间（safe-area 上方） */
.clock {
  position: fixed;
  top: calc(8px + env(safe-area-inset-top));
  right: 0; left: 0;
  text-align: center;
  font-size: 18px;
  font-weight: 300;
  letter-spacing: 2px;
  color: rgba(255,255,255,0.55);
  font-variant-numeric: tabular-nums;
  z-index: 5;
  pointer-events: none;
}

/* 大字舞台 */
.stage {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6% 8%;
  z-index: 2;
}

.quote {
  max-width: 100%;
  text-align: center;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.3;
  font-weight: 600;
  color: #fff;
  text-shadow: 0 2px 30px rgba(255,255,255,0.08);
  opacity: 1;
  transition: opacity .4s ease;
}
.quote.is-leaving { opacity: 0; }

/* 版本徽标（右下角） */
.app-version {
  position: fixed;
  right: 12px;
  bottom: calc(10px + env(safe-area-inset-bottom));
  font-size: 11px;
  font-weight: 400;
  color: rgba(255,255,255,0.25);
  z-index: 6;
  pointer-events: none;
  user-select: none;
}

/* ======== 控制条 ======== */
.controls {
  position: fixed;
  bottom: calc(36px + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 999px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 20;
}

.ctl-btn {
  min-width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: rgba(255,255,255,0.12);
  color: #fff;
  font-size: 17px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s;
}
.ctl-btn:active { background: rgba(255,255,255,0.3); }

/* ======== 管理面板 ======== */
.admin-panel {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0,0,0,0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: flex;
  flex-direction: column;
  padding: calc(14px + env(safe-area-inset-top)) 18px calc(18px + env(safe-area-inset-bottom));
  overflow-y: auto;
}

.admin-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.admin-head h2 { font-size: 20px; font-weight: 600; }

.admin-section {
  margin-bottom: 22px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  padding: 14px;
}

.admin-label {
  font-size: 14px;
  font-weight: 600;
  color: rgba(255,255,255,0.85);
  margin-bottom: 10px;
}
.admin-hint { font-size: 12px; font-weight: 400; color: rgba(255,255,255,0.4); }

.admin-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.admin-row input[type="text"], .admin-row input:not([type]) {
  flex: 1 1 140px;
  min-width: 120px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 10px;
  color: #fff;
  padding: 10px 12px;
  font-size: 15px;
  outline: none;
}
.admin-row .in-tag { flex: 0 1 90px; min-width: 70px; }
.admin-row input:focus { border-color: rgba(255,255,255,0.45); }

textarea {
  width: 100%;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 10px;
  color: #fff;
  padding: 10px 12px;
  font-size: 15px;
  outline: none;
  resize: vertical;
  font-family: inherit;
}

.btn-primary {
  background: #fff;
  color: #000;
  border: none;
  border-radius: 10px;
  padding: 10px 18px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}
.btn-primary:active { opacity: 0.8; }

.btn-ghost {
  background: transparent;
  color: rgba(255,255,255,0.8);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 10px;
  padding: 9px 16px;
  font-size: 14px;
  cursor: pointer;
}

.cfg-item { display: flex; align-items: center; gap: 8px; font-size: 14px; color: rgba(255,255,255,0.8); }
.cfg-item input[type="number"] {
  width: 70px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 8px;
  color: #fff;
  padding: 7px 9px;
  font-size: 14px;
  outline: none;
}
.cfg-check { cursor: pointer; }
.cfg-check input { width: 16px; height: 16px; }

/* 记录列表 */
.rec-list { list-style: none; }
.rec-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 6px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}
.rec-item .rec-text { flex: 1; font-size: 15px; line-height: 1.4; word-break: break-word; }
.rec-item .rec-tag {
  font-size: 11px;
  color: rgba(255,255,255,0.5);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 999px;
  padding: 2px 8px;
  white-space: nowrap;
}
.rec-item .rec-del {
  background: transparent;
  border: none;
  color: rgba(255,100,100,0.85);
  font-size: 18px;
  cursor: pointer;
  padding: 4px 6px;
}

.empty-tip { color: rgba(255,255,255,0.35); font-size: 14px; padding: 8px 4px; }
