:root {
  color-scheme: light;
  --blue: #2376c9;
  --blue-soft: #eef5ff;
  --red: #b93a4a;
  --text: #121826;
  --muted: #a8adb7;
  --line: #eceff3;
  --bg: #f5f6f8;
  --panel: #ffffff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.phone-shell {
  width: min(100%, 460px);
  min-height: 100vh;
  margin: 0 auto;
  background: var(--panel);
}

.wechat-bar {
  position: sticky;
  top: 0;
  z-index: 4;
  display: grid;
  grid-template-columns: 52px 1fr 64px;
  align-items: center;
  min-height: 74px;
  padding: 12px 12px 8px;
  background: #f3f3f4;
  border-bottom: 1px solid #e6e6e8;
  text-align: center;
}

.wechat-bar strong {
  display: block;
  font-size: 19px;
  line-height: 1.3;
}

.wechat-bar span {
  display: block;
  color: #6f737b;
  font-size: 13px;
}

.icon-button {
  width: 40px;
  height: 40px;
  border: 0;
  background: transparent;
  color: #111;
  font-size: 38px;
  line-height: 1;
}

.admin-link {
  color: #111;
  font-size: 14px;
  text-decoration: none;
}

.report-form {
  padding: 0 0 28px;
}

.report-form h1 {
  margin: 0;
  padding: 10px 26px 22px;
  color: var(--red);
  font-size: 25px;
  font-weight: 800;
}

.data-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 42px;
  margin: 0 0 20px 26px;
  padding: 0 18px;
  border: 0;
  border-radius: 2px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 17px;
}

.user-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
}

.form-section,
.detail-section {
  border-top: 1px solid var(--line);
}

.field-row {
  display: grid;
  grid-template-columns: 116px 1fr;
  gap: 14px;
  min-height: 72px;
  padding: 18px 18px;
  border-bottom: 1px solid var(--line);
  align-items: start;
}

.field-row > span,
.section-title > span {
  color: #111827;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.5;
}

.field-row b,
.section-title b {
  color: #e23d51;
  margin-right: 1px;
}

input,
textarea,
select {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: #242936;
  line-height: 1.5;
}

input,
select {
  min-height: 34px;
}

textarea {
  resize: vertical;
}

select {
  appearance: none;
}

::placeholder {
  color: #b6bac3;
}

.selectable {
  position: relative;
  grid-template-columns: 116px 1fr 34px;
}

.selectable::after {
  content: "›";
  grid-column: 3;
  grid-row: 1;
  justify-self: end;
  align-self: center;
  color: #404852;
  font-size: 40px;
  line-height: 1;
}

.selectable select {
  grid-column: 2;
  grid-row: 1;
}

.muted-row > span {
  color: #717783;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 18px 14px;
}

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

.square-button {
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--blue);
  font-size: 28px;
  line-height: 1;
}

.light-button {
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--blue);
  font-size: 16px;
}

.items {
  padding: 0 16px 18px;
}

.item-card {
  overflow: hidden;
  border: 1px solid #e6e9ee;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 1px 7px rgba(15, 23, 42, 0.05);
}

.item-card + .item-card {
  margin-top: 14px;
}

.item-card.is-collapsed .item-fields {
  display: none;
}

.item-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 16px 8px;
}

.item-index {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #58a8f4;
  color: #fff;
  font-size: 22px;
  font-weight: 800;
}

.item-head-actions {
  display: flex;
  margin-left: auto;
  gap: 16px;
}

.item-head-actions button {
  border: 0;
  background: transparent;
  color: var(--blue);
  font-size: 16px;
}

.item-field {
  display: grid;
  grid-template-columns: 118px 1fr;
  min-height: 68px;
  border-top: 1px solid var(--line);
  align-items: center;
}

.item-field span {
  padding-left: 18px;
  color: #111827;
  font-size: 18px;
  font-weight: 800;
}

.item-field b {
  color: #e23d51;
}

.item-field input,
.item-field select {
  padding: 0 16px;
  font-size: 18px;
}

.add-record {
  width: 100%;
  height: 72px;
  border: 0;
  border-top: 1px solid var(--line);
  background: #fff;
  color: var(--blue);
  font-size: 22px;
}

.item-helper {
  margin: 0;
  padding: 12px 18px;
  border-top: 1px solid var(--line);
  background: #f7f9fc;
  color: #667085;
  font-size: 14px;
}

.form-error {
  min-height: 24px;
  margin: 14px 18px 8px;
  color: #d53343;
  font-size: 14px;
}

.submit-button {
  width: calc(100% - 36px);
  height: 52px;
  margin: 0 18px;
  border: 0;
  border-radius: 8px;
  background: var(--blue);
  color: #fff;
  font-size: 18px;
  font-weight: 700;
}

.submit-button:disabled,
button:disabled {
  opacity: 0.62;
  cursor: not-allowed;
}

.success-sheet {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: end center;
  padding: 18px;
  background: rgba(15, 23, 42, 0.28);
}

.success-sheet[hidden] {
  display: none;
}

.success-sheet > div {
  width: min(100%, 424px);
  padding: 22px;
  border-radius: 16px;
  background: #fff;
}

.success-sheet strong {
  font-size: 20px;
}

.success-sheet a,
.success-sheet button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  margin-right: 10px;
  padding: 0 14px;
  border: 0;
  border-radius: 8px;
  background: var(--blue);
  color: #fff;
  text-decoration: none;
}

.success-sheet button {
  background: #eef2f7;
  color: #263142;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  z-index: 20;
  width: min(calc(100% - 36px), 360px);
  margin: 0;
  transform: translateX(-50%);
  padding: 12px 16px;
  border-radius: 8px;
  background: rgba(17, 24, 39, 0.92);
  color: #fff;
  font-size: 15px;
  text-align: center;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.22);
}

.toast[hidden] {
  display: none;
}

.admin-body {
  background: #eef1f5;
}

.admin-layout {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0;
}

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

.admin-header p {
  margin: 0 0 4px;
  color: var(--red);
  font-weight: 800;
}

.admin-header h1 {
  margin: 0;
  font-size: 28px;
}

.admin-header a {
  color: var(--blue);
  text-decoration: none;
}

.admin-nav {
  display: flex;
  align-items: center;
  gap: 12px;
}

.admin-nav span {
  color: #667085;
}

.admin-nav button {
  border: 1px solid #d5dbe4;
  border-radius: 6px;
  background: #fff;
  color: #344154;
  padding: 8px 10px;
}

.admin-grid {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 18px;
}

.order-list-panel,
.order-detail {
  min-height: 620px;
  border: 1px solid #e1e5eb;
  border-radius: 8px;
  background: #fff;
}

.panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.panel-title h2 {
  margin: 0;
  font-size: 18px;
}

.panel-title button,
.status-actions button {
  border: 1px solid #d5dbe4;
  border-radius: 6px;
  background: #fff;
  color: #344154;
  padding: 8px 10px;
}

.order-list {
  padding: 10px;
}

.order-filters {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

.order-filters input,
.order-filters select {
  width: 100%;
  min-height: 40px;
  border: 1px solid #d5dbe4;
  border-radius: 6px;
  padding: 0 10px;
  background: #fff;
  color: #263142;
}

.order-filters input[name="keyword"],
.filter-actions {
  grid-column: 1 / -1;
}

.filter-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.filter-actions button {
  min-height: 40px;
  border: 1px solid #d5dbe4;
  border-radius: 6px;
  background: #fff;
  color: #344154;
}

.filter-actions button[type="submit"] {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
}

.order-card {
  width: 100%;
  margin: 0 0 10px;
  padding: 14px;
  border: 1px solid #e3e7ee;
  border-radius: 8px;
  background: #fff;
  text-align: left;
}

.order-card.active {
  border-color: var(--blue);
  background: var(--blue-soft);
}

.order-card strong {
  display: block;
  margin-bottom: 6px;
  font-size: 16px;
}

.order-card span {
  display: block;
  color: #667085;
  font-size: 13px;
  line-height: 1.5;
}

.order-detail {
  padding: 22px;
}

.empty-detail {
  display: grid;
  place-content: center;
  height: 100%;
  color: #667085;
  text-align: center;
}

.detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.detail-header h2 {
  margin: 0 0 8px;
}

.status-badge {
  display: inline-flex;
  padding: 6px 10px;
  border-radius: 999px;
  background: #fff4df;
  color: #986500;
  font-weight: 700;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 20px 0;
}

.detail-cell {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.detail-cell span {
  display: block;
  margin-bottom: 6px;
  color: #667085;
  font-size: 13px;
}

.detail-cell strong {
  white-space: pre-wrap;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
}

.admin-table th,
.admin-table td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.admin-table th {
  color: #667085;
  font-size: 13px;
}

.audit-table td {
  max-width: 260px;
  vertical-align: top;
  word-break: break-word;
}

.order-table tr[data-id] {
  cursor: pointer;
}

.order-table tr[data-id]:hover,
.active-row {
  background: var(--blue-soft);
}

.status-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.user-admin {
  margin-top: 18px;
  border: 1px solid #e1e5eb;
  border-radius: 8px;
  background: #fff;
}

.user-form {
  display: grid;
  grid-template-columns: 1fr 1fr 180px auto;
  gap: 10px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.user-form input,
.user-form select,
.role-select {
  min-height: 42px;
  border: 1px solid #d5dbe4;
  border-radius: 6px;
  padding: 0 12px;
  background: #fff;
}

.user-form button {
  border: 0;
  border-radius: 6px;
  background: var(--blue);
  color: #fff;
  padding: 0 16px;
}

.user-list {
  padding: 0 18px 18px;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 18px;
  background: #eef1f5;
}

.login-card {
  width: min(100%, 420px);
  padding: 28px;
  border: 1px solid #e1e5eb;
  border-radius: 8px;
  background: #fff;
}

.login-card p {
  margin: 0 0 6px;
  color: var(--red);
  font-weight: 800;
}

.login-card h1 {
  margin: 0 0 22px;
}

.login-card label {
  display: block;
  margin-bottom: 14px;
}

.login-card label span {
  display: block;
  margin-bottom: 6px;
  color: #344154;
}

.login-card .field-title-row,
.panel-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.login-card .field-title-row {
  margin-bottom: 6px;
}

.panel-title-row {
  margin-bottom: 16px;
}

.panel-title-row strong {
  color: #121826;
  font-size: 18px;
}

.text-link {
  border: 0;
  background: transparent;
  color: var(--blue);
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}

.login-card input {
  width: 100%;
  min-height: 44px;
  border: 1px solid #d5dbe4;
  border-radius: 6px;
  padding: 0 12px;
}

.avatar-upload input {
  padding: 9px 10px;
}

.avatar-upload small {
  display: block;
  margin-top: 6px;
  color: #667085;
}

.profile-strip {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
}

.avatar-replace {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid #d5dbe4;
  border-radius: 8px;
  background: #fff;
  color: var(--blue);
  font-weight: 700;
  white-space: nowrap;
}

.avatar-replace input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.code-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  margin-bottom: 14px;
}

.code-row button {
  min-width: 108px;
  min-height: 44px;
  border: 1px solid var(--blue);
  border-radius: 6px;
  background: var(--blue);
  color: #fff;
  font-weight: 700;
}

.code-row button:disabled {
  border-color: #d5dbe4;
  background: #eef2f7;
  color: #667085;
}

.invite-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 12px 0;
  padding: 12px;
  border: 1px solid #d5dbe4;
  border-radius: 8px;
  background: #fff;
}

.invite-panel strong,
.invite-panel span {
  display: block;
}

.invite-panel span {
  margin-top: 4px;
  color: #667085;
  font-size: 13px;
}

.invite-link-text {
  display: block;
  max-width: 230px;
  margin-top: 6px;
  color: #667085;
  font-size: 12px;
  cursor: text;
  overflow-wrap: anywhere;
  user-select: text;
}

.invite-panel button {
  min-height: 40px;
  border: 0;
  border-radius: 6px;
  background: var(--blue);
  color: #fff;
  padding: 0 12px;
  white-space: nowrap;
}

.login-card .submit-button {
  width: 100%;
  margin: 0;
}

.auth-tabs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 18px;
}

.auth-tabs button {
  min-height: 38px;
  border: 1px solid #d5dbe4;
  border-radius: 6px;
  background: #fff;
  color: #344154;
}

.auth-tabs button.active {
  border-color: var(--blue);
  background: var(--blue-soft);
  color: var(--blue);
  font-weight: 700;
}


@media (max-width: 760px) {
  .admin-layout {
    width: 100%;
    padding: 16px;
  }

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

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

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

  .admin-nav {
    align-items: flex-end;
    flex-direction: column;
  }

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

  .profile-strip {
    grid-template-columns: 1fr;
  }

  .avatar-replace {
    width: 100%;
  }

  .code-row {
    grid-template-columns: 1fr;
  }

  .invite-panel {
    flex-direction: column;
    align-items: stretch;
  }
}
