/* ═══════════════════════════════════════════════════════════
   URL 短链服务 — 自定义样式（演示模式）
   基于 Basecoat UI 设计系统
   ═══════════════════════════════════════════════════════════ */

/* ── 主题色覆盖（比 Basecoat 默认更柔和） ───────────────── */
:root {
  --background: oklch(0.985 0.002 247);
  --foreground: oklch(0.172 0.012 258);
  --card: oklch(0.992 0.001 247);
  --card-foreground: oklch(0.172 0.012 258);
  --popover: oklch(0.992 0.001 247);
  --popover-foreground: oklch(0.172 0.012 258);
  --muted: oklch(0.955 0.004 258);
  --muted-foreground: oklch(0.48 0.02 258);
  --border: oklch(0.902 0.006 258);
  --input: oklch(0.902 0.006 258);
}

.dark {
  --background: oklch(0.175 0.015 255);
  --foreground: oklch(0.965 0.004 255);
  --card: oklch(0.215 0.015 255);
  --card-foreground: oklch(0.965 0.004 255);
  --popover: oklch(0.235 0.015 255);
  --popover-foreground: oklch(0.965 0.004 255);
  --muted: oklch(0.275 0.015 255);
  --muted-foreground: oklch(0.68 0.02 255);
  --border: oklch(0.32 0.02 255 / 40%);
  --input: oklch(0.32 0.02 255 / 50%);
  --ring: oklch(0.55 0.03 255);
}

/* ── MiSans 字体 ────────────────────────────────────────── */
@font-face {
  font-family: "MiSans";
  src: url("MiSans-Medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

/* ── 自定义覆盖式滚动条（JS + CSS，无布局偏移） ─────────── */

/* ─ 隐藏原生滚动条（仅 html，不动 body） ─ */
html {
  overflow-y: scroll;
  scrollbar-width: none;                        /* Firefox */
  -ms-overflow-style: none;                     /* IE / 旧 Edge */
}

html::-webkit-scrollbar {
  width: 0;
  display: none;                                /* Chrome / Safari / Edge */
}

/* ─ 覆盖式滚动条轨道 ─ */
.sb-track {
  position: fixed;
  top: 0;
  right: 0;
  width: 8px;
  height: 100dvh;
  z-index: 9999;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.sb-track.show {
  opacity: 1;
}

/* ─ 覆盖式滚动条滑块 ─ */
.sb-thumb {
  position: absolute;
  right: 1px;
  width: 6px;
  min-height: 30px;
  border-radius: 9999px;
  background: oklch(0.60 0.015 258 / 28%);
  pointer-events: auto;
  cursor: pointer;
  transition: background 0.15s ease, width 0.15s ease, right 0.15s ease;
}

.sb-thumb:hover,
.sb-thumb.active {
  background: oklch(0.50 0.015 258 / 48%);
  width: 8px;
  right: 0;
}

/* ─ Dark 模式 ─ */
.dark .sb-thumb {
  background: oklch(0.65 0.02 255 / 32%);
}

.dark .sb-thumb:hover,
.dark .sb-thumb.active {
  background: oklch(0.75 0.025 255 / 52%);
  width: 8px;
  right: 0;
}

/* ── 克制动画 ─────────────────────────────────────────────
   仅允许特定、有意图的过渡效果
   按钮无悬停效果（按需求） */

.btn:hover,
[data-tooltip]:hover::before {
  transition-property: none;
}

/* 仅允许 toast 和遮罩层的透明度过渡 */
.app-toast,
.confirm-overlay,
details[open] .list-chevron {
  transition: opacity 0.2s ease, transform 0.2s ease;
}

/* 加载旋转是唯一的持续动画 */
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── 全局字体应用 ───────────────────────────────────────── */
body {
  font-family: "MiSans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  user-select: none;
  -webkit-user-select: none;
}

/* 输入框允许选中文字（用于输入/复制） */
input,
textarea,
select {
  user-select: auto !important;
  -webkit-user-select: auto !important;
}

/* ── 应用布局 ───────────────────────────────────────────── */
.app-container {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* ── 站点页脚 ───────────────────────────────────────────── */
.site-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  padding: 1.25rem 1.5rem;
  border-top: 1px solid var(--border);
  background: var(--background);
  font-size: 0.75rem;
  color: var(--muted-foreground);
  flex-shrink: 0;
}

.site-footer a {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  color: var(--muted-foreground);
  text-decoration: none;
  transition: color 0.15s ease;
}

.site-footer a:hover {
  color: var(--foreground);
}

.site-footer img {
  height: 1rem;
  width: auto;
  vertical-align: middle;
}


/* ── 顶栏 ───────────────────────────────────────────────── */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
  background: var(--background);
  position: sticky;
  top: 0;
  z-index: 30;
}

.app-header-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.app-header-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.app-title {
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.02em;
}

/* ── GitHub 链接按钮 ─────────────────────────────────────── */
.github-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: var(--radius-md, 0.5rem);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--foreground);
  cursor: pointer;
  flex-shrink: 0;
  text-decoration: none;
}

.github-link svg {
  width: 1.125rem;
  height: 1.125rem;
}

.github-link:hover {
  color: var(--foreground);
}

/* ── 主题切换按钮 ───────────────────────────────────────── */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: var(--radius-md, 0.5rem);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--foreground);
  cursor: pointer;
  flex-shrink: 0;
}

.theme-toggle svg {
  width: 1.125rem;
  height: 1.125rem;
}

.theme-toggle .icon-sun { display: block; }
.dark .theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: none; }
.dark .theme-toggle .icon-moon { display: block; }

/* ── 主内容区 ───────────────────────────────────────────── */
.app-main {
  flex: 1;
  padding: 1.5rem;
  max-width: 48rem;
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* ── 创建卡片 ───────────────────────────────────────────── */
.create-card {
  margin-bottom: 0;
}

.create-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.create-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  padding-top: 0.25rem;
}

/* ── 切换按钮组（永久 / 临时） ──────────────────────────── */
.toggle-group {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: var(--radius-md, 0.5rem);
  background: var(--muted);
  padding: 2px;
  gap: 0;
  position: relative;
}

/* 滑动高亮背景块 */
.toggle-group::before {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: calc(50% - 2px);
  height: calc(100% - 4px);
  border-radius: calc(var(--radius-md, 0.5rem) - 2px);
  background: var(--background);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 0;
}

/* 选择永久时，高亮块滑到右侧 */
.toggle-group.is-perm::before {
  transform: translateX(100%);
}

.toggle-btn {
  position: relative;
  z-index: 1;
  padding: 0.375rem 0.875rem;
  font-size: 0.8125rem;
  font-weight: 500;
  border: none;
  border-radius: calc(var(--radius-md, 0.5rem) - 2px);
  background: transparent;
  color: var(--muted-foreground);
  cursor: pointer;
  outline: none;
  white-space: nowrap;
  transition: color 0.2s ease;
}

.toggle-btn.active {
  color: var(--foreground);
}

/* ── 密钥输入（等宽字体） ───────────────────────────────── */
input[type="password"] {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

.key-confirm-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.key-confirm-row input {
  flex: 1;
  min-width: 0;
}

/* ── 有效期控件 ─────────────────────────────────────────── */
.ttl-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.875rem;
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
  -webkit-user-select: none;
}

.ttl-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.ttl-custom {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

/* ── 标签辅助 ───────────────────────────────────────────── */
.label-optional {
  font-weight: 400;
  font-size: 0.75rem;
  color: var(--muted-foreground);
}

/* ── 创建表单隐藏状态 ──────────────────────────────────── */
.create-form.hidden {
  display: none;
}

/* ── 创建成功视图（创建成功后显示） ─────────────────────── */
.success-view {
  display: none;
  flex-direction: column;
  align-items: center;
  padding: 2rem 1.25rem;
  gap: 1.25rem;
  text-align: center;
}

.success-view.visible {
  display: flex;
}

.success-icon {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
  background: oklch(0.72 0.14 160 / 0.15);
  color: oklch(0.55 0.15 160);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.success-icon svg {
  width: 1.75rem;
  height: 1.75rem;
}

.success-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--foreground);
}

.success-link-card {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 1.25rem;
  border-radius: var(--radius-lg, 0.625rem);
  border: 1px solid var(--border);
  background: var(--muted);
}

.success-url {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 1rem;
  font-weight: 600;
  word-break: break-all;
  color: var(--foreground);
}

.success-exp {
  font-size: 0.8125rem;
  color: var(--muted-foreground);
}

.success-demo-hint {
  font-size: 0.75rem;
  color: oklch(0.6 0.18 250);
  font-weight: 500;
}

.success-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: center;
}

.success-actions .btn {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  min-width: 7rem;
  justify-content: center;
  padding: 0.625rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: var(--radius-md, 0.5rem);
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

/* 复制链接按钮 — 绿色强调 */
.success-actions #successCopyBtn {
  background: oklch(0.55 0.15 160);
  color: #fff;
  border-color: oklch(0.55 0.15 160);
}

/* 继续创建按钮 — 淡描边 */
.success-actions #continueCreateBtn {
  background: transparent;
  color: var(--foreground);
  border: 1px solid var(--border);
}

/* ── 结果显示框（旧版，保留兼容） ──────────────────────── */
.result-box {
  display: none;
  padding: 1rem 1.125rem;
  border-radius: var(--radius-lg, 0.625rem);
  border: 1px solid var(--border);
  background: var(--muted);
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 0.25rem;
}

.result-box.visible {
  display: flex;
}

.result-url {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 0.875rem;
  font-weight: 500;
  word-break: break-all;
  flex: 1;
  min-width: 0;
}

.result-exp {
  font-size: 0.75rem;
  color: var(--muted-foreground);
}

/* ── 可折叠列表区块 ────────────────────────────────────── */
.list-details {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg, 0.625rem);
  background: var(--card);
  overflow: hidden;
}

.list-summary {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 1rem 1.25rem;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9375rem;
  user-select: none;
  -webkit-user-select: none;
  list-style: none;
  color: var(--card-foreground);
}

.list-summary::-webkit-details-marker {
  display: none;
}

.list-summary .list-chevron {
  width: 1rem;
  height: 1rem;
  margin-left: auto;
  flex-shrink: 0;
  color: var(--muted-foreground);
}

.list-details[open] .list-chevron {
  transform: rotate(180deg);
}

.list-summary-badge {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--muted-foreground);
  background: var(--muted);
  padding: 0.125rem 0.5rem;
  border-radius: 9999px;
}

.list-details > :not(summary) {
  padding: 0 1.25rem 1.25rem;
}

/* ── 统计栏 ─────────────────────────────────────────────── */
.stats-bar {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.stats-bar .list-badge {
  align-self: flex-start;
}

.stats-bar .stat-cards-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.stat-card {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  padding: 1rem 1.125rem;
  border-radius: var(--radius-md, 0.5rem);
  border: 1px solid var(--border);
  background: var(--background);
}

.stat-label {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--muted-foreground);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.stat-value {
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

/* ── 列表标签页 ────────────────────────────────────────── */
.list-tabs {
  margin-top: 0.25rem;
}

/* 标签页头部：toggle-group + 刷新按钮 */
.list-tabs-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* 列表区域的 toggle-group 复用创建短链的滑动动画 */
/* 注意：列表顺序为 [永久 | 临时]，与创建表单 [临时 | 永久] 相反 */
/* 默认高亮在左侧（永久），点击临时后滑到右侧 */
.list-tabs .toggle-group {
  /* 自适应内容宽度，不撑满整行 */
}

.list-tabs .toggle-group::before {
  /* 默认在左侧（永久短链） */
  transform: translateX(0);
}

/* 临时短链激活时，滑块移到右侧 */
.list-tabs .toggle-group.is-temp::before {
  transform: translateX(100%);
}

.list-tabs .toggle-btn {
  flex: 1;
  text-align: center;
  padding: 0.5rem 0.75rem;
}

/* 刷新按钮：与切换按钮等高、等大、醒目 */
#listRefreshBtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  white-space: nowrap;
  flex-shrink: 0;
  padding: 0.375rem 0.875rem; /* 与 toggle-btn 内边距一致 */
  font-size: 0.8125rem;
  font-weight: 500;
  border-radius: calc(var(--radius-md, 0.5rem) - 2px); /* 与 toggle-btn 圆角一致 */
  border: 1px solid var(--border);
  background: var(--background);
  color: var(--foreground);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
  height: 100%; /* 填满父容器高度，确保对齐 */
}

#listRefreshBtn:hover {
  background: var(--muted);
}

/* ── 短链列表项 ────────────────────────────────────────── */
.url-list-empty {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--muted-foreground);
  font-size: 0.875rem;
}

.url-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.url-item:last-child {
  border-bottom: none;
}

.url-item-code {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 0.8125rem;
  font-weight: 600;
  flex-shrink: 0;
  color: var(--foreground);
}

.url-item-original {
  font-size: 0.8125rem;
  color: var(--muted-foreground);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
  max-width: 18rem;
}

.url-item-exp {
  font-size: 0.6875rem;
  color: var(--muted-foreground);
  flex-shrink: 0;
  background: var(--muted);
  padding: 0.125rem 0.5rem;
  border-radius: 9999px;
}

.url-item-actions {
  display: flex;
  gap: 0.125rem;
  margin-left: auto;
  flex-shrink: 0;
}

/* ── Toast 通知 ─────────────────────────────────────────── */
.app-toaster {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
  max-width: 24rem;
}

.app-toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-lg, 0.625rem);
  border: 1px solid var(--border);
  background: var(--popover);
  color: var(--popover-foreground);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08), 0 1px 4px rgba(0, 0, 0, 0.04);
  font-size: 0.8125rem;
  line-height: 1.4;
  opacity: 0;
}

.app-toast.visible {
  opacity: 1;
}

.app-toast-icon {
  flex-shrink: 0;
  width: 1rem;
  height: 1rem;
  margin-top: 0.15rem;
}

.app-toast-success .app-toast-icon {
  color: oklch(0.55 0.15 160);
}

.app-toast-error .app-toast-icon {
  color: var(--destructive);
}

.app-toast-msg {
  flex: 1;
  word-break: break-word;
}

/* ── 确认对话框 ─────────────────────────────────────────── */
.confirm-overlay {
  position: fixed;
  inset: 0;
  background: oklch(0 0 0 / 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 90;
  padding: 1rem;
  opacity: 0;
}

.confirm-overlay.visible {
  opacity: 1;
}

.confirm-box {
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl, 0.75rem);
  padding: 1.5rem;
  max-width: 26rem;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.14), 0 4px 12px rgba(0, 0, 0, 0.06);
}

.confirm-title {
  font-weight: 600;
  font-size: 1rem;
}

.confirm-msg {
  font-size: 0.875rem;
  color: var(--muted-foreground);
  line-height: 1.5;
}

.confirm-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  padding-top: 0.25rem;
}

.confirm-actions .btn-outline {
  color: var(--foreground);
  border-color: var(--border);
  background: transparent;
}

.confirm-actions .btn-outline:hover {
  background: var(--muted);
}

/* ── 加载旋转器 ────────────────────────────────────────── */
.spinner {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  border: 2px solid var(--muted);
  border-top-color: var(--foreground);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

/* ── 仅屏幕阅读器可见 ─────────────────────────────────── */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* ── 演示横幅 ─────────────────────────────────────────── */
.demo-banner {
  background: oklch(0.55 0.15 250 / 0.12);
  border-bottom: 1px solid oklch(0.55 0.15 250 / 0.25);
  flex-shrink: 0;
}

.demo-banner-inner {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.5rem 1.5rem;
  font-size: 0.8125rem;
  color: var(--foreground);
  max-width: 48rem;
  margin: 0 auto;
}

.demo-banner-icon {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
  color: oklch(0.6 0.18 250);
}

.demo-banner-text {
  flex: 1;
  min-width: 0;
  line-height: 1.5;
}

.demo-banner-text code {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 0.8125rem;
  background: oklch(0.55 0.15 250 / 0.15);
  padding: 0.125rem 0.375rem;
  border-radius: 0.25rem;
  font-weight: 600;
}

.demo-banner-reset {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.625rem;
  font-size: 0.75rem;
  font-weight: 500;
  border: 1px solid oklch(0.55 0.15 250 / 0.3);
  border-radius: var(--radius-md, 0.5rem);
  background: transparent;
  color: var(--foreground);
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}

.demo-banner-reset:hover {
  background: oklch(0.55 0.15 250 / 0.1);
}

.demo-badge-header {
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 0.125rem 0.375rem;
  border-radius: 0.25rem;
  background: oklch(0.55 0.15 250 / 0.2);
  color: oklch(0.6 0.18 250);
  border: 1px solid oklch(0.55 0.15 250 / 0.3);
  vertical-align: middle;
  line-height: 1.4;
}

.demo-footer-note {
  font-size: 0.75rem;
  color: var(--muted-foreground);
}

/* ── 响应式适配 ────────────────────────────────────────── */
@media (max-width: 40rem) {
  /* ── 演示横幅 ── */
  .demo-banner-inner {
    padding: 0.5rem 1rem;
    flex-wrap: wrap;
    gap: 0.375rem;
  }

  .demo-banner-text {
    font-size: 0.75rem;
  }

  .demo-banner-reset {
    font-size: 0.6875rem;
  }

  /* ── 顶栏 ── */
  .app-header {
    padding: 0.75rem 1rem;
  }

  /* ── 主内容区 ── */
  .app-main {
    padding: 0.75rem;
    gap: 1rem;
  }

  /* ── 表单字段 ── */
  .create-form {
    gap: 1rem;
  }

  .field input[type="url"],
  .field input[type="text"],
  .field input[type="password"],
  .field select {
    font-size: 16px; /* 防止 iOS 聚焦时缩放 */
  }

  /* ── 有效期行 ── */
  .ttl-row {
    flex-direction: column;
    align-items: stretch;
    gap: 0.625rem;
  }

  .toggle-group {
    width: 100%;
  }

  .toggle-btn {
    flex: 1;
    text-align: center;
    padding: 0.5rem 0.5rem;
  }

  .ttl-controls {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }

  .ttl-controls select {
    width: 100%;
  }

  /* ── 密钥确认行 ── */
  .key-confirm-row {
    flex-wrap: nowrap;
  }

  .key-confirm-row .btn {
    flex-shrink: 0;
    padding-left: 0.875rem;
    padding-right: 0.875rem;
  }

  /* ── 创建操作按钮 ── */
  .create-actions {
    justify-content: stretch;
  }

  .create-actions .btn {
    width: 100%;
  }

  /* ── 结果框 ── */
  .result-box {
    flex-direction: column;
    align-items: stretch;
    gap: 0.625rem;
  }

  .result-url {
    word-break: break-all;
    text-align: center;
  }

  .result-exp {
    text-align: center;
  }

  #copyResultBtn {
    width: 100%;
    justify-content: center;
  }

  /* ── 统计栏 ── */
  .stats-bar .stat-cards-row {
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
  }

  .stat-card {
    padding: 0.625rem 0.75rem;
  }

  .stat-label {
    font-size: 0.625rem;
  }

  .stat-value {
    font-size: 1.0625rem;
  }

  /* ── 标签页头部（toggle-group + 刷新按钮） ── */
  .list-tabs-header {
    width: 100%;
    flex-wrap: nowrap;
    gap: 0.5rem;
  }

  .list-tabs .toggle-group {
    width: 100%;
  }

  .list-tabs .toggle-btn {
    flex: 1;
    text-align: center;
    padding: 0.5rem 0.5rem;
  }

  #listRefreshBtn {
    flex-shrink: 0;
  }

  /* ── 短链列表项 ── */
  .url-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.75rem 0;
  }

  .url-item-code {
    font-size: 0.875rem;
  }

  .url-item-original {
    max-width: 100%;
    width: 100%;
    white-space: normal;
    word-break: break-all;
  }

  .url-item-actions {
    margin-left: 0;
    align-self: flex-end;
  }

  .url-item-actions .btn-sm-icon {
    min-width: 2.25rem;
    min-height: 2.25rem;
    padding: 0.375rem;
  }

  /* ── 空状态 ── */
  .url-list-empty {
    padding: 1.75rem 1rem;
    font-size: 0.8125rem;
  }

  /* ── 确认对话框 ── */
  .confirm-overlay {
    padding: 0.75rem;
    align-items: flex-end; /* 移动端底部弹出样式 */
  }

  .confirm-box {
    padding: 1.25rem;
    border-radius: var(--radius-lg, 0.625rem);
    margin-bottom: 0.5rem;
    max-width: 100%;
  }

  .confirm-title {
    font-size: 0.9375rem;
  }

  .confirm-msg {
    font-size: 0.8125rem;
  }

  .confirm-actions {
    flex-direction: row-reverse; /* 主要操作在前（视觉上靠右） */
    gap: 0.5rem;
  }

  .confirm-actions .btn {
    flex: 1;
    padding-top: 0.625rem;
    padding-bottom: 0.625rem;
  }

  /* ── 页脚 ── */
  .site-footer {
    flex-direction: column;
    gap: 0.625rem;
    padding: 1rem;
    font-size: 0.6875rem;
    text-align: center;
  }

  /* ── Toast 通知 ── */
  .app-toaster {
    left: 0.75rem;
    right: 0.75rem;
    bottom: 0.75rem;
    max-width: none;
  }

  .app-toast {
    font-size: 0.8125rem;
    padding: 0.625rem 0.875rem;
  }
}

/* ── 超小屏幕（< 360px） ──────────────────────────────── */
@media (max-width: 22.5rem) {
  .app-header {
    padding: 0.625rem 0.75rem;
  }

  .app-title {
    font-size: 1rem;
  }

  .app-main {
    padding: 0.625rem;
  }

  .list-summary {
    padding: 0.875rem 1rem;
    font-size: 0.875rem;
  }

  .stats-bar .stat-cards-row {
    grid-template-columns: 1fr 1fr;
    gap: 0.375rem;
  }

  .stat-card {
    padding: 0.5rem 0.625rem;
  }

  .stat-value {
    font-size: 0.9375rem;
  }

  .list-tabs .toggle-btn {
    padding: 0.4rem 0.375rem;
    font-size: 0.75rem;
  }
}
