/* ============================================
   iOS 液态毛玻璃设计系统
   ============================================ */

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

:root {
  --glass-bg: rgba(255, 255, 255, 0.08);
  --glass-bg-strong: rgba(255, 255, 255, 0.12);
  --glass-border: rgba(255, 255, 255, 0.18);
  --glass-border-strong: rgba(255, 255, 255, 0.28);
  --text-primary: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.6);
  --text-tertiary: rgba(255, 255, 255, 0.35);
  --accent-blue: #0a84ff;
  --accent-blue-light: #5ac8fa;
  --accent-purple: #bf5af2;
  --accent-green: #30d158;
  --accent-orange: #ff9f0a;
  --accent-red: #ff453a;
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --blur: blur(20px) saturate(180%);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Helvetica Neue', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: #000;
  color: var(--text-primary);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ============================================
   动态背景（彩色光斑流动）
   ============================================ */
.liquid-bg {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(135deg, #0c0c1d 0%, #1a1035 50%, #0d1b2a 100%);
  z-index: -2;
  overflow: hidden;
}

.liquid-bg::before,
.liquid-bg::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.5;
}

.liquid-bg::before {
  width: 500px;
  height: 500px;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
  top: -10%;
  left: -10%;
  animation: float1 15s ease-in-out infinite;
}

.liquid-bg::after {
  width: 400px;
  height: 400px;
  background: linear-gradient(135deg, var(--accent-purple), #ff375f);
  bottom: -10%;
  right: -10%;
  animation: float2 18s ease-in-out infinite;
}

.liquid-bg .orb3 {
  position: absolute;
  width: 350px;
  height: 350px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-blue-light), var(--accent-green));
  filter: blur(80px);
  opacity: 0.35;
  top: 40%;
  left: 50%;
  animation: float3 20s ease-in-out infinite;
}

@keyframes float1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(100px, 50px) scale(1.1); }
  66% { transform: translate(50px, 100px) scale(0.95); }
}

@keyframes float2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(-80px, -60px) scale(1.05); }
  66% { transform: translate(-40px, -80px) scale(1.1); }
}

@keyframes float3 {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  50% { transform: translate(-30%, -70%) scale(1.2); }
}

/* ============================================
   毛玻璃通用类
   ============================================ */
.glass {
  background: var(--glass-bg);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.glass-strong {
  background: var(--glass-bg-strong);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--glass-border-strong);
  border-radius: var(--radius-lg);
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

/* ============================================
   登录页
   ============================================ */
.login-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 20px;
}

.login-container {
  width: 100%;
  max-width: 420px;
  text-align: center;
  z-index: 1;
  animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.game-title {
  font-size: 48px;
  font-weight: 800;
  letter-spacing: -1px;
  margin-bottom: 6px;
  background: linear-gradient(135deg, #ffffff 0%, var(--accent-blue-light) 50%, var(--accent-purple) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 4px 20px rgba(10, 132, 255, 0.3));
}

.game-subtitle {
  color: var(--text-secondary);
  font-size: 15px;
  margin-bottom: 40px;
  letter-spacing: 1px;
  font-weight: 400;
}

.login-box {
  padding: 32px 28px;
  text-align: left;
  animation: fadeIn 0.5s ease 0.2s both;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.login-box h3 {
  text-align: center;
  margin-bottom: 6px;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.box-desc {
  text-align: center;
  color: var(--text-secondary);
  font-size: 13px;
  margin-bottom: 24px;
  line-height: 1.5;
}

.input-group {
  margin-bottom: 14px;
}

.input-group input {
  width: 100%;
  padding: 15px 18px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 15px;
  font-weight: 400;
  outline: none;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  -webkit-appearance: none;
}

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

.input-group input:focus {
  border-color: var(--accent-blue);
  background: rgba(10, 132, 255, 0.08);
  box-shadow: 0 0 0 4px rgba(10, 132, 255, 0.15);
}

.code-area {
  margin-bottom: 14px;
}

.code-area input {
  width: 100%;
  padding: 15px 18px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 17px;
  font-weight: 600;
  outline: none;
  letter-spacing: 8px;
  text-align: center;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.code-area input:focus {
  border-color: var(--accent-blue);
  background: rgba(10, 132, 255, 0.08);
  box-shadow: 0 0 0 4px rgba(10, 132, 255, 0.15);
}

/* iOS 风格按钮 */
.btn-primary {
  width: 100%;
  padding: 15px;
  background: linear-gradient(135deg, var(--accent-blue) 0%, #0066cc 100%);
  border: none;
  border-radius: var(--radius-sm);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  margin-bottom: 10px;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 15px rgba(10, 132, 255, 0.35);
  position: relative;
  overflow: hidden;
}

.btn-primary::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 50%;
  background: linear-gradient(180deg, rgba(255,255,255,0.15), transparent);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(10, 132, 255, 0.45);
}

.btn-primary:active {
  transform: translateY(0) scale(0.98);
  box-shadow: 0 2px 10px rgba(10, 132, 255, 0.3);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-link {
  width: 100%;
  padding: 10px;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  transition: color 0.2s;
}

.btn-link:hover {
  color: var(--accent-blue-light);
}

.tip-text {
  text-align: center;
  font-size: 13px;
  min-height: 20px;
  margin-top: 6px;
  font-weight: 400;
}

.tip-text.error {
  color: var(--accent-red);
}

.tip-text.success {
  color: var(--accent-green);
}

/* ============================================
   横屏提示
   ============================================ */
.rotate-tip {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(20px);
  z-index: 99999;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  text-align: center;
  padding: 20px;
}

.rotate-tip .icon {
  font-size: 64px;
  margin-bottom: 24px;
  animation: rotatePhone 2s ease-in-out infinite;
}

@keyframes rotatePhone {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(90deg); }
}

.rotate-tip h2 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 10px;
}

.rotate-tip p {
  color: var(--text-secondary);
  font-size: 15px;
}

@media screen and (orientation: portrait) and (max-width: 900px) {
  .rotate-tip {
    display: flex !important;
  }
}

/* ============================================
   弹窗遮罩
   ============================================ */
.modal-mask {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  animation: fadeIn 0.3s ease;
}

.modal-box {
  background: rgba(30, 30, 50, 0.85);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--glass-border-strong);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  width: 100%;
  max-width: 420px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  animation: modalIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.modal-box h3 {
  text-align: center;
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 8px;
  letter-spacing: -0.5px;
}

/* 加载动画 */
.loading-spinner {
  width: 48px;
  height: 48px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--accent-blue);
  border-radius: 50%;
  margin: 0 auto;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* 滚动条 */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

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

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.35);
}
