* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; font: 13px/1.5 "Microsoft YaHei", system-ui, sans-serif; color: #2c3e50; background: #f4f6f9; }
#rail-nav { display: flex; gap: 2px; background: #2c3e50; padding: 0 8px; position: sticky; top: 0; z-index: 50; }
#rail-nav a { color: #bdc3c7; text-decoration: none; padding: 9px 14px; }
#rail-nav a.on { color: #fff; background: #34495e; border-bottom: 2px solid #3498db; }
#rail-bar { display: flex; justify-content: space-between; align-items: center; padding: 6px 12px; background: #fff; border-bottom: 1px solid #e3e8ee; }
#rail-status { color: #7f8c8d; }
main { padding: 12px; }
button { font: inherit; padding: 4px 12px; border: 1px solid #3498db; background: #fff; color: #3498db; border-radius: 4px; cursor: pointer; }
button:hover { background: #3498db; color: #fff; }
button[disabled] { opacity: .5; cursor: wait; }
button.danger { border-color: #e74c3c; color: #e74c3c; }
button.danger:hover { background: #e74c3c; color: #fff; }
button.ghost { border-color: #95a5a6; color: #7f8c8d; }
input, select, textarea { font: inherit; padding: 4px 8px; border: 1px solid #ccd4dc; border-radius: 4px; background: #fff; }
textarea.csv { width: 100%; min-height: 120px; font-family: monospace; }
.card { background: #fff; border: 1px solid #e3e8ee; border-radius: 6px; padding: 10px 12px; margin-bottom: 12px; }
.card > h3 { margin: 0 0 8px; font-size: 14px; color: #2c3e50; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 8px; }
.spacer { flex: 1; }
table.grid { width: 100%; border-collapse: collapse; background: #fff; }
table.grid th, table.grid td { border-bottom: 1px solid #eef1f5; padding: 4px 8px; text-align: left; white-space: nowrap; }
table.grid th { background: #f8fafc; position: sticky; top: 0; z-index: 1; font-weight: 600; }
table.grid tr:hover td { background: #f4f8fc; }
.vbox { overflow: auto; border: 1px solid #e3e8ee; background: #fff; border-radius: 6px; position: relative; }
.pager { display: flex; align-items: center; gap: 10px; margin: 6px 0; }
.pager .dim { color: #7f8c8d; font-size: 12px; }
.vrow { display: flex; align-items: center; border-bottom: 1px solid #f0f3f6; padding: 0 8px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vrow:hover { background: #f4f8fc; }
.vrow b { margin-right: 8px; }
.vrow .dim { color: #95a5a6; margin-left: 6px; }
.tag { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 11px; color: #fff; margin-right: 4px; }
.tag.g { background: #2ecc71; } .tag.o { background: #f39c12; } .tag.r { background: #e74c3c; }
.tag.b { background: #3498db; } .tag.gray { background: #95a5a6; }
.progress { height: 10px; background: #e8edf2; border-radius: 5px; overflow: hidden; min-width: 120px; }
.progress i { display: block; height: 100%; background: #3498db; transition: width .3s; }
dialog.mdl { border: 0; border-radius: 8px; box-shadow: 0 8px 30px rgba(0,0,0,.25); padding: 0; max-width: 92vw; }
dialog.mdl::backdrop { background: rgba(20,30,40,.45); }
.mdl-head { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; border-bottom: 1px solid #e3e8ee; font-weight: 600; }
.mdl-body { padding: 12px 14px; max-height: 72vh; overflow: auto; min-width: 520px; }
.mdl-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 10px 14px; border-top: 1px solid #e3e8ee; }
.form-grid { display: grid; grid-template-columns: 110px 1fr 110px 1fr; gap: 8px; align-items: center; }
.form-grid label { text-align: right; color: #57606a; }
#rail-toasts { position: fixed; right: 16px; bottom: 16px; z-index: 999; display: flex; flex-direction: column; gap: 6px; }
.toast { padding: 8px 14px; border-radius: 6px; color: #fff; background: #2c3e50; box-shadow: 0 2px 8px rgba(0,0,0,.3); max-width: 480px; }
.toast.err { background: #e74c3c; } .toast.ok { background: #27ae60; } .toast.warn { background: #f39c12; }
.loading { padding: 30px; text-align: center; color: #95a5a6; }
.errline { color: #e74c3c; }
.warnline { color: #f39c12; }
.mono { font-family: monospace; }
details.fold { margin: 4px 0; }
details.fold summary { cursor: pointer; color: #3498db; }
.tabs { display: flex; gap: 4px; margin-bottom: 8px; flex-wrap: wrap; }
.tabs button { border-color: #ccd4dc; color: #57606a; }
.tabs button.on { background: #34495e; color: #fff; border-color: #34495e; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 2px 10px; }
.stale-bar { background: #fdecea; color: #c0392b; border: 1px solid #e6b0aa; border-radius: 6px; padding: 6px 10px; margin-bottom: 10px; }
.sug-wrap { position: relative; display: inline-block; }
.sug { position: absolute; left: 0; top: 100%; z-index: 60; background: #fff; border: 1px solid #ccd4dc; border-radius: 0 0 6px 6px; box-shadow: 0 4px 14px rgba(0,0,0,.15); max-height: 260px; overflow: auto; min-width: 240px; width: 100%; }
.sug-row { padding: 4px 10px; cursor: pointer; }
.sug-row:hover { background: #f4f8fc; }
.stops { border: 1px solid #eef1f5; border-radius: 6px; padding: 4px; margin: 6px 0; max-height: 340px; overflow: auto; }
.stop-row { display: flex; align-items: center; gap: 6px; padding: 2px 4px; border-bottom: 1px solid #f0f3f6; white-space: nowrap; }
.stop-row label { color: #95a5a6; font-size: 12px; }
.right { margin-left: auto; }
.sm { padding: 1px 8px; font-size: 12px; }
.err { color: #e74c3c; }
.kpis { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.kpi { border: 1px solid #e3e8ee; border-radius: 6px; padding: 6px 14px; background: #f8fafc; text-align: center; min-width: 84px; }
.kpi b { display: block; font-size: 18px; }
.kpi span { color: #7f8c8d; font-size: 12px; }
.kpi.g { background: #eafaf1; } .kpi.b { background: #ebf5fb; }
.kpi.r { background: #fdecea; } .kpi.o { background: #fef5e7; }
table.matrix td.cell { cursor: pointer; text-align: center; min-width: 64px; }
table.matrix td.cell:hover { background: #eaf6ff; }
table.matrix td.has { background: #f2fbf5; }
.warnbar { background: #fef5e7; color: #b9770e; border: 1px solid #f8c471; border-radius: 6px; padding: 6px 10px; margin-top: 8px; }
