* { box-sizing: border-box; }
body { margin:0; font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Microsoft YaHei",sans-serif; background:#f4f6f9; color:#1f2733; font-size:14px; }
.hidden { display:none !important; }
.brand { font-size:26px; font-weight:800; letter-spacing:1px; color:#0b5cff; }
.brand.sm { font-size:17px; color:#fff; }

/* login */
.login-wrap { min-height:100vh; display:flex; align-items:center; justify-content:center; background:linear-gradient(135deg,#0b5cff,#6a8dff); }
.login-card { width:360px; background:#fff; border-radius:14px; padding:34px 30px; box-shadow:0 12px 40px rgba(0,0,0,.18); }
.login-card .login-sub { color:#6b7280; margin:4px 0 22px; font-size:15px; }
label { display:block; margin:12px 0 5px; color:#374151; font-weight:600; font-size:13px; }
input, select, textarea { width:100%; padding:9px 11px; border:1px solid #d1d5db; border-radius:8px; font-size:14px; background:#fff; color:#1f2733; }
textarea { resize:vertical; line-height:1.6; }
input:focus,select:focus,textarea:focus { outline:none; border-color:#0b5cff; box-shadow:0 0 0 3px rgba(11,92,255,.12); }
button { cursor:pointer; border:none; border-radius:8px; font-size:14px; padding:9px 15px; font-weight:600; }
button.primary { background:#0b5cff; color:#fff; }
button.primary:hover { background:#094ede; }
button.ghost { background:#eef2f7; color:#374151; }
button.ghost:hover { background:#e2e8f0; }
button.danger { background:#fee2e2; color:#b91c1c; }
button.link { background:none; color:#0b5cff; padding:2px 0; font-size:13px; }
button.big { width:100%; padding:12px; margin-top:16px; font-size:15px; }
.err { color:#b91c1c; margin-top:12px; min-height:18px; }
.login-tip { margin-top:18px; color:#9ca3af; font-size:12px; line-height:1.6; }

/* app shell */
header { height:56px; background:#0b1220; color:#fff; display:flex; align-items:center; justify-content:space-between; padding:0 24px; }
.hd-left,.hd-right { display:flex; align-items:center; gap:14px; }
.hd-title { font-size:15px; color:#cbd5e1; }
.whoami { color:#94a3b8; font-size:13px; }
.tabs { display:flex; gap:2px; background:#fff; border-bottom:1px solid #e5e7eb; padding:0 24px; }
.tab { background:none; border-radius:0; color:#6b7280; padding:14px 20px; border-bottom:3px solid transparent; }
.tab.active { color:#0b5cff; border-bottom-color:#0b5cff; }
main { padding:22px 24px; max-width:1280px; margin:0 auto; }
.panel { display:none; }
.panel.active { display:block; }
.grid2 { display:grid; grid-template-columns:1fr 1fr; gap:18px; }
@media(max-width:900px){ .grid2{grid-template-columns:1fr;} }
.card { background:#fff; border:1px solid #e5e7eb; border-radius:12px; padding:20px 22px; margin-bottom:18px; }
.card h3 { margin:0 0 6px; font-size:16px; }
.card h4 { margin:18px 0 4px; font-size:14px; color:#111827; border-top:1px dashed #e5e7eb; padding-top:12px; }
.row { display:flex; gap:14px; align-items:flex-end; }
.row > div { flex:1; }
.row.between { justify-content:space-between; align-items:center; }
.chk { display:flex; align-items:center; gap:8px; font-weight:500; }
.chk input { width:auto; }
.hint { color:#6b7280; font-size:12px; line-height:1.6; margin-top:8px; }
code { background:#f1f5f9; padding:1px 5px; border-radius:4px; color:#0b5cff; }
.msg { margin-top:10px; min-height:18px; font-size:13px; }
.msg.ok { color:#15803d; }
.msg.err { color:#b91c1c; }

.business-data { margin-top:16px; border:1px solid #e5e7eb; border-radius:10px; padding:12px 14px; background:#fafbfc; }
.bd-head { display:flex; justify-content:space-between; align-items:center; }
.bd-fields { display:grid; grid-template-columns:1fr 1fr; gap:8px 12px; margin-top:10px; }
.bd-fields label { margin:0; font-size:12px; color:#6b7280; }
.bd-fields input { padding:6px 9px; font-size:13px; }
.preview-subject { background:#f8fafc; border:1px solid #e5e7eb; border-radius:8px; padding:10px 12px; min-height:40px; font-weight:600; }
.preview-body { background:#f8fafc; border:1px solid #e5e7eb; border-radius:8px; padding:14px; min-height:220px; white-space:pre-wrap; word-break:break-word; font-family:inherit; line-height:1.7; }

.tpl-list { margin-top:12px; }
.tpl-item { display:flex; justify-content:space-between; align-items:center; border:1px solid #e5e7eb; border-radius:9px; padding:12px 14px; margin-bottom:8px; }
.tpl-item .tpl-name { font-weight:600; }
.tpl-item .tpl-code { color:#9ca3af; font-size:12px; margin-left:8px; }
.tpl-item .badge { font-size:11px; padding:2px 8px; border-radius:20px; background:#dbeafe; color:#1e40af; margin-left:8px; }
.field-picker { margin:12px 0; display:flex; flex-wrap:wrap; gap:6px; }
.field-picker button { font-size:12px; padding:4px 10px; background:#eef2ff; color:#3730a3; font-weight:500; }

.log-table { width:100%; border-collapse:collapse; margin-top:12px; font-size:13px; }
.log-table th,.log-table td { text-align:left; padding:9px 10px; border-bottom:1px solid #eef0f3; }
.log-table th { color:#6b7280; font-weight:600; background:#fafbfc; }
.status-ok { color:#15803d; font-weight:600; }
.status-fail { color:#b91c1c; font-weight:600; }
.api-doc { background:#0b1220; color:#d1e7ff; border-radius:8px; padding:14px; font-size:12px; line-height:1.6; overflow:auto; white-space:pre-wrap; word-break:break-all; }

.toast { position:fixed; right:24px; bottom:24px; background:#0b1220; color:#fff; padding:12px 18px; border-radius:10px; box-shadow:0 8px 24px rgba(0,0,0,.25); z-index:99; }
