:root {
  --ant-primary: #1677ff;
  --ant-primary-hover: #4096ff;
  --ant-text: #1f1f1f;
  --ant-text-secondary: #595959;
  --ant-border: #f0f0f0;
  --ant-bg: #f5f7fb;
  --ant-card-bg: #ffffff;
  --ant-radius: 10px;
  --ant-shadow: 0 6px 18px rgba(5, 18, 45, 0.08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  color: var(--ant-text);
  background:
    radial-gradient(1000px 520px at 0% -10%, #eaf2ff 0, transparent 55%),
    radial-gradient(1000px 520px at 100% -5%, #f3fbff 0, transparent 55%),
    var(--ant-bg);
}

.layout {
  max-width: 1180px;
  margin: 0 auto;
  padding: 88px 16px 28px;
}

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

.topbar.sticky {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  backdrop-filter: blur(8px);
  background: rgba(255, 255, 255, 0.86);
  border-bottom: 1px solid var(--ant-border);
  box-shadow: 0 2px 14px rgba(5, 18, 45, 0.06);
  margin-bottom: 0;
  padding: 12px 16px;
}

.topbar-inner {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand-title {
  margin: 0;
  font-size: 22px;
  line-height: 1.2;
}

.brand-desc {
  margin: 4px 0 0;
  color: var(--ant-text-secondary);
  font-size: 13px;
}

.card {
  background: var(--ant-card-bg);
  border: 1px solid var(--ant-border);
  border-radius: var(--ant-radius);
  box-shadow: var(--ant-shadow);
  padding: 16px;
  margin-bottom: 14px;
}

.card-title {
  margin: 0 0 12px;
  font-size: 18px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.stat-card {
  background: #fff;
  border: 1px solid var(--ant-border);
  border-radius: var(--ant-radius);
  box-shadow: var(--ant-shadow);
  padding: 14px;
}

.stat-label {
  color: var(--ant-text-secondary);
  font-size: 13px;
  margin-bottom: 6px;
}

.stat-value {
  font-size: 28px;
  line-height: 1.1;
  font-weight: 600;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 14px;
}

.chip {
  display: inline-flex;
  align-items: center;
  height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid #d9d9d9;
  color: var(--ant-text-secondary);
  text-decoration: none;
  font-size: 13px;
  background: #fff;
}

.chip-count {
  margin-left: 6px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: #8c8c8c;
  background: #f5f5f5;
}

.chip.active {
  border-color: #91caff;
  color: #1677ff;
  background: #e6f4ff;
}

.chip.active .chip-count {
  color: #1677ff;
  background: #d6eaff;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  background: #fff;
  color: var(--ant-text);
  border-radius: 8px;
  height: 34px;
  padding: 0 14px;
  font-size: 14px;
  cursor: pointer;
  transition: all .18s ease;
  text-decoration: none;
}

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

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

.btn-primary:hover { background: var(--ant-primary-hover); }

.btn-default {
  border-color: #d9d9d9;
}

.btn-nav-active {
  background: #e6f4ff;
  border-color: #91caff;
  color: #1677ff;
}

.btn-icon {
  width: 34px;
  min-width: 34px;
  padding: 0;
}

.icon-logout {
  font-size: 16px;
  line-height: 1;
}

.input,
.select,
input[type="text"],
input[type="password"],
input[type="file"],
select,
textarea {
  border: 1px solid #d9d9d9;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 14px;
  background: #fff;
  color: var(--ant-text);
  outline: none;
  width: auto;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="file"]:focus,
select:focus,
textarea:focus {
  border-color: var(--ant-primary);
  box-shadow: 0 0 0 2px rgba(22, 119, 255, 0.15);
}

.table-wrap {
  overflow-x: auto;
  overflow-y: visible;
  padding-bottom: 72px;
}

.model-table-wrap {
  overflow: visible;
  padding-bottom: 8px;
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 780px;
}

th {
  background: #fafafa;
  color: var(--ant-text-secondary);
  font-weight: 600;
  font-size: 13px;
  border-bottom: 1px solid var(--ant-border);
  padding: 11px 10px;
  text-align: left;
}

td {
  border-bottom: 1px solid var(--ant-border);
  padding: 11px 10px;
  font-size: 13px;
  vertical-align: top;
  position: relative;
}

tr:hover td { background: #fcfdff; }

.tag {
  display: inline-flex;
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 12px;
  border: 1px solid;
}

.tag-blue { color: #1677ff; border-color: #91caff; background: #e6f4ff; }
.tag-green { color: #389e0d; border-color: #b7eb8f; background: #f6ffed; }
.tag-orange { color: #d46b08; border-color: #ffd591; background: #fff7e6; }
.tag-red { color: #cf1322; border-color: #ffa39e; background: #fff1f0; }

.muted { color: var(--ant-text-secondary); font-size: 13px; }

.link { color: var(--ant-primary); text-decoration: none; }
.link:hover { color: var(--ant-primary-hover); }

.action-menu {
  position: relative;
  display: inline-block;
}

.action-menu summary {
  list-style: none;
}

.action-menu summary::-webkit-details-marker {
  display: none;
}

.icon-btn {
  width: 34px;
  height: 34px;
  border: 1px solid #d9d9d9;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  cursor: pointer;
  line-height: 1;
  color: var(--ant-text-secondary);
}

.icon-dots {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
  display: inline-block;
  box-shadow: 0 -6px 0 currentColor, 0 6px 0 currentColor;
}

.icon-btn:hover {
  border-color: #91caff;
  color: var(--ant-primary);
}

.action-menu-list {
  position: absolute;
  top: 38px;
  right: 0;
  min-width: 120px;
  background: #fff;
  border: 1px solid var(--ant-border);
  border-radius: 10px;
  box-shadow: var(--ant-shadow);
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 30;
}

.action-menu-btn {
  width: 100%;
}

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

.pager-nav {
  display: flex;
  gap: 8px;
}

.empty {
  border: 1px dashed #d9d9d9;
  border-radius: 10px;
  padding: 28px 16px;
  text-align: center;
  color: var(--ant-text-secondary);
  background: #fcfcfd;
}

.flash {
  border-radius: 8px;
  border: 1px solid;
  padding: 9px 12px;
  margin-bottom: 12px;
  font-size: 13px;
}

.flash-success {
  color: #135200;
  background: #f6ffed;
  border-color: #b7eb8f;
}

.flash-warning {
  color: #873800;
  background: #fff7e6;
  border-color: #ffd591;
}

.timeline {
  border-left: 2px solid #e6f4ff;
  margin-left: 7px;
  padding-left: 14px;
}

.timeline-item {
  position: relative;
  margin-bottom: 12px;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: -20px;
  top: 4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #1677ff;
  box-shadow: 0 0 0 3px #e6f4ff;
}

.timeline-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  margin-bottom: 2px;
}

.timeline-time {
  color: var(--ant-text-secondary);
  font-size: 12px;
}

.diff-box {
  margin-top: 10px;
  border: 1px solid #d9d9d9;
  border-radius: 8px;
  background: #fafafa;
  min-height: 140px;
  max-height: 300px;
  overflow: auto;
  padding: 10px;
  font-size: 12px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

.diff-eq { color: #8c8c8c; display: block; }
.diff-line-add { color: #135200; background: #f6ffed; display: block; }
.diff-line-del { color: #820014; background: #fff1f0; display: block; }
.diff-add { color: #135200; background: #d9f7be; border-radius: 2px; }
.diff-del { color: #820014; background: #ffccc7; border-radius: 2px; }

.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 40;
  padding: 16px;
}

.modal-mask.show {
  display: flex;
}

.modal-card {
  width: 100%;
  max-width: 520px;
  background: #fff;
  border-radius: 10px;
  border: 1px solid #f0f0f0;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.16);
  padding: 14px;
}

.kv {
  display: grid;
  grid-template-columns: 110px 1fr;
  row-gap: 8px;
  column-gap: 10px;
  font-size: 14px;
}

.kv .k { color: var(--ant-text-secondary); }

.compare-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 12px;
}

.audio-detail-top-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.audio-detail-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.panel-title {
  margin: 0 0 8px;
  font-size: 14px;
  color: var(--ant-text-secondary);
}

textarea {
  width: 100%;
  min-height: 240px;
  resize: vertical;
  font-family: "SFMono-Regular", Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

.auth-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 16px;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: #fff;
  border: 1px solid var(--ant-border);
  border-radius: 12px;
  box-shadow: var(--ant-shadow);
  padding: 22px;
}

.auth-title { margin: 0 0 6px; font-size: 24px; }
.auth-sub { margin: 0 0 16px; color: var(--ant-text-secondary); font-size: 13px; }

.form-item { margin-bottom: 12px; }
.form-label { display: block; margin-bottom: 6px; color: var(--ant-text-secondary); font-size: 13px; }

.alert {
  margin-top: 12px;
  background: #fff2f0;
  border: 1px solid #ffa39e;
  color: #cf1322;
  border-radius: 8px;
  font-size: 13px;
  padding: 8px 10px;
}

@media (max-width: 860px) {
  .compare-grid { grid-template-columns: 1fr; }
  .audio-detail-top-grid { grid-template-columns: 1fr; }
  .audio-detail-split { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 90px 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
}
