/* ======================================================
   独立前台页面外壳样式（明亮卡片风格，参考 mubang 后台）
   所有非首页的前台页面（对话/绘画/记录/资料/商城等）独立引用，
   不再依赖 layout.html，每个页面自带 <html> 文档，互不影响。
   ====================================================== */

:root { --brand-grad: linear-gradient(135deg,#6366f1,#8b5cf6); }

/* 基础 */
body.front-page {
  background: var(--bg-primary);
  min-height: 100vh;
  color: var(--text-primary);
  display: block;
}

/* ========== 顶栏 ========== */
.fp-topbar {
  position: sticky; top: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  height: var(--topbar-height);
  padding: 0 clamp(16px, 4vw, 32px);
  background: rgba(255,255,255,.82);
  backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--border-color);
}
.fp-brand { display: inline-flex; align-items: center; gap: 11px; text-decoration: none; color: var(--text-primary); font-size: 17px; font-weight: 800; }
.fp-brand .logo {
  width: 36px; height: 36px; border-radius: 11px; display: flex; align-items: center; justify-content: center;
  background: var(--brand-grad); color: #fff; font-size: 19px; box-shadow: 0 6px 18px rgba(99,102,241,.3);
}
.fp-nav { display: flex; align-items: center; gap: 4px; margin: 0 auto; }
.fp-nav a {
  position: relative; padding: 8px 15px; border-radius: var(--radius-md);
  font-size: 14px; font-weight: 500; color: var(--text-secondary); text-decoration: none; transition: all .15s;
}
.fp-nav a:hover { color: var(--text-primary); background: var(--bg-input); }
.fp-nav a.active { color: var(--accent); background: var(--accent-light); }
.fp-actions { display: flex; align-items: center; gap: 10px; }
.fp-balance {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 20px;
  background: var(--accent-light); color: var(--accent); font-size: 13px; font-weight: 600; white-space: nowrap;
}
.fp-user { position: relative; display: inline-flex; align-items: center; gap: 8px; cursor: pointer; padding: 4px 8px; border-radius: var(--radius-md); }
.fp-user:hover { background: var(--bg-input); }
.fp-user .uname { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.fp-drop {
  position: absolute; top: calc(100% + 10px); right: 0; width: 210px; background: var(--bg-card);
  border: 1px solid var(--border-color); border-radius: var(--radius-md); box-shadow: var(--shadow-xl);
  padding: 6px; opacity: 0; visibility: hidden; transform: translateY(-8px) scale(.96); transition: all .2s; z-index: 1000;
}
.fp-drop.show { opacity: 1; visibility: visible; transform: translateY(0) scale(1); }
.fp-drop a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: var(--radius-sm); font-size: 13px; color: var(--text-primary); text-decoration: none; }
.fp-drop a:hover { background: var(--accent-light); color: var(--accent); }
.fp-drop a i { width: 18px; text-align: center; color: var(--text-secondary); font-size: 16px; }

/* 汉堡按钮（移动端） */
.fp-burger { display: none; width: 40px; height: 40px; border-radius: var(--radius-md); align-items: center; justify-content: center;
  font-size: 22px; color: var(--text-primary); background: var(--bg-input); border: 1px solid var(--border-color); cursor: pointer; }

/* 移动端抽屉 */
.fp-drawer { position: fixed; inset: 0; z-index: 1100; display: none; }
.fp-drawer.open { display: block; }
.fp-drawer .mask { position: absolute; inset: 0; background: rgba(15,23,42,.45); backdrop-filter: blur(2px); }
.fp-drawer .panel { position: absolute; top: 0; right: 0; height: 100%; width: min(82vw, 320px);
  background: var(--bg-card); border-left: 1px solid var(--border-color); padding: 24px;
  display: flex; flex-direction: column; gap: 4px; box-shadow: var(--shadow-xl); transform: translateX(100%); transition: transform .25s; }
.fp-drawer.open .panel { transform: translateX(0); }
.fp-drawer .close { position: absolute; top: 16px; right: 16px; font-size: 24px; color: var(--text-secondary); background: none; border: none; cursor: pointer; }
.fp-drawer a.link { padding: 13px 14px; border-radius: var(--radius-md); font-size: 15px; font-weight: 600; color: var(--text-primary); text-decoration: none; display: flex; align-items: center; gap: 12px; }
.fp-drawer a.link i { font-size: 20px; color: var(--accent); }
.fp-drawer a.link.active, .fp-drawer a.link:hover { background: var(--accent-light); color: var(--accent); }
.fp-drawer .cta { margin-top: auto; display: flex; flex-direction: column; gap: 10px; padding-top: 16px; border-top: 1px solid var(--border-color); }
.fp-drawer .cta .btn { width: 100%; justify-content: center; }

/* ========== 内容容器 ========== */
.fp-content { max-width: 1240px; margin: 0 auto; padding: clamp(20px, 4vw, 40px); }

/* 页面标题区 */
.fp-page-head { margin-bottom: 24px; }
.fp-page-head h1 { font-size: clamp(22px, 3vw, 28px); font-weight: 800; color: var(--text-primary); letter-spacing: -.5px; }
.fp-page-head p { font-size: 14px; color: var(--text-secondary); margin-top: 6px; }
.breadcrumb { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-secondary); margin-bottom: 8px; }
.breadcrumb a { color: var(--accent); text-decoration: none; }
.breadcrumb .cur { color: var(--text-primary); font-weight: 600; }

/* 通用卡片（亮色） */
.fp-card { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--radius-lg); padding: 24px; box-shadow: var(--shadow-sm); }

/* 页脚 */
.fp-footer { text-align: center; padding: 28px 20px; font-size: 13px; color: var(--text-secondary); border-top: 1px solid var(--border-color); }
.fp-footer b { color: var(--accent); font-weight: 700; }

/* ========== 响应式 ========== */
@media (max-width: 992px) {
  .fp-nav { display: none; }
  .fp-burger { display: inline-flex; }
  .fp-balance, .fp-user .uname { display: none; }
}
@media (max-width: 560px) {
  .fp-topbar { padding: 0 16px; }
  .fp-content { padding: 18px 16px; }
}
