/*
 * 组件层：卡片、按钮、标签、终端块、表格、引导链、时间线。
 * 这些组件在四个内容页与文档页之间复用，样式只在这里定义一次。
 */

/* ── 卡片 ────────────────────────────────────────────────────────────── */

.card {
  padding: 24px;
  border-radius: var(--radius-window);
  background: var(--page-raised);
  border: 1px solid var(--hairline);
  transition: border-color var(--duration-base) var(--ease-standard),
              background-color var(--duration-base) var(--ease-standard);
}

.card--interactive:hover {
  border-color: color-mix(in srgb, var(--accent) 42%, var(--hairline));
  background: color-mix(in srgb, var(--accent) 6%, var(--page-raised));
}

.card__title {
  font-size: var(--text-title);
  font-weight: var(--weight-semibold);
  margin-bottom: 8px;
}

.card__body {
  color: var(--text-secondary);
  font-size: var(--text-body);
  line-height: 1.62;
}

.card__foot {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--hairline);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

/* ── 标签与徽章 ──────────────────────────────────────────────────────── */

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--hairline);
  background: var(--page-raised);
  font-size: var(--text-caption);
  line-height: 18px;
  color: var(--text-secondary);
  white-space: nowrap;
}

.pill--accent {
  border-color: color-mix(in srgb, var(--accent) 40%, transparent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: color-mix(in srgb, var(--accent) 82%, var(--text-primary));
}

.pill--warn {
  border-color: rgba(240, 178, 92, 0.4);
  background: rgba(240, 178, 92, 0.12);
  color: #f0b25c;
}

/* 证据状态点：已实测用实心，未实现用空心 */
.pill__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

/* ── 按钮 ────────────────────────────────────────────────────────────── */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  font-size: var(--text-body);
  font-weight: var(--weight-medium);
  cursor: pointer;
  transition: transform var(--duration-instant) var(--ease-standard),
              background-color var(--duration-instant) var(--ease-standard),
              border-color var(--duration-instant) var(--ease-standard),
              color var(--duration-instant) var(--ease-standard);
}

.button:active {
  transform: translateY(1px);
}

.button--primary {
  background: var(--accent);
  color: var(--accent-ink);
}

.button--primary:hover {
  color: var(--accent-ink);
  background: color-mix(in srgb, var(--accent) 86%, #fff);
}

.button--ghost {
  border-color: var(--stroke-outer);
  background: var(--page-raised);
  color: var(--text-primary);
}

.button--ghost:hover {
  color: var(--text-primary);
  border-color: color-mix(in srgb, var(--accent) 46%, var(--stroke-outer));
  background: color-mix(in srgb, var(--accent) 8%, var(--page-raised));
}

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

.button svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ── 终端块：呈现真实串口日志 ─────────────────────────────────────────── */

.terminal {
  border-radius: var(--radius-window);
  border: 1px solid var(--hairline);
  background: var(--page-sunken);
  overflow: hidden;
}

.terminal__bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border-bottom: 1px solid var(--hairline);
  background: var(--page-raised);
  font-size: var(--text-caption);
  color: var(--text-secondary);
}

.terminal__bar-title {
  font-family: var(--font-mono);
  font-size: var(--text-caption);
}

.terminal__body {
  margin: 0;
  padding: 16px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.75;
  color: var(--text-secondary);
  white-space: pre;
  tab-size: 4;
}

/* 内核自身输出的行用主文字色，用户态服务的行稍暗，靠前缀区分来源 */
.terminal__line--kernel {
  color: var(--text-primary);
}

.terminal__line--user {
  color: var(--text-secondary);
}

/* ── 证据列表 ────────────────────────────────────────────────────────── */

.evidence {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.evidence__item {
  display: block;
  padding: 7px 12px;
  border-radius: var(--radius-menu);
  border: 1px solid var(--hairline);
  background: var(--page-sunken);
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--text-secondary);
  overflow-wrap: anywhere;
}

/* ── 数据表 ──────────────────────────────────────────────────────────── */

.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-window);
  border: 1px solid var(--hairline);
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-body);
}

.table th,
.table td {
  padding: 12px 16px;
  text-align: start;
  vertical-align: top;
  border-bottom: 1px solid var(--hairline);
}

.table thead th {
  background: var(--page-raised);
  color: var(--text-primary);
  font-weight: var(--weight-semibold);
  font-size: var(--text-caption);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}

.table tbody tr:last-child td {
  border-bottom: 0;
}

.table tbody td {
  color: var(--text-secondary);
}

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

/* ── 技术事实表（首页）───────────────────────────────────────────────── */

/*
 * 技术参数表。用固定三列而不是 auto-fit：auto-fit 会按容器宽度塞下尽量多的列，
 * 六项在宽屏上排成五列，第二行只剩一项、右边空出一块灰底，看着像没写完。
 * 三列两行正好填满，加第七项时也只是末行留一格。
 */
.facts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--hairline);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-window);
  overflow: hidden;
}

@media (max-width: 900px) {
  .facts {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 560px) {
  .facts {
    grid-template-columns: 1fr;
  }
}

.facts__item {
  padding: 20px;
  background: var(--page-base);
}

.facts__label {
  font-size: var(--text-caption);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.facts__value {
  margin-top: 6px;
  font-size: var(--text-headline);
  font-weight: var(--weight-semibold);
  line-height: 1.25;
}

.facts__note {
  margin-top: 6px;
  font-size: var(--text-caption);
  line-height: 1.55;
  color: var(--text-secondary);
}

/* ── 引导链 ──────────────────────────────────────────────────────────── */

.chain {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 1px;
  background: var(--hairline);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-window);
  overflow: hidden;
}

.chain__step {
  position: relative;
  padding: 20px;
  background: var(--page-base);
}

.chain__index {
  font-family: var(--font-mono);
  font-size: var(--text-caption);
  color: var(--accent);
}

.chain__name {
  margin-top: 8px;
  font-size: var(--text-title);
  font-weight: var(--weight-semibold);
}

.chain__role {
  margin-top: 8px;
  font-size: var(--text-caption);
  line-height: 1.6;
  color: var(--text-secondary);
}

/* ── 启动顺序时间线 ──────────────────────────────────────────────────── */

.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  position: relative;
}

.timeline::before {
  content: "";
  position: absolute;
  top: 6px;
  bottom: 6px;
  left: 7px;
  width: 1px;
  background: var(--hairline);
}

.timeline__item {
  position: relative;
  padding: 0 0 26px 32px;
}

.timeline__item:last-child {
  padding-bottom: 0;
}

.timeline__item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 6px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 1px solid var(--stroke-outer);
  background: var(--glass-surface-solid);
}

/* 已实测的环节用强调色填充，未实现的保持空心 */
.timeline__item--done::before {
  background: var(--accent);
  border-color: var(--accent);
}

.timeline__name {
  font-size: var(--text-title);
  font-weight: var(--weight-medium);
}

.timeline__detail {
  margin-top: 6px;
  color: var(--text-secondary);
  font-size: var(--text-body);
  max-width: var(--measure);
}

.timeline__evidence {
  display: inline-block;
  margin-top: 10px;
  padding: 5px 10px;
  border-radius: var(--radius-menu);
  border: 1px solid var(--hairline);
  background: var(--page-sunken);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-secondary);
  overflow-wrap: anywhere;
}

/* ── 空态与提示条 ────────────────────────────────────────────────────── */

.notice {
  padding: 18px 22px;
  border-radius: var(--radius-window);
  border: 1px solid color-mix(in srgb, var(--accent) 32%, var(--hairline));
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  font-size: var(--text-body);
  line-height: 1.62;
}

.notice__title {
  font-weight: var(--weight-semibold);
  margin-bottom: 6px;
  color: var(--text-primary);
}

.notice--warn {
  border-color: rgba(240, 178, 92, 0.36);
  background: rgba(240, 178, 92, 0.09);
}

/* ── 复制按钮（校验和用）─────────────────────────────────────────────── */

.copy-field {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-menu);
  border: 1px solid var(--hairline);
  background: var(--page-sunken);
}

.copy-field__value {
  flex: 1;
  min-width: 0;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--text-secondary);
  overflow-wrap: anywhere;
}

.copy-field__button {
  flex-shrink: 0;
  padding: 6px 12px;
  border-radius: var(--radius-menu);
  border: 1px solid var(--stroke-outer);
  background: var(--page-raised);
  color: var(--text-primary);
  font-size: var(--text-caption);
  font-weight: var(--weight-medium);
  cursor: pointer;
  transition: border-color var(--duration-instant) var(--ease-standard);
}

.copy-field__button:hover {
  border-color: color-mix(in srgb, var(--accent) 46%, var(--stroke-outer));
}
