:root {
  color-scheme: dark;
  --page: #111111;
  --glass: rgba(44, 44, 44, 0.76);
  --glass-strong: rgba(44, 44, 44, 0.92);
  --glass-soft: rgba(255, 255, 255, 0.07);
  --border: rgba(255, 255, 255, 0.14);
  --text: #ffffff;
  --muted: #888888;
  --black: #000000;
  --success: #6ee7a8;
  --danger: #ff8d8d;
  --radius: 24px;
  --radius-small: 16px;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-height: 100%; background: var(--page); }
body { min-height: 100vh; margin: 0; color: var(--text); background: var(--page); letter-spacing: 0; }
button, input { font: inherit; letter-spacing: 0; }
button { color: inherit; }

.backdrop {
  position: fixed;
  inset: 0;
  z-index: -2;
  background-color: #151515;
}

.glass {
  background: var(--glass);
  border: 1px solid var(--border);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
}

.unlock-screen { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.unlock-panel { width: min(440px, 100%); padding: 34px; border-radius: var(--radius); }
.avatar { width: 64px; height: 64px; object-fit: cover; border-radius: 20px; border: 1px solid rgba(255, 255, 255, 0.28); }
.unlock-copy { margin: 22px 0 30px; }
.eyebrow { margin: 0 0 8px; color: var(--muted); font-size: 12px; font-weight: 750; letter-spacing: 0 !important; }
h1, h2, p { margin-top: 0; }
.unlock-copy h1 { margin-bottom: 8px; font-size: 30px; line-height: 1.2; }
.unlock-copy p:last-child { margin: 0; color: var(--muted); }
.field-label { display: block; margin-bottom: 9px; font-size: 14px; font-weight: 650; }
.password-field { position: relative; }
.password-field input {
  width: 100%; height: 50px; padding: 0 52px 0 15px; color: var(--text);
  background: rgba(255, 255, 255, 0.08); border: 1px solid var(--border); border-radius: var(--radius-small); outline: none;
}
.password-field input:focus { border-color: rgba(255, 255, 255, 0.5); box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.08); }
.password-field input::placeholder { color: var(--muted); }
.icon-button {
  display: grid; place-items: center; width: 42px; height: 42px; padding: 0;
  background: transparent; border: 0; border-radius: 14px; cursor: pointer;
}
.password-field .icon-button { position: absolute; right: 4px; top: 4px; color: var(--muted); }
.icon-button:hover { color: var(--text); background: var(--glass-soft); }
.form-error { min-height: 20px; margin: 9px 0; color: var(--danger); font-size: 13px; }
.primary-button, .secondary-button, .text-button {
  border: 0; cursor: pointer; transition: transform 150ms ease, background-color 150ms ease, opacity 150ms ease;
}
.primary-button {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  min-height: 48px; padding: 0 20px; color: #fff; background: #000; border-radius: var(--radius-small); font-weight: 750;
}
.unlock-panel > .primary-button { width: 100%; }
.primary-button:hover:not(:disabled) { background: #171717; transform: translateY(-1px); }
.primary-button:disabled { opacity: 0.38; cursor: not-allowed; }
.secondary-button { min-height: 42px; padding: 0 16px; color: var(--text); background: var(--glass-soft); border: 1px solid var(--border); border-radius: 14px; }
.secondary-button:hover { background: rgba(255, 255, 255, 0.12); }
.text-button { padding: 8px 0; color: var(--muted); background: transparent; }
.text-button:hover { color: var(--text); }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 22px; padding: 22px; }
.sidebar { position: sticky; top: 22px; height: calc(100vh - 44px); padding: 24px; border-radius: var(--radius); display: flex; flex-direction: column; }
.brand-row { display: flex; align-items: center; gap: 13px; }
.brand-avatar { width: 46px; height: 46px; border-radius: 16px; object-fit: cover; }
.brand-row div { min-width: 0; display: grid; gap: 4px; }
.brand-row strong { font-size: 16px; }
.brand-row span, .side-note { color: var(--muted); font-size: 13px; }
.side-stat { display: flex; align-items: end; justify-content: space-between; margin-top: 42px; padding: 20px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.side-stat span { color: var(--muted); font-size: 13px; }
.side-stat strong { font-size: 34px; line-height: 1; }
.side-note { margin: 20px 0 0; line-height: 1.7; }
.logout-button { margin-top: auto; width: 100%; }

.main-content { width: min(1040px, 100%); margin: 0 auto; padding: 38px 20px 70px; }
.page-header { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.page-header h1 { max-width: 680px; margin: 0; font-size: 40px; line-height: 1.12; }
.status-pill { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 8px; padding: 9px 12px; color: #d4f8e4; background: rgba(110, 231, 168, 0.09); border: 1px solid rgba(110, 231, 168, 0.2); border-radius: 999px; font-size: 13px; }
.status-pill i { width: 7px; height: 7px; border-radius: 50%; background: var(--success); box-shadow: 0 0 12px rgba(110, 231, 168, 0.8); }

.upload-tool { padding: 20px; border-radius: var(--radius); }
.drop-zone {
  width: 100%; min-height: 260px; display: grid; place-items: center; align-content: center; gap: 9px;
  color: var(--text); background: rgba(255, 255, 255, 0.035); border: 1px dashed rgba(255, 255, 255, 0.25); border-radius: 20px; cursor: pointer;
}
.drop-zone:hover, .drop-zone.is-dragging { background: rgba(255, 255, 255, 0.08); border-color: rgba(255, 255, 255, 0.5); }
.drop-zone span:last-child { color: var(--muted); font-size: 13px; }
.upload-symbol { display: grid; place-items: center; width: 54px; height: 54px; margin-bottom: 8px; color: #000; background: #fff; border-radius: 18px; font-size: 28px; }
.selection { min-height: 116px; display: grid; grid-template-columns: 86px minmax(0, 1fr) 42px; align-items: center; gap: 16px; padding: 15px; background: var(--glass-soft); border: 1px solid var(--border); border-radius: 20px; }
.selection img { width: 86px; height: 86px; object-fit: cover; border-radius: 16px; background: #202020; }
.selection-copy { min-width: 0; display: grid; gap: 6px; }
.selection-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.selection-copy span { color: var(--muted); font-size: 13px; }
.remove-button { font-size: 22px; }
.upload-button { width: 100%; margin-top: 14px; }
.progress-track { height: 4px; margin-top: 14px; overflow: hidden; background: rgba(255, 255, 255, 0.08); border-radius: 999px; }
.progress-track span { display: block; width: 38%; height: 100%; background: #fff; border-radius: inherit; animation: loading 900ms ease-in-out infinite alternate; }
@keyframes loading { from { transform: translateX(-100%); } to { transform: translateX(265%); } }

.result-band { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 18px; padding: 18px 20px; border-radius: var(--radius); }
.result-band > div:first-child { min-width: 0; display: grid; gap: 7px; }
.result-label { color: var(--muted); font-size: 12px; }
.result-band a { overflow: hidden; color: var(--text); text-overflow: ellipsis; white-space: nowrap; text-decoration: none; }
.result-actions { flex: 0 0 auto; display: flex; gap: 9px; }
.compact { min-height: 42px; }

.recent-section { margin-top: 38px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.section-heading h2 { margin: 0; font-size: 20px; }
.recent-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.recent-item { position: relative; min-width: 0; overflow: hidden; background: var(--glass); border: 1px solid var(--border); border-radius: 20px; }
.recent-item img { width: 100%; aspect-ratio: 4 / 3; display: block; object-fit: cover; background: #1d1d1d; }
.recent-item footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px; }
.recent-meta { min-width: 0; display: grid; gap: 4px; }
.recent-meta strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.recent-meta span { color: var(--muted); font-size: 11px; }
.recent-copy { flex: 0 0 auto; width: 36px; height: 36px; }
.empty-state { margin: 0; padding: 36px 0; color: var(--muted); text-align: center; }
.toast { position: fixed; left: 50%; bottom: 24px; z-index: 20; transform: translate(-50%, 18px); padding: 12px 16px; color: #fff; background: #000; border: 1px solid var(--border); border-radius: 14px; opacity: 0; pointer-events: none; transition: opacity 180ms ease, transform 180ms ease; }
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; padding: 14px; }
  .sidebar { position: static; height: auto; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 16px; padding: 18px; }
  .side-stat, .side-note { display: none; }
  .logout-button { margin: 0; width: auto; }
  .main-content { padding: 24px 4px 56px; }
}

@media (max-width: 640px) {
  .unlock-screen { padding: 14px; }
  .unlock-panel { padding: 26px 20px; border-radius: 22px; }
  .unlock-copy h1 { font-size: 26px; }
  .app-shell { gap: 8px; padding: 8px; }
  .sidebar { border-radius: 20px; }
  .brand-row span { display: none; }
  .page-header { align-items: start; }
  .page-header h1 { font-size: 32px; }
  .status-pill { display: none; }
  .upload-tool { padding: 12px; border-radius: 20px; }
  .drop-zone { min-height: 220px; }
  .result-band { align-items: stretch; flex-direction: column; border-radius: 20px; }
  .result-actions > button { flex: 1; }
  .recent-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .recent-item { border-radius: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
