/* EditGit v1 — approved design: clean light UI, ink navy + Git orange, green Publish */
* { margin:0; padding:0; box-sizing:border-box; }
:root{
  --ink:#0f172a; --ink2:#334155; --mut:#64748b; --line:#e2e8f0;
  --bg:#f4f6f8; --card:#ffffff; --acc:#ee5136; --acc-d:#d63f27; --acc-bg:#fdeee9;
  --grn:#0e9f6e; --grn-d:#067647; --grn-bg:#e7f8f1;
  --amb:#b45309; --amb-bg:#fdf3e0; --blu:#2563eb; --blu-bg:#e8effc;
  --gold:#c9a227; --rad:14px;
}
html,body{ height:100%; }
body{ font-family:-apple-system,"Segoe UI",Inter,Roboto,"Helvetica Neue",Arial,sans-serif; background:var(--bg); color:var(--ink); font-size:14.5px; }
button{ font-family:inherit; }
a{ color:var(--blu); }
input,textarea,select{ font-family:inherit; font-size:14px; color:var(--ink); }
:focus-visible{ outline:2px solid var(--acc); outline-offset:1px; }

/* buttons + shared */
.btn{ border:1px solid var(--line); background:#fff; color:var(--ink); font-size:13.5px; font-weight:600; padding:9px 15px; border-radius:10px; cursor:pointer; display:inline-flex; align-items:center; gap:7px; text-decoration:none; }
.btn:hover{ background:#f8fafc; }
.btn.primary{ background:var(--acc); border-color:var(--acc); color:#fff; }
.btn.primary:hover{ background:var(--acc-d); }
.btn.green{ background:var(--grn); border-color:var(--grn); color:#fff; }
.btn.ghost{ border-color:transparent; color:var(--ink2); }
.btn.small{ padding:6px 11px; font-size:12.5px; border-radius:8px; }
.btn:disabled{ opacity:.55; cursor:wait; }
.btn.danger{ color:#b42318; }
.inp, .sel{ background:#fff; border:1px solid var(--line); border-radius:10px; padding:9px 12px; }
.inp:focus,.sel:focus,textarea.inp:focus{ border-color:var(--acc); outline:none; box-shadow:0 0 0 3px var(--acc-bg); }
.chip{ display:inline-block; background:#eef2f7; color:var(--ink2); font-size:12px; font-weight:600; padding:4px 9px; border-radius:999px; margin:0 4px 4px 0; }
.pill{ font-size:12px; font-weight:700; padding:5px 10px; border-radius:999px; white-space:nowrap; }
.pill.pub{ background:var(--grn-bg); color:var(--grn-d); }
.pill.drf{ background:var(--amb-bg); color:var(--amb); }
.dot{ width:8px; height:8px; border-radius:50%; background:var(--grn); display:inline-block; }
.zchip{ display:inline-flex; align-items:center; gap:6px; background:var(--grn-bg); color:var(--grn-d); font-size:12px; font-weight:700; padding:5px 10px; border-radius:999px; }
.avatar{ width:34px; height:34px; border-radius:50%; background:linear-gradient(135deg,#ee5136,#f59e0b); color:#fff; font-weight:700; display:flex; align-items:center; justify-content:center; font-size:14px; flex:0 0 34px; }
.logo{ display:flex; align-items:center; gap:10px; font-weight:800; font-size:19px; letter-spacing:-.3px; }
.logo .mark{ width:32px; height:32px; border-radius:9px; background:var(--ink); display:flex; align-items:center; justify-content:center; }
.logo b{ color:var(--acc); }
.spacer{ flex:1; }
.mut{ color:var(--mut); } .small{ font-size:12.5px; }
.spin{ display:inline-block; width:14px; height:14px; border:2px solid #f3c6bc; border-top-color:var(--acc); border-radius:50%; animation:sp 0.8s linear infinite; vertical-align:-2px; }
@keyframes sp{ to{ transform:rotate(360deg);} }

/* topbar + layout */
.topbar{ height:60px; background:#fff; border-bottom:1px solid var(--line); display:flex; align-items:center; gap:16px; padding:0 22px; position:sticky; top:0; z-index:20; }
.topbar .search{ flex:0 1 320px; background:var(--bg); border:1px solid var(--line); border-radius:10px; padding:8px 12px; color:var(--mut); font-size:13.5px; }
.layout{ display:flex; align-items:stretch; }
.side{ width:230px; flex:0 0 230px; background:#fff; border-right:1px solid var(--line); min-height:calc(100vh - 60px); padding:16px 12px; position:sticky; top:60px; height:calc(100vh - 60px); overflow:auto; }
.siteswitch{ display:flex; align-items:center; gap:10px; border:1px solid var(--line); border-radius:12px; padding:10px 12px; margin-bottom:16px; background:#fbfcfe; width:100%; text-align:left; cursor:pointer; }
.siteswitch .thumb{ width:34px; height:34px; border-radius:9px; background:#141824; color:var(--gold); display:flex; align-items:center; justify-content:center; font-family:Georgia,serif; font-weight:700; font-size:17px; flex:0 0 34px; }
.siteswitch .nm{ font-weight:700; font-size:14px; line-height:1.15; }
.siteswitch .dm{ color:var(--mut); font-size:11.5px; }
.siteswitch .car{ margin-left:auto; color:var(--mut); font-size:12px; }
.nav a{ display:flex; align-items:center; gap:11px; padding:9px 11px; border-radius:10px; color:var(--ink2); text-decoration:none; font-size:14px; font-weight:550; margin-bottom:2px; }
.nav a .ic{ width:18px; text-align:center; font-size:14px; }
.nav a.act{ background:var(--acc-bg); color:var(--acc-d); font-weight:700; }
.nav a:hover{ background:#f1f5f9; }
.nav .count{ margin-left:auto; background:#eef2f7; color:var(--ink2); font-size:11px; font-weight:700; border-radius:999px; padding:2px 8px; }
.side .foot{ margin-top:22px; border-top:1px solid var(--line); padding:14px 6px 0; font-size:12.5px; color:var(--mut); line-height:1.55; }
.main{ flex:1; padding:26px 30px; min-width:0; }
.main.narrow{ max-width:1180px; margin:0 auto; width:100%; }
h1.ptitle{ font-size:24px; letter-spacing:-.4px; }
.sub{ color:var(--mut); font-size:14px; margin-top:4px; line-height:1.5; }
.panel{ background:var(--card); border:1px solid var(--line); border-radius:var(--rad); padding:18px 20px; margin-top:18px; }
.panel h3{ font-size:15.5px; margin-bottom:6px; }

/* login */
.loginwrap{ min-height:100vh; display:flex; flex-direction:column; align-items:center; padding:48px 20px; background:radial-gradient(1000px 500px at 50% -10%, #fdeee9 0%, var(--bg) 55%); }
.loginwrap .logo{ font-size:24px; } .loginwrap .logo .mark{ width:40px; height:40px; border-radius:11px; }
.loginwrap h1{ font-size:30px; letter-spacing:-.6px; margin-top:22px; text-align:center; }
.loginwrap .tag{ color:var(--mut); margin-top:8px; font-size:15.5px; text-align:center; }
.logincards{ display:grid; grid-template-columns:repeat(3,1fr); gap:16px; max-width:1020px; width:100%; margin-top:34px; }
.lcard{ background:#fff; border:1px solid var(--line); border-radius:16px; padding:22px; display:flex; flex-direction:column; }
.lcard h3{ font-size:16.5px; margin-bottom:6px; }
.lcard p{ color:var(--mut); font-size:13.5px; line-height:1.55; }
.lcard ol{ color:var(--mut); font-size:13px; line-height:1.6; margin:10px 0 0 17px; }
.lcard .inp{ width:100%; margin-top:12px; }
.lcard .btn{ margin-top:12px; justify-content:center; }
.lcard .chk{ display:flex; gap:8px; align-items:flex-start; font-size:12.5px; color:var(--mut); margin-top:10px; line-height:1.45; }
.err{ background:#fdf0ef; border:1px solid #f3c6bc; color:#b42318; border-radius:10px; padding:10px 13px; font-size:13.5px; margin-top:14px; max-width:1020px; width:100%; line-height:1.5; }
.loginwrap .foot{ margin-top:30px; color:var(--mut); font-size:12.5px; text-align:center; line-height:1.6; }

/* dashboard */
.stats{ display:grid; grid-template-columns:repeat(4,1fr); gap:16px; margin:20px 0; }
.stat{ background:var(--card); border:1px solid var(--line); border-radius:var(--rad); padding:16px 18px; }
.stat .k{ color:var(--mut); font-size:12.5px; font-weight:600; text-transform:uppercase; letter-spacing:.5px; }
.stat .v{ font-size:26px; font-weight:800; margin-top:5px; letter-spacing:-.5px; }
.stat .s{ color:var(--mut); font-size:12.5px; margin-top:2px; }
.sitecards{ display:grid; grid-template-columns:repeat(3,1fr); gap:16px; }
.sitecard{ background:var(--card); border:1px solid var(--line); border-radius:var(--rad); overflow:hidden; }
.sitecard .prev{ height:110px; background:linear-gradient(120deg,#141824,#232a3d); position:relative; padding:14px 16px; }
.sitecard .prev .brand{ font-family:Georgia,serif; color:#f5eeda; font-size:18px; letter-spacing:.4px; text-transform:uppercase; }
.sitecard .prev .tag2{ color:#b9c0cf; font-size:12px; margin-top:3px; }
.sitecard .prev .live{ position:absolute; top:12px; right:12px; background:rgba(14,159,110,.18); color:#4ade9e; font-size:11px; font-weight:700; padding:4px 9px; border-radius:999px; display:flex; gap:6px; align-items:center; }
.sitecard .body{ padding:15px 16px; }
.sitecard .body .t{ font-weight:750; font-size:15.5px; }
.sitecard .meta{ color:var(--mut); font-size:12.5px; margin-top:6px; line-height:1.55; word-break:break-all; }
.sitecard .row{ display:flex; gap:9px; margin-top:13px; }
.sitecard.add{ border:1.6px dashed #cbd5e1; background:#fbfcfe; display:flex; flex-direction:column; align-items:center; justify-content:center; min-height:230px; color:var(--mut); text-align:center; padding:20px; }
.sitecard.add .plus{ width:44px; height:44px; border-radius:50%; border:1.6px dashed #cbd5e1; display:flex; align-items:center; justify-content:center; font-size:21px; margin-bottom:10px; color:var(--acc); }
.sitecard.add b{ color:var(--ink2); font-size:14.5px; }
.sitecard.add span{ font-size:12.5px; margin-top:4px; line-height:1.5; }
.act{ display:flex; align-items:center; gap:12px; padding:10px 0; border-bottom:1px solid #f1f5f9; font-size:13.5px; }
.act:last-child{ border-bottom:none; }
.act .av{ width:30px; height:30px; border-radius:8px; background:var(--acc-bg); color:var(--acc-d); display:flex; align-items:center; justify-content:center; font-size:13px; flex:0 0 30px; }
.act .when{ margin-left:auto; color:var(--mut); font-size:12.5px; white-space:nowrap; }
.act .undo{ color:var(--blu); font-weight:600; font-size:12.5px; white-space:nowrap; cursor:pointer; background:none; border:none; }

/* posts table */
.toolbar{ display:flex; align-items:center; gap:10px; margin:18px 0 14px; flex-wrap:wrap; }
.tabs{ display:flex; gap:4px; background:#fff; border:1px solid var(--line); border-radius:11px; padding:4px; }
.tabs button{ font-size:13px; font-weight:600; color:var(--ink2); padding:6px 12px; border-radius:8px; cursor:pointer; border:none; background:none; }
.tabs button.act{ background:var(--ink); color:#fff; }
table.list{ width:100%; border-collapse:separate; border-spacing:0; background:#fff; border:1px solid var(--line); border-radius:var(--rad); overflow:hidden; }
table.list th{ text-align:left; font-size:11.5px; text-transform:uppercase; letter-spacing:.6px; color:var(--mut); padding:12px 16px; border-bottom:1px solid var(--line); background:#fbfcfe; }
table.list td{ padding:12px 16px; border-bottom:1px solid #f1f5f9; font-size:14px; vertical-align:middle; }
table.list tr:last-child td{ border-bottom:none; }
table.list tbody tr:hover td{ background:#fbfcfe; }
.postcell{ display:flex; gap:13px; align-items:center; min-width:300px; }
.postcell img{ width:58px; height:42px; object-fit:cover; border-radius:8px; flex:0 0 58px; background:#e8ebef; }
.pt{ font-weight:650; line-height:1.3; }
.ps{ color:var(--mut); font-size:12px; margin-top:2px; }
.rowact{ color:var(--acc-d); font-weight:650; font-size:13px; white-space:nowrap; cursor:pointer; background:none; border:none; }
.rowact.more{ color:var(--mut); margin-left:8px; }
.empty{ background:#fff; border:1px dashed #cbd5e1; border-radius:var(--rad); padding:34px; text-align:center; color:var(--mut); line-height:1.6; }

/* media */
.drop{ border:1.8px dashed #cbd5e1; border-radius:var(--rad); background:#fbfcfe; padding:22px; text-align:center; color:var(--mut); font-size:13.5px; margin:16px 0; }
.drop b{ color:var(--acc-d); cursor:pointer; }
.grid{ display:grid; grid-template-columns:repeat(5,1fr); gap:14px; }
.tile{ background:#fff; border:1px solid var(--line); border-radius:12px; overflow:hidden; cursor:pointer; text-align:left; padding:0; width:100%; }
.tile img{ width:100%; height:96px; object-fit:cover; display:block; background:#e8ebef; }
.tile .inf{ padding:9px 11px; font-size:12px; }
.tile .inf b{ display:block; font-size:12.3px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.tile .inf span{ color:var(--mut); }

/* editor */
.edtop{ min-height:60px; background:#fff; border-bottom:1px solid var(--line); display:flex; align-items:center; gap:12px; padding:8px 18px; flex-wrap:wrap; }
.edtop .crumb{ font-size:13.5px; color:var(--mut); }
.edtop .crumb b{ color:var(--ink); }
.devtog{ display:flex; background:var(--bg); border:1px solid var(--line); border-radius:10px; padding:3px; gap:2px; }
.devtog button{ font-size:12px; font-weight:600; padding:5px 11px; border-radius:7px; color:var(--mut); cursor:pointer; border:none; background:none; }
.devtog button.act{ background:#fff; color:var(--ink); box-shadow:0 1px 3px rgba(15,23,42,.12); }
.savedst{ display:flex; align-items:center; gap:7px; font-size:12.5px; color:var(--grn-d); font-weight:650; }
.savedst.dirty{ color:var(--amb); }
.edwrap{ display:flex; height:calc(100vh - 61px); min-height:0; }
.stage{ flex:1; background:#e8ebef; padding:22px; overflow:auto; position:relative; }
.stage .hint{ position:sticky; top:0; margin:0 auto 14px; width:fit-content; background:var(--ink); color:#fff; font-size:12.5px; font-weight:600; padding:7px 14px; border-radius:999px; z-index:3; box-shadow:0 4px 14px rgba(15,23,42,.25); white-space:nowrap; }
.stage .hint i{ color:#fda08d; font-style:normal; }
.fmtbar{ position:sticky; top:44px; z-index:3; margin:0 auto 12px; width:fit-content; background:#fff; border:1px solid var(--line); border-radius:11px; box-shadow:0 6px 20px rgba(15,23,42,.12); display:flex; gap:2px; padding:4px; }
.fmtbar button{ border:none; background:none; font-size:13px; font-weight:600; padding:6px 10px; border-radius:7px; cursor:pointer; color:var(--ink2); }
.fmtbar button:hover{ background:#f1f5f9; }
.artpage{ background:#10131c; border-radius:12px; margin:4px auto 30px; box-shadow:0 18px 50px rgba(15,23,42,.28); overflow:hidden; color:#e8e6df; transition:max-width .2s; }
.artpage .phead{ display:flex; align-items:center; padding:14px 22px; border-bottom:1px solid #262b3a; }
.artpage .phead .pb{ font-family:Georgia,"Times New Roman",serif; letter-spacing:1.5px; font-size:14px; color:#f5eeda; text-transform:uppercase; }
.artpage .phead nav{ margin-left:auto; display:flex; gap:16px; font-size:11.5px; color:#9aa3b5; }
.artpage .pbody{ padding:26px 34px 34px; }
.ed{ position:relative; border:1.6px solid transparent; border-radius:8px; padding:4px 8px; margin-left:-8px; margin-right:-8px; cursor:pointer; }
.ed.sel{ border-color:var(--acc); background:rgba(238,81,54,.07); }
.ed:hover{ border-color:rgba(238,81,54,.45); border-style:dashed; }
.ed.sel:hover{ border-style:solid; }
.ed .tag2{ position:absolute; top:-11px; left:10px; background:var(--acc); color:#fff; font-size:10px; font-weight:700; letter-spacing:.4px; padding:2.5px 8px; border-radius:6px; display:none; z-index:2; }
.ed.sel .tag2, .ed:hover .tag2{ display:block; }
.artpage h1{ font-family:Georgia,"Times New Roman",serif; font-size:28px; line-height:1.25; font-weight:600; color:#faf7ee; }
.artpage .meta2{ color:#9aa3b5; font-size:12px; margin-top:10px; }
.artpage .heroimg{ width:100%; min-height:180px; max-height:300px; object-fit:cover; border-radius:10px; display:block; background:#232a3d; }
.artpage .excerpt{ font-size:15px; line-height:1.6; color:#d8dae1; font-style:italic; }
.artcontent{ font-size:14.5px; line-height:1.7; color:#c9cdd6; margin-top:10px; border-radius:8px; }
.artcontent h2{ font-family:Georgia,serif; font-size:20px; color:#faf7ee; font-weight:600; margin:20px 0 6px; }
.artcontent h3{ font-family:Georgia,serif; font-size:17px; color:#faf7ee; margin:16px 0 5px; }
.artcontent p{ margin:8px 0; }
.artcontent ul,.artcontent ol{ margin:8px 0 8px 22px; }
.artcontent a{ color:#e9c767; }
.artcontent img{ max-width:100%; border-radius:8px; }
.artcontent blockquote{ border-left:3px solid var(--gold); padding-left:14px; margin:12px 0; color:#d8dae1; }
.artcontent [contenteditable="true"]{ outline:none; }
.insp{ width:312px; flex:0 0 312px; background:#fff; border-left:1px solid var(--line); padding:18px; overflow:auto; }
.insp h4{ font-size:12px; text-transform:uppercase; letter-spacing:.6px; color:var(--mut); margin:18px 0 10px; }
.insp h4:first-child{ margin-top:0; }
.insp .fld{ margin-bottom:13px; }
.insp label{ display:block; font-size:12.5px; font-weight:650; color:var(--ink2); margin-bottom:6px; }
.insp .inp, .insp textarea.inp{ width:100%; }
.insp textarea.inp{ resize:vertical; line-height:1.45; }
.insp .inp.focus{ border-color:var(--acc); box-shadow:0 0 0 3px var(--acc-bg); }
.insp hr{ border:none; border-top:1px solid var(--line); margin:16px 0; }
.insp .mini{ width:100%; height:86px; object-fit:cover; border-radius:10px; background:#e8ebef; display:block; }
.codeshell{ flex:1; display:flex; flex-direction:column; background:#0d1117; min-height:0; }
.codetabs{ display:flex; gap:4px; padding:10px 14px 0; }
.codetabs button{ background:#161b22; color:#9aa3b5; border:1px solid #262b3a; border-bottom:none; font-size:12.5px; font-weight:600; padding:8px 14px; border-radius:9px 9px 0 0; cursor:pointer; }
.codetabs button.act{ background:#161b22; color:#fff; box-shadow:inset 0 2px 0 var(--acc); }
.codearea{ flex:1; margin:0 14px 14px; background:#161b22; border:1px solid #262b3a; border-radius:0 10px 10px 10px; color:#d6deeb; font-family:ui-monospace,Menlo,Consolas,monospace; font-size:12.8px; line-height:1.6; padding:14px; resize:none; min-height:300px; }
.codearea:focus{ outline:none; border-color:var(--acc); }

/* modal + toast */
.mback{ position:fixed; inset:0; background:rgba(15,23,42,.5); z-index:50; display:flex; align-items:flex-start; justify-content:center; padding:60px 16px; overflow:auto; }
.modal{ background:#fff; border-radius:16px; max-width:560px; width:100%; padding:22px; box-shadow:0 24px 60px rgba(15,23,42,.3); }
.modal.wide{ max-width:760px; }
.modal h3{ font-size:17px; margin-bottom:6px; }
.modal .x{ float:right; }
.frow{ margin-bottom:12px; } .frow label{ display:block; font-size:12.5px; font-weight:650; color:var(--ink2); margin-bottom:6px; }
.frow .inp{ width:100%; }
.toast{ position:fixed; bottom:22px; left:50%; transform:translateX(-50%); background:var(--ink); color:#fff; font-size:13.5px; font-weight:600; padding:11px 18px; border-radius:11px; z-index:80; box-shadow:0 10px 30px rgba(15,23,42,.35); max-width:90vw; }
.toast.err{ background:#b42318; }
.revitem{ display:flex; gap:12px; padding:11px 0; border-bottom:1px solid #f1f5f9; font-size:13.5px; align-items:flex-start; }
.revitem:last-child{ border-bottom:none; }

@media (max-width:1100px){
  .stats{ grid-template-columns:repeat(2,1fr); } .sitecards{ grid-template-columns:1fr; }
  .logincards{ grid-template-columns:1fr; } .grid{ grid-template-columns:repeat(3,1fr); }
  .side{ display:none; } .insp{ width:280px; flex-basis:280px; }
}
