/* ============================================================
   肉包网站 - 全局样式（现代浅色大网站风）
   ============================================================ */
:root {
  --bg: #f4f6fb;
  --bg-soft: #ffffff;
  --bg-card: #ffffff;
  --bg-elev: #f8f9fd;
  --line: #e6e9f2;
  --brand: #4f6ef7;
  --brand-bright: #6d85ff;
  --brand-dark: #3a55d4;
  --accent: #ff7a59;
  --text: #1d2233;
  --text-dim: #5b6278;
  --text-faint: #9aa1b5;
  --green: #16a34a;
  --red: #dc2626;
  --radius: 14px;
  --shadow-sm: 0 1px 3px rgba(20, 30, 70, .06);
  --shadow: 0 8px 28px rgba(20, 30, 70, .08);
  --shadow-lg: 0 18px 50px rgba(20, 30, 70, .14);
  --grad: linear-gradient(135deg, #6d85ff 0%, #9f6bff 60%, #ff7a59 100%);
  font-size: 16px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", system-ui, sans-serif;
  line-height: 1.6;
}
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-dark); }
img { max-width: 100%; display: block; }

/* ---------- 顶部导航 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 18px;
  padding: 12px 26px;
  background: rgba(255, 255, 255, .85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.15rem; color: var(--text); }
.brand .logo { width: 38px; height: 38px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 2px var(--brand); object-fit: cover; }
.brand .name { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.nav-links { display: flex; gap: 2px; flex-wrap: wrap; margin-left: auto; }
.nav-links a { padding: 8px 14px; border-radius: 10px; color: var(--text-dim); font-size: .92rem; font-weight: 500; transition: all .16s; }
.nav-links a:hover { color: var(--brand); background: var(--bg-elev); }
.nav-links a.active { color: #fff; background: var(--brand); }
.brand .logo { width: 30px; height: 30px; border-radius: 8px; }

/* ---------- 布局 ---------- */
.container { max-width: 1200px; margin: 0 auto; padding: 28px 22px 70px; }
.page { display: none; animation: fadeIn .25s ease; }
.page.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

h1.page-title { font-size: 1.9rem; margin-bottom: 6px; font-weight: 800; }
h1.page-title .accent { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.page-sub { color: var(--text-dim); margin-bottom: 22px; }

.card {
  background: var(--bg-card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow-sm);
}
.grid { display: grid; gap: 18px; }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border-radius: 10px; border: 1px solid var(--line);
  background: #fff; color: var(--text); font-size: .95rem; font-weight: 600;
  cursor: pointer; transition: all .16s;
}
.btn:hover { border-color: var(--brand); color: var(--brand); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.btn.gold { background: var(--grad); color: #fff; border: none; }
.btn.gold:hover { filter: brightness(1.05); color: #fff; }
.btn.ghost { background: transparent; }
.btn.danger { border-color: #f3c1c1; color: var(--red); }
.btn.small { padding: 6px 12px; font-size: .84rem; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

/* ---------- 表单 ---------- */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: .88rem; color: var(--text-dim); margin-bottom: 6px; font-weight: 600; }
.field input[type=text], .field input[type=password], .field input[type=url],
.field textarea, .field select {
  width: 100%; padding: 11px 13px;
  background: #fff; color: var(--text);
  border: 1.5px solid var(--line); border-radius: 10px;
  font-size: .95rem; outline: none; transition: border .15s;
}
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--brand); }
.field textarea { min-height: 90px; resize: vertical; font-family: inherit; }
.hint { font-size: .8rem; color: var(--text-faint); margin-top: 5px; }

/* ---------- 头像 ---------- */
.avatar { width: 46px; height: 46px; border-radius: 50%; object-fit: cover; border: 2px solid #fff; box-shadow: 0 0 0 2px var(--brand); }
.avatar.lg { width: 88px; height: 88px; }
.avatar.sm { width: 32px; height: 32px; }
.avatar.default { display: inline-flex; align-items: center; justify-content: center; background: var(--grad); color: #fff; font-weight: 700; }

/* ---------- 聊天 ---------- */
.chat-wrap { display: flex; flex-direction: column; height: calc(100vh - 150px); min-height: 480px; }
.chat-head { display: flex; align-items: center; gap: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--line); margin-bottom: 12px; }
.chat-messages { flex: 1; overflow-y: auto; padding: 8px 4px; display: flex; flex-direction: column; gap: 14px; }
.msg { display: flex; gap: 10px; max-width: 82%; }
.msg .bubble { padding: 11px 14px; border-radius: 14px; font-size: .95rem; white-space: pre-wrap; word-break: break-word; }
.msg.user { align-self: flex-end; flex-direction: row-reverse; }
.msg.user .bubble { background: var(--brand); color: #fff; border-bottom-right-radius: 4px; }
.msg.bot .bubble { background: var(--bg-elev); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.msg .meta { font-size: .72rem; color: var(--text-faint); margin-top: 4px; }
.chat-input { display: flex; gap: 10px; padding-top: 12px; border-top: 1px solid var(--line); }
.chat-input textarea { flex: 1; min-height: 52px; max-height: 140px; }
.mode-tabs { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.mode-tab { padding: 7px 14px; border-radius: 999px; cursor: pointer; border: 1px solid var(--line); color: var(--text-dim); font-size: .88rem; transition: all .15s; background: #fff; }
.mode-tab.active { background: var(--brand); color: #fff; border-color: transparent; font-weight: 700; }
.typing { display: inline-flex; gap: 4px; padding: 4px 2px; }
.typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--brand); animation: blink 1.2s infinite; }
.typing span:nth-child(2) { animation-delay: .2s; }
.typing span:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%,80%,100% { opacity: .25; } 40% { opacity: 1; } }

/* ---------- 应用卡片 ---------- */
.app-card { display: flex; flex-direction: column; gap: 10px; }
.app-card .thumb { height: 110px; border-radius: 10px; background: var(--bg-elev); border: 1px dashed var(--line); display: flex; align-items: center; justify-content: center; color: var(--text-faint); font-size: .85rem; overflow: hidden; }
.app-card .app-name { font-weight: 700; }
.app-card .app-meta { font-size: .78rem; color: var(--text-faint); }
.app-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; }

/* ---------- 打赏 ---------- */
.donate-hero { text-align: center; padding: 30px 10px; }
.donate-hero p.slogan { font-size: 1.05rem; color: var(--brand); margin: 10px 0 4px; font-weight: 700; }
.donate-qr { margin: 20px auto; max-width: 320px; border-radius: 14px; overflow: hidden; border: 2px solid var(--brand); background: #fff; box-shadow: var(--shadow); }
.donate-amounts { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin: 16px 0; }

/* ---------- 生图 ---------- */
.draw-result { margin-top: 18px; }
.draw-result img { border-radius: 12px; border: 1px solid var(--line); margin: 0 auto; }
.prompt-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.prompt-chips .chip { font-size: .8rem; padding: 5px 11px; border-radius: 999px; background: var(--bg-elev); border: 1px solid var(--line); cursor: pointer; color: var(--text-dim); }
.prompt-chips .chip:hover { border-color: var(--brand); color: var(--brand); }

/* ---------- API 调试 ---------- */
pre.json-view {
  background: #0f172a; color: #a5f3c4;
  border: 1px solid #1e293b; border-radius: 10px;
  padding: 14px; overflow: auto; font-size: .82rem;
  font-family: "JetBrains Mono", Consolas, monospace; max-height: 480px;
}
.url-line {
  font-family: Consolas, monospace; font-size: .82rem;
  background: var(--bg-elev); border: 1px solid var(--line);
  padding: 10px 12px; border-radius: 10px; word-break: break-all; color: var(--brand-dark);
}

/* ---------- 列表 / 徽章 ---------- */
.list-item { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px dashed var(--line); }
.list-item:last-child { border-bottom: none; }
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .72rem; background: var(--bg-elev); border: 1px solid var(--line); color: var(--text-dim); }
.badge.gold { background: var(--grad); color: #fff; border: none; font-weight: 700; }
.badge.green { background: #dcfce7; color: var(--green); border: none; }

/* ---------- Toast ---------- */
#toast {
  position: fixed; left: 50%; bottom: 36px; transform: translateX(-50%);
  background: #1e293b; color: #fff; padding: 11px 20px; border-radius: 10px;
  box-shadow: var(--shadow-lg); opacity: 0; pointer-events: none; transition: opacity .25s; z-index: 99; font-size: .9rem;
}
#toast.show { opacity: 1; }

/* ---------- 页脚 ---------- */
footer.site-footer { margin-top: 60px; padding: 30px 22px; text-align: center; border-top: 1px solid var(--line); color: var(--text-faint); font-size: .82rem; background: #fff; }
footer.site-footer .brand-line { color: var(--brand); font-weight: 700; }

/* ---------- Hero ---------- */
.hero { text-align: center; padding: 46px 10px 16px; }
.hero .avatar.lg { margin: 0 auto 14px; width: 110px; height: 110px; box-shadow: 0 0 0 8px rgba(111,133,255,.15); }
.hero h1 { font-size: 2.3rem; font-weight: 800; }
.hero h1 .accent { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p.lead { color: var(--text-dim); max-width: 640px; margin: 14px auto 24px; font-size: 1.05rem; }
.hero .cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ---------- 演示提示条 ---------- */
.demo-banner {
  background: #fff7ed; border: 1px solid #fed7aa; color: #9a3412;
  padding: 10px 14px; border-radius: 10px; font-size: .85rem; text-align: center; margin-bottom: 14px;
}

/* ---------- 大网站统计条 ---------- */
.stats-bar { display: grid; grid-template-columns: repeat(4,1fr); gap: 14px; margin: 26px 0; }
.stats-bar .stat { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 16px; text-align: center; }
.stats-bar .num { font-size: 1.5rem; font-weight: 800; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stats-bar .lbl { font-size: .8rem; color: var(--text-faint); }

/* ---------- 响应式 ---------- */
@media (max-width: 860px) {
  .grid.cols-3 { grid-template-columns: 1fr; }
  .grid.cols-2 { grid-template-columns: 1fr; }
  .stats-bar { grid-template-columns: repeat(2,1fr); }
  .nav-links { position: static; flex-wrap: wrap; gap: 6px 14px; padding: 8px 0; justify-content: flex-end; }
  .msg { max-width: 94%; }
  .hero h1 { font-size: 1.7rem; }
  .container { padding: 16px 12px 60px; }
  .topbar { padding: 0 12px; flex-wrap: wrap; }
  .auth-box { padding: 10px 0; }
  .card { padding: 16px; }
  .chat-input-bar { padding: 10px; gap: 8px; }
  .hero .stats-bar { margin: 16px 0; }
}

/* 手机版强制 */
body[data-device="mobile"] .grid.cols-3 { grid-template-columns: 1fr; }
body[data-device="mobile"] .grid.cols-2 { grid-template-columns: 1fr; }
body[data-device="mobile"] .msg { max-width: 94%; }
body[data-device="mobile"] .hero h1 { font-size: 1.7rem; }
body[data-device="mobile"] .container { padding: 16px 12px 60px; }
body[data-device="mobile"] .nav-links { flex-wrap: wrap; gap: 6px 14px; padding: 8px 0; }

/* 注册/登录页 */
.auth-box { max-width: 520px; margin: 0 auto; text-align: center; padding: 20px 0; }
.auth-box .avatar.lg.center { display: block; margin: 0 auto 16px; }
.auth-title { font-size: 1.9rem; font-weight: 800; margin: 8px 0 6px; }
.auth-sub { color: var(--text-dim); margin-bottom: 24px; }
.btn.block { display: block; width: 100%; }
.hint.center { text-align: center; }

