/*
 * Quiet Design System — base + components
 * 依赖 tokens.css。所有类名以 q- 开头，避免和项目里已有的样式冲突。
 */

/* =========================================================
   Base
   ========================================================= */

*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  -webkit-tap-highlight-color: transparent;
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar) transparent;
}

html {
  background: var(--bg-page);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-body);
  color: var(--text-primary);
  font-synthesis-weight: none; /* 不让浏览器伪造粗体 */
  text-autospace: normal; /* 中文和西文、数字之间自动留出空隙（新版浏览器支持，旧版忽略） */
}

a {
  color: inherit;
  text-decoration: inherit;
}

::selection {
  color: var(--selection-text);
  background: var(--selection-bg);
}

/* 键盘焦点环（原站点没有统一的焦点样式，这是为可访问性补充的） */
:focus-visible {
  outline: 2px solid var(--text-primary);
  outline-offset: 2px;
}

/* =========================================================
   Top bar — 顶部面包屑栏
   ========================================================= */

.q-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: var(--space-1);
  height: var(--topbar-height);
  padding: 0 var(--space-3);
  background: var(--bg-page);
}

.q-topbar a {
  padding: var(--space-2);
  font-weight: var(--weight-medium);
  line-height: 24px;
  color: var(--text-primary);
}

.q-topbar-sep {
  font-weight: var(--weight-medium);
  color: var(--text-quaternary);
  opacity: var(--separator-opacity);
  user-select: none;
}

/* 把它后面的东西推到顶栏最右（比如一个图标按钮） */
.q-topbar-end {
  margin-left: auto;
}

/* 圆形图标按钮：平时完全透明，悬停才出现底色 */
.q-icon-button {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: var(--control-size);
  height: var(--control-size);
  padding: 0;
  border: 0;
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--text-primary);
  cursor: pointer;
  user-select: none;
  transition: background-color var(--duration) var(--ease);
}

.q-icon-button:hover {
  background: var(--bg-hover);
}

/* =========================================================
   Nav overlay — 全屏导航
   ========================================================= */

.q-nav {
  position: fixed;
  inset: 0;
  top: 44px;
  z-index: 20;
  overflow-y: auto;
  padding: var(--space-6);
  background: var(--bg-page);
}

.q-nav[hidden] {
  display: none;
}

.q-nav-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.q-nav-group + .q-nav-group {
  margin-top: var(--space-8);
}

.q-nav-label {
  margin-bottom: var(--space-2);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--text-quaternary);
}

.q-nav-link {
  padding: var(--space-2) 0;
  font-size: var(--text-xl);
  font-weight: var(--weight-semibold);
  line-height: 28px;
  color: var(--text-tertiary);
}

.q-nav-link:hover,
.q-nav-link[aria-current="page"] {
  color: var(--text-primary);
}

/* =========================================================
   Page — 单栏内容容器
   ========================================================= */

.q-page {
  display: flex;
  flex-direction: column;
  gap: var(--space-16);
  width: 100%;
  max-width: var(--measure);
  margin: 0 auto;
  padding: var(--space-16) var(--space-4);
}

.q-page--narrow {
  max-width: var(--measure-narrow);
}

/* 文章页、应用页：更宽、区块更紧凑 */
.q-page--article,
.q-page--app {
  max-width: var(--measure-wide);
  gap: var(--space-8);
  padding: var(--space-12) var(--space-4);
}

@media (min-width: 640px) {
  /* 介绍页（首页、产品页、个人主页）：上下留白翻倍 */
  .q-page--airy {
    padding-top: var(--space-32);
    padding-bottom: var(--space-32);
  }
}

@media (min-width: 768px) {
  .q-page--article,
  .q-page--app {
    padding-left: var(--space-6);
    padding-right: var(--space-6);
  }
}

@media (min-width: 1024px) {
  .q-page--article,
  .q-page--app {
    padding: var(--space-16) var(--space-8);
  }
}

@media (min-width: 1280px) {
  .q-page--article {
    padding-top: var(--space-20);
    padding-bottom: var(--space-20);
  }
}

/* =========================================================
   Section — 分组：灰色小标签 + 内容
   ========================================================= */

.q-section {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.q-section-label {
  margin: 0;
  font-size: var(--text-base);
  font-weight: var(--weight-regular);
  line-height: var(--leading-body);
  color: var(--text-label);
  user-select: none;
}

/* =========================================================
   Typography
   ========================================================= */

/* 页面标题 */
.q-title {
  margin: 0;
  font-size: var(--text-title);
  font-weight: var(--weight-bold);
  line-height: var(--leading-title);
  letter-spacing: var(--tracking-title);
  color: var(--text-primary);
}

@media (min-width: 768px) {
  .q-title {
    font-size: var(--text-title-md);
  }
}

@media (min-width: 1024px) {
  .q-title {
    font-size: var(--text-title-lg);
  }
}

/* 引言段落：大号、中等字重、次级灰 */
.q-lead {
  margin: 0;
  font-size: var(--text-2xl);
  font-weight: var(--weight-medium);
  line-height: var(--leading-lead);
  color: var(--text-secondary);
  text-wrap: pretty;
}

/* 日期等元信息 */
.q-meta {
  margin: 0;
  color: var(--text-tertiary);
}

/* 正文链接：颜色继承，只靠 2px 灰色下划线表明可点 */
.q-link {
  color: inherit;
  text-decoration-line: underline;
  text-decoration-thickness: 2px;
  text-decoration-color: var(--text-quaternary);
  text-underline-offset: var(--underline-offset);
  word-break: break-word;
}

.q-link:hover {
  color: var(--text-primary);
}

/* 头像 */
.q-avatar {
  display: block;
  width: var(--avatar-size);
  height: var(--avatar-size);
  margin-bottom: var(--space-8);
  border-radius: var(--radius-full);
  object-fit: cover;
  user-select: none;
}

/* =========================================================
   List — 这套设计的核心组件
   每行：[图标] 主文字 灰色附注 ………… 等宽日期
   ========================================================= */

.q-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  margin: 0;
  padding: 0;
  list-style: none;
}

.q-list > li {
  display: flex;
}

/* 带图标的列表在手机上每行占三四行高，行距要拉开才分得清 */
.q-list:has(.q-row-icon) {
  gap: var(--space-8);
}

/* 可选：把主文字和附注包起来，手机上它们并排，桌面端这层包装自动消失 */
.q-row-main {
  display: flex;
  flex-wrap: wrap; /* 手机上放不下时，附注整个换到下一行，不把主文字挤断 */
  align-items: center;
  gap: 0 var(--space-2);
}

.q-row {
  display: inline-flex;
  flex: 1;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
  min-width: 0;
  font-size: var(--text-xl);
  line-height: var(--leading-body);
}

.q-row-icon {
  flex: none;
  width: var(--row-icon-mobile);
  height: var(--row-icon-mobile);
  margin-bottom: var(--space-2);
  border-radius: var(--radius-sm);
  user-select: none;
}

.q-row-title {
  font-weight: var(--weight-medium);
  color: var(--text-primary);
  text-underline-offset: var(--underline-offset-row);
}

.q-row-meta {
  color: var(--text-quaternary);
}

.q-row-date {
  font-family: var(--font-mono);
  font-size: var(--text-mono);
  color: var(--text-quaternary);
  opacity: 0.8;
  white-space: nowrap;
}

/* 行尾的控件（开关、按钮），推到最右 */
.q-row > .q-row-end {
  flex: none;
  margin-left: auto;
}

/* 手机上也保持一行（行尾有控件时用） */
.q-row--inline {
  flex-direction: row;
  align-items: center;
  gap: var(--space-3);
}

.q-row--inline .q-row-main {
  flex: 1;
  flex-wrap: wrap;
  row-gap: 0;
  min-width: 0;
}

/* 外链的小箭头等行内图标 */
.q-row-glyph {
  flex: none;
  color: var(--text-quaternary);
}

@media (hover: hover) {
  /* 悬停只给主文字加下划线，不变色、不加底色。不是链接的行（<div class="q-row">）没有悬停效果 */
  a.q-row:hover .q-row-title {
    text-decoration-line: underline;
  }
}

@media (min-width: 640px) {
  .q-list,
  .q-list:has(.q-row-icon) {
    gap: var(--space-1-5);
  }

  .q-row-main {
    display: contents;
  }

  .q-row {
    flex-direction: row;
    align-items: center;
    gap: var(--space-2);
  }

  .q-row-icon {
    width: var(--row-icon);
    height: var(--row-icon);
    margin-bottom: 0;
    margin-right: var(--space-1);
  }

  .q-row-title {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 1;
    line-clamp: 1;
  }

  /* 让附注占满剩余宽度，把日期推到最右 */
  .q-row-meta--fill,
  .q-row-title--fill {
    flex: 1;
  }

  .q-row-date {
    margin-left: auto;
    padding-left: var(--space-3);
  }
}

/* =========================================================
   Icon links — 一排社交图标
   ========================================================= */

.q-icon-links {
  display: flex;
  gap: var(--space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.q-icon-link {
  display: inline-flex;
  padding: var(--space-2);
  color: var(--text-quaternary);
  transition: color var(--duration) var(--ease);
}

.q-icon-links > li:first-child .q-icon-link {
  margin-left: calc(var(--space-2) * -1); /* 图标视觉上和文字左对齐 */
}

.q-icon-link:hover {
  color: var(--text-primary);
}

.q-icon-link svg {
  width: 28px;
  height: 28px;
}

/* =========================================================
   Prose — 文章正文
   ========================================================= */

.q-prose {
  display: flex;
  flex-direction: column;
  gap: var(--gap-paragraph);
  min-width: 0;
  font-size: var(--text-lg);
  line-height: var(--leading-prose);
  color: var(--text-primary);
}

.q-prose > * {
  margin: 0;
}

.q-section > .q-prose > :first-child {
  margin-top: 0;
}

.q-prose a {
  color: inherit;
  text-decoration-line: underline;
  text-decoration-thickness: 2px;
  text-decoration-color: var(--text-quaternary);
  text-underline-offset: var(--underline-offset);
  word-break: break-word;
}

.q-prose h2 {
  /* 原站点文章里没出现 h2，这里按 h3 的规律外推 */
  margin-top: var(--space-6);
  font-size: var(--text-2xl);
  font-weight: var(--weight-bold);
  line-height: 1.3;
}

.q-prose h3 {
  margin-top: var(--space-5);
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
}

/* 中文没有斜体，硬倾斜很难看：强调改用中等字重 */
.q-prose em:lang(zh) {
  font-style: normal;
  font-weight: var(--weight-medium);
}

.q-prose ul,
.q-prose ol {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding-left: 1.25em;
}

.q-prose ul {
  list-style: disc;
}

.q-prose ol {
  list-style: decimal;
}

.q-prose blockquote {
  padding-left: var(--space-5);
  border-left: 3px solid var(--border-primary);
  color: var(--text-tertiary);
}

.q-prose hr {
  width: 100%;
  margin: var(--space-6) 0;
  border: 0;
  border-top: 1px solid var(--border-primary);
}

.q-prose code {
  padding: var(--space-0-5) var(--space-1);
  border-radius: var(--radius-sm);
  background: var(--bg-tertiary);
  font-family: var(--font-mono);
  font-size: var(--text-base);
}

.q-prose pre {
  /* 原站点用截图展示代码，这里按行内代码的规律外推 */
  overflow-x: auto;
  padding: var(--space-4);
  border-radius: var(--radius-lg);
  background: var(--bg-tertiary);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  line-height: 1.6;
}

.q-prose pre code {
  padding: 0;
  background: none;
  font-size: inherit;
}

.q-prose img,
.q-prose video {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius-lg);
}

/* =========================================================
   Pill — 小号的浮起按钮（点赞、计数、翻页）。大一号的见 .q-button
   ========================================================= */

.q-pill {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  height: var(--pill-height);
  padding: 0 var(--space-3);
  border: 0;
  border-radius: var(--radius-full);
  background: var(--bg-elevated);
  box-shadow: var(--shadow-pill);
  color: var(--text-quaternary);
  font-family: inherit;
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  font-variant-numeric: tabular-nums;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  transition: background-color var(--duration) var(--ease);
}

/* 带图标时左侧收紧一点，图标和文字在视觉上才居中 */
.q-pill:has(svg) {
  padding: 0 10px 0 8px;
}

.q-pill:hover {
  background: var(--bg-secondary);
}

.q-pill:disabled {
  pointer-events: none;
}

/* =========================================================
   Dividers — 两种分隔方式，都很克制
   ========================================================= */

/* 斜纹带：横跨整个视口，分开"正文"和"延伸阅读" */
.q-hatch {
  height: 8px;
  background-image: linear-gradient(
    -45deg,
    transparent 48%,
    var(--hatch) 48%,
    var(--hatch) 52%,
    transparent 52%
  );
  background-size: 4px 4px;
}

/* 强调短线：全站唯一用到品牌色的地方，放在分组标签上方 */
.q-tick {
  width: 20px;
  height: 4px;
  border-radius: var(--radius-full);
  background: var(--brand);
}

/* 短线下面的标签比普通分组标签深一级 */
.q-tick + .q-section-label {
  color: var(--text-tertiary);
}

/* =========================================================
   Header — 页面标题和它右边的操作
   ========================================================= */

.q-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

/* 一排按钮 */
.q-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}

/* =========================================================
   Button — 按钮
   默认是浮起的白色胶囊（和 .q-pill 同一种做法，大一号）；
   主按钮是实心的，一个页面最多一个。
   ========================================================= */

.q-button {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  height: var(--control-size);
  padding: 0 var(--space-4);
  border: 0;
  border-radius: var(--radius-full);
  background: var(--bg-elevated);
  box-shadow: var(--shadow-pill);
  color: var(--text-primary);
  font-family: inherit;
  font-size: var(--text-base);
  font-weight: var(--weight-medium);
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  transition: background-color var(--duration) var(--ease),
    color var(--duration) var(--ease);
}

.q-button:hover {
  background: var(--bg-tertiary);
}

.q-button--primary {
  background: var(--bg-inverse);
  box-shadow: none;
  color: var(--text-inverse);
}

.q-button--primary:hover {
  background: var(--bg-inverse-hover);
}

/* 次要操作：平时只有文字，悬停才出现底色（和图标按钮同一种做法） */
.q-button--ghost {
  background: transparent;
  box-shadow: none;
  color: var(--text-tertiary);
}

.q-button--ghost:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

/* 危险操作：只把文字换成红色，不做红色的实心按钮 */
.q-button--danger {
  color: var(--danger);
}

.q-button:disabled,
.q-button[aria-disabled="true"] {
  opacity: 0.4;
  pointer-events: none;
}

/* =========================================================
   Form — 表单
   输入框没有边框，只有一层浅灰底色（和行内代码同一种灰）。
   ========================================================= */

.q-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

.q-field {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.q-field-label {
  font-weight: var(--weight-medium);
  color: var(--text-primary);
}

.q-field-hint,
.q-field-error {
  margin: 0;
  font-size: var(--text-sm);
  color: var(--text-tertiary);
}

.q-field-error {
  color: var(--danger);
}

.q-input,
.q-textarea,
.q-select {
  width: 100%;
  height: var(--field-height);
  margin: 0;
  padding: 0 var(--space-3);
  border: 0;
  border-radius: var(--radius-lg);
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
  font-family: inherit;
  font-size: var(--text-base); /* 不小于 16px，手机上点进去才不会自动放大 */
  line-height: var(--leading-body);
}

.q-input::placeholder,
.q-textarea::placeholder {
  color: var(--text-quaternary);
  opacity: 1;
}

.q-input:focus-visible,
.q-textarea:focus-visible,
.q-select:focus-visible {
  outline-offset: 0;
}

.q-input[aria-invalid="true"],
.q-textarea[aria-invalid="true"],
.q-select[aria-invalid="true"] {
  outline: 2px solid var(--danger);
  outline-offset: 0;
}

.q-textarea {
  height: auto;
  min-height: 96px;
  padding: var(--space-2) var(--space-3);
  resize: vertical;
}

.q-select {
  appearance: none;
  padding-right: var(--space-8);
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%),
    linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: right 17px center, right 12px center;
  background-size: 5px 5px;
  background-repeat: no-repeat;
  cursor: pointer;
}

.q-input:disabled,
.q-textarea:disabled,
.q-select:disabled {
  opacity: 0.5;
}

/* 单选、多选：用浏览器自带的控件，只把颜色改成主文字色 */
.q-check {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  cursor: pointer;
}

.q-check input {
  flex: none;
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--text-primary);
}

/* 一组单选或多选，横着排，放不下就换行 */
.q-checks {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-5);
}

/* 开关：<input type="checkbox" class="q-switch"> */
.q-switch {
  appearance: none;
  position: relative;
  flex: none;
  width: 36px;
  height: 20px;
  margin: 0;
  border-radius: var(--radius-full);
  background: var(--text-quaternary);
  cursor: pointer;
  transition: background-color var(--duration) var(--ease);
}

.q-switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: var(--radius-full);
  background: var(--bg-page);
  transition: transform var(--duration) var(--ease);
}

.q-switch:checked {
  background: var(--text-primary);
}

.q-switch:checked::after {
  transform: translateX(16px);
}

/* =========================================================
   Tabs — 标签页
   和导航链接同一种做法：灰色文字，当前项变成主色。没有下划线和底色。
   ========================================================= */

.q-tabs {
  display: flex;
  gap: var(--space-5);
  overflow-x: auto;
}

.q-tab {
  flex: none;
  padding: 0;
  border: 0;
  background: none;
  color: var(--text-tertiary);
  font-family: inherit;
  font-size: var(--text-base);
  font-weight: var(--weight-medium);
  line-height: var(--leading-body);
  white-space: nowrap;
  cursor: pointer;
  transition: color var(--duration) var(--ease);
}

.q-tab:hover,
.q-tab[aria-current="page"],
.q-tab[aria-selected="true"] {
  color: var(--text-primary);
}

/* =========================================================
   Stats — 数据概览
   灰色小标签在上，大号数字在下。
   ========================================================= */

.q-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--space-6) var(--space-8);
  margin: 0;
}

.q-stat {
  display: flex;
  flex-direction: column;
}

.q-stat-label {
  color: var(--text-label);
}

.q-stat-value {
  margin: 0;
  font-size: var(--text-title);
  font-weight: var(--weight-bold);
  line-height: var(--leading-title);
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
}

/* =========================================================
   Table — 表格
   就是把列对齐了的列表：表头是灰色小标签，没有边框和斑马纹。
   ========================================================= */

.q-table-wrap {
  overflow-x: auto;
}

.q-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-base);
  line-height: var(--leading-body);
}

.q-table th,
.q-table td {
  padding: 5px var(--space-4) 5px 0;
  text-align: left;
  vertical-align: baseline;
}

.q-table th:last-child,
.q-table td:last-child {
  padding-right: 0;
}

.q-table thead th {
  padding-bottom: 11px;
  font-weight: var(--weight-regular);
  color: var(--text-label);
  white-space: nowrap;
  user-select: none;
}

.q-table tbody td:first-child,
.q-table tbody th {
  font-weight: var(--weight-medium);
  color: var(--text-primary);
}

.q-table a:hover {
  text-decoration-line: underline;
  text-underline-offset: var(--underline-offset-row);
}

/* 数字和日期：等宽、右对齐 */
.q-table .q-num {
  font-family: var(--font-mono);
  font-size: 15px;
  text-align: right;
  white-space: nowrap;
}

/* 表头里的「字数」「更新」只跟着右对齐，字体和其他表头一样 */
.q-table thead .q-num {
  font-family: inherit;
  font-size: var(--text-base);
}

/* 次要的一列 */
.q-muted {
  color: var(--text-quaternary);
}

@media (min-width: 640px) {
  .q-table {
    font-size: var(--text-xl);
  }

  .q-table th,
  .q-table td {
    padding-top: 3px;
    padding-bottom: 3px;
  }

  .q-table thead th {
    padding-bottom: 13px;
    font-size: var(--text-base);
  }

  .q-table tbody .q-num {
    font-size: var(--text-mono);
  }
}

/* =========================================================
   Status / Tag — 状态和标签
   ========================================================= */

/* 状态：一个 8px 的圆点加文字。颜色只在圆点上 */
.q-status {
  white-space: nowrap;
}

.q-status::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: var(--space-2);
  border-radius: var(--radius-full);
  background: var(--text-quaternary);
  vertical-align: 0.1em;
}

.q-status--success::before {
  background: var(--success);
}

.q-status--warning::before {
  background: var(--warning);
}

.q-status--danger::before {
  background: var(--danger);
}

/* 标签：和行内代码同一种灰底 */
.q-tag {
  display: inline-block;
  padding: var(--space-0-5) var(--space-1-5);
  border-radius: var(--radius-sm);
  background: var(--bg-tertiary);
  color: var(--text-tertiary);
  font-size: var(--text-sm);
  line-height: 20px;
  white-space: nowrap;
}

/* =========================================================
   Note — 提示
   和引用块同一种做法：左边一条细线，文字是三级灰。
   ========================================================= */

.q-note {
  margin: 0;
  padding-left: var(--space-5);
  border-left: 3px solid var(--border-primary);
  color: var(--text-tertiary);
}

.q-note--danger {
  border-left-color: var(--danger);
}

/* =========================================================
   Dialog — 对话框：<dialog class="q-dialog">
   后面的页面盖上一层半透明的页面底色，不用黑色遮罩。
   ========================================================= */

.q-dialog {
  width: calc(100% - var(--space-8));
  max-width: 448px;
  padding: var(--space-6);
  border: 0;
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
  box-shadow: var(--shadow-pill);
  color: var(--text-primary);
}

.q-dialog::backdrop {
  background: var(--veil);
}

.q-dialog-title {
  margin: 0 0 var(--space-2);
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
}

.q-dialog-body {
  margin: 0;
  color: var(--text-tertiary);
}

.q-dialog .q-form {
  gap: var(--space-4);
}

.q-dialog .q-actions {
  justify-content: flex-end;
  margin-top: var(--space-6);
}

/* =========================================================
   Footer — 页脚：一行灰色小字
   ========================================================= */

.q-footer {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-5);
  margin: 0;
  color: var(--text-tertiary);
}

.q-footer a:hover {
  color: var(--text-primary);
}

/* =========================================================
   Docs — 写文档时用的两个小东西
   ========================================================= */

/* 示例框：上下各一条细线，中间放真实的组件。后面通常跟一段代码 */
.q-demo {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
  min-width: 0;
  padding: var(--space-6) 0;
  border-top: 1px solid var(--border-primary);
  border-bottom: 1px solid var(--border-primary);
}

/* 顶栏和全屏导航放进示例框时，不再粘顶和盖住页面 */
.q-demo .q-topbar,
.q-demo .q-nav {
  position: static;
  z-index: auto;
  padding: 0;
  overflow: visible;
}

/* 色块：<span class="q-swatch" style="--swatch: var(--brand)">，可以当列表行的图标用 */
.q-swatch {
  display: inline-block;
  flex: none;
  width: var(--row-icon);
  height: var(--row-icon);
  border-radius: var(--radius-sm);
  background: var(--swatch, var(--bg-tertiary));
  box-shadow: inset 0 0 0 1px var(--border-primary);
}

/* =========================================================
   Utilities
   ========================================================= */

.q-stack {
  display: flex;
  flex-direction: column;
  gap: var(--gap-paragraph);
}

.q-stack--loose {
  gap: var(--space-6);
}

.q-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
