* { box-sizing: border-box; }
body { margin: 0; font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
       background: #f4f6f8; color: #222; font-size: 14px; }
.layout { display: flex; min-height: 100vh; }
.sidebar { width: 200px; background: #1e293b; color: #cbd5e1; padding: 16px 12px;
           display: flex; flex-direction: column; gap: 8px; position: sticky; top: 0; height: 100vh; }
.brand { color: #fff; font-size: 16px; font-weight: 700; padding: 4px 8px 12px; border-bottom: 1px solid #334155; }
.sidebar nav { display: flex; flex-direction: column; gap: 2px; }
.sidebar nav a { color: #cbd5e1; text-decoration: none; padding: 9px 10px; border-radius: 6px; }
.sidebar nav a:hover { background: #334155; color: #fff; }
.sidebar nav a.on { background: #3b82f6; color: #fff; }
.sidebar nav a.action { margin-top: 8px; border: 1px dashed #64748b; text-align: center; }
.side-foot { margin-top: auto; font-size: 12px; color: #64748b; padding: 8px; }
.content { flex: 1; padding: 24px 28px; max-width: 1200px; }
h1 { font-size: 22px; margin: 0 0 16px; }
h2 { font-size: 16px; margin: 0 0 12px; }
h3.cat { margin: 18px 0 6px; font-size: 14px; color: #475569; }
a { color: #2563eb; }
a.strong { font-weight: 600; color: #1d4ed8; text-decoration: none; }
a.strong:hover { text-decoration: underline; }
.muted { color: #94a3b8; font-size: 12px; }
.mono { font-family: ui-monospace, Menlo, monospace; font-size: 12px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.actions { display: flex; gap: 8px; align-items: center; }
.card { background: #fff; border: 1px solid #e2e8f0; border-radius: 10px; padding: 16px 18px; margin-bottom: 18px; box-shadow: 0 1px 2px rgba(0,0,0,.03); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat { background: #fff; border: 1px solid #e2e8f0; border-radius: 10px; padding: 14px 16px; }
.stat b { display: block; font-size: 26px; color: #1e293b; }
.stat span { color: #64748b; font-size: 12px; }
.stat.warn b { color: #dc2626; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid #eef2f6; vertical-align: top; }
th { color: #64748b; font-weight: 600; font-size: 12px; background: #f8fafc; }
tr:hover td { background: #f8fafc; }
table.kv td { border: none; padding: 4px 10px; }
table.kv td:nth-child(odd) { color: #64748b; width: 90px; }
.row-overdue td { background: #fef2f2 !important; }
.row-soon td { background: #fffbeb !important; }
.btn { display: inline-block; border: 1px solid #cbd5e1; background: #fff; color: #334155;
       padding: 6px 12px; border-radius: 6px; cursor: pointer; text-decoration: none; font-size: 13px; }
.btn:hover { background: #f1f5f9; }
.btn.primary { background: #2563eb; border-color: #2563eb; color: #fff; }
.btn.primary:hover { background: #1d4ed8; }
.btn.danger { color: #dc2626; border-color: #fecaca; }
.btn.danger:hover { background: #fef2f2; }
.btn.sm { padding: 2px 8px; font-size: 12px; }
.tag { display: inline-block; padding: 1px 8px; border-radius: 999px; background: #e2e8f0; color: #475569; font-size: 12px; }
.tag-ok { background: #dcfce7; color: #166534; }
.tag-warn { background: #fef3c7; color: #92400e; }
.tag-bad { background: #fee2e2; color: #991b1b; }
.tag-mut { background: #f1f5f9; color: #64748b; }
.empty { color: #94a3b8; padding: 12px 0; }
.note { background: #f8fafc; border-left: 3px solid #cbd5e1; padding: 8px 12px; border-radius: 4px; }
.filters { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.filters input[type=search], .filters input[type=text], .filters select,
.form input, .form select, .form textarea, .inline-form input, .inline-form select,
.upload-row select { padding: 7px 10px; border: 1px solid #cbd5e1; border-radius: 6px; font-size: 13px; background: #fff; }
.filters input[type=search] { width: 320px; }
.form { background: #fff; border: 1px solid #e2e8f0; border-radius: 10px; padding: 18px; }
.form .grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 20px; }
.form label { display: flex; flex-direction: column; gap: 4px; font-weight: 600; color: #475569; font-size: 13px; margin-bottom: 12px; }
.form small { color: #94a3b8; font-weight: 400; }
.form textarea { width: 100%; }
.form .actions { margin-top: 10px; }
.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; }
.flash-ok { background: #dcfce7; color: #166534; }
.flash-error { background: #fee2e2; color: #991b1b; }
.uploader { border: 2px dashed #cbd5e1; border-radius: 10px; padding: 18px; background: #f8fafc; margin-bottom: 12px; }
.upload-hint { color: #64748b; margin-bottom: 10px; }
.upload-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.upload-row input[type=file] { flex: 1; min-width: 200px; }
.inline-form { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.inline-form input[name=title] { width: 200px; }
.result { background: #fff; border: 1px solid #e2e8f0; border-radius: 8px; padding: 12px 14px; margin-bottom: 10px; }
.snippet { margin-top: 6px; color: #334155; line-height: 1.6; }
.steps li { margin-bottom: 6px; }
.modal { position: fixed; inset: 0; background: rgba(15,23,42,.5); display: flex;
         align-items: center; justify-content: center; z-index: 50; }
.modal-box { background: #fff; width: min(860px, 92vw); max-height: 86vh; border-radius: 10px;
             display: flex; flex-direction: column; overflow: hidden; }
.modal-head { display: flex; justify-content: space-between; align-items: center;
              padding: 12px 16px; border-bottom: 1px solid #e2e8f0; }
.mat-text { margin: 0; padding: 16px; overflow: auto; white-space: pre-wrap; font-size: 13px; line-height: 1.7; font-family: inherit; }

/* 起草编辑器 */
.draft-wrap { display: flex; gap: 16px; align-items: flex-start; }
.draft-left { flex: 1.15; min-width: 0; }
.draft-right { flex: 1; min-width: 0; position: sticky; top: 12px; max-height: 90vh; overflow: auto; }
.party { display: flex; gap: 8px; margin-bottom: 8px; align-items: center; }
.party b { width: 48px; color: #475569; flex: none; }
.party input { flex: 1; }
.sec { margin-top: 16px; border-top: 1px solid #eef2f6; padding-top: 10px; }
.sec h3 { margin: 0 0 8px; font-size: 15px; }
.itm { border: 1px solid #e2e8f0; border-radius: 8px; padding: 8px 10px; margin-bottom: 10px; background: #fbfdff; }
.itm textarea { width: 100%; border: 1px solid #cbd5e1; border-radius: 6px; padding: 8px; font-size: 13px; line-height: 1.6; font-family: inherit; resize: vertical; }
.chips { margin: 6px 0; display: flex; flex-wrap: wrap; gap: 6px; }
.itm-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.tag-law { background: #dbeafe; color: #1e40af; }
.tag-mat { background: #dcfce7; color: #166534; }
.tag .x { cursor: pointer; margin-left: 4px; color: #94a3b8; font-weight: 700; }
.tag .x:hover { color: #dc2626; }
.evi { display: flex; gap: 8px; margin-bottom: 8px; }
.evi select { flex: 2; }
.evi input { flex: 3; }
.modal-body { padding: 12px 16px; overflow: auto; max-height: 60vh; }
.pick-item { padding: 8px 10px; border: 1px solid #e2e8f0; border-radius: 6px; margin-bottom: 6px; cursor: pointer; background: #fff; }
.pick-item:hover { border-color: #2563eb; background: #eff6ff; }
.draft-preview { font-size: 14px; line-height: 1.8; }
.pv-title { text-align: center; font-weight: 700; font-size: 18px; margin-bottom: 10px; }
.pv-h { font-weight: 700; margin: 10px 0 4px; }
.pv-p { margin-bottom: 6px; }
.pv-right { text-align: right; margin-top: 14px; }
.pv-meta { font-size: 12px; margin-top: 2px; }
.pv-p.abstain { background: #fef2f2; border-left: 3px solid #dc2626; padding: 2px 6px; }
.pv-p.partial { background: #fffbeb; border-left: 3px solid #d97706; padding: 2px 6px; }

/* 法条分类 */
.cat-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.cat-chips .chip { border: 1px solid #cbd5e1; background: #fff; color: #334155;
  padding: 5px 12px; border-radius: 999px; text-decoration: none; font-size: 13px; }
.cat-chips .chip:hover { border-color: #2563eb; color: #2563eb; }
.cat-chips .chip.on { background: #2563eb; border-color: #2563eb; color: #fff; }
.law-group { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.law-card { background: #fff; border: 1px solid #e2e8f0; border-radius: 8px; padding: 10px 12px; }
.law-head { display: flex; justify-content: space-between; align-items: center; gap: 6px; margin-bottom: 4px; }

.tag-interp { background: #ede9fe; color: #5b21b6; }
.tag-prec { background: #cffafe; color: #155e75; }

/* 出行：票面 + 地图 */
.ticket { display:flex; gap:16px; align-items:stretch; background:#fff;
  border:1px dashed #94a3b8; border-radius:14px; padding:0; overflow:hidden; position:relative; }
.ticket .t-left { padding:14px 18px; flex:1; }
.ticket .t-right { display:flex; flex-direction:column; justify-content:center; align-items:center;
  background:#f1f5f9; border-left:2px dashed #cbd5e1; padding:10px 18px; min-width:110px; }
.ticket .route { font-size:26px; font-weight:700; color:#0f172a; }
.ticket .meta { color:#64748b; font-size:13px; margin-top:6px; }
.ticket .cut { position:absolute; width:18px; height:18px; border-radius:50%; background:#f4f6f8; }
.ticket .cut.t { top:-9px; left:50%; transform:translateX(-50%); }
.ticket .cut.b { bottom:-9px; left:50%; transform:translateX(-50%); }
.map-wrap { border:1px solid #e2e8f0; border-radius:12px; overflow:hidden; background:#f8fafc; }
.sp-ta { width:100%; border:1px solid #cbd5e1; border-radius:6px; padding:8px; font-size:13px; line-height:1.6; font-family:inherit; margin-bottom:8px; resize:vertical; }
#sp_body h4 { margin:12px 0 6px; color:#1e293b; }

.side-user { border-top:1px solid #eef2f6; margin:10px 16px 4px; padding:10px 0 2px; font-size:13px; }
.side-user b { color:#0f172a; }
.side-user a { color:#2563eb; text-decoration:none; }
