:root {
  --bg: #f4f5f7;
  --panel: #ffffff;
  --text: #1a1a1a;
  --muted: #7a7f87;
  --line: #ececef;
  --brand: #07c160;
  --danger: #d92d20;
  --pending: #b26a00;
  --processing: #2b5bb7;
  --resolved: #0b7a3a;
  --rejected: #b42323;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px;
}

.shell {
  max-width: 1240px;
  margin: 0 auto;
  padding: 28px 24px 60px;
}

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

.head h1 {
  margin: 0;
  font-size: 24px;
}

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

.head__actions {
  display: flex;
  gap: 8px;
}

.btn,
.icon-btn {
  border: 1px solid #dcdfe4;
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font: inherit;
  cursor: pointer;
}

.btn {
  padding: 8px 14px;
}

.btn:hover {
  border-color: #b9bec6;
}

.btn--primary {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}

.btn--primary:hover {
  border-color: #06a850;
  background: #06a850;
}

.icon-btn {
  width: 32px;
  height: 32px;
  font-size: 20px;
  line-height: 1;
}

.login {
  max-width: 420px;
  margin: 60px auto;
  padding: 28px;
  border-radius: 14px;
  background: var(--panel);
  box-shadow: 0 10px 30px rgba(20, 24, 31, 0.08);
}

.login h2 {
  margin: 0 0 8px;
  font-size: 20px;
}

.login p {
  margin: 0 0 18px;
  color: var(--muted);
  line-height: 1.7;
}

.login code {
  padding: 1px 6px;
  border-radius: 4px;
  background: #f2f3f5;
}

.login__form {
  display: flex;
  gap: 8px;
}

.login__form input {
  flex: 1;
  min-width: 0;
  padding: 9px 12px;
  border: 1px solid #dcdfe4;
  border-radius: 8px;
  font: inherit;
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.stat {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
}

.stat__label {
  color: var(--muted);
  font-size: 12px;
}

.stat__value {
  margin-top: 6px;
  font-size: 24px;
  font-weight: 700;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

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

.filter {
  padding: 6px 12px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  cursor: pointer;
}

.filter:hover {
  background: #eceef1;
}

.filter.is-active {
  background: #1f2329;
  color: #fff;
}

.search {
  width: 320px;
  max-width: 100%;
  padding: 8px 12px;
  border: 1px solid #dcdfe4;
  border-radius: 8px;
  background: #fff;
  font: inherit;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 980px;
}

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

th {
  position: sticky;
  top: 0;
  background: #fafbfc;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

tbody tr {
  cursor: pointer;
}

tbody tr:hover {
  background: #fafbfc;
}

tbody tr:last-child td {
  border-bottom: 0;
}

.ticket {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  white-space: nowrap;
}

.muted {
  color: var(--muted);
}

.clip {
  display: -webkit-box;
  max-width: 260px;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

.badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.badge[data-status="pending"] {
  background: #fff4e5;
  color: var(--pending);
}

.badge[data-status="processing"] {
  background: #e8f1ff;
  color: var(--processing);
}

.badge[data-status="resolved"] {
  background: #e7f8ee;
  color: var(--resolved);
}

.badge[data-status="rejected"] {
  background: #ffeded;
  color: var(--rejected);
}

.link {
  border: 0;
  background: none;
  color: #2563eb;
  font: inherit;
  cursor: pointer;
  white-space: nowrap;
}

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

.drawer {
  position: fixed;
  inset: 0;
  z-index: 50;
}

.drawer__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 18, 22, 0.4);
  animation: fade 0.18s ease;
}

.drawer__panel {
  position: absolute;
  top: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  width: min(560px, 92vw);
  height: 100%;
  background: #fff;
  box-shadow: -12px 0 40px rgba(0, 0, 0, 0.12);
  animation: slide 0.22s ease;
}

.drawer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

.drawer__head h2 {
  margin: 0;
  font-size: 18px;
}

.drawer__body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

.detail-grid {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 10px 14px;
  margin: 0 0 18px;
  font-size: 14px;
}

.detail-grid dt {
  color: var(--muted);
}

.detail-grid dd {
  margin: 0;
  word-break: break-all;
}

.block {
  margin-bottom: 20px;
}

.block h3 {
  margin: 0 0 8px;
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
}

.content-box {
  margin: 0;
  padding: 12px 14px;
  border-radius: 10px;
  background: #f7f8fa;
  font: inherit;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
}

.thumbs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 8px;
}

.thumbs a {
  display: block;
  aspect-ratio: 1;
  border-radius: 10px;
  background-size: cover;
  background-position: center;
  border: 1px solid var(--line);
}

.timeline {
  margin: 0;
  padding: 0 0 0 18px;
  list-style: none;
  border-left: 2px solid var(--line);
}

.timeline li {
  position: relative;
  margin-bottom: 14px;
  padding-left: 14px;
}

.timeline li::before {
  content: "";
  position: absolute;
  top: 5px;
  left: -25px;
  width: 10px;
  height: 10px;
  border: 2px solid #c9ced6;
  border-radius: 50%;
  background: #fff;
}

.timeline li:last-child::before {
  border-color: var(--brand);
  background: var(--brand);
}

.timeline strong {
  font-size: 14px;
}

.timeline span {
  margin-left: 8px;
  color: var(--muted);
  font-size: 12px;
}

.timeline p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.update-form {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fafbfc;
}

.update-form label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  color: var(--muted);
}

.update-form select,
.update-form textarea {
  width: 100%;
  margin-bottom: 12px;
  padding: 9px 12px;
  border: 1px solid #dcdfe4;
  border-radius: 8px;
  background: #fff;
  font: inherit;
}

.update-form textarea {
  min-height: 76px;
  resize: vertical;
}

.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  z-index: 80;
  padding: 10px 16px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.8);
  color: #fff;
  transform: translateX(-50%);
}

@keyframes slide {
  from {
    transform: translateX(40px);
    opacity: 0.4;
  }
}

@keyframes fade {
  from {
    opacity: 0;
  }
}

@media (max-width: 720px) {
  .shell {
    padding: 18px 14px 40px;
  }

  .search {
    width: 100%;
  }
}
