* { margin:0; padding:0; box-sizing:border-box; }
body { font-family:-apple-system,"Segoe UI",Roboto,"Microsoft YaHei",sans-serif; background:#f4f6f9; color:#1f2937; font-size:14px; line-height:1.6; }
a { color:#2563eb; text-decoration:none; }
.wrap { max-width:1100px; margin:0 auto; padding:0 16px; }

/* 登录 */
.login-box { max-width:400px; margin:10vh auto; background:#fff; border-radius:14px; padding:34px; box-shadow:0 8px 30px rgba(0,0,0,.08); }
.login-box h1 { font-size:21px; margin-bottom:6px; }
.login-box .sub { color:#6b7280; font-size:13px; margin-bottom:22px; }
label { display:block; margin:14px 0 6px; font-size:13px; color:#374151; font-weight:600; }
input, select, textarea { width:100%; padding:10px 12px; border:1px solid #d5dbe3; border-radius:8px; font-size:14px; background:#fff; }
input:focus, select:focus, textarea:focus { outline:none; border-color:#2563eb; box-shadow:0 0 0 3px rgba(37,99,235,.12); }
.btn { display:inline-block; border:0; border-radius:8px; padding:10px 18px; font-size:14px; cursor:pointer; background:#2563eb; color:#fff; }
.btn:hover { background:#1d4ed8; }
.btn.full { width:100%; margin-top:20px; }
.btn.sm { padding:6px 12px; font-size:13px; }
.btn.danger { background:#dc2626; }
.btn.danger:hover { background:#b91c1c; }
.btn.ghost { background:#eef2ff; color:#2563eb; }

/* 后台框架 */
.topbar { background:#111827; color:#fff; }
.topbar .wrap { display:flex; align-items:center; justify-content:space-between; height:58px; }
.topbar .brand { font-weight:700; font-size:16px; }
.topbar .brand small { color:#9ca3af; font-weight:400; margin-left:8px; }
.topbar .user { color:#d1d5db; font-size:13px; }
.topbar .user a { color:#93c5fd; margin-left:12px; }
.nav { background:#fff; border-bottom:1px solid #e5e7eb; }
.nav .wrap { display:flex; gap:4px; overflow-x:auto; }
.nav a { padding:12px 16px; color:#4b5563; font-size:14px; white-space:nowrap; border-bottom:2px solid transparent; }
.nav a:hover { color:#2563eb; }
.nav a.active { color:#2563eb; border-bottom-color:#2563eb; font-weight:600; }
.main { padding:24px 0 60px; }

.card { background:#fff; border-radius:12px; padding:22px; box-shadow:0 1px 3px rgba(0,0,0,.06); margin-bottom:18px; }
.card h2 { font-size:17px; margin-bottom:16px; }
.grid { display:grid; gap:16px; }
.grid.cols-4 { grid-template-columns:repeat(auto-fit,minmax(180px,1fr)); }
.stat { background:#fff; border-radius:12px; padding:20px; box-shadow:0 1px 3px rgba(0,0,0,.06); }
.stat .num { font-size:30px; font-weight:700; color:#2563eb; }
.stat .lbl { color:#6b7280; font-size:13px; margin-top:4px; }

table { width:100%; border-collapse:collapse; }
th, td { text-align:left; padding:11px 10px; border-bottom:1px solid #eef0f3; font-size:13px; vertical-align:middle; }
th { color:#6b7280; font-weight:600; background:#fafbfc; }
tr:hover td { background:#fafbff; }
.url { font-family:monospace; font-size:12px; word-break:break-all; }
.badge { display:inline-block; padding:2px 8px; border-radius:999px; font-size:12px; }
.badge.on { background:#dcfce7; color:#166534; }
.badge.off { background:#fee2e2; color:#991b1b; }
.badge.role-admin { background:#dbeafe; color:#1e40af; }
.badge.role-staff { background:#fef3c7; color:#92400e; }
.actions { display:flex; gap:6px; flex-wrap:wrap; }

.msg { padding:12px 14px; border-radius:8px; margin-bottom:16px; font-size:14px; }
.msg.ok { background:#ecfdf5; color:#065f46; }
.msg.err { background:#fef2f2; color:#991b1b; }
.hint { color:#6b7280; font-size:13px; }
.code { background:#f3f4f6; padding:2px 6px; border-radius:5px; font-family:monospace; }
.row { display:flex; gap:12px; align-items:center; flex-wrap:wrap; }
.row > * { flex:1; }
.row .fix { flex:0 0 auto; }
.divider { height:1px; background:#eef0f3; margin:18px 0; }
.preview { max-width:300px; border:1px solid #e5e7eb; border-radius:8px; }

/* ===== 分享卡片预览 ===== */
.og-card { position:relative; display:flex; gap:8px; background:#f3fbf0; border:2px solid #6cc24a; border-left:6px solid #6cc24a; border-radius:8px; padding:10px 10px 18px; min-height:86px; overflow:hidden; }
.og-card-text { flex:1; min-width:0; }
.og-site { color:#3f9e2c; font-size:12px; font-weight:700; line-height:1.4; }
.og-title { font-size:13px; font-weight:700; color:#1f2937; line-height:1.45; margin-top:2px; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.og-desc { font-size:12px; color:#6b7280; line-height:1.5; margin-top:4px; display:-webkit-box; -webkit-line-clamp:3; -webkit-box-orient:vertical; overflow:hidden; word-break:break-all; }
.og-card-thumb { flex:0 0 84px; width:84px; height:84px; border-radius:5px; overflow:hidden; background:#eef7ea; }
.og-card-thumb img { width:100%; height:100%; object-fit:cover; display:block; }
.og-time { position:absolute; right:8px; bottom:2px; font-size:11px; color:#9ca3af; }
.og-card-lg { min-height:140px; padding:14px 14px 22px; }
.og-card-lg .og-site { font-size:14px; }
.og-card-lg .og-title { font-size:16px; line-height:1.5; }
.og-card-lg .og-desc { font-size:14px; line-height:1.6; }
.og-card-lg .og-card-thumb { flex-basis:130px; width:130px; height:130px; }

/* 模板选择器 */
.tpl-picker { display:flex; gap:18px; align-items:flex-start; flex-wrap:wrap; }
.tpl-list { flex:1 1 420px; display:flex; flex-direction:column; gap:10px; max-height:420px; overflow-y:auto; padding-right:4px; }
.tpl-item { display:block; margin:0; cursor:pointer; }
.tpl-item input { position:absolute; opacity:0; width:0; height:0; }
.tpl-box { display:block; border:2px solid #e5e7eb; border-radius:10px; padding:10px; background:#fff; transition:.15s; }
.tpl-item input:checked + .tpl-box { border-color:#2563eb; box-shadow:0 0 0 3px rgba(37,99,235,.12); background:#f8faff; }
.tpl-name { display:block; font-size:13px; font-weight:600; color:#374151; margin-bottom:6px; }
.tpl-item input:checked + .tpl-box .tpl-name { color:#2563eb; }
.tpl-preview { flex:0 1 360px; min-width:280px; position:sticky; top:12px; }
.tpl-preview-label { font-size:13px; font-weight:600; color:#6b7280; margin-bottom:8px; }

/* 自定义卡片输入面板 */
.custom-panel { background:#f8faff; border:1px solid #dbeafe; border-radius:10px; padding:4px 16px 16px; margin-top:16px; }
.custom-panel label { margin-top:14px; }
.custom-panel input[type=file] { background:#fff; }
.custom-panel textarea { resize:vertical; min-height:70px; }
.custom-panel .divider { margin:14px 0 0; background:#dbeafe; }
