:root {
  --bg1: #070c11;
  --bg2: #0f1824;
  --fg: #e7f1fb;
  --fg-muted: rgba(231, 241, 251, 0.75);
  --fg-subtle: rgba(231, 241, 251, 0.55);
  --glass-bg: rgba(17, 25, 40, 0.4);
  --glass-border: none;
  --glass-radius: 18px;
  --shadow-lg: 0 24px 60px rgba(3, 8, 20, 0.45);
  --shadow-md: 0 12px 32px rgba(6, 11, 21, 0.4);
  --shadow-sm: 0 4px 16px rgba(6, 11, 21, 0.35);

  --brand: #5cc8ff;
  --brand-soft: rgba(92, 200, 255, 0.18);
  --accent: #7a8cff;
  --warn: #ffcf66;

  --page-padding: clamp(24px, 5vh, 64px);
  --section-gap: clamp(20px, 4vh, 48px);
  --card-gap: clamp(16px, 3vh, 28px);
  --pane-padding: clamp(18px, 3vh, 28px);
  --grid-gap: clamp(12px, 1.8vh, 20px);

  --font-title: clamp(18px, 3.2vw, 24px);
  --font-h2: clamp(14px, 1.8vw, 18px);
  --font-body: clamp(14px, 1.6vw, 16px);
  --font-small: clamp(12px, 1.2vw, 14px);
}

/* Visually hidden but accessible text holder (for i18n targets we removed from UI) */
.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

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

html {
  height: 100%;
  background-color: #070c11;
}

body {
  height: 100%;
}

body {
  margin: 0;
  color: var(--fg);
  font-family: "Inter", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, -apple-system,
    BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: var(--font-body);
  background:
    radial-gradient(1400px 720px at 10% -15%, rgba(32, 80, 149, 0.35), transparent 65%),
    radial-gradient(980px 520px at 90% -5%, rgba(80, 45, 149, 0.32), transparent 65%),
    linear-gradient(180deg, var(--bg1), var(--bg2));
  line-height: 1.55;
}

.page {
  padding: var(--page-padding);
  padding-top: calc(var(--page-padding) + 12px);
  display: flex;
  flex-direction: column;
  gap: clamp(0px, 0.5vh, 2px);
}

.glass {
  background: var(--glass-bg);
  border: none;
  border-radius: var(--glass-radius);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(14px) saturate(1.35);
}

.debug-warning {
  position: fixed;
  top: 0;
  inset-inline: 0;
  text-align: center;
  padding-block: 10px;
  font-size: var(--font-small);
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #0b0f14;
  background: linear-gradient(120deg, #ffb067 0%, #ff6b6b 100%);
  z-index: 1000;
  box-shadow: var(--shadow-lg);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: clamp(10px, 1.8vh, 16px) clamp(18px, 3vw, 32px);
  background: transparent;
  box-shadow: none;
}

.brand {
  display: flex;
  align-items: center;
  gap: clamp(10px, 1.6vw, 18px);
}

.model-inline {
  display: flex;
  align-items: center;
  gap: clamp(10px, 1.6vw, 16px);
  margin-left: clamp(10px, 2vw, 24px);
  flex-wrap: wrap;
}

.model-inline .label {
  color: var(--fg-subtle);
  font-size: var(--font-small);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.brand-tagline {
  font-size: clamp(16px, 2.1vw, 22px);
  font-weight: 500;
  color: var(--fg-muted);
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.logo {
  width: clamp(30px, 4vw, 36px);
  height: clamp(30px, 4vw, 36px);
  display: grid;
  place-items: center;
  border-radius: 14px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.04);
}

.logo img {
  width: 100%;
  height: 100%;
}

.logo-link {
  text-decoration: none;
  color: inherit;
}

.title {
  font-size: clamp(18px, 2.4vw, 24px);
  font-weight: 700;
  letter-spacing: 0.04em;
}

.actions {
  display: flex;
  align-items: center;
  gap: clamp(8px, 1.5vw, 18px);
}

.user-info {
  display: inline-flex;
  align-items: center;
  gap: clamp(6px, 1.2vw, 12px);
  min-width: 0;
}

.user-avatar,
#userAvatar {
  width: clamp(32px, 4vw, 40px);
  height: clamp(32px, 4vw, 40px);
  border-radius: 50%;
  flex-shrink: 0;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.user-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.08);
  color: var(--fg-muted);
  cursor: default;
  pointer-events: none;
}

.user-avatar i {
  font-size: clamp(14px, 2vw, 18px);
  line-height: 1;
}

.user-avatar:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 0 4px rgba(92, 200, 255, 0.18);
}

.user-info .user-name {
  font-size: clamp(13px, 1.5vw, 14px);
  font-weight: 600;
  color: var(--fg-muted);
  max-width: clamp(120px, 20vw, 240px);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-info.signed-in .user-name {
  color: var(--fg);
}

.user-info.signed-in .user-avatar {
  color: var(--fg);
  background: rgba(255, 255, 255, 0.14);
}

#logoutIcon {
  display: none;
  font-size: clamp(14px, 1.6vw, 16px);
}

#loginBtn.icon-only {
  width: clamp(32px, 3.2vw, 38px);
  height: clamp(32px, 3.2vw, 38px);
  min-width: 0;
  padding: 0;
  border-radius: 50%;
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0;
}

#loginBtn.icon-only:hover {
  background: transparent;
  transform: none;
}

#loginBtn.icon-only #logoutIcon {
  display: inline-block;
}

#loginBtn.icon-only #i18n-login {
  display: none;
}

/* Topbar minimal look for login/logout and language icon */
.topbar .actions #loginBtn:not(.icon-only) {
  background: transparent !important;
  padding: 0;
  box-shadow: none;
  transform: none;
}

.topbar .actions #loginBtn:not(.icon-only):hover {
  background: transparent !important;
  transform: none;
}

.topbar .actions #loginBtn.btn.primary {
  background: transparent !important;
  color: var(--fg);
}

body.modal-open {
  overflow: hidden;
}

/* Language select shows globe icon only; keep select for accessibility */
.lang-trigger {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: clamp(32px, 3.2vw, 38px);
  height: clamp(32px, 3.2vw, 38px);
  background: var(--glass-bg);
  border-radius: var(--glass-radius);
  backdrop-filter: blur(14px) saturate(1.35);
  box-shadow: var(--shadow-sm);
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

.lang-trigger i {
  font-size: clamp(14px, 1.6vw, 16px);
  color: var(--fg);
  pointer-events: none;
}

.lang-trigger select {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  appearance: none;
  cursor: pointer;
}

.lang-trigger select:focus {
  outline: none;
}

.lang-trigger:hover {
  background: rgba(17, 25, 40, 0.6);
  box-shadow: var(--shadow-md);
}

.lang-trigger select:focus+i,
.lang-trigger:hover i {
  color: var(--brand);
}

#userAvatar {
  display: inline-block;
  object-fit: cover;
  cursor: pointer;
  border: none;
}

#userAvatar:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 0 4px rgba(92, 200, 255, 0.18);
}

select {
  appearance: none;
  background: rgba(255, 255, 255, 0.04);
  color: var(--fg);
  border: none;
  border-radius: 999px;
  padding: 0.5em 1.75em 0.5em 1em;
  font-size: var(--font-small);
  line-height: 1.4;
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

select:focus {
  outline: none;
  background: rgba(92, 200, 255, 0.14);
  box-shadow: 0 0 0 6px rgba(92, 200, 255, 0.14);
}

.btn {
  border: none;
  border-radius: 999px;
  padding: 0.6em 1.4em;
  font-size: clamp(12px, 1.15vw, 13px);
  font-weight: 600;
  color: var(--fg);
  background: rgba(255, 255, 255, 0.08);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: max-content;
  white-space: nowrap;
  cursor: pointer;
  transition:
    transform 0.18s ease,
    background 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.16);
}

.btn.primary {
  background: linear-gradient(135deg, var(--brand), var(--accent));
  color: #071625;
}

.btn.primary:hover {
  background: linear-gradient(135deg, rgba(92, 200, 255, 0.85), rgba(122, 140, 255, 0.85));
}

.btn.small {
  padding: 0.5em 1.3em;
}

.btn.xsmall {
  padding: 0.35em 0.9em;
}

/* Ensure media controls never wrap text inside a button or labels */
.btn span,
.switch-label,
.count {
  white-space: nowrap;
}

/* Auth modal */
.auth-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(16px, 5vh, 72px);
  z-index: 1600;
}

.auth-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(6, 10, 18, 0.65);
  backdrop-filter: blur(12px);
}

.auth-panel {
  position: relative;
  width: min(620px, 94vw);
  padding: clamp(24px, 6vh, 44px);
  display: flex;
  flex-direction: column;
  gap: clamp(16px, 3vh, 28px);
  box-shadow: var(--shadow-lg);
  pointer-events: auto;
  min-height: clamp(460px, 68vh, 620px);
}

.auth-close {
  position: absolute;
  top: clamp(12px, 2vh, 18px);
  inset-inline-end: clamp(12px, 2vh, 18px);
  display: grid;
  place-items: center;
  width: clamp(32px, 3.5vw, 40px);
  height: clamp(32px, 3.5vw, 40px);
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  color: var(--fg);
  font-size: clamp(14px, 1.8vw, 18px);
  cursor: pointer;
}

.auth-close:hover {
  background: rgba(255, 255, 255, 0.12);
}

.auth-head {
  display: flex;
  align-items: center;
  gap: clamp(14px, 2.6vw, 28px);
}

.auth-logo {
  width: clamp(48px, 6.2vw, 68px);
  height: clamp(48px, 6.2vw, 68px);
  border-radius: clamp(12px, 1.5vw, 16px);
  object-fit: contain;
  background: rgba(255, 255, 255, 0.05);
  padding: clamp(6px, 1vw, 10px);
}

.auth-head-text h2 {
  margin: 0;
  font-size: clamp(20px, 3vw, 28px);
  letter-spacing: 0.04em;
}

.auth-head-text p {
  margin: clamp(4px, 0.8vh, 6px) 0 0;
  font-size: clamp(12px, 1.6vw, 15px);
  color: var(--fg-subtle);
  line-height: 1.6;
}

.auth-tabs {
  display: inline-flex;
  padding: clamp(4px, 0.8vh, 6px);
  border-radius: clamp(18px, 3vw, 28px);
  background: rgba(255, 255, 255, 0.06);
  gap: clamp(6px, 1vw, 10px);
  align-self: center;
}

.auth-tabs button {
  border: none;
  border-radius: clamp(14px, 2.4vw, 24px);
  padding: clamp(6px, 1.2vh, 10px) clamp(18px, 4vw, 34px);
  font-size: clamp(13px, 1.8vw, 16px);
  color: var(--fg-subtle);
  background: transparent;
  cursor: pointer;
  transition: all 0.2s ease;
}

.auth-tabs button.active {
  background: linear-gradient(135deg, rgba(92, 200, 255, 0.24), rgba(122, 140, 255, 0.28));
  color: var(--fg);
}

.auth-alert {
  padding: clamp(10px, 1.6vh, 14px) clamp(12px, 2vw, 18px);
  border-radius: clamp(10px, 1.8vw, 14px);
  font-size: clamp(12px, 1.6vw, 14px);
  line-height: 1.5;
}

.auth-alert.error {
  background: rgba(255, 99, 132, 0.12);
  color: #ffb4c1;
}

.auth-alert.success {
  background: rgba(92, 200, 255, 0.12);
  color: #c4ecff;
}

/* Confirm Modal Styles */
.confirm-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(16px, 5vh, 72px);
  z-index: 1700;
}

.confirm-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(6, 10, 18, 0.65);
  backdrop-filter: blur(12px);
}

.confirm-panel {
  position: relative;
  width: min(420px, 90vw);
  padding: clamp(24px, 4vh, 32px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(20px, 3vh, 28px);
  box-shadow: var(--shadow-lg);
  pointer-events: auto;
  text-align: center;
}

.confirm-close {
  position: absolute;
  top: clamp(12px, 2vh, 18px);
  inset-inline-end: clamp(12px, 2vh, 18px);
  display: grid;
  place-items: center;
  width: clamp(32px, 3.5vw, 40px);
  height: clamp(32px, 3.5vw, 40px);
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  color: var(--fg);
  font-size: clamp(14px, 1.8vw, 18px);
  cursor: pointer;
  transition: background 0.2s ease;
}

.confirm-close:hover {
  background: rgba(255, 255, 255, 0.12);
}

.confirm-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(16px, 2.5vh, 24px);
  width: 100%;
}

.confirm-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: clamp(64px, 8vw, 80px);
  height: clamp(64px, 8vw, 80px);
  border-radius: 50%;
  background: rgba(255, 207, 102, 0.15);
  color: #ffcf66;
  font-size: clamp(24px, 3.5vw, 32px);
}

.confirm-title {
  font-size: clamp(18px, 2.5vw, 22px);
  font-weight: 600;
  color: var(--fg);
  margin: 0;
}

.confirm-message {
  font-size: var(--font-body);
  color: var(--fg-muted);
  margin: 0;
  line-height: 1.5;
}

.confirm-actions {
  display: flex;
  gap: clamp(12px, 2vw, 16px);
  justify-content: center;
  width: 100%;
}

.auth-social {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: clamp(10px, 1.8vh, 16px);
}

.auth-social-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: clamp(10px, 1.6vw, 14px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: clamp(14px, 2vw, 20px);
  padding: clamp(10px, 1.8vh, 14px) clamp(16px, 3vw, 24px);
  font-size: clamp(13px, 1.8vw, 16px);
  color: var(--fg);
  background: rgba(255, 255, 255, 0.05);
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease;
}

.auth-social-btn .icon {
  display: grid;
  place-items: center;
  width: clamp(26px, 3.6vw, 32px);
  height: clamp(26px, 3.6vw, 32px);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
}

.auth-social-btn:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.08);
}

.auth-divider {
  position: relative;
  text-align: center;
  color: var(--fg-subtle);
  font-size: clamp(12px, 1.6vw, 14px);
  letter-spacing: 0.08em;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 35%;
  height: 1px;
  background: rgba(255, 255, 255, 0.12);
}

.auth-divider::before {
  inset-inline-start: 0;
}

.auth-divider::after {
  inset-inline-end: 0;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: clamp(6px, 1vh, 10px);
}

.auth-field label {
  font-size: clamp(12px, 1.6vw, 14px);
  color: var(--fg-muted);
}

.auth-field input {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: clamp(12px, 2vw, 16px);
  padding: clamp(10px, 1.8vh, 14px) clamp(14px, 2.6vw, 20px);
  font-size: clamp(13px, 1.8vw, 16px);
  color: var(--fg);
  background: rgba(7, 12, 17, 0.45);
  outline: none;
}

.auth-field input:focus {
  border-color: rgba(92, 200, 255, 0.65);
  box-shadow: 0 0 0 2px rgba(92, 200, 255, 0.18);
}

.auth-password {
  display: flex;
  align-items: center;
  border-radius: clamp(12px, 2vw, 16px);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(7, 12, 17, 0.45);
}

.auth-password input {
  border: none;
  border-radius: 0;
  flex: 1;
}

.auth-password button {
  width: clamp(40px, 5vw, 48px);
  height: 100%;
  border: none;
  background: transparent;
  color: var(--fg-subtle);
  font-size: clamp(16px, 2.4vw, 20px);
  cursor: pointer;
}

.auth-password button:hover {
  color: var(--fg);
}

.auth-aux {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(12px, 2vw, 18px);
  font-size: clamp(12px, 1.6vw, 14px);
  margin-bottom: clamp(16px, 3vh, 32px);
}

.auth-checkbox {
  display: inline-flex;
  align-items: center;
  gap: clamp(8px, 1.6vw, 12px);
  font-size: clamp(12px, 1.6vw, 14px);
  color: var(--fg-muted);
}

.auth-checkbox input {
  width: clamp(16px, 2vw, 18px);
  height: clamp(16px, 2vw, 18px);
  accent-color: var(--accent);
}

.auth-agree {
  align-items: flex-start;
  line-height: 1.6;
}

.auth-inline-link,
.auth-link {
  background: none;
  border: none;
  color: var(--brand);
  font-size: inherit;
  font-family: inherit;
  text-decoration: none;
  cursor: pointer;
  padding: 0;
}

.auth-inline-link:hover,
.auth-link:hover {
  color: var(--fg);
  text-decoration: underline;
}

#authForm {
  display: flex;
  flex-direction: column;
  gap: clamp(16px, 3vh, 28px);
  flex: 1;
}

.auth-submit {
  width: clamp(100px, 32vw, 160px);
  align-self: center;
  justify-content: center;
  font-size: clamp(13px, 1.9vw, 17px);
  padding-block: clamp(12px, 2vh, 16px);
  gap: clamp(8px, 1.4vw, 12px);
  margin-inline: auto;
  margin-top: auto;
}

.auth-switch {
  display: flex;
  justify-content: center;
  gap: clamp(8px, 1.6vw, 12px);
  font-size: clamp(12px, 1.6vw, 14px);
  color: var(--fg-muted);
}

.auth-spinner {
  width: clamp(16px, 2.2vw, 20px);
  height: clamp(16px, 2.2vw, 20px);
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-top-color: rgba(255, 255, 255, 0.8);
  border-radius: 50%;
  animation: auth-spin 0.9s linear infinite;
}

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

@media (max-width: 640px) {
  .auth-panel {
    width: min(520px, 96vw);
    padding: clamp(18px, 6vh, 32px);
  }

  .auth-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .auth-social {
    grid-template-columns: 1fr;
  }

  .auth-divider::before,
  .auth-divider::after {
    width: 27%;
  }

  .topbar {
    flex-wrap: wrap;
    justify-content: center;
    gap: clamp(12px, 3vh, 20px);
  }

  .brand {
    flex-wrap: wrap;
    gap: clamp(8px, 2vw, 12px);
    flex: 1 0 100%;
    justify-content: center;
  }

  .model-inline {
    margin-left: 0;
    margin-top: clamp(4px, 1vh, 8px);
    width: 100%;
    justify-content: center;
  }

  .models {
    justify-content: center;
  }

  .actions {
    gap: clamp(12px, 3vw, 16px);
  }
}

.hero {
  display: flex;
  justify-content: center;
  text-align: center;
  margin-top: clamp(12px, 2vh, 20px);
}

.hero h1 {
  margin: 0 0 5px;
  font-size: var(--font-title);
  font-weight: 700;
  letter-spacing: 0.04em;
}

.hero-sub {
  color: var(--fg-muted);
  font-size: clamp(14px, 1.6vw, 18px);
  font-weight: 500;
  letter-spacing: 0.02em;
  line-height: 1.6;
  max-width: min(60ch, 70%);
}

.controls {
  padding: clamp(0px, 0.4vh, 2px) clamp(4px, 1.2vw, 8px);
  display: flex;
  flex-direction: column;
  gap: clamp(0px, 0.4vh, 2px);
}

.model-picker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: clamp(14px, 2vw, 22px);
}

.model-picker .label {
  color: var(--fg-subtle);
  font-size: var(--font-small);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.models {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: clamp(8px, 1vw, 12px);
  padding: 0;
  border-radius: 0;
  background: transparent;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0.45em 1.1em;
  border-radius: 999px;
  cursor: pointer;
  position: relative;
  color: var(--fg-muted);
  transition: color 0.18s ease, background 0.18s ease;
}

.chip input {
  appearance: none;
  width: 0;
  height: 0;
  position: absolute;
  opacity: 0;
}

.chip span {
  position: relative;
  z-index: 1;
  font-size: var(--font-small);
  font-weight: 500;
}

.chip::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: transparent;
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

.chip:hover::before {
  background: rgba(92, 200, 255, 0.08);
}

.chip input:checked+span {
  color: #071625;
}

.chip input:checked+span::before {
  content: "";
  position: absolute;
  inset: -0.45em -1.1em;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--brand), var(--accent));
  z-index: -1;
  box-shadow: 0 10px 20px rgba(92, 200, 255, 0.32);
}

.chip input:checked~span::before {
  background: linear-gradient(135deg, var(--brand), var(--accent));
}

.chip input:checked~span {
  color: #071625;
}

.warning {
  padding: clamp(14px, 2vh, 18px);
  border-radius: calc(var(--glass-radius) - 6px);
  background: rgba(255, 207, 102, 0.12);
  color: #ffe6ad;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.warning-title {
  font-weight: 600;
  color: var(--warn);
  display: flex;
  align-items: center;
  gap: 6px;
}

.warning-body {
  font-size: var(--font-small);
  line-height: 1.6;
}

.ignore {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: var(--font-small);
  color: rgba(255, 230, 173, 0.75);
}

.hidden {
  display: none !important;
}

.split {
  display: grid;
  gap: var(--card-gap);
  grid-template-columns: minmax(220px, 16vw) minmax(320px, 1fr) minmax(400px, 1.1fr) minmax(180px, 0.45fr);
  align-items: stretch;
}

@media (max-width: 1440px) {
  .split {
    grid-template-columns: minmax(200px, 18vw) minmax(280px, 1fr) minmax(360px, 1fr) minmax(160px, 0.4fr);
  }
}

@media (max-width: 1220px) {
  .split {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .split .camera,
  .split .meta {
    grid-column: span 2;
  }
}

@media (max-width: 900px) {
  .split {
    grid-template-columns: 1fr;
  }

  .split .camera,
  .split .meta {
    grid-column: auto;
  }
}

.pane {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: clamp(16px, 2vh, 22px);
  padding: var(--pane-padding);
  min-height: clamp(520px, 70vh, 760px);
}

.pane.camera {
  min-height: clamp(560px, 85vh, 1120px);
}

.pane.side {
  gap: clamp(16px, 2.2vh, 24px);
}

.pane.side .panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  border-radius: calc(var(--glass-radius) - 4px);
  background: rgba(255, 255, 255, 0.02);
  overflow: hidden;
}

.pane.side .panel+.panel {
  margin-top: clamp(10px, 1.2vh, 14px);
}

.pane.side .tpl-grid {
  flex: 1;
  overflow: auto;
  display: grid;
  gap: var(--grid-gap);
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  padding: clamp(12px, 1.8vh, 18px);
}

.pane.side .table-wrap {
  flex: 1 1 auto;
  overflow: auto;
  max-height: 100%;
}

.quick-actions {
  display: flex;
  flex-wrap: wrap;
  padding: clamp(12px, 1.8vh, 18px);
  gap: clamp(8px, 1.2vw, 12px);
}

.pane-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(12px, 1.6vw, 18px);
}

.pane.assets .pane-title {
  justify-content: flex-end;
}

.pane-title>span {
  font-size: var(--font-h2);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.pane-title .right-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: clamp(8px, 1vw, 12px);
}

.count {
  font-size: var(--font-small);
  color: var(--fg-subtle);
  padding: 0.25em 0.75em;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.switch {
  position: relative;
  display: inline-block;
  width: clamp(40px, 5vw, 48px);
  height: clamp(20px, 2.6vh, 24px);
}

.switch input {
  display: none;
}

.slider {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  transition: background 0.2s ease;
}

.slider::before {
  content: "";
  position: absolute;
  width: clamp(14px, 2.4vh, 18px);
  height: clamp(14px, 2.4vh, 18px);
  border-radius: 50%;
  background: #fff;
  top: 50%;
  left: clamp(3px, 0.5vw, 4px);
  transform: translate(0, -50%);
  transition: transform 0.2s ease;
  box-shadow: 0 6px 10px rgba(8, 16, 27, 0.3);
}

.switch input:checked+.slider {
  background: linear-gradient(135deg, var(--brand), var(--accent));
}

.switch input:checked+.slider::before {
  transform: translate(calc(130% - clamp(0em, 0%, 0%) * 2), -50%);
}

.switch-label {
  font-size: var(--font-small);
  color: var(--fg-muted);
}

.pane.assets {
  position: relative;
  overflow: hidden;
}

.dropzone {
  position: absolute;
  inset: clamp(4px, 0.8vh, 8px);
  border-radius: calc(var(--glass-radius) - 8px);
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--fg-muted);
  pointer-events: none;
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

.dropzone.dragover {
  background: rgba(92, 200, 255, 0.12);
  box-shadow: 0 0 0 8px rgba(92, 200, 255, 0.08);
}


.grid {
  position: relative;
  z-index: 1;
  display: grid;
  gap: var(--grid-gap);
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: minmax(120px, 160px);
  height: clamp(520px, 70vh, 680px);
  overflow: auto;
  margin-top: clamp(12px, 1.6vh, 18px);
}

.loading {
  position: absolute;
  inset: clamp(10px, 1.6vh, 14px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  pointer-events: none;
  background: rgba(7, 12, 17, 0.55);
  border-radius: calc(var(--glass-radius) - 6px);
}

.spinner {
  width: clamp(36px, 5vw, 44px);
  height: clamp(36px, 5vw, 44px);
  border: 3px solid rgba(255, 255, 255, 0.2);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

.card {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.04);
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.card img {
  width: 100%;
  height: clamp(120px, 16vw, 160px);
  object-fit: cover;
  display: block;
}

.card:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 18px 32px rgba(6, 11, 21, 0.45);
}

.card .thumb {
  width: 100%;
  height: clamp(120px, 16vw, 160px);
  object-fit: cover;
  background: rgba(0, 0, 0, 0.4);
}

.card .meta {
  position: absolute;
  inset-inline: clamp(8px, 1.4vw, 12px);
  bottom: clamp(8px, 1.2vh, 12px);
  display: flex;
  align-items: center;
  gap: clamp(6px, 1vw, 8px);
  font-size: var(--font-small);
  color: rgba(255, 255, 255, 0.9);
}

.status-indicator {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-red {
  background: #ff4757;
  box-shadow: 0 0 8px rgba(255, 71, 87, 0.5);
}

.status-yellow {
  background: #ffa502;
  box-shadow: 0 0 8px rgba(255, 165, 2, 0.5);
}

.status-green {
  background: #2ed573;
  box-shadow: 0 0 8px rgba(46, 213, 115, 0.5);
}

/* Placeholder styles */
.card.placeholder {
  opacity: 0.6;
  cursor: default;
}

.card.placeholder .thumb {
  background: rgba(255, 255, 255, 0.002);
  /* 占位图颜色 */
}

.badge {
  background: rgba(7, 12, 17, 0.4);
  padding: 0.25em 0.75em;
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.card.selected {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: clamp(10px, 1.4vw, 14px);
}

.toolbar-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(10px, 1.4vw, 14px);
}

.toolbar .tokens {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: clamp(14px, 1.8vw, 16px);
  color: var(--fg-muted);
  white-space: nowrap;
}

.progress .bar {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}

#progressBar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--brand), var(--accent));
}

.progress .info {
  color: var(--fg-muted);
  font-size: var(--font-small);
  margin-top: 6px;
  min-height: 18px;
}

.form {
  display: flex;
  flex-direction: column;
  gap: clamp(14px, 2vh, 20px);
  margin-top: clamp(12px, 1.6vh, 18px);
}

.form label {
  display: flex;
  flex-direction: column;
  gap: clamp(8px, 1.2vh, 12px);
}

.field-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(8px, 1vw, 12px);
}

.field-head span {
  font-size: var(--font-small);
  font-weight: 600;
  color: var(--fg-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.inline-actions {
  display: flex;
  align-items: center;
  gap: clamp(6px, 0.9vw, 10px);
}

.form input,
.form textarea {
  background: rgba(255, 255, 255, 0.04);
  border: none;
  border-radius: 14px;
  color: var(--fg);
  padding: 0.75em 1em;
  font-size: clamp(15px, 1.8vw, 17px);
  box-shadow: 0 0 0 0 rgba(92, 200, 255, 0);
  transition: box-shadow 0.2s ease, background 0.2s ease;
}

.form input:focus,
.form textarea:focus {
  outline: none;
  background: rgba(92, 200, 255, 0.12);
  box-shadow: 0 0 0 4px rgba(92, 200, 255, 0.15);
}

.kw-chips {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(8px, 1vw, 12px);
  align-content: flex-start;
  align-items: flex-start;
  min-height: clamp(180px, 28vh, 280px);
  max-height: clamp(220px, 36vh, 340px);
  overflow-y: auto;
  padding: clamp(14px, 1.8vw, 22px);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.05);
}

.tagchip {
  display: inline-flex;
  align-items: center;
  gap: clamp(6px, 0.8vw, 10px);
  padding: clamp(10px, 1.5vh, 14px) clamp(16px, 2.2vw, 22px);
  border-radius: 999px;
  background: rgba(122, 140, 255, 0.85);
  color: #071625;
  font-size: clamp(13px, 1.6vw, 15px);
  font-weight: 600;
  box-shadow: 0 10px 24px rgba(20, 24, 60, 0.45);
  flex: 0 0 auto;
  min-height: clamp(34px, 4.4vh, 46px);
  max-width: clamp(160px, 24vw, 240px);
  overflow-wrap: anywhere;
}

.chip-close {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #071625;
  color: rgba(122, 140, 255, 0.85);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.chip-close:hover {
  background: #ff0000;
  color: #fff;
}

.export {
  display: flex;
  align-items: center;
  gap: clamp(10px, 1.2vw, 14px);
  flex-wrap: wrap;
  color: var(--fg-muted);
}

.tokens strong {
  font-size: clamp(16px, 2.2vw, 20px);
  font-weight: 700;
  color: var(--fg);
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: clamp(12px, 1.8vh, 16px) clamp(14px, 2vw, 20px);
  background: transparent;
  flex-shrink: 0;
}

.panel-title {
  font-size: clamp(15px, 2vw, 18px);
  font-weight: 600;
}

.panel-actions {
  display: flex;
  align-items: center;
  gap: clamp(8px, 1vw, 12px);
}

#histDateFilter {
  background: transparent;
  border-radius: 0;
  padding: 0.25em 0.5em;
}

#histDateFilter:focus {
  background: transparent;
  box-shadow: none;
}

.tpl-card {
  border-radius: 14px;
  padding: clamp(12px, 1.6vh, 16px);
  background: rgba(255, 255, 255, 0.04);
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: transform 0.2s ease, background 0.2s ease;
}

.tpl-card:hover {
  transform: translateY(-2px);
  background: rgba(92, 200, 255, 0.12);
}

.tpl-title {
  font-weight: 600;
  font-size: clamp(15px, 1.9vw, 17px);
}

.tpl-desc {
  color: var(--fg-subtle);
  font-size: var(--font-small);
  line-height: 1.6;
}

.table-wrap {
  border-radius: 0 0 calc(var(--glass-radius) - 6px) calc(var(--glass-radius) - 6px);
  overflow: hidden;
  background: rgba(255, 255, 255, 0.02);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: clamp(11px, 1.1vw, 13px);
}

thead tr {
  background: rgba(255, 255, 255, 0.01);
}

th,
td {
  padding: clamp(5px, 0.8vh, 8px) clamp(10px, 1.5vw, 15px);
  text-align: left;
}

tbody tr:hover {
  background: rgba(92, 200, 255, 0.05);
}

tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.03);
}

td .row-actions {
  display: flex;
  gap: clamp(6px, 0.8vw, 10px);
}

/* Camera Info Panel */
.pane.camera {
  display: flex;
  flex-direction: column;
  gap: 0;
  overflow: hidden;
}

.camera-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding-top: clamp(8px, 1.4vh, 14px);
  padding-bottom: clamp(8px, 1.4vh, 14px);
  scrollbar-width: thin;
  scrollbar-color: rgba(92, 200, 255, 0.3) transparent;
  height: 100%;
  box-sizing: border-box;
}

.camera-content::-webkit-scrollbar {
  width: 6px;
}

.camera-content::-webkit-scrollbar-track {
  background: transparent;
}

.camera-content::-webkit-scrollbar-thumb {
  background: rgba(92, 200, 255, 0.3);
  border-radius: 3px;
}

.camera-content::-webkit-scrollbar-thumb:hover {
  background: rgba(92, 200, 255, 0.5);
}

.loading-spinner {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100px;
}

.no-exif-notice {
  padding: clamp(8px, 1.2vh, 12px) clamp(10px, 1.6vw, 16px);
  text-align: center;
  color: var(--warn);
  font-size: clamp(11px, 1.1vw, 12px);
}

.no-exif-notice p {
  margin: 0;
  font-weight: 500;
}


.camera-info-item {
  display: flex;
  flex-direction: column;
  gap: clamp(2px, 0.3vh, 3px);
  padding: clamp(5px, 0.7vh, 7px) clamp(8px, 1.2vw, 10px);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  margin-bottom: clamp(4px, 0.6vh, 6px);
  transition: background 0.2s ease;
}

.camera-info-item:hover {
  background: rgba(255, 255, 255, 0.06);
}

.camera-info-label {
  font-size: var(--font-small);
  font-weight: 600;
  color: var(--fg-subtle);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.camera-info-value {
  font-size: clamp(12px, 1.4vw, 14px);
  font-weight: 500;
  color: var(--fg);
  word-break: break-word;
}

.camera-info-highlight {
  padding: clamp(6px, 0.8vh, 8px) clamp(10px, 1.4vw, 12px);
}

.camera-info-highlight .camera-info-label {
  color: var(--brand);
}

.camera-info-highlight .camera-info-value {
  font-size: clamp(13px, 1.6vw, 15px);
  font-weight: 600;
}

.camera-section-title {
  font-size: clamp(11px, 1.1vw, 12px);
  font-weight: 700;
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin: clamp(8px, 1.2vh, 12px) 0 clamp(6px, 0.8vh, 8px) 0;
  padding-bottom: clamp(4px, 0.5vh, 5px);
}

.camera-section-title:first-child {
  margin-top: 0;
}

.footer {
  margin-top: auto;
  text-align: center;
  color: var(--fg-subtle);
  font-size: var(--font-small);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}