/* ============================================================
   pyipatool · iOS 27 Liquid Glass 风格
   ============================================================ */

:root {
  --glass-white: rgba(255, 255, 255, 0.48);
  --glass-white-strong: rgba(255, 255, 255, 0.62);
  --glass-white-tabbar: rgba(255, 255, 255, 0.55);
  --glass-border: rgba(255, 255, 255, 0.72);
  --glass-shadow: 0 8px 32px rgba(31, 38, 135, 0.14),
    inset 0 0 0 0.5px rgba(255, 255, 255, 0.4);

  --ios-blue: #0a84ff;
  --ios-blue-deep: #0060df;
  --ios-blue-soft: rgba(10, 132, 255, 0.12);
  --ios-green: #30d158;
  --ios-red: #ff453a;
  --ios-amber: #ff9f0a;

  --text: rgba(28, 28, 30, 0.92);
  --text-2: rgba(28, 28, 30, 0.60);
  --text-3: rgba(28, 28, 30, 0.38);

  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 10px;
  --radius-pill: 999px;

  --tabbar-h: 56px;
  --status-h: 52px;

  --font: -apple-system, "SF Pro Display", "SF Pro Text", "PingFang SC",
    "HarmonyOS Sans SC", "Microsoft YaHei", sans-serif;

  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; }

body {
  font-family: var(--font);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  letter-spacing: 0.01em;
}

/* ============================================================
   液态玻璃背景
   ============================================================ */
.bg-scene {
  position: fixed;
  inset: 0;
  z-index: -2;
  background: linear-gradient(160deg, #dceefb 0%, #e8e0fb 40%, #fdeef4 72%, #dff4f0 100%);
  overflow: hidden;
}
.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.50;
  animation: drift 24s ease-in-out infinite alternate;
  will-change: transform;
}
.blob-1 { width: 46vmax; height: 46vmax; top: -12vmax; left: -8vmax; background: #6ec6ff; }
.blob-2 { width: 38vmax; height: 38vmax; top: 22vmax; right: -10vmax; background: #c4a7ff; animation-delay: -7s; }
.blob-3 { width: 32vmax; height: 32vmax; bottom: -10vmax; left: 16vmax; background: #ffb3d9; animation-delay: -14s; }
.blob-4 { width: 24vmax; height: 24vmax; top: 8vmax; left: 38vmax; background: #7ce8d4; opacity: 0.38; animation-delay: -18s; }

@keyframes drift {
  0%   { transform: translate(0, 0) scale(1); }
  50%  { transform: translate(4vmax, -3vmax) scale(1.10); }
  100% { transform: translate(-3vmax, 3vmax) scale(0.95); }
}
.grain {
  position: absolute; inset: 0; opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
  pointer-events: none;
}

/* ============================================================
   玻璃基础类
   ============================================================ */
.glass {
  background: var(--glass-white);
  -webkit-backdrop-filter: blur(24px) saturate(170%);
  backdrop-filter: blur(24px) saturate(170%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--glass-shadow);
}
.glass-deep {
  background: var(--glass-white-strong);
  -webkit-backdrop-filter: blur(36px) saturate(190%);
  backdrop-filter: blur(36px) saturate(190%);
  border: 1px solid rgba(255, 255, 255, 0.88);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 64px rgba(31, 38, 135, 0.24),
    inset 0 0 0 0.5px rgba(255, 255, 255, 0.5);
}

/* ============================================================
   顶部状态栏
   ============================================================ */
.status-bar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 60;
  height: calc(var(--status-h) + var(--safe-top));
  padding: var(--safe-top) 16px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: 0;
  border-left: none; border-right: none; border-top: none;
  border-bottom: 1px solid rgba(255,255,255,0.5);
}
.status-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.brand-icon {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  font-size: 18px;
  border-radius: 10px;
  background: linear-gradient(145deg, rgba(255,255,255,0.85), rgba(255,255,255,0.40));
  border: 1px solid rgba(255,255,255,0.85);
  flex-shrink: 0;
  color: var(--ios-blue);
}
.brand-title {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.status-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 600;
  border: 1px solid rgba(255,255,255,0.75);
  background: rgba(255,255,255,0.45);
  white-space: nowrap;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pill::before {
  content: "";
  width: 7px; height: 7px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}
.pill.ok  { color: var(--ios-green); }
.pill.err { color: var(--ios-red); }

/* ============================================================
   iOS 27 Liquid Glass 液态玻璃 Tab Bar
   ============================================================ */
.tabbar {
  position: fixed;
  bottom: calc(8px + var(--safe-bottom));
  left: 50%;
  transform: translateX(-50%);
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 5px;
  min-width: 320px;
  max-width: 92vw;
  height: calc(var(--tabbar-h) + 2px);
  border-radius: var(--radius-pill);
  /* 液态玻璃背景 */
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.55) 0%,
    rgba(255, 255, 255, 0.35) 100%
  );
  -webkit-backdrop-filter: blur(40px) saturate(180%);
  backdrop-filter: blur(40px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow:
    0 8px 32px rgba(31, 38, 135, 0.15),
    0 2px 8px rgba(0, 0, 0, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.8),
    inset 0 -1px 0 rgba(255, 255, 255, 0.3);
  transition: box-shadow 0.4s ease;
}

/* 液态玻璃流光效果 */
.tabbar::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1.5px;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.9) 0%,
    rgba(255, 255, 255, 0.1) 40%,
    rgba(255, 255, 255, 0) 60%,
    rgba(255, 255, 255, 0.4) 100%
  );
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  opacity: 0.7;
}

.tab-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  flex: 1;
  min-width: 60px;
  height: 100%;
  padding: 4px 14px;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--text-2);
  font-family: var(--font);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.02em;
  border-radius: var(--radius-pill);
  -webkit-tap-highlight-color: transparent;
  white-space: nowrap;
  z-index: 1;
  transition: color 0.3s ease, background 0.3s ease;
}
.tab-item .tab-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), color 0.3s ease;
}
.tab-item span {
  line-height: 1.2;
}

/* 选中态：液态玻璃高亮填充 */
.tab-item.active {
  color: var(--ios-blue);
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.85) 0%,
    rgba(255, 255, 255, 0.55) 100%
  );
  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 1),
    inset 0 -1px 0 rgba(255, 255, 255, 0.5);
}
.tab-item.active .tab-icon {
  transform: scale(1.1);
}

/* 非选中态 hover */
.tab-item:not(.active):hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.2);
}
.tab-item:not(.active):active {
  background: rgba(255, 255, 255, 0.1);
  transform: scale(0.97);
}

/* ============================================================
   Tab 视图
   ============================================================ */
.tab-view {
  position: fixed;
  top: calc(var(--status-h) + var(--safe-top));
  left: 0; right: 0;
  bottom: 0;
  display: none;
  animation: view-in 0.35s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.tab-view.visible {
  display: block;
}
@keyframes view-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.view-scroll {
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}
.view-content {
  max-width: 720px;
  margin: 0 auto;
  padding: 16px 16px 32px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ============================================================
   卡片
   ============================================================ */
.card {
  padding: 20px;
  animation: card-in 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
  overflow: hidden;
}
.card:nth-child(2) { animation-delay: 0.06s; }
.card:nth-child(3) { animation-delay: 0.12s; }

@keyframes card-in {
  from { opacity: 0; transform: translateY(14px) scale(0.99); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.card-emoji {
  font-size: 15px;
  width: 32px; height: 32px;
  display: grid; place-items: center;
  border-radius: 10px;
  background: var(--ios-blue-soft);
  border: 1px solid rgba(255,255,255,0.72);
  flex-shrink: 0;
  color: var(--ios-blue);
}

/* ==================== SVG 图标系统 ==================== */
.icon {
  width: 18px; height: 18px;
  display: block;
  flex-shrink: 0;
}
.icon-xs { width: 14px; height: 14px; }
/* 品牌 Apple 标志：加大加清晰，配合深色提升对比度 */
.icon-brand { width: 22px; height: 22px; }
/* 图标 + 文字按钮 */
.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.card h2 {
  font-size: 16px;
  font-weight: 700;
  white-space: nowrap;
}
/* 卡片头部的账号选择器：靠右，任务/记录页按账号过滤 */
.card-account-select {
  margin-left: auto;
  flex: 0 1 220px;
  min-width: 130px;
  font-size: 13px;
  padding: 7px 32px 7px 10px;
}

/* 版本卡片头部 */
.ver-card-head { margin-bottom: 14px; }
.ver-card-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.ver-app-name {
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 180px;
}
.ver-card-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.ver-account-select {
  flex: 1 1 160px;
  min-width: 0;
  max-width: 240px;
  font-size: 13px;
  padding: 7px 10px;
}

/* 元数据自动获取开关（iOS 风格） */
.meta-switch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-2);
  cursor: pointer;
  user-select: none;
  flex-shrink: 0;
}
.meta-switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.meta-switch .switch-ui {
  width: 38px;
  height: 22px;
  border-radius: 11px;
  background: rgba(120, 120, 128, 0.32);
  position: relative;
  transition: background 0.25s;
  flex-shrink: 0;
}
.meta-switch .switch-ui::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.meta-switch input:checked + .switch-ui { background: var(--ios-green); }
.meta-switch input:checked + .switch-ui::after { transform: translateX(16px); }

/* ============================================================
   表单
   ============================================================ */
.form-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}
.form-row-sub {
  display: flex;
  gap: 10px;
}
.form-row-sub .glass-select { flex: 1 1 0; min-width: 0; }
.form-row-sub .btn { flex-shrink: 0; }

.glass-input {
  width: 100%;
  padding: 11px 14px;
  font-size: 15px;
  font-family: var(--font);
  color: var(--text);
  background-color: rgba(255, 255, 255, 0.50);
  border: 1px solid rgba(255, 255, 255, 0.80);
  border-radius: var(--radius-sm);
  outline: none;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: inset 0 1px 2px rgba(31, 38, 135, 0.05);
  /* 注意：只过渡 background-color，绝不能用 background 简写，
     否则会把 select 箭头（background-image/position）一起动画，
     造成聚焦时箭头从左滑到右的 bug */
  transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s;
  -webkit-appearance: none;
}
.glass-input::placeholder { color: var(--text-3); }
.glass-input:focus {
  background-color: rgba(255, 255, 255, 0.72);
  border-color: rgba(10, 132, 255, 0.50);
  box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.12);
}
.glass-select {
  appearance: none;
  padding-right: 32px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%230a84ff' stroke-width='2' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 12px 8px;
  cursor: pointer;
}
/* 箭头位置钉死：任何状态（hover/focus/active）都不参与过渡 */
.glass-select,
.glass-select:hover,
.glass-select:focus,
.glass-select:active {
  background-position: right 12px center;
  background-size: 12px 8px;
  background-repeat: no-repeat;
}

/* ============================================================
   输入框清除按钮（iOS 风格 ⓧ，有内容时显示）
   ============================================================ */
.input-clear-wrap {
  position: relative;
  display: flex;
  width: 100%;
  min-width: 0;
}
.input-clear-wrap .glass-input { padding-right: 38px; }
.input-clear {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px; height: 18px;
  padding: 0;
  display: grid;
  place-items: center;
  border: none;
  border-radius: 50%;
  background: rgba(60, 60, 67, 0.28);
  color: #fff;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.2s, transform 0.15s;
}
.input-clear:hover { background: rgba(60, 60, 67, 0.45); }
.input-clear:active { transform: translateY(-50%) scale(0.88); }
.input-clear svg { width: 10px; height: 10px; }
/* hidden 属性必须显式压制 display:grid，否则按钮藏不起来 */
.input-clear[hidden] { display: none; }

/* ============================================================
   按钮
   ============================================================ */
.btn {
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow 0.2s, background 0.2s, opacity 0.2s;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(0.96); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
  background: linear-gradient(160deg, #3d9bff, var(--ios-blue) 55%, var(--ios-blue-deep));
  color: #fff;
  box-shadow: 0 4px 14px rgba(10, 132, 255, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
}
.btn-primary:hover:not(:disabled) {
  box-shadow: 0 6px 20px rgba(10, 132, 255, 0.45);
  transform: translateY(-1px);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.50);
  border-color: rgba(255, 255, 255, 0.85);
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.8);
}
.btn-ghost:hover { background: rgba(255, 255, 255, 0.75); }

.btn-sm { padding: 7px 14px; font-size: 13px; border-radius: 10px; }
.btn-xs { padding: 5px 10px; font-size: 12px; border-radius: 8px; }
.btn-danger { color: var(--ios-red); }
.btn-danger:hover { background: rgba(255, 69, 58, 0.10); }

/* 删除弹窗危险按钮 */
.btn-danger-solid {
  background: linear-gradient(160deg, #ff6b6b, var(--ios-red) 55%, #e03131);
  color: #fff;
  box-shadow: 0 4px 14px rgba(255, 69, 58, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
}
.btn-danger-solid:hover:not(:disabled) {
  box-shadow: 0 6px 20px rgba(255, 69, 58, 0.45);
  transform: translateY(-1px);
}

/* ============================================================
   列表
   ============================================================ */
.list { list-style: none; }
.list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 11px 6px;
  border-bottom: 1px solid rgba(28, 28, 30, 0.06);
  animation: item-in 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
  min-width: 0;
}
.list li:last-child { border-bottom: none; }

@keyframes item-in {
  from { opacity: 0; transform: translateX(-6px); }
  to   { opacity: 1; transform: translateX(0); }
}

.list .name { font-weight: 600; word-break: break-all; min-width: 0; }
.list .meta { color: var(--text-2); font-size: 12.5px; margin-top: 2px; min-width: 0; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; flex-shrink: 0; }

/* 搜索结果 */
.search-item {
  cursor: pointer;
  padding: 14px;
  margin-bottom: 10px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.38);
  border: 1px solid rgba(255, 255, 255, 0.65);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.7);
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1),
    background 0.2s, box-shadow 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.search-item:active {
  transform: scale(0.98);
  background: rgba(255, 255, 255, 0.60);
}
.si-name { font-weight: 650; }
.si-meta { color: var(--text-2); font-size: 12.5px; margin-top: 3px; word-break: break-all; }

/* 搜索图标 */
.search-item-content {
  display: flex;
  align-items: center;
  gap: 12px;
}
.search-item-info { flex: 1; min-width: 0; }
.search-icon {
  width: 48px; height: 48px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
  background: rgba(255,255,255,0.4);
  border: 1px solid rgba(255,255,255,0.6);
}
.search-icon-placeholder {
  width: 48px; height: 48px;
  border-radius: 10px;
  flex-shrink: 0;
  background: linear-gradient(135deg, rgba(10,132,255,0.12), rgba(10,132,255,0.06));
  border: 1px solid rgba(255,255,255,0.6);
  display: grid; place-items: center;
  font-size: 20px; font-weight: 700;
  color: var(--ios-blue);
}

/* 版本项 */
.ver-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 11px 6px;
  border-bottom: 1px solid rgba(28, 28, 30, 0.06);
  gap: 10px;
}
.ver-item:last-child { border-bottom: none; }
.ver-info { min-width: 0; flex: 1; }
.v-ver { font-weight: 700; font-size: 13.5px; }
.v-meta { color: var(--text-2); font-size: 12.5px; margin-left: 6px; }

/* ============================================================
   任务
   ============================================================ */
.task-item {
  padding: 14px;
  margin-bottom: 10px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.38);
  border: 1px solid rgba(255, 255, 255, 0.65);
}
.task-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 6px;
  gap: 8px;
}
.task-head b { font-weight: 650; min-width: 0; word-break: break-all; }

.task-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.task-icon {
  width: 40px; height: 40px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
  background: rgba(255,255,255,0.4);
  border: 1px solid rgba(255,255,255,0.6);
}
.task-icon-placeholder {
  width: 40px; height: 40px;
  border-radius: 8px;
  flex-shrink: 0;
  background: linear-gradient(135deg, rgba(10,132,255,0.12), rgba(10,132,255,0.06));
  border: 1px solid rgba(255,255,255,0.6);
  display: grid; place-items: center;
  font-size: 16px; font-weight: 700;
  color: var(--ios-blue);
}
.task-err { color: var(--ios-red); font-size: 12.5px; margin-top: 6px; word-break: break-all; }
.task-path { color: var(--text-2); font-size: 12px; margin-top: 4px; word-break: break-all; }
.task-actions {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}
.task-actions .btn {
  width: 100%;
  min-width: 0;
  justify-content: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 7px 4px;
  font-size: 12px;
  border-radius: 9px;
}
.task-actions a {
  text-decoration: none;
  color: inherit;
}
/* 仅单个按钮时占满整行 */
.task-actions-solo .btn { grid-column: 1 / -1; }
/* 手机端一行放 4 个：隐藏图标与可省略文字，保证不挤爆 */
@media (max-width: 820px) {
  .task-actions .icon-xs { display: none; }
  .task-actions .hide-xs { display: none !important; }
}

.progress {
  height: 5px;
  margin-top: 8px;
  border-radius: var(--radius-pill);
  background: rgba(28, 28, 30, 0.07);
  overflow: hidden;
}
.progress > i {
  display: block;
  height: 100%;
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg, #64d2ff, var(--ios-blue));
  transition: width 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.empty-state {
  color: var(--text-3);
  font-size: 13.5px;
  text-align: center;
  padding: 22px 0;
}

/* ============================================================
   表格（横向滚动）
   ============================================================ */
.rec-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0 -4px;
}
.tbl { width: 100%; border-collapse: collapse; min-width: 460px; }
.tbl th, .tbl td {
  padding: 10px 6px;
  text-align: left;
  border-bottom: 1px solid rgba(28,28,30,0.06);
  font-size: 13px;
  white-space: nowrap;
}
.tbl th { color: var(--text-2); font-weight: 600; font-size: 12px; }
.tbl td:first-child { font-weight: 550; }

/* 记录图标 */
.rec-name-cell {
  display: flex;
  align-items: center;
  gap: 8px;
}
.rec-icon {
  width: 28px; height: 28px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
  background: rgba(255,255,255,0.4);
  border: 1px solid rgba(255,255,255,0.6);
}
.rec-icon-placeholder {
  width: 28px; height: 28px;
  border-radius: 6px;
  flex-shrink: 0;
  background: linear-gradient(135deg, rgba(10,132,255,0.12), rgba(10,132,255,0.06));
  border: 1px solid rgba(255,255,255,0.6);
  display: grid; place-items: center;
  font-size: 12px; font-weight: 700;
  color: var(--ios-blue);
}

/* ============================================================
   提示 / 引导
   ============================================================ */
.hint {
  margin: 0 0 12px;
  padding: 10px 14px;
  font-size: 13px;
  color: var(--text-2);
  background: rgba(10, 132, 255, 0.07);
  border: 1px solid rgba(10, 132, 255, 0.16);
  border-radius: var(--radius-sm);
}
.hint[hidden] { display: none; }

.muted { color: var(--text-2); font-size: 12.5px; }
.err { color: var(--ios-red); font-size: 13px; margin-top: 8px; }

/* ============================================================
   弹窗
   ============================================================ */
.mask {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(40, 44, 63, 0.25);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  padding: 20px;
  animation: mask-in 0.25s ease both;
}
@keyframes mask-in { from { opacity: 0; } to { opacity: 1; } }

.modal {
  width: 360px;
  max-width: 100%;
  padding: 24px;
  animation: modal-in 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
.modal-sm { max-width: 340px; }
@keyframes modal-in {
  from { opacity: 0; transform: translateY(20px) scale(0.95); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.modal-emoji {
  font-size: 17px;
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: 12px;
  background: var(--ios-blue-soft);
  border: 1px solid rgba(255,255,255,0.82);
  flex-shrink: 0;
  color: var(--ios-blue);
}
.modal-emoji.danger { color: var(--ios-red); }
.modal h3 { font-size: 17px; font-weight: 700; word-break: break-all; }
.modal-info { font-size: 14px; margin: 4px 0 8px; word-break: break-all; }

.field-label { display: block; margin: 10px 0; font-size: 13px; color: var(--text-2); font-weight: 550; }
.field-label input, .field-label select { width: 100%; margin-top: 6px; }

.modal-actions { display: flex; justify-content: space-between; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.modal-actions .btn { flex: 1; min-width: 0; }

/* 删除弹窗危险按钮 */
.btn-danger-solid {
  background: linear-gradient(160deg, #ff6b6b, var(--ios-red) 55%, #e03131);
  color: #fff;
  box-shadow: 0 4px 14px rgba(255, 69, 58, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
}
.btn-danger-solid:hover:not(:disabled) {
  box-shadow: 0 6px 20px rgba(255, 69, 58, 0.45);
  transform: translateY(-1px);
}

/* ============================================================
   Toast
   ============================================================ */
.toast {
  position: fixed;
  bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 20px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  padding: 12px 22px;
  font-size: 14px;
  font-weight: 550;
  border-radius: var(--radius-pill);
  background: rgba(40, 44, 63, 0.75);
  color: #fff;
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,0.15);
  box-shadow: 0 10px 30px rgba(31,38,135,0.22);
  max-width: 88vw;
  text-align: center;
  animation: toast-in 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes toast-in {
  from { opacity: 0; transform: translateX(-50%) translateY(12px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ============================================================
   来源切换
   ============================================================ */
.source-toggle {
  display: inline-flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.32);
  border-radius: var(--radius-pill);
  padding: 2px;
  border: 1px solid rgba(255, 255, 255, 0.40);
}
.source-btn {
  border: none;
  background: transparent;
  padding: 5px 14px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 550;
  color: var(--text-2);
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: var(--font);
  -webkit-tap-highlight-color: transparent;
}
.source-btn.active {
  background: rgba(255, 255, 255, 0.82);
  color: var(--text);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

/* ============================================================
   滚动条
   ============================================================ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-thumb { background: rgba(28, 28, 30, 0.14); border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: rgba(28, 28, 30, 0.28); }

/* ============================================================
   桌面端宽屏优化
   ============================================================ */
@media (min-width: 821px) {
  .view-content {
    padding: 20px 24px 40px;
  }
  .card { padding: 24px; }
  .form-row {
    flex-direction: row;
    align-items: stretch;
  }
  .form-row .glass-input { flex: 1 1 0; width: auto; }
  .form-row .btn { flex-shrink: 0; }
  .form-row-sub { flex: 0 0 auto; }
  .form-row .input-clear-wrap { flex: 1 1 0; width: auto; }

  .ver-card-title { flex-wrap: nowrap; }
  .ver-card-controls { flex-wrap: nowrap; }

  /* Tab 图标更大 */
  .tab-item .tab-icon { width: 28px; height: 28px; }
  .tab-item { font-size: 11px; }

  /* 桌面端任务按钮恢复宽松尺寸（仍保持一行四列） */
  .task-actions { gap: 8px; }
  .task-actions .btn {
    padding: 7px 14px;
    font-size: 13px;
    border-radius: 10px;
  }
}

/* ============================================================
   超小屏幕
   ============================================================ */
@media (max-width: 380px) {
  :root {
    --tabbar-h: 72px;
    --status-h: 48px;
  }
  .card { padding: 16px; }
  .card h2 { font-size: 14px; }
  .card-emoji { width: 28px; height: 28px; font-size: 13px; }
  .brand-title { font-size: 14px; }
  .brand-icon { width: 28px; height: 28px; font-size: 16px; }
  .brand-icon .icon-brand { width: 18px; height: 18px; }
  .pill { font-size: 11px; padding: 4px 8px; max-width: 110px; }
  .view-content { padding: 12px 12px 24px; gap: 12px; }
  .tab-item .tab-icon { width: 22px; height: 22px; }
  .tab-item { font-size: 10px; }
  .ver-card-controls { flex-direction: column; gap: 6px; }
  .ver-account-select { max-width: 100%; width: 100%; }
  .ver-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .v-meta { margin-left: 0; display: block; margin-top: 2px; }
}
