/* ==========================================================================
   侧边栏布局（单页应用）
   ========================================================================== */

#app {
  display: flex;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

/* ---------- 侧边栏 ---------- */

.sidebar {
  width: 244px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: rgba(14, 14, 21, 0.78);
  backdrop-filter: blur(16px);
  border-right: 1px solid var(--border);
  padding: 20px 13px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 100;
}

/* 侧边栏右侧的渐变高光 —— 让它和内容区分开，而不是一块死板的面板 */
.sidebar::after {
  content: '';
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: 1px;
  background: linear-gradient(180deg,
    transparent 0%,
    rgba(124,58,237,.35) 22%,
    rgba(6,182,212,.22) 62%,
    transparent 100%);
  pointer-events: none;
}

/* ---------- 品牌 ---------- */

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 2px 8px 18px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
}

.brand-mark {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: rgba(124, 58, 237, 0.1);
  transition: background .2s, transform .2s;
}
.brand-mark svg { width: 26px; height: 26px; display: block; }
.sidebar-brand:hover .brand-mark {
  background: rgba(124, 58, 237, 0.18);
  transform: scale(1.04);
}

.brand-text { display: flex; flex-direction: column; min-width: 0; }

.brand-name {
  font-weight: 700;
  font-size: 14.5px;
  letter-spacing: -0.015em;
  line-height: 1.25;
  background: linear-gradient(135deg, #fff, var(--neon-light));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.brand-sub {
  font-size: 10.5px;
  color: var(--text-mute);
  line-height: 1.3;
  letter-spacing: .04em;
  margin-top: 1px;
}

/* ---------- 导航 ---------- */

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
  margin-top: 12px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 11px;
  border-radius: 10px;
  color: var(--text-dim);
  text-decoration: none;
  position: relative;
  transition: color .16s, background .16s;
}

.nav-item:hover {
  color: var(--text);
  background: rgba(255, 255, 255, .035);
}

.nav-item.active {
  color: var(--text);
  background: linear-gradient(90deg, rgba(124,58,237,.17), rgba(124,58,237,.05));
}

/* 左侧霓虹竖条 */
.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 20px;
  border-radius: 0 3px 3px 0;
  background: linear-gradient(180deg, var(--neon-light), var(--neon-2));
  box-shadow: 0 0 10px var(--neon-glow);
}

/* 图标：统一 18px 方形，跟着 currentColor 变色 */
.nav-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  opacity: .78;
  transition: opacity .16s, color .16s;
}
.nav-icon svg { width: 100%; height: 100%; display: block; }
.nav-item:hover .nav-icon { opacity: 1; }
.nav-item.active .nav-icon { opacity: 1; color: var(--neon-light); }

.nav-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.35;
}

.nav-label {
  font-size: 13.5px;
  font-weight: 500;
}

/* 副标题 —— 平时很淡，鼠标悬停/激活时显现，避免平时太吵 */
.nav-desc {
  font-size: 11px;
  color: var(--text-mute);
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  transition: opacity .18s, max-height .18s, margin-top .18s;
}
.nav-item:hover .nav-desc,
.nav-item.active .nav-desc {
  opacity: 1;
  max-height: 16px;
  margin-top: 1px;
}

/* ---------- 侧边栏底部（钱包） ---------- */

.sidebar-foot {
  position: relative;
  padding-top: 13px;
  border-top: 1px solid var(--border);
}
.sidebar-foot .wallet-btn {
  width: 100%;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wallet-menu {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius-sm);
  padding: 6px;
  box-shadow: 0 -8px 32px rgba(0, 0, 0, .6);
  animation: menuIn .16s ease-out;
  z-index: 200;
}
@keyframes menuIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
.wallet-menu-head {
  padding: 8px 10px 10px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 5px;
}
.wallet-menu-addr {
  font-size: 11px;
  word-break: break-all;
  line-height: 1.4;
  margin-top: 3px;
}
.wallet-menu button {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  padding: 9px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: background .12s;
}
.wallet-menu button:hover { background: var(--bg-hover); }
.wallet-menu button.danger { color: var(--err); }
.wallet-menu button.danger:hover { background: rgba(239, 68, 68, .12); }

/* ---------- 内容区 ---------- */

.content {
  flex: 1;
  min-width: 0;
  padding: 40px 40px 80px;
  max-width: 860px;
}

.content-head {
  margin-bottom: 28px;
}
.content-head h1 {
  font-size: clamp(24px, 4vw, 32px);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.18;
  background: linear-gradient(135deg, #fff 0%, var(--neon-light) 55%, var(--neon-2-light) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.content-head p {
  color: var(--text-dim);
  font-size: 14.5px;
  margin-top: 7px;
}

/* ---------- 移动端抽屉 ---------- */

.drawer-toggle {
  display: none;
  position: fixed;
  top: 16px; left: 16px;
  z-index: 300;
  width: 40px; height: 40px;
  padding: 0;
  place-items: center;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border-bright);
  color: var(--text);
  cursor: pointer;
}
.drawer-toggle svg { width: 20px; height: 20px; display: block; }
.drawer-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .6);
  z-index: 90;
}

@media (max-width: 820px) {
  .drawer-toggle { display: block; }

  .sidebar {
    position: fixed;
    left: 0; top: 0; bottom: 0;
    transform: translateX(-100%);
    transition: transform .22s ease-out;
    width: 250px;
    height: 100vh;
  }
  body.drawer-open .sidebar { transform: translateX(0); }
  body.drawer-open .drawer-backdrop { display: block; }

  .content {
    padding: 76px 18px 60px;
    max-width: none;
  }
  .content-head { margin-bottom: 22px; }
}

/* ---------- 标签页（我的名字页） ---------- */

.tabs {
  display: flex;
  gap: 5px;
  padding: 4px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.tab {
  flex: 1;
  padding: 8px 10px;
  border: none;
  border-radius: 5px;
  background: transparent;
  color: var(--text-dim);
  font-family: var(--mono);
  font-size: 12.5px;
  cursor: pointer;
  transition: all .14s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tab:hover { color: var(--text); }
.tab.active {
  background: rgba(124, 58, 237, .18);
  color: var(--neon-light);
}

/* ---------- 分区（管理页） ---------- */

.section-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.section-num {
  width: 24px; height: 24px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  font-size: 12px; font-weight: 700;
  background: rgba(124, 58, 237, .15);
  color: var(--neon-light);
  border: 1px solid rgba(124, 58, 237, .35);
}
.section-title { font-weight: 600; font-size: 15px; }
.section-desc { font-size: 12.5px; color: var(--text-mute); margin-left: auto; }

.checkline {
  display: flex; align-items: center; gap: 9px;
  font-size: 14px; cursor: pointer;
}
.checkline input {
  width: 16px; height: 16px;
  accent-color: var(--neon);
  cursor: pointer;
}

textarea {
  width: 100%;
  min-height: 110px;
  resize: vertical;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--mono);
  font-size: 12.5px;
  padding: 12px 14px;
  outline: none;
  line-height: 1.6;
}
textarea:focus {
  border-color: var(--neon);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, .15);
}
