/* 卡密系统 - Apple 风格设计令牌
   4px 基准间距 / 18px 卡片圆角 / 12px 输入框圆角 */

:root {
  /* 浅色 */
  --bg: #F5F5F7;
  --card: #FFFFFF;
  --text: #1D1D1F;
  --text-2: #6E6E73;
  --accent: #0071E3;
  --accent-hover: #0077ED;
  --success: #34C759;
  --warning: #FF9500;
  --danger: #FF3B30;
  --border: rgba(0, 0, 0, 0.08);
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
  --input-bg: rgba(0, 0, 0, 0.03);
  --code-bg: #F5F5F7;
  --radius-card: 18px;
  --radius-input: 12px;
  --radius-btn: 12px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
}

[data-theme="dark"] {
  --bg: #000000;
  --card: #1C1C1E;
  --text: #F5F5F7;
  --text-2: #98989D;
  --accent: #0A84FF;
  --accent-hover: #409CFF;
  --success: #30D158;
  --warning: #FF9F0A;
  --danger: #FF453A;
  --border: rgba(255, 255, 255, 0.12);
  --shadow: none;
  --input-bg: rgba(255, 255, 255, 0.06);
  --code-bg: #2C2C2E;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 15px;
  line-height: 1.6;
  transition: background-color .25s ease, color .25s ease;
}

/* ---------- 布局 ---------- */
.page {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px 20px 64px;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 40px;
  min-height: 44px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.2px;
}

.brand img { width: 28px; height: 28px; border-radius: 7px; object-fit: cover; }

.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}
.shop-entry {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 17px;
  border: 1px solid rgba(0, 113, 227, .18);
  border-radius: 999px;
  background: rgba(0, 113, 227, .08);
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: background-color .15s ease, border-color .15s ease, transform .15s ease;
}
.shop-entry-icon {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.shop-entry:hover {
  background: rgba(0, 113, 227, .14);
  border-color: rgba(0, 113, 227, .3);
  color: var(--accent-hover);
  transform: translateY(-1px);
}
@media (max-width: 480px) {
  .header-actions { gap: 10px; }
  .shop-entry { min-height: 40px; padding: 0 12px; font-size: 13px; }
  .shop-entry-icon { width: 17px; height: 17px; }
}

/* ---------- 卡片与组件 ---------- */
.card {
  background: var(--card);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  padding: 32px 28px;
}

[data-theme="dark"] .card { border-color: var(--border); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 24px;
  border: none;
  border-radius: var(--radius-btn);
  background: var(--accent);
  color: #fff;
  font-family: var(--font);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color .15s ease, transform .1s ease;
  text-decoration: none;
}
.btn:hover { background: var(--accent-hover); }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .4; cursor: default; }
.btn.secondary {
  background: var(--input-bg);
  color: var(--text);
}
.btn.danger { background: var(--danger); }
.btn.small { min-height: 36px; padding: 0 16px; font-size: 13px; }

.input {
  width: 100%;
  min-height: 44px;
  padding: 10px 16px;
  border: 1px solid transparent;
  border-radius: var(--radius-input);
  background: var(--input-bg);
  color: var(--text);
  font-family: var(--mono);
  font-size: 16px;
  letter-spacing: 1px;
  outline: none;
  transition: border-color .15s ease, background-color .15s ease;
}
.input:focus { border-color: var(--accent); }

.field {
  width: 100%;
  min-height: 40px;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-input);
  background: var(--card);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  outline: none;
}
.field:focus { border-color: var(--accent); }
textarea.field { min-height: 96px; resize: vertical; line-height: 1.5; }

select.field { appearance: none; cursor: pointer; }

.label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 6px;
}

/* ---------- 主题切换 ---------- */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--input-bg);
  border: none;
  color: var(--text);
  cursor: pointer;
  font-size: 18px;
}

/* ---------- 提示 ---------- */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-input);
  font-size: 14px;
  margin-top: 16px;
}
.alert.error { background: rgba(255, 59, 48, .1); color: var(--danger); }
.alert.ok { background: rgba(52, 199, 89, .1); color: var(--success); }
.alert.warn { background: rgba(255, 149, 0, .1); color: var(--warning); }

/* ---------- 兑换区 ---------- */
.redeem-box {
  max-width: 520px;
  margin: 0 auto;
  text-align: center;
  /* 垂直居中：视口中间 */
  min-height: calc(100vh - 180px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* Vue 渲染前隐藏插值，避免乱码/闪烁 */
[v-cloak] { display: none !important; }
.redeem-title { font-size: 28px; font-weight: 700; letter-spacing: -0.5px; margin-bottom: 8px; }
.redeem-sub { color: var(--text-2); font-size: 15px; margin-bottom: 24px; }
.redeem-row { display: flex; gap: 12px; }
.redeem-row .input { flex: 1; text-align: center; font-size: 18px; }

/* ---------- 授权内容区 ---------- */
.section { margin-top: 24px; }
.section-title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.3px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-title .tag {
  font-size: 12px;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 99px;
  background: rgba(52, 199, 89, .12);
  color: var(--success);
}
.section-title .section-hint {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 24px;
  padding: 3px 9px;
  border: 1px solid rgba(52, 199, 89, .22);
  border-radius: 999px;
  background: rgba(52, 199, 89, .08);
  color: var(--success);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.2;
  white-space: nowrap;
}
.section-title .section-hint i {
  width: 6px;
  height: 6px;
  flex: 0 0 6px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 3px rgba(52, 199, 89, .12);
}
@media (max-width: 480px) {
  .section-title { align-items: flex-start; flex-wrap: wrap; }
  .section-title .section-hint { white-space: normal; }
}

.content-box {
  background: var(--code-bg);
  border-radius: var(--radius-input);
  padding: 16px;
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.6;
  word-break: break-all;
  white-space: pre-wrap;
  min-height: 88px;
}

.content-link {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: rgba(0, 113, 227, .35);
  text-underline-offset: 2px;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.content-link:hover { color: var(--accent-hover); text-decoration-color: currentColor; }

/* 复制按钮自身反馈 */
.btn .icon-check { display: none; }
.btn.copied { background: var(--success); }
.btn.copied .icon-check { display: inline; }
.btn.copied .icon-copy { display: none; }

/* ---------- 教程 ---------- */
.tutorial-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 20px;
  margin-bottom: 12px;
  background: var(--card);
}
.tutorial-item h3 { font-size: 16px; margin-bottom: 4px; }
.tutorial-item .meta { color: var(--text-2); font-size: 13px; margin-bottom: 12px; }
.tutorial-body { font-size: 14px; line-height: 1.75; }
.tutorial-body img { max-width: 100%; border-radius: 8px; margin: 12px 0; }
.tutorial-body img.tutorial-image-preview { cursor: zoom-in; }
.image-preview-mask {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
  background: rgba(0, 0, 0, .78);
  cursor: zoom-out;
}
.image-preview-image {
  max-width: min(94vw, 1400px);
  max-height: 88vh;
  object-fit: contain;
  border-radius: 10px;
  box-shadow: 0 18px 60px rgba(0, 0, 0, .35);
  cursor: default;
}
.image-preview-close {
  position: absolute;
  top: 18px;
  right: 22px;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, .3);
  border-radius: 50%;
  background: rgba(0, 0, 0, .35);
  color: #fff;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}
.image-preview-close:hover { background: rgba(255, 255, 255, .18); }
.tutorial-body code {
  background: var(--code-bg);
  padding: 2px 6px;
  border-radius: 6px;
  font-family: var(--mono);
  font-size: 13px;
}
.tutorial-body pre {
  background: var(--code-bg);
  padding: 14px;
  border-radius: 8px;
  overflow-x: auto;
  margin: 12px 0;
}
.tutorial-body pre code { padding: 0; background: none; }
.tutorial-body a { color: var(--accent); }
.tutorial-body blockquote {
  border-left: 3px solid var(--border);
  padding-left: 14px;
  color: var(--text-2);
  margin: 12px 0;
}
.tutorial-body ul, .tutorial-body ol { padding-left: 24px; margin: 8px 0; }

/* ---------- 群组 ---------- */
.group-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}
.group-card {
  text-align: center;
  padding: 20px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--card);
}
.group-card img { width: 120px; height: 120px; border-radius: 12px; object-fit: cover; }
.group-card .gname { font-weight: 600; font-size: 14px; margin: 12px 0 4px; }
.group-card .gplatform { color: var(--text-2); font-size: 12px; margin-bottom: 12px; }

/* ---------- 2FA ---------- */
.twofa-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 32px;
}
.totp-code {
  font-family: var(--mono);
  font-size: 44px;
  font-weight: 600;
  letter-spacing: 8px;
  margin: 8px 0;
  font-variant-numeric: tabular-nums;
}
.totp-timer {
  width: 120px;
  height: 4px;
  border-radius: 2px;
  background: var(--input-bg);
  overflow: hidden;
  margin: 8px auto 20px;
}
.totp-timer-bar {
  height: 100%;
  background: var(--accent);
  transition: width 1s linear;
}
.totp-remaining { color: var(--text-2); font-size: 13px; margin-top: 8px; }

/* ---------- 表格（后台） ---------- */
.table-wrap { overflow-x: auto; }
table.tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
.tbl th {
  text-align: left;
  font-weight: 600;
  color: var(--text-2);
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.tbl td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.tbl tr:last-child td { border-bottom: none; }

/* 状态徽章 */
.badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 99px;
  white-space: nowrap;
}
.badge.issued { background: rgba(142,142,147,.15); color: var(--text-2); }
.badge.active { background: rgba(0,113,227,.12); color: var(--accent); }
.badge.redeemed { background: rgba(52,199,89,.12); color: var(--success); }
.badge.locked { background: rgba(255,149,0,.15); color: var(--warning); }
.badge.revoked, .badge.void { background: rgba(255,59,48,.12); color: var(--danger); }

/* ---------- 后台布局 ---------- */
.admin-shell { display: flex; min-height: 100vh; }
.admin-side {
  width: 220px;
  flex-shrink: 0;
  background: var(--card);
  border-right: 1px solid var(--border);
  padding: 20px 12px;
  /* 固定侧栏：随滚动吸附在顶部，不受主内容长度影响 */
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  box-sizing: border-box;
}
.admin-side nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 10px;
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
  margin-bottom: 2px;
}
.admin-side nav a:hover { background: var(--input-bg); }
.admin-side nav a.active { background: var(--accent); color: #fff; }
.admin-main { flex: 1; padding: 28px 32px; min-width: 0; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}
.stat {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 20px;
}
.stat .num { font-size: 28px; font-weight: 700; letter-spacing: -0.5px; }
.stat .lbl { color: var(--text-2); font-size: 13px; }

.toolbar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 20px;
}
.toolbar .field { width: auto; min-width: 160px; }

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

/* 模态框 */
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
}
.modal {
  background: var(--card);
  border-radius: var(--radius-card);
  padding: 28px;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
}
.modal h3 { margin-bottom: 20px; font-size: 18px; }
.modal .actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 24px; }

/* Markdown 编辑器 */
.md-editor {
  width: 100%;
  min-height: 260px;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.7;
  padding: 14px;
  border-radius: var(--radius-input);
  border: 1px solid var(--border);
  background: var(--input-bg);
  color: var(--text);
  resize: vertical;
  outline: none;
}

/* 系统设置：按窗口高度组织桌面布局 */
.settings-layout {
  display: grid;
  grid-template-columns: minmax(380px, 1.15fr) minmax(320px, .85fr);
  grid-template-areas:
    "security appearance"
    "security log";
  gap: 20px;
  align-items: start;
}
.settings-security { grid-area: security; }
.settings-appearance { grid-area: appearance; }
.settings-log { grid-area: log; }

@media (max-width: 860px) {
  .settings-layout {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-areas:
      "security"
      "appearance"
      "log";
  }
}

/* 教程编辑器：字号选择和关联产品状态 */
.md-size-select { min-width: 116px; font-size: 13px; cursor: pointer; }
.tutorial-product-status-list {
  display: grid;
  gap: 6px;
  margin-top: 10px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-input);
  background: var(--code-bg);
}
.tutorial-product-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
}
.tutorial-product-status-row .field { width: 92px; min-width: 92px; min-height: 34px; }

/* 登录页：窗口在视口正中 */
.login-wrap {
  width: min(380px, calc(100vw - 32px));
  max-width: 380px;
  margin: 0;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}
.login-wrap .card { width: 100%; }

/* Toast（非打断式） */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  background: var(--text);
  color: var(--bg);
  padding: 10px 22px;
  border-radius: 99px;
  font-size: 14px;
  font-weight: 500;
  opacity: 0;
  transition: opacity .2s ease, transform .2s ease;
  pointer-events: none;
  z-index: 200;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- 响应式 ---------- */
@media (max-width: 640px) {
  .page { padding: 16px 16px 48px; }
  .card { padding: 24px 20px; border-radius: 14px; }
  .redeem-row { flex-direction: column; }
  .totp-code { font-size: 36px; letter-spacing: 5px; }
  .admin-shell { flex-direction: column; }
  .admin-side { width: 100%; border-right: none; border-bottom: 1px solid var(--border); }
  .admin-main { padding: 20px 16px; }
  .group-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
}

/* Markdown 高亮与任务列表 */
.tutorial-body mark {
  background: #FFE58F;
  color: #4A3400;
  border-radius: 3px;
  padding: 0 3px;
}
[data-theme="dark"] .tutorial-body mark {
  background: #8A6800;
  color: #FFF3B0;
}
.tutorial-body .task-list {
  list-style: none;
  padding-left: 8px;
}
.tutorial-body .task-list li label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.tutorial-body .task-list input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.cards-toolbar {
  margin-top: 36px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}
.cards-search, .redemption-search { min-width: 220px !important; }
.redemption-table-wrap { overflow-x: auto; }
.redemption-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
}
.redemption-table th,
.redemption-table td { padding: 10px 7px; }
.redemption-table .col-check { width: 3%; text-align: center; }
.redemption-table .col-code { width: 18%; }
.redemption-table .col-product { width: 10%; }
.redemption-table .col-batch { width: 9%; }
.redemption-table .col-status { width: 8%; }
.redemption-table .col-time { width: 13%; white-space: normal; }
.redemption-table .col-ip { width: 13%; }
.redemption-table .col-count { width: 7%; text-align: center; }
.redemption-table .col-action { width: 7%; }
.redemption-code-cell,
.redemption-ip { vertical-align: middle; min-width: 0; }
.redemption-code {
  margin-bottom: 5px;
  overflow-wrap: anywhere;
  word-break: break-all;
  line-height: 1.3;
  font-family: var(--mono);
  font-size: 12px;
}
.redemption-code-cell .btn,
.redemption-ip .btn { margin-top: 3px; max-width: 100%; }
.redemption-ip span {
  display: block;
  overflow-wrap: anywhere;
  word-break: break-word;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.3;
}
.redemption-time { white-space: normal; font-size: 12px; line-height: 1.3; }
.redemption-action { white-space: normal; }
@media (max-width: 1100px) {
  .redemption-table { min-width: 900px; table-layout: fixed; }
  .redemption-table .col-code { width: 170px; }
  .redemption-table .col-time { width: 130px; white-space: nowrap; }
}
@media (max-width: 720px) {
  .cards-search, .redemption-search { flex: 1 1 100%; min-width: 0 !important; }
}

/* 关联资源多选面板 */
.picker-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.picker-count {
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
}
.picker-search {
  margin-bottom: 8px;
  min-height: 36px;
  font-size: 13px;
}
.multi-picker {
  max-height: 190px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 6px;
  background: var(--input-bg);
}
.multi-picker-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding: 4px 4px 7px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}
.multi-chip {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 3px 9px;
  border-radius: 99px;
  background: rgba(0,113,227,.12);
  color: var(--accent);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.multi-option {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 42px;
  padding: 6px 9px;
  border-radius: 9px;
  cursor: pointer;
  transition: background .15s ease;
}
.multi-option:hover { background: var(--card); }
.multi-option input { width: 17px; height: 17px; accent-color: var(--accent); flex-shrink: 0; }
.multi-option span { display: flex; flex-direction: column; min-width: 0; }
.multi-option strong { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.multi-option small { color: var(--text-2); font-size: 11px; margin-top: 1px; }
.picker-empty { padding: 18px 8px; color: var(--text-2); font-size: 12px; text-align: center; }

/* 后台卡密内容折叠区域 */
.card-content-cell {
  min-width: 250px;
  max-width: 360px;
  vertical-align: top !important;
}
.card-content-box {
  min-height: 40px;
  max-height: 56px;
  overflow: hidden;
  padding: 9px 11px;
  border-radius: 10px;
  background: var(--code-bg);
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-all;
  transition: max-height .2s ease;
}
.card-content-box.is-expanded {
  max-height: 300px;
  overflow: auto;
}
.card-content-actions {
  display: flex;
  gap: 6px;
  margin-top: 6px;
}

/* 教程卡片入口模式 */
.tutorial-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}
.tutorial-entry-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  min-height: 78px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: border-color .15s ease, background-color .15s ease, transform .15s ease;
  font-family: var(--font);
  text-decoration: none;
}
.tutorial-entry-card:hover {
  border-color: var(--accent);
  background: var(--input-bg);
  transform: translateY(-1px);
}
.tutorial-entry-card span {
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 15px;
  font-weight: 600;
}
.tutorial-entry-card small {
  color: var(--text-2);
  font-size: 12px;
  margin-top: 6px;
}
.tutorial-detail-view {
  position: relative;
  display: flex;
  flex-direction: column;
}
.tutorial-back-btn {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 14px;
  margin-bottom: 18px;
  border: 0;
  border-radius: 9px;
  background: var(--accent);
  color: #fff;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.tutorial-back-btn:hover { background: var(--accent-hover); color: #fff; }
.tutorial-detail-view h2 { font-size: 24px; margin-bottom: 8px; }
.tutorial-window {
  width: min(900px, calc(100% - 40px));
  margin: 40px auto;
  padding: 28px;
}
.tutorial-window-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 18px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--border);
}
.tutorial-window-head h1 { margin: 0 0 6px; font-size: 28px; }
.tutorial-window-close {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--input-bg);
  color: var(--text-2);
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}
.tutorial-window-close:hover { background: var(--text); color: var(--bg); }
.tutorial-modal-mask {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, .48);
}
.tutorial-modal {
  width: min(760px, 100%);
  max-height: min(780px, 90vh);
  overflow: auto;
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--card);
  box-shadow: 0 18px 60px rgba(0, 0, 0, .22);
}
.tutorial-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}
.tutorial-modal-header h2 { margin: 0 0 6px; font-size: 24px; }
.tutorial-modal-close {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--input-bg);
  color: var(--text-2);
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}
.tutorial-modal-close:hover { background: var(--text); color: var(--bg); }
@media (max-width: 560px) {
  .tutorial-window { width: auto; margin: 20px auto; padding: 20px; }
  .tutorial-window-head h1 { font-size: 22px; }
  .tutorial-modal-mask { padding: 12px; align-items: flex-end; }
  .tutorial-modal { max-height: 88vh; padding: 20px; border-radius: 16px 16px 0 0; }
  .tutorial-modal-header h2 { font-size: 20px; }
}

/* 教程正文 Markdown 警示框 */
.md-alert {
  border-radius: 12px;
  padding: 14px 16px;
  margin: 12px 0;
  font-size: 14px;
  line-height: 1.6;
}
.md-alert-title { font-weight: 700; margin-bottom: 4px; }
.md-alert-warning { background: rgba(255,149,0,.12); border: 1px solid rgba(255,149,0,.3); }
.md-alert-warning .md-alert-title { color: var(--warning); }
.md-alert-tip { background: rgba(52,199,89,.12); border: 1px solid rgba(52,199,89,.3); }
.md-alert-tip .md-alert-title { color: var(--success); }
.md-alert-caution { background: rgba(255,59,48,.12); border: 1px solid rgba(255,59,48,.3); }
.md-alert-caution .md-alert-title { color: var(--danger); }
.md-alert-note { background: rgba(0,113,227,.10); border: 1px solid rgba(0,113,227,.25); }
.md-alert-note .md-alert-title { color: var(--accent); }

/* 教程正文表格 */
.tutorial-body .table-wrap table.tbl { margin: 12px 0; font-size: 13.5px; }

/* 无横向滚动保证 */
body { overflow-x: hidden; }
