/* ==========================================================================
   排版舱 · 设计系统
   Token 取自主流后台系统的浅色 Zinc 配色，栅格/圆角/阴影与工作台一致。
   ========================================================================== */

:root {
  --background: 0 0% 100%;
  --foreground: 0 0% 3.9%;
  --card: 0 0% 100%;
  --card-foreground: 0 0% 3.9%;
  --popover: 0 0% 100%;
  --popover-foreground: 0 0% 3.9%;
  --primary: 0 0% 9%;
  --primary-foreground: 0 0% 98%;
  --secondary: 0 0% 96.1%;
  --secondary-foreground: 0 0% 9%;
  --muted: 0 0% 96.1%;
  --muted-foreground: 0 0% 45.1%;
  --accent: 0 0% 96.1%;
  --accent-foreground: 0 0% 9%;
  --destructive: 0 84.2% 60.2%;
  --destructive-foreground: 0 0% 98%;
  --border: 0 0% 89.8%;
  --input: 0 0% 89.8%;
  --ring: 0 0% 3.9%;
  --radius: 0.5rem;
  --sidebar-background: 0 0% 99.6%;
  --sidebar-foreground: 240 5.3% 26.1%;
  --sidebar-primary: 240 5.9% 10%;
  --sidebar-accent: 240 4.8% 95.9%;
  --sidebar-border: 220 13% 91%;

  --rail-w: 6rem;
  --topbar-h: 72px;
  --ink: #09090b;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Noto Sans CJK SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  color: hsl(var(--foreground));
  background: hsl(var(--muted) / 0.4);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, h5, h6 { margin: 0; font-weight: 600; }
p { margin: 0; }
a { color: inherit; }
button { font-family: inherit; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #d4d4d8; border-radius: 6px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #a1a1aa; background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- 布局 ---------- */
.app { display: flex; height: 100vh; overflow: hidden; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; background: #fafafa; }

/* ---------- 左侧导航 ---------- */
.rail {
  width: var(--rail-w);
  flex: 0 0 var(--rail-w);
  background: hsl(var(--sidebar-background));
  border-right: 1px solid hsl(var(--sidebar-border));
  display: flex;
  flex-direction: column;
  box-shadow: 1px 0 3px rgb(0 0 0 / 0.04);
  z-index: 40;
}
.rail-head { height: var(--topbar-h); display: flex; align-items: center; justify-content: center; border-bottom: 1px solid hsl(var(--sidebar-border)); }
.rail-logo { width: 40px; height: 40px; border: 0; background: transparent; cursor: pointer; border-radius: var(--radius); transition: opacity .2s; }
.rail-logo:hover { opacity: .8; }
.rail-logo-glyph {
  display: flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 10px; background: var(--ink); color: #fff;
  font-size: 18px; font-weight: 700;
}
.rail-nav { flex: 1; overflow-y: auto; padding: 8px 6px; display: flex; flex-direction: column; gap: 2px; }
.rail-foot { padding: 6px; border-top: 1px solid hsl(var(--sidebar-border)); }
.rail-item {
  width: 100%; border: 0; background: transparent; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 9px 2px; border-radius: 10px; color: #52525b;
  font-size: 11px; line-height: 1.2; transition: background .15s, color .15s;
}
.rail-item:hover { background: hsl(var(--sidebar-accent)); color: hsl(var(--sidebar-primary)); }
.rail-item.active { background: hsl(var(--sidebar-accent)); color: hsl(var(--sidebar-primary)); font-weight: 600; }
.rail-item svg { width: 20px; height: 20px; }

/* 展开态 */
.app.rail-open .rail { position: fixed; left: 0; top: 0; bottom: 0; width: 208px; flex-basis: 208px; }
.app.rail-open .rail-item { flex-direction: row; justify-content: flex-start; gap: 10px; padding: 9px 12px; font-size: 13px; }
.app.rail-open .rail-nav { padding: 8px; }
.app.rail-open .rail-head { justify-content: flex-start; padding-left: 18px; }
.app.rail-open .rail-toggle { display: none; }
.rail-scrim { position: fixed; inset: 0; background: rgb(0 0 0 / .35); z-index: 35; }

/* ---------- 顶栏 ---------- */
.topbar {
  height: var(--topbar-h); flex: 0 0 var(--topbar-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px; background: #fff; border-bottom: 1px solid hsl(var(--border));
  box-shadow: 0 1px 2px rgb(0 0 0 / .04); z-index: 30;
}
.topbar-left { display: flex; align-items: center; min-width: 0; gap: 10px; }
.topbar-title { min-width: 0; }
.topbar-title h1 { font-size: 17px; font-weight: 600; letter-spacing: .3px; }
.quote { font-size: 12.5px; color: hsl(var(--muted-foreground)); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.icon-btn {
  width: 36px; height: 36px; border: 0; border-radius: 8px; background: transparent;
  color: #52525b; cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
  transition: background .15s, color .15s;
}
.icon-btn:hover { background: #f4f4f5; color: #18181b; }
/* 会员状态胶囊 */
.member-pill {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px;
  border: 1px solid hsl(var(--border)); border-radius: 999px; background: #fff; cursor: pointer;
  font-size: 13px; font-weight: 600; color: #3f3f46; transition: background .15s, border-color .15s;
}
.member-pill:hover { background: #f4f4f5; }
.member-pill.pro { background: var(--ink); border-color: var(--ink); color: #fff; }
.member-pill.pro:hover { background: #27272a; }

/* 离线演示提示条 */
.offline-bar {
  flex: 0 0 auto; padding: 7px 16px; text-align: center; font-size: 12.5px;
  background: #fef9c3; color: #854d0e; border-bottom: 1px solid #fde68a;
}
.offline-bar[hidden] { display: none; }

.bell-wrap, .user-menu { position: relative; }
.bell-badge {
  position: absolute; top: 2px; right: 2px; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 999px; background: hsl(var(--destructive)); color: #fff;
  font-size: 10px; font-weight: 700; display: flex; align-items: center; justify-content: center;
  border: 2px solid #fff;
}
.user-btn {
  display: flex; align-items: center; gap: 9px; border: 0; background: transparent; cursor: pointer;
  padding: 5px 8px; border-radius: 9px; text-align: left;
}
.user-btn:hover { background: #f4f4f5; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: #e4e4e7; object-fit: cover; display: block; flex: 0 0 auto; }
.avatar-fallback { width: 34px; height: 34px; border-radius: 50%; background: #e4e4e7; color: #52525b; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; }
.user-meta { max-width: 128px; }
.user-meta .n { font-size: 13px; font-weight: 600; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-meta .t { font-size: 11px; color: hsl(var(--muted-foreground)); line-height: 1.3; }

/* ---------- 视图容器 ---------- */
.view { flex: 1; min-height: 0; overflow: auto; padding: 24px; }
.view.flush { padding: 0; }
.page { max-width: 1500px; margin: 0 auto; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 22px; }
.page-title { font-size: 20px; font-weight: 600; }
.page-sub { font-size: 13px; color: hsl(var(--muted-foreground)); margin-top: 6px; }
.page-actions { display: flex; gap: 10px; align-items: center; }

/* ---------- 卡片 ---------- */
.card { background: #fff; border: 1px solid hsl(var(--border)); border-radius: 10px; }
.card-pad { padding: 18px; }
.card-head { padding: 14px 18px; border-bottom: 1px solid hsl(var(--border)); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card-title { font-size: 14.5px; font-weight: 600; }
.card-sub { font-size: 12px; color: hsl(var(--muted-foreground)); margin-top: 3px; }
.grid { display: grid; gap: 16px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 1100px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 720px) { .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; } }

/* ---------- 统计卡 ---------- */
.stat { padding: 16px 18px; }
.stat-label { font-size: 12px; color: hsl(var(--muted-foreground)); }
.stat-value { font-size: 26px; font-weight: 600; margin-top: 8px; letter-spacing: -.5px; }
.stat-foot { font-size: 11.5px; color: hsl(var(--muted-foreground)); margin-top: 6px; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 38px; padding: 0 16px; border-radius: 8px; border: 1px solid transparent;
  background: var(--ink); color: #fff; font-size: 13.5px; font-weight: 500; cursor: pointer;
  transition: background .15s, transform .1s, box-shadow .15s, opacity .15s;
  white-space: nowrap;
}
.btn:hover { background: #27272a; }
.btn:active { transform: scale(.985); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.outline { background: #fff; color: #3f3f46; border-color: hsl(var(--border)); }
.btn.outline:hover { background: #f4f4f5; }
.btn.ghost { background: transparent; color: #3f3f46; }
.btn.ghost:hover { background: #f4f4f5; }
.btn.danger { background: hsl(var(--destructive)); }
.btn.danger:hover { background: hsl(var(--destructive) / .9); }
.btn.sm { height: 31px; padding: 0 11px; font-size: 12.5px; border-radius: 7px; }
.btn.lg { height: 44px; padding: 0 24px; font-size: 15px; }
.btn.block { width: 100%; }

/* ---------- 表单 ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.label { font-size: 13px; font-weight: 500; }
.hint { font-size: 12px; color: hsl(var(--muted-foreground)); }
.input, .select, .textarea {
  width: 100%; min-height: 38px; padding: 8px 12px; border-radius: 8px;
  border: 1px solid hsl(var(--input)); background: #fff; color: inherit; font-size: 13.5px;
  font-family: inherit; transition: border-color .15s, box-shadow .15s;
}
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: hsl(var(--ring)); box-shadow: 0 0 0 2px hsl(var(--ring) / .18); }
.textarea { min-height: 120px; resize: vertical; line-height: 1.7; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2371717a' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }
.row { display: flex; gap: 12px; }
.row > * { flex: 1; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1px solid hsl(var(--border)); background: #fff; border-radius: 999px;
  padding: 5px 12px; font-size: 12.5px; cursor: pointer; color: #3f3f46; transition: all .15s;
}
.chip:hover { border-color: #a1a1aa; }
.chip.on { background: var(--ink); color: #fff; border-color: var(--ink); }

/* ---------- 表格 ---------- */
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th { text-align: left; font-weight: 500; color: hsl(var(--muted-foreground)); font-size: 12.5px; padding: 10px 14px; border-bottom: 1px solid hsl(var(--border)); background: #fafafa; }
.table td { padding: 12px 14px; border-bottom: 1px solid #f4f4f5; vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #fafafa; }

/* ---------- 徽标 ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px;
  border-radius: 5px; font-size: 11.5px; font-weight: 500;
  background: hsl(var(--muted)); color: #52525b;
}
.badge.dark { background: var(--ink); color: #fff; }
.badge.ok { background: #dcfce7; color: #15803d; }
.badge.warn { background: #fef3c7; color: #b45309; }
.badge.err { background: #fee2e2; color: #b91c1c; }
.badge.info { background: #dbeafe; color: #1d4ed8; }

/* ---------- 空状态 ---------- */
.empty { text-align: center; padding: 52px 20px; color: hsl(var(--muted-foreground)); }
.empty svg { width: 40px; height: 40px; margin-bottom: 12px; opacity: .35; }
.empty p { font-size: 13.5px; }

/* ---------- 弹层 ---------- */
.toast-wrap { position: fixed; top: 16px; right: 16px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast {
  min-width: 220px; max-width: 380px; padding: 11px 14px; border-radius: 9px;
  background: #18181b; color: #fff; font-size: 13px; box-shadow: 0 10px 30px rgb(0 0 0 / .2);
  animation: toast-in .22s ease-out;
}
.toast.ok { background: #15803d; }
.toast.err { background: #b91c1c; }
.toast.warn { background: #b45309; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

.overlay {
  position: fixed; inset: 0; z-index: 150; background: rgb(0 0 0 / .5);
  display: flex; align-items: center; justify-content: center; padding: 20px;
  animation: fade-in .15s ease-out;
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.modal {
  width: 100%; max-width: 520px; max-height: 86vh; overflow: auto;
  background: #fff; border-radius: 14px; box-shadow: 0 24px 60px rgb(0 0 0 / .3);
  animation: modal-in .18s ease-out;
}
@keyframes modal-in { from { opacity: 0; transform: translateY(10px) scale(.985); } to { opacity: 1; transform: none; } }
.modal-head { padding: 18px 20px 12px; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.modal-title { font-size: 16px; font-weight: 600; }
.modal-desc { font-size: 12.5px; color: hsl(var(--muted-foreground)); margin-top: 5px; }
.modal-body { padding: 4px 20px 18px; }
.modal-foot { padding: 14px 20px; border-top: 1px solid hsl(var(--border)); display: flex; justify-content: flex-end; gap: 10px; background: #fafafa; border-radius: 0 0 14px 14px; }

.pop {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 60; min-width: 300px;
  background: #fff; border: 1px solid hsl(var(--border)); border-radius: 12px;
  box-shadow: 0 12px 36px rgb(0 0 0 / .12); padding: 6px; animation: pop-in .14s ease-out;
}
@keyframes pop-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.pop-head { padding: 9px 10px 7px; display: flex; align-items: center; justify-content: space-between; }
.pop-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px;
  cursor: pointer; font-size: 13.5px; color: #3f3f46;
}
.pop-item:hover { background: #f4f4f5; }
.pop-item.danger { color: hsl(var(--destructive)); }
.pop-item.danger:hover { background: hsl(var(--destructive) / .08); }
.pop-sep { height: 1px; background: hsl(var(--border)); margin: 5px 4px; }
.pop-user { display: flex; align-items: center; gap: 11px; padding: 10px; }
.pop-user .avatar, .pop-user .avatar-fallback { width: 38px; height: 38px; }

/* ---------- 工作台首页 ---------- */
.dash-hero {
  display: flex; align-items: center; gap: 18px; padding: 18px 20px; margin-bottom: 20px;
  border-radius: 12px; background: linear-gradient(120deg, #18181b 0%, #3f3f46 58%, #71717a 100%);
  color: #fff; overflow: hidden; position: relative;
}
.dash-hero::after {
  content: ''; position: absolute; right: -60px; top: -60px; width: 220px; height: 220px;
  border-radius: 50%; background: rgb(255 255 255 / .06);
}
.dash-hero h2 { font-size: 18px; }
.dash-hero p { font-size: 13px; color: rgb(255 255 255 / .72); margin-top: 6px; max-width: 620px; }
.dash-hero .btn { background: #fff; color: #18181b; position: relative; z-index: 1; }
.dash-hero .btn:hover { background: #f4f4f5; }

.ws-card { padding: 16px; cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.ws-card:hover { border-color: #a1a1aa; box-shadow: 0 4px 16px rgb(0 0 0 / .06); }
.ws-title { font-size: 14.5px; font-weight: 600; display: flex; align-items: center; gap: 7px; }
.ws-meta { font-size: 12px; color: hsl(var(--muted-foreground)); margin-top: 6px; display: flex; gap: 10px; flex-wrap: wrap; }
.ws-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; padding-top: 12px; border-top: 1px solid #f4f4f5; font-size: 12px; color: hsl(var(--muted-foreground)); }

.list-row { display: flex; align-items: center; gap: 14px; padding: 12px 18px; border-bottom: 1px solid #f4f4f5; }
.list-row:last-child { border-bottom: 0; }
.list-row:hover { background: #fafafa; }
.list-main { flex: 1; min-width: 0; }
.list-title { font-size: 13.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-sub { font-size: 12px; color: hsl(var(--muted-foreground)); margin-top: 3px; }

/* ---------- 编辑器（排版核心） ---------- */
.editor-shell { display: flex; height: 100%; min-height: 0; }
.editor-side { width: 50%; min-width: 380px; border-right: 1px solid hsl(var(--border)); display: flex; flex-direction: column; background: #fff; }
.editor-preview { flex: 1; min-width: 0; display: flex; flex-direction: column; background: #f4f4f5; }
.editor-toolbar {
  height: 50px; flex: 0 0 50px; display: flex; align-items: center; gap: 8px;
  padding: 0 14px; border-bottom: 1px solid hsl(var(--border)); background: #fff; flex-wrap: wrap;
}
.editor-tabs { display: flex; gap: 2px; background: #f4f4f5; padding: 3px; border-radius: 8px; }
.editor-tab {
  border: 0; background: transparent; padding: 6px 13px; border-radius: 6px; cursor: pointer;
  font-size: 12.5px; color: #52525b; transition: all .15s;
}
.editor-tab.on { background: #fff; color: var(--ink); font-weight: 500; box-shadow: 0 1px 3px rgb(0 0 0 / .1); }
.editor-body { flex: 1; min-height: 0; overflow: auto; }
.md-input {
  width: 100%; height: 100%; border: 0; outline: none; resize: none; padding: 22px 26px;
  font-family: "SF Mono", Menlo, Consolas, monospace; font-size: 13.5px; line-height: 1.9;
  background: #fff; color: #27272a;
}
.phone-wrap { flex: 1; min-height: 0; overflow: auto; display: flex; justify-content: center; padding: 22px 16px; }
.phone {
  width: 375px; flex: 0 0 375px; background: #fff; border-radius: 26px; overflow: hidden;
  box-shadow: 0 10px 40px rgb(0 0 0 / .16); border: 1px solid #e4e4e7; align-self: flex-start;
}
.phone-notch { height: 34px; background: #fff; display: flex; align-items: center; justify-content: center; }
.phone-notch span { width: 90px; height: 5px; border-radius: 999px; background: #e4e4e7; }
.phone-bar { padding: 9px 16px; border-bottom: 1px solid #f4f4f5; font-size: 12px; color: #71717a; display: flex; justify-content: space-between; }
.phone-article { padding: 16px 0 30px; max-height: 620px; overflow: auto; }
.phone-article img { max-width: 100%; height: auto; display: block; margin: 0 auto; }
.wechat-body { font-size: 16px; color: #262626; }

.theme-drawer {
  position: absolute; right: 16px; top: 16px; bottom: 16px; width: 320px; z-index: 20;
  background: #fff; border: 1px solid hsl(var(--border)); border-radius: 12px;
  box-shadow: 0 14px 40px rgb(0 0 0 / .14); display: flex; flex-direction: column; overflow: hidden;
}
.theme-list { flex: 1; overflow: auto; padding: 8px; }
.theme-item {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; cursor: pointer;
}
.theme-item:hover { background: #f4f4f5; }
.theme-item.on { background: #f4f4f5; box-shadow: inset 0 0 0 1px var(--ink); }
.theme-swatch { width: 30px; height: 30px; border-radius: 7px; border: 1px solid #e4e4e7; flex: 0 0 auto; }
.theme-name { font-size: 13px; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.theme-tags { font-size: 11px; color: hsl(var(--muted-foreground)); }

.seg { display: inline-flex; background: #f4f4f5; border-radius: 8px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button {
  border: 0; background: transparent; padding: 5px 12px; border-radius: 6px; cursor: pointer;
  font-size: 12.5px; color: #52525b; white-space: nowrap;
}
.seg button.on { background: #fff; color: var(--ink); font-weight: 500; box-shadow: 0 1px 3px rgb(0 0 0 / .1); }

.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.tpl-card { border: 1px solid hsl(var(--border)); border-radius: 10px; overflow: hidden; cursor: pointer; background: #fff; transition: all .15s; }
.tpl-card:hover { border-color: #a1a1aa; box-shadow: 0 4px 14px rgb(0 0 0 / .07); }
.tpl-preview { height: 96px; padding: 12px; overflow: hidden; }
.tpl-preview .tl-h { height: 7px; width: 62%; background: #3f3f46; border-radius: 2px; margin-bottom: 8px; }
.tpl-preview .tl-l { height: 5px; width: 100%; background: #d4d4d8; border-radius: 2px; margin-bottom: 6px; }
.tpl-preview .tl-l.s { width: 78%; }
.tpl-preview .tl-accent { height: 5px; width: 34%; border-radius: 2px; margin-bottom: 8px; }
.tpl-foot { padding: 9px 11px; border-top: 1px solid #f4f4f5; font-size: 12.5px; display: flex; justify-content: space-between; align-items: center; }

/* ---------- 素材库 ---------- */
.mat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.mat-card { border: 1px solid hsl(var(--border)); border-radius: 10px; overflow: hidden; background: #fff; }
.mat-thumb { height: 120px; background: #f4f4f5; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.mat-thumb img { width: 100%; height: 100%; object-fit: cover; }
.mat-info { padding: 10px 12px; }
.mat-name { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mat-tags { font-size: 11.5px; color: hsl(var(--muted-foreground)); margin-top: 4px; }
.mat-actions { display: flex; gap: 6px; padding: 0 12px 11px; }

/* ---------- 订阅 / 套餐 ---------- */
.plan { border: 1px solid hsl(var(--border)); border-radius: 12px; padding: 20px; background: #fff; position: relative; }
.plan.hot { border-color: var(--ink); box-shadow: 0 6px 22px rgb(0 0 0 / .1); }
.plan-tag { position: absolute; top: -10px; right: 16px; background: var(--ink); color: #fff; font-size: 11px; padding: 3px 10px; border-radius: 999px; }
.plan-name { font-size: 15px; font-weight: 600; }
.plan-price { font-size: 30px; font-weight: 700; margin: 10px 0 2px; letter-spacing: -1px; }
.plan-price small { font-size: 13px; font-weight: 400; color: hsl(var(--muted-foreground)); }
.plan-price .currency { font-size: 17px; font-weight: 600; margin-right: 2px; vertical-align: 5px; }
.plan-price .amount { font-size: 34px; }
.plan ul { margin: 14px 0 18px; padding-left: 18px; font-size: 13px; color: #52525b; line-height: 2; }
.plan-original { display: flex; align-items: center; gap: 8px; margin-top: 2px; min-height: 22px; }
.plan-original .strike { font-size: 12.5px; color: #a1a1aa; text-decoration: line-through; }
.save-badge {
  font-size: 11px; font-weight: 600; color: #15803d; background: #dcfce7;
  border-radius: 5px; padding: 2px 7px;
}
.feature-list { margin: 0; padding-left: 18px; font-size: 13px; color: #52525b; line-height: 2; }

/* ---------- 支付面板 ---------- */
.pay-panel { display: flex; flex-direction: column; gap: 12px; }
.pay-head { text-align: center; padding: 6px 0 2px; }
.pay-amount { font-size: 30px; font-weight: 700; letter-spacing: -1px; }
.pay-qr {
  border: 1px solid hsl(var(--border)); border-radius: 10px; padding: 14px;
  display: flex; flex-direction: column; align-items: center; gap: 8px; background: #fafafa;
}
.pay-qr-label { font-size: 13px; font-weight: 600; }
.pay-qr-code {
  font-family: Menlo, monospace; font-size: 11.5px; color: #52525b; word-break: break-all;
  background: #fff; border: 1px solid hsl(var(--border)); border-radius: 8px; padding: 8px 10px;
  max-width: 100%; text-align: center;
}
.pay-status { text-align: center; font-size: 12.5px; color: hsl(var(--muted-foreground)); }
.pay-actions { display: flex; gap: 10px; }
.pay-actions .btn { flex: 1; }

/* ---------- 会员墙 / 锁定 ---------- */
.lock-badge {
  display: inline-flex; align-items: center; gap: 3px; font-size: 11px; font-weight: 600;
  color: #b45309; background: #fef3c7; border-radius: 5px; padding: 2px 7px; white-space: nowrap;
}
.theme-item.locked .theme-name { color: #a1a1aa; }
.theme-item.locked .theme-swatch { opacity: .6; }
.tpl-card.locked { position: relative; }
.tpl-card.locked .tpl-preview { opacity: .62; filter: grayscale(.35); }
.tpl-card.locked:hover { border-color: #fcd34d; }

/* 升级引导 */
.gate-card { display: flex; flex-direction: column; gap: 10px; }
.gate-head { color: #b45309; }
.gate-list { display: flex; flex-direction: column; gap: 9px; }
.gate-item {
  display: flex; align-items: center; gap: 9px; font-size: 13px; color: #3f3f46;
}
.gate-item svg { flex: 0 0 auto; color: #71717a; }

/* ---------- 登录 / 注册 ---------- */
.auth-card { display: flex; flex-direction: column; }
.auth-tabs { align-self: flex-start; }
.auth-error { background: #fee2e2; border-color: #fecaca; color: #b91c1c; margin-bottom: 14px; }

/* ---------- 封面生成器 ---------- */
.cover-stage { display: flex; justify-content: center; padding: 20px; background: #f4f4f5; border-radius: 10px; }
.cover-canvas { max-width: 100%; box-shadow: 0 8px 30px rgb(0 0 0 / .14); border-radius: 6px; }

/* ---------- 杂项 ---------- */
.kv { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid #f4f4f5; font-size: 13.5px; }
.kv:last-child { border-bottom: 0; }
.kv .k { color: hsl(var(--muted-foreground)); }
.kv .v { font-weight: 500; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid hsl(var(--border)); margin-bottom: 20px; }
.tabs button {
  border: 0; background: transparent; padding: 10px 14px; cursor: pointer; font-size: 13.5px;
  color: hsl(var(--muted-foreground)); border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tabs button.on { color: var(--ink); border-bottom-color: var(--ink); font-weight: 500; }

.notice { padding: 11px 14px; border-radius: 8px; font-size: 12.5px; line-height: 1.7; background: #f4f4f5; color: #52525b; border: 1px solid #e4e4e7; }
.notice.warn { background: #fef9c3; border-color: #fde68a; color: #854d0e; }
.notice.info { background: #eff6ff; border-color: #bfdbfe; color: #1e40af; }

.progress { height: 4px; border-radius: 999px; background: #e4e4e7; overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--ink); transition: width .25s; }

.spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.tag-row { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { background: #f4f4f5; color: #52525b; border-radius: 5px; padding: 2px 7px; font-size: 11.5px; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

@media (max-width: 980px) {
  .editor-shell { flex-direction: column; }
  .editor-side { width: 100%; min-width: 0; height: 46%; border-right: 0; border-bottom: 1px solid hsl(var(--border)); }
  .view { padding: 16px; }
}
