@import url("fonts.css");

/* ============================================================
   Community Issues — 复刻 Gaijin Community Bug Reporting System
   Palette: blue.600 #2B6CB0 · panel #EDF2F7 · border #E2E8F0
   ============================================================ */
:root {
  --blue: #2b6cb0;
  --blue-dark: #2c5282;
  --blue-soft: #90cdf4;
  --panel: #edf2f7;
  --panel-2: #f7fafc;
  --border: #e2e8f0;
  --border-soft: #edf2f7;
  --text: #1a202c;
  --text-strong: #09090b;
  --muted: #718096;
  --muted-dark: #4a5568;
  --red: #c53030;
  --amber: #b7791f;
  --green: #2f855a;
  --purple: #6b46c1;
  --gray: #4a5568;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: #fff;
  color: var(--text-strong);
  font-family: Ubuntu, "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: none; }
img { max-width: 100%; }

/* 图标基础尺寸：1em，随父级 font-size 缩放 */
svg.icon {
  width: 1em;
  height: 1em;
  display: inline-block;
  vertical-align: -0.125em;
  flex: none;
  fill: currentColor;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px 72px;
}

/* ------------------------------------------------------------------ header */
.site-header { background: #fff; }
.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 18px 24px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.crumbs {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  font-weight: 700;
  color: #2d3748;
  min-width: 0;
}
.crumbs a { color: inherit; }
.crumbs .sep { color: #a0aec0; display: inline-flex; font-size: 18px; }
.crumb-pill {
  background: #e2e8f0;
  border-radius: 6px;
  padding: 1px 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.header-right { display: flex; align-items: center; gap: 10px; flex: none; }

/* ----------------------------------------------------------------- buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 34px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: var(--muted-dark);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s, color .15s, border-color .15s;
}
.btn svg { font-size: 16px; }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-dark); }
.btn-light { background: #fff; border-color: var(--border); color: var(--muted-dark); }
.btn-light:hover { background: var(--panel-2); }
.btn-soft { background: var(--panel); color: var(--muted-dark); }
.btn-soft:hover { background: #e2e8f0; }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: #9b2c2c; }
.btn-danger-ghost { color: var(--red); border-color: #fed7d7; background: #fff; }
.btn-danger-ghost:hover { background: #fff5f5; }
.btn-lg { height: 42px; padding: 0 20px; font-size: 14px; }
.btn-sm { height: 28px; padding: 0 10px; font-size: 12px; border-radius: 4px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* -------------------------------------------------------------- user menu */
.user-menu { position: relative; }
.user-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 10px 0 6px;
  background: var(--panel);
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  font: 500 14px inherit;
  font-family: inherit;
  color: var(--muted-dark);
}
.user-trigger:hover { background: #e2e8f0; }
.user-trigger .avatar { width: 24px; height: 24px; line-height: 24px; font-size: 11px; }
.user-trigger .role-dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--green);
}
.dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 208px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(26, 32, 44, .12);
  padding: 6px;
  z-index: 40;
  display: none;
}
.dropdown.open { display: block; }
.dropdown .dd-head { padding: 8px 10px 10px; border-bottom: 1px solid var(--border-soft); margin-bottom: 6px; }
.dropdown .dd-name { font-weight: 700; font-size: 14px; color: var(--text); }
.dropdown .dd-mail { font-size: 12px; color: var(--muted); word-break: break-all; }
.dropdown button, .dropdown a {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 10px;
  border: 0;
  border-radius: 5px;
  background: none;
  color: var(--text);
  font: 400 14px inherit;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}
.dropdown button:hover, .dropdown a:hover { background: var(--panel); }
.dropdown svg { font-size: 15px; color: var(--muted); }
.dropdown .dd-sep { height: 1px; background: var(--border-soft); margin: 6px 0; }

.avatar {
  display: inline-block;
  flex: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3182ce, #63b3ed);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  text-transform: uppercase;
}
.avatar.big { width: 32px; height: 32px; line-height: 32px; font-size: 13px; }
.avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
.author-link { color: inherit; }
.author-link:hover { color: var(--blue); text-decoration: underline; }

/* ----------------------------------------------------------------- profile */
.profile-page { max-width: 780px; margin: 0 auto; }
.profile-card {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 26px;
}
.profile-avatar-wrap { flex: none; width: 108px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.profile-avatar {
  position: relative;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  border: 0;
  padding: 0;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #3182ce, #63b3ed);
  color: #fff;
  font-size: 36px;
  font-weight: 700;
  text-transform: uppercase;
}
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
button.profile-avatar { cursor: pointer; }
.profile-avatar-hint {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 5px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: rgba(26, 32, 44, .55);
  color: #fff;
  font-size: 10px;
  font-weight: 400;
  text-transform: none;
  opacity: 0;
  transition: opacity .15s;
}
button.profile-avatar:hover .profile-avatar-hint,
button.profile-avatar:focus-visible .profile-avatar-hint { opacity: 1; }
.profile-avatar-note { font-size: 10px; color: var(--muted); text-align: center; line-height: 1.4; }
.profile-head { flex: 1; min-width: 0; padding-top: 4px; }
.profile-head h1 {
  margin: 0 0 6px;
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.profile-meta { font-size: 13px; color: var(--muted); }
.profile-bio {
  margin: 14px 0 0;
  font-size: 15px;
  line-height: 1.7;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
}
.profile-form {
  margin-top: 20px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 24px;
}
.profile-form h2 { margin: 0 0 18px; font-size: 16px; font-weight: 700; color: var(--text); }
.profile-form textarea { min-height: 96px; }
.profile-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
@media (max-width: 720px) {
  .profile-card { flex-direction: column; align-items: center; text-align: center; padding: 20px; }
  .profile-head h1 { justify-content: center; }
  .profile-form { padding: 18px; }
}

/* ------------------------------------------------------------- page layout */
.page-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  padding: 10px 0 14px;
}

/* ------------------------------------------------------------ filter panel */
.filter-panel { background: var(--panel); border-radius: 8px; padding: 16px; }
.filter-row { display: flex; gap: 12px; align-items: stretch; }
.filter-row + .filter-row { margin-top: 12px; }
.filter-row.three > * { flex: 1 1 0; min-width: 0; }

.seg {
  display: flex;
  flex: 0 0 238px;
  background: #fff;
  border-radius: 6px;
  padding: 4px;
}
.seg button {
  flex: 1;
  height: 36px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--muted-dark);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.seg button:hover { color: var(--blue); }
.seg button.active { background: var(--blue); color: #fff; }

.input-icon, .select-icon { position: relative; flex: 1; min-width: 0; }
.input-icon > svg, .select-icon > svg {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 16px;
  color: var(--muted);
  pointer-events: none;
}
.input-icon input, .select-icon select {
  width: 100%;
  height: 44px;
  padding: 0 12px 0 38px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  outline: none;
  appearance: none;
  transition: border-color .15s, box-shadow .15s;
}
.input-icon input::placeholder { color: #a0aec0; }
.input-icon input:focus, .select-icon select:focus {
  border-color: var(--blue-soft);
  box-shadow: 0 0 0 1px var(--blue-soft);
}
.select-icon::after {
  content: "";
  position: absolute;
  right: 14px;
  top: 50%;
  width: 8px;
  height: 8px;
  border-right: 1.6px solid #718096;
  border-bottom: 1.6px solid #718096;
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}
.select-icon select { padding-right: 34px; cursor: pointer; }
.select-icon select.placeholder { color: #a0aec0; }

/* -------------------------------------------------------------- list tools */
.list-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 0 4px;
}
.muted { color: var(--muted); }
.small { font-size: 13px; }
.hot-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 12px;
  background: var(--panel);
  border: 0;
  border-radius: 6px;
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}
.hot-btn:hover { background: #e2e8f0; }
.hot-btn svg { font-size: 16px; color: var(--red); }

.issue-list { border-top: 1px solid var(--border-soft); margin-top: 8px; }
.issue-row {
  display: block;
  padding: 15px 4px;
  border-bottom: 1px solid var(--border-soft);
  color: inherit;
  transition: background .12s;
}
.issue-row:hover { background: #fafcff; }
.issue-title {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.45;
  color: var(--text);
  word-break: break-word;
}
.issue-row:hover .issue-title { color: var(--blue); }
.issue-title svg { flex: none; margin-top: 2px; font-size: 18px; }
.issue-title .st-ico { display: inline-flex; flex: none; margin-top: 2px; font-size: 18px; line-height: 1; }
.issue-title .st-ico.sm { font-size: 14px; margin-top: 1px; }
.issue-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 14px;
  margin-top: 7px;
  font-size: 13px;
  color: var(--muted);
}
.issue-meta .m { display: inline-flex; align-items: center; gap: 5px; }
.issue-meta .m svg { font-size: 14px; color: #a0aec0; }

.chip {
  display: inline-block;
  max-width: 100%;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--border);
  color: var(--muted-dark);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
}
.chip.light { background: #fff; border: 1px solid var(--border); }
.chip.blue { background: #bee3f8; color: #2c5282; }

.empty {
  padding: 60px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 15px;
}
.empty svg { font-size: 34px; color: #cbd5e0; display: block; margin: 0 auto 12px; }

/* ------------------------------------------------------------- pagination */
.pagination { display: flex; justify-content: center; align-items: center; gap: 4px; padding: 22px 0 0; }
.pagination button, .pagination span.gap {
  min-width: 30px;
  height: 30px;
  padding: 0 8px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--muted-dark);
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
}
.pagination button:hover { background: var(--panel); }
.pagination button.active { background: var(--panel); color: var(--blue); font-weight: 700; }
.pagination button[disabled] { opacity: .35; cursor: default; background: transparent; }
.pagination svg { font-size: 14px; }

/* ------------------------------------------------------------- detail view */
.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 328px;
  gap: 24px;
  align-items: start;
  padding-top: 26px;
}
.card { background: #fff; border: 1px solid var(--border); border-radius: 8px; }
.issue-main { padding: 24px; }
.detail-title { margin: 0 0 14px; font-size: 26px; font-weight: 700; line-height: 1.3; color: var(--text); word-break: break-word; }
.issue-sub {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 14px;
  font-size: 13px;
  color: var(--muted-dark);
}
.issue-sub .m { display: inline-flex; align-items: center; gap: 5px; }
.issue-sub .m svg { font-size: 14px; color: #a0aec0; }
.issue-sub .author { display: inline-flex; align-items: center; gap: 5px; font-weight: 500; }

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px 3px 8px;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
}
.status-pill svg { font-size: 12px; }
.st-open { background: #c53030; }
.st-acknowledged { background: #b7791f; }
.st-fixed { background: #2f855a; }
.st-duplicate { background: #6b46c1; }
.st-not_a_bug { background: #4a5568; }
.st-closed { background: #718096; }

.issue-body {
  margin: 18px 0 8px;
  font-size: 15px;
  line-height: 1.72;
  color: #2d3748;
  white-space: pre-wrap;
  word-break: break-word;
}
.attachments { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0 4px; }
.thumb {
  width: 108px;
  height: 72px;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  cursor: zoom-in;
  background: var(--panel);
}
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.same-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
  padding: 9px 14px;
  border: 0;
  border-radius: 6px;
  background: var(--blue-soft);
  color: #fff;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s;
}
.same-btn:hover { background: #63b3ed; }
.same-btn.active { background: var(--blue); }
.same-btn .count { padding: 2px 6px; border-radius: 3px; background: rgba(255, 255, 255, .28); font-size: 12px; }

/* ------------------------------------------------------------------ sidebar */
.side-card { background: var(--panel); border-radius: 8px; padding: 16px; margin-bottom: 16px; }
.side-card.white { background: #fff; border: 1px solid var(--border); }
.side-title { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; font-size: 15px; font-weight: 700; color: #2d3748; }
.side-title svg { font-size: 16px; color: var(--muted-dark); }
.info-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 5px 0; font-size: 13px; }
.info-row .k { color: var(--muted); flex: none; }
.info-row .v { color: var(--muted-dark); text-align: right; word-break: break-word; }
.info-divider { height: 1px; background: #e2e8f0; margin: 10px 0; }
.side-sub { margin: 12px 0 8px; font-size: 13px; color: var(--muted); }
.shot-box { background: #cbd5e0; border-radius: 6px; min-height: 46px; display: flex; align-items: center; justify-content: center; color: #718096; font-size: 12px; }
.shot-list { display: flex; flex-wrap: wrap; gap: 8px; }
.shot-list .thumb { width: 84px; height: 56px; }

/* ---------------------------------------------------------------- comments */
.discussion { margin-top: 24px; }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 17px; font-weight: 700; color: var(--text); margin: 0 0 4px; }
.comment { display: flex; gap: 12px; padding: 16px 0; border-bottom: 1px solid var(--border-soft); }
.comment-head { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: 13px; }
.comment-head .name { font-weight: 700; color: var(--text); font-size: 14px; }
.comment-head .time { color: var(--muted); font-size: 12px; }
.comment-body { margin-top: 6px; font-size: 14px; line-height: 1.65; color: #2d3748; white-space: pre-wrap; word-break: break-word; }
.comment.system .comment-body { color: var(--muted); font-style: italic; }
.comment-actions { margin-top: 6px; }
.link-danger { background: none; border: 0; padding: 0; color: var(--red); font: 400 12px inherit; font-family: inherit; cursor: pointer; }
.link-danger:hover { text-decoration: underline; }
.staff-badge {
  padding: 1px 5px;
  border-radius: 3px;
  background: var(--blue);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .03em;
  text-transform: uppercase;
}

/* ------------------------------------------------------------------- forms */
.form-card { background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 28px; }
.form-title { margin: 0 0 6px; font-size: 26px; font-weight: 700; color: var(--text); }
.form-sub { margin: 0 0 22px; font-size: 14px; color: var(--muted); line-height: 1.6; }
.field { margin-bottom: 18px; }
.field > label { display: block; margin-bottom: 7px; font-size: 13px; font-weight: 700; color: var(--muted-dark); }
.field > label .req { color: var(--red); }
.field input[type="text"], .field input[type="email"], .field input[type="password"],
.field select, .field textarea {
  width: 100%;
  height: 44px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.field textarea { height: auto; padding: 12px; line-height: 1.65; resize: vertical; min-height: 180px; }
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--blue-soft);
  box-shadow: 0 0 0 1px var(--blue-soft);
}
.field .hint { margin-top: 6px; font-size: 12px; color: var(--muted); }
.captcha-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.captcha-img {
  width: 168px;
  height: 56px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #f6f8fb;
  display: block;
}
.captcha-question { font-size: 16px; font-weight: 700; color: var(--muted-dark); padding: 0 6px; }
.check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 6px;
  font-size: 13px;
  color: var(--muted-dark);
  cursor: pointer;
  user-select: none;
}
.check-row input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--blue); cursor: pointer; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.form-actions { display: flex; justify-content: flex-end; align-items: center; gap: 10px; padding-top: 8px; border-top: 1px solid var(--border-soft); margin-top: 8px; }
.checklist { background: var(--panel); border-radius: 8px; padding: 16px 20px; font-size: 13px; color: var(--muted-dark); line-height: 1.7; }
.checklist h4 { margin: 0 0 8px; font-size: 14px; color: var(--text); }
.checklist ul { margin: 0; padding-left: 18px; }
.checklist li + li { margin-top: 4px; }

.dropzone {
  border: 1.5px dashed #cbd5e0;
  border-radius: 8px;
  background: var(--panel-2);
  padding: 26px 16px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.dropzone:hover, .dropzone.drag { border-color: var(--blue-soft); background: #ebf8ff; }
.dropzone svg { font-size: 26px; color: #a0aec0; display: block; margin: 0 auto 8px; }
.dropzone b { color: var(--blue); font-weight: 500; }
.preview-grid { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.preview { position: relative; width: 104px; height: 74px; border-radius: 6px; overflow: hidden; border: 1px solid var(--border); }
.preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.preview button {
  position: absolute; right: 3px; top: 3px; width: 20px; height: 20px; border: 0; border-radius: 50%;
  background: rgba(0, 0, 0, .6); color: #fff; font-size: 12px; line-height: 20px; text-align: center; cursor: pointer; padding: 0;
}

/* --------------------------------------------------------------- auth page */
.auth-wrap { max-width: 440px; margin: 36px auto 0; }
.auth-card { background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 28px; }
.auth-tabs { display: flex; background: var(--panel); border-radius: 6px; padding: 4px; margin-bottom: 22px; }
.auth-tabs button {
  flex: 1; height: 36px; border: 0; border-radius: 4px; background: transparent;
  color: var(--muted-dark); font-family: inherit; font-size: 14px; font-weight: 500; cursor: pointer;
}
.auth-tabs button.active { background: #fff; color: var(--blue); box-shadow: 0 1px 2px rgba(0, 0, 0, .06); }
.auth-note { margin-top: 16px; font-size: 12px; color: var(--muted); line-height: 1.6; text-align: center; }
.alert { padding: 10px 12px; border-radius: 6px; font-size: 13px; margin-bottom: 16px; }
.alert.error { background: #fff5f5; color: #c53030; border: 1px solid #fed7d7; }
.alert.info { background: #ebf8ff; color: #2c5282; border: 1px solid #bee3f8; }
.alert.success { background: #f0fff4; color: #2f855a; border: 1px solid #c6f6d5; }

/* ------------------------------------------------------------------ admin */
.admin-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; padding: 26px 0 16px; flex-wrap: wrap; }
.admin-header h1 { margin: 0; font-size: 26px; font-weight: 700; color: var(--text); }
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 22px; }
.stat { background: var(--panel); border-radius: 8px; padding: 16px 18px; }
.stat .n { font-size: 26px; font-weight: 700; color: var(--text); line-height: 1.2; }
.stat .l { font-size: 13px; color: var(--muted); margin-top: 2px; }
.panel-card { background: #fff; border: 1px solid var(--border); border-radius: 8px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--border-soft); flex-wrap: wrap; }
.panel-head h2 { margin: 0; font-size: 16px; font-weight: 700; color: var(--text); }
.panel-body { padding: 6px 18px 18px; overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--border); font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.table td { padding: 12px 10px; border-bottom: 1px solid var(--border-soft); color: #2d3748; vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table td .t-title { font-weight: 500; color: var(--text); display: block; max-width: 420px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.table select { height: 30px; padding: 0 8px; border: 1px solid var(--border); border-radius: 4px; font-family: inherit; font-size: 12px; color: var(--muted-dark); background: #fff; }
.row-actions { display: flex; gap: 6px; align-items: center; }
.icon-btn { width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--border); border-radius: 4px; background: #fff; color: var(--muted-dark); cursor: pointer; }
.icon-btn:hover { background: var(--panel-2); }
.icon-btn.danger { color: var(--red); border-color: #fed7d7; }
.icon-btn.danger:hover { background: #fff5f5; }

/* -------------------------------------------------------------- moderation */
.mod-layout { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(320px, 1fr); gap: 20px; align-items: start; }
.mod-side { display: flex; flex-direction: column; gap: 20px; }
.mod-filters { display: flex; gap: 8px; padding: 12px 18px; border-bottom: 1px solid var(--border-soft); flex-wrap: wrap; }
.mod-filters > * { flex: 1 1 128px; min-width: 0; }
.mod-filters select { height: 34px; border: 1px solid var(--border); border-radius: 4px; padding: 0 8px; font-family: inherit; font-size: 12px; color: var(--muted-dark); background: #fff; }
.mod-filters .input-icon input { height: 34px; }
.mod-id { font-family: ui-monospace, Consolas, "Courier New", monospace; font-size: 11.5px; background: var(--panel); border: 1px solid var(--border); color: var(--muted-dark); border-radius: 4px; padding: 2px 6px; white-space: nowrap; }
.mod-cat { display: inline-block; font-size: 11px; line-height: 1.5; padding: 1px 7px; border-radius: 999px; white-space: nowrap; border: 1px solid transparent; }
.cat-politics { background: #fff5f5; color: #9b2c2c; border-color: #fed7d7; }
.cat-porn { background: #faf5ff; color: #6b46c1; border-color: #e9d8fd; }
.cat-violence { background: #fffaf0; color: #9c4221; border-color: #feebc8; }
.cat-insult { background: #fffaf0; color: #b7791f; border-color: #fefcbf; }
.cat-ad { background: #ebf8ff; color: #2c5282; border-color: #bee3f8; }
.cat-reserved { background: #edf2f7; color: #4a5568; border-color: #e2e8f0; }
.mod-badge { display: inline-block; font-size: 11px; padding: 1px 7px; border-radius: 999px; white-space: nowrap; }
.mb-pending { background: #fefcbf; color: #975a16; }
.mb-cleared { background: #c6f6d5; color: #276749; }
.mb-confirmed { background: #fed7d7; color: #9b2c2c; }
.mb-checked { background: #e2e8f0; color: #4a5568; }
.mod-excerpt { color: var(--muted-dark); font-size: 12px; max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mod-table { table-layout: fixed; }
.mod-table th, .mod-table td { padding: 10px 7px; }
.mod-table th:nth-child(1), .mod-table td:nth-child(1) { width: 136px; }
.mod-table th:nth-child(2), .mod-table td:nth-child(2) { width: 72px; }
.mod-table th:nth-child(3), .mod-table td:nth-child(3) { width: 82px; }
.mod-table th:nth-child(4), .mod-table td:nth-child(4) { width: 84px; }
.mod-table th:nth-child(5), .mod-table td:nth-child(5) { width: 88px; }
.mod-table th:nth-child(7), .mod-table td:nth-child(7) { width: 64px; }
.mod-table th:nth-child(8), .mod-table td:nth-child(8) { width: 54px; }
.mod-table td { overflow: hidden; }
.mod-table .mod-excerpt { max-width: none; }
tr[data-mod-open] { cursor: pointer; }
tr[data-mod-open]:hover { background: #fafcff; }
.mod-textarea { width: 100%; border: 1px solid #cbd5e0; border-radius: 6px; padding: 10px 12px; font-family: inherit; font-size: 13px; line-height: 1.6; resize: vertical; }
.mod-textarea:focus { outline: none; border-color: var(--blue-soft); box-shadow: 0 0 0 3px rgba(43, 108, 176, .12); }
.mod-hit-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; align-items: center; }
.mod-hit-word { font-size: 12px; color: var(--muted-dark); background: #fff; border: 1px dashed var(--border); border-radius: 4px; padding: 1px 6px; }
.lex-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.lex-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.lex-form { display: flex; gap: 6px; }
.lex-form input { flex: 1; min-width: 0; height: 30px; border: 1px solid var(--border); border-radius: 4px; padding: 0 8px; font-family: inherit; font-size: 12px; }
.lex-form select { height: 30px; border: 1px solid var(--border); border-radius: 4px; font-family: inherit; font-size: 12px; background: #fff; max-width: 108px; }
.lex-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.lex-chip { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; background: var(--panel); border-radius: 4px; padding: 2px 4px 2px 8px; color: var(--muted-dark); }
.lex-chip button { border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 14px; line-height: 1; padding: 0 3px; }
.lex-chip button:hover { color: var(--red); }
.modal-card.wide { max-width: 680px; }
.mod-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 18px; margin-top: 14px; }
.mod-k { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 3px; }
.mod-pre { margin: 4px 0 0; background: var(--panel-2); border: 1px solid var(--border-soft); border-radius: 6px; padding: 10px 12px; font-size: 12px; line-height: 1.65; color: #2d3748; white-space: pre-wrap; word-break: break-word; max-height: 180px; overflow: auto; font-family: inherit; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; margin-top: 18px; }
.modal-card .field textarea { min-height: 64px; }

/* ------------------------------------------------------------------ toast */
.toasts { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 100; max-width: 340px; }
.toast {
  background: #1a202c;
  color: #fff;
  border-radius: 6px;
  padding: 11px 14px;
  font-size: 13px;
  line-height: 1.5;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .18);
  animation: toast-in .16s ease-out;
}
.toast.success { background: #276749; }
.toast.error { background: #9b2c2c; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ----------------------------------------------------------------- modal */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(9, 9, 11, .82);
  display: flex; align-items: center; justify-content: center; padding: 32px; z-index: 90;
}
.modal-overlay img { max-width: 100%; max-height: 88vh; border-radius: 4px; box-shadow: 0 20px 60px rgba(0,0,0,.5); }
.modal-card {
  width: 100%;
  max-width: 420px;
  background: #fff;
  border-radius: 8px;
  padding: 24px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, .35);
  max-height: 90vh;
  overflow-y: auto;
}
.modal-card h3 { margin: 0 0 4px; font-size: 18px; color: var(--text); }
.modal-card > p { margin: 0 0 16px; font-size: 13px; color: var(--muted); word-break: break-all; }
.modal-close { position: fixed; top: 18px; right: 22px; background: transparent; border: 0; color: #fff; font-size: 26px; cursor: pointer; line-height: 1; }

/* ----------------------------------------------------------------- footer */
.site-footer { border-top: 1px solid var(--border); margin-top: 56px; background: #fff; }
.footer-inner {
  max-width: 1200px; margin: 0 auto; padding: 22px 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  font-size: 13px; color: var(--muted);
}
.footer-links { display: flex; gap: 18px; flex-wrap: wrap; }
.footer-links a { color: var(--muted); }
.footer-links a:hover { color: var(--blue); }
.lang-switch { display: inline-flex; align-items: center; gap: 6px; }
.lang-switch button { border: 0; background: none; color: var(--muted); font-family: inherit; font-size: 13px; cursor: pointer; padding: 2px 4px; }
.lang-switch button.active { color: var(--blue); font-weight: 700; }

/* ------------------------------------------------------------- responsive */
@media (max-width: 980px) {
  .detail-grid { grid-template-columns: minmax(0, 1fr); }
  .mod-layout { grid-template-columns: minmax(0, 1fr); }
  .filter-row.three { flex-wrap: wrap; }
  .filter-row.three > * { flex: 1 1 180px; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .container, .header-inner { padding-left: 16px; padding-right: 16px; }
  .crumbs { font-size: 17px; gap: 6px; }
  .crumb-pill { padding: 1px 8px; }
  .filter-row { flex-direction: column; }
  .filter-row.three > * { flex: 0 0 auto; width: 100%; }
  .seg { flex: 1 1 auto; width: 100%; }
  .form-grid { grid-template-columns: 1fr; }
  .form-card, .issue-main, .auth-card { padding: 18px; }
  .detail-title { font-size: 21px; }
  .issue-title { font-size: 16px; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .user-trigger .uname { max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
