/* ================================================================
   Base Styles & Global Variables
   ================================================================ */

:root {
  /* === Color System === */
  --navy-0: #020817;
  --navy-1: #061636;
  --navy-2: #0b2f72;
  --blue: #1769ff;
  --blue-soft: #84b9ff;
  --gold: #d8b45a;
  --gold-light: #fff0b8;
  --gold-deep: #9d7528;
  --white: #f2f7ff;
  --muted: rgba(242, 247, 255, 0.68);
  --glass: rgba(4, 16, 42, 0.56);
  --line-blue: rgba(132, 185, 255, 0.4);
  --line-gold: rgba(216, 180, 90, 0.58);
  --shadow: 0 26px 88px rgba(0, 0, 0, 0.38);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;

  /* === Z-Index Scale === */
  --z-background: 0;
  --z-content: 10;
  --z-floating: 20;
  --z-overlay: 30;
  --z-modal: 50;
  --z-tooltip: 60;

  /* === Spacing Scale === */
  --space-xs: 6px;
  --space-sm: 12px;
  --space-md: 20px;
  --space-lg: 32px;
  --space-xl: 48px;

  /* === Animation Tokens === */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --duration-fast: 150ms;
  --duration-normal: 250ms;
  --duration-slow: 400ms;

  /* === Focus Ring === */
  --focus-ring: 0 0 0 3px rgba(216, 180, 90, 0.35);
}

* {
  box-sizing: border-box;
}

/* === Accessibility: Focus Styles === */
:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-radius: 4px;
}

/* === Accessibility: Reduced Motion === */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  font-family: var(--font);
  color: var(--white);
  background: var(--navy-0);
}

/* Modal-open body lock (used by job detail/selection modals) */
body.modal-open {
  overflow: hidden !important;
  touch-action: none;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font-family: inherit;
}

.app {
  position: relative;
  width: 100vw;
  height: 100vh;
  min-height: 720px;
  overflow: hidden;
  background:
    radial-gradient(circle at 12% 14%, rgba(216, 180, 90, 0.2), transparent 24%),
    radial-gradient(circle at 80% 18%, rgba(23, 105, 255, 0.28), transparent 32%),
    radial-gradient(circle at 56% 92%, rgba(255, 240, 184, 0.1), transparent 34%),
    linear-gradient(135deg, #020817 0%, #061636 38%, #0b2f72 72%, #1769ff 130%);
}

.app::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(circle at center, black 0%, transparent 74%);
  opacity: 0.8;
}

.marquee {
  position: absolute;
  top: 0;
  left: 0;
  z-index: var(--z-overlay);
  width: 100%;
  height: 24px;
  display: flex;
  align-items: center;
  gap: 34px;
  overflow: hidden;
  white-space: nowrap;
  color: rgba(255, 240, 184, 0.44);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  background: rgba(2, 8, 24, 0.38);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.marquee span {
  animation: marquee 24s linear infinite;
}

@keyframes marquee {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-520px);
  }
}

.orb {
  position: absolute;
  width: 440px;
  height: 440px;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(30px);
  opacity: 0.44;
  animation: float 9s ease-in-out infinite;
}

.orb.gold {
  left: -180px;
  top: 70px;
  background: radial-gradient(circle, rgba(216, 180, 90, 0.48), transparent 68%);
}

.orb.blue {
  right: 80px;
  bottom: -150px;
  background: radial-gradient(circle, rgba(23, 105, 255, 0.48), transparent 70%);
  animation-delay: -3s;
}

@keyframes float {
  0%, 100% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  50% {
    transform: translate3d(20px, -22px, 0) scale(1.04);
  }
}

.topbar {
  position: absolute;
  top: 40px;
  left: 50%;
  z-index: 100;
  width: min(1180px, calc(100vw - 72px));
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: 260px 1fr 260px;
  align-items: center;
  gap: var(--space-md);
}

.brand {
  justify-self: center;
  text-align: center;
  line-height: 1.05;
  padding-top: 2px;
}

.brand::after {
  content: "";
  display: block;
  width: 220px;
  height: 1px;
  margin: 12px auto 0;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(216, 180, 90, 0.2),
    rgba(255, 240, 184, 0.9),
    rgba(216, 180, 90, 0.2),
    transparent
  );
  box-shadow: 0 0 14px rgba(216, 180, 90, 0.28);
}

.brand-title {
  font-family: "Alibaba PuHuiTi", "HarmonyOS Sans SC", "MiSans", "Source Han Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 42px;
  font-weight: 900;
  letter-spacing: 0.06em;
  background: linear-gradient(90deg, #FFF4C2 0%, #D8B45A 45%, #FFF0B8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 18px rgba(216, 180, 90, 0.24);
  white-space: nowrap;
}

.brand-sub {
  margin-top: 8px;
  font-family: "Inter", "Sora", "Rajdhani", "PingFang SC", sans-serif;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: rgba(255, 240, 184, 0.76);
}

.top-actions {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 14px;
}

.nav-btn {
  height: 40px;
  min-width: 94px;
  padding: 0 18px;
  border-radius: 10px;
  color: rgba(242, 247, 255, 0.94);
  background: rgba(3, 14, 38, 0.34);
  border: 1px solid rgba(132, 185, 255, 0.42);
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  transition: color var(--duration-fast) var(--ease-out),
              border-color var(--duration-fast) var(--ease-out),
              box-shadow var(--duration-fast) var(--ease-out),
              transform var(--duration-fast) var(--ease-out);
  box-shadow: inset 0 0 18px rgba(132, 185, 255, 0.06);
  touch-action: manipulation;
}

@media (hover: hover) {
  .nav-btn:hover {
    color: var(--gold-light);
    border-color: rgba(216, 180, 90, 0.92);
    box-shadow:
      0 0 24px rgba(216, 180, 90, 0.18),
      inset 0 0 22px rgba(216, 180, 90, 0.08);
    transform: translateY(-1px);
  }
}

.nav-btn:active {
  transform: scale(0.97);
}

/* === User Dropdown Wrap === */
.user-dropdown-wrap {
  position: relative;
}

.user-btn {
  position: relative;
}

.user-btn::after {
  content: "▾";
  margin-left: 6px;
  font-size: 10px;
  color: rgba(242, 247, 255, 0.48);
}

/* === User Dropdown Menu === */
.user-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 150px;
  padding: 6px 0;
  background: rgba(8, 22, 45, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(216, 180, 90, 0.32);
  border-radius: 14px;
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.42),
    0 0 0 1px rgba(216, 180, 90, 0.06);
  z-index: 200;
  overflow: hidden;
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.user-dropdown-menu:not([hidden]) {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* === User Dropdown Items (我的记录 / 退出登录) === */
.user-dropdown-item {
  appearance: none;
  -webkit-appearance: none;
  display: block;
  width: calc(100% - 16px);
  margin: 3px 8px;
  padding: 10px 14px;
  border: 1px solid rgba(216, 180, 90, 0.42);
  background: rgba(8, 22, 45, 0.68);
  color: #f7ecd0;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.2;
  letter-spacing: 0.01em;
  cursor: pointer;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow:
    0 8px 22px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  transition:
    background 0.18s ease,
    border-color 0.18s ease,
    color 0.18s ease,
    transform 0.18s ease,
    box-shadow 0.18s ease;
  text-align: center;
  white-space: nowrap;
}

.user-dropdown-item:hover {
  background: rgba(14, 32, 64, 0.88);
  border-color: rgba(243, 213, 107, 0.78);
  color: #f3d56b;
  transform: translateY(-1px);
  box-shadow:
    0 12px 30px rgba(0, 0, 0, 0.28),
    0 0 0 1px rgba(243, 213, 107, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.user-dropdown-item:active {
  transform: translateY(0);
  background: rgba(6, 18, 38, 0.9);
}

/* 退出登录 — slightly subdued border */
.user-dropdown-item.logout {
  border-color: rgba(216, 180, 90, 0.32);
  color: rgba(255, 210, 160, 0.82);
}

.user-dropdown-item.logout:hover {
  border-color: rgba(243, 213, 107, 0.72);
  color: #f3d56b;
  background: rgba(18, 28, 48, 0.9);
  box-shadow:
    0 12px 30px rgba(0, 0, 0, 0.28),
    0 0 0 1px rgba(255, 100, 100, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

/* === Language Toggle === */
.lang-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 8px;
}

.lang-option {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 28px;
  padding: 0 8px;
  border-radius: 8px;
  color: rgba(242, 247, 255, 0.72);
  transition: all 0.2s ease;
}

.lang-option.active {
  color: #fff0b8;
  background: rgba(216, 180, 90, 0.18);
  border: 1px solid rgba(255, 240, 184, 0.78);
  box-shadow:
    0 0 14px rgba(216, 180, 90, 0.28),
    inset 0 0 12px rgba(255, 240, 184, 0.08);
}

.lang-divider {
  color: rgba(242, 247, 255, 0.52);
  font-weight: 700;
}

.view {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transform: translateY(18px);
  transition: opacity var(--duration-slow) var(--ease-out),
              transform var(--duration-slow) var(--ease-out);
}

.view.active {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

/* === Footer === */
.footer {
  width: 100%;
  max-width: 960px;
  margin: 72px auto 0;
  padding: 24px 24px calc(36px + env(safe-area-inset-bottom, 0px));
  text-align: center;
  color: rgba(242, 247, 255, 0.52);
  font-size: 13px;
}

.footer-privacy-note {
  max-width: 760px;
  margin: 0 auto 12px;
  font-size: 13px;
  line-height: 1.6;
  color: rgba(242, 247, 255, 0.45);
}

.footer-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 13px;
}

.footer-links a {
  color: rgba(242, 247, 255, 0.68);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-links a:hover {
  color: #f3d56b;
}

.star {
  color: var(--gold-light);
  text-shadow: 0 0 16px var(--gold);
  font-size: 18px;
}

/* === Generic Glass Card === */
.glass-card {
  position: relative;
  border-radius: 24px;
  background: rgba(3, 14, 38, 0.58);
  border: 1px solid rgba(132, 185, 255, 0.28);
  box-shadow: var(--shadow), inset 0 0 36px rgba(23, 105, 255, 0.10);
  backdrop-filter: blur(14px);
}

.glass-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, rgba(255, 240, 184, 0.72), rgba(23, 105, 255, 0.18), rgba(216, 180, 90, 0.55));
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  opacity: 0.76;
}

/* === Generic Button === */
.cta-btn {
  height: 52px;
  padding: 0 28px;
  border-radius: 14px;
  border: none;
  background: linear-gradient(135deg, #D8B45A 0%, #C9A340 50%, #B8942E 100%);
  color: #061636;
  font-size: 16px;
  font-weight: 900;
  cursor: pointer;
  transition: transform var(--duration-fast) var(--ease-out),
              box-shadow var(--duration-fast) var(--ease-out);
  box-shadow: 0 8px 28px rgba(216, 180, 90, 0.22);
  touch-action: manipulation;
}

@media (hover: hover) {
  .cta-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 36px rgba(216, 180, 90, 0.32);
  }
}

.cta-btn:active {
  transform: scale(0.96);
}

/* === Generic Input & Select === */
.generic-input,
.generic-select,
.generic-textarea {
  width: 100%;
  border: 1px solid rgba(132, 185, 255, 0.28);
  background: rgba(2, 10, 28, 0.38);
  color: var(--white);
  border-radius: 13px;
  padding: 11px 14px;
  outline: none;
  font-size: 14px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.generic-input::placeholder,
.generic-textarea::placeholder {
  color: rgba(242, 247, 255, 0.32);
}

.generic-input:focus,
.generic-select:focus,
.generic-textarea:focus {
  border-color: rgba(216, 180, 90, 0.78);
  box-shadow: var(--focus-ring);
  outline: none;
}

.generic-select option,
.generic-select option {
  background: #061636;
  color: var(--white);
}

/* === Liquid Ripple Canvas === */
#rippleCanvas {
  position: fixed;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  width: 100vw;
  height: 100vh;
}

/* === Toast / notification for disabled feature === */
.feature-toast {
  position: fixed;
  top: 28px;
  left: 50%;
  transform: translateX(-50%);
  z-index: var(--z-tooltip);
  padding: 12px 28px;
  border-radius: 12px;
  background: rgba(4, 16, 42, 0.94);
  backdrop-filter: blur(18px);
  border: 1px solid rgba(216, 180, 90, 0.42);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.48);
  font-size: 13px;
  font-weight: 700;
  color: rgba(242, 247, 255, 0.82);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--duration-normal) var(--ease-out);
}

.feature-toast.show {
  opacity: 1;
}