:root {
  color-scheme: light;
  --bg: #f5f7fa;
  --panel: #ffffff;
  --panel-soft: #f0f4f8;
  --text: #14202b;
  --muted: #627284;
  --line: #dce3ea;
  --brand: #0f766e;
  --brand-dark: #0b5f59;
  --blue: #2563eb;
  --red: #b42318;
  --gold: #a15c07;
  --green: #157347;
  --shadow: 0 18px 48px rgba(20, 32, 43, 0.12);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    linear-gradient(180deg, rgba(15, 118, 110, 0.08), rgba(245, 247, 250, 0) 360px),
    var(--bg);
  color: var(--text);
}

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

button {
  border: 0;
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

.shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 22px 0 48px;
}

.site-header {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 18px;
  align-items: center;
  margin-bottom: 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--blue));
  box-shadow: 0 12px 26px rgba(15, 118, 110, 0.22);
  flex: 0 0 auto;
}

.brand h1 {
  margin: 0;
  font-size: clamp(22px, 3vw, 34px);
  line-height: 1.12;
  letter-spacing: 0;
}

.brand p {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.55;
  font-size: 14px;
}

.nav-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(21, 115, 71, 0.22);
  background: rgba(21, 115, 71, 0.08);
  color: var(--green);
  font-weight: 800;
  white-space: nowrap;
  font-size: 14px;
}

.toolbar {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 12px;
  align-items: center;
  margin-bottom: 18px;
}

.search-box {
  position: relative;
}

.search-box i {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}

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

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  border-radius: var(--radius);
  min-height: 44px;
  padding: 10px 12px;
  outline: none;
  transition: border-color .16s ease, box-shadow .16s ease;
}

textarea {
  resize: vertical;
  min-height: 96px;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.12);
}

.filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.chip {
  min-height: 36px;
  border-radius: 999px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  background: #edf2f7;
  color: #334155;
  font-weight: 800;
  font-size: 13px;
  transition: .16s ease;
}

.chip.active,
.chip:hover {
  background: #e8f4f2;
  color: var(--brand);
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.stat {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  min-height: 86px;
  display: grid;
  gap: 6px;
}

.stat b {
  font-size: 22px;
  letter-spacing: 0;
}

.stat span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.account-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.account-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 12px 34px rgba(20, 32, 43, 0.08);
  overflow: hidden;
  display: grid;
  min-height: 100%;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}

.account-card:hover {
  transform: translateY(-3px);
  border-color: rgba(15, 118, 110, 0.32);
  box-shadow: 0 18px 42px rgba(20, 32, 43, 0.14);
}

.card-visual {
  min-height: 150px;
  padding: 18px;
  background:
    linear-gradient(135deg, rgba(15, 118, 110, .16), rgba(37, 99, 235, .08)),
    #edf3f8;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.logo-tile {
  width: 72px;
  height: 72px;
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 900;
  font-size: 24px;
  letter-spacing: 0;
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.18);
  flex: 0 0 auto;
}

.service-thumb {
  width: 110px;
  height: 82px;
  border-radius: var(--radius);
  object-fit: cover;
  background: #fff;
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.16);
  flex: 0 0 auto;
}

.logo-tile.image-logo {
  overflow: hidden;
  background: #fff !important;
}

.logo-tile.image-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.visual-copy {
  text-align: right;
  color: #2c3b4e;
  display: grid;
  gap: 8px;
  justify-items: end;
}

.visual-copy span {
  max-width: 175px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--muted);
}

.badge {
  min-height: 28px;
  border-radius: 999px;
  padding: 0 9px;
  display: inline-flex;
  align-items: center;
  background: #fff;
  color: var(--brand);
  font-size: 12px;
  font-weight: 900;
  font-style: normal;
  border: 1px solid rgba(15, 118, 110, .18);
}

.card-body {
  padding: 16px;
  display: grid;
  gap: 12px;
}

.card-title {
  display: grid;
  gap: 6px;
}

.card-title h2 {
  margin: 0;
  font-size: 20px;
  line-height: 1.28;
  letter-spacing: 0;
}

.card-title p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.meta-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.meta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 0 9px;
  border-radius: 999px;
  background: var(--panel-soft);
  color: #324153;
  font-weight: 800;
  font-size: 12px;
}

.price-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.price {
  color: var(--red);
  font-size: 28px;
  font-weight: 900;
  letter-spacing: 0;
  display: flex;
  align-items: baseline;
  gap: 2px;
}

.price small {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.btn {
  min-height: 42px;
  border-radius: var(--radius);
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 900;
  transition: .16s ease;
}

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

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

.btn-primary {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 12px 24px rgba(15, 118, 110, .22);
}

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

.btn-secondary {
  background: #e8eef5;
  color: #26364a;
}

.btn-ghost {
  background: transparent;
  color: var(--brand);
  padding-inline: 8px;
}

.empty-state {
  display: none;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  text-align: center;
  color: var(--muted);
  line-height: 1.6;
}

.empty-state.show {
  display: block;
}

.notice-band {
  margin-top: 18px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: var(--radius);
  color: #6b3a04;
  padding: 14px 16px;
  display: flex;
  gap: 10px;
  line-height: 1.6;
  font-size: 14px;
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(350px, .78fr);
  gap: 18px;
  align-items: start;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

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

.panel-head h2 {
  margin: 0;
  font-size: 18px;
  letter-spacing: 0;
}

.panel-head span {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.panel-body {
  padding: 20px;
}

.detail-hero {
  min-height: 240px;
  padding: 22px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 18px;
  align-items: center;
  background:
    linear-gradient(135deg, rgba(15, 118, 110, .18), rgba(37, 99, 235, .09)),
    #edf3f8;
}

.detail-hero .logo-tile {
  width: 104px;
  height: 104px;
  font-size: 34px;
}

.detail-copy {
  display: grid;
  gap: 10px;
}

.detail-copy h2 {
  margin: 0;
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.12;
  letter-spacing: 0;
}

.detail-copy p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
  max-width: 650px;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.info-item {
  background: var(--panel-soft);
  border-radius: var(--radius);
  padding: 12px;
  min-height: 84px;
  display: grid;
  gap: 5px;
  align-content: start;
}

.info-item b {
  font-size: 14px;
}

.info-item span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.flow-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}

.flow-list li {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 10px;
  align-items: start;
}

.flow-num {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: #e8f4f2;
  color: var(--brand);
  font-weight: 900;
}

.flow-list b {
  display: block;
  margin-bottom: 3px;
}

.flow-list span {
  color: var(--muted);
  line-height: 1.55;
  font-size: 14px;
}

.order-box {
  display: grid;
  gap: 14px;
}

.order-price {
  display: grid;
  gap: 4px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.order-price span {
  color: var(--muted);
  font-size: 13px;
}

.field {
  display: grid;
  gap: 8px;
}

label,
.field-title {
  font-weight: 800;
  color: #273646;
  font-size: 14px;
}

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

.option {
  position: relative;
}

.option input {
  position: absolute;
  inset: 0;
  opacity: 0;
}

.option span {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 8px 10px;
  color: #3a4a5b;
  font-weight: 800;
  font-size: 13px;
  transition: .16s ease;
}

.option input:checked + span {
  border-color: var(--brand);
  background: #e8f4f2;
  color: var(--brand);
  box-shadow: inset 0 0 0 1px var(--brand);
}

.phone-row,
.code-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.list-note {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.list-note li {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.list-note i {
  color: var(--brand);
  margin-top: 2px;
  flex: 0 0 auto;
}

.alert {
  border-radius: var(--radius);
  padding: 12px;
  line-height: 1.55;
  font-size: 13px;
}

.alert.safe {
  background: #eef9f4;
  border: 1px solid #bfe8d2;
  color: #14532d;
}

.alert.warn {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #6b3a04;
}

.chat-button {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 40;
  border-radius: 999px;
  min-height: 52px;
  padding: 0 18px;
}

.chat-panel {
  position: fixed;
  right: 22px;
  bottom: 86px;
  width: min(360px, calc(100vw - 32px));
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  z-index: 45;
  display: none;
  overflow: hidden;
}

.chat-panel.open {
  display: block;
}

.chat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px;
  background: var(--brand);
  color: #fff;
}

.chat-head strong {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius);
  background: #eef3f7;
  color: #273646;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
}

.chat-body {
  padding: 14px;
  display: grid;
  gap: 10px;
  background: #f7fafc;
}

.message {
  max-width: 88%;
  padding: 10px 12px;
  border-radius: var(--radius);
  line-height: 1.5;
  font-size: 14px;
}

.message.service {
  background: #fff;
  border: 1px solid var(--line);
}

.quick-replies {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.quick-replies button {
  min-height: 34px;
  padding: 0 10px;
  border-radius: 999px;
  background: #e8f4f2;
  color: var(--brand);
  font-weight: 800;
  font-size: 13px;
}

.chat-input {
  padding: 12px;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  background: #fff;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.52);
  z-index: 70;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

.modal-backdrop.open {
  display: flex;
}

.modal {
  width: min(460px, 100%);
  background: #fff;
  border-radius: var(--radius);
  box-shadow: 0 30px 80px rgba(15, 23, 42, .32);
  overflow: hidden;
}

.modal-head {
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.modal-head h3 {
  margin: 0;
  font-size: 18px;
  letter-spacing: 0;
}

.modal-body {
  padding: 20px;
  display: grid;
  gap: 14px;
}

.modal-foot {
  padding: 0 20px 20px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%) translateY(16px);
  background: #14212f;
  color: #fff;
  padding: 12px 16px;
  border-radius: 999px;
  box-shadow: 0 16px 36px rgba(15, 23, 42, .24);
  z-index: 90;
  opacity: 0;
  pointer-events: none;
  transition: .2s ease;
  font-weight: 800;
  font-size: 14px;
}

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

.admin-shell {
  display: grid;
  gap: 16px;
}

.login-panel {
  max-width: 420px;
  margin: 54px auto 0;
}

.admin-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.tab-btn {
  min-height: 38px;
  padding: 0 12px;
  border-radius: 999px;
  background: #e8eef5;
  color: #26364a;
  font-weight: 900;
}

.tab-btn.active {
  background: #e8f4f2;
  color: var(--brand);
}

.admin-layout {
  display: grid;
  grid-template-columns: minmax(270px, .75fr) minmax(0, 1.25fr);
  gap: 16px;
  align-items: start;
}

.admin-list {
  display: grid;
  gap: 8px;
  max-height: 650px;
  overflow: auto;
}

.admin-list button {
  width: 100%;
  min-height: 48px;
  text-align: left;
  border-radius: var(--radius);
  background: #f4f7fa;
  color: var(--text);
  padding: 10px 12px;
  display: grid;
  gap: 3px;
}

.admin-list button.active {
  background: #e8f4f2;
  color: var(--brand);
  box-shadow: inset 0 0 0 1px var(--brand);
}

.admin-list small {
  color: var(--muted);
}

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

.admin-form .full {
  grid-column: 1 / -1;
}

.admin-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.image-preview {
  width: 132px;
  height: 92px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  object-fit: cover;
  background: var(--panel-soft);
}

.orders-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

.orders-table th,
.orders-table td {
  border-bottom: 1px solid var(--line);
  padding: 10px 8px;
  text-align: left;
  vertical-align: top;
  font-size: 13px;
  line-height: 1.5;
}

.orders-table th {
  color: #273646;
  background: #f7fafc;
  position: sticky;
  top: 0;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.hidden {
  display: none !important;
}

@media (max-width: 980px) {
  .account-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

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

  .order-panel {
    order: -1;
  }
}

@media (max-width: 720px) {
  .shell {
    width: min(100% - 22px, 1180px);
    padding-top: 16px;
  }

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

  .nav-actions,
  .filters {
    justify-content: flex-start;
  }

  .stats-row,
  .account-grid,
  .info-grid,
  .select-grid,
  .admin-form,
  .phone-row,
  .code-row,
  .chat-input {
    grid-template-columns: 1fr;
  }

  .detail-hero {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .card-visual {
    min-height: 132px;
  }

  .panel-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .panel-head span {
    white-space: normal;
  }

  .chat-button {
    right: 14px;
    bottom: 14px;
  }

  .chat-panel {
    right: 11px;
    bottom: 76px;
  }
}
