/* ========================================
   专愈 · 前台倒计时 — 视觉规范
   品牌色系: 深灰 + 暖金 + 原木
   ======================================== */

:root {
  --gold: #C9A96E;
  --gold-light: #D4BC8B;
  --gold-dark: #A8853F;
  --dark: #1A1A1A;
  --dark-soft: #2A2A2A;
  --dark-card: rgba(30, 30, 30, 0.85);
  --white: #F5F0EB;
  --white-soft: rgba(245, 240, 235, 0.7);
  --text-muted: rgba(245, 240, 235, 0.4);
  --wood: #8B6914;
  --radius: 16px;
  --radius-sm: 10px;
  --transition: 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: 'Noto Sans SC', 'Inter', -apple-system, sans-serif;
  background: var(--dark);
  color: var(--white);
  user-select: none;
  -webkit-user-select: none;
  cursor: default;
}

/* ========== 背景层 ========== */
.bg-layer {
  position: fixed;
  inset: 0;
  z-index: 0;
}

.bg-image {
  position: absolute;
  inset: -40px;
  background-size: cover;
  background-position: center;
  transition: filter 1.2s ease, transform 20s ease;
  will-change: transform, filter;
}

/* Ken Burns 呼吸动效 */
@keyframes kenBurns {
  0%   { transform: scale(1.0) translate(0, 0); }
  25%  { transform: scale(1.08) translate(-1%, -0.5%); }
  50%  { transform: scale(1.04) translate(0.5%, 1%); }
  75%  { transform: scale(1.10) translate(-0.5%, -1%); }
  100% { transform: scale(1.0) translate(0, 0); }
}

.bg-image.animate {
  animation: kenBurns 30s ease-in-out infinite;
}

.bg-overlay {
  position: absolute;
  inset: 0;
  transition: background var(--transition);
}

/* 温馨风 */
.bg-layer[data-theme="warm"] .bg-image {
  background: linear-gradient(135deg,
    #3E2723 0%, #5D4037 25%, #6D4C41 50%, #4E342E 75%, #3E2723 100%);
}
.bg-layer[data-theme="warm"] .bg-overlay {
  background: radial-gradient(ellipse at center,
    rgba(201, 169, 110, 0.08) 0%, rgba(26, 26, 26, 0.6) 100%);
}

/* 专业风 */
.bg-layer[data-theme="professional"] .bg-image {
  background: linear-gradient(160deg,
    #1a1a2e 0%, #16213e 30%, #0f3460 60%, #1a1a2e 100%);
}
.bg-layer[data-theme="professional"] .bg-overlay {
  background: radial-gradient(ellipse at center,
    rgba(201, 169, 110, 0.05) 0%, rgba(15, 15, 30, 0.7) 100%);
}

/* 纯色 */
.bg-layer[data-theme="solid"] .bg-image {
  background: linear-gradient(180deg, #1A1A1A 0%, #2A2A2A 100%);
}
.bg-layer[data-theme="solid"] .bg-overlay {
  background: none;
}

/* 配置模式下模糊 */
body.mode-config .bg-image {
  filter: blur(20px) brightness(0.5);
}

/* 运行模式下稍微清晰 */
body.mode-running .bg-image {
  filter: blur(8px) brightness(0.6);
}

/* 完成模式 */
body.mode-complete .bg-image {
  filter: blur(6px) brightness(0.65);
}

/* ========== 品牌标识 ========== */
.brand-logo {
  position: fixed;
  top: 36px;
  left: 40px;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: opacity var(--transition);
}

.brand-icon {
  color: var(--gold);
  font-size: 28px;
  line-height: 1;
}

.brand-text {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 4px;
  color: var(--white);
}

.brand-sub {
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 3px;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-left: 4px;
}

body.mode-running .brand-logo,
body.mode-complete .brand-logo {
  opacity: 0.3;
}

/* ========== 配置面板 ========== */
.config-panel {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}

.config-panel.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.config-card {
  background: var(--dark-card);
  backdrop-filter: blur(40px);
  -webkit-backdrop-filter: blur(40px);
  border: 1px solid rgba(201, 169, 110, 0.15);
  border-radius: var(--radius);
  padding: 48px 56px;
  width: 480px;
  max-width: 90vw;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow:
    0 32px 64px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(255, 255, 255, 0.03) inset;
}

.config-title {
  font-size: 24px;
  font-weight: 500;
  color: var(--gold);
  margin-bottom: 36px;
  letter-spacing: 2px;
  text-align: center;
}

.config-section {
  margin-bottom: 28px;
}

.config-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--white-soft);
  letter-spacing: 1px;
  margin-bottom: 12px;
  text-transform: uppercase;
}

/* 快捷时间按钮 */
.quick-time-btns {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
}

.time-btn {
  flex: 1;
  height: 80px;
  border: 1px solid rgba(201, 169, 110, 0.2);
  border-radius: var(--radius-sm);
  background: rgba(201, 169, 110, 0.06);
  color: var(--white);
  font-family: 'JetBrains Mono', monospace;
  font-size: 18px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  letter-spacing: 1px;
}

.time-btn:hover {
  background: rgba(201, 169, 110, 0.12);
  border-color: rgba(201, 169, 110, 0.4);
  transform: translateY(-2px);
}

.time-btn.active {
  background: rgba(201, 169, 110, 0.18);
  border-color: var(--gold);
  color: var(--gold);
  box-shadow: 0 0 20px rgba(201, 169, 110, 0.1);
}

/* 手动输入 */
.manual-time {
  display: flex;
  align-items: center;
  gap: 10px;
}

.manual-input {
  flex: 1;
  height: 52px;
  border: 1px solid rgba(201, 169, 110, 0.15);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  color: var(--white);
  font-family: 'JetBrains Mono', monospace;
  font-size: 16px;
  padding: 0 16px;
  outline: none;
  transition: border-color 0.3s;
}

.manual-input:focus {
  border-color: var(--gold);
}

.manual-input::placeholder {
  color: var(--text-muted);
}

.manual-unit {
  font-size: 14px;
  color: var(--white-soft);
  min-width: 36px;
}

/* 文字输入 */
.text-input {
  width: 100%;
  height: 52px;
  border: 1px solid rgba(201, 169, 110, 0.15);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  color: var(--white);
  font-family: 'Noto Sans SC', sans-serif;
  font-size: 16px;
  padding: 0 16px;
  outline: none;
  transition: border-color 0.3s;
  margin-bottom: 10px;
}

.text-input:last-child {
  margin-bottom: 0;
}

.text-input:focus {
  border-color: var(--gold);
}

.text-input::placeholder {
  color: var(--text-muted);
}

/* 背景主题按钮 */
.theme-btns {
  display: flex;
  gap: 12px;
}

.theme-btn {
  flex: 1;
  height: 80px;
  border: 1px solid rgba(201, 169, 110, 0.15);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
  color: var(--white-soft);
  font-family: 'Noto Sans SC', sans-serif;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.theme-btn:hover {
  background: rgba(201, 169, 110, 0.08);
  border-color: rgba(201, 169, 110, 0.3);
}

.theme-btn.active {
  border-color: var(--gold);
  background: rgba(201, 169, 110, 0.12);
  color: var(--gold-light);
}

.theme-preview {
  width: 32px;
  height: 20px;
  border-radius: 4px;
}

.warm-preview {
  background: linear-gradient(135deg, #5D4037, #8D6E63);
}

.pro-preview {
  background: linear-gradient(135deg, #16213e, #0f3460);
}

.solid-preview {
  background: linear-gradient(135deg, #2A2A2A, #3A3A3A);
}

/* 开始按钮 */
.start-btn {
  width: 100%;
  height: 80px;
  margin-top: 12px;
  border: none;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--gold-dark), var(--gold));
  color: var(--dark);
  font-family: 'Noto Sans SC', sans-serif;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 4px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  box-shadow: 0 8px 32px rgba(201, 169, 110, 0.2);
}

.start-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(201, 169, 110, 0.3);
}

.start-btn:active {
  transform: translateY(0);
}

.start-icon {
  font-size: 16px;
}

/* ========== 运行面板 ========== */
.running-panel {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: opacity 0.8s ease, visibility 0.8s ease;
}

.running-panel.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.running-status {
  font-size: 20px;
  font-weight: 400;
  color: var(--gold-light);
  letter-spacing: 6px;
  margin-bottom: 40px;
  opacity: 0.8;
  text-transform: uppercase;
}

/* 倒计时数字 */
.timer-display {
  margin-bottom: 48px;
}

.timer-digits {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 300;
  line-height: 1;
}

.digit-group {
  display: flex;
}

.digit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(100px, 20vw, 240px);
  width: 0.65em;
  height: 1em;
  color: var(--white);
  position: relative;
  overflow: hidden;
}

.digit.flip {
  animation: digitFlip 0.4s ease-out;
}

@keyframes digitFlip {
  0% {
    opacity: 0;
    transform: translateY(-20px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.timer-colon {
  font-size: clamp(80px, 16vw, 200px);
  color: var(--gold);
  opacity: 0.6;
  width: 0.4em;
  text-align: center;
  animation: colonPulse 1s ease-in-out infinite;
}

@keyframes colonPulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 0.2; }
}

/* 运行中的文字 */
.running-titles {
  text-align: center;
}

.running-main-title {
  font-size: clamp(28px, 4vw, 56px);
  font-weight: 500;
  color: var(--white);
  letter-spacing: 8px;
  margin-bottom: 16px;
}

.running-sub-title {
  font-size: clamp(16px, 2vw, 24px);
  font-weight: 300;
  color: var(--gold-light);
  letter-spacing: 4px;
  opacity: 0.7;
}

/* ========== 完成面板 ========== */
.complete-panel {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: opacity 0.8s ease, visibility 0.8s ease;
}

.complete-panel.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.complete-icon {
  font-size: 80px;
  color: var(--gold);
  margin-bottom: 40px;
  animation: completeIconPulse 2.5s ease-in-out infinite;
}

@keyframes completeIconPulse {
  0%, 100% { transform: scale(1); opacity: 0.8; }
  50% { transform: scale(1.08); opacity: 1; }
}

.complete-main {
  font-size: clamp(36px, 6vw, 72px);
  font-weight: 600;
  color: var(--white);
  letter-spacing: 12px;
  margin-bottom: 20px;
  animation: fadeInUp 0.8s ease-out;
}

.complete-sub {
  font-size: clamp(20px, 3vw, 36px);
  font-weight: 300;
  color: var(--gold-light);
  letter-spacing: 8px;
  margin-bottom: 60px;
  animation: fadeInUp 0.8s ease-out 0.2s both;
}

.complete-hint {
  font-size: 14px;
  color: var(--text-muted);
  letter-spacing: 2px;
  animation: fadeInUp 0.8s ease-out 0.6s both;
}

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

/* ========== 双击提示 ========== */
.reset-hint {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 13px;
  color: var(--text-muted);
  letter-spacing: 2px;
  z-index: 20;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}

body.mode-running .reset-hint,
body.mode-complete .reset-hint {
  opacity: 1;
}

/* ========== 隐藏/显示辅助 ========== */
.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* ========== 响应式 ========== */
@media (max-width: 540px) {
  .config-card {
    padding: 32px 24px;
  }

  .brand-logo {
    top: 20px;
    left: 20px;
  }

  .brand-sub {
    display: none;
  }

  .quick-time-btns {
    flex-wrap: wrap;
  }

  .time-btn {
    height: 64px;
    font-size: 16px;
  }

  .theme-btns {
    flex-wrap: wrap;
  }
}

/* ========== 隐藏 number input 箭头 ========== */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input[type="number"] {
  -moz-appearance: textfield;
}

/* ========== 滚动条 ========== */
::-webkit-scrollbar {
  width: 4px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(201, 169, 110, 0.2);
  border-radius: 2px;
}
