/* ============================================================ * 全局侧栏 — 纯字排版,零图标,分区编号 + 中文标 * -------------------------------------------------------------- * 核心视觉刻画: * - 分区头:Fraunces 衬线斜体 + 微小分区编号 (01/02/03),与正文 Inter 形成强烈反差 * - 二级条目:纯文字 14px,hover 仅文字颜色变化,active 时左侧 2px 竖线 * - 不使用 hover 背景色块或图标 → 让信息密度专注于"标签文字"本身 * ============================================================ */ .t-sidebar { width: 220px; height: 100%; display: flex; flex-direction: column; padding: 28px 0 16px; background: #ffffff; border-right: 1px solid rgba(15, 23, 42, 0.06); font-family: var(--font-body); color: #1d1d1f; overflow-y: auto; flex-shrink: 0; } /* ===== 分区列表 ===== */ .t-sidebar__zones { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 28px; flex: 1; } .t-zone { display: flex; flex-direction: column; } /* —— 分区头:序号 + 中文标 —— */ .t-zone__head { display: flex; align-items: baseline; gap: 12px; padding: 0 24px; margin-bottom: 8px; } .t-zone__serial { font-family: var(--font-serif); font-style: italic; font-weight: 300; font-size: 22px; line-height: 1; color: rgba(15, 23, 42, 0.32); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; /* Fraunces 可选项:optical sizing 在不同字号下自动调整笔画粗细 */ font-optical-sizing: auto; } .t-zone__label { font-family: var(--font-body); font-size: 11px; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase; color: rgba(15, 23, 42, 0.55); } /* ===== 二级条目 ===== */ .t-zone__items { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; } .t-item { position: relative; display: flex; align-items: center; gap: 8px; padding: 8px 24px; font-size: 14px; font-weight: 500; color: rgba(15, 23, 42, 0.72); cursor: pointer; user-select: none; outline: none; transition: color 120ms ease; } .t-item:hover, .t-item:focus-visible { color: #0f172a; } .t-item:focus-visible { /* 不用粗暴 outline,用左边竖线作为焦点提示 */ background: rgba(15, 23, 42, 0.03); } /* 左侧竖线:active 时显示 */ .t-item__rail { position: absolute; left: 0; top: 8px; bottom: 8px; width: 2px; background: transparent; border-radius: 0 2px 2px 0; transition: background-color 160ms ease; } .t-item.is-active { color: #0f172a; font-weight: 700; } .t-item.is-active .t-item__rail { background: #0f172a; } /* 标签 */ .t-item__label { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } /* Beta 微章 */ .t-item__badge { font-family: var(--font-mono); font-size: 9px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; padding: 2px 6px; border-radius: 3px; background: rgba(15, 23, 42, 0.06); color: rgba(15, 23, 42, 0.55); flex-shrink: 0; } .t-item.is-active .t-item__badge { background: #0f172a; color: #ffffff; } /* ===== 底部主题切换 ===== */ .t-sidebar__foot { margin-top: 16px; padding: 16px 24px 0; border-top: 1px solid rgba(15, 23, 42, 0.06); } .t-theme { display: flex; align-items: center; gap: 8px; width: 100%; padding: 0; border: none; background: transparent; cursor: pointer; font-family: var(--font-body); font-size: 13px; color: rgba(15, 23, 42, 0.55); transition: color 120ms ease; } .t-theme:hover { color: #0f172a; } .t-theme__dot { width: 8px; height: 8px; border-radius: 50%; background: linear-gradient(135deg, #fbbf24, #f97316); box-shadow: 0 0 0 2px rgba(251, 191, 36, 0.18); transition: background 200ms ease, box-shadow 200ms ease; } .t-theme__dot.is-night { background: linear-gradient(135deg, #1e293b, #475569); box-shadow: 0 0 0 2px rgba(71, 85, 105, 0.22); } /* ===== 夜间主题适配 ===== */ .app-container.theme-night .t-sidebar { background: #0b0f1a; border-right-color: rgba(255, 255, 255, 0.06); color: #e2e8f0; } .app-container.theme-night .t-zone__serial { color: rgba(226, 232, 240, 0.32); } .app-container.theme-night .t-zone__label { color: rgba(226, 232, 240, 0.5); } .app-container.theme-night .t-item { color: rgba(226, 232, 240, 0.7); } .app-container.theme-night .t-item:hover, .app-container.theme-night .t-item:focus-visible, .app-container.theme-night .t-item.is-active { color: #f8fafc; } .app-container.theme-night .t-item:focus-visible { background: rgba(255, 255, 255, 0.04); } .app-container.theme-night .t-item.is-active .t-item__rail { background: #f8fafc; } .app-container.theme-night .t-item__badge { background: rgba(255, 255, 255, 0.08); color: rgba(226, 232, 240, 0.65); } .app-container.theme-night .t-item.is-active .t-item__badge { background: #f8fafc; color: #0b0f1a; } .app-container.theme-night .t-sidebar__foot { border-top-color: rgba(255, 255, 255, 0.06); } .app-container.theme-night .t-theme { color: rgba(226, 232, 240, 0.55); } .app-container.theme-night .t-theme:hover { color: #f8fafc; } /* ===== 响应式:窄屏折叠(仅显示分区编号) ===== */ @media (max-width: 960px) { .t-sidebar { width: 64px; } .t-zone__head { padding: 0 12px; gap: 0; flex-direction: column; align-items: center; margin-bottom: 4px; } .t-zone__label { display: none; } .t-item { padding: 8px 12px; justify-content: center; } .t-item__label { display: none; } .t-item__badge { display: none; } .t-item.is-active::after { /* 折叠态用一个圆点表示 active */ content: ''; position: absolute; right: 8px; top: 50%; width: 4px; height: 4px; border-radius: 50%; background: currentColor; transform: translateY(-50%); } .t-theme__label { display: none; } .t-sidebar__foot { padding: 16px 12px 0; } }