:root{
  --red:#c4001a;
  --red2:#ff1a2d;
  --text:#111;
  --muted:#666;
  --border:#d7d7d7;
  --bg:#ffffff;
  --panel:#f6f6f6;
  --shadow:0 6px 18px rgba(0,0,0,.10);
}
*{box-sizing:border-box}
html,body{height:100%}
body{margin:0;font-family:system-ui,-apple-system,Segoe UI,Roboto,Inter,Arial,sans-serif;background:var(--bg);color:var(--text)}
a{color:inherit;text-decoration:none}
.small{font-size:12px;color:var(--muted)}
.btn{
  display:inline-flex;align-items:center;justify-content:center;
  padding:8px 10px;border:1px solid var(--border);
  background:#fff;border-radius:6px;cursor:pointer;
}
.btn:hover{border-color:#b9b9b9}
.btn.red{border-color:var(--red);background:var(--red);color:#fff}
.btn.icon{width:36px;height:34px;padding:0}
.topline{
  display:flex;align-items:center;justify-content:space-between;
  padding:10px 14px;border-bottom:1px solid var(--border);
  background:#fff;
}
.brandline{
  display:flex;align-items:flex-end;gap:14px;
  padding:10px 14px;border-bottom:1px solid var(--border);
  background:#fff;
}
.brandline img{height:56px;object-fit:contain}
.navline{
  display:flex;align-items:center;gap:10px;flex-wrap:wrap;
  padding:8px 14px;border-bottom:2px solid var(--red);
  background:#fdfdfd;
}
.navitem{padding:6px 10px;border-bottom:3px solid transparent}
.navitem.active{border-bottom-color:var(--red)}
.select{padding:6px 8px;border:1px solid var(--border);border-radius:6px;background:#fff}
.layout{
  display:grid;
  grid-template-columns: 190px 1fr;
  height: calc(100vh - 132px);
}
@media (max-width: 860px){
  .layout{grid-template-columns: 132px 1fr; height: calc(100vh - 152px);}
  .brandline img{height:46px}
}
.sidebar{
  border-right:1px solid var(--border);
  background:#f2f2f2;
  overflow:auto;
  padding:10px 8px;
}
.thumbcard{
  background:#fff;border:1px solid var(--border);border-radius:6px;
  box-shadow:var(--shadow);
  padding:8px;margin:10px 0;cursor:pointer;
}
.thumbcard .lbl{
  text-align:center;font-weight:700;color:#444;margin-bottom:6px;
}
.thumbcard img{width:100%;border-radius:4px;border:1px solid #eee;display:block}
.viewerwrap{
  position:relative;background:#fff;overflow:hidden;
}
#osd{width:100%;height:100%}
.arrow{
  position:absolute;top:50%;transform:translateY(-50%);
  width:34px;height:64px;border:1px solid var(--red);
  background:rgba(196,0,26,.85);color:#fff;
  display:flex;align-items:center;justify-content:center;
  cursor:pointer;z-index:40;border-radius:4px;
}
.arrow.left{left:10px}
.arrow.right{right:10px}
.bottomtools{
  position:absolute;left:50%;transform:translateX(-50%);
  bottom:10px;z-index:50;
  background:rgba(255,255,255,.92);
  border:1px solid var(--border);
  box-shadow:var(--shadow);
  border-radius:6px;
  display:flex;gap:6px;padding:6px;
}
.adslot{
  position:absolute;z-index:30;
  width:150px;height:150px;border:1px solid var(--border);
  background:#fff;box-shadow:var(--shadow);
  border-radius:6px;overflow:hidden;
}
.adslot img{width:100%;height:100%;object-fit:cover}
.ad-tl{top:10px;left:10px}
.ad-tr{top:10px;right:10px}
.ad-bl{bottom:90px;left:10px}
.ad-br{bottom:90px;right:10px}
@media (max-width:720px){
  .adslot{width:110px;height:110px}
  .ad-bl,.ad-br{bottom:90px}
}
.modal{
  position:fixed;inset:0;z-index:999;
  display:none;align-items:center;justify-content:center;
  background:rgba(0,0,0,.55);
  padding:12px;
}
.modal.show{display:flex}
.modal .box{
  width:min(1100px, 98vw);
  background:#fff;border-radius:8px;
  box-shadow:0 18px 50px rgba(0,0,0,.25);
  overflow:hidden;border:1px solid var(--border);
}
.modal .top{
  display:flex;align-items:center;justify-content:space-between;gap:10px;
  padding:10px 12px;border-bottom:1px solid var(--border);
}
.modal .title{font-weight:800}
.modal .content{padding:10px}
.cropCanvas{width:100%;height:auto;border:1px solid var(--border);border-radius:6px;background:#fff}
