:root {
  --wp-bg: #f0f0f1;
  --wp-ink: #1d2327;
  --wp-muted: #646970;
  --wp-line: #c3c4c7;
  --wp-soft: #dcdcde;
  --wp-blue: #2271b1;
  --wp-blue-dark: #135e96;
  --wp-side: #1d2327;
  --wp-side-2: #2c3338;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --serif: "Noto Serif SC", "Songti SC", Georgia, serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--wp-bg);
  color: var(--wp-ink);
  font-family: var(--sans);
  font-size: 13px;
  line-height: 1.6;
}
a { color: var(--wp-blue); text-decoration: none; }
a:hover { color: var(--wp-blue-dark); }
h1, h2, h3, h4 { margin: 0; font-weight: 400; }

/* ---------- login ---------- */
.login-screen {
  min-height: 100vh; display: grid; place-items: center;
  background: #f0f0f1; padding: 24px;
}
.login-card { width: 100%; max-width: 380px; }
.login-logo { text-align: center; margin-bottom: 22px; }
.login-logo .mark {
  width: 56px; height: 56px; border-radius: 14px; background: var(--wp-blue);
  color: #fff; display: grid; place-items: center; margin: 0 auto 14px;
  font-family: var(--serif); font-size: 26px;
}
.login-logo h1 { font-size: 20px; font-family: var(--serif); }
.login-logo p { color: var(--wp-muted); font-size: 12.5px; margin: 6px 0 0; }
.login-box { background: #fff; border: 1px solid var(--wp-line); padding: 26px 24px; }
.login-box .field { margin-bottom: 16px; }
.login-note { margin-top: 18px; font-size: 12px; color: var(--wp-muted); text-align: center; }
.login-note code { background: #f0f0f1; padding: 1px 5px; border-radius: 3px; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 200px minmax(0, 1fr); min-height: 100vh; }
.side {
  background: var(--wp-side); color: #c3c4c7;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  display: flex; flex-direction: column;
}
.side-brand { display: flex; align-items: center; gap: 10px; padding: 18px 18px 16px; color: #fff; }
.side-brand .mark {
  width: 32px; height: 32px; border-radius: 8px; background: var(--wp-blue);
  display: grid; place-items: center; font-family: var(--serif); font-size: 16px;
}
.side-brand b { font-weight: 500; font-size: 14px; }
.side-brand span { font-size: 11px; color: #8c8f94; display: block; line-height: 1.3; }
.menu { padding: 6px 0 18px; }
.menu a {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 18px; font-size: 13.5px; color: #c3c4c7;
  border-left: 3px solid transparent;
}
.menu a:hover { color: #72aee6; background: #191e23; }
.menu a.active { background: #1f2c33; color: #72aee6; border-left-color: #72aee6; }
.menu a .ico { width: 16px; text-align: center; opacity: .9; }
.menu .divider { height: 1px; background: #2c3338; margin: 10px 14px; }
.menu a .pill {
  margin-left: auto; background: #d63638; color: #fff; font-size: 10.5px;
  border-radius: 10px; padding: 0 6px; line-height: 17px;
}
.side-foot { margin-top: auto; padding: 14px 18px; font-size: 11.5px; color: #7a8188; border-top: 1px solid #2c3338; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 52px; background: #fff; border-bottom: 1px solid var(--wp-line);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 26px; position: sticky; top: 0; z-index: 20;
}
.topbar .crumb { font-size: 13px; color: var(--wp-muted); display: flex; gap: 8px; align-items: center; }
.topbar .crumb .sep { opacity: .5; }
.topbar .right { display: flex; align-items: center; gap: 16px; font-size: 12.5px; }
.content { padding: 26px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h2 { font-size: 22px; font-weight: 400; }
.page-head .sub { color: var(--wp-muted); font-size: 12.5px; margin-top: 4px; }

/* ---------- buttons / forms ---------- */
.button {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--wp-blue); background: #f6f7f7; color: var(--wp-blue);
  border-radius: 3px; padding: 6px 12px; font-size: 13px; line-height: 1.7;
  transition: background .15s, border-color .15s, color .15s;
  cursor: pointer;
}
.button:hover { background: #f0f0f1; border-color: var(--wp-blue-dark); color: var(--wp-blue-dark); }
.button-primary { background: var(--wp-blue); border-color: var(--wp-blue); color: #fff; }
.button-primary:hover { background: var(--wp-blue-dark); border-color: var(--wp-blue-dark); color: #fff; }
.button-link { border: none; background: none; color: #b32d2e; padding: 0; font-size: 12px; }
.button-sm { padding: 3px 9px; font-size: 12px; }
.button[disabled] { opacity: .55; cursor: not-allowed; }

input[type=text], input[type=password], input[type=number], input[type=email], textarea, select {
  width: 100%; border: 1px solid #8c8f94; border-radius: 3px;
  padding: 7px 10px; font-size: 13px; background: #fff; color: var(--wp-ink);
  outline: none; font-family: inherit;
}
input:focus, textarea:focus, select:focus { border-color: var(--wp-blue); box-shadow: 0 0 0 1px var(--wp-blue); }
textarea { resize: vertical; line-height: 1.7; }
.field { margin-bottom: 18px; }
.field > label { display: block; font-weight: 500; margin-bottom: 6px; font-size: 13px; }
.field .help { font-size: 12px; color: var(--wp-muted); margin-top: 5px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }

/* ---------- cards ---------- */
.panel { background: #fff; border: 1px solid var(--wp-line); }
.panel-head { padding: 12px 16px; border-bottom: 1px solid var(--wp-line); font-size: 14px; display: flex; justify-content: space-between; align-items: center; }
.panel-body { padding: 16px; }

.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 22px; }
.stat { background: #fff; border: 1px solid var(--wp-line); padding: 16px 18px; }
.stat .label { font-size: 12px; color: var(--wp-muted); }
.stat .value { font-size: 26px; line-height: 1.35; margin-top: 4px; font-weight: 300; }
.stat .delta { font-size: 11.5px; color: #1a7f4b; }

.two-col { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: 18px; }

/* ---------- table ---------- */
table.list { width: 100%; border-collapse: collapse; background: #fff; font-size: 13px; }
table.list th {
  text-align: left; padding: 9px 12px; font-weight: 500; font-size: 12.5px;
  background: #f6f7f7; border-bottom: 1px solid var(--wp-line); color: var(--wp-muted);
  white-space: nowrap;
}
table.list td { padding: 11px 12px; border-bottom: 1px solid #f0f0f1; vertical-align: middle; }
table.list tr:last-child td { border-bottom: none; }
table.list tr:hover td { background: #fbfbfc; }
table.list .title { font-weight: 500; color: var(--wp-ink); }
table.list .title:hover { color: var(--wp-blue); }
table.list .muted { color: var(--wp-muted); font-size: 12px; }
.row-actions { display: flex; gap: 10px; margin-top: 3px; }
.row-actions button { border: none; background: none; padding: 0; font-size: 12px; color: var(--wp-blue); cursor: pointer; }
.row-actions button.danger { color: #b32d2e; }
.row-actions button:hover { text-decoration: underline; }

.badge { display: inline-block; font-size: 11.5px; padding: 1px 8px; border-radius: 10px; line-height: 1.7; }
.badge.publish { background: #edfaef; color: #14602b; }
.badge.draft { background: #fcf3e6; color: #8a5a00; }
.badge.pending { background: #fcf0e6; color: #996800; }
.badge.approved { background: #edfaef; color: #14602b; }
.badge.spam { background: #fcebeb; color: #a02222; }
.badge.count { background: #f0f0f1; color: var(--wp-muted); }

/* ---------- editor ---------- */
.editor-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 18px; align-items: start; }
.title-input {
  width: 100%; border: none; border-bottom: 1px solid var(--wp-soft);
  font-size: 22px; padding: 12px 4px; background: transparent; outline: none;
  font-family: var(--serif);
}
.title-input:focus { border-bottom-color: var(--wp-blue); box-shadow: none; }
.editor-body { padding: 0 16px 16px; }
.editor-body textarea {
  width: 100%; min-height: 460px; border: none; padding: 14px 4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px; line-height: 1.85; outline: none;
}
.editor-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--wp-line); padding: 0 12px; }
.editor-tabs button {
  border: none; background: none; padding: 10px 12px; font-size: 13px;
  color: var(--wp-muted); border-bottom: 2px solid transparent; cursor: pointer;
}
.editor-tabs button.active { color: var(--wp-ink); border-bottom-color: var(--wp-blue); }
.preview-box { padding: 18px 16px; font-size: 15px; line-height: 1.85; }
.preview-box h2 { font-family: var(--serif); font-size: 21px; margin: 1.6em 0 .6em; padding-left: 12px; border-left: 3px solid var(--wp-blue); }
.preview-box pre { background: #1b1f24; color: #e7edf3; padding: 16px; border-radius: 8px; overflow-x: auto; font-size: 12.5px; }
.preview-box code { font-family: ui-monospace, monospace; background: #f1efe9; padding: 2px 5px; border-radius: 4px; font-size: .88em; }
.preview-box pre code { background: none; padding: 0; color: inherit; }
.preview-box blockquote { border-left: 3px solid #d9d3c7; background: #faf8f4; margin: 1.4em 0; padding: 12px 18px; color: #4d545c; }
.preview-box ul, .preview-box ol { padding-left: 1.3em; }

.publish-box { position: sticky; top: 70px; }
.publish-row { display: flex; justify-content: space-between; align-items: center; padding: 9px 0; border-bottom: 1px solid #f0f0f1; font-size: 12.5px; }
.publish-row span:first-child { color: var(--wp-muted); }
.publish-actions { display: flex; gap: 8px; padding-top: 14px; }

/* ---------- comments ---------- */
.tabs { display: flex; gap: 4px; margin-bottom: 14px; flex-wrap: wrap; }
.tabs button {
  border: 1px solid transparent; background: none; color: var(--wp-blue);
  padding: 5px 11px; font-size: 12.5px; border-radius: 3px; cursor: pointer;
}
.tabs button.active { background: #fff; border-color: var(--wp-line); color: var(--wp-ink); font-weight: 500; }
.tabs .n { color: var(--wp-muted); }
.comment-row { display: flex; gap: 14px; padding: 16px; border-bottom: 1px solid #f0f0f1; }
.comment-row:last-child { border-bottom: none; }
.comment-row .avatar {
  width: 36px; height: 36px; border-radius: 50%; background: #eef0f3; color: #5c6570;
  display: grid; place-items: center; font-size: 13px; flex: none;
}
.comment-row .body { min-width: 0; flex: 1; }
.comment-row .who { font-size: 13px; }
.comment-row .who b { font-weight: 600; }
.comment-row .text { margin: 5px 0 8px; font-size: 13px; color: #3c434a; }
.comment-row .on { font-size: 12px; color: var(--wp-muted); }

/* ---------- toast ---------- */
.toast {
  position: fixed; right: 24px; bottom: 24px; z-index: 200;
  background: #1d2327; color: #fff; font-size: 13px; padding: 12px 18px;
  border-radius: 4px; opacity: 0; transform: translateY(8px);
  transition: opacity .2s, transform .2s; pointer-events: none; max-width: 320px;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.bad { background: #b32d2e; }

.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

@media (max-width: 1024px) {
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .two-col, .editor-layout { grid-template-columns: minmax(0, 1fr); }
  .publish-box { position: static; }
}
@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; }
  .menu { display: flex; overflow-x: auto; padding: 0 6px 8px; }
  .menu a { border-left: none; border-bottom: 3px solid transparent; white-space: nowrap; }
  .menu a.active { border-left: none; border-bottom-color: #72aee6; }
  .menu .divider, .side-foot { display: none; }
  .content { padding: 16px; }
  .grid-2 { grid-template-columns: 1fr; }
  table.list th:nth-child(3), table.list td:nth-child(3) { display: none; }
}
