:root{
  --ink:#141414; --muted:#6f6f6f; --line:#e3e3e3; --bg:#f7f7f7; --green:#141414;
  --soft:#f0f0f0; --card:#fff; --warn:#141414; --accent:#141414;
}
*{box-sizing:border-box}
html{-webkit-text-size-adjust:100%}
body{margin:0;font-family:-apple-system,"PingFang SC","Helvetica Neue",Arial,sans-serif;
  color:var(--ink);background:var(--bg);font-size:15px;line-height:1.5}
header{padding:18px 16px 12px;background:#fff;border-bottom:1px solid var(--line)}
.brand{display:flex;align-items:center;gap:16px}
.logo{display:block;height:90px;width:auto}
.brandtext{border-left:1px solid var(--line);padding-left:16px;min-width:0}
h1{margin:0;font-size:20px;letter-spacing:.3px}
.sub{margin:3px 0 0;color:var(--muted);font-size:12.5px}
@media(max-width:600px){
  .brand{gap:8px;flex-wrap:wrap}
  .logo{height:64px}
  .brandtext{flex-basis:100%;padding-left:0;border-left:0;border-top:1px solid var(--line);padding-top:8px}
  h1{font-size:18px}
  .sub{font-size:11.5px}
}
.tabs{display:flex;background:#fff;border-bottom:1px solid var(--line);position:sticky;top:0;z-index:20}
.tabs button{flex:1;border:0;background:none;padding:13px 8px;font-size:14px;color:var(--muted);cursor:pointer;
  border-bottom:2px solid transparent}
.tabs button.active{color:var(--green);border-bottom-color:var(--green);font-weight:600}
main{max-width:1100px;margin:0 auto;padding:12px 12px 40px}
.panel{background:var(--card);border:1px solid var(--line);border-radius:12px;padding:14px;margin-bottom:12px}
input[type=text],input[type=search]{width:100%;padding:12px 12px;border:1px solid var(--line);border-radius:10px;
  font-size:16px;background:#fcfcfc;outline:none}
input[type=text]:focus,input[type=search]:focus{border-color:var(--green)}
.results{margin-top:6px;border:1px solid var(--line);border-radius:10px;max-height:260px;overflow:auto;display:none;background:#fff}
.results.on{display:block}
.item{padding:11px 12px;font-size:14px;cursor:pointer;border-bottom:1px solid #f0f0f0}
.item:last-child{border-bottom:0}
.item:active{background:var(--soft)}
.item small{color:var(--muted);margin-left:6px;font-size:12px}
.toolbar{display:flex;gap:8px;margin-top:10px;flex-wrap:wrap}
button.act{border:1px solid var(--line);background:#fff;border-radius:9px;padding:9px 13px;font-size:13px;cursor:pointer;color:var(--ink)}
button.act:active{background:var(--soft)}
button.act.primary{background:var(--green);border-color:var(--green);color:#fff}
button.act.danger{color:#141414}
.listsbar{display:flex;gap:8px;margin-top:10px;flex-wrap:wrap}
#hybrid .listsbar input{flex:1 1 0;width:auto;min-width:0}
.listsbar input{flex:1;min-width:140px}
.chips{display:flex;flex-wrap:wrap;gap:6px;margin-top:10px}
.chip{background:var(--soft);border:1px solid #dcdcdc;border-radius:999px;padding:6px 10px;font-size:12.5px;
  display:inline-flex;align-items:center;gap:6px;cursor:pointer}
.chip button{border:0;background:none;color:#6f6f6f;cursor:pointer;font-size:16px;line-height:1;padding:0 0 0 2px}
.chip .badge{color:var(--accent);font-size:11px}
/* sort bar */
.sortbar{display:flex;flex-wrap:wrap;gap:6px;padding:2px 0 10px}
.sortbar button{flex:0 0 auto;border:1px solid var(--line);background:#fff;border-radius:999px;padding:7px 12px;font-size:12px;color:var(--muted);cursor:pointer}
.sortbar button.active{background:#141414;border-color:#141414;color:#fff}
/* cards (mobile) */
.cards{display:flex;flex-direction:column;gap:10px}
.card.rc{background:#fff;border:1px solid var(--line);border-radius:12px;padding:12px}
.rc-head{display:flex;align-items:flex-start;justify-content:space-between;gap:8px}
.rc-name{font-weight:600;font-size:14.5px;line-height:1.3;word-break:break-word}
.rc-meta{color:var(--muted);font-size:12px;margin-top:2px}
.rc-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:6px;margin-top:10px}
.rc-grid div{background:#fafafa;border-radius:8px;padding:6px 8px;font-size:11.5px;color:var(--muted)}
.rc-grid b{display:block;font-size:13.5px;color:var(--ink);font-weight:600;margin-top:1px}
.rc-actions{display:flex;gap:6px;margin-top:10px;flex-wrap:wrap}
.rc-actions button{border:1px solid var(--line);background:#fff;border-radius:8px;padding:8px 10px;font-size:12px;cursor:pointer}
.rc-actions button:active{background:var(--soft)}
.rc-actions .del{color:#141414}
.rc-actions .hy{color:var(--green)}
.movecol{display:flex;flex-direction:column;gap:4px}
.movecol button{width:30px;height:30px;padding:0;font-size:12px;color:#8a8a8a}
/* desktop table */
.tbl{width:100%;border-collapse:collapse;font-size:12.5px;background:#fff}
.tbl th,.tbl td{padding:9px 8px;border-bottom:1px solid #efefef;text-align:right;white-space:nowrap}
.tbl th:first-child,.tbl td:first-child{text-align:left}
.tbl th{background:#fafafa;color:var(--green);font-size:11.5px;cursor:pointer;user-select:none}
.tbl th:hover{background:var(--soft)}
.tbl td.name{max-width:240px;overflow:hidden;text-overflow:ellipsis}
.tbl tr.dragging{opacity:.35}
.tbl tr.dragover{outline:2px dashed var(--green);outline-offset:-2px;background:#f5f5f5}
.smallbtn{border:0;background:none;color:#8a8a8a;cursor:pointer;font-size:12px;padding:2px 4px}
.smallbtn:hover{color:var(--green)}
.hyadd{border:1px solid var(--line);background:#fff;border-radius:999px;font-size:10.5px;padding:2px 7px;margin-left:4px;cursor:pointer;color:var(--green)}
/* hybrid */
.hycol{margin-bottom:14px}
.hycol h3{margin:0 0 8px;font-size:14px;color:var(--green)}
.hyscroll{overflow-x:auto;max-width:100%;-webkit-overflow-scrolling:touch}
.hytable{width:100%;min-width:520px;border-collapse:collapse;font-size:11.5px}
.hytable th,.hytable td{padding:6px 5px;border-bottom:1px solid #efefef;text-align:right;white-space:nowrap}
.hytable th:first-child,.hytable td:first-child{text-align:left}
.hytable th{color:var(--green);background:#f6f6f6;font-weight:600}
.hytable td.name{max-width:180px;overflow:hidden;text-overflow:ellipsis}
.genbtn{width:100%;border:0;background:var(--green);color:#fff;border-radius:10px;padding:13px;font-size:14px;cursor:pointer}
.paircard{border:1px solid var(--line);border-radius:10px;padding:12px;margin-bottom:10px;background:#fff}
.paircard .pt{font-weight:600;font-size:14px}
.paircard .ps{float:right;color:var(--green);font-weight:700}
.paircard ul{margin:6px 0 0;padding-left:18px;font-size:12.5px;line-height:1.7}
.paircard .risk{color:#141414}
.paircard button{margin-top:10px;border:1px solid var(--line);background:#fff;border-radius:8px;padding:8px 12px;font-size:12.5px;cursor:pointer}
.empty{padding:24px;text-align:center;color:var(--muted);font-size:13px}
.note{font-size:11.5px;color:var(--muted);line-height:1.7}
/* footer */
footer{max-width:1100px;margin:0 auto;padding:18px 16px 40px;color:var(--muted);font-size:12px;line-height:1.8}
footer b{color:var(--ink)}
footer details{margin:10px 0}
footer summary{cursor:pointer;color:var(--green);font-weight:600;font-size:12.5px}
footer h4{margin:14px 0 4px;font-size:12px;color:var(--ink)}
footer ul{margin:0;padding-left:18px}
footer li{margin:3px 0}
footer a{color:#141414;text-decoration:none}
footer a:hover{text-decoration:underline}
footer .credit{margin-top:14px;padding-top:10px;border-top:1px solid var(--line);font-size:12px;color:var(--muted)}
/* responsive */
.desktop-only{display:none}
@media(min-width:768px){
  body{font-size:14px}
  main{padding:18px 20px 50px}
  .mobile-only{display:none!important}
  .desktop-only{display:block}
  .cards{display:none}
  .rc-grid{grid-template-columns:repeat(6,1fr)}
  .tabs{position:static}
}
@media(max-width:767px){
  .tbl{display:none}
  .hyscroll{overflow:visible}
  .hytable{min-width:0;border:0}
  .hytable thead{display:none}
  .hytable tr{display:block;border:1px solid var(--line);border-radius:10px;padding:10px 12px;margin-bottom:8px;background:#fff}
  .hytable td{display:flex;justify-content:space-between;border:0;padding:3px 0;text-align:right;font-size:12px}
  .hytable td.name{font-weight:600;font-size:13.5px;text-align:left;max-width:none;white-space:normal}
  .hytable td[data-l]::before{content:attr(data-l);color:var(--muted);font-size:11.5px}
  .hytable td:last-child{justify-content:flex-end;gap:6px;padding-top:8px}
  .pairtable .hyscroll{overflow-x:auto}
}
@media(max-width:480px){
  .listsbar input{flex:1 1 100%}
}
