/* ============================================================
   液态画廊 · Liquid Glass Design System
   iOS 26 style: layered translucency + specular highlights
   ============================================================ */

:root {
  --glass-bg: rgba(255, 255, 255, 0.10);
  --glass-bg-strong: rgba(255, 255, 255, 0.16);
  --glass-border: rgba(255, 255, 255, 0.28);
  --glass-blur: 28px;
  --glass-sat: 180%;
  --text: #f5f6fb;
  --text-dim: rgba(245, 246, 251, 0.62);
  --text-faint: rgba(245, 246, 251, 0.40);
  --radius-xl: 34px;
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --accent: #7cc4ff;
  --accent-2: #b18cff;
  --accent-3: #ff9ad5;
  --ok: #6fe3a8;
  --warn: #ffcf6b;
  --danger: #ff8a8a;
  --shadow-glass:
    0 8px 32px rgba(0, 0, 0, 0.28),
    0 2px 8px rgba(0, 0, 0, 0.18);
  --shadow-lift:
    0 24px 64px rgba(0, 0, 0, 0.42),
    0 8px 20px rgba(0, 0, 0, 0.28);
  /* inner top specular + bottom bounce = the "liquid" feel */
  --inner-spec:
    inset 0 1px 0 rgba(255, 255, 255, 0.55),
    inset 0 -1px 0 rgba(255, 255, 255, 0.10),
    inset 0 0 24px rgba(255, 255, 255, 0.05);
}

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

html, body { height: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI",
    "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  color: var(--text);
  background: #05060c;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* ---------- ambient animated background ---------- */
.bg-layer {
  position: fixed;
  inset: -20%;
  z-index: -3;
  background:
    radial-gradient(48% 42% at 22% 18%, #4a6cff 0%, transparent 60%),
    radial-gradient(46% 40% at 78% 24%, #b14bff 0%, transparent 62%),
    radial-gradient(52% 46% at 62% 82%, #ff5f9e 0%, transparent 60%),
    radial-gradient(44% 40% at 14% 78%, #29d3c2 0%, transparent 60%),
    linear-gradient(160deg, #0a0c1a 0%, #05060c 55%, #070410 100%);
  filter: saturate(120%);
  animation: drift 34s ease-in-out infinite alternate;
  will-change: transform;
}
.bg-layer.b2 {
  z-index: -2;
  opacity: 0.5;
  mix-blend-mode: screen;
  filter: blur(60px) saturate(140%);
  animation: drift2 46s ease-in-out infinite alternate;
}
.bg-grain {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.38;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}
@keyframes drift {
  0%   { transform: translate3d(-3%, -2%, 0) scale(1.05) rotate(0deg); }
  50%  { transform: translate3d(3%, 2%, 0) scale(1.12) rotate(4deg); }
  100% { transform: translate3d(-2%, 3%, 0) scale(1.06) rotate(-3deg); }
}
@keyframes drift2 {
  0%   { transform: translate3d(4%, 3%, 0) scale(1.1); }
  100% { transform: translate3d(-4%, -3%, 0) scale(1.2); }
}

/* ---------- glass primitives ---------- */
.glass {
  background: linear-gradient(150deg,
    rgba(255,255,255,0.16) 0%,
    rgba(255,255,255,0.06) 42%,
    rgba(255,255,255,0.10) 100%);
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat));
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat));
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-glass), var(--inner-spec);
  border-radius: var(--radius-lg);
  position: relative;
}
/* moving specular sheen */
.glass::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(115deg,
    transparent 30%,
    rgba(255,255,255,0.16) 45%,
    rgba(255,255,255,0.04) 52%,
    transparent 68%);
  background-size: 260% 260%;
  background-position: 120% 0;
  transition: background-position 0.9s cubic-bezier(.22,.61,.36,1);
  opacity: 0.9;
}
.glass:hover::after { background-position: -30% 0; }

.glass-strong { background: linear-gradient(150deg, rgba(255,255,255,0.22), rgba(255,255,255,0.08)); }

/* ---------- buttons ---------- */
.btn {
  appearance: none;
  border: 1px solid var(--glass-border);
  background: linear-gradient(150deg, rgba(255,255,255,0.20), rgba(255,255,255,0.07));
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  color: var(--text);
  padding: 12px 22px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  box-shadow: var(--shadow-glass), var(--inner-spec);
  transition: transform 0.25s cubic-bezier(.22,.61,.36,1), box-shadow 0.25s, background 0.25s, opacity 0.2s;
  position: relative;
  overflow: hidden;
  font-family: inherit;
}
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift), var(--inner-spec); }
.btn:active { transform: translateY(0) scale(0.97); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.btn.primary {
  background: linear-gradient(150deg, rgba(124,196,255,0.55), rgba(177,140,255,0.42));
  border-color: rgba(255,255,255,0.45);
}
.btn.ghost { background: rgba(255,255,255,0.06); }
.btn.small { padding: 8px 15px; font-size: 13px; }
.btn.danger { background: linear-gradient(150deg, rgba(255,120,120,0.35), rgba(255,80,80,0.22)); }
.btn.ok { background: linear-gradient(150deg, rgba(111,227,168,0.42), rgba(80,200,140,0.26)); }

/* ---------- inputs ---------- */
.field { margin-bottom: 16px; }
.field label {
  display: block; font-size: 13px; font-weight: 600;
  color: var(--text-dim); margin-bottom: 7px; letter-spacing: 0.02em;
}
.input, .textarea, select.input {
  width: 100%;
  padding: 13px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255,255,255,0.22);
  background: rgba(10,14,28,0.42);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
  outline: none;
  transition: border 0.2s, box-shadow 0.2s, background 0.2s;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
}
.input::placeholder, .textarea::placeholder { color: var(--text-faint); }
.input:focus, .textarea:focus {
  border-color: rgba(124,196,255,0.75);
  box-shadow: 0 0 0 4px rgba(124,196,255,0.16), inset 0 1px 0 rgba(255,255,255,0.10);
  background: rgba(10,14,28,0.58);
}
.textarea { min-height: 96px; resize: vertical; line-height: 1.5; }

/* ---------- modal / sheet ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  background: rgba(4,6,14,0.55);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  opacity: 0; pointer-events: none;
  transition: opacity 0.35s ease;
  padding: 24px;
}
.overlay.show { opacity: 1; pointer-events: auto; }
.sheet {
  width: min(560px, 100%);
  max-height: 88vh;
  overflow-y: auto;
  padding: 30px;
  transform: translateY(24px) scale(0.97);
  opacity: 0;
  transition: transform 0.45s cubic-bezier(.22,1,.36,1), opacity 0.35s;
  border-radius: var(--radius-xl);
}
.overlay.show .sheet { transform: translateY(0) scale(1); opacity: 1; }
.sheet h2 { font-size: 24px; font-weight: 700; letter-spacing: -0.01em; margin-bottom: 6px; }
.sheet .sub { color: var(--text-dim); font-size: 14px; margin-bottom: 22px; }

/* toast */
.toast {
  position: fixed; left: 50%; bottom: 40px; transform: translateX(-50%) translateY(20px);
  z-index: 200; padding: 14px 24px; border-radius: 999px;
  font-size: 14.5px; font-weight: 600;
  opacity: 0; pointer-events: none; transition: all 0.4s cubic-bezier(.22,1,.36,1);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.ok { color: #d6ffe9; border-color: rgba(111,227,168,0.5); }
.toast.err { color: #ffdede; border-color: rgba(255,138,138,0.5); }

/* scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.16); border-radius: 10px;
  border: 2px solid transparent; background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.28); background-clip: content-box; }

.hidden { display: none !important; }
