/* ============ 主题变量 ============ */
:root {
  --bg: #F2F2F7;
  --bg-elevated: #FFFFFF;
  --card: #FFFFFF;
  --card-soft: #F2F2F7;
  --text: #000000;
  --text-secondary: #8E8E93;
  --text-tertiary: #C7C7CC;
  --separator: rgba(60, 60, 67, 0.16);
  --orange: #FF9500;
  --orange-strong: #E68600;
  --orange-soft: rgba(255, 149, 0, 0.12);
  --orange-grad: linear-gradient(135deg, #FFB340 0%, #FF9500 100%);
  --danger: #FF3B30;
  --danger-soft: rgba(255, 59, 48, 0.1);
  --green: #34C759;
  --blue: #0A84FF;
  --shadow: 0 2px 14px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 34px rgba(0, 0, 0, 0.14);
  --radius: 18px;
  --radius-sm: 12px;
  --nav-h: 52px;
  --tabbar-h: 58px;
}
[data-theme="dark"] {
  --bg: #000000;
  --bg-elevated: #1C1C1E;
  --card: #1C1C1E;
  --card-soft: #2C2C2E;
  --text: #FFFFFF;
  --text-secondary: #98989F;
  --text-tertiary: #636366;
  --separator: rgba(84, 84, 88, 0.55);
  --orange-soft: rgba(255, 149, 0, 0.2);
  --shadow: 0 2px 14px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 10px 34px rgba(0, 0, 0, 0.6);
}

/* ============ 基础 ============ */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}
button { font-family: inherit; border: none; background: none; color: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; color: var(--text); }
img { display: block; }

#app {
  max-width: 430px;
  margin: 0 auto;
  height: 100vh;
  height: 100dvh;
  background: var(--bg);
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
@media (min-width: 480px) {
  body { background: #E4E4E9; }
  [data-theme="dark"] body { background: #0A0A0A; }
  #app {
    border-left: 1px solid var(--separator);
    border-right: 1px solid var(--separator);
    box-shadow: var(--shadow-lg);
  }
}

/* ============ 导航栏 ============ */
.navbar {
  flex: none;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  padding-top: env(safe-area-inset-top);
  border-bottom: 0.5px solid var(--separator);
  z-index: 20;
}
.navbar-inner {
  height: var(--nav-h);
  display: flex;
  align-items: center;
  padding: 0 14px;
  gap: 6px;
  position: relative;
}
.nav-title {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.5px;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}
.nav-title.small { font-size: 17px; font-weight: 600; letter-spacing: 0; }
.nav-actions { display: flex; align-items: center; gap: 4px; }
.nav-back {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  color: var(--orange);
  background: var(--orange-soft);
  flex: none;
}
.nav-back.visible { display: flex; }
.nav-btn {
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  color: var(--orange);
  background: var(--orange-soft);
}
.nav-btn:active { opacity: 0.7; }
.nav-btn.ghost { background: var(--card-soft); color: var(--text); }

/* ============ 视图区 ============ */
.view {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 14px 16px calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 24px);
  scrollbar-width: none;
}
.view::-webkit-scrollbar { display: none; }

/* ============ 搜索与排序 ============ */
.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; }
.search-bar {
  flex: 1;
  height: 40px;
  background: var(--card-soft);
  border-radius: 12px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  gap: 8px;
  color: var(--text-secondary);
}
.search-bar svg { flex: none; }
.search-input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-size: 16px;
  color: var(--text);
}
.search-input::placeholder { color: var(--text-tertiary); }
.sort-btn {
  height: 40px;
  padding: 0 13px;
  border-radius: 12px;
  background: var(--card-soft);
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 6px;
  flex: none;
}
.sort-btn svg { color: var(--orange); }

/* 分类 chips */
.chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 2px 12px;
  scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none;
  padding: 7px 15px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  background: var(--card-soft);
  transition: transform .08s ease;
}
.chip:active { transform: scale(0.95); }
.chip.active { background: var(--orange); color: #fff; }

/* ============ 菜谱卡片网格 ============ */
.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 4px;
}
.card {
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform .1s ease;
}
.card:active { transform: scale(0.97); }
.card-img-wrap { position: relative; aspect-ratio: 1 / 1; background: var(--card-soft); }
.card-img { width: 100%; height: 100%; object-fit: cover; }
.card-img-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: 52px;
}
.card-count {
  position: absolute; right: 8px; bottom: 8px;
  background: rgba(0,0,0,0.55);
  color: #fff; font-size: 11px; font-weight: 600;
  padding: 2px 7px; border-radius: 999px;
  backdrop-filter: blur(4px);
}
.card-body { padding: 10px 12px 12px; }
.card-name {
  font-size: 15px; font-weight: 600; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  min-height: 40px;
}
.card-meta {
  margin-top: 7px;
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--text-secondary);
}
.card-meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--text-tertiary); }
.card-cat {
  color: var(--orange); font-weight: 600;
  background: var(--orange-soft);
  padding: 1px 8px; border-radius: 999px;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ============ 空状态 ============ */
.empty {
  text-align: center;
  padding: 70px 24px 40px;
}
.empty-icon {
  width: 96px; height: 96px;
  margin: 0 auto 20px;
  border-radius: 50%;
  background: var(--orange-soft);
  display: flex; align-items: center; justify-content: center;
  font-size: 46px;
}
.empty-title { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.empty-sub { font-size: 14px; color: var(--text-secondary); line-height: 1.6; }
.empty-btn {
  margin-top: 22px;
  padding: 12px 30px;
  border-radius: 999px;
  background: var(--orange-grad);
  color: #fff;
  font-size: 16px; font-weight: 700;
  box-shadow: 0 6px 18px rgba(255,149,0,0.35);
}

/* ============ 详情 ============ */
.gallery {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--card-soft);
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}
.gallery-track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.gallery-track::-webkit-scrollbar { display: none; }
.gallery-slide {
  flex: none;
  width: 100%;
  aspect-ratio: 4 / 3;
  scroll-snap-align: start;
  position: relative;
}
.gallery-slide img { width: 100%; height: 100%; object-fit: cover; }
.gallery-slide.placeholder {
  display: flex; align-items: center; justify-content: center;
  font-size: 72px;
}
.gallery-dots {
  position: absolute; left: 0; right: 0; bottom: 10px;
  display: flex; justify-content: center; gap: 6px;
  pointer-events: none;
}
.gallery-dots .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: rgba(255,255,255,0.55);
  transition: all .2s ease;
}
.gallery-dots .dot.active { width: 18px; border-radius: 999px; background: #fff; }
.gallery-count {
  position: absolute; right: 12px; top: 12px;
  background: rgba(0,0,0,0.5); color: #fff;
  font-size: 12px; font-weight: 600;
  padding: 3px 9px; border-radius: 999px;
}

.detail-name { font-size: 26px; font-weight: 800; letter-spacing: -0.4px; line-height: 1.25; }
.meta-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 4px; }
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 13px; font-weight: 600;
  background: var(--card-soft);
  color: var(--text-secondary);
}
.badge.cat { background: var(--orange-soft); color: var(--orange); }
.badge.diff-hard { color: var(--danger); background: var(--danger-soft); }
.badge.diff-mid { color: var(--orange); background: var(--orange-soft); }
.badge.diff-easy { color: var(--green); background: rgba(52,199,89,0.12); }
.badge svg { flex: none; }

.section { margin-top: 22px; }
.section-title {
  display: flex; align-items: center; gap: 8px;
  font-size: 20px; font-weight: 700; letter-spacing: -0.3px;
  margin-bottom: 12px;
}
.section-title::before {
  content: '';
  width: 4px; height: 18px;
  border-radius: 4px;
  background: var(--orange-grad);
}
.section-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 6px 16px;
}
.ingredient-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 11px 0;
  font-size: 15px; line-height: 1.5;
  border-bottom: 0.5px solid var(--separator);
}
.ingredient-item:last-child { border-bottom: none; }
.ingredient-item::before {
  content: '';
  flex: none;
  width: 7px; height: 7px;
  border-radius: 3px;
  background: var(--orange);
  margin-top: 8px;
}
.step-item {
  display: flex; gap: 14px;
  padding: 13px 0;
  border-bottom: 0.5px solid var(--separator);
}
.step-item:last-child { border-bottom: none; }
.step-num {
  flex: none;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--orange-grad);
  color: #fff;
  font-size: 13px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  margin-top: 1px;
}
.step-text { font-size: 15px; line-height: 1.65; color: var(--text); }
.note-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 15px 16px;
  font-size: 15px; line-height: 1.65;
  white-space: pre-wrap;
}
.note-empty { color: var(--text-tertiary); font-size: 14px; }

.detail-footer { height: 10px; }

/* ============ 表单 ============ */
.form-group { margin-bottom: 22px; }
.form-label {
  font-size: 13px; font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin: 0 4px 8px;
  display: flex; align-items: center; gap: 6px;
}
.form-label .required { color: var(--orange); }
.form-control {
  width: 100%;
  background: var(--card);
  border: 1.5px solid transparent;
  border-radius: var(--radius-sm);
  padding: 13px 15px;
  font-size: 16px;
  outline: none;
  box-shadow: var(--shadow);
  transition: border-color .15s ease;
}
.form-control:focus { border-color: var(--orange); }
.form-control::placeholder { color: var(--text-tertiary); }
textarea.form-control { resize: vertical; min-height: 90px; line-height: 1.6; }
.hint { font-size: 12px; color: var(--text-tertiary); margin: 6px 4px 0; line-height: 1.5; }

/* 分段控件 */
.segmented {
  display: flex;
  background: var(--card-soft);
  border-radius: 11px;
  padding: 3px;
  gap: 3px;
}
.segmented .seg {
  flex: 1;
  padding: 9px 0;
  border-radius: 9px;
  font-size: 14px; font-weight: 600;
  color: var(--text-secondary);
  text-align: center;
  transition: all .15s ease;
}
.segmented .seg.active {
  background: var(--card);
  color: var(--text);
  box-shadow: 0 1px 4px rgba(0,0,0,0.12);
}
.segmented .seg.active.orange { background: var(--orange); color: #fff; box-shadow: 0 3px 10px rgba(255,149,0,0.4); }

/* 照片选择 */
.photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.photo-tile {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--card);
  box-shadow: var(--shadow);
}
.photo-tile img { width: 100%; height: 100%; object-fit: cover; }
.photo-tile .cover-badge {
  position: absolute; left: 7px; top: 7px;
  background: var(--orange-grad);
  color: #fff;
  font-size: 10px; font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}
.photo-tile .photo-del {
  position: absolute; right: 6px; top: 6px;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: rgba(0,0,0,0.6);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
}
.photo-tile .photo-set-cover {
  position: absolute; left: 6px; bottom: 6px;
  font-size: 11px; font-weight: 600;
  color: #fff;
  background: rgba(0,0,0,0.55);
  padding: 3px 8px; border-radius: 999px;
}
.add-tile {
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  border: 2px dashed var(--text-tertiary);
  color: var(--text-secondary);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 4px;
  font-size: 12px; font-weight: 600;
  background: transparent;
}
.add-tile:active { opacity: 0.6; }

/* 步骤编辑器 */
.step-row {
  background: var(--card);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  padding: 12px;
  margin-bottom: 10px;
}
.step-head {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 8px;
}
.step-index {
  flex: none;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--orange-grad);
  color: #fff;
  font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.step-actions { margin-left: auto; display: flex; gap: 6px; }
.icon-btn {
  width: 32px; height: 32px;
  border-radius: 9px;
  background: var(--card-soft);
  color: var(--text-secondary);
  display: flex; align-items: center; justify-content: center;
  font-size: 15px;
}
.icon-btn:active { opacity: 0.6; }
.icon-btn.danger { color: var(--danger); background: var(--danger-soft); }
.step-row textarea {
  width: 100%;
  border: none; outline: none;
  background: transparent;
  font-size: 15px; line-height: 1.6;
  resize: vertical;
  min-height: 52px;
  color: var(--text);
}
.step-row textarea::placeholder { color: var(--text-tertiary); }
.add-step-btn {
  width: 100%;
  padding: 12px;
  border-radius: var(--radius-sm);
  background: var(--orange-soft);
  color: var(--orange);
  font-size: 14px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.add-step-btn:active { opacity: 0.7; }

/* 底部保存栏 */
.bottom-bar {
  flex: none;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-top: 0.5px solid var(--separator);
}
.btn-primary {
  width: 100%;
  padding: 15px;
  border-radius: 14px;
  background: var(--orange-grad);
  color: #fff;
  font-size: 17px; font-weight: 700;
  box-shadow: 0 6px 18px rgba(255,149,0,0.35);
}
.btn-primary:disabled { opacity: 0.45; box-shadow: none; }
.btn-primary:active { transform: scale(0.98); }
.btn-danger-outline {
  width: 100%;
  margin-top: 10px;
  padding: 14px;
  border-radius: 14px;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 16px; font-weight: 700;
}
.btn-danger-outline:active { opacity: 0.7; }

/* ============ 设置 ============ */
.settings-group { margin-bottom: 22px; }
.settings-group-title {
  font-size: 13px; font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin: 0 4px 8px;
}
.settings-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.setting-row {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  border-bottom: 0.5px solid var(--separator);
  text-align: left;
  width: 100%;
}
.setting-row:last-child { border-bottom: none; }
.setting-label { flex: 1; font-size: 16px; }
.setting-sub { font-size: 12px; color: var(--text-secondary); margin-top: 3px; line-height: 1.5; }
.setting-value { font-size: 14px; color: var(--text-secondary); }
.url-cell {
  font-size: 13px;
  color: var(--orange);
  font-weight: 600;
  background: var(--orange-soft);
  padding: 6px 12px;
  border-radius: 9px;
  max-width: 190px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.switch {
  flex: none;
  width: 51px; height: 31px;
  border-radius: 999px;
  background: var(--text-tertiary);
  position: relative;
  transition: background .2s ease;
}
.switch::after {
  content: '';
  position: absolute;
  top: 2px; left: 2px;
  width: 27px; height: 27px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 5px rgba(0,0,0,0.25);
  transition: transform .2s ease;
}
.switch.on { background: var(--green); }
.switch.on::after { transform: translateX(20px); }

/* ============ 底部 Tab ============ */
.tabbar {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  display: flex;
  background: color-mix(in srgb, var(--bg-elevated) 88%, transparent);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-top: 0.5px solid var(--separator);
  z-index: 30;
}
.tab-btn {
  flex: 1;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 2px;
  font-size: 10px; font-weight: 600;
  color: var(--text-secondary);
}
.tab-btn.active { color: var(--orange); }
.tab-add { position: relative; }
.tab-add svg {
  margin-top: -26px;
  width: 54px; height: 54px;
  padding: 11px;
  border-radius: 50%;
  background: var(--orange-grad);
  color: #fff;
  box-shadow: 0 6px 20px rgba(255,149,0,0.45);
}

/* ============ Toast ============ */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 34px);
  transform: translateX(-50%) translateY(20px);
  background: rgba(0,0,0,0.85);
  color: #fff;
  font-size: 14px; font-weight: 500;
  padding: 11px 20px;
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  transition: all .25s ease;
  z-index: 100;
  max-width: 86vw;
  text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* 选项弹层（排序/外观） */
.sheet-mask {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.35);
  z-index: 80;
  opacity: 0;
  transition: opacity .2s ease;
  display: flex; align-items: flex-end; justify-content: center;
  pointer-events: none;
}
.sheet-mask.show { opacity: 1; pointer-events: auto; }
.sheet {
  width: 100%;
  max-width: 430px;
  background: var(--bg-elevated);
  border-radius: 18px 18px 0 0;
  padding: 10px 12px calc(18px + env(safe-area-inset-bottom));
  transform: translateY(100%);
  transition: transform .25s ease;
  box-shadow: 0 -8px 30px rgba(0,0,0,0.18);
}
.sheet-mask.show .sheet { transform: translateY(0); }
.sheet-grab {
  width: 38px; height: 5px;
  border-radius: 999px;
  background: var(--text-tertiary);
  margin: 4px auto 12px;
}
.sheet-title {
  text-align: center;
  font-size: 14px; font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
}
.sheet-item {
  width: 100%;
  padding: 14px;
  font-size: 16px;
  border-radius: 12px;
  text-align: center;
  border-bottom: 0.5px solid var(--separator);
}
.sheet-item:last-child { border-bottom: none; }
.sheet-item.active { color: var(--orange); font-weight: 700; }
.sheet-item.cancel { color: var(--text-secondary); margin-top: 6px; font-weight: 600; }
.sheet-items { background: var(--card); border-radius: 14px; overflow: hidden; }

.hidden { display: none !important; }
/* ============ 附加样式 ============ */
.no-tabbar .tabbar { display: none; }
.no-tabbar .view { padding-bottom: 28px; }
.setting-label .setting-sub { display: block; }
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
input[type="number"] { -moz-appearance: textfield; appearance: textfield; }
input[type="search"]::-webkit-search-decoration,
input[type="search"]::-webkit-search-cancel-button { -webkit-appearance: none; }
input[type="search"] { -webkit-appearance: none; appearance: none; }
.navbar, .bottom-bar, .tabbar { background: var(--bg); }
/* ============ 选择模式 / 智能导入 / 参考链接 ============ */
.card-check {
  position: absolute; left: 8px; top: 8px;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: rgba(0,0,0,0.35);
  border: 2px solid #fff;
  color: #fff; font-size: 13px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  z-index: 2;
}
.card-check.on { background: var(--orange); }
.card.selected { outline: 2px solid var(--orange); }
.select-bar {
  position: absolute; left: 0; right: 0;
  bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px;
  background: var(--bg);
  background: color-mix(in srgb, var(--bg-elevated) 90%, transparent);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-top: 0.5px solid var(--separator);
  z-index: 25;
}
.select-info { flex: 1; font-size: 14px; color: var(--text-secondary); }
.select-info b { color: var(--orange); font-size: 17px; }
.btn-primary.small { width: auto; padding: 10px 18px; font-size: 14px; border-radius: 12px; }
.btn-ghost {
  padding: 10px 16px; border-radius: 12px;
  background: var(--card-soft); color: var(--text);
  font-size: 14px; font-weight: 700;
}
.btn-ghost:active { opacity: .7; }
.btn-ghost.wide { width: 100%; margin-top: 10px; }

.import-btn {
  width: 100%;
  display: flex; align-items: center; gap: 10px;
  padding: 14px;
  border-radius: var(--radius-sm);
  border: 1.5px dashed var(--orange);
  background: var(--orange-soft);
  color: var(--orange);
  font-size: 14px; font-weight: 700;
  text-align: left;
  margin-bottom: 20px;
  line-height: 1.4;
}
.import-btn:active { opacity: .7; }
.import-sheet .import-body { padding: 4px 2px 2px; }
.import-sheet .import-body textarea { box-shadow: none; background: var(--card-soft); }
.import-sheet .btn-primary { margin-top: 12px; }

.empty-btn.secondary {
  display: block;
  margin: 14px auto 0;
  background: var(--card);
  color: var(--orange);
  box-shadow: var(--shadow);
}

.link-row {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 0;
  border-bottom: 0.5px solid var(--separator);
  text-decoration: none;
  color: var(--blue);
  font-size: 14px;
}
.link-row:last-child { border-bottom: none; }
.link-ico { flex: none; }
.link-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* ============ 草稿 / 视频解析 ============ */
.draft-badge {
  display: inline-block;
  margin-left: 6px;
  vertical-align: 2px;
  font-size: 10px; font-weight: 700;
  color: var(--orange);
  background: var(--orange-soft);
  border: 1px solid var(--orange);
  border-radius: 999px;
  padding: 1px 7px;
}

.sort-btn.icon { padding: 0 11px; }
/* ============ 手机自适应优化 ============ */
html, body { overflow-x: hidden; }
.search-bar { min-width: 0; }
.search-input { min-width: 0; }
.setting-label { min-width: 0; overflow-wrap: anywhere; }
.setting-sub { overflow-wrap: anywhere; }
.url-cell { overflow-wrap: anywhere; max-width: 100%; }
.link-row { min-width: 0; }
.link-text { min-width: 0; }
.settings-seg { flex: 1 1 180px; min-width: 0; max-width: 240px; }
.settings-group { margin-bottom: 18px; }
.settings-group-title { margin-bottom: 6px; }
.setting-row { padding: 12px 16px; }

/* 超小屏：设置行允许换行、分段控件占满整行 */
@media (max-width: 380px) {
  .setting-row { flex-wrap: wrap; }
  .settings-seg { flex: 1 1 100%; max-width: none; }
  .toolbar { gap: 6px; }
  .sort-btn { padding: 0 10px; font-size: 13px; }
  .search-bar { padding: 0 10px; }
}
/* 自定义分类输入 */
.custom-cat { margin-top: 8px; }
/* ============ 一日菜谱预览页 ============ */
.export-head { text-align: center; padding: 8px 0 18px; }
.export-title { font-size: 26px; font-weight: 800; letter-spacing: -0.3px; }
.export-date { color: var(--text-secondary); font-size: 14px; margin-top: 6px; }
.export-sub { color: var(--text-tertiary); font-size: 12px; margin-top: 6px; }
.export-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  margin-bottom: 14px;
}
.export-card-name { font-size: 19px; font-weight: 700; text-align: center; margin-bottom: 12px; }
.export-card-img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: var(--radius-sm);
  background: var(--card-soft);
}
.export-card-img.placeholder {
  display: flex; align-items: center; justify-content: center;
  font-size: 64px;
}
/* ============ 登录 / 注册 ============ */
.auth-wrap {
  display: flex; align-items: flex-start; justify-content: center;
  padding: 48px 24px;
  min-height: calc(100dvh - 120px);
}
.auth-card {
  width: 100%; max-width: 340px;
  background: var(--card);
  border-radius: 22px;
  box-shadow: var(--shadow-lg);
  padding: 28px 24px;
  text-align: center;
}
.auth-logo { font-size: 54px; }
.auth-title { font-size: 20px; font-weight: 800; margin: 12px 0 4px; }
.auth-sub { font-size: 13px; color: var(--text-secondary); margin-bottom: 18px; }
.auth-input { margin-bottom: 12px; text-align: left; }
.auth-card .btn-primary { margin-top: 6px; }
.auth-switch { margin-top: 16px; font-size: 14px; color: var(--text-secondary); }
.auth-link { color: var(--orange); font-weight: 700; }
/* 公网地址醒目展示 */
.url-cell.public {
  max-width: 100%;
  width: 100%;
  text-align: center;
  font-size: 15px;
  font-weight: 700;
  padding: 12px 14px;
  background: var(--orange);
  color: #fff;
  border-radius: 12px;
  overflow-wrap: anywhere;
  white-space: normal;
  line-height: 1.4;
}
