:root {
  --bg: #eef4f9;
  --panel: rgba(255, 255, 255, 0.96);
  --line: #d9e5f0;
  --text: #18212f;
  --muted: #64748b;
  --brand: #1e3a5f;
  --brand-light: #4e7ea9;
  --accent: #ef7c36;
  --success: #0f766e;
  --danger: #b91c1c;
  --shadow: 0 18px 45px rgba(17, 24, 39, 0.08);
  --radius: 24px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(76, 137, 182, 0.18), transparent 26%),
    radial-gradient(circle at top right, rgba(239, 124, 54, 0.12), transparent 18%),
    linear-gradient(180deg, #edf4fa 0%, #f6f8fb 50%, #eef4f9 100%);
  font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
}

a {
  color: inherit;
}

button,
input,
textarea,
select {
  font: inherit;
}

.hidden {
  display: none !important;
}

.shell {
  min-height: 100vh;
  padding: 28px 28px 12px;
}

.site-footer {
  display: flex;
  justify-content: center;
  padding: 0 28px 28px;
}

.beian-link {
  color: var(--muted);
  font-size: 13px;
  text-decoration: none;
}

.beian-link:hover {
  color: var(--brand);
  text-decoration: underline;
}

.login-view {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 56px);
}

.login-card {
  width: min(1080px, 100%);
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 24px;
}

.hero-panel,
.panel,
.modal-card {
  background: var(--panel);
  border: 1px solid rgba(217, 229, 240, 0.9);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.hero-panel {
  padding: 42px;
  min-height: 420px;
  background:
    linear-gradient(140deg, rgba(30, 58, 95, 0.96), rgba(44, 93, 135, 0.94)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0));
  color: #fff;
}

.hero-panel h1,
.app-header h1 {
  margin: 0;
  font-size: 40px;
  letter-spacing: 0.02em;
}

.eyebrow {
  margin: 0 0 14px;
  color: rgba(255, 255, 255, 0.74);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 700;
}

.hero-desc {
  margin: 14px 0 0;
  color: rgba(255, 255, 255, 0.82);
  line-height: 1.8;
  max-width: 520px;
}

.login-panel {
  padding: 34px 30px;
}

.login-panel h2,
.panel-header h2 {
  margin: 0;
  font-size: 26px;
}

.panel-desc,
.panel-meta,
.consume-summary {
  color: var(--muted);
}

.panel-desc {
  margin: 10px 0 0;
  line-height: 1.7;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 20px;
}

.field span {
  font-size: 14px;
  font-weight: 700;
  color: #334155;
}

.field-hint {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  border: 1px solid var(--line);
  background: #f8fbfd;
  border-radius: 16px;
  padding: 14px 16px;
  color: var(--text);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: rgba(76, 137, 182, 0.8);
  box-shadow: 0 0 0 4px rgba(76, 137, 182, 0.14);
}

.field.compact {
  margin-top: 0;
}

.field-group {
  display: flex;
  gap: 16px;
}

.field-group .field {
  flex: 1;
}

.field-group .field.flex-2 {
  flex: 2;
}

.btn {
  border: none;
  border-radius: 16px;
  padding: 13px 18px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.2s ease, background 0.2s ease;
}

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

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.btn-block {
  width: 100%;
  margin-top: 26px;
}

.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--accent), #ff9b54);
}

.btn-secondary {
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-light));
}

.btn-ghost {
  color: var(--brand);
  background: #edf4fb;
}

.app-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 24px;
  padding: 30px 34px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(30, 58, 95, 0.96), rgba(44, 93, 135, 0.93));
  color: #fff;
  box-shadow: var(--shadow);
}

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

.admin-badge {
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
  white-space: nowrap;
}

.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  gap: 20px;
  padding: 24px;
  margin-bottom: 24px;
}

.toolbar-left {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 14px;
  flex: 0 0 auto;
  min-width: auto;
}

.toolbar .field.compact {
  width: auto;
}

.toolbar-buttons,
.toolbar-right {
  display: flex;
  gap: 12px;
  flex-shrink: 0;
}

.toolbar-buttons {
  align-self: flex-start;
  margin-top: 2px;
  flex-wrap: wrap;
}

.search-plate-row {
  display: flex;
  gap: 12px;
  align-items: stretch;
  width: 330px;
  max-width: 330px;
}

.search-province {
  width: 52px !important;
  min-width: 52px !important;
  max-width: 52px !important;
  height: 52px;
  flex: 0 0 52px;
  font-weight: 800;
  text-align: center;
  padding: 0 6px !important;
  border-radius: 16px !important;
  appearance: none;
  background-position: right 8px center;
}

#searchInput {
  flex: 0 0 266px;
  width: 266px;
  min-width: 266px;
  max-width: 266px;
  height: 52px;
  border-radius: 18px;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(420px, 1.1fr) minmax(360px, 0.9fr);
  gap: 24px;
}

.list-panel,
.detail-panel {
  padding: 24px;
  min-height: 620px;
}

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

.member-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.member-item,
.detail-card,
.record-item {
  border: 1px solid rgba(217, 229, 240, 0.95);
  border-radius: 20px;
  background: #fbfdff;
}

.member-item {
  padding: 18px;
}

.member-row,
.record-row,
.detail-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.member-title,
.detail-plate {
  font-size: 24px;
  font-weight: 800;
}

.meta-line {
  margin-top: 10px;
  color: #475569;
  line-height: 1.7;
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.tag.success {
  color: var(--success);
  background: #ecfdf5;
}

.tag.warn {
  color: #c2410c;
  background: #fff7ed;
}

.item-actions,
.detail-actions,
.pagination,
.modal-actions {
  display: flex;
  gap: 12px;
}

.item-actions {
  margin-top: 16px;
  flex-wrap: wrap;
}

.item-actions .btn,
.detail-actions .btn,
.pagination .btn,
.modal-actions .btn {
  padding: 10px 14px;
  border-radius: 14px;
}

.empty-state {
  padding: 50px 20px;
  text-align: center;
  color: #94a3b8;
}

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

.detail-card {
  padding: 20px;
  margin-bottom: 16px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 18px;
}

.stat-box {
  background: #f4f8fc;
  border-radius: 18px;
  padding: 16px;
}

.stat-label {
  color: var(--muted);
  font-size: 13px;
}

.stat-value {
  margin-top: 10px;
  font-size: 28px;
  font-weight: 800;
}

.detail-meta {
  margin-top: 18px;
  color: #475569;
  line-height: 1.8;
}

.detail-actions {
  margin-top: 20px;
  flex-wrap: wrap;
}

.record-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.record-item {
  padding: 16px;
}

.record-type {
  color: var(--accent);
  font-weight: 800;
}

.record-body {
  margin-top: 12px;
  color: #475569;
  line-height: 1.7;
}

.modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 40;
}

.modal-mask {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(5px);
}

.modal-card {
  position: relative;
  width: min(680px, 100%);
  padding: 24px;
  z-index: 1;
}

.modal-card.small {
  width: min(520px, 100%);
}

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

.modal-header h3 {
  margin: 0;
  font-size: 24px;
}

.modal-body {
  margin-top: 18px;
}

.icon-btn {
  border: none;
  background: #edf4fb;
  color: var(--brand);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  font-size: 24px;
  cursor: pointer;
}

.toast {
  position: fixed;
  top: 28px;
  right: 28px;
  padding: 14px 18px;
  border-radius: 16px;
  color: #fff;
  background: rgba(24, 33, 47, 0.88);
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-10px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 100;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast.success {
  background: rgba(15, 118, 110, 0.92);
}

.toast.error {
  background: rgba(185, 28, 28, 0.92);
}

@media (max-width: 1100px) {
  .login-card,
  .content-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .shell {
    padding: 16px;
  }

  .app-header,
  .toolbar,
  .toolbar-left,
  .field-group,
  .detail-top,
  .member-row,
  .record-row {
    flex-direction: column;
    align-items: stretch;
  }

  .header-actions,
  .toolbar-buttons,
  .toolbar-right,
  .pagination,
  .detail-actions,
  .item-actions,
  .modal-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .stats {
    grid-template-columns: 1fr;
  }

  .hero-panel,
  .login-panel,
  .list-panel,
  .detail-panel,
  .toolbar,
  .modal-card {
    padding: 20px;
  }
}
