/* 海报 SaaS 主题：浅色系，移动适配，深蓝品牌 */
:root {
  --primary: #2a5bd7; --primary-d: #1e45ad; --accent: #00b4d8;
  --bg: #f4f6fb; --card: #ffffff; --line: #e5e9f2; --text: #1c2434;
  --muted: #6b7488; --danger: #e5484d; --ok: #16a34a; --gold: #d4a017;
  --shadow: 0 6px 24px rgba(30, 60, 120, .08); --radius: 14px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif; background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.6; }
a { color: var(--primary); text-decoration: none; }
h1, h2, h3, h4 { margin: 0 0 10px; font-weight: 700; }
h1 { font-size: 26px; } h2 { font-size: 20px; } h3 { font-size: 16px; }
.sub, .muted { color: var(--muted); } .tiny { font-size: 12px; }
.row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.grid { display: grid; gap: 16px; } .g2 { grid-template-columns: repeat(2, 1fr); }
.g3 { grid-template-columns: repeat(3, 1fr); } .g4 { grid-template-columns: repeat(4, 1fr); }
.mt { margin-top: 16px; } .mb { margin-bottom: 16px; } .narrow { max-width: 860px; margin: 0 auto; }
.wrap { max-width: 1280px; margin: 0 auto; padding: 20px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.card-title { font-size: 16px; font-weight: 700; margin-bottom: 14px; display: flex; align-items: center; justify-content: space-between; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.stat .num { font-size: 30px; font-weight: 800; color: var(--primary); line-height: 1.2; }
.stat .lbl { color: var(--muted); font-size: 13px; margin-top: 6px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--primary); background: var(--primary); color: #fff; padding: 9px 18px; border-radius: 9px; font-size: 14px; cursor: pointer; font-family: inherit; transition: .15s; }
.btn:hover { background: var(--primary-d); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-sm { padding: 5px 11px; font-size: 12px; border-radius: 7px; }
.btn-block { width: 100%; }
.btn-ghost { background: transparent; color: var(--primary); }
.btn-ghost:hover { background: #eef3ff; }
.btn-danger { background: var(--danger); border-color: var(--danger); }
.btn-danger:hover { background: #c9363b; }
.btn-gold { background: var(--gold); border-color: var(--gold); }

input, select, textarea { width: 100%; padding: 9px 12px; border: 1px solid var(--line); border-radius: 9px; font-size: 14px; font-family: inherit; background: #fff; color: var(--text); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(42, 91, 215, .1); }
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 5px; font-weight: 600; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--muted); font-weight: 600; background: #fafbfe; }

.tag { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 12px; background: #eef3ff; color: var(--primary); }
.tag-gold { background: #fff5dd; color: var(--gold); }
.tag-ok { background: #e7f8ed; color: var(--ok); }
.tag-danger { background: #fdecec; color: var(--danger); }
.badge { display: inline-block; padding: 1px 8px; border-radius: 5px; background: #f0f3f9; color: var(--muted); font-size: 12px; }
.empty { text-align: center; padding: 40px 20px; color: var(--muted); }

/* 顶部导航 */
.nav { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.nav-in { max-width: 1280px; margin: 0 auto; padding: 0 20px; height: 60px; display: flex; align-items: center; gap: 22px; }
.logo { display: flex; align-items: center; gap: 9px; font-weight: 800; font-size: 17px; color: var(--primary); }
.logo-mark { width: 30px; height: 30px; border-radius: 8px; background: linear-gradient(135deg, var(--primary), var(--accent)); color: #fff; display: grid; place-items: center; font-size: 15px; }
.nav-links { display: flex; gap: 4px; flex: 1; overflow-x: auto; }
.nav-links a { padding: 7px 13px; border-radius: 8px; color: var(--muted); white-space: nowrap; }
.nav-links a.on, .nav-links a:hover { background: #eef3ff; color: var(--primary); font-weight: 600; }

.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tabs .tab { padding: 9px 16px; cursor: pointer; color: var(--muted); white-space: nowrap; border-bottom: 2px solid transparent; }
.tabs .tab.on { color: var(--primary); font-weight: 700; border-color: var(--primary); }

.modal { position: fixed; inset: 0; background: rgba(15, 25, 45, .5); display: grid; place-items: center; z-index: 100; padding: 16px; }
.modal-box { background: #fff; border-radius: 16px; width: min(560px, 100%); max-height: 88vh; overflow: auto; box-shadow: 0 20px 60px rgba(0, 0, 0, .25); }
.modal-head { padding: 16px 20px; border-bottom: 1px solid var(--line); font-weight: 700; display: flex; justify-content: space-between; align-items: center; }
.modal-head .close { cursor: pointer; font-size: 22px; color: var(--muted); line-height: 1; }
.modal-body { padding: 20px; }
.toast { position: fixed; left: 50%; bottom: 40px; transform: translateX(-50%) translateY(20px); background: #1c2434; color: #fff; padding: 11px 22px; border-radius: 30px; opacity: 0; pointer-events: none; transition: .25s; z-index: 200; font-size: 14px; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.error { background: var(--danger); }

.switch { position: relative; width: 46px; height: 26px; display: inline-block; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider { position: absolute; inset: 0; background: #cbd3e1; border-radius: 26px; cursor: pointer; transition: .2s; }
.switch .slider:before { content: ''; position: absolute; width: 20px; height: 20px; left: 3px; bottom: 3px; background: #fff; border-radius: 50%; transition: .2s; }
.switch input:checked + .slider { background: var(--primary); }
.switch input:checked + .slider:before { transform: translateX(20px); }

.tpl-card { background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; cursor: pointer; transition: .15s; }
.tpl-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--primary); }
.tpl-card .thumb { width: 100%; aspect-ratio: 1; background: #f0f3fa; display: grid; place-items: center; overflow: hidden; }
.tpl-card .thumb canvas, .tpl-card .thumb img { max-width: 100%; max-height: 100%; }
.tpl-card .meta { padding: 10px 12px; font-size: 13px; }
.tpl-card .meta .name { font-weight: 600; margin-bottom: 2px; }

.editor-layout { display: grid; grid-template-columns: minmax(280px, 1fr) minmax(320px, 1fr); gap: 20px; }
.poster-stage { background: #e9edf6; border-radius: 14px; padding: 20px; display: flex; align-items: flex-start; justify-content: center; min-height: 420px; }
.poster-stage canvas { max-width: 100%; max-height: 70vh; box-shadow: 0 10px 40px rgba(0,0,0,.18); border-radius: 8px; }

@media (max-width: 860px) {
  .wrap { padding: 12px; }
  .g2, .g3, .g4 { grid-template-columns: repeat(2, 1fr); }
  .editor-layout { grid-template-columns: 1fr; }
  .nav-in { gap: 10px; padding: 0 12px; }
  .nav-links { gap: 0; }
  .nav-links a { padding: 7px 9px; font-size: 13px; }
  h1 { font-size: 21px; }
  .stat .num { font-size: 24px; }
}
@media (max-width: 520px) {
  .g2, .g3, .g4 { grid-template-columns: 1fr 1fr; }
  .grid.g4 > .stat { padding: 12px; }
}
