:root {
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #22252a;
  background: #f5f4f1;
  font-synthesis: none;
  --brand: #9f1d21;
  --brand-dark: #7d1519;
  --brand-soft: #faeceb;
  --text: #22252a;
  --muted: #747980;
  --line: #e1ded9;
  --panel: #ffffff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: #f5f4f1;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.page-shell {
  min-height: 100vh;
  padding-bottom: 104px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(37, 32, 27, 0.05);
}

.login-view {
  display: grid;
  min-height: calc(100vh - 104px);
  place-items: center;
  padding: 24px;
}

.login-panel {
  width: min(400px, 100%);
  padding: 34px;
}

h1,
h2,
p {
  margin-top: 0;
}

.login-panel h1 {
  margin-bottom: 28px;
  font-size: 26px;
}

.login-form {
  display: grid;
  gap: 12px;
}

label {
  color: #474b52;
  font-size: 13px;
  font-weight: 600;
}

input {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  color: var(--text);
  background: #ffffff;
  border: 1px solid #c8c5bf;
  border-radius: 6px;
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

input::placeholder {
  color: #a1a4a8;
}

input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(159, 29, 33, 0.11);
}

.primary-button,
.secondary-button,
.text-button,
.icon-button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 6px;
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.primary-button {
  padding: 0 22px;
  color: #ffffff;
  background: var(--brand);
  border: 1px solid var(--brand);
  font-weight: 600;
}

.primary-button:hover:not(:disabled) {
  background: var(--brand-dark);
  border-color: var(--brand-dark);
}

.login-form .primary-button {
  width: 100%;
  min-height: 48px;
  margin-top: 4px;
}

.secondary-button {
  padding: 0 15px;
  color: #44484f;
  background: #ffffff;
  border: 1px solid #cfcbc5;
}

.secondary-button:hover:not(:disabled) {
  background: #f7f6f4;
}

.text-button {
  min-height: 38px;
  padding: 0 13px;
  color: #5c6067;
  background: transparent;
  border: 1px solid #d8d4ce;
}

.text-button:hover {
  color: var(--brand);
  background: var(--brand-soft);
  border-color: #e7c3c1;
}

.icon-button {
  width: 38px;
  min-height: 38px;
  padding: 0;
  color: #52565c;
  background: #ffffff;
  border: 1px solid #d6d2cc;
  font-size: 22px;
}

.primary-button:active:not(:disabled),
.secondary-button:active:not(:disabled),
.text-button:active:not(:disabled) {
  transform: translateY(1px);
}

.message {
  min-height: 18px;
  margin: 0;
  color: #b42318;
  font-size: 13px;
}

.message:empty {
  min-height: 0;
}

.message.success {
  color: #287a4d;
}

.workspace {
  width: min(1080px, calc(100% - 40px));
  margin: 0 auto;
  padding: 48px 0 20px;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.page-title {
  display: grid;
  gap: 8px;
}

.page-header h1 {
  margin-bottom: 0;
  font-size: 30px;
}

.service-status {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 7px;
  color: #656a71;
  font-size: 13px;
}

.service-status strong {
  color: #8b8f95;
  font-size: 12px;
  font-weight: 600;
}

.status-dot {
  width: 8px;
  height: 8px;
  background: #a7abb0;
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(167, 171, 176, 0.15);
}

.service-status.online .status-dot {
  background: #27915b;
  box-shadow: 0 0 0 3px rgba(39, 145, 91, 0.14);
}

.service-status.online strong {
  color: #237a4d;
}

.service-status.offline .status-dot {
  background: #c53b36;
  box-shadow: 0 0 0 3px rgba(197, 59, 54, 0.14);
}

.service-status.offline strong {
  color: #a82d29;
}

.search-panel,
.results-panel {
  padding: 24px;
}

.search-form {
  display: flex;
  align-items: end;
  gap: 14px;
}

.field {
  flex: 1;
}

.field label {
  display: block;
  margin-bottom: 8px;
}

.search-button {
  min-width: 112px;
  height: 48px;
}

.search-panel .message {
  margin-top: 10px;
}

.results-panel {
  margin-top: 20px;
}

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

.results-header h2 {
  margin-bottom: 0;
  font-size: 18px;
}

.result-count {
  color: var(--muted);
  font-size: 13px;
}

.table-wrap {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
}

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

th,
td {
  padding: 14px;
  border-bottom: 1px solid #ebe8e3;
  text-align: left;
  vertical-align: middle;
  overflow-wrap: anywhere;
}

th {
  color: #676c73;
  background: #f7f6f4;
  font-size: 12px;
  font-weight: 600;
}

td {
  color: #30343a;
  font-size: 14px;
}

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

tbody tr:hover {
  background: #fbfaf8;
}

th:nth-child(1),
td:nth-child(1) {
  width: 17%;
}

th:nth-child(2),
td:nth-child(2) {
  width: 11%;
}

th:nth-child(3),
td:nth-child(3) {
  width: 43%;
  white-space: pre-wrap;
}

th:nth-child(4),
td:nth-child(4) {
  width: 21%;
  color: #676c73;
}

.action-column,
td:last-child {
  width: 8%;
  text-align: center;
}

.type-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 9px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
}

.type-badge.audio {
  color: #8b5312;
  background: #fff4df;
  border: 1px solid #f0d5a6;
}

.type-badge.text {
  color: #176348;
  background: #eaf7f1;
  border: 1px solid #bee1d2;
}

.type-badge.other {
  color: #5f646d;
  background: #f0f1f2;
  border: 1px solid #d9dcdf;
}

.play-button {
  display: inline-grid;
  width: 36px;
  height: 36px;
  padding: 0;
  place-items: center;
  color: var(--brand);
  background: var(--brand-soft);
  border: 1px solid #e5bfbd;
  border-radius: 50%;
}

.play-button:hover {
  color: #ffffff;
  background: var(--brand);
}

.play-button svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
  stroke: none;
}

.empty-state {
  padding: 48px 16px;
  color: var(--muted);
  text-align: center;
  font-size: 14px;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 18px;
}

.page-info {
  min-width: 92px;
  color: #676c73;
  font-size: 13px;
  text-align: center;
}

.audio-bar {
  position: fixed;
  right: 16px;
  bottom: 16px;
  left: 16px;
  z-index: 10;
  display: flex;
  width: min(720px, calc(100% - 32px));
  margin: 0 auto;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  background: #ffffff;
  border: 1px solid #d5d1cb;
  border-radius: 8px;
  box-shadow: 0 12px 38px rgba(37, 32, 27, 0.18);
}

.audio-label {
  min-width: 150px;
  color: #5f646b;
  font-size: 12px;
}

audio {
  flex: 1;
  min-width: 180px;
  height: 40px;
}

[hidden] {
  display: none !important;
}

@media (max-width: 680px) {
  .page-shell {
    padding-bottom: 102px;
  }

  .login-view {
    min-height: calc(100vh - 102px);
    padding: 16px;
  }

  .login-panel {
    padding: 28px 22px;
  }

  .login-panel h1 {
    font-size: 23px;
  }

  .workspace {
    width: calc(100% - 24px);
    padding-top: 26px;
  }

  .page-header h1 {
    font-size: 25px;
  }

  .text-button span {
    display: none;
  }

  .text-button {
    width: 40px;
    padding: 0;
  }

  .search-panel,
  .results-panel {
    padding: 18px 14px;
  }

  .search-form {
    display: grid;
    grid-template-columns: 1fr;
  }

  .search-button {
    width: 100%;
  }

  .table-wrap {
    overflow: visible;
    border: 0;
  }

  table,
  thead,
  tbody,
  tr,
  th,
  td {
    display: block;
  }

  thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  tbody {
    display: grid;
    gap: 12px;
  }

  tr {
    position: relative;
    padding: 14px 54px 14px 13px;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 7px;
  }

  tbody tr:hover {
    background: #ffffff;
  }

  td,
  th:nth-child(n),
  td:nth-child(n) {
    width: auto;
  }

  td {
    display: grid;
    grid-template-columns: 64px 1fr;
    gap: 8px;
    padding: 6px 0;
    border: 0;
    font-size: 13px;
  }

  td::before {
    color: #888c92;
    font-size: 12px;
  }

  td:nth-child(1)::before { content: "手机号"; }
  td:nth-child(2)::before { content: "类型"; }
  td:nth-child(3)::before { content: "内容"; }
  td:nth-child(4)::before { content: "时间"; }

  td:last-child {
    position: absolute;
    top: 13px;
    right: 10px;
    display: block;
    padding: 0;
  }

  td:last-child::before {
    content: none;
  }

  .pagination {
    justify-content: center;
  }

  .audio-label {
    display: none;
  }

  audio {
    width: calc(100% - 46px);
  }
}
