/* CHINAUTO Admin */
*,*::before,*::after{box-sizing:border-box}
html,body{margin:0;padding:0}
body{
  font-family:'Manrope',-apple-system,BlinkMacSystemFont,sans-serif;
  font-size:14px;color:#1a1d22;background:#f0f2f5;
  -webkit-font-smoothing:antialiased;
}
a{color:#c8102e;text-decoration:none}
a:hover{text-decoration:underline}
h1,h2,h3,h4{margin:0;font-weight:700;letter-spacing:-.01em}
.muted{color:#7a808a;font-size:.88rem}
small{color:#7a808a;font-size:.78rem}

/* ===== layout ===== */
.adm-sidebar{
  position:fixed;left:0;top:0;bottom:0;width:230px;background:#0f1115;color:#dfe1e6;
  display:flex;flex-direction:column;padding:20px 0;
}
.adm-brand{
  display:flex;align-items:center;gap:10px;padding:0 20px 20px;
  border-bottom:1px solid #1a1d22;font-weight:800;font-size:1.1rem;color:#fff;
}
.adm-brand span{
  display:inline-flex;align-items:center;justify-content:center;
  width:34px;height:34px;border-radius:6px;
  background:linear-gradient(135deg,#c8102e,#7a0a1c);color:#fff;
  font-family:'Roboto Mono',monospace;font-size:18px;
}
.adm-sidebar nav{display:flex;flex-direction:column;padding:14px 0;flex:1}
.adm-sidebar nav a{
  padding:10px 20px;color:#aab0bb;font-weight:500;
  border-left:3px solid transparent;
}
.adm-sidebar nav a:hover{color:#fff;background:#16181c;text-decoration:none}
.adm-sidebar nav a.active{color:#fff;background:#16181c;border-left-color:#c8102e}
.adm-foot{padding:14px 20px;border-top:1px solid #1a1d22;display:flex;gap:14px;font-size:.85rem}
.adm-foot a{color:#7a808a}
.adm-foot a:hover{color:#fff}

.adm-main{margin-left:230px;padding:24px 32px 60px;min-height:100vh}
.adm-head{margin-bottom:20px;display:flex;justify-content:space-between;align-items:center;flex-wrap:wrap;gap:12px}
.adm-head h1{font-size:1.6rem}
.adm-head .muted{margin-top:4px}

/* ===== alerts ===== */
.alert{padding:11px 16px;border-radius:6px;margin-bottom:18px;font-weight:500}
.alert.ok{background:#e6f4ec;color:#0f6c2c;border-left:3px solid #16a34a}
.alert.err{background:#fce7ea;color:#8a0d22;border-left:3px solid #c8102e}
.alert.info{background:#e7f0fc;color:#0e3a7c;border-left:3px solid #2563eb}

/* ===== KPI cards ===== */
.kpi-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:14px;margin-bottom:24px}
.kpi{
  background:#fff;border-radius:10px;padding:14px 18px;border:1px solid #e6e8ec;
  display:flex;flex-direction:column;gap:3px;
}
.kpi span{font-size:.74rem;color:#7a808a;text-transform:uppercase;letter-spacing:.04em;font-weight:600}
.kpi b{font-size:1.7rem;font-weight:700;font-family:'Roboto Mono',monospace;letter-spacing:-.02em;color:#16181c}
.kpi small{font-size:.78rem;color:#7a808a}

/* ===== cards ===== */
.card{background:#fff;border-radius:10px;border:1px solid #e6e8ec;padding:18px 20px;margin-bottom:18px}
.card h3{font-size:1.05rem;margin-bottom:14px;padding-bottom:10px;border-bottom:1px solid #e6e8ec}
.card header{display:flex;justify-content:space-between;align-items:center;margin-bottom:14px;padding-bottom:10px;border-bottom:1px solid #e6e8ec}
.card header h3{border:0;padding:0;margin:0}
.card header a{font-size:.82rem;font-weight:600}

.grid-2{display:grid;grid-template-columns:1.4fr 1fr;gap:18px;margin-bottom:18px}
.grid-2 .card{margin-bottom:0}

/* ===== tables ===== */
.t{width:100%;background:#fff;border-radius:10px;overflow:hidden;border-collapse:collapse;margin-bottom:20px;border:1px solid #e6e8ec}
.t th,.t td{padding:11px 14px;text-align:left;font-size:.9rem;border-bottom:1px solid #eef0f3;vertical-align:middle}
.t th{background:#f7f8fa;color:#4d5360;font-weight:600;font-size:.78rem;text-transform:uppercase;letter-spacing:.04em}
.t tr:last-child td{border-bottom:0}
.t-hover tbody tr:hover{background:#f9fafb}
.t code{font-family:'Roboto Mono',monospace;font-size:.82rem;background:#f0f2f5;padding:1px 5px;border-radius:3px}
.t a{font-weight:500}

/* Status pills */
.pill{display:inline-block;padding:2px 9px;border-radius:999px;font-size:.7rem;font-weight:700;text-transform:uppercase;letter-spacing:.04em}
.pill-published{background:#e6f4ec;color:#0f6c2c}
.pill-draft{background:#fff4e0;color:#8a5a0d}
.pill-moderation{background:#e7f0fc;color:#0e3a7c}
.pill-archive,.pill-archived{background:#f0f2f5;color:#7a808a}

/* ===== ranked list ===== */
.rank{list-style:none;padding:0;margin:0;display:flex;flex-direction:column;gap:10px}
.rank li{display:flex;gap:12px;align-items:flex-start}
.rank-num{
  flex:0 0 28px;height:28px;display:flex;align-items:center;justify-content:center;
  background:#16181c;color:#fff;border-radius:4px;font-weight:700;font-size:.85rem;
  font-family:'Roboto Mono',monospace;
}
.rank li:first-child .rank-num{background:#c8102e}
.rank a{color:#16181c;font-size:.92rem;font-weight:600;line-height:1.3;display:block}
.rank a:hover{color:#c8102e;text-decoration:none}
.rank-meta{display:block;font-size:.75rem;color:#7a808a;margin-top:3px}

/* ===== forms ===== */
.inline-form{display:grid;grid-template-columns:repeat(3,1fr);gap:12px 16px}
.inline-form label{display:flex;flex-direction:column;gap:5px;font-size:.85rem;font-weight:600;color:#4d5360}
.inline-form .full{grid-column:1/-1}
.inline-form .chk{flex-direction:row;align-items:center;gap:8px}
.inline-form button{grid-column:1/-1;justify-self:start}

input[type=text],input[type=email],input[type=password],input[type=number],input[type=url],input[type=date],input[type=datetime-local],input[type=search],input:not([type]),select,textarea{
  padding:9px 12px;border:1px solid #d8dadf;border-radius:6px;background:#fff;
  font:inherit;font-size:.92rem;outline:none;width:100%;
  font-family:inherit;color:#16181c;
}
textarea{resize:vertical;min-height:80px;font-family:inherit}
input:focus,select:focus,textarea:focus{border-color:#c8102e;box-shadow:0 0 0 3px rgba(200,16,46,.1)}
input[type=checkbox]{width:auto}
select{cursor:pointer}

/* ===== buttons ===== */
.btn{
  display:inline-block;padding:9px 16px;border:0;border-radius:6px;
  font:inherit;font-weight:600;cursor:pointer;font-size:.9rem;
  transition:background .12s;background:#16181c;color:#fff;
}
.btn:hover{background:#0f1115;text-decoration:none;color:#fff}
.btn-primary{
  display:inline-block;padding:10px 18px;border:0;border-radius:6px;
  font:inherit;font-weight:600;cursor:pointer;font-size:.92rem;
  background:#c8102e;color:#fff;
}
.btn-primary:hover{background:#a30c24;text-decoration:none;color:#fff}
.btn-ghost{
  display:inline-block;padding:9px 16px;border:1px solid #d8dadf;
  background:#fff;color:#16181c;border-radius:6px;font-weight:600;
}
.btn-ghost:hover{background:#f0f2f5;text-decoration:none}
.btn-danger-sm{
  background:#fce7ea;color:#8a0d22;border:0;border-radius:4px;
  width:28px;height:28px;cursor:pointer;font-size:1rem;line-height:1;
  display:inline-flex;align-items:center;justify-content:center;
}
.btn-danger-sm:hover{background:#c8102e;color:#fff}

/* ===== article editor ===== */
.article-form{display:block}
.form-grid{display:grid;grid-template-columns:1fr 320px;gap:20px}
.form-main label{display:flex;flex-direction:column;gap:5px;margin-bottom:14px;font-weight:600;font-size:.85rem;color:#4d5360}
.form-main textarea.body-md{min-height:380px;font-family:'Roboto Mono',monospace;font-size:.9rem;line-height:1.6}

.form-side{display:flex;flex-direction:column;gap:14px}
.form-card{background:#fff;border:1px solid #e6e8ec;border-radius:10px;padding:14px 16px}
.form-card h4{
  font-size:.74rem;text-transform:uppercase;letter-spacing:.04em;
  color:#7a808a;margin-bottom:12px;font-weight:700;
  padding-bottom:8px;border-bottom:1px solid #eef0f3;
}
.form-card label{display:flex;flex-direction:column;gap:4px;margin-bottom:10px;font-size:.82rem;color:#4d5360;font-weight:600}
.form-card label:last-child{margin-bottom:0}
.form-card .chk{flex-direction:row;align-items:center;gap:6px;font-size:.88rem;cursor:pointer}
.form-card button{width:100%;margin-top:6px}

/* ===== filter bar ===== */
.filter-bar{
  display:flex;gap:10px;align-items:center;flex-wrap:wrap;
  background:#fff;border:1px solid #e6e8ec;border-radius:10px;
  padding:12px 16px;margin-bottom:18px;
}
.filter-bar select,.filter-bar input{padding:7px 10px;font-size:.88rem;width:auto;min-width:140px}
.filter-bar button{padding:7px 16px;background:#16181c;color:#fff;border:0;border-radius:6px;font:inherit;font-weight:600;cursor:pointer;font-size:.88rem}
.filter-bar button:hover{background:#c8102e}

/* ===== login ===== */
.login-body{
  min-height:100vh;display:flex;align-items:center;justify-content:center;
  background:linear-gradient(135deg,#0f1115,#1a1d22);padding:20px;margin:0;
}
.login-card{
  background:#fff;border-radius:12px;padding:32px;max-width:380px;width:100%;
  box-shadow:0 20px 60px rgba(0,0,0,.3);display:flex;flex-direction:column;gap:14px;
}
.login-brand{
  display:flex;align-items:center;gap:10px;justify-content:center;
  font-weight:800;font-size:1.2rem;margin-bottom:8px;color:#16181c;
}
.login-brand span{
  display:inline-flex;align-items:center;justify-content:center;
  width:36px;height:36px;border-radius:6px;
  background:linear-gradient(135deg,#c8102e,#7a0a1c);color:#fff;
  font-family:'Roboto Mono',monospace;font-size:18px;
}
.login-card label{display:flex;flex-direction:column;gap:5px;font-weight:600;font-size:.85rem;color:#4d5360}
.login-card button{
  padding:11px;background:#c8102e;color:#fff;border:0;border-radius:6px;
  font:inherit;font-weight:600;cursor:pointer;font-size:.95rem;margin-top:4px;
}
.login-card button:hover{background:#a30c24}
.login-card .muted{text-align:center;margin:0;font-size:.78rem}

/* ===== responsive ===== */
@media (max-width: 1100px){
  .kpi-grid{grid-template-columns:repeat(2,1fr)}
  .form-grid{grid-template-columns:1fr}
  .grid-2{grid-template-columns:1fr}
  .inline-form{grid-template-columns:repeat(2,1fr)}
}
@media (max-width: 720px){
  .adm-sidebar{position:relative;width:100%;flex-direction:row;padding:8px;overflow-x:auto}
  .adm-sidebar .adm-brand{border:0;padding:8px 12px}
  .adm-sidebar nav{flex-direction:row;padding:0}
  .adm-sidebar nav a{padding:8px 12px;border-left:0;border-bottom:2px solid transparent;white-space:nowrap}
  .adm-sidebar nav a.active{border-left:0;border-bottom-color:#c8102e}
  .adm-foot{display:none}
  .adm-main{margin-left:0;padding:18px}
  .inline-form{grid-template-columns:1fr}
  .kpi-grid{grid-template-columns:1fr}
}
