/* ============================================================
   common.css — 全站基础（重置 · 登录弹窗结构 · Toast）
   Apple 极简页面视觉见 auth-modal-apple.css / page-index.css
   ============================================================ */

@import url('auth-modal-apple.css');

:root {
  --nav-inner-max: 1180px;
}

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

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', 'Segoe UI', sans-serif;
  line-height: 1.6;
  min-height: 100vh;
  position: relative;
}

body > * {
  position: relative;
  z-index: 1;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.container {
  max-width: var(--nav-inner-max);
  margin: 0 auto;
  padding: 0 24px;
}

#site-auth {
  position: relative;
  z-index: 950;
}

.page-main {
  padding-top: 8px;
  padding-bottom: 64px;
}

.page-enter {
  animation: page-enter-fade 0.6s ease-out both;
}

@keyframes page-enter-fade {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.fade-in {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: none;
}

/* 登录弹窗 — 结构层（视觉见 auth-modal-apple.css） */
.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.28s ease, visibility 0.28s ease;
}

.auth-modal.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

body.auth-modal-open {
  overflow: hidden;
}

.auth-modal-backdrop {
  position: absolute;
  inset: 0;
}

.auth-modal-sheet {
  position: relative;
  z-index: 1;
  width: 100%;
  max-height: min(94vh, 760px);
  overflow: auto;
}

.auth-pane {
  display: none;
}

.auth-pane.active {
  display: block;
}

.auth-field {
  margin-bottom: 18px;
}

.auth-field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
}

.auth-input-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.field-icon {
  display: flex;
  flex-shrink: 0;
}

.field-icon i {
  width: 18px;
  height: 18px;
}

.auth-input-wrap input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  font-size: 15px;
  font-family: inherit;
  outline: none;
}

.auth-tabs {
  display: flex;
  gap: 0;
  margin: 4px 0 20px;
}

.auth-tab {
  flex: 1;
  padding: 10px 4px;
  border: none;
  background: transparent;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  font-family: inherit;
  transition: color 0.18s ease, border-color 0.18s ease;
}

.auth-tab.active::after {
  display: none;
}

.auth-submit.btn-primary {
  width: 100%;
  justify-content: center;
  margin-top: 8px;
  box-sizing: border-box;
}

.auth-msg {
  margin-top: 12px;
  font-size: 13px;
  color: #c44;
  min-height: 1.2em;
}

.auth-switch {
  margin-top: 16px;
  text-align: center;
}

.auth-link {
  background: none;
  border: none;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  font-family: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.auth-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.auth-row--agree {
  margin-bottom: 12px;
}

.auth-check {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  cursor: pointer;
}

.auth-code-row {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  width: 100%;
}

.auth-code-input {
  flex: 1;
  min-width: 0;
}

.auth-send-code {
  flex-shrink: 0;
  align-self: flex-end;
  margin-bottom: 2px;
  padding: 10px 14px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
}

.auth-send-code:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.auth-reset-lead {
  font-size: 14px;
  margin-bottom: 16px;
  line-height: 1.6;
}

.auth-toggle-pw {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  display: flex;
}

.auth-toggle-pw .icon-eye-off {
  display: none;
}

.auth-toggle-pw.is-visible .icon-eye {
  display: none;
}

.auth-toggle-pw.is-visible .icon-eye-off {
  display: block;
}

.maclogin-toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(120%);
  z-index: 3000;
  max-width: min(92vw, 420px);
  padding: 14px 20px;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 600;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.maclogin-toast:not([hidden]) {
  transform: translateX(-50%) translateY(0);
}

.maclogin-toast--error {
  border-color: rgba(251, 113, 133, 0.45);
}

.maclogin-toast--ok {
  border-color: rgba(52, 211, 153, 0.4);
}

@media (prefers-reduced-motion: reduce) {
  .fade-in {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .page-enter {
    animation: none;
  }
}

@media (max-width: 768px) {
  .page-enter {
    animation: none;
  }

  .fade-in {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ── Language Switcher (theme-apple-minimal inline nav) ── */
html.theme-apple-minimal .lang-dropdown {
  position: relative;
}

html.theme-apple-minimal .home-lang-trigger {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  border-radius: 8px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: #636366;
  transition: background 0.15s, color 0.15s;
  line-height: 1;
}

html.theme-apple-minimal .home-lang-trigger:hover,
html.theme-apple-minimal .lang-dropdown.open .home-lang-trigger {
  background: #f5f5f7;
  color: #1d1d1f;
}

html.theme-apple-minimal .home-lang-trigger [data-lucide] {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

html.theme-apple-minimal .lang-chevron {
  width: 12px !important;
  height: 12px !important;
  transition: transform 0.2s;
}

html.theme-apple-minimal .lang-dropdown.open .lang-chevron {
  transform: rotate(180deg);
}

html.theme-apple-minimal .lang-menu {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 1000;
  min-width: 160px;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 14px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1), 0 2px 8px rgba(0, 0, 0, 0.06);
  padding: 6px;
  list-style: none;
  margin: 0;
}

html.theme-apple-minimal .lang-dropdown.open .lang-menu {
  display: block;
}

html.theme-apple-minimal .lang-menu li {
  list-style: none;
}

html.theme-apple-minimal .lang-menu a {
  display: block;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: #1d1d1f;
  text-decoration: none;
  transition: background 0.12s;
}

html.theme-apple-minimal .lang-menu a:hover {
  background: #f5f5f7;
}

html.theme-apple-minimal .lang-menu a[aria-current="true"] {
  color: #007aff;
  font-weight: 600;
}

/* Mobile: language section in mobile panel */
html.theme-apple-minimal .home-mobile-lang {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding-top: 8px;
  margin-top: 8px;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

html.theme-apple-minimal .home-mobile-lang__title {
  padding: 8px 12px 4px;
  font-size: 11px;
  font-weight: 600;
  color: #8e8e93;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

html.theme-apple-minimal .home-mobile-lang a {
  display: block;
  width: 100%;
  padding: 12px 12px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  color: #1d1d1f;
  text-decoration: none;
  transition: background 0.12s;
}

html.theme-apple-minimal .home-mobile-lang a:hover {
  background: #f5f5f7;
}

html.theme-apple-minimal .home-mobile-lang a[aria-current="true"] {
  color: #007aff;
  font-weight: 600;
}
