:root {
  --page-bg: #0a0a08;
  --card-bg: #11140e;
  --card-bg-2: #141811;
  --line: #2b3027;
  --line-light: #353a31;
  --text: #eeeade;
  --muted: #a19d92;
  --gold: #d0a94f;
  --gold-border: #725d27;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
}

body {
  margin: 0;
  background: var(--page-bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
}

.page {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: max(16px, env(safe-area-inset-top)) 12px 42px;
}

.top-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.stat-card {
  min-height: 118px;
  padding: 28px 30px;
  overflow: hidden;
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.015);
}

.stat-card.active {
  border-color: rgba(132, 105, 41, 0.75);
  box-shadow: inset 0 1px 0 rgba(255, 214, 115, 0.08);
}

.stat-card p {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.stat-card strong {
  display: block;
  color: #f2efe5;
  font-size: 36px;
  line-height: 1.05;
  font-weight: 900;
  letter-spacing: 0.015em;
  white-space: nowrap;
}

.panel {
  margin-top: 78px;
  padding: 30px 30px 24px;
  background: var(--card-bg);
  border: 1px solid var(--line-light);
  border-radius: 22px;
}

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 28px;
}

.panel-header h1 {
  margin: 0 0 8px;
  color: #f4f1e9;
  font-size: 28px;
  line-height: 1.15;
  font-weight: 900;
}

.panel-header p {
  margin: 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.45;
  font-weight: 500;
}

.badge {
  flex: 0 0 auto;
  padding: 9px 16px;
  border-radius: 6px;
  border: 1px solid var(--gold-border);
  background: rgba(140, 109, 36, 0.22);
  color: var(--gold);
  font-size: 17px;
  font-weight: 800;
  line-height: 1;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #10130e;
  scrollbar-width: thin;
  scrollbar-color: #494a43 transparent;
}

.table-wrap::-webkit-scrollbar {
  height: 6px;
}

.table-wrap::-webkit-scrollbar-thumb {
  background: #494a43;
  border-radius: 999px;
}

.table-wrap::-webkit-scrollbar-track {
  background: transparent;
}

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

th,
td {
  height: 52px;
  padding: 0 16px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: #e8e4d9;
  font-size: 16px;
  line-height: 1;
  vertical-align: middle;
  white-space: nowrap;
}

th {
  height: 56px;
  background: var(--card-bg-2);
  color: #bdb7a9;
  font-weight: 900;
  text-align: center;
}

td {
  font-weight: 600;
}

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

th:last-child,
td:last-child {
  border-right: 0;
}

.model-col {
  width: 250px;
  text-align: left;
}

td:nth-child(2),
th:nth-child(2) {
  width: 150px;
  text-align: left;
}

td:nth-child(3),
th:nth-child(3),
td:nth-child(4),
th:nth-child(4),
td:nth-child(5),
th:nth-child(5) {
  text-align: right;
}

.loading,
.empty {
  height: 96px;
  color: var(--muted);
  text-align: center !important;
}

@media (max-width: 700px) {
  .page {
    padding-left: 14px;
    padding-right: 14px;
  }

  .top-grid {
    gap: 14px;
  }

  .stat-card {
    min-height: 106px;
    padding: 24px 22px;
    border-radius: 20px;
  }

  .stat-card p {
    font-size: 16px;
  }

  .stat-card strong {
    font-size: 27px;
  }

  .panel {
    margin-top: 70px;
    padding: 26px 22px 20px;
    border-radius: 22px;
  }

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

  .panel-header p {
    font-size: 16px;
  }

  .badge {
    font-size: 15px;
    padding: 8px 12px;
  }

  th,
  td {
    height: 58px;
    font-size: 18px;
  }
}

@media (max-width: 430px) {
  .top-grid {
    grid-template-columns: 1fr 1fr;
  }

  .stat-card strong {
    font-size: 24px;
  }

  .panel-header {
    align-items: flex-start;
  }
}

.filter-bar {
  display: flex;
  justify-content: flex-end;
  margin: -8px 0 18px;
}

.date-filter {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 17px;
  font-weight: 800;
}

.date-filter input {
  width: 178px;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--gold-border);
  border-radius: 8px;
  outline: none;
  background: rgba(140, 109, 36, 0.16);
  color: var(--text);
  font-size: 16px;
  font-weight: 700;
  color-scheme: dark;
}

.date-filter input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(208, 169, 79, 0.12);
}

.btn-detail {
  padding: 8px 16px;
  border: 1px solid var(--gold-border);
  border-radius: 6px;
  background: rgba(140, 109, 36, 0.22);
  color: var(--gold);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-detail:hover {
  background: rgba(140, 109, 36, 0.35);
  border-color: var(--gold);
}

.btn-back {
  padding: 9px 20px;
  border: 1px solid var(--line-light);
  border-radius: 6px;
  background: var(--card-bg-2);
  color: var(--text);
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-back:hover {
  border-color: var(--muted);
  background: rgba(255, 255, 255, 0.05);
}

.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
}

.login-card {
  width: 100%;
  max-width: 420px;
  padding: 48px 40px;
  background: var(--card-bg);
  border: 1px solid var(--line-light);
  border-radius: 22px;
}

.login-header {
  text-align: center;
  margin-bottom: 40px;
}

.login-header h1 {
  margin: 0 0 12px;
  font-size: 32px;
  font-weight: 900;
  color: #f4f1e9;
}

.login-header p {
  margin: 0;
  font-size: 18px;
  color: var(--muted);
}

.form-group {
  margin-bottom: 24px;
}

.form-group label {
  display: block;
  margin-bottom: 10px;
  font-size: 17px;
  font-weight: 700;
  color: var(--muted);
}

.form-group input {
  width: 100%;
  height: 52px;
  padding: 0 16px;
  border: 1px solid var(--gold-border);
  border-radius: 10px;
  background: rgba(140, 109, 36, 0.16);
  color: var(--text);
  font-size: 18px;
  font-weight: 600;
  outline: none;
  color-scheme: dark;
  transition: all 0.2s;
}

.form-group input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(208, 169, 79, 0.12);
}

.form-group input::placeholder {
  color: #6b665c;
}

.error-message {
  height: 24px;
  margin-bottom: 16px;
  font-size: 15px;
  color: #e57373;
  text-align: center;
}

.btn-login {
  width: 100%;
  height: 56px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, #d0a94f 0%, #a68a3d 100%);
  color: #1a1810;
  font-size: 20px;
  font-weight: 900;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-login:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(208, 169, 79, 0.3);
}

.btn-login:active {
  transform: translateY(0);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn {
  padding: 9px 20px;
  border-radius: 8px;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid transparent;
}

.btn-primary {
  background: linear-gradient(135deg, #d0a94f 0%, #a68a3d 100%);
  color: #1a1810;
  border-color: transparent;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(208, 169, 79, 0.3);
}

.btn-secondary {
  background: var(--card-bg-2);
  color: var(--text);
  border-color: var(--line-light);
}

.btn-secondary:hover {
  border-color: var(--muted);
}

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(4px);
}

.modal {
  width: 100%;
  max-width: 460px;
  margin: 20px;
  background: var(--card-bg);
  border: 1px solid var(--line-light);
  border-radius: 16px;
  overflow: hidden;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 28px;
  border-bottom: 1px solid var(--line);
}

.modal-header h2 {
  margin: 0;
  font-size: 24px;
  font-weight: 900;
  color: #f4f1e9;
}

.close-btn {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font-size: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.close-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}

.modal-body {
  padding: 28px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 20px 28px;
  border-top: 1px solid var(--line);
}

.form-group select {
  width: 100%;
  height: 52px;
  padding: 0 16px;
  border: 1px solid var(--gold-border);
  border-radius: 10px;
  background: rgba(140, 109, 36, 0.16);
  color: var(--text);
  font-size: 18px;
  font-weight: 600;
  outline: none;
  cursor: pointer;
  transition: all 0.2s;
}

.form-group select:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(208, 169, 79, 0.12);
}

.form-group select option {
  background: var(--card-bg);
  color: var(--text);
}
