/* ============================================
   layout.css — 顶栏 / 侧边栏 / 主区 / 状态栏
   ============================================ */

.page {
  display: flex;
  gap: 20px;
  max-width: 1200px;
  margin: 0 auto;
  padding: calc(var(--topbar-h) + 20px) 16px 60px;
  align-items: flex-start;
}

/* ---------- 顶栏 ---------- */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 16px;
  background: var(--dark-2);
  border-bottom: 2px solid var(--pink);
  box-shadow: 0 3px 0 rgba(61, 90, 255, .6);
}

.topbar__logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--white);
}
.topbar__logo:hover { text-decoration: none; color: var(--pink-light); }
.topbar__logo img { width: 28px; height: auto; }
.topbar__title {
  font-family: var(--font-en);
  font-size: 14px;
  background: linear-gradient(90deg, var(--cyan), var(--pink), var(--cyan));
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: rainbow-slide 4s linear infinite;
}

.topbar__marquee { flex: 1; min-width: 0; }

/* ---------- 顶栏搜索框 ---------- */
.topbar__search {
  position: relative;
  display: flex;
  align-items: center;
}
.topbar__search img {
  position: absolute;
  left: 7px;
  width: 12px;
  height: 12px;
  pointer-events: none;
}
.topbar__search input {
  width: 220px;
  height: 34px;
  line-height: 1;
  font-family: inherit;
  font-size: 12px;
  color: var(--cyan);
  background: var(--bg);
  border: 2px solid;
  border-color: var(--bevel-dark) var(--bevel-light) var(--bevel-light) var(--bevel-dark);
  padding: 0 26px 0 24px;
}
/* 隐藏原生清除按钮（又小又无法着色），用自绘的 ✕ */
.topbar__search input::-webkit-search-cancel-button { -webkit-appearance: none; }
.topbar__search input::placeholder { color: rgba(253, 246, 255, .4); }
.topbar__search input:focus {
  outline: 2px solid var(--pink);
  outline-offset: -2px;
}
.topbar__search-clear {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  padding: 0;
  line-height: 1;
  font-family: var(--font-en);
  font-size: 12px;
  color: var(--pink);
  background: transparent;
  border: 2px solid transparent;
  cursor: pointer;
  display: none;
}
.topbar__search input:not(:placeholder-shown) + .topbar__search-clear { display: block; }
.topbar__search-clear:hover {
  border-color: var(--pink);
  background: rgba(255, 110, 199, .18);
}

.topbar__clock {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 10px;
  background: var(--bg);
  border: 2px solid;
  border-color: var(--bevel-dark) var(--bevel-light) var(--bevel-light) var(--bevel-dark);
  font-family: var(--font-en);
  font-size: 10px;
  color: var(--cyan-text);
  white-space: nowrap;
}

/* ---------- 左侧导航栏 ---------- */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  position: sticky;
  top: calc(var(--topbar-h) + 20px);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.nav { display: flex; flex-direction: column; gap: 8px; }

.nav-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  background: var(--bg-2);
  border: 2px solid;
  border-color: var(--bevel-light) var(--bevel-dark) var(--bevel-dark) var(--bevel-light);
  color: var(--ink);
  font-size: 14px;
  cursor: pointer;
  transition: transform .1s steps(2);
}
.nav-btn img { width: 18px; height: 18px; }
.nav-btn:hover {
  background: var(--blue);
  text-decoration: none;
  color: var(--white);
  transform: translate(-1px, -1px);
  box-shadow: 2px 2px 0 var(--pink);
}
.nav-btn.is-active {
  background: var(--pink);
  border-color: var(--bevel-dark) var(--bevel-light) var(--bevel-light) var(--bevel-dark);
  color: var(--white);
}
.nav-btn.is-active img { filter: brightness(0) invert(1); }

/* ---------- 右侧音乐栏 ---------- */
.rightbar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  position: sticky;
  top: calc(var(--topbar-h) + 20px);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ---------- 主内容区 ---------- */
.content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ---------- 底部状态栏 ---------- */
.statusbar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 100;
  padding: 6px 16px;
  background: var(--dark);
  border-top: 2px solid var(--blue);
  font-size: 12px;
  color: var(--pink-light);
  text-align: center;
}

/* ---------- 装饰星星 ---------- */
.deco-star {
  position: fixed;
  z-index: -1;
  width: 22px;
  height: auto;
  pointer-events: none;
  animation: twinkle 1.6s steps(2) infinite;
}
.deco-star--pink { filter: hue-rotate(120deg) saturate(3); }

/* ---------- 响应式 ---------- */
@media (max-width: 1100px) {
  .rightbar { display: none; }
}
@media (max-width: 760px) {
  .page { flex-direction: column; }
  .sidebar {
    position: static;
    width: 100%;
    flex-direction: row;
    flex-wrap: wrap;
  }
  .sidebar .win { flex: 1 1 100%; }
  .nav { flex-direction: row; flex-wrap: wrap; }
  .nav-btn { flex: 1 1 40%; justify-content: center; }
  .topbar__marquee { display: none; }
}
