@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@400;500;600&display=swap");

:root {
  color-scheme: light;
  --bg: #e9f2ff;
  --card: #ffffff;
  --ink: #0f1b2d;
  --muted: #5e6f86;
  --accent: #1e6bff;
  --accent-dark: #0f4fd6;
  --accent-soft: #e6efff;
  --border: #c8d8f3;
  --shadow: 0 18px 40px rgba(13, 39, 86, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, #d9e7ff 0%, transparent 45%),
    radial-gradient(circle at bottom right, #f3f8ff 0%, transparent 50%),
    var(--bg);
}

.app {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 20px 56px;
  display: grid;
  gap: 24px;
}

.app__header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
}

.eyebrow {
  margin: 0 0 8px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--muted);
}

h1 {
  margin: 0;
  font-size: 32px;
}

h2 {
  margin: 0 0 16px;
  font-size: 22px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 22px;
  box-shadow: var(--shadow);
}

.hidden {
  display: none;
}

.grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.span-2 {
  grid-column: span 2;
}

label {
  display: grid;
  gap: 6px;
  font-size: 14px;
}

input,
select,
textarea {
  width: 100%;
  padding: 10px 12px;
  font-size: 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #f5f8ff;
  color: var(--ink);
}

.inline-input {
  width: 100%;
  padding: 6px 8px;
  font-size: 13px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #f7faff;
  color: var(--ink);
}

textarea {
  resize: vertical;
}

.btn {
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 14px;
  cursor: pointer;
}

.btn.primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  box-shadow: 0 10px 18px rgba(30, 107, 255, 0.2);
}

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

.btn.ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--ink);
}

.hint {
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
}

.table__wrap {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th,
td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

.table__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.token-cell {
  max-width: 240px;
  word-break: break-all;
  font-family: "Courier New", monospace;
}

.status {
  display: inline-flex;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  font-size: 12px;
  color: var(--muted);
}

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

.tag {
  display: inline-flex;
  padding: 4px 10px;
  border-radius: 999px;
  background: #edf2ff;
  font-size: 12px;
}

.tag-on {
  background: #e7f7ee;
  color: #1a7f37;
}

.tag-off {
  background: #fde8e8;
  color: #b42318;
}

.inline-input {
  background: #ffffff;
  border: 1px solid #d7e4fb;
}

.inline-input:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 2px rgba(30, 107, 255, 0.15);
}

.captcha-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.captcha-row img {
  width: 120px;
  height: 44px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f5f8ff;
}

@media (max-width: 720px) {
  .app__header {
    align-items: flex-start;
  }

  .span-2 {
    grid-column: span 1;
  }
}

@media (max-width: 600px) {
  body {
    background:
      radial-gradient(circle at top left, #d9e7ff 0%, transparent 55%),
      radial-gradient(circle at bottom right, #f3f8ff 0%, transparent 60%),
      var(--bg);
  }

  .app {
    padding: 20px 14px 40px;
    gap: 18px;
  }

  h1 {
    font-size: 26px;
  }

  h2 {
    font-size: 18px;
  }

  input,
  select,
  textarea {
    font-size: 16px;
  }

  .btn {
    width: 100%;
  }

  .captcha-row {
    flex-direction: column;
    align-items: stretch;
  }

  .captcha-row img {
    width: 100%;
    height: 52px;
  }

  .table__wrap {
    overflow-x: visible;
  }

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

  thead {
    display: none;
  }

  tr {
    border: 1px solid #d8e6ff;
    border-radius: 16px;
    padding: 12px;
    margin-bottom: 12px;
    background: linear-gradient(180deg, #ffffff 0%, #f7faff 100%);
    box-shadow: 0 12px 24px rgba(16, 53, 120, 0.08);
  }

  td {
    border: 0;
    padding: 6px 0;
    display: grid;
    grid-template-columns: 80px 1fr;
    gap: 12px;
    align-items: center;
  }

  td::before {
    color: var(--muted);
    font-weight: 600;
  }

  td:nth-child(1)::before { content: "ID"; }
  td:nth-child(2)::before { content: "Token"; }
  td:nth-child(3)::before { content: "限额"; }
  td:nth-child(4)::before { content: "已用"; }
  td:nth-child(5)::before { content: "平台"; }
  td:nth-child(6)::before { content: "过期"; }
  td:nth-child(7)::before { content: "备注"; }
  td:nth-child(8)::before { content: "状态"; }
  td:nth-child(9)::before { content: "操作"; }

  .actions {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .actions .btn {
    flex: 1 1 calc(50% - 6px);
    min-width: 110px;
  }
}
