/* ==========================================================================
   宝葫芦 · 趣味暖色视觉系统（coral 暖调 · 深浅双色 · 零依赖）
   设计语言：暖橙渐变 + 彩带卡片 + 旋转金币 + 运势胶囊 + 彩蛋名言
   ========================================================================== */

/* ---------- 主题变量 ---------- */
:root {
  --bg-a: #fff7ef;              /* 暖米背景 */
  --bg-b: #ffe9d6;              /* 暖橙渐变 */
  --card: rgba(255, 255, 255, 0.78);
  --card-border: rgba(255, 126, 95, 0.16);
  --text: #4a3728;              /* 暖棕文字 */
  --text-sub: #a0805f;
  --primary: #ff7e5f;           /* coral 主色 */
  --primary-soft: rgba(255, 126, 95, 0.14);
  --accent: #feb47b;            /* 辅助暖橙 */
  --free: #10b981;
  --free-soft: rgba(16, 185, 129, 0.13);
  --gold: #f59e0b;
  --gold-soft: rgba(245, 158, 11, 0.16);
  --danger: #ef4444;
  --shadow: 0 2px 8px rgba(160, 120, 70, 0.09);
  --shadow-hover: 0 18px 40px rgba(255, 126, 95, 0.22);
  --input-bg: rgba(255, 255, 255, 0.85);
  --hl: #fbbf24;
}
html[data-theme="dark"] {
  --bg-a: #2a1f19;              /* 暖深棕 */
  --bg-b: #3a2a22;
  --card: rgba(58, 42, 34, 0.72);
  --card-border: rgba(254, 180, 123, 0.18);
  --text: #f5e9dd;
  --text-sub: #c9a88c;
  --primary: #ff8a6b;
  --primary-soft: rgba(255, 138, 107, 0.2);
  --accent: #feb47b;
  --free-soft: rgba(16, 185, 129, 0.18);
  --gold-soft: rgba(245, 158, 11, 0.2);
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.32);
  --shadow-hover: 0 18px 40px rgba(0, 0, 0, 0.5);
  --input-bg: rgba(42, 31, 25, 0.7);
}

/* ---------- 基础 ---------- */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: "Inter", "SF Pro Display", -apple-system, BlinkMacSystemFont,
    "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: linear-gradient(160deg, var(--bg-a), var(--bg-b));
  color: var(--text);
  min-height: 100vh;
  transition: background 0.3s, color 0.3s;
}
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea, select { font-family: inherit; color: var(--text); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: 30px 20px 18px;
  background:
    radial-gradient(circle at 12% 20%, rgba(255, 154, 139, 0.22), transparent 42%),
    radial-gradient(circle at 88% 8%, rgba(254, 180, 123, 0.25), transparent 40%),
    linear-gradient(135deg, rgba(255, 126, 95, 0.12), transparent 65%);
  overflow: hidden;
}
.hero::after { /* 装饰光斑 */
  content: "";
  position: absolute; width: 260px; height: 260px; border-radius: 50%;
  right: -60px; top: -80px;
  background: radial-gradient(circle, rgba(255, 154, 139, 0.18), transparent 70%);
  pointer-events: none;
}
.hero-inner {
  max-width: 1200px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  flex-wrap: wrap; position: relative; z-index: 1;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-logo {
  width: 46px; height: 46px;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  animation: logoWave 3.2s ease-in-out infinite;
  filter: drop-shadow(0 6px 14px rgba(255, 126, 95, 0.4));
}
.brand-logo img {
  width: 100%; height: 100%;
  object-fit: contain;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.9);
}
@keyframes logoWave { 0%, 100% { transform: rotate(-6deg); } 50% { transform: rotate(8deg) translateY(-3px); } }
.brand-title {
  font-size: 23px; font-weight: 800; letter-spacing: -0.02em;
  background: linear-gradient(120deg, #ff6a88, #ff9a8b 55%, #feb47b);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.brand-slogan { font-size: 12px; color: var(--text-sub); margin-top: 2px; }
/* 动态问候 */
.greeting {
  margin-top: 5px; font-size: 13.5px; font-weight: 600;
  color: var(--primary);
  display: flex; align-items: center; gap: 6px;
}
.greeting::before { content: "☀️"; font-size: 12px; }
.hero-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* 运势胶囊（刷新随机小惊喜） */
.fortune-pill {
  font-size: 12.5px; font-weight: 600;
  padding: 7px 14px; border-radius: 999px;
  color: #fff;
  background: linear-gradient(120deg, #ff9a8b, #ff6a88, #ff99ac);
  background-size: 180% 180%;
  box-shadow: 0 6px 16px rgba(255, 106, 136, 0.4);
  animation: fortuneShine 3s ease infinite, fortuneIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  white-space: nowrap;
}
@keyframes fortuneShine { 0%, 100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }
@keyframes fortuneIn { from { opacity: 0; transform: translateY(-8px) scale(0.8); } }

/* 积分胶囊：旋转金币 */
.credits-pill {
  background: var(--gold-soft);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: var(--gold);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px; font-weight: 700;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s;
}
.credits-pill:hover { transform: translateY(-2px) scale(1.03); box-shadow: 0 6px 16px rgba(245,158,11,.3); }
.credits-pill.low { color: var(--danger); border-color: rgba(239,68,68,.4); background: rgba(239,68,68,.1); }
.coin {
  position: relative;
  display: inline-block;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffe9a8, #f5b93c 48%, #c98a0c 85%);
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.38), 0 1px 3px rgba(150,90,0,.35);
  animation: coinSpin 5s linear infinite;
  transform-style: preserve-3d;
  vertical-align: -2px;
}
.coin::after {
  content: "";
  position: absolute;
  left: 50%; top: 50%;
  width: 8px; height: 8px;
  border: 1.5px solid rgba(201,138,12,.55);
  border-radius: 50%;
  transform: translate(-50%, -50%);
}
/* 弹窗大金币（外层 .confirm-icon 已自带翻转动画，内层不再重复转） */
.confirm-icon .coin {
  width: 46px; height: 46px;
  vertical-align: middle;
  animation: none;
}
.confirm-icon .coin::after {
  width: 28px; height: 28px;
  border-width: 2.5px;
}
@keyframes coinSpin {
  0% { transform: rotateY(0deg); }
  50% { transform: rotateY(180deg) scale(1.15); }
  100% { transform: rotateY(360deg); }
}

.theme-toggle {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--card); border: 1px solid var(--card-border);
  box-shadow: var(--shadow); font-size: 16px;
  display: grid; place-items: center;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.theme-toggle:hover { transform: rotate(20deg) scale(1.08); }

/* ---------- 搜索框 ---------- */
.search-wrap {
  max-width: 640px; margin: 20px auto 0; position: relative;
  transition: max-width 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
.search-wrap:focus-within { max-width: 768px; }
.search-icon { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); font-size: 15px; opacity: .6; }
.search-wrap input {
  width: 100%;
  padding: 12px 52px 12px 42px;
  border-radius: 16px;
  border: 1px solid var(--card-border);
  background: var(--input-bg);
  box-shadow: var(--shadow);
  font-size: 15px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: box-shadow 0.3s, backdrop-filter 0.3s, background 0.3s;
}
.search-wrap:focus-within input {
  box-shadow: 0 8px 28px rgba(255, 126, 95, 0.22);
  border-color: rgba(255, 126, 95, 0.4);
  background: var(--input-bg);
}
.search-kbd {
  position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
  font-size: 11px; padding: 3px 8px; border-radius: 6px;
  background: var(--primary-soft); color: var(--primary);
  border: 1px solid rgba(255,126,95,.25);
  opacity: .9; pointer-events: none;
}
/* 快速标签 */
.search-tags {
  max-width: 640px; margin: 10px auto 0;
  display: flex; gap: 8px; justify-content: center; flex-wrap: wrap;
}
.tag-chip {
  font-size: 12px; padding: 4px 12px; border-radius: 999px;
  color: var(--text-sub); background: var(--card);
  border: 1px solid var(--card-border);
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.tag-chip:hover { color: #fff; background: var(--primary); border-color: transparent; transform: translateY(-2px); }

/* ---------- 吸顶锚点导航 ---------- */
.anchor-bar {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg-a) 78%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--card-border);
  padding: 8px 20px;
  display: flex; gap: 8px; overflow-x: auto;
  scrollbar-width: none;
}
.anchor-bar::-webkit-scrollbar { display: none; }
.anchor-pill {
  flex-shrink: 0;
  padding: 6px 14px; border-radius: 999px;
  font-size: 13px; color: var(--text-sub);
  border: 1px solid transparent;
  transition: all 0.25s cubic-bezier(0.22, 1, 0.36, 1);
  white-space: nowrap;
  display: inline-flex; align-items: center; gap: 6px;
}
.anchor-pill:hover { color: var(--primary); background: var(--primary-soft); }
.anchor-pill.active { color: #fff; background: var(--primary); box-shadow: 0 4px 12px rgba(255,126,95,.35); }
.pill-count {
  font-size: 10.5px; font-weight: 700;
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
  display: inline-grid; place-items: center;
  background: var(--primary-soft); color: var(--primary);
}
.anchor-pill.active .pill-count { background: rgba(255,255,255,.25); color: #fff; }

/* ---------- 容器 / 区块 ---------- */
.container { max-width: 1200px; margin: 0 auto; padding: 20px 20px 40px; }
.tool-section { margin-top: 8px; scroll-margin-top: 68px; }
.section-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 4px 12px;
}
.section-title { font-size: 18px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.section-title .count { font-size: 12px; color: var(--text-sub); font-weight: 400; }
.fold-btn {
  width: 30px; height: 30px; border-radius: 10px;
  display: grid; place-items: center;
  color: var(--text-sub); background: var(--card);
  border: 1px solid var(--card-border); box-shadow: var(--shadow);
  font-size: 13px; transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), color 0.2s;
}
.fold-btn:hover { color: var(--primary); }
.fold-btn.closed { transform: rotate(-90deg); }
.section-body.collapsed { display: none; }

/* ---------- 程序员大组：子分类 ---------- */
.group-subcats { display: flex; flex-direction: column; gap: 14px; }
.subcat-chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 2px 4px 12px; }
.subcat-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: 999px; cursor: pointer;
  font-size: 13px; font-weight: 600; color: var(--text-sub);
  border: 1px solid var(--card-border); background: var(--card); box-shadow: var(--shadow);
  transition: all .2s;
}
.subcat-chip:hover { border-color: var(--primary); color: var(--primary); transform: translateY(-1px); }
.subcat-chip .pill-count { background: var(--primary-soft); color: var(--primary); }
.subcat {
  border: 1px solid var(--card-border); border-radius: 14px; padding: 6px 12px 14px;
  background: var(--card); scroll-margin-top: 76px;
}
.subcat-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 2px 6px; cursor: pointer; user-select: none;
}
.subcat-title { font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.subcat-title .count { font-size: 12px; color: var(--text-sub); font-weight: 400; }
.fold-btn.sm { width: 26px; height: 26px; border-radius: 8px; font-size: 12px; }
.subcat-body.collapsed { display: none; }

/* ---------- 工具卡片网格（会说话） ---------- */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 14px;
}
@media (min-width: 1100px) { .tool-grid { grid-template-columns: repeat(4, 1fr); } }
.tool-card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 14px 16px;
  min-height: 126px;
  display: flex; flex-direction: column; justify-content: space-between;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.3s, border-color 0.3s;
  opacity: 0; /* 入场动效起点 */
}
/* 顶部彩带：悬停时滑入 */
.tool-card::before {
  content: "";
  position: absolute; top: 0; left: 0; right: 0; height: 5px;
  background: linear-gradient(90deg, #ff9a8b, #ff6a88, #feb47b, #ff9a8b);
  background-size: 200% 100%;
  opacity: 0; transform: translateY(-5px);
  transition: opacity 0.25s, transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.tool-card.enter { animation: cardIn 0.3s cubic-bezier(0.22, 1, 0.36, 1) forwards; }
@keyframes cardIn {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}
.tool-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-hover);
  border-color: rgba(255, 126, 95, 0.45);
}
.tool-card:hover::before { opacity: 1; transform: translateY(0); }
.tool-card:active { transform: scale(0.96) translateY(-2px); transition-duration: 0.12s; } /* 点击弹性 */
.tool-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.tool-card-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.tool-icon {
  width: 38px; height: 38px; flex-shrink: 0;
  display: grid; place-items: center; font-size: 19px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(255,154,139,.25), rgba(254,180,123,.25));
  transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1);
}
.tool-card:hover .tool-icon { transform: scale(1.15) rotate(-6deg); }
.tool-name { font-size: 14.5px; font-weight: 700; line-height: 1.3; }
.tool-desc {
  font-size: 12px; color: var(--text-sub); margin-top: 2px;
  overflow: hidden; text-overflow: ellipsis; display: -webkit-box;
  -webkit-line-clamp: 1; -webkit-box-orient: vertical;
}
/* 俏皮后缀：会说话的卡片 */
.tool-funny {
  font-size: 11.5px; font-style: italic;
  color: var(--primary);
  margin-top: 4px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tool-funny::before { content: "💬 "; font-style: normal; }
.badge {
  flex-shrink: 0;
  font-size: 11px; padding: 2px 8px; border-radius: 999px; font-weight: 600;
}
.badge.free { color: var(--free); background: var(--free-soft); }
.badge.paid { color: var(--gold); background: var(--gold-soft); border: 1px solid rgba(245,158,11,.3); }
.tool-card-live {
  font-size: 11.5px; color: var(--text-sub);
  font-variant-numeric: tabular-nums;
  border-top: 1px dashed var(--card-border);
  padding-top: 7px; margin-top: 6px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tool-card-live .live-label { color: var(--primary); font-weight: 600; margin-right: 4px; }

/* ---------- 搜索高亮 ---------- */
mark.hl {
  background: transparent; color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--hl);
  text-decoration-thickness: 2px;
  text-underline-offset: 2px;
}

/* ---------- 弹窗 ---------- */
.modal-mask {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(42, 31, 25, 0.45);
  backdrop-filter: blur(6px);
  display: grid; place-items: center; padding: 20px;
  animation: fadeIn 0.2s ease;
}
.modal {
  width: min(680px, 100%);
  max-height: 84vh; overflow-y: auto;
  background: var(--bg-a);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 30px 60px rgba(0,0,0,.25);
  animation: modalIn 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes fadeIn { from { opacity: 0; } }
@keyframes modalIn {
  from { opacity: 0; transform: translateY(30px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.modal-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.modal-head .tool-icon { width: 44px; height: 44px; font-size: 22px; }
.modal-title { font-size: 18px; font-weight: 700; }
.modal-sub { font-size: 12px; color: var(--text-sub); margin-top: 2px; }
.modal-close {
  margin-left: auto; width: 34px; height: 34px; border-radius: 10px;
  display: grid; place-items: center; color: var(--text-sub);
  background: var(--card); border: 1px solid var(--card-border); font-size: 14px;
  transition: all 0.2s;
}
.modal-close:hover { color: var(--danger); transform: rotate(90deg); }

/* ---------- 表单控件（弹窗内通用） ---------- */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12.5px; color: var(--text-sub); margin-bottom: 6px; font-weight: 500; }
.field .row { display: flex; gap: 8px; }
.field .row > * { flex: 1; }
.input, .textarea, .select {
  width: 100%;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid var(--card-border);
  background: var(--input-bg);
  font-size: 14px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.input:focus, .textarea:focus, .select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(255, 126, 95, 0.15);
}
.textarea { min-height: 120px; resize: vertical; line-height: 1.5; font-family: ui-monospace, Consolas, monospace; font-size: 13px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 18px; border-radius: 10px;
  font-size: 14px; font-weight: 600;
  background: linear-gradient(135deg, #ff7e5f, #ff6a88);
  color: #fff;
  box-shadow: 0 4px 12px rgba(255, 106, 136, 0.3);
  transition: transform 0.2s cubic-bezier(0.34,1.56,0.64,1), box-shadow 0.2s, filter 0.2s;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(255,106,136,.4); }
.btn:active { transform: scale(0.96); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }
.btn.ghost { background: var(--card); color: var(--text); border: 1px solid var(--card-border); box-shadow: var(--shadow); }
.btn.ghost:hover { border-color: var(--primary); color: var(--primary); box-shadow: var(--shadow); }
.btn.sm { padding: 6px 12px; font-size: 12.5px; border-radius: 8px; }
.btn.gold { background: linear-gradient(135deg, #f59e0b, #f97316); box-shadow: 0 4px 14px rgba(245,158,11,.35); }
.btn.gold:hover { box-shadow: 0 8px 22px rgba(245,158,11,.45); }
.btn.danger-ghost { background: transparent; color: var(--danger); border: 1px solid rgba(239,68,68,.4); }

/* 输出框 */
.output {
  background: var(--input-bg);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13px;
  min-height: 44px;
  white-space: pre-wrap; word-break: break-all;
  line-height: 1.6;
  font-family: ui-monospace, Consolas, monospace;
  position: relative;
}
.output .copy-btn {
  position: absolute; top: 6px; right: 6px;
  font-size: 11.5px; padding: 3px 9px; border-radius: 7px;
  background: var(--primary-soft); color: var(--primary);
  transition: background 0.2s;
}
.output .copy-btn:hover { background: var(--primary); color: #fff; }
.output .copy-btn .pop-tip { position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); }

/* ---------- API 工具 ---------- */
.api-area { margin-top: 4px; }
.api-result { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 12px; background: var(--card); border: 1px solid var(--card-border); }
.api-result img { width: 56px; height: 56px; object-fit: cover; border-radius: 10px; }
/* 工具结果大图：统一限制尺寸（最大高 300px、宽不超容器、不裁切） */
.tool-img,
.api-result img.tool-img {
  display: block;
  width: auto; height: auto;
  max-width: 100%;
  max-height: 300px;
  object-fit: contain;
  margin: 0 auto;
  border-radius: 12px;
  box-shadow: var(--shadow);
}
.api-state { font-size: 13px; color: var(--text-sub); text-align: center; padding: 18px 0; }
.spinner {
  width: 16px; height: 16px; border: 2px solid var(--primary-soft);
  border-top-color: var(--primary); border-radius: 50%;
  display: inline-block; animation: spin 0.8s linear infinite; vertical-align: -3px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Diff ---------- */
.diff-line { font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; padding: 2px 10px; border-radius: 4px; white-space: pre-wrap; word-break: break-all; }
.diff-add { background: rgba(16, 185, 129, 0.16); color: #10b981; }
.diff-del { background: rgba(239, 68, 68, 0.14); color: #ef4444; }

/* ---------- AI 段子手：类型筛选 tabs ---------- */
.joke-tabs { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-bottom: 12px; }
.joke-tab {
  padding: 6px 14px; border-radius: 999px; cursor: pointer; font-size: 13px; font-weight: 600;
  border: 1px solid var(--card-border); background: var(--card); color: var(--text-sub);
  transition: all .2s;
}
.joke-tab:hover { border-color: var(--primary); color: var(--primary); }
.joke-tab.active {
  color: #fff; border-color: transparent;
  background: linear-gradient(135deg, #ff7e5f, #ff6a88);
  box-shadow: 0 4px 12px rgba(255,106,136,.35);
}
.joke-tag {
  display: inline-block; margin-right: 8px; padding: 1px 8px; border-radius: 999px;
  font-size: 11px; font-weight: 700; vertical-align: 1px;
  background: var(--primary-soft); color: var(--primary);
}

/* ---------- 照片卡通化 ---------- */
.pc-tips { font-size: 12px; color: var(--text-sub); }
.pc-styles { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.pc-compare {
  display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-start; justify-content: center;
}
.pc-col {
  flex: 1 1 220px; min-width: 0; text-align: center;
  border: 1px solid var(--card-border); border-radius: 14px; padding: 10px;
  background: var(--card);
}
.pc-col img {
  width: 100%; max-height: 280px; object-fit: contain; border-radius: 10px; display: block;
}
.pc-label { font-size: 13px; font-weight: 700; color: var(--text-sub); margin-bottom: 8px; }

/* ---------- 照片祛水印 ---------- */
.cl-stage {
  border: 1px dashed var(--card-border); border-radius: 14px; overflow: hidden;
  background: repeating-conic-gradient(#f5f5f5 0 25%, #fff 0 50%) 0 0 / 22px 22px;
  display: flex; justify-content: center; max-height: 480px;
}
.dark .cl-stage { background: repeating-conic-gradient(#1c1c1c 0 25%, #262626 0 50%) 0 0 / 22px 22px; }
.cl-stage canvas {
  max-width: 100%; max-height: 480px; object-fit: contain; cursor: crosshair;
  touch-action: none;
}
.share-text {
  margin: 12px 0; padding: 12px 14px; border-radius: 12px; text-align: left;
  font-size: 13px; line-height: 1.7; user-select: all;
  background: var(--card); border: 1px dashed var(--primary);
  color: var(--text);
}

/* ---------- 付费确认弹窗（游戏化） ---------- */
.confirm-mask { position: fixed; inset: 0; z-index: 120; background: rgba(42,31,25,.55); backdrop-filter: blur(4px); display: grid; place-items: center; padding: 20px; animation: fadeIn .2s; }
.confirm-card {
  width: min(360px, 100%);
  background: var(--bg-a); border: 1px solid var(--card-border);
  border-radius: 18px; padding: 24px; text-align: center;
  box-shadow: 0 30px 60px rgba(0,0,0,.3);
  animation: modalIn .3s cubic-bezier(0.22,1,0.36,1);
}
.confirm-icon {
  font-size: 46px; margin-bottom: 10px;
  display: inline-block; animation: coinSpin 3s ease-in-out infinite;
}
.confirm-title { font-size: 17px; font-weight: 700; margin-bottom: 6px; }
.confirm-desc { font-size: 13px; color: var(--text-sub); margin-bottom: 16px; line-height: 1.6; }
.confirm-actions { display: flex; gap: 10px; }
.confirm-actions .btn { flex: 1; }

/* ---------- 复制弹簧弹窗 ---------- */
.pop-tip {
  background: #22c55e; color: #fff;
  padding: 3px 10px; border-radius: 999px; font-size: 12px;
  white-space: nowrap; pointer-events: none;
  box-shadow: 0 4px 12px rgba(34,197,94,.35);
  animation: springPop .35s cubic-bezier(0.34,1.56,0.64,1), fadeOut .4s ease 1.1s forwards;
}
@keyframes springPop {
  from { opacity: 0; transform: translateX(-50%) scale(.5); }
  60% { opacity: 1; transform: translateX(-50%) scale(1.15); }
  to { opacity: 1; transform: translateX(-50%) scale(1); }
}
@keyframes fadeOut { to { opacity: 0; transform: translateX(-50%) scale(.9); } }

/* ---------- Toast ---------- */
.toast {
  position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%);
  background: linear-gradient(120deg, #ff7e5f, #ff6a88);
  color: #fff;
  padding: 10px 20px; border-radius: 999px; font-size: 13px; font-weight: 500;
  z-index: 200; opacity: 0; pointer-events: none;
  box-shadow: 0 10px 30px rgba(255,106,136,.35);
  transition: opacity .3s, transform .3s cubic-bezier(0.34,1.56,0.64,1);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(-6px); }

/* ---------- 充值弹窗 ---------- */
.recharge-modal {
  position: fixed; inset: 0; z-index: 150;
  background: rgba(42,31,25,.55); backdrop-filter: blur(4px);
  display: grid; place-items: center; padding: 20px; animation: fadeIn .2s;
}
.recharge-modal[hidden] { display: none; }
.recharge-card {
  width: min(340px, 100%);
  background: var(--bg-a); border: 1px solid var(--card-border);
  border-radius: 18px; padding: 26px; text-align: center; position: relative;
  box-shadow: 0 30px 60px rgba(0,0,0,.3);
  animation: modalIn .3s cubic-bezier(0.22,1,0.36,1);
}
.recharge-close { position: absolute; top: 12px; right: 12px; width: 30px; height: 30px; border-radius: 9px; color: var(--text-sub); }
.recharge-close:hover { color: var(--danger); }
.recharge-card h3 { font-size: 17px; margin-bottom: 8px; }
.recharge-tip { font-size: 12.5px; color: var(--text-sub); line-height: 1.7; margin-bottom: 14px; }
.qr-tabs { display: flex; gap: 8px; justify-content: center; margin-bottom: 14px; }
.qr-tab {
  padding: 6px 18px; border-radius: 999px; font-size: 13px;
  color: var(--text-sub); background: var(--card); border: 1px solid var(--card-border);
  cursor: pointer; transition: all .2s;
}
.qr-tab:hover { color: var(--text); border-color: var(--accent); }
.qr-tab.active {
  background: linear-gradient(135deg, #10b981, #059669); color: #fff;
  border-color: transparent; box-shadow: 0 4px 12px rgba(16,185,129,.35);
}
.qr-box { margin-bottom: 14px; }
.qr-img-wrap {
  width: 180px; height: 180px; margin: 0 auto;
  border: 2px dashed var(--card-border); border-radius: 14px;
  display: grid; place-items: center; background: #fff; overflow: hidden;
}
.qr-img-wrap img { width: 100%; height: 100%; object-fit: contain; }
.qr-img-wrap.missing { background: var(--card); }
.qr-missing { font-size: 12px; color: var(--text-sub); line-height: 1.9; text-align: center; padding: 0 12px; }
.qr-missing code { background: var(--bg-b); padding: 1px 6px; border-radius: 4px; font-size: 11px; }
.qr-tip { font-size: 12px; color: var(--text-sub); line-height: 1.7; margin-top: 10px; }
.recharge-price { font-size: 12px; color: var(--gold); font-weight: 600; }

/* ---------- Footer：彩蛋名言 ---------- */
.footer { text-align: center; padding: 28px 20px 44px; }
.quote {
  max-width: 560px; margin: 0 auto 16px;
  font-size: 14.5px; font-weight: 600; line-height: 1.8;
  color: var(--text);
  padding: 14px 22px; border-radius: 14px;
  background: var(--card); border: 1px dashed var(--card-border);
  box-shadow: var(--shadow);
}
.quote::before { content: "✨ "; }
.quote.fade { animation: quoteIn 0.6s ease; }
@keyframes quoteIn { from { opacity: 0; transform: translateY(10px); } }

/* ---------- 趣味算命 ---------- */
.ft-report {
  background: linear-gradient(160deg, var(--card), rgba(254, 180, 123, 0.12));
  border: 1px solid var(--card-border); border-radius: 16px;
  padding: 18px 16px 14px; box-shadow: var(--shadow);
}
/* 头部：名字超长可截断，日期不换行 */
.ft-head {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 8px; margin-bottom: 14px;
}
.ft-name {
  font-size: 15px; font-weight: 700; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ft-date { font-size: 11.5px; color: var(--text-sub); white-space: nowrap; }
/* 星座运势卡片 */
.ft-zodiac {
  display: flex; flex-direction: column; gap: 8px;
  margin-bottom: 12px; padding: 14px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(254, 180, 123, 0.16), rgba(245, 158, 11, 0.07));
  border: 1px solid rgba(245, 158, 11, 0.35);
}
.ft-zodiac-head { display: flex; align-items: center; gap: 12px; }
.ft-zodiac-icon {
  width: 46px; height: 46px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; line-height: 1;
  border-radius: 12px;
  background: linear-gradient(135deg, #f59e0b, #ff7e5f);
  box-shadow: var(--shadow);
}
.ft-zodiac-meta { min-width: 0; }
.ft-zodiac-name { font-size: 14.5px; font-weight: 800; }
.ft-zodiac-range { font-size: 11px; color: var(--text-sub); margin-top: 2px; }
.ft-zodiac-text { font-size: 13px; line-height: 1.6; color: var(--text); }
.ft-zodiac-tags { display: flex; flex-wrap: wrap; gap: 6px; }
/* 总分区：小标签 + 大数字 + 评级，层次清晰 */
.ft-score { text-align: center; margin-bottom: 12px; }
.ft-score-label {
  font-size: 11.5px; letter-spacing: 4px; text-indent: 4px;
  color: var(--text-sub); text-transform: uppercase; margin-bottom: 6px;
}
.ft-total {
  font-size: 42px; font-weight: 800; line-height: 1;
  background: linear-gradient(120deg, #f59e0b, #ff7e5f);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.ft-total i { font-style: normal; font-size: 15px; margin-left: 3px; }
.ft-grade {
  display: inline-block; margin: 8px 0 10px;
  font-size: 12.5px; font-weight: 700; color: var(--gold);
  padding: 4px 14px; border-radius: 999px;
  background: var(--gold-soft); border: 1px solid rgba(245, 158, 11, 0.35);
}
.ft-bar {
  height: 8px; border-radius: 999px; overflow: hidden;
  background: var(--card-border); position: relative;
}
.ft-bar i {
  display: block; height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, #feb47b, #ff7e5f, #f59e0b);
  transition: width .6s cubic-bezier(0.22, 1, 0.36, 1);
}
.ft-bar.small { height: 6px; margin: 6px 0; }
/* 四维卡片：2 列网格，卡片 hover 微动效 */
.ft-dims { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.ft-dim {
  background: var(--card); border: 1px solid var(--card-border);
  border-radius: 12px; padding: 10px 12px;
  transition: transform .18s ease, box-shadow .18s ease;
}
.ft-dim:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.ft-dim-top { display: flex; justify-content: space-between; align-items: center; font-size: 13px; }
.ft-dim-top b {
  font-size: 16px; font-weight: 800;
  background: linear-gradient(120deg, #f59e0b, #ff7e5f);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.ft-dim-text { font-size: 12px; color: var(--text-sub); line-height: 1.6; }
/* 宜忌：标签徽章 + 词组 chips */
.ft-yiji { margin-bottom: 12px; }
.ft-yiji-row {
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
  font-size: 12.5px; margin-bottom: 6px;
}
.ft-yiji-label {
  font-size: 11.5px; font-weight: 700; padding: 3px 9px;
  border-radius: 6px; margin-right: 2px; line-height: 1.4;
}
.ft-yiji-label.good { color: var(--free); background: var(--free-soft); }
.ft-yiji-label.bad { color: var(--danger); background: rgba(239, 68, 68, 0.08); }
.ft-chip {
  font-size: 11.5px; padding: 3px 10px; border-radius: 999px;
  border: 1px solid var(--card-border);
}
.ft-chip.good { color: var(--free); background: var(--free-soft); border-color: rgba(16, 185, 129, 0.3); }
.ft-chip.bad { color: var(--danger); background: rgba(239, 68, 68, 0.08); border-color: rgba(239, 68, 68, 0.25); }
/* 幸运：小标题 + 词组 chips，窄屏自动换行不凌乱 */
.ft-lucky {
  display: flex; flex-direction: column; align-items: flex-start; gap: 8px;
  font-size: 12.5px; color: var(--text); margin-bottom: 12px;
  padding: 10px 12px; border-radius: 10px;
  background: var(--gold-soft); border: 1px dashed rgba(245, 158, 11, 0.4);
}
.ft-lucky-label { font-size: 12.5px; font-weight: 700; color: var(--gold); }
.ft-lucky-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ft-chip.luck { color: var(--gold); background: var(--card); border-color: rgba(245, 158, 11, 0.35); font-weight: 600; }
/* 签文：小标签 + 居中诗句 */
.ft-poem {
  font-size: 13.5px; font-weight: 600; line-height: 1.65; text-align: center;
  color: var(--text); padding: 10px 14px; border-radius: 12px;
  background: var(--card); border-left: 3px solid var(--accent);
}
.ft-poem-label {
  display: block; font-size: 11px; font-weight: 700; letter-spacing: 2px;
  color: var(--accent); margin-bottom: 4px;
}
.ft-tip { font-size: 11.5px; color: var(--text-sub); text-align: center; margin-top: 10px; }
/* 输入行 & 窄屏适配 */
.ft-input-row { flex-wrap: wrap; gap: 8px; }
.ft-input-row .input { min-width: 0; }
.ft-go {
  display: block; width: 100%;
  margin: 12px 0 16px;
  padding: 9px 0;
  text-align: center;
}
@media (max-width: 520px) {
  .ft-dims { grid-template-columns: 1fr; }
}

/* ---------- 命书海报预览 ---------- */
.poster-mask {
  position: fixed; inset: 0; z-index: 120;
  background: rgba(20, 12, 6, 0.6);
  backdrop-filter: blur(6px);
  display: grid; place-items: center;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}
.poster-card {
  width: min(430px, 100%);
  max-height: 88vh; overflow-y: auto;
  background: var(--bg-a);
  border: 1px solid var(--card-border);
  border-radius: 18px;
  padding: 18px;
  box-shadow: var(--shadow);
  animation: modalIn 0.25s ease;
}
.poster-head { font-size: 16px; font-weight: 700; text-align: center; margin-bottom: 12px; }
.poster-img { display: block; width: 100%; border-radius: 12px; border: 1px solid var(--card-border); background: #fff; }
.poster-hint { font-size: 12px; color: var(--text-sub); text-align: center; margin: 10px 0 12px; line-height: 1.6; }
.poster-actions { display: flex; gap: 8px; }
.poster-actions .btn { flex: 1; padding: 9px 6px; font-size: 13px; }

/* ---------- 快速登录 ---------- */
.login-pill {
  display: inline-flex; align-items: center; gap: 4px;
  border: 1px solid var(--card-border); background: var(--card);
  color: var(--text); font-size: 12.5px; font-weight: 600;
  padding: 6px 12px; border-radius: 999px; cursor: pointer;
  transition: all .2s; white-space: nowrap; max-width: 130px; overflow: hidden;
}
.login-pill:hover { border-color: var(--primary); color: var(--primary); transform: translateY(-1px); }
.login-hint { font-size: 11px; color: var(--text-sub); text-align: center; margin-top: 10px; line-height: 1.6; }

/* ---------- 工具互动区（点赞 + 二级评论） ---------- */
.interact {
  margin-top: 18px; border-top: 1px dashed var(--card-border); padding-top: 14px;
}
.iv-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.iv-like {
  border: 1px solid var(--card-border); background: var(--card);
  color: var(--text); font-size: 13px; font-weight: 600;
  padding: 7px 14px; border-radius: 999px; cursor: pointer; transition: all .2s;
}
.iv-like:hover { border-color: var(--primary); transform: translateY(-1px); }
.iv-like.on { background: var(--gold-soft); border-color: rgba(245, 158, 11, 0.5); color: var(--gold); }
.iv-tip { font-size: 11.5px; color: var(--text-sub); }
.iv-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.iv-empty { font-size: 12.5px; color: var(--text-sub); text-align: center; padding: 18px 0; }
.iv-cmt {
  background: var(--card); border: 1px solid var(--card-border);
  border-radius: 12px; padding: 10px 12px;
}
.iv-cmt-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.iv-cmt-avatar { font-size: 18px; width: 24px; text-align: center; }
.iv-cmt-info { display: flex; flex-direction: column; }
.iv-cmt-name { font-size: 12.5px; font-weight: 700; }
.iv-cmt-time { font-size: 10.5px; color: var(--text-sub); }
.iv-cmt-body { font-size: 13px; line-height: 1.7; word-break: break-word; }
.iv-cmt-actions { margin-top: 4px; }
.iv-reply-btn {
  font-size: 11px; color: var(--text-sub); background: none; border: none;
  cursor: pointer; padding: 2px 4px;
}
.iv-reply-btn:hover { color: var(--primary); }
.iv-sub {
  margin-top: 8px; padding: 8px 10px; border-radius: 10px;
  background: var(--gold-soft); display: flex; flex-direction: column; gap: 8px;
}
.iv-reply { display: flex; align-items: baseline; gap: 6px; font-size: 12.5px; line-height: 1.6; }
.iv-reply-avatar { font-size: 13px; }
.iv-reply-name { font-weight: 600; color: var(--primary); white-space: nowrap; }
.iv-reply-text { word-break: break-word; }
.iv-reply-time { font-size: 10.5px; color: var(--text-sub); margin-left: auto; white-space: nowrap; }
.iv-replybox { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; align-items: center; }
.iv-replybox .input { flex: 1; min-width: 160px; }
.iv-box { border-top: 1px solid var(--card-border); padding-top: 10px; }
.iv-ta {
  width: 100%; min-height: 60px; resize: vertical; box-sizing: border-box;
  border: 1px solid var(--card-border); border-radius: 10px;
  background: var(--card); color: var(--text); padding: 8px 10px;
  font-size: 13px; font-family: inherit; outline: none;
}
.iv-ta:focus { border-color: var(--primary); }
.iv-box-row { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; gap: 8px; }
.iv-remain { font-size: 11px; color: var(--text-sub); }

/* ---------- 管理员排版管理 ---------- */
.admin-pill { border-color: rgba(245, 158, 11, 0.45); color: var(--gold); background: var(--gold-soft); }
.admin-pill:hover { border-color: var(--gold); color: var(--gold); }
.admin-chip {
  display: inline-block; margin-left: 6px; vertical-align: 2px;
  font-size: 10.5px; font-weight: 700; color: var(--gold);
  background: var(--gold-soft); border: 1px solid rgba(245, 158, 11, 0.4);
  padding: 1px 8px; border-radius: 999px;
}
.login-id-box {
  margin-top: 12px; padding: 10px 12px; border-radius: 10px;
  background: var(--card); border: 1px dashed var(--card-border);
  font-size: 12px; color: var(--text); text-align: left; line-height: 1.9;
}
.login-id-box b { color: var(--primary); word-break: break-all; }
.login-id-box .btn.sm { margin-left: 6px; padding: 1px 10px; font-size: 11px; }
.login-id-tip { font-size: 10.5px; color: var(--text-sub); }

.admin-mask { z-index: 130; padding: 14px; }
.admin-card {
  width: min(560px, 100%);
  max-height: calc(100vh - 40px);
  display: flex; flex-direction: column;
  background: var(--bg-a); border: 1px solid var(--card-border);
  border-radius: 18px; overflow: hidden;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.35);
  animation: modalIn .25s ease;
}
@keyframes modalIn { from { opacity: 0; transform: translateY(14px) scale(.97); } }
.admin-head { display: flex; align-items: center; gap: 10px; padding: 16px 18px 12px; position: relative; }
.admin-title { font-size: 17px; font-weight: 800; }
.admin-sub { font-size: 12px; color: var(--text-sub); flex: 1; }
.admin-tabs { display: flex; gap: 6px; padding: 0 18px; }
.admin-tab {
  border: 1px solid var(--card-border); background: var(--card);
  color: var(--text-sub); font-size: 13px; font-weight: 600;
  padding: 6px 16px; border-radius: 999px; cursor: pointer; transition: all .2s;
}
.admin-tab.active { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); }
.admin-body {
  flex: 1; overflow-y: auto; padding: 10px 18px 14px; margin-top: 8px;
  min-height: 200px;
}
.admin-group-title {
  font-size: 11.5px; font-weight: 700; color: var(--text-sub);
  margin: 12px 0 6px; padding-bottom: 4px; border-bottom: 1px dashed var(--card-border);
}
.admin-group-title.sub { margin-top: 14px; }
.admin-row {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 10px; border-radius: 10px;
  background: var(--card); border: 1px solid var(--card-border);
  margin-bottom: 6px; transition: background .2s;
}
.admin-row.sub { margin-left: 18px; }
.admin-row:hover { background: var(--primary-soft); }
.admin-idx {
  flex-shrink: 0; width: 24px; height: 24px; border-radius: 8px;
  display: grid; place-items: center; font-size: 11px; font-weight: 700;
  color: var(--text-sub); background: var(--bg-b);
  font-variant-numeric: tabular-nums;
}
.admin-name { flex: 1; font-size: 13px; font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-name small { color: var(--text-sub); font-weight: 500; margin-left: 4px; }
.admin-move {
  flex-shrink: 0; width: 30px; height: 30px; border-radius: 9px;
  border: 1px solid var(--card-border); background: var(--card);
  color: var(--text); font-size: 14px; cursor: pointer; transition: all .15s;
}
.admin-move:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); transform: translateY(-1px); }
.admin-move:disabled { opacity: .35; cursor: not-allowed; }
.admin-switch { flex-shrink: 0; position: relative; display: inline-block; width: 42px; height: 24px; cursor: pointer; }
.admin-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.admin-switch span {
  position: absolute; inset: 0; border-radius: 999px;
  background: var(--card-border); transition: background .2s;
}
.admin-switch span::before {
  content: ""; position: absolute; left: 3px; top: 3px;
  width: 18px; height: 18px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  transition: transform .2s;
}
.admin-switch input:checked + span { background: var(--free); }
.admin-switch input:checked + span::before { transform: translateX(18px); }
.admin-actions {
  display: flex; justify-content: flex-end; gap: 8px;
  padding: 12px 18px 16px; border-top: 1px solid var(--card-border);
  flex-wrap: wrap;
}
.admin-actions .btn { min-width: 88px; }
@media (max-width: 520px) {
  .admin-name { font-size: 12.5px; }
  .admin-sub { display: none; }
}

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
  .tool-grid { grid-template-columns: repeat(2, 1fr); }
  .brand-title { font-size: 20px; }
}
@media (max-width: 520px) {
  .tool-grid { grid-template-columns: 1fr; }
  .tool-card { min-height: 118px; }
  .hero { padding-top: 20px; }
  .fortune-pill { font-size: 11.5px; padding: 5px 10px; }
}
