/* ============================================
   登录 / 注册页 · 与修仙天机阁主色一致
   依赖：css/style.css 中的 :root 变量
   ============================================ */

/* ----- 顶栏（匾额式） ----- */
.site-header .header-inner {
  position: relative;
  z-index: 20;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 64px;
}

.site-header .logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 700;
  flex-shrink: 0;
}

.site-header .logo-icon {
  font-size: 1.5rem;
}

.site-header .logo-text {
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--secondary-color);
}

.main-nav {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
  gap: 0.25rem 0.75rem;
  flex: 1;
  overflow-x: auto;
}

.main-nav a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  padding: 0.35rem 0.4rem;
  white-space: nowrap;
  border-radius: 6px;
  transition: color 0.2s, background 0.2s;
}

.main-nav a:hover {
  color: var(--accent-gold);
  background: rgba(212, 168, 75, 0.1);
}

.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: 6px;
}

.menu-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-primary);
  margin: 0 auto;
  transition: transform 0.2s;
}

.menu-toggle[aria-expanded='true'] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.menu-toggle[aria-expanded='true'] span:nth-child(2) {
  opacity: 0;
}
.menu-toggle[aria-expanded='true'] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ===== 登录/注册页面样式 ===== */

.auth-page {
  min-height: calc(100vh - 200px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  background: linear-gradient(135deg, #fdf6e3 0%, #f5e6d3 100%);
}

.auth-container {
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
}

.auth-card {
  background: #fffef9;
  border: 1px solid #e8dcc8;
  border-radius: 16px;
  padding: 2.5rem;
  box-shadow: 0 8px 24px rgba(139, 115, 85, 0.15);
}

.auth-title {
  text-align: center;
  color: #5c4b37;
  font-size: 1.8rem;
  margin-bottom: 0.5rem;
  font-family: 'ZCOOL KuaiLe', var(--font-display), cursive;
}

.auth-subtitle {
  text-align: center;
  color: #999;
  font-size: 0.95rem;
  margin-bottom: 2rem;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.auth-form .form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.auth-form .form-label {
  color: #5c4b37;
  font-weight: 500;
  font-size: 0.95rem;
}

.auth-form .form-input {
  width: 100%;
  padding: 0.875rem 1rem;
  border: 2px solid #e8dcc8;
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
  background: #fffef9;
  color: #5c4b37;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
}

.auth-form .form-input:focus {
  outline: none;
  border-color: #d4a76a;
  box-shadow: 0 0 0 3px rgba(212, 167, 106, 0.2);
}

.input-group {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
  flex-wrap: wrap;
}

.input-group .form-input {
  flex: 1;
  min-width: 0;
}

.btn-code {
  flex-shrink: 0;
  padding: 0.875rem 1rem;
  background: #f5e6d3;
  color: #5c4b37;
  border: 2px solid #e8dcc8;
  border-radius: 8px;
  font-size: 0.9rem;
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
  transition: background 0.2s, border-color 0.2s, opacity 0.2s;
}

.btn-code:hover:not(:disabled) {
  background: #e8dcc8;
  border-color: #d4a76a;
}

.btn-code:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.auth-form .form-hint {
  color: #999;
  font-size: 0.85rem;
}

.auth-form .form-error {
  color: #c44d4d;
  font-size: 0.85rem;
  min-height: 1.2em;
}

.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  color: #5c4b37;
  font-size: 0.9rem;
  cursor: pointer;
  line-height: 1.5;
}

.checkbox-label input[type='checkbox'] {
  margin-top: 0.2rem;
  accent-color: #d4a76a;
  width: 1.1rem;
  height: 1.1rem;
  flex-shrink: 0;
  cursor: pointer;
}

.checkbox-label a {
  color: #8b7355;
  text-decoration: underline;
}

.checkbox-label a:hover {
  color: #6d5a42;
}

.form-actions {
  margin-top: 0.5rem;
}

.btn-block {
  width: 100%;
  padding: 1rem;
  font-size: 1.1rem;
  justify-content: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.5rem;
  font-size: 1rem;
  font-family: inherit;
  border-radius: 10px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: filter 0.2s, transform 0.05s;
}

.btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--primary-color);
  color: var(--secondary-color);
  border-color: var(--border-color);
}

.btn-primary:hover:not(:disabled) {
  filter: brightness(1.05);
}

.btn-secondary {
  background: #fdf6e3;
  color: #5c4b37;
  border-color: #e8dcc8;
}

.btn-inline {
  padding: 0.5rem 0.85rem;
  font-size: 0.9rem;
  white-space: nowrap;
}

.auth-links {
  text-align: center;
  color: #999;
  font-size: 0.9rem;
  margin-top: 1rem;
}

.auth-links a {
  color: #8b7355;
  text-decoration: none;
  font-weight: 500;
  margin-left: 0.25rem;
}

.auth-links a:hover {
  text-decoration: underline;
}

.auth-footer-link {
  text-align: center;
  margin-top: 1.25rem;
  font-size: 0.9rem;
}

.auth-footer-link a {
  color: var(--text-secondary);
}

/* 注册页：验证码行 */
.form-row-code {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: flex-start;
}

.form-row-code .form-input {
  flex: 1;
  min-width: 120px;
}

/* ----- 页脚 ----- */
.site-footer .footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem;
  text-align: center;
}

.site-footer .footer-text {
  color: var(--text-muted);
  font-size: 0.88rem;
  margin: 0;
}

/* ----- Toast ----- */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: #5c4b37;
  color: #fff;
  padding: 1rem 2rem;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  opacity: 0;
  transition: all 0.3s ease;
  z-index: 9999;
  max-width: min(90vw, 400px);
  pointer-events: none;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.toast.success {
  background: #558b2f;
}

.toast.error {
  background: #c44d4d;
}

.toast.info {
  background: #5c4b37;
}

.toast-icon {
  flex-shrink: 0;
}

.toast-message {
  font-size: 0.95rem;
  line-height: 1.45;
}

/* ----- 响应式 ----- */
@media (max-width: 768px) {
  .menu-toggle {
    display: flex;
  }

  .main-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    padding: 1rem 1.25rem 1.25rem;
    background: rgba(250, 245, 235, 0.98);
    border-bottom: 1px solid var(--border-subtle);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
    gap: 0;
  }

  .main-nav.is-open {
    display: flex;
  }

  .main-nav a {
    padding: 0.65rem 0.5rem;
    border-radius: 6px;
  }

  .site-header .header-inner {
    flex-wrap: wrap;
  }

  .auth-title {
    font-size: 1.5rem;
  }
}

@media (max-width: 480px) {
  .auth-card {
    padding: 2rem 1.5rem;
  }

  .input-group {
    flex-direction: column;
  }

  .btn-code {
    width: 100%;
  }
}
