/* ============================================================
   管理台样式 —— 与前台同一套设计语言（石墨黑 + 金色）
   ============================================================ */

:root {
  --ink: #0b0d12;
  --ink-2: #14171f;
  --ink-3: #1c202a;
  --ink-4: #232834;
  --line: rgba(242, 239, 232, 0.12);
  --line-strong: rgba(242, 239, 232, 0.22);
  --on-ink: #f2efe8;
  --on-ink-2: rgba(242, 239, 232, 0.7);
  --on-ink-3: rgba(242, 239, 232, 0.45);
  --gold: #e9b660;
  --gold-hover: #f3c97c;
  --green: #4ade80;
  --danger: #ef7a5c;
  --radius: 14px;
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "HarmonyOS Sans SC", "MiSans", "Microsoft YaHei",
    "Noto Sans CJK SC", sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.7;
  color: var(--on-ink);
  background: var(--ink);
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
p,
ul,
ol {
  margin: 0;
}

ul {
  padding: 0;
  list-style: none;
}

a {
  color: inherit;
}

/* 显式处理 hidden，避免 flex/grid 覆盖浏览器的默认 display:none */
.a-status[hidden],
.a-actions[hidden],
.a-workspace[hidden],
.a-login[hidden],
.a-workspace[hidden] * {
  display: none !important;
}

/* ---------- 顶栏 ---------- */

.a-top {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--line);
  background: rgba(11, 13, 18, 0.92);
  backdrop-filter: blur(12px);
}

.a-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 14px;
  text-decoration: none;
}

.a-brand__mark {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: linear-gradient(145deg, var(--gold), #c98f35);
  color: #241a08;
  font-size: 12px;
  font-weight: 900;
}

.a-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: 6px;
  padding: 4px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12.5px;
  color: var(--on-ink-2);
}

.a-status strong {
  color: var(--gold);
}

.a-sep {
  color: var(--on-ink-3);
}

.a-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--on-ink-3);
}

.a-dot.is-live {
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.18);
}

.a-dot.is-down {
  background: var(--danger);
  box-shadow: 0 0 0 3px rgba(239, 122, 92, 0.18);
}

.a-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-left: auto;
}

/* ---------- 按钮 ---------- */

.a-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 999px;
  font: inherit;
  font-size: 13.5px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.2s, border-color 0.2s, transform 0.2s var(--ease);
}

.a-btn:active {
  transform: scale(0.98);
}

.a-btn--gold {
  background: var(--gold);
  color: #1a1205;
}

.a-btn--gold:hover {
  background: var(--gold-hover);
}

.a-btn--gold.is-dirty {
  box-shadow: 0 0 0 3px rgba(233, 182, 96, 0.28);
}

.a-btn--gold.is-dirty::after {
  content: "•";
  margin-left: 6px;
  font-size: 16px;
  line-height: 1;
}

.a-btn--ghost {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--line-strong);
  color: var(--on-ink);
}

.a-btn--ghost:hover {
  background: rgba(255, 255, 255, 0.1);
}

.a-btn--block {
  width: 100%;
  min-height: 42px;
}

.a-btn--danger {
  background: rgba(239, 122, 92, 0.12);
  border-color: rgba(239, 122, 92, 0.4);
  color: #ffb3a0;
}

.a-btn--danger:hover {
  background: rgba(239, 122, 92, 0.2);
}

.a-btn--xs {
  min-height: 28px;
  padding: 0 12px;
  font-size: 12.5px;
}

/* ---------- 登录 ---------- */

.a-main {
  padding: 24px 20px 60px;
}

.a-login {
  display: grid;
  place-items: center;
  min-height: calc(100vh - 140px);
}

.a-login__card {
  width: 100%;
  max-width: 380px;
  padding: 32px 28px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--ink-2);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4);
}

.a-login__card h1 {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.a-login__lead {
  margin-top: 8px;
  margin-bottom: 22px;
  font-size: 13.5px;
  color: var(--on-ink-2);
}

.a-hint {
  margin-top: 14px;
  font-size: 13px;
  color: var(--danger);
  min-height: 20px;
}

/* ---------- 表单 ---------- */

.a-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.a-field > span {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--on-ink-3);
  text-transform: uppercase;
}

.a-input {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--ink);
  color: var(--on-ink);
  font: inherit;
  font-size: 13.5px;
  line-height: 1.6;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.a-input:focus {
  outline: none;
  border-color: rgba(233, 182, 96, 0.7);
  box-shadow: 0 0 0 3px rgba(233, 182, 96, 0.14);
}

.a-input--sm {
  min-height: 34px;
  padding: 6px 10px;
  font-size: 13px;
}

textarea.a-input {
  resize: vertical;
  min-height: 64px;
}

.a-row {
  display: flex;
  gap: 8px;
  margin: 8px 0 12px;
}

.a-row > * {
  flex: 1;
}

/* ---------- 工作区布局 ---------- */

.a-workspace {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  max-width: 1440px;
  margin: 0 auto;
}

@media (min-width: 1100px) {
  .a-workspace {
    grid-template-columns: 170px minmax(0, 1fr) 320px;
    align-items: start;
  }
}

.a-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

@media (min-width: 1100px) {
  .a-nav {
    position: sticky;
    top: 76px;
    flex-direction: column;
    flex-wrap: nowrap;
  }
}

.a-nav a {
  padding: 7px 12px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: var(--on-ink-2);
  text-decoration: none;
  transition: background-color 0.2s, color 0.2s;
}

.a-nav a:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--on-ink);
}

.a-nav a.is-active {
  background: rgba(233, 182, 96, 0.14);
  border-color: rgba(233, 182, 96, 0.4);
  color: var(--gold);
}

/* ---------- 编辑区 ---------- */

.a-editor {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.a-block {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--ink-2);
  overflow: hidden;
}

.a-block__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
}

.a-block__head h2 {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.a-block__head span {
  font-size: 12px;
  color: var(--on-ink-3);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.a-block__body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px;
}

.a-sub {
  padding: 14px;
  border: 1px dashed var(--line-strong);
  border-radius: 10px;
}

.a-sub h3 {
  margin-bottom: 10px;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--gold);
  text-transform: uppercase;
}

.a-sub--item {
  position: relative;
  padding-top: 38px;
}

.a-sub__tools {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  gap: 6px;
}

.a-grid2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

@media (min-width: 720px) {
  .a-grid2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.a-imgrow {
  display: flex;
  align-items: center;
  gap: 10px;
}

.a-imgrow img {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--ink-3);
  border: 1px solid var(--line);
}

/* ---------- 右侧面板 ---------- */

.a-side {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

@media (min-width: 1100px) {
  .a-side {
    position: sticky;
    top: 76px;
  }
}

.a-panel {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--ink-2);
}

.a-panel__title {
  font-size: 13.5px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.a-panel__desc {
  margin: 6px 0 12px;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--on-ink-3);
}

.a-feedlist {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
  max-height: 360px;
  overflow-y: auto;
}

.a-feedlist li {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 12.5px;
  color: var(--on-ink-2);
}

.a-feedlist li p {
  flex: 1;
  overflow-wrap: anywhere;
}

.a-feedlist time {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  color: var(--on-ink-3);
}

.a-empty {
  padding: 14px;
  font-size: 12.5px;
  color: var(--on-ink-3);
  text-align: center;
}

/* ---------- 提示 ---------- */

.a-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 90;
  max-width: min(92vw, 460px);
  padding: 11px 20px;
  border: 1px solid rgba(233, 182, 96, 0.4);
  border-radius: 999px;
  background: rgba(11, 13, 18, 0.96);
  color: var(--on-ink);
  font-size: 13.5px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
  transform: translate(-50%, 140%);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.4s var(--ease), opacity 0.3s;
}

.a-toast.is-on {
  transform: translate(-50%, 0);
  opacity: 1;
}

.a-toast.is-error {
  border-color: rgba(239, 122, 92, 0.5);
}
