:root {
  --bg: #f5efe2;
  --card: rgba(255, 252, 245, 0.92);
  --line: rgba(74, 59, 44, 0.12);
  --text: #2c241d;
  --muted: #796756;
  --brand: #d34b24;
  --brand-ink: #fff8f2;
  --ok: #1c7c54;
  --warn: #a65e00;
  --error: #b42318;
  --shadow: 0 16px 40px rgba(81, 61, 38, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(211, 75, 36, 0.14), transparent 28%),
    radial-gradient(circle at top right, rgba(34, 116, 165, 0.11), transparent 22%),
    linear-gradient(180deg, #f7f2e8 0%, var(--bg) 100%);
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

.page-shell {
  width: min(1380px, calc(100% - 32px));
  margin: 24px auto 56px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 24px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: linear-gradient(135deg, rgba(255, 250, 244, 0.96), rgba(248, 242, 231, 0.94));
  box-shadow: var(--shadow);
}

.topbar h1,
.panel-head h2 {
  margin: 0;
  font-family: "Songti SC", "STSong", serif;
}

.topbar h1 {
  font-size: 34px;
  line-height: 1.15;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--brand);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 700;
}

.subtle {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.topbar-actions,
.filters {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.user-chip {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(44, 36, 29, 0.06);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  padding: 11px 18px;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn.primary {
  background: var(--brand);
  color: var(--brand-ink);
  box-shadow: 0 12px 24px rgba(211, 75, 36, 0.2);
}

.btn.secondary {
  background: #fff7ef;
  color: var(--text);
  border-color: rgba(211, 75, 36, 0.18);
}

.btn.tertiary {
  background: #fff;
  color: var(--text);
  border-color: var(--line);
}

.notice,
.warning-card,
.panel,
.stat-card,
.comment-card,
.job-item,
.reply-log,
.auth-card {
  border: 1px solid var(--line);
  background: var(--card);
  box-shadow: var(--shadow);
}

.notice,
.warning-card,
.panel {
  border-radius: 24px;
}

.notice,
.warning-card {
  margin-top: 18px;
  padding: 16px 18px;
}

.notice {
  background: rgba(255, 247, 239, 0.94);
}

.warning-card {
  background: rgba(255, 242, 231, 0.96);
}

.stats-grid,
.split-grid {
  display: grid;
  gap: 16px;
  margin-top: 18px;
}

.stats-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.split-grid {
  grid-template-columns: 1.1fr 1fr;
}

.stat-card {
  border-radius: 22px;
  padding: 20px;
}

.stat-card span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 10px;
}

.stat-card strong {
  font-size: 34px;
  line-height: 1;
  font-family: "Songti SC", serif;
}

.stat-card.accent {
  background: linear-gradient(135deg, rgba(211, 75, 36, 0.1), rgba(255, 252, 245, 0.95));
}

.panel {
  margin-top: 18px;
  padding: 18px;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
  margin-bottom: 14px;
}

.panel-head p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 14px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  text-align: left;
  font-size: 14px;
}

th {
  color: var(--muted);
  font-weight: 700;
}

.account-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}

.avatar,
.avatar.fallback {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--line);
}

.avatar.fallback {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  background: rgba(211, 75, 36, 0.12);
  color: var(--brand);
  font-weight: 700;
}

.mono {
  font-family: ui-monospace, "SFMono-Regular", "Menlo", monospace;
  font-size: 12px;
  word-break: break-all;
}

.status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 64px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.status.ok,
.status.success {
  background: rgba(28, 124, 84, 0.12);
  color: var(--ok);
}

.status.error,
.status.failed {
  background: rgba(180, 35, 24, 0.12);
  color: var(--error);
}

.status.running,
.status.queued {
  background: rgba(166, 94, 0, 0.12);
  color: var(--warn);
}

.job-list,
.reply-log-list,
.comment-list {
  display: grid;
  gap: 14px;
}

.job-item,
.reply-log,
.comment-card {
  border-radius: 18px;
  padding: 16px;
}

.job-top,
.comment-header,
.comment-title-row,
.comment-footer {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.job-meta,
.tiny-error {
  margin-top: 8px;
  font-size: 12px;
}

.tiny-error {
  color: var(--error);
}

.job-result,
.comment-body {
  margin: 10px 0 0;
  line-height: 1.65;
}

.filters {
  padding: 16px;
  margin-bottom: 18px;
  border-radius: 18px;
  background: rgba(255, 250, 244, 0.92);
  border: 1px solid var(--line);
}

.filters label {
  display: grid;
  gap: 8px;
  min-width: 170px;
}

.filters label.grow {
  flex: 1 1 320px;
}

.filters span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border-radius: 14px;
  border: 1px solid rgba(74, 59, 44, 0.18);
  background: #fffdf9;
  color: var(--text);
  font: inherit;
  padding: 11px 12px;
}

textarea {
  resize: vertical;
}

.pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 12px;
  color: var(--muted);
  background: rgba(74, 59, 44, 0.08);
}

.pill.accent {
  color: var(--brand);
  background: rgba(211, 75, 36, 0.1);
}

.comment-card.reply-card {
  border-left: 5px solid rgba(34, 116, 165, 0.35);
}

.reply-box {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
}

.reply-box summary {
  cursor: pointer;
  color: var(--brand);
  font-weight: 700;
}

.reply-box form {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.auth-shell {
  display: flex;
  justify-content: center;
  margin-top: 18px;
}

.auth-card {
  width: min(520px, 100%);
  border-radius: 24px;
  padding: 24px;
}

.auth-form {
  display: grid;
  gap: 16px;
}

.auth-form label {
  display: grid;
  gap: 8px;
}

.auth-form span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.auth-submit {
  width: 100%;
}

.empty {
  color: var(--muted);
  text-align: center;
  padding: 22px 10px;
}

@media (max-width: 1100px) {
  .stats-grid,
  .split-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 800px) {
  .page-shell {
    width: min(100% - 20px, 100%);
    margin-top: 12px;
  }

  .topbar {
    padding: 20px;
  }

  .topbar,
  .panel-head,
  .comment-header {
    flex-direction: column;
    align-items: stretch;
  }

  .stats-grid,
  .split-grid {
    grid-template-columns: 1fr;
  }
}
