:root { --bg:#f3f6fb; --surface:#fff; --soft:#f8fafc; --text:#172033; --muted:#64748b; --line:#dce3ed; --primary:#2563eb; --danger:#dc2626; --shadow:0 8px 30px rgba(28,45,75,.08); }
* { box-sizing:border-box; }
body { font-family:Inter,ui-sans-serif,system-ui,-apple-system,"PingFang SC","Microsoft YaHei",sans-serif; margin:0; background:var(--bg); color:var(--text); line-height:1.5; }
.nav { min-height:58px; background:#111b30; padding:0 max(20px,calc((100vw - 1440px)/2)); display:flex; align-items:center; gap:4px; overflow-x:auto; box-shadow:0 2px 14px rgba(5,13,31,.24); }
.nav::before { content:"ASTERRA"; color:#fff; font-size:13px; font-weight:800; letter-spacing:.16em; margin-right:20px; }
.nav a { color:#b9c5da; text-decoration:none; font-size:14px; white-space:nowrap; padding:18px 12px 16px; border-bottom:3px solid transparent; }
.nav a:hover,.nav a.active { color:#fff; background:rgba(255,255,255,.05); }
.nav a.active { border-bottom-color:#60a5fa; }
.page-header,h1,h2,.row,.page-status,.table-wrap,.cards,.detail-panel,.toolbar { width:min(1440px,calc(100% - 40px)); margin-left:auto; margin-right:auto; }
.page-header { padding:30px 0 16px; }
.page-header h1,h1 { padding:0; margin:0; font-size:28px; letter-spacing:-.02em; }
.page-header p { margin:5px 0 0; color:var(--muted); font-size:14px; }
h1 { padding-top:28px; }
h2 { font-size:18px; margin-top:28px; margin-bottom:10px; }
.token-row,.toolbar,.row { background:var(--surface); border:1px solid var(--line); border-radius:10px; padding:12px 14px; margin-top:10px; margin-bottom:14px; display:flex; align-items:end; flex-wrap:wrap; gap:10px; box-shadow:0 3px 14px rgba(28,45,75,.04); }
.token-row { width:min(1440px,calc(100% - 40px)); margin-left:auto; margin-right:auto; font-size:13px; }
label { color:#46536a; font-size:12px; font-weight:650; display:grid; gap:5px; }
input,select,textarea { width:100%; min-height:38px; padding:7px 10px; color:var(--text); background:#fff; border:1px solid #cbd5e1; border-radius:7px; font:inherit; font-size:14px; }
textarea { min-height:86px; resize:vertical; }
input:focus,select:focus,textarea:focus { outline:3px solid #dbeafe; border-color:#60a5fa; }
.token-row label { display:flex; align-items:center; gap:8px; }
.token-row input { width:min(360px,58vw); }
.sel { min-width:130px; }
button,.button { min-height:36px; padding:7px 13px; border:1px solid transparent; border-radius:7px; background:var(--primary); color:#fff; font:inherit; font-size:13px; font-weight:650; text-decoration:none; cursor:pointer; }
button:hover,.button:hover { background:#1d4ed8; }
button:disabled { opacity:.55; cursor:wait; }
button.secondary { background:#fff; color:#334155; border-color:#cbd5e1; }
button.secondary:hover { background:#f8fafc; }
button.danger { color:var(--danger); background:#fff; border-color:#fecaca; }
button.danger:hover { background:#fef2f2; }
button.small { min-height:30px; padding:4px 8px; font-size:12px; }
.toolbar .spacer { flex:1; }
.page-status { border-radius:8px; padding:10px 13px; margin-top:0; margin-bottom:14px; font-size:13px; }
.page-status.success { color:#065f46; background:#ecfdf5; border:1px solid #a7f3d0; }
.page-status.error { color:#991b1b; background:#fef2f2; border:1px solid #fecaca; }
.page-status.info { color:#1e40af; background:#eff6ff; border:1px solid #bfdbfe; }
.cards { display:grid; grid-template-columns:repeat(auto-fit,minmax(170px,1fr)); gap:14px; padding:0; }
.card { background:var(--surface); border:1px solid var(--line); border-radius:12px; box-shadow:var(--shadow); padding:18px 20px; }
.card .k { color:var(--muted); font-size:12px; font-weight:650; }
.card .v { font-size:27px; font-weight:750; margin-top:7px; letter-spacing:-.03em; }
.table-wrap { overflow-x:auto; background:var(--surface); border:1px solid var(--line); border-radius:10px; box-shadow:var(--shadow); margin-top:8px; }
table { width:100%; border-collapse:collapse; background:#fff; }
th,td { padding:10px 12px; border-bottom:1px solid #edf0f5; font-size:13px; text-align:left; vertical-align:top; }
th { background:var(--soft); color:#475569; font-size:11px; text-transform:uppercase; letter-spacing:.035em; white-space:nowrap; }
tbody tr:last-child td { border-bottom:0; }
tbody tr:hover td { background:#fbfdff; }
.clickable { cursor:pointer; }
.table-message { text-align:center; padding:32px; }
.muted { color:var(--muted); }
.actions { display:flex; align-items:center; gap:6px; white-space:nowrap; }
.badge { display:inline-flex; align-items:center; border-radius:999px; padding:2px 8px; background:#e2e8f0; color:#475569; font-size:11px; font-weight:700; }
.badge.done,.badge.committed,.badge.reviewed { background:#d1fae5; color:#065f46; }
.badge.queued,.badge.running { background:#dbeafe; color:#1e40af; }
.badge.failed,.badge.dead,.badge.cancelled { background:#fee2e2; color:#991b1b; }
.detail-panel { margin-top:18px; background:var(--surface); border:1px solid var(--line); border-radius:10px; padding:18px; box-shadow:var(--shadow); }
.detail-panel h2 { width:auto; margin:0 0 12px; }
.detail-panel .row { width:auto; margin:0; padding:8px 0; border:0; box-shadow:none; }
.fb-grid { display:grid; grid-template-columns:1fr 1fr; gap:16px; }
.fb-col h3 { font-size:14px; margin:0 0 8px; }
.fb-col img { display:block; max-width:100%; max-height:420px; border-radius:7px; margin:4px 0; background:#eef2f7; }
.asset-preview { padding:8px; border:1px solid var(--line); border-radius:8px; margin-bottom:8px; }
.score-bar { display:inline-block; width:68px; height:8px; background:#e2e8f0; border-radius:4px; overflow:hidden; vertical-align:middle; }
.score-bar>span { display:block; height:100%; background:linear-gradient(90deg,#f59e0b,#10b981); }
code,pre { font-family:ui-monospace,SFMono-Regular,Menlo,monospace; font-size:12px; }
pre { white-space:pre-wrap; word-break:break-word; margin:0; max-width:460px; }
.spinner { display:inline-block; width:14px; height:14px; margin-right:8px; border:2px solid #bfdbfe; border-top-color:var(--primary); border-radius:50%; animation:spin .8s linear infinite; vertical-align:-2px; }
@keyframes spin { to { transform:rotate(360deg); } }
dialog { width:min(620px,calc(100% - 28px)); max-height:calc(100vh - 40px); overflow:auto; padding:0; border:0; border-radius:12px; box-shadow:0 24px 80px rgba(15,23,42,.32); }
dialog::backdrop { background:rgba(15,23,42,.5); backdrop-filter:blur(2px); }
.dialog-header { display:flex; justify-content:space-between; align-items:center; padding:17px 20px; border-bottom:1px solid var(--line); }
.dialog-header h2 { width:auto; margin:0; font-size:18px; }
.dialog-body { padding:18px 20px; display:grid; gap:13px; }
.dialog-grid { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.dialog-actions { display:flex; justify-content:flex-end; gap:8px; padding:14px 20px; border-top:1px solid var(--line); }
.icon-close { color:#64748b; background:transparent; border:0; font-size:20px; padding:3px 8px; min-height:auto; }
.icon-close:hover { background:#f1f5f9; }
.pagination { display:flex; align-items:center; justify-content:flex-end; gap:8px; width:min(1440px,calc(100% - 40px)); margin:12px auto; color:var(--muted); font-size:12px; }
@media (max-width:720px) {
  .nav { padding:0 10px; } .nav::before { display:none; } .nav a { padding-left:9px; padding-right:9px; }
  .page-header,h1,h2,.row,.page-status,.table-wrap,.cards,.detail-panel,.toolbar,.token-row { width:calc(100% - 24px); }
  .page-header { padding-top:22px; } .page-header h1,h1 { font-size:23px; } .cards { grid-template-columns:1fr 1fr; }
  .fb-grid,.dialog-grid { grid-template-columns:1fr; } .toolbar label { width:100%; } .toolbar .spacer { display:none; }
}
