/* ================================================================
   Hermes Dashboard Theme — 移植自 Hermes Agent Web UI
   Deep teal #041c1c + warm beige #ffe6cb + 5-layer background
   ================================================================ */

/* --- CSS Custom Properties --- */
:root {
  /* Core colors */
  --bg-base: #041c1c;
  --text-primary: #ffe6cb;
  --text-secondary: rgba(255, 230, 203, 0.65);
  --text-tertiary: rgba(255, 230, 203, 0.4);

  /* Accent colors */
  --color-primary: #ffbd38;
  --color-primary-foreground: #041c1c;
  --color-success: #4ade80;
  --color-destructive: #fb2c36;
  --color-warning: #ffbd38;
  --color-info: #60a5fa;

  /* Surface */
  --card-bg: #041c1c;
  --card-border: rgba(255, 230, 203, 0.15);
  --card-hover-border: rgba(255, 230, 203, 0.15);

  /* Border */
  --border-subtle: rgba(255, 230, 203, 0.06);
  --border-default: rgba(255, 230, 203, 0.10);
  --border-strong: rgba(255, 230, 203, 0.15);

  /* Buttons */
  --btn-primary-bg: rgba(255, 230, 203, 0.08);
  --btn-primary-color: #ffe6cb;
  --btn-primary-hover-bg: rgba(255, 230, 203, 0.14);
  --btn-primary-radius: 10px;

  --btn-secondary-bg: transparent;
  --btn-secondary-color: rgba(255, 230, 203, 0.5);
  --btn-secondary-hover-bg: rgba(255, 230, 203, 0.06);
  --btn-secondary-radius: 8px;

  --btn-danger-bg: rgba(251, 44, 54, 0.12);
  --btn-danger-color: #fb2c36;
  --btn-danger-hover-bg: rgba(251, 44, 54, 0.2);
  --btn-danger-radius: 8px;

  --btn-ghost-bg: transparent;
  --btn-ghost-color: rgba(255, 230, 203, 0.5);
  --btn-ghost-hover-bg: rgba(255, 230, 203, 0.06);
  --btn-ghost-radius: 8px;

  /* Inputs */
  --input-bg: rgba(4, 28, 28, 0.6);
  --input-border: rgba(255, 230, 203, 0.12);
  --input-focus-border: rgba(255, 189, 56, 0.5);
  --input-color: #ffe6cb;
  --input-placeholder: rgba(255, 230, 203, 0.3);
  --input-radius: 8px;

  /* Sidebar */
  --sidebar-width: 240px;
  --sidebar-bg: #041c1c;
  --sidebar-border: rgba(255, 230, 203, 0.20);

  /* Header */
  --header-height: 0px; /* no header, sidebar goes full height */

  /* Scrollbar */
  --scrollbar-thumb: rgba(255, 230, 203, 0.12);
  --scrollbar-thumb-hover: rgba(255, 230, 203, 0.2);
  --scrollbar-track: transparent;

  /* Typography */
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', 'Noto Sans SC', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', 'Consolas', monospace;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
  /* Radii */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;

  /* Z-index layers */
  --z-background: 1;
  --z-filler: 2;
  --z-glow: 99;
  --z-main: 100;
  --z-sidebar: 150;
  --z-foreground: 200;
  --z-noise: 201;
  --z-modal: 600;
  --z-toast: 700;
}

/* --- Reset & Base --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  color: var(--text-primary);
  background: #000;
  line-height: 1.6;
  min-height: 100dvh;
  overflow: hidden;
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color 0.15s ease;
}
a:hover {
  color: #ffe6cb;
}

img {
  max-width: 100%;
  height: auto;
}

svg {
  fill: currentColor;
}

::selection {
  background: rgba(255, 189, 56, 0.3);
  color: #ffe6cb;
}


/* --- 5-Layer Background System --- */
.bg-base {
  position: fixed;
  inset: 0;
  z-index: var(--z-background);
  pointer-events: none;
  background-color: var(--bg-base);
  mix-blend-mode: difference;
}
.bg-filler {
  position: fixed;
  inset: 0;
  z-index: var(--z-filler);
  pointer-events: none;
  mix-blend-mode: difference;
  opacity: 0.033;
}
.bg-filler .filler-img {
  height: 150dvh;
  width: auto;
  min-width: 100dvw;
  object-fit: cover;
  object-position: top left;
  filter: invert(1);
}
.bg-glow {
  position: fixed;
  inset: 0;
  z-index: var(--z-glow);
  pointer-events: none;
  background: radial-gradient(ellipse at 0% 0%, transparent 60%, rgba(255, 189, 56, 0.6) 100%);
  mix-blend-mode: lighten;
  opacity: 0.22;
}
.bg-diff {
  position: fixed;
  inset: 0;
  z-index: var(--z-foreground);
  pointer-events: none;
  background: transparent;
  mix-blend-mode: difference;
}
.bg-noise {
  position: fixed;
  inset: 0;
  z-index: 201;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' fill='%23eaeaea' filter='url(%23n)' opacity='0.6'/%3E%3C/svg%3E");
  background-size: 512px 512px;
  mix-blend-mode: color-dodge;
  opacity: 0.55;
}

/* --- Page Layout (sidebar + main) --- */
.app-shell {
  position: relative;
  z-index: var(--z-main);
  display: flex;
  height: 100dvh;
  overflow: hidden;
}

/* --- Sidebar --- */
.app-sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  backdrop-filter: blur(8px);
}

.sidebar-header {
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-logo {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
  color: var(--color-primary);
}

.sidebar-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
}

.nav-section-label {
  padding: 12px 20px 6px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-tertiary);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 20px;
  color: var(--text-secondary);
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.15s ease;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-family: inherit;
  border-radius: 0;
  position: relative;
}

.nav-item:hover {
  color: var(--text-primary);
  background: rgba(255, 230, 203, 0.04);
}

.nav-item.active {
  color: var(--text-primary);
  background: rgba(255, 230, 203, 0.08);
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 4px;
  bottom: 4px;
  width: 2px;
  background: var(--color-primary);
  border-radius: 0 2px 2px 0;
}

.nav-item .nav-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.7;
}

.nav-item:hover .nav-icon,
.nav-item.active .nav-icon {
  opacity: 1;
}

/* --- Main Content Area --- */
.app-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

.app-main-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 32px;
  border-bottom: 1px solid var(--border-subtle);
  min-height: 56px;
  flex-shrink: 0;
}

.main-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.main-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.app-main-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px 32px 40px;
}

/* Page title */
.page-title {
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.page-description {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 2px;
}


/* --- Cards --- */
.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 20px;
  backdrop-filter: blur(4px);
  transition: border-color 0.2s ease;
}
.card:hover {
  border-color: var(--card-hover-border);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-subtle);
}

.card-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.card-body {
  font-size: 0.9rem;
  color: var(--text-primary);
  line-height: 1.7;
}

.card + .card {
  margin-top: 16px;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}


/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 18px;
  font-size: 0.85rem;
  font-family: inherit;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
  line-height: 1.4;
  white-space: nowrap;
  user-select: none;
}
.btn:active {
  transform: scale(0.97);
}
.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  background: var(--btn-primary-bg);
  color: var(--btn-primary-color);
  border-radius: var(--btn-primary-radius);
}
.btn-primary:hover:not(:disabled) {
  background: var(--btn-primary-hover-bg);
}

.btn-secondary {
  background: var(--btn-secondary-bg);
  color: var(--btn-secondary-color);
  border-radius: var(--btn-secondary-radius);
  border: 1px solid var(--border-default);
}
.btn-secondary:hover:not(:disabled) {
  background: var(--btn-secondary-hover-bg);
  color: var(--text-primary);
}

.btn-danger {
  background: var(--btn-danger-bg);
  color: var(--btn-danger-color);
  border-radius: var(--btn-danger-radius);
}
.btn-danger:hover:not(:disabled) {
  background: var(--btn-danger-hover-bg);
}

.btn-ghost {
  background: var(--btn-ghost-bg);
  color: var(--btn-ghost-color);
  border-radius: var(--btn-ghost-radius);
}
.btn-ghost:hover:not(:disabled) {
  background: var(--btn-ghost-hover-bg);
  color: var(--text-primary);
}

.btn-sm {
  padding: 5px 12px;
  font-size: 0.8rem;
  border-radius: 6px;
}

.btn-lg {
  padding: 10px 24px;
  font-size: 0.95rem;
}

.btn-icon {
  padding: 6px;
  width: 32px;
  height: 32px;
  border-radius: 8px;
}


/* --- Forms --- */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-text {
  font-size: 0.78rem;
  color: var(--text-tertiary);
  margin-top: 4px;
}

.form-text-error {
  font-size: 0.78rem;
  color: var(--color-destructive);
  margin-top: 4px;
}

/* Autofill override */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
  -webkit-text-fill-color: var(--input-color) !important;
  -webkit-box-shadow: 0 0 0 1000px var(--input-bg) inset !important;
  transition: background-color 50000s ease-in-out 0s;
}

.form-control {
  -webkit-text-fill-color: var(--input-color);
  box-shadow: inset 0 0 0 1000px var(--input-bg);
  caret-color: var(--input-color);
  width: 100%;
  padding: 9px 14px;
  font-size: 0.88rem;
  font-family: inherit;
  color: var(--input-color);
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: var(--input-radius);
  outline: none;
  transition: all 0.15s ease;
}

.form-control::placeholder {
  color: var(--input-placeholder);
}

.form-control:focus {
  border-color: var(--input-focus-border);
  box-shadow: 0 0 0 3px rgba(255, 189, 56, 0.1);
}

.form-control:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

textarea/* Autofill override */

.form-control {
  resize: vertical;
  min-height: 80px;
  line-height: 1.6;
}

select/* Autofill override */
  -webkit-text-fill-color: var(--input-color) !important;
  -webkit-box-shadow: 0 0 0 1000px var(--input-bg) inset !important;
  transition: background-color 50000s ease-in-out 0s;
}

.form-control {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='rgba(255,230,203,0.5)' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

select.form-control::-ms-expand {
  display: none;
}

/* Checkbox & Radio */
.form-check {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.form-check input[type="checkbox"],
.form-check input[type="radio"] {
  appearance: none;
  width: 16px;
  height: 16px;
  border: 1.5px solid var(--border-default);
  background: var(--input-bg);
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.12s ease;
  position: relative;
}

.form-check input[type="checkbox"] {
  border-radius: 4px;
}
.form-check input[type="radio"] {
  border-radius: 50%;
}

.form-check input:checked {
  border-color: var(--color-primary);
  background: var(--color-primary);
}

.form-check input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  left: 4px;
  top: 1px;
  width: 5px;
  height: 9px;
  border: solid var(--color-primary-foreground);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.form-check input[type="radio"]:checked::after {
  content: '';
  position: absolute;
  inset: 3px;
  background: var(--color-primary-foreground);
  border-radius: 50%;
}

.form-inline {
  display: flex;
  align-items: center;
  gap: 12px;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border-subtle);
}


/* --- Tables --- */
.table-container {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

thead th {
  background: rgba(4, 28, 28, 0.5);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 10px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
}

tbody td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-primary);
  vertical-align: middle;
}

tbody tr:last-child td {
  border-bottom: none;
}

tbody tr:hover {
  background: rgba(255, 230, 203, 0.02);
}


/* --- Badges / Tags --- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: 20px;
  line-height: 1.5;
}

.badge-primary {
  background: rgba(255, 189, 56, 0.12);
  color: var(--color-primary);
}
.badge-success {
  background: rgba(74, 222, 128, 0.12);
  color: var(--color-success);
}
.badge-danger {
  background: rgba(251, 44, 54, 0.12);
  color: var(--color-destructive);
}
.badge-warning {
  background: rgba(255, 189, 56, 0.12);
  color: var(--color-warning);
}
.badge-info {
  background: rgba(96, 165, 250, 0.12);
  color: var(--color-info);
}
.badge-neutral {
  background: rgba(255, 230, 203, 0.06);
  color: var(--text-secondary);
}




/* --- Toast / Flash Messages --- */
.toast-container {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-md);
  font-size: 0.88rem;
  color: var(--text-primary);
  pointer-events: auto;
  animation: toast-in 0.25s ease forwards;
  max-width: 380px;
}

.toast-success {
  border-left: 3px solid var(--color-success);
}
.toast-error {
  border-left: 3px solid var(--color-destructive);
}
.toast-warning {
  border-left: 3px solid var(--color-warning);
}
.toast-info {
  border-left: 3px solid var(--color-info);
}

@keyframes toast-in {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes toast-out {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(20px); }
}


/* --- Progress Bar --- */
.progress-bar {
  width: 100%;
  height: 4px;
  background: rgba(255, 230, 203, 0.06);
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: var(--color-primary);
  border-radius: 4px;
  transition: width 0.3s ease;
}


/* --- Tabs --- */
.tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 20px;
}

.tab {
  padding: 10px 20px;
  font-size: 0.88rem;
  color: var(--text-secondary);
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
  border-bottom: 2px solid transparent;
  transition: all 0.15s ease;
  margin-bottom: -1px;
}
.tab:hover {
  color: var(--text-primary);
}
.tab.active {
  color: var(--text-primary);
  border-bottom-color: var(--color-primary);
}


/* --- Loading Spinner --- */
.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid var(--border-subtle);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

.spinner-sm { width: 14px; height: 14px; border-width: 1.5px; }
.spinner-lg { width: 32px; height: 32px; border-width: 3px; }

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


/* --- Empty State --- */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  text-align: center;
}

.empty-state-icon {
  width: 48px;
  height: 48px;
  margin-bottom: 16px;
  opacity: 0.3;
}

.empty-state-title {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.empty-state-desc {
  font-size: 0.85rem;
  color: var(--text-tertiary);
}


/* --- Scrollbar Styling --- */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--scrollbar-track);
}
::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--scrollbar-thumb-hover);
}

/* Firefox scrollbar */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}


/* --- Utility Classes --- */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.justify-end { justify-content: flex-end; }
.gap-xs { gap: 4px; }
.gap-sm { gap: 8px; }
.gap-md { gap: 12px; }
.gap-lg { gap: 16px; }
.gap-xl { gap: 24px; }
.flex-1 { flex: 1; }
.shrink-0 { flex-shrink: 0; }

.text-center { text-align: center; }
.text-right { text-align: right; }
.text-sm { font-size: 0.8rem; }
.text-xs { font-size: 0.75rem; }
.text-secondary { color: var(--text-secondary); }
.text-tertiary { color: var(--text-tertiary); }
.text-primary-color { color: var(--color-primary); }
.text-success { color: var(--color-success); }
.text-danger { color: var(--color-destructive); }

.font-mono { font-family: var(--font-mono); }
.font-bold { font-weight: 600; }

.mt-xs { margin-top: 4px; }
.mt-sm { margin-top: 8px; }
.mt-md { margin-top: 12px; }
.mt-lg { margin-top: 16px; }
.mt-xl { margin-top: 24px; }
.mb-xs { margin-bottom: 4px; }
.mb-sm { margin-bottom: 8px; }
.mb-md { margin-bottom: 12px; }
.mb-lg { margin-bottom: 16px; }
.mb-xl { margin-bottom: 24px; }

.p-sm { padding: 8px; }
.p-md { padding: 16px; }
.p-lg { padding: 24px; }

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hidden { display: none !important; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

.w-full { width: 100%; }
.h-full { height: 100%; }
.max-w-sm { max-width: 500px; }

/* Stat grid for dashboard overview */
.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  text-align: center;
}
.stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--color-primary);
  line-height: 1.2;
}
.stat-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* Section label for demo/preview pages */
.section-label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

/* Info table helper */
.info-table td:first-child {
  padding: 6px 0;
  color: var(--text-secondary);
  width: 100px;
  vertical-align: top;
}
.info-table td:last-child {
  padding: 6px 0;
}

/* Sidebar footer */
.sidebar-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.75rem;
  color: var(--text-tertiary);
  text-align: center;
}

/* Transition helper */
.fade-enter {
  opacity: 0;
}
.fade-enter-active {
  opacity: 1;
  transition: opacity 0.15s ease;
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .app-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 400;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
  }
  .app-sidebar.open {
    transform: translateX(0);
  }

  .sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 399;
    background: rgba(0, 0, 0, 0.5);
  }
  .sidebar-overlay.open {
    display: block;
  }

  .app-main-header {
    padding: 12px 16px;
  }

  .app-main-body {
    padding: 16px;
  }

  .card-grid {
    grid-template-columns: 1fr;
  }

/* --- File Uploader --- */
.drop-zone {
  border: 2px dashed var(--border-default);
  border-radius: var(--radius-md);
  padding: 32px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s;
}
.drop-zone:hover,
.drop-zone.drag-over {
  border-color: var(--color-primary);
}

.queue-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-subtle);
}
.queue-item--uploading {
  flex-direction: column;
  gap: 4px;
}
.queue-item .queue-progress {
  width: 100%;
}

.file-card {
  padding: 12px;
  text-align: center;
}
.file-thumb {
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
  background: rgba(255, 230, 203, 0.03);
  border-radius: 6px;
  overflow: hidden;
}
.file-thumb img {
  max-width: 100%;
  max-height: 120px;
  object-fit: contain;
}
.file-delete-btn {
  margin-top: 6px;
  color: var(--color-destructive);
}

.queue-icon-valid { color: var(--text-secondary); }
.queue-icon-done   { color: var(--color-success); }
.queue-icon-error  { color: var(--color-destructive); }
.queue-icon-valid,
.queue-icon-done,
.queue-icon-error { width: 16px; display: inline-block; }

.queue-errmsg      { color: var(--color-destructive); font-size: 0.8rem; margin-left: 8px; }

.queue-size        { width: 80px; text-align: right; }
.queue-remove-btn  { padding: 2px 6px; font-size: 12px; color: var(--color-destructive); }

.file-type-icon    { font-size: 32px; }

/* ── Auth 注册表单增强 ── */
.pw-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.pw-wrap .form-control {
  padding-right: 40px;
}
.pw-toggle {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  color: var(--text-secondary);
  opacity: 0.6;
  transition: opacity 0.15s;
  line-height: 1;
}
.pw-toggle:hover { opacity: 1; }
.pw-toggle svg { display: block; }

.req-list {
  list-style: none;
  margin: 8px 0 4px;
  padding: 0;
}
.req-item {
  font-size: 0.78rem;
  color: var(--text-secondary);
  padding: 3px 0 3px 16px;
  position: relative;
  transition: all 0.35s ease;
  max-height: 24px;
  overflow: hidden;
  opacity: 1;
}
.req-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 7px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-primary);
  opacity: 0.4;
  transition: all 0.35s ease;
}
.req-met {
  opacity: 0;
  max-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  margin: 0;
}
.req-met::before {
  background: var(--color-success);
  opacity: 1;
}

.pw-strength {
  height: 4px;
  background: var(--border-subtle);
  border-radius: 2px;
  margin: 6px 0 4px;
  overflow: hidden;
}
.strength-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.25s ease, background 0.25s ease;
  width: 0%;
}
.str-weak        { background: var(--color-destructive); }
.str-fair        { background: #e67e22; }
.str-good        { background: #f1c40f; }
.str-strong      { background: var(--color-success); }
.str-very-strong { background: #27ae60; }

#pw-strength-label {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-left: 4px;
}

.pw-hint {
  font-size: 0.78rem;
  margin-top: 2px;
  transition: color 0.2s;
}
.hint-ok  { color: var(--color-success); }
.hint-err { color: var(--color-destructive); }

.field-check {
  display: block;
  font-size: 0.78rem;
  margin-top: 2px;
  min-height: 1.2em;
}
.check-ok  { color: var(--color-success); }
.check-err { color: var(--color-destructive); }
/* 不再需要 */
.card.max-w-sm .card-body {
  font-size: 0.95rem;
}
.card.max-w-sm .form-control {
  font-size: 0.95rem;
  padding: 11px 14px;
}
.card.max-w-sm .form-label {
  font-size: 0.9rem;
}

/* 轮播管理 */
.carousel-table-img {
  width: 120px;
  height: 60px;
  object-fit: cover;
  border-radius: 4px;
}
.carousel-preview-wrap {
  margin-bottom: 8px;
}
.carousel-preview-img {
  width: 100%;
  max-height: 200px;
  object-fit: cover;
  border-radius: 4px;
}
.card-narrow {
  max-width: 600px;
}
