/**
 * Prestige Template - 大气庄重风格
 * 浅色系配色，简洁大气的登录页面设计
 */

/* ===== 本地字体 ===== */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url("../fonts/Inter-Light.woff2") format("woff2");
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/Inter-Regular.woff2") format("woff2");
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/Inter-Medium.woff2") format("woff2");
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/Inter-SemiBold.woff2") format("woff2");
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/Inter-Bold.woff2") format("woff2");
}

/* ===== CSS 变量定义 ===== */
:root {
  /* 主色调 - 可通过 PHP 覆盖 */
  --primary-color: #0ea5e9 !important;
  --primary-light: rgba(14, 165, 233, 0.2);
  --primary-lighter: rgba(14, 165, 233, 0.1);

  /* 中性色 */
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --text-light: #94a3b8;
  --border-color: #e2e8f0;
  --border-focus: var(--primary-color);

  /* 背景色 */
  --bg-primary: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-tertiary: #f1f5f9;

  /* 渐变色 */
  --gradient-1: linear-gradient(135deg, #0ea5e9 0%, #06b6d4 50%, #14b8a6 100%);
  --gradient-2: linear-gradient(135deg, #38bdf8 0%, #22d3ee 100%);
  --gradient-3: linear-gradient(135deg, #0ea5e9 0%, #3b82f6 100%);

  /* 阴影 */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md:
    0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  --shadow-lg:
    0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
  --shadow-xl:
    0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.15);

  /* 过渡 */
  --transition-fast: 0.15s ease;
  --transition-base: 0.3s ease;
  --transition-slow: 0.5s ease;
}

/* ===== 全局样式 ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

.prestige-body {
  font-family:
    "Inter",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    "Microsoft YaHei",
    sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 50%, #f0fdfa 100%);
}

/* ===== 背景装饰 ===== */
.prestige-background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  overflow: hidden;
}

.gradient-layer {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.6;
  animation: float 20s ease-in-out infinite;
}

.layer-1 {
  width: 800px;
  height: 800px;
  background: linear-gradient(
    135deg,
    rgba(14, 165, 233, 0.3),
    rgba(6, 182, 212, 0.2)
  );
  top: -200px;
  right: -200px;
  animation-delay: 0s;
}

.layer-2 {
  width: 600px;
  height: 600px;
  background: linear-gradient(
    135deg,
    rgba(20, 184, 166, 0.25),
    rgba(59, 130, 246, 0.2)
  );
  bottom: -150px;
  left: -150px;
  animation-delay: -7s;
}

.layer-3 {
  width: 500px;
  height: 500px;
  background: linear-gradient(
    135deg,
    rgba(34, 211, 238, 0.2),
    rgba(14, 165, 233, 0.15)
  );
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation-delay: -14s;
}

@keyframes float {
  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }
  33% {
    transform: translate(30px, -30px) scale(1.05);
  }
  66% {
    transform: translate(-20px, 20px) scale(0.95);
  }
}

/* 浮动圆形 */
.floating-shapes {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.shape {
  position: absolute;
  border-radius: 50%;
  background: var(--gradient-1);
  opacity: 0.08;
  animation: floatShape 25s ease-in-out infinite;
}

.shape-circle-1 {
  width: 300px;
  height: 300px;
  top: 10%;
  left: 10%;
  animation-delay: 0s;
}

.shape-circle-2 {
  width: 200px;
  height: 200px;
  bottom: 20%;
  right: 15%;
  animation-delay: -8s;
}

.shape-circle-3 {
  width: 150px;
  height: 150px;
  top: 60%;
  left: 20%;
  animation-delay: -16s;
}

@keyframes floatShape {
  0%,
  100% {
    transform: translate(0, 0) rotate(0deg);
  }
  25% {
    transform: translate(50px, 50px) rotate(90deg);
  }
  50% {
    transform: translate(0, 100px) rotate(180deg);
  }
  75% {
    transform: translate(-50px, 50px) rotate(270deg);
  }
}

/* ===== 主容器 ===== */
.prestige-wrapper {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}

/* ===== 登录卡片 ===== */
.prestige-card {
  background: var(--bg-primary);
  border-radius: 24px;
  box-shadow: var(--shadow-2xl);
  width: 100%;
  max-width: 460px;
  max-height: 90vh;
  overflow-y: auto;
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
}

.prestige-card.visible {
  opacity: 1;
  transform: translateY(0);
}

/* 卡片头部 */
.card-header {
  padding: 50px 40px 30px;
  text-align: center;
  background: linear-gradient(
    180deg,
    var(--bg-secondary) 0%,
    var(--bg-primary) 100%
  );
  border-bottom: 1px solid var(--border-color);
}

.logo-container {
  margin-bottom: 24px;
}

.logo-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto;
  background: var(--gradient-1);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 20px rgba(14, 165, 233, 0.3);
  position: relative;
  overflow: hidden;
}

.logo-icon::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    45deg,
    transparent 30%,
    rgba(255, 255, 255, 0.3) 50%,
    transparent 70%
  );
  transform: rotate(45deg);
  animation: shine 3s ease-in-out infinite;
}

@keyframes shine {
  0% {
    transform: translateX(-100%) translateY(-100%) rotate(45deg);
  }
  100% {
    transform: translateX(100%) translateY(100%) rotate(45deg);
  }
}

/* SVG 保持固定大小 */
.logo-icon svg {
  width: 40px;
  height: 40px;
  color: #ffffff;
  position: relative;
  z-index: 1;
}

/* 图片使用原始大小，移除容器背景装饰 */
.logo-icon:has(img) {
  width: 80px;
  height: 80px;
  background: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  overflow: visible;
}

.logo-icon:has(img)::before {
  display: none !important;
}

.logo-icon img {
  width: 50px;
  height: 50px;
  display: block;
  position: static;
  object-fit: contain;
}

.site-title {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
  letter-spacing: -0.5px;
}

.site-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 400;
}

/* 卡片主体 */
.card-body {
  padding: 40px;
}

.form-intro {
  text-align: center;
  margin-bottom: 32px;
}

.form-title {
  font-size: 22px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.form-desc {
  font-size: 14px;
  color: var(--text-secondary);
}

/* 表单样式 */
.login-form {
  margin-top: 0;
}

.form-group {
  margin-bottom: 24px;
}

.form-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.form-label svg {
  color: var(--text-primary);
}

.input-container {
  position: relative;
  display: flex;
  align-items: center;
}

.form-input {
  width: 100%;
  height: 52px;
  padding: 0 16px;
  font-size: 15px;
  color: var(--text-primary);
  background: var(--bg-primary);
  border: 2px solid var(--border-color);
  border-radius: 12px;
  transition:
    border-color var(--transition-base),
    box-shadow var(--transition-base);
  outline: none;
}

.form-input::placeholder {
  color: var(--text-light);
}

.form-input:focus {
  border-color: #d1d5db;
  box-shadow: 0 0 0 4px rgba(209, 213, 219, 0.2);
}

.input-container.focused .input-border {
  transform: scaleX(1);
}

.password-toggle {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  cursor: pointer;
  border-radius: 8px;
  color: var(--text-light);
  transition: all var(--transition-fast);
}

.password-toggle:hover {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
}

.password-toggle svg {
  width: 20px;
  height: 20px;
}

/* 记住我 */
.form-options {
  margin-bottom: 28px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}

.checkbox-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.checkbox-box {
  width: 20px;
  height: 20px;
  background: var(--bg-secondary);
  border: 2px solid var(--border-color);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.checkbox-input:checked + .checkbox-box {
  background: var(--primary-color);
  border-color: var(--primary-color);
}

.checkbox-input:checked + .checkbox-box .check-icon {
  opacity: 1;
  transform: scale(1);
}

.check-icon {
  color: #ffffff;
  opacity: 0;
  transform: scale(0.5);
  transition: all var(--transition-fast);
}

.checkbox-text {
  font-size: 14px;
  color: var(--text-secondary);
}

/* 提交按钮 */
.submit-button {
  width: 100%;
  height: 54px;
  background: var(--gradient-1);
  color: #ffffff;
  font-size: 16px;
  font-weight: 600;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all var(--transition-base);
  box-shadow: 0 4px 12px rgba(14, 165, 233, 0.3);
  position: relative;
  overflow: hidden;
}

.submit-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(14, 165, 233, 0.4);
  color: #ffffff;
}

.submit-button:active {
  transform: translateY(0);
}

.submit-button.submitting {
  opacity: 0.8;
  cursor: not-allowed;
}

.button-icon {
  transition: transform var(--transition-base);
}

.submit-button:hover .button-icon {
  transform: translateX(4px);
}

.button-shine {
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.3) 50%,
    transparent 100%
  );
  transition: left 0.6s ease;
}

.submit-button:hover .button-shine {
  left: 100%;
}

/* 卡片底部 */
.card-footer {
  padding: 0 40px 32px;
  flex-shrink: 0;
  margin-top: auto;
}

.footer-divider {
  height: 1px;
  background: var(--border-color);
  margin-bottom: 24px;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
}

.footer-link {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all var(--transition-fast);
}

.footer-link:hover {
  color: var(--primary-color);
}

.footer-link svg {
  width: 16px;
  height: 16px;
}

/* 版权信息 */
.prestige-footer {
  margin-top: 40px;
  text-align: center;
  color: var(--text-secondary);
  font-size: 13px;
}

.prestige-footer p {
  opacity: 0.8;
}

/* ===== 响应式设计 ===== */
@media (max-width: 768px) {
  .prestige-card {
    max-width: 100%;
    border-radius: 20px;
    max-height: 85vh;
  }

  .card-header {
    padding: 40px 30px 24px;
  }

  .card-body {
    padding: 30px;
  }

  .card-footer {
    padding: 0 30px 24px;
  }

  .site-title {
    font-size: 24px;
  }

  .logo-icon {
    width: 64px;
    height: 64px;
  }

  .form-input,
  .submit-button {
    height: 50px;
  }
}

@media (max-width: 480px) {
  .prestige-wrapper {
    padding: 20px 16px;
  }

  .prestige-card {
    border-radius: 16px;
    max-height: 90vh;
  }

  .card-header {
    padding: 32px 24px 20px;
  }

  .card-body {
    padding: 24px;
  }

  .card-footer {
    padding: 0 24px 24px;
  }

  .site-title {
    font-size: 22px;
  }

  .form-title {
    font-size: 20px;
  }

  .footer-links {
    flex-direction: column;
    gap: 16px;
  }

  .footer-link {
    justify-content: center;
  }
}

/* ===== 深色模式支持（可选） ===== */
@media (prefers-color-scheme: dark) {
  /* 可以在这里添加深色模式样式 */
  /* 暂不启用，保持浅色系风格 */
}

/* ===== 打印样式 ===== */
@media print {
  .prestige-background,
  .prestige-footer {
    display: none;
  }

  .prestige-card {
    box-shadow: none;
    border: 1px solid var(--border-color);
  }
}

/* ===== 辅助功能 ===== */
.submit-button:focus-visible,
.form-input:focus-visible,
.password-toggle:focus-visible {
  outline: 2px solid #d1d5db;
  outline-offset: 2px;
}

/* 减少动画效果（尊重用户偏好） */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ===== 自定义滚动条样式 ===== */
.prestige-card::-webkit-scrollbar {
  width: 6px;
}

.prestige-card::-webkit-scrollbar-track {
  background: transparent;
}

.prestige-card::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 3px;
}

.prestige-card::-webkit-scrollbar-thumb:hover {
  background: var(--primary-color);
}

/* ===== 消息提示 ===== */
.gate-message {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    z-index: 9999;
    min-width: 280px;
    max-width: 400px;
    padding: 14px 18px;
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    gap: 10px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    border: 1px solid #e2e8f0;
}

.gate-message.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.gate-message.success {
    background: #f0fdf4;
    border-color: #86efac;
}

.gate-message.success .message-icon {
    color: #22c55e;
}

.gate-message.error {
    background: #fef2f2;
    border-color: #fca5a5;
}

.gate-message.error .message-icon {
    color: #ef4444;
}

.gate-message.notice {
    background: #fffbeb;
    border-color: #fcd34d;
}

.gate-message.notice .message-icon {
    color: #f59e0b;
}

.message-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
}

.message-content {
    flex: 1;
    font-size: 14px;
    font-weight: 400;
    color: #334155;
    line-height: 1.5;
}

.message-close {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    cursor: pointer;
    color: #94a3b8;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    padding: 2px;
}

.message-close:hover {
    color: #64748b;
    background: rgba(0, 0, 0, 0.05);
}

@media (max-width: 480px) {
    .gate-message {
        min-width: auto;
        width: calc(100vw - 32px);
        top: 16px;
        max-width: none;
    }
}
