:root {
  --bg: #07090f;
  --glass-bg: rgba(18, 22, 34, 0.56);
  --glass-bg-hover: rgba(28, 34, 52, 0.72);
  --glass-strong: rgba(15, 19, 30, 0.78);
  --border: rgba(255, 255, 255, 0.09);
  --border-focus: rgba(125, 211, 252, 0.42);
  --text: rgba(244, 247, 255, 0.94);
  --text-muted: rgba(186, 198, 222, 0.58);
  --text-dim: rgba(160, 174, 200, 0.42);
  --accent-bing: #38bdf8;
  --accent-indigo: #818cf8;
  --shadow-lg: 0 24px 64px -16px rgba(0, 0, 0, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  --shadow-sm: 0 8px 24px -8px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  --radius-pill: 22px;
  --radius-card: 16px;
}

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

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ─── 背景极光氛围 ─── */
.ambient {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(110px);
  opacity: 0.32;
  will-change: transform;
}

.orb-1 {
  width: 520px;
  height: 520px;
  top: -160px;
  left: 14%;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.55), transparent 70%);
  animation: drift 24s ease-in-out infinite alternate;
}

.orb-2 {
  width: 560px;
  height: 560px;
  bottom: -200px;
  right: 10%;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.5), transparent 70%);
  animation: drift 28s ease-in-out infinite alternate-reverse;
}

.orb-3 {
  width: 360px;
  height: 360px;
  top: 38%;
  left: 52%;
  background: radial-gradient(circle, rgba(45, 212, 191, 0.22), transparent 70%);
  animation: drift 20s ease-in-out infinite alternate;
}

@keyframes drift {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  100% { transform: translate3d(36px, -28px, 0) scale(1.08); }
}

.noise {
  position: absolute;
  inset: 0;
  opacity: 0.035;
  background-image: radial-gradient(rgba(255, 255, 255, 0.65) 0.5px, transparent 0.5px);
  background-size: 3px 3px;
}

/* ─── 顶部栏 ─── */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 28px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  user-select: none;
}

.brand-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-bing), var(--accent-indigo));
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.7);
}

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

.icon-btn {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--glass-bg);
  color: var(--text-muted);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  cursor: pointer;
  transition: all 0.2s ease;
}

.icon-btn:hover {
  color: var(--text);
  background: var(--glass-bg-hover);
  border-color: rgba(255, 255, 255, 0.18);
}

/* ─── 主舞台 ─── */
.stage {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 88px 20px 64px;
}

.hero {
  text-align: center;
  margin-bottom: 34px;
  user-select: none;
}

.clock {
  font-size: clamp(54px, 8vw, 76px);
  font-weight: 200;
  letter-spacing: -0.02em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(180deg, #ffffff 10%, rgba(203, 213, 225, 0.68) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.date-line {
  margin-top: 10px;
  font-size: 13.5px;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

/* ─── 毛玻璃搜索框 ─── */
.search-wrap {
  position: relative;
  width: 100%;
  max-width: 720px;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 8px 8px 18px;
  border-radius: var(--radius-pill);
  background: var(--glass-bg);
  border: 1px solid var(--border);
  backdrop-filter: blur(28px) saturate(160%);
  -webkit-backdrop-filter: blur(28px) saturate(160%);
  box-shadow: var(--shadow-lg);
  transition: border-color 0.22s ease, box-shadow 0.22s ease, background 0.22s ease;
}

.search-box:focus-within {
  background: rgba(20, 25, 40, 0.72);
  border-color: var(--border-focus);
  box-shadow: 0 24px 68px -14px rgba(0, 0, 0, 0.72), 0 0 0 3px rgba(56, 189, 248, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.search-leading {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  opacity: 0.92;
}

.search-input {
  flex: 1;
  min-width: 0;
  height: 44px;
  border: none;
  outline: none;
  background: transparent;
  color: var(--text);
  font-size: 16px;
  caret-color: var(--accent-bing);
}

.search-input::placeholder {
  color: var(--text-dim);
  font-size: 14.5px;
}

.clear-btn {
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.clear-btn.visible {
  display: inline-flex;
}

.clear-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  color: var(--text);
}

.search-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.btn-bing,
.btn-google {
  height: 40px;
  padding: 0 15px;
  border-radius: 15px;
  font-size: 13.5px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
}

.btn-bing {
  border: 1px solid rgba(56, 189, 248, 0.34);
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.24), rgba(99, 102, 241, 0.22));
  color: #f0f9ff;
}

.btn-bing:hover {
  border-color: rgba(56, 189, 248, 0.62);
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.36), rgba(99, 102, 241, 0.32));
  transform: translateY(-1px);
}

.btn-bing kbd {
  font-family: inherit;
  font-size: 11px;
  opacity: 0.72;
  padding: 1px 5px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.1);
}

.btn-google {
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.btn-google:hover {
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.13);
  transform: translateY(-1px);
}

/* ─── 搜索联想下拉 ─── */
.suggest-panel {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  right: 0;
  z-index: 30;
  display: none;
  flex-direction: column;
  padding: 6px;
  border-radius: 18px;
  background: var(--glass-strong);
  border: 1px solid rgba(255, 255, 255, 0.11);
  backdrop-filter: blur(32px) saturate(180%);
  -webkit-backdrop-filter: blur(32px) saturate(180%);
  box-shadow: 0 28px 60px -12px rgba(0, 0, 0, 0.78);
}

.suggest-panel.open {
  display: flex;
}

.suggest-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 12px;
  color: rgba(235, 240, 252, 0.88);
  font-size: 14px;
  cursor: pointer;
  transition: background 0.12s ease;
}

.suggest-item:hover,
.suggest-item.active {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.suggest-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.suggest-tag {
  font-size: 11px;
  color: var(--text-dim);
  flex-shrink: 0;
}

.suggest-google-mini {
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  font-size: 11.5px;
  padding: 3px 9px;
  border-radius: 8px;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.suggest-google-mini:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

/* ─── 扩展引擎条 ─── */
.engine-bar {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.engine-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(18, 22, 34, 0.44);
  color: var(--text-muted);
  font-size: 12.5px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  cursor: pointer;
  transition: all 0.18s ease;
}

.engine-chip:hover {
  color: var(--text);
  background: var(--glass-bg-hover);
  border-color: rgba(255, 255, 255, 0.18);
  transform: translateY(-1px);
}

.chip-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}
.chip-dual { background: linear-gradient(135deg, #38bdf8, #facc15); }
.chip-bili { background: #fb7299; }
.chip-gh   { background: #e2e8f0; }
.chip-zh   { background: #3b82f6; }
.chip-bd   { background: #60a5fa; }
.chip-xhs  { background: #f43f5e; }

/* ─── 快捷导航 Dock ─── */
.dock-wrap {
  width: 100%;
  max-width: 720px;
  margin-top: 42px;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.dock-wrap.hidden {
  display: none;
}

.dock-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
  gap: 12px;
}

.dock-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 15px 8px 13px;
  border-radius: var(--radius-card);
  border: 1px solid var(--border);
  background: rgba(18, 22, 34, 0.42);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: var(--shadow-sm);
  color: var(--text-muted);
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.dock-item:hover {
  background: var(--glass-bg-hover);
  border-color: rgba(255, 255, 255, 0.18);
  color: var(--text);
  transform: translateY(-2px);
}

.dock-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
}

.dock-icon img {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

.dock-label {
  font-size: 12px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dock-del {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 18px;
  height: 18px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: rgba(255, 255, 255, 0.72);
  font-size: 11px;
  line-height: 1;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.dock-item:hover .dock-del {
  display: flex;
}

.dock-del:hover {
  background: rgba(239, 68, 68, 0.85);
  color: #fff;
}

.dock-add {
  border-style: dashed;
  opacity: 0.65;
}

.dock-add:hover {
  opacity: 1;
}

/* ─── 弹窗 ─── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(4, 6, 12, 0.68);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-backdrop[hidden] {
  display: none;
}

.modal-card {
  width: 100%;
  max-width: 400px;
  padding: 22px;
  border-radius: 20px;
  background: rgba(16, 20, 32, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.8);
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.modal-head h3 {
  font-size: 16px;
  font-weight: 500;
}

.modal-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.modal-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12.5px;
  color: var(--text-muted);
}

.modal-form input {
  height: 40px;
  padding: 0 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  font-size: 14px;
  outline: none;
}

.modal-form input:focus {
  border-color: var(--border-focus);
}

.modal-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 6px;
}

.btn-ghost {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 13px;
  cursor: pointer;
}

.btn-ghost:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

.btn-primary {
  border: 1px solid rgba(56, 189, 248, 0.45);
  background: rgba(56, 189, 248, 0.22);
  color: #f0f9ff;
  padding: 8px 18px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}

.btn-primary:hover {
  background: rgba(56, 189, 248, 0.34);
}

.help-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 13px;
  color: var(--text-muted);
}

.help-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.help-row kbd,
.help-tip code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  color: var(--text);
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.help-divider {
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}

.help-tip {
  line-height: 1.7;
  font-size: 12.5px;
}

@media (max-width: 600px) {
  .search-box {
    flex-wrap: wrap;
    padding: 10px 12px;
    border-radius: 20px;
  }
  .search-leading {
    display: none;
  }
  .search-input {
    width: 100%;
    flex: 1 1 80%;
  }
  .search-actions {
    width: 100%;
    justify-content: flex-end;
    padding-top: 6px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
  }
  .btn-bing,
  .btn-google {
    flex: 1;
    justify-content: center;
  }
  .dock-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
  }
}
