
:root {
  --bg:#f4f6f9; --card:#fff; --bd:#e3e8ef; --fg:#1f2937;
  --muted:#6b7280; --accent:#2563eb; --accent-weak:#eff6ff;
  --danger:#dc2626; --ok:#16a34a;
}
* { box-sizing:border-box; }
html,body { margin:0; height:100%; }
body { font-family:system-ui,"Segoe UI",sans-serif; background:var(--bg); color:var(--fg); font-size:14px; }
a { color:var(--accent); text-decoration:none; }

.topbar {
  display:flex; align-items:center; gap:12px; padding:0 20px; height:52px;
  background:var(--card); border-bottom:1px solid var(--bd);
}
.brand { font-weight:700; font-size:16px; }
.spacer { flex:1; }
.muted { color:var(--muted); font-size:13px; }

.btn {
  border:1px solid var(--bd); background:var(--card); color:var(--fg);
  padding:7px 14px; border-radius:8px; cursor:pointer; font-size:14px; line-height:1.2;
}
.btn:hover { border-color:var(--accent); color:var(--accent); }
.btn:disabled { opacity:.6; cursor:default; }
.btn-primary { background:var(--accent); border-color:var(--accent); color:#fff; }
.btn-primary:hover { opacity:.9; color:#fff; }
.btn-success { background:var(--ok); border-color:var(--ok); color:#fff; }
.btn-success:hover { opacity:.9; color:#fff; }
.btn-ghost { border-color:transparent; background:transparent; color:var(--muted); }
.btn-ghost:hover { color:var(--danger); }

.workspace { padding:20px; height:calc(100vh - 52px); }
.empty { max-width:640px; margin:60px auto; background:var(--card);
  border:1px dashed var(--bd); border-radius:12px; padding:32px; text-align:center; }
.empty h2 { margin:0 0 8px; }
.empty p { color:var(--muted); margin:6px 0; }
.empty .muted { color:var(--muted); }

.layout { display:grid; grid-template-columns:300px 1fr; gap:16px; height:calc(100vh - 84px); }
.panel { background:var(--card); border:1px solid var(--bd); border-radius:12px; display:flex; flex-direction:column; overflow:hidden; }
.panel-h { padding:10px 14px; font-weight:600; border-bottom:1px solid var(--bd); display:flex; align-items:center; gap:8px; }
.panel-b { flex:1; overflow:auto; padding:8px; }

.drop-zone { border:2px dashed var(--bd); border-radius:10px; padding:22px; text-align:center;
  color:var(--muted); cursor:pointer; transition:.15s; }
.drop-zone.drag { border-color:var(--accent); background:var(--accent-weak); color:var(--accent); }
.list-item { padding:7px 10px; border-radius:7px; cursor:pointer; display:flex; justify-content:space-between; gap:8px; }
.list-item:hover { background:#f3f4f6; }
.list-item.active { background:var(--accent-weak); color:var(--accent); }
.list-item .sub { color:var(--muted); font-size:12px; white-space:nowrap; }

.toast { position:fixed; left:50%; bottom:26px; transform:translateX(-50%);
  background:#111827; color:#fff; padding:9px 16px; border-radius:8px; font-size:13px; z-index:99;
  box-shadow:0 6px 18px rgba(0,0,0,.18); opacity:0; transition:.2s; }
.toast.show { opacity:1; }

.tbl { width:100%; border-collapse:collapse; font-size:13px; }
.tbl th,.tbl td { border-bottom:1px solid var(--bd); padding:8px 10px; text-align:left; }
.tbl th { background:#fafbfc; font-weight:600; }
.tag { display:inline-block; padding:2px 8px; border-radius:20px; font-size:12px; }
.tag.on { background:#dcfce7; color:#166534; }
.tag.off { background:#fee2e2; color:#991b1b; }

.row { display:flex; gap:10px; align-items:center; flex-wrap:wrap; margin-bottom:10px; }
.row label { font-size:13px; margin:0; min-width:70px; }

.usermenu { position:relative; }
.me-btn { border:1px solid transparent; background:transparent; padding:6px 10px; border-radius:8px;
  cursor:pointer; font-size:13px; color:var(--fg); display:flex; align-items:center; gap:6px; }
.me-btn:hover { background:#f3f4f6; border-color:var(--bd); }
.caret { font-size:10px; color:var(--muted); }
.me-dd { position:absolute; right:0; top:calc(100% + 6px); min-width:150px; background:var(--card);
  border:1px solid var(--bd); border-radius:10px; box-shadow:0 10px 30px rgba(0,0,0,.16); padding:6px; z-index:60; }
.me-dd-item { padding:8px 12px; border-radius:8px; cursor:pointer; font-size:13px; }
.me-dd-item:hover { background:#f3f4f6; }

.modal-blind { position:fixed; inset:0; background:rgba(15,23,42,.45); backdrop-filter:blur(6px);
  -webkit-backdrop-filter:blur(6px); display:flex; align-items:center; justify-content:center; z-index:90; }
.modal-blind[hidden] { display:none; }
.modal-card { width:560px; max-width:94vw; max-height:86vh; display:flex; flex-direction:column;
  background:var(--card); border:1px solid var(--bd); border-radius:14px;
  box-shadow:0 20px 50px rgba(0,0,0,.22); overflow:hidden; }
.mod-h { display:flex; align-items:center; justify-content:space-between; padding:14px 18px;
  border-bottom:1px solid var(--bd); font-weight:600; font-size:15px; }
.mod-x { cursor:pointer; color:var(--muted); font-size:18px; line-height:1; padding:2px 7px; border-radius:6px; }
.mod-x:hover { background:#f3f4f6; color:var(--fg); }
.mod-b { padding:16px 18px; overflow:auto; }
.ann-html { max-height:44vh; overflow:auto; line-height:1.6; }
.ann-html img { max-width:100%; }
.mod-f { padding:12px 18px; border-top:1px solid var(--bd); display:flex; align-items:center; gap:12px; }
.mod-f .sp { flex:1; }
.mod-f .row-7 { display:flex; align-items:center; gap:6px; font-size:13px; margin:0; }