:root {
  color-scheme: dark;
  --navy-950: #07162c;
  --navy-900: #0b1d38;
  --navy-850: #11294c;
  --blue-500: #398eff;
  --blue-400: #59a9ff;
  --cyan-300: #98ddff;
  --text: #f7fbff;
  --muted: #aabbd2;
  --danger: #ff918b;
}

* {
  box-sizing: border-box;
}

html {
  background: #07162c;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100svh;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  background: #07162c;
}

button,
input,
select {
  font: inherit;
}

button,
select,
label,
.privacy-trigger {
  -webkit-tap-highlight-color: transparent;
}

.page-shell {
  position: relative;
  width: min(100%, 500px);
  min-height: 100svh;
  margin: 0 auto;
  overflow: hidden;
  isolation: isolate;
  background: var(--navy-950);
  box-shadow: 0 0 80px rgba(0, 0, 0, 0.38);
}

.background-art {
  position: absolute;
  z-index: -3;
  inset: 0 0 auto;
  width: 100%;
  aspect-ratio: 1500 / 844;
  background-image: url("/byd-song-ultra-wide.jpg");
  background-repeat: no-repeat;
  background-size: 100% auto;
  background-position: top center;
}

.shade {
  position: absolute;
  z-index: -2;
  inset: 0 0 auto;
  height: clamp(225px, 65vw, 325px);
  pointer-events: none;
  background: linear-gradient(180deg, transparent 0 75%, rgba(7, 22, 44, 0.14) 88%, #07162c 100%);
}

.form-stage {
  min-height: 0;
  padding: clamp(213px, 57vw, 285px) 12px calc(6px + env(safe-area-inset-bottom));
}

.form-card {
  position: relative;
  padding: 16px 17px 14px;
  border: 1px solid rgba(166, 215, 255, 0.24);
  border-radius: 20px;
  background: linear-gradient(145deg, rgba(27, 58, 98, 0.98), rgba(7, 23, 45, 0.99));
  box-shadow:
    0 24px 58px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.form-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 34px;
  width: 82px;
  height: 2px;
  background: linear-gradient(90deg, #fff, var(--cyan-300), transparent);
  box-shadow: 0 0 18px rgba(152, 221, 255, 0.85);
}

.form-heading {
  margin-bottom: 12px;
}

.eyebrow {
  display: block;
  margin-bottom: 2px;
  color: var(--cyan-300);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.24em;
}

.form-heading h1 {
  margin: 0;
  font-size: 20px;
  font-weight: 650;
  letter-spacing: 0.04em;
}

.form-heading p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.field {
  margin-bottom: 8px;
}

.field label {
  display: block;
  margin: 0 0 3px 2px;
  color: #eaf4ff;
  font-size: 11px;
  font-weight: 560;
}

.required {
  color: var(--cyan-300);
}

.control {
  position: relative;
}

.control input,
.control select {
  width: 100%;
  height: 42px;
  margin: 0;
  padding: 0 42px 0 13px;
  border: 1px solid rgba(184, 216, 247, 0.24);
  border-radius: 10px;
  outline: none;
  color: var(--text);
  font-size: 14px;
  background: rgba(4, 19, 39, 0.52);
  transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
  appearance: none;
  -webkit-appearance: none;
}

.control input::placeholder {
  color: #8094ae;
}

.control input:focus,
.control select:focus {
  border-color: rgba(116, 193, 255, 0.88);
  background: rgba(7, 28, 56, 0.77);
  box-shadow: 0 0 0 3px rgba(58, 142, 255, 0.15), 0 0 22px rgba(58, 142, 255, 0.09);
}

.control select:invalid {
  color: #8094ae;
}

.control select option {
  color: #13263e;
  background: #fff;
}

.field-icon,
.select-arrow {
  position: absolute;
  top: 50%;
  right: 13px;
  display: grid;
  width: 19px;
  height: 19px;
  place-items: center;
  color: #86b7e6;
  pointer-events: none;
  transform: translateY(-50%);
}

.field-icon svg,
.select-arrow svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.65;
}

.field.has-error input,
.field.has-error select {
  border-color: rgba(255, 145, 139, 0.8);
  box-shadow: 0 0 0 3px rgba(255, 120, 114, 0.1);
}

.error {
  min-height: 0;
  margin: 0;
  color: var(--danger);
  font-size: 11px;
  line-height: 1.55;
}

.error:not(:empty) {
  min-height: 17px;
  margin: 5px 2px -7px;
}

.consent {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin: 1px 2px 0;
  color: #b8c7d9;
  font-size: 10px;
  line-height: 1.45;
  cursor: pointer;
}

.consent input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.checkmark {
  display: grid;
  flex: 0 0 15px;
  width: 15px;
  height: 15px;
  margin-top: 1px;
  place-items: center;
  border: 1px solid rgba(190, 215, 240, 0.55);
  border-radius: 5px;
  background: rgba(3, 18, 37, 0.55);
  transition: 160ms ease;
}

.checkmark svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: transparent;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.consent input:checked + .checkmark {
  border-color: var(--blue-400);
  background: var(--blue-500);
}

.consent input:checked + .checkmark svg {
  stroke: #fff;
}

.consent input:focus-visible + .checkmark {
  outline: 2px solid var(--cyan-300);
  outline-offset: 2px;
}

.privacy-trigger {
  padding: 0;
  border: 0;
  color: #82c4ff;
  font: inherit;
  background: transparent;
  text-decoration: none;
  cursor: pointer;
}

.consent-error:not(:empty) {
  margin: 5px 2px 0 27px;
}

.submit-button {
  position: relative;
  display: flex;
  width: 100%;
  height: 45px;
  margin-top: 11px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  overflow: hidden;
  border: 1px solid rgba(169, 218, 255, 0.48);
  border-radius: 11px;
  color: #fff;
  font-size: 15px;
  font-weight: 650;
  letter-spacing: 0.08em;
  background: linear-gradient(180deg, #58a7ff, #2369d7);
  box-shadow: 0 12px 25px rgba(20, 93, 203, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.36);
  cursor: pointer;
  transition: transform 120ms ease, filter 180ms ease;
}

.submit-button::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 -40%;
  width: 40%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.28), transparent);
  transform: skewX(-18deg);
  animation: button-glint 4.6s ease-in-out infinite;
}

.submit-button:active {
  transform: scale(0.985);
}

.submit-button:disabled {
  filter: grayscale(0.25) brightness(0.8);
  cursor: wait;
}

.submit-button svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.fine-print {
  margin: 6px 2px 0;
  color: #71859f;
  font-size: 9px;
  line-height: 1.5;
  text-align: center;
}

.brand-footer {
  display: flex;
  margin: 10px 0 0;
  align-items: center;
  justify-content: center;
  gap: 13px;
  color: #54708f;
  font-size: 10px;
  letter-spacing: 0.22em;
  text-align: center;
}

.brand-footer a {
  padding-left: 13px;
  border-left: 1px solid rgba(99, 130, 165, 0.42);
  color: #7899bc;
  letter-spacing: 0.08em;
  text-decoration: none;
}

/* 数据后台 */
.admin-page {
  min-height: 100svh;
  padding: 36px clamp(20px, 5vw, 72px) 28px;
  color: #17243a;
  background:
    radial-gradient(circle at 10% 0%, rgba(55, 137, 236, 0.13), transparent 28%),
    linear-gradient(180deg, #f5f8fc, #edf3f9);
}

.admin-header {
  display: flex;
  max-width: 1180px;
  margin: 0 auto 24px;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

.admin-kicker {
  margin: 0 0 5px;
  color: #2b77df !important;
  font-size: 10px !important;
  font-weight: 750;
  letter-spacing: 0.24em;
}

.admin-header h1 {
  margin: 0;
  color: #10213b;
  font-size: clamp(28px, 4vw, 40px);
  letter-spacing: -0.03em;
}

.admin-header p {
  margin: 7px 0 0;
  color: #708099;
  font-size: 13px;
}

.admin-actions {
  display: flex;
  gap: 10px;
}

.admin-actions a,
.admin-actions button,
.export-button,
.error-state button {
  display: inline-flex;
  height: 42px;
  padding: 0 17px;
  align-items: center;
  justify-content: center;
  border: 1px solid #d4dfeb;
  border-radius: 11px;
  color: #2c405d;
  font-size: 13px;
  font-weight: 600;
  background: #fff;
  box-shadow: 0 5px 16px rgba(31, 58, 91, 0.05);
  text-decoration: none;
  cursor: pointer;
}

.admin-actions button {
  border-color: #246fd2;
  color: #fff;
  background: linear-gradient(180deg, #428ff1, #286fce);
}

.stat-grid {
  display: grid;
  max-width: 1180px;
  margin: 0 auto 18px;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.stat-grid article {
  position: relative;
  overflow: hidden;
  padding: 19px 21px;
  border: 1px solid #dfe8f2;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 10px 30px rgba(28, 56, 89, 0.05);
}

.stat-grid article::after {
  content: "";
  position: absolute;
  top: -35px;
  right: -20px;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: rgba(62, 145, 239, 0.08);
}

.stat-grid span,
.stat-grid small {
  display: block;
  color: #75849a;
  font-size: 12px;
}

.stat-grid strong {
  display: block;
  margin: 7px 0 2px;
  color: #132743;
  font-size: 30px;
}

.data-panel {
  max-width: 1180px;
  min-height: 360px;
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid #dae5f0;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 18px 50px rgba(25, 53, 86, 0.07);
}

.toolbar {
  display: grid;
  padding: 16px;
  grid-template-columns: minmax(220px, 1fr) 170px auto;
  gap: 10px;
  border-bottom: 1px solid #e6edf5;
  background: #fbfdff;
}

.search-box {
  position: relative;
}

.search-box svg {
  position: absolute;
  top: 50%;
  left: 14px;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: #7e8fa5;
  stroke-linecap: round;
  stroke-width: 1.7;
  transform: translateY(-50%);
}

.search-box input,
.toolbar select {
  width: 100%;
  height: 42px;
  border: 1px solid #d8e2ed;
  border-radius: 10px;
  outline: none;
  color: #203651;
  background: #fff;
}

.search-box input {
  padding: 0 14px 0 42px;
}

.toolbar select {
  padding: 0 12px;
}

.search-box input:focus,
.toolbar select:focus {
  border-color: #609ce8;
  box-shadow: 0 0 0 3px rgba(59, 134, 228, 0.12);
}

.export-button {
  border-color: #d1dfed;
}

.export-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.table-wrap {
  overflow-x: auto;
}

.table-wrap table {
  width: 100%;
  border-collapse: collapse;
}

.table-wrap th,
.table-wrap td {
  padding: 15px 18px;
  border-bottom: 1px solid #edf2f7;
  text-align: left;
  white-space: nowrap;
}

.table-wrap th {
  color: #718198;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.04em;
  background: #f8fafc;
}

.table-wrap td {
  color: #42536a;
  font-size: 13px;
}

.table-wrap td:first-child {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #1c304c;
}

.avatar {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  color: #246ed0;
  font-weight: 700;
  background: #e8f2ff;
}

.model-tag {
  display: inline-flex;
  padding: 5px 9px;
  border-radius: 999px;
  color: #2468bd;
  font-size: 12px;
  font-weight: 650;
  background: #eaf3ff;
}

.admin-empty {
  display: flex;
  min-height: 290px;
  padding: 34px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #8190a4;
  text-align: center;
}

.admin-empty strong {
  color: #344963;
  font-size: 18px;
}

.admin-empty p {
  margin: 8px 0 0;
  font-size: 13px;
}

.loading-ring {
  width: 28px;
  height: 28px;
  margin-bottom: 10px;
  border: 3px solid #dce9f7;
  border-top-color: #3d86df;
  border-radius: 50%;
  animation: spin 800ms linear infinite;
}

.error-state button {
  margin-top: 16px;
}

.admin-footnote {
  max-width: 1180px;
  margin: 14px auto 0;
  color: #8290a4;
  font-size: 11px;
  text-align: center;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.toast {
  position: fixed;
  z-index: 20;
  top: calc(16px + env(safe-area-inset-top));
  left: 50%;
  max-width: calc(100% - 36px);
  padding: 10px 18px;
  border: 1px solid rgba(255, 183, 178, 0.42);
  border-radius: 999px;
  color: #fff;
  font-size: 13px;
  white-space: nowrap;
  background: rgba(113, 31, 40, 0.92);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.26);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -15px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.modal[hidden] {
  display: none;
}

.modal {
  position: fixed;
  z-index: 30;
  inset: 0;
  display: grid;
  padding: 22px;
  place-items: center;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(1, 9, 21, 0.76);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.success-card,
.privacy-card {
  position: relative;
  width: min(100%, 360px);
  border: 1px solid rgba(164, 211, 255, 0.24);
  border-radius: 24px;
  color: var(--text);
  background: linear-gradient(150deg, #183f6e, #081d38 65%);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.5);
  animation: modal-in 220ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.success-card {
  padding: 32px 25px 24px;
  text-align: center;
}

.success-mark {
  display: grid;
  width: 62px;
  height: 62px;
  margin: 0 auto 17px;
  place-items: center;
  border: 1px solid rgba(140, 215, 255, 0.45);
  border-radius: 50%;
  color: #b7e7ff;
  background: rgba(63, 153, 238, 0.16);
  box-shadow: 0 0 28px rgba(70, 169, 255, 0.2);
}

.success-mark svg {
  width: 36px;
  height: 36px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.5;
}

.success-card h2,
.privacy-card h2 {
  margin: 0;
  font-size: 22px;
}

.success-card p {
  margin: 10px 0 24px;
  color: #a8b9ce;
  font-size: 13px;
  line-height: 1.7;
}

.success-card button,
.modal-confirm {
  width: 100%;
  height: 46px;
  border: 0;
  border-radius: 12px;
  color: #fff;
  font-weight: 600;
  background: linear-gradient(180deg, #4da2ff, #236edb);
  cursor: pointer;
}

.privacy-card {
  padding: 22px;
}

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

.privacy-card h2 {
  font-size: 19px;
}

.icon-button {
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: #bfd0e2;
  font-size: 26px;
  line-height: 1;
  background: rgba(255, 255, 255, 0.08);
  cursor: pointer;
}

.privacy-copy {
  margin: 22px 0;
  color: #acbdd0;
  font-size: 13px;
  line-height: 1.8;
}

.privacy-copy p {
  margin: 0 0 10px;
}

@keyframes modal-in {
  from { opacity: 0; transform: translateY(10px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes button-glint {
  0%, 48% { transform: translateX(0) skewX(-18deg); }
  72%, 100% { transform: translateX(390%) skewX(-18deg); }
}

@media (max-width: 380px) {
  .form-stage {
    padding-right: 13px;
    padding-left: 13px;
  }

  .form-card {
    padding-right: 14px;
    padding-left: 14px;
  }
}

@media (max-width: 600px) and (min-height: 700px) {
  .form-stage {
    padding-top: clamp(250px, 65vw, 325px);
    padding-right: 10px;
    padding-left: 10px;
  }

  .form-card {
    padding: 18px 17px 16px;
    border-radius: 22px;
  }

  .form-heading {
    margin-bottom: 18px;
  }

  .eyebrow {
    margin-bottom: 3px;
    font-size: 10px;
  }

  .form-heading h1 {
    font-size: 22px;
  }

  .form-heading p {
    margin-top: 4px;
    font-size: 13px;
  }

  .field {
    margin-bottom: 12px;
  }

  .field label {
    margin-bottom: 5px;
    font-size: 12px;
  }

  .control input,
  .control select {
    height: 48px;
    padding-right: 48px;
    padding-left: 15px;
    font-size: 15px;
  }

  .field-icon,
  .select-arrow {
    right: 15px;
    width: 22px;
    height: 22px;
  }

  .field-icon svg,
  .select-arrow svg {
    width: 20px;
    height: 20px;
  }

  .consent {
    gap: 7px;
    margin-top: 2px;
    font-size: 11px;
  }

  .checkmark {
    flex-basis: 17px;
    width: 17px;
    height: 17px;
  }

  .submit-button {
    height: 50px;
    margin-top: 15px;
    font-size: 16px;
  }

  .fine-print {
    margin-top: 10px;
    font-size: 10px;
  }

  .brand-footer {
    margin-top: 18px;
    font-size: 10px;
  }
}

@media (max-width: 720px) {
  .admin-page {
    padding: 23px 14px 20px;
  }

  .admin-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 16px;
  }

  .admin-actions {
    width: 100%;
  }

  .admin-actions a,
  .admin-actions button {
    flex: 1;
  }

  .stat-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }

  .stat-grid article {
    padding: 14px 12px;
  }

  .stat-grid strong {
    font-size: 25px;
  }

  .stat-grid small {
    display: none;
  }

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

  .search-box {
    grid-column: 1 / -1;
  }

  .table-wrap {
    padding: 8px 12px 14px;
  }

  .table-wrap thead {
    display: none;
  }

  .table-wrap table,
  .table-wrap tbody,
  .table-wrap tr,
  .table-wrap td {
    display: block;
    width: 100%;
  }

  .table-wrap tr {
    display: grid;
    margin: 8px 0;
    padding: 13px 14px;
    grid-template-columns: 1fr 1fr;
    gap: 10px 15px;
    border: 1px solid #e3ebf3;
    border-radius: 13px;
    background: #fbfdff;
  }

  .table-wrap td,
  .table-wrap td:first-child {
    display: flex;
    padding: 0;
    align-items: center;
    border: 0;
    white-space: normal;
  }

  .table-wrap td::before {
    content: attr(data-label);
    margin-right: 7px;
    color: #8a98aa;
    font-size: 10px;
  }

  .table-wrap td:first-child::before {
    display: none;
  }

  .avatar {
    width: 30px;
    height: 30px;
  }
}

@media (min-width: 501px) {
  body {
    background:
      radial-gradient(circle at 50% 5%, #173b68, transparent 38%),
      #061326;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
