:root {
  --ink: #172033;
  --muted: #6f6680;
  --soft: #f7f1ff;
  --panel: rgba(255, 251, 255, 0.86);
  --line: rgba(124, 58, 237, 0.16);
  --accent: #7c3aed;
  --accent-soft: #ede3ff;
  --violet-deep: #4c1d95;
  --rose: #c084fc;
  --shadow: 0 24px 70px rgba(76, 29, 149, 0.16);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow: hidden;
  color: var(--ink);
  font-family: "HarmonyOS Sans SC", "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
  background:
    radial-gradient(circle at 8% 8%, rgba(196, 181, 253, 0.7), transparent 28rem),
    radial-gradient(circle at 88% 4%, rgba(216, 180, 254, 0.5), transparent 26rem),
    radial-gradient(circle at 72% 92%, rgba(233, 213, 255, 0.7), transparent 24rem),
    linear-gradient(135deg, #fbf7ff 0%, #f0e7ff 48%, #fff7fb 100%);
}

button,
input {
  font: inherit;
}

.shell {
  display: grid;
  grid-template-columns: minmax(340px, 400px) 1fr;
  gap: 20px;
  height: 100vh;
  padding: 20px;
}

.sidebar,
.detail {
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.sidebar {
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 40px);
  border-radius: 28px;
  overflow: hidden;
}

.mobile-detail-overlay,
.mobile-detail-bar {
  display: none;
}

.mobile-detail-drawer {
  display: contents;
}

.brand,
.search-panel {
  padding: 22px;
}

.brand {
  padding-bottom: 18px;
  background:
    linear-gradient(135deg, rgba(124, 58, 237, 0.16), transparent 58%),
    linear-gradient(160deg, rgba(233, 213, 255, 0.72), rgba(255, 255, 255, 0.34));
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.18em;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.18;
}

h1 {
  font-size: clamp(30px, 4vw, 42px);
  letter-spacing: -0.03em;
}

.brand p:last-child,
.empty-state p,
.search-note {
  color: var(--muted);
}

.search-panel {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.search-panel label {
  display: block;
  margin-bottom: 10px;
  font-weight: 700;
}

#searchInput {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 16px;
  outline: none;
  background: rgba(255, 255, 255, 0.94);
  color: var(--ink);
}

#searchInput:focus {
  border-color: rgba(124, 58, 237, 0.72);
  box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.14);
}

.search-note {
  margin: 10px 0 0;
  font-size: 13px;
}

.customer-list {
  display: grid;
  gap: 8px;
  padding: 14px 12px 16px;
  overflow: auto;
}

.customer-card {
  width: 100%;
  border: 1px solid transparent;
  border-radius: 18px;
  padding: 14px;
  text-align: left;
  color: inherit;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.86), rgba(250, 245, 255, 0.78));
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.customer-card:hover,
.customer-card.is-active {
  transform: translateY(-2px);
  border-color: rgba(124, 58, 237, 0.34);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(237, 227, 255, 0.86));
  box-shadow: 0 14px 30px rgba(124, 58, 237, 0.13);
}

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

.card-name {
  font-size: 17px;
  font-weight: 800;
}

.card-id {
  color: var(--violet-deep);
  font-size: 12px;
  font-weight: 800;
}

.card-meta {
  display: grid;
  gap: 4px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}

.detail {
  position: relative;
  min-width: 0;
  border-radius: 30px;
  overflow-y: auto;
}

.empty-state,
.profile-detail {
  max-width: 1040px;
  margin: 0 auto;
  padding: clamp(28px, 4vw, 52px);
}

.empty-state {
  display: grid;
  min-height: calc(100vh - 40px);
  align-content: center;
}

.empty-state h2 {
  max-width: 640px;
  font-size: clamp(34px, 5vw, 60px);
  letter-spacing: -0.04em;
}

.profile-hero {
  border-bottom: 1px solid var(--line);
  padding-bottom: 24px;
  margin-bottom: 24px;
}

.profile-hero h2 {
  font-size: clamp(36px, 5vw, 64px);
  letter-spacing: -0.05em;
}

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

.info-item {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 16px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.88), rgba(250, 245, 255, 0.78));
}

.info-item span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 6px;
}

.info-item strong {
  word-break: break-word;
}

.markdown {
  display: grid;
  gap: 14px;
  font-size: 16px;
  line-height: 1.75;
}

.markdown h1 {
  display: none;
}

.markdown h2 {
  margin-top: 18px;
  color: var(--ink);
  font-size: 24px;
}

.markdown h3 {
  margin-top: 12px;
  border-left: 4px solid var(--accent);
  padding-left: 12px;
  color: var(--accent);
  font-size: 19px;
}

.markdown p,
.markdown ul {
  margin: 0;
}

.markdown ul {
  padding-left: 1.2em;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px 18px 14px 36px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.76), rgba(250, 245, 255, 0.78));
}

.markdown li {
  margin: 8px 0;
}

.no-results {
  padding: 20px;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 920px) {
  body {
    overflow: auto;
  }

  .shell {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 100vh;
    padding: 12px;
  }

  .sidebar {
    max-height: none;
    border-radius: 18px;
  }

  .detail {
    overflow: visible;
    border-radius: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
  }

  .brand {
    display: none;
  }

  .mobile-detail-overlay {
    position: fixed;
    inset: 0;
    z-index: 39;
    background: rgba(23, 32, 51, 0.34);
  }

  .mobile-detail-drawer {
    position: fixed;
    right: 12px;
    bottom: 12px;
    left: 12px;
    z-index: 40;
    height: min(78vh, 920px);
    border: 1px solid var(--line);
    border-radius: 22px;
    background: rgba(255, 251, 255, 0.98);
    box-shadow: var(--shadow);
    overflow: hidden;
  }

  .mobile-detail-bar {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 251, 255, 0.96);
    backdrop-filter: blur(18px);
  }

  .mobile-detail-close {
    flex: 0 0 auto;
    border: 1px solid rgba(124, 58, 237, 0.24);
    border-radius: 999px;
    padding: 8px 12px;
    color: var(--violet-deep);
    background: rgba(255, 255, 255, 0.84);
    font-size: 13px;
    font-weight: 800;
  }

  .mobile-detail-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 16px;
  }

  .detail[data-mobile-open='true'] .mobile-detail-overlay,
  .detail[data-mobile-open='true'] .mobile-detail-drawer {
    display: block;
  }

  .detail[data-mobile-open='true'] .profile-detail,
  .detail[data-mobile-open='true'] .empty-state {
    display: block;
    max-width: none;
    height: calc(100% - 61px);
    margin: 0;
    padding: 18px;
    overflow-y: auto;
  }

  .customer-list {
    max-height: none;
    overflow: visible;
    padding-top: 12px;
  }

  .brand,
  .search-panel,
  .empty-state,
  .profile-detail {
    padding: 18px;
  }

  h1 {
    font-size: 28px;
  }

  .empty-state {
    min-height: auto;
  }

  .empty-state h2,
  .profile-hero h2 {
    font-size: 32px;
  }

  .profile-hero {
    padding-bottom: 18px;
    margin-bottom: 18px;
  }

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