/* finesse · register=brand+product · A=deep-space+lime · B=900/300 · C=planet-idle-layer
 * D=threejs-album-planet · E=machined-glass · SOUL=8 SPECTACLE=8 DENSITY=5 */

:root {
  --bg: #05070c;
  --surface: #0c1017;
  --surface-2: #111722;
  --ink: #e8ecf5;
  --muted: #8b93a7;
  --dim: #4a5166;
  --placeholder: #9aa3b8;
  --accent: #d9b36c;
  --accent-soft: rgba(217, 179, 108, 0.14);
  --accent-ink: #1b140a;
  --border: rgba(232, 236, 245, 0.09);
  --border-strong: rgba(232, 236, 245, 0.17);
  --nebula-a: rgba(40, 72, 118, 0.32);
  --nebula-b: rgba(128, 96, 52, 0.14);
  --shadow: 0 18px 60px rgba(0, 0, 0, 0.42);
  --radius: 12px;
  --radius-sm: 8px;
  --font: "MiSans", "HarmonyOS Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
}

body.light {
  --bg: #eef1ee;
  --surface: #f6f8f5;
  --surface-2: #ffffff;
  --ink: #18201a;
  --muted: #5f6a62;
  --dim: #a3aca6;
  --placeholder: #7c867e;
  --accent: #9a7426;
  --accent-soft: rgba(154, 116, 38, 0.12);
  --accent-ink: #faf3e4;
  --border: rgba(24, 32, 26, 0.1);
  --border-strong: rgba(24, 32, 26, 0.18);
  --nebula-a: rgba(120, 165, 210, 0.25);
  --nebula-b: rgba(190, 160, 100, 0.12);
  --shadow: 0 16px 48px rgba(24, 32, 26, 0.12);
}

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

html,
body {
  height: 100%;
  overflow: hidden;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

button,
input,
textarea {
  font: inherit;
  color: inherit;
}

button {
  border: 0;
  background: none;
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.hidden {
  display: none !important;
}

[hidden] {
  display: none !important;
}

.layer {
  position: fixed;
  inset: 0;
}

/* Idle layer */
.idle-layer {
  --bg: #05070c;
  --ink: #e8ecf5;
  --muted: #8b93a7;
  --dim: #4a5166;
  --placeholder: #9aa3b8;
  --accent: #d9b36c;
  --accent-soft: rgba(217, 179, 108, 0.14);
  --border: rgba(232, 236, 245, 0.09);
  --border-strong: rgba(232, 236, 245, 0.17);
  z-index: 1;
  background:
    radial-gradient(ellipse 80% 60% at 28% 24%, var(--nebula-a), transparent 62%),
    radial-gradient(ellipse 70% 55% at 74% 72%, var(--nebula-b), transparent 60%),
    var(--bg);
  overflow: hidden;
}

.idle-layer::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.8;
  background-image:
    radial-gradient(1px 1px at 8% 18%, rgba(214, 228, 255, 0.8), transparent 100%),
    radial-gradient(1px 1px at 16% 62%, rgba(232, 236, 245, 0.7), transparent 100%),
    radial-gradient(1px 1px at 24% 32%, rgba(214, 228, 255, 0.6), transparent 100%),
    radial-gradient(1px 1px at 33% 78%, rgba(255, 226, 184, 0.7), transparent 100%),
    radial-gradient(1px 1px at 41% 12%, rgba(232, 236, 245, 0.8), transparent 100%),
    radial-gradient(1px 1px at 48% 44%, rgba(214, 228, 255, 0.55), transparent 100%),
    radial-gradient(1px 1px at 56% 86%, rgba(232, 236, 245, 0.6), transparent 100%),
    radial-gradient(1px 1px at 64% 24%, rgba(255, 226, 184, 0.6), transparent 100%),
    radial-gradient(1px 1px at 71% 58%, rgba(214, 228, 255, 0.7), transparent 100%),
    radial-gradient(1px 1px at 79% 14%, rgba(232, 236, 245, 0.75), transparent 100%),
    radial-gradient(1px 1px at 87% 70%, rgba(214, 228, 255, 0.6), transparent 100%),
    radial-gradient(1px 1px at 93% 34%, rgba(232, 236, 245, 0.8), transparent 100%),
    radial-gradient(1.4px 1.4px at 12% 82%, rgba(214, 228, 255, 0.5), transparent 100%),
    radial-gradient(1.4px 1.4px at 36% 56%, rgba(232, 236, 245, 0.45), transparent 100%),
    radial-gradient(1.4px 1.4px at 59% 10%, rgba(255, 226, 184, 0.5), transparent 100%),
    radial-gradient(1.4px 1.4px at 82% 88%, rgba(232, 236, 245, 0.45), transparent 100%);
}

#idle-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.idle-scrim {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse 90% 70% at 50% 52%, transparent 42%, rgba(5, 7, 12, 0.82) 100%);
}

body.light .idle-scrim {
  background: radial-gradient(ellipse 90% 70% at 50% 52%, transparent 46%, rgba(238, 241, 238, 0.8) 100%);
}

body.light .idle-layer .idle-scrim {
  background: radial-gradient(ellipse 90% 70% at 50% 52%, transparent 42%, rgba(5, 7, 12, 0.82) 100%);
}

body.light .idle-layer .idle-topline {
  text-shadow: 0 2px 18px rgba(5, 7, 12, 0.7);
}

.idle-topline {
  position: absolute;
  top: clamp(18px, 5vh, 44px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  color: var(--ink);
  font-size: clamp(13px, 1.6vw, 17px);
  font-weight: 500;
  text-align: center;
  white-space: nowrap;
  text-shadow: 0 2px 18px rgba(5, 7, 12, 0.7);
}

body.light .idle-topline {
  text-shadow: 0 2px 18px rgba(238, 241, 238, 0.7);
}

.idle-search {
  position: absolute;
  top: clamp(52px, 13vh, 118px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 6;
  display: flex;
  align-items: center;
  gap: 8px;
  width: min(74vw, 640px);
  height: 44px;
  padding: 0 8px 0 14px;
  border-radius: 18px;
  transition: background 0.28s, border-color 0.28s, box-shadow 0.28s, opacity 0.28s;
}

.idle-search.ghost {
  background: rgba(232, 236, 245, 0.06);
  border: 1px solid rgba(232, 236, 245, 0.08);
  box-shadow: none;
  opacity: 0.62;
  backdrop-filter: blur(6px);
}

.idle-search.ghost:hover {
  opacity: 0.92;
  background: rgba(232, 236, 245, 0.1);
}

.idle-search.solid {
  background: var(--surface-2);
  border: 1px solid var(--accent);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.38);
  opacity: 1;
}

.idle-search input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  outline: 0;
  background: none;
  color: var(--ink);
  font-size: 15px;
}

.idle-search input::placeholder {
  color: var(--placeholder);
}

.engine-chip,
.icon-btn,
.go-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  border-radius: 10px;
  color: var(--muted);
  transition: transform 0.16s cubic-bezier(0.16, 1, 0.3, 1), color 0.2s, background 0.2s;
}

.engine-chip:hover,
.icon-btn:hover {
  color: var(--ink);
  background: rgba(232, 236, 245, 0.08);
}

.engine-chip:active,
.icon-btn:active,
.go-btn:active {
  transform: scale(0.94);
}

.engine-chip svg,
.icon-btn svg,
.go-btn svg,
.chip svg,
.dock-btn svg {
  width: 17px;
  height: 17px;
  stroke-width: 1.8;
}

.go-btn {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
}

.go-btn:hover {
  color: var(--accent-ink);
  filter: brightness(1.06);
}

.idle-hint {
  position: absolute;
  top: clamp(122px, 21vh, 184px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  color: var(--placeholder);
  font-size: 12px;
  text-align: center;
  white-space: nowrap;
}

.key {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 2px 7px;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  background: rgba(232, 236, 245, 0.06);
  font-family: var(--mono);
  font-size: 11px;
}

.dot {
  margin: 0 6px;
  opacity: 0.5;
}

.idle-quote {
  position: absolute;
  bottom: clamp(28px, 8vh, 72px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  max-width: min(82vw, 560px);
  color: var(--muted);
  font-size: 13px;
  text-align: center;
  line-height: 1.7;
}

.haoqi-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  overflow: hidden;
  pointer-events: none;
}

.haoqi-overlay.paused * {
  animation-play-state: paused !important;
}

.haoqi-ray {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 46vw;
  height: 130vh;
  transform: translate(-50%, -50%) rotate(var(--a));
  background: linear-gradient(90deg, transparent, rgba(190, 220, 250, 0.28) 40%, rgba(255, 255, 255, 0.5) 50%, rgba(190, 220, 250, 0.28) 60%, transparent);
  filter: blur(4px);
  mix-blend-mode: screen;
  animation: haoqi-ray var(--dur, 9s) ease-in-out infinite;
}

@keyframes haoqi-ray {
  0%,
  100% {
    opacity: 0.5;
    transform: translate(-50%, -50%) rotate(var(--a)) scaleY(1);
  }
  50% {
    opacity: 0.85;
    transform: translate(-50%, -50%) rotate(calc(var(--a) + 2deg)) scaleY(1.06);
  }
}

.haoqi-word-wrap {
  position: absolute;
  left: 50%;
  top: 46%;
  transform: translate(-50%, -50%);
  perspective: 900px;
  filter: drop-shadow(0 0 18px rgba(190, 220, 255, 0.5)) drop-shadow(0 2px 40px rgba(150, 200, 255, 0.35));
}

.haoqi-word {
  font-size: clamp(72px, 17vw, 170px);
  font-weight: 800;
  line-height: 0.95;
  white-space: nowrap;
  transform: rotateX(14deg) rotateZ(-2deg);
  transform-style: preserve-3d;
  color: transparent;
  background: linear-gradient(135deg, rgba(170, 210, 255, 0.95), rgba(255, 255, 255, 0.98) 42%, rgba(215, 235, 255, 0.7));
  -webkit-background-clip: text;
  background-clip: text;
  background-size: 220% 100%;
  -webkit-text-stroke: 1px rgba(255, 255, 255, 0.3);
  text-shadow:
    0 0 1px rgba(255, 255, 255, 0.9),
    0 0 18px rgba(190, 220, 255, 0.5),
    0 1px 0 rgba(255, 255, 255, 0.45),
    0 3px 0 rgba(150, 190, 230, 0.22),
    0 7px 0 rgba(120, 165, 215, 0.16),
    0 14px 0 rgba(100, 145, 195, 0.12),
    0 22px 26px rgba(80, 120, 170, 0.35);
  animation: haoqi-wordflow 6s ease-in-out infinite;
}

.haoqi-reflection {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  font-size: inherit;
  font-weight: 800;
  line-height: 0.95;
  white-space: nowrap;
  transform: scaleY(-1);
  color: transparent;
  background: linear-gradient(135deg, rgba(170, 210, 255, 0.9), rgba(255, 255, 255, 0.9) 42%, rgba(215, 235, 255, 0.65));
  -webkit-background-clip: text;
  background-clip: text;
  opacity: 0.16;
  filter: blur(1px);
  -webkit-mask-image: linear-gradient(to top, transparent 10%, #000 70%);
  mask-image: linear-gradient(to top, transparent 10%, #000 70%);
}


@keyframes haoqi-wordflow {
  0% {
    background-position: 0% 0;
  }
  50% {
    background-position: 100% 0;
  }
  100% {
    background-position: 0% 0;
  }
}

@media (max-width: 760px) {
  .haoqi-word {
    font-size: clamp(56px, 20vw, 96px);
  }
}

/* Main layer */
.main-layer {
  z-index: 10;
  background: var(--bg);
}

.main-layer.main-light {
  --bg: #f4f5f3;
  --surface: #ffffff;
  --surface-2: #ffffff;
  --ink: #1a1b1e;
  --muted: #6e737a;
  --dim: #b4b9c0;
  --accent: #9a7426;
  --accent-soft: rgba(154, 116, 38, 0.1);
  --accent-ink: #faf6ee;
  --border: rgba(24, 26, 30, 0.09);
  --border-strong: rgba(24, 26, 30, 0.16);
  --placeholder: #9aa0a6;
  --shadow: 0 16px 44px rgba(30, 32, 36, 0.1);
}

.main-layer.main-light::before {
  display: none;
}

.main-layer::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(1px 1px at 12% 18%, rgba(232, 236, 245, 0.35) 50%, transparent 51%),
    radial-gradient(1px 1px at 78% 12%, rgba(232, 236, 245, 0.3) 50%, transparent 51%),
    radial-gradient(1px 1px at 34% 72%, rgba(232, 236, 245, 0.22) 50%, transparent 51%),
    radial-gradient(1px 1px at 88% 64%, rgba(232, 236, 245, 0.26) 50%, transparent 51%),
    radial-gradient(1px 1px at 55% 88%, rgba(232, 236, 245, 0.2) 50%, transparent 51%);
}

body.perf .main-layer::before,
body.perf .idle-scrim {
  display: none;
}

body.no-starfield .idle-layer::before {
  display: none;
}

body.no-blur .topbar,
body.no-blur .dock,
body.no-blur .idle-search,
body.no-blur .drawer-backdrop,
body.no-blur .shortcuts-overlay,
body.no-blur .photo-viewer,
body.no-blur .avatar-modal,
body.no-blur .card-actions {
  backdrop-filter: none !important;
}

.main-scroll {
  position: relative;
  z-index: 2;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: var(--dim) transparent;
}

.main-scroll::-webkit-scrollbar {
  width: 8px;
}

.main-scroll::-webkit-scrollbar-thumb {
  background: var(--dim);
  border-radius: 999px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  gap: 12px;
  padding: 14px clamp(18px, 4vw, 44px);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

body.perf .topbar {
  background: var(--bg);
  backdrop-filter: none;
}

.hook {
  text-align: center;
  font-size: clamp(15px, 2vw, 19px);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hook .accent {
  color: var(--accent);
}

.header-strip {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 16px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 26px clamp(18px, 4vw, 44px) 8px;
}

.avatar-btn {
  width: 54px;
  height: 54px;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.18s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.2s;
}

.avatar-btn:hover {
  transform: scale(1.04);
  border-color: var(--accent);
}

.avatar-img {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--surface-2), var(--accent-soft));
  color: var(--accent);
  font-size: 22px;
  font-weight: 700;
  overflow: hidden;
}

.avatar-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.who-name {
  font-size: 17px;
  font-weight: 700;
}

.who-sign {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

.date-line {
  text-align: right;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.chips {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 4px 11px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  transition: transform 0.16s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.2s, color 0.2s;
}

.chip:hover {
  color: var(--ink);
  border-color: var(--border-strong);
}

.chip:active {
  transform: scale(0.96);
}

.chip.active {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-soft);
}

.search-zone {
  position: relative;
  max-width: 860px;
  margin: 18px auto 6px;
  padding: 0 clamp(18px, 4vw, 44px);
}

.search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 50px;
  padding: 0 10px 0 16px;
  border-radius: 18px;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.26);
  transition: border-color 0.25s, box-shadow 0.25s;
}

body.light .search-bar {
  box-shadow: 0 10px 30px rgba(24, 32, 26, 0.1);
}

.search-bar:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), 0 14px 44px rgba(0, 0, 0, 0.32);
}

.search-bar input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  outline: 0;
  background: none;
  font-size: 15px;
}

.search-bar input::placeholder {
  color: var(--placeholder);
}

.search-pop {
  position: absolute;
  top: calc(100% + 8px);
  left: clamp(18px, 4vw, 44px);
  right: clamp(18px, 4vw, 44px);
  z-index: 30;
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  background: var(--surface-2);
  box-shadow: var(--shadow);
  overflow: hidden;
  max-height: 320px;
  overflow-y: auto;
}

.pop-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 16px;
  color: var(--muted);
  font-size: 13px;
  text-align: left;
  transition: background 0.15s, color 0.15s;
}

.pop-item:hover,
.pop-item.active {
  background: var(--accent-soft);
  color: var(--ink);
}

.pop-item .pop-kind {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--accent);
}

.pop-head {
  padding: 10px 16px 4px;
  color: var(--dim);
  font-size: 11px;
}

/* Nav */
.nav-zone {
  max-width: 1180px;
  margin: 0 auto;
  padding: 22px clamp(18px, 4vw, 44px) 8px;
}

.nav-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.nav-toolbar h2 {
  font-size: 16px;
  font-weight: 700;
  margin-right: auto;
}

.nav-filter {
  min-width: 160px;
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  font-size: 12px;
}

.nav-filter::placeholder {
  color: var(--muted);
}

.seg {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
}

.seg button {
  min-height: 26px;
  padding: 2px 10px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 12px;
  transition: background 0.18s, color 0.18s;
}

.seg button.active {
  background: var(--accent-soft);
  color: var(--accent);
}

.nav-group {
  margin-bottom: 18px;
}

.nav-group-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.nav-group-head h3 {
  font-size: 14px;
  font-weight: 700;
  color: var(--muted);
}

.nav-group-head .collapse-btn {
  width: 24px;
  height: 24px;
  border-radius: 8px;
  color: var(--dim);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s;
}

.nav-group.collapsed .nav-cards {
  display: none;
}

.nav-group.collapsed .collapse-btn {
  transform: rotate(-90deg);
}

.nav-cards.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: 10px;
}

.nav-cards.list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nav-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 64px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  text-align: left;
  overflow: hidden;
  transition: transform 0.18s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.2s, background 0.2s;
}

.nav-cards.grid .nav-card {
  flex-direction: column;
  justify-content: center;
  text-align: center;
}

.nav-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
  background: var(--surface-2);
}

.nav-card.dragging {
  opacity: 0.5;
}

.nav-card .nav-icon {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 18px;
  overflow: hidden;
}

.nav-cards.list .nav-card .nav-icon {
  width: 32px;
  height: 32px;
  border-radius: 10px;
}

.nav-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.nav-card .nav-label {
  font-size: 13px;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.nav-card.starred::after {
  content: "";
  position: absolute;
  top: 8px;
  right: 8px;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
}

.nav-card .card-actions {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: color-mix(in srgb, var(--bg) 70%, transparent);
  backdrop-filter: blur(6px);
}

.nav-zone.editing .nav-card .card-actions {
  display: flex;
}

.card-actions .icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
}

.nav-empty {
  padding: 30px 20px;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  font-size: 13px;
}

.nav-add-card {
  min-height: 64px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  color: var(--muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 12px;
  transition: border-color 0.2s, color 0.2s;
}

.nav-cards.list .nav-add-card {
  flex-direction: row;
  min-height: 44px;
}

.nav-add-card:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Album */
.album-zone {
  max-width: 1180px;
  margin: 0 auto;
  padding: 22px clamp(18px, 4vw, 44px) 8px;
}

.section-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.section-head h2 {
  font-size: 16px;
  font-weight: 700;
  margin-right: auto;
}

.section-actions {
  display: flex;
  gap: 8px;
}

.album-stage {
  position: relative;
  height: clamp(280px, 42vh, 460px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 50% 45%, rgba(217, 179, 108, 0.08), transparent 42%),
    var(--surface);
  overflow: hidden;
}

.album-stage.fullscreen {
  position: fixed;
  inset: 0;
  z-index: 85;
  height: 100%;
  border: 0;
  border-radius: 0;
}

#album-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.album-note {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 12px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--bg) 70%, transparent);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
  pointer-events: none;
}

.planet-tip {
  position: absolute;
  z-index: 8;
  transform: translate(-50%, -130%);
  padding: 5px 11px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: var(--surface-2);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35), 0 0 18px var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
  white-space: nowrap;
  pointer-events: none;
  transition: opacity 0.15s;
}

.quote-zone {
  max-width: 1180px;
  margin: 0 auto;
  padding: 16px clamp(18px, 4vw, 44px) 10px;
}

.quote-card {
  padding: 18px 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  text-align: center;
}

.quote-card .quote-text {
  font-size: 15px;
  line-height: 1.8;
  color: var(--ink);
}

.quote-card .quote-src {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

/* Dock */
.dock {
  position: sticky;
  bottom: 0;
  z-index: 18;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px clamp(18px, 4vw, 44px);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--border);
}

body.perf .dock {
  background: var(--bg);
  backdrop-filter: none;
}

.dock-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  transition: transform 0.16s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.2s, color 0.2s;
}

.dock-btn:hover {
  color: var(--ink);
  border-color: var(--border-strong);
}

.dock-btn:active {
  transform: scale(0.95);
}

.dock-btn.active {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-soft);
}

/* Drawers */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: rgba(5, 7, 12, 0.5);
  backdrop-filter: blur(3px);
  opacity: 0;
  transition: opacity 0.25s;
}

.drawer-backdrop.show {
  opacity: 1;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 80;
  width: min(520px, 92vw);
  background: var(--surface);
  border-left: 1px solid var(--border-strong);
  box-shadow: -24px 0 70px rgba(0, 0, 0, 0.45);
  transform: translateX(104%);
  transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
}

.drawer.open {
  transform: translateX(0);
}

.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
}

.drawer-head h2 {
  font-size: 16px;
  font-weight: 700;
}

.head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 18px 26px;
}

.tool-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 14px;
}

.tool-tab {
  min-height: 30px;
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 12px;
  transition: background 0.18s, color 0.18s, border-color 0.18s;
}

.tool-tab.active {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-soft);
}

.tool-panel {
  display: none;
}

.tool-panel.active {
  display: grid;
  gap: 12px;
}

.tool-card {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.tool-card h3 {
  margin-bottom: 10px;
  font-size: 13px;
  font-weight: 700;
}

.tool-card textarea,
.tool-card input[type="text"],
.tool-card input[type="number"],
.tool-card input[type="date"],
.tool-card input[type="url"] {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--ink);
  font-size: 13px;
  resize: vertical;
}

.tool-card input {
  height: 38px;
  resize: none;
}

.tool-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.btn {
  min-height: 34px;
  padding: 6px 14px;
  border-radius: 10px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 12px;
  font-weight: 600;
  transition: transform 0.16s cubic-bezier(0.16, 1, 0.3, 1), filter 0.2s;
}

.btn:hover {
  filter: brightness(1.06);
}

.btn:active {
  transform: scale(0.95);
}

.btn.ghost-btn {
  background: transparent;
  border: 1px solid var(--border-strong);
  color: var(--muted);
}

.btn.ghost-btn:hover {
  color: var(--ink);
  border-color: var(--accent);
}

.btn.danger-btn {
  background: transparent;
  border: 1px solid rgba(220, 90, 90, 0.5);
  color: #d88484;
}

.tool-output {
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 180px;
  overflow-y: auto;
}

.two-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.switch-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

/* Notes */
.notes-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.note-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.note-tab {
  min-height: 30px;
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 12px;
}

.note-tab.active {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-soft);
}

.note-editor {
  display: grid;
  gap: 10px;
}

.note-editor input,
.note-editor textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--ink);
  resize: vertical;
}

.note-editor input {
  height: 40px;
  font-weight: 600;
}

/* Terminal */
.term-tabs {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 10px;
}

.term-tab {
  min-height: 26px;
  padding: 2px 12px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 12px;
}

.term-tab.active {
  background: var(--accent-soft);
  color: var(--accent);
}

.term-panel {
  display: none;
  height: 100%;
}

.term-panel.active {
  display: flex;
  flex-direction: column;
}

.terminal {
  flex: 1;
  min-height: 380px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #04060b;
  color: #c9d4c8;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.6;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-all;
  outline: none;
}

body.light .terminal {
  background: #10140f;
  color: #d5e2d2;
}

.terminal .t-line {
  min-height: 1.6em;
}

.terminal .t-in {
  color: var(--accent);
}

.terminal .t-err {
  color: #e08a8a;
}

.terminal .t-caret {
  display: inline-block;
  color: var(--accent);
  animation: caret 1s steps(1) infinite;
}

@keyframes caret {
  50% {
    opacity: 0;
  }
}

.ssh-empty {
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 30px 14px;
  text-align: center;
  color: var(--muted);
}

.ssh-empty svg {
  width: 34px;
  height: 34px;
  color: var(--accent);
}

.ssh-empty h3 {
  color: var(--ink);
  font-size: 15px;
}

.ssh-empty p {
  font-size: 12px;
  line-height: 1.7;
  max-width: 360px;
}

.ssh-form {
  display: grid;
  gap: 10px;
  width: 100%;
  max-width: 360px;
  margin-top: 8px;
}

.ssh-form input {
  width: 100%;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.ssh-profiles {
  display: grid;
  gap: 8px;
  width: 100%;
  max-width: 360px;
}

.ssh-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 12px;
}

.ssh-profile .name {
  font-weight: 600;
  color: var(--ink);
}

.ssh-profile .host {
  color: var(--muted);
  margin-left: auto;
}

/* Settings */
.settings-body {
  display: grid;
  gap: 14px;
}

.setting-group {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.setting-group h3 {
  margin-bottom: 12px;
  font-size: 13px;
  font-weight: 700;
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 40px;
  font-size: 13px;
  color: var(--muted);
}

.setting-row > span {
  color: var(--ink);
}

.switch {
  position: relative;
  display: inline-flex;
  width: 40px;
  height: 22px;
  flex: 0 0 auto;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.switch::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: var(--dim);
  transition: background 0.2s;
}

.switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: var(--ink);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.switch:has(input:checked)::before {
  background: var(--accent);
}

.switch:has(input:checked)::after {
  transform: translateX(18px);
  background: var(--accent-ink);
}

.setting-row input[type="range"] {
  width: 160px;
  accent-color: var(--accent);
}

.setting-note {
  margin-top: 12px;
  color: var(--dim);
  font-size: 11px;
  line-height: 1.7;
}

/* Overlays */
.shortcuts-overlay,
.photo-viewer,
.avatar-modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(5, 7, 12, 0.72);
  backdrop-filter: blur(8px);
}

.shortcuts-panel,
.avatar-panel {
  width: min(460px, 90vw);
  max-height: 84vh;
  overflow-y: auto;
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.shortcuts-panel header,
.avatar-panel header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
}

.shortcuts-panel h2,
.avatar-panel h2 {
  font-size: 16px;
  font-weight: 700;
}

.shortcut-list {
  padding: 12px 18px 18px;
  display: grid;
  gap: 10px;
}

.shortcut-list > div {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
}

.shortcut-list .key {
  min-width: 52px;
  justify-content: center;
}

.photo-viewer {
  background: rgba(4, 6, 11, 0.88);
  z-index: 95;
}

.photo-viewer img {
  max-width: 88vw;
  max-height: 86vh;
  border-radius: 12px;
  box-shadow: var(--shadow);
  object-fit: contain;
}

.photo-close {
  position: absolute;
  top: 20px;
  right: 24px;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  color: var(--ink);
}

.avatar-form {
  display: grid;
  gap: 12px;
  padding: 18px;
}

.avatar-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.avatar-form input,
.avatar-form textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--ink);
  resize: vertical;
}

.toast {
  position: fixed;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 120;
  padding: 10px 18px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--surface-2);
  box-shadow: var(--shadow);
  color: var(--ink);
  font-size: 13px;
  animation: toast-in 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translate(-50%, 12px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

/* Line style */
body.line .search-bar,
body.line .nav-card,
body.line .album-stage,
body.line .tool-card,
body.line .setting-group,
body.line .quote-card,
body.line .terminal {
  background: transparent;
  backdrop-filter: none;
  box-shadow: none;
}

body.line .search-bar {
  border-radius: 4px;
}

body.line .nav-card {
  border-radius: 4px;
}

body.line .chip,
body.line .dock-btn {
  border-radius: 4px;
}

/* Ripple */
.ripple-host {
  position: relative;
  overflow: hidden;
}

.ripple {
  position: absolute;
  border-radius: 999px;
  background: var(--accent);
  opacity: 0.24;
  transform: scale(0);
  animation: ripple 0.55s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  pointer-events: none;
}

@keyframes ripple {
  to {
    transform: scale(2.4);
    opacity: 0;
  }
}

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

/* Responsive */
@media (max-width: 760px) {
  .idle-search {
    width: min(88vw, 420px);
  }

  .idle-hint {
    top: 20vh;
  }

  .header-strip {
    grid-template-columns: auto 1fr;
    gap: 10px;
  }

  .date-line {
    grid-column: 2;
    text-align: left;
  }

  .chips {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  .topbar {
    grid-template-columns: 40px 1fr 40px;
  }

  .nav-cards.grid {
    grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  }

  .album-stage {
    height: 300px;
  }

  .dock {
    justify-content: space-between;
  }

  .dock-btn {
    padding: 6px 10px;
  }

  .dock-btn span {
    display: none;
  }

  .dock-btn svg {
    width: 20px;
    height: 20px;
  }

  .drawer {
    width: 100%;
  }
}
