:root {
  --bg: #eef3ff;
  --panel: rgba(255, 255, 255, .82);
  --panel-strong: rgba(255, 255, 255, .94);
  --line: rgba(99, 122, 178, .16);
  --text: #101b3f;
  --muted: #68759b;
  --blue: #2f72ff;
  --purple: #7057ff;
  --green: #16b982;
  --red: #ff5b6e;
  --shadow: 0 18px 55px rgba(70, 91, 150, .14);
  --radius: 22px;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 8% 2%, rgba(112, 87, 255, .23), transparent 32%),
    radial-gradient(circle at 93% 6%, rgba(48, 137, 255, .22), transparent 34%),
    linear-gradient(135deg, #f8fbff, var(--bg));
}

body {
  display: flex;
  padding: 14px;
}

.app {
  width: 100%;
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-columns: 330px minmax(0, 1fr);
  gap: 14px;
}

.panel {
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.left {
  padding: 16px;
  gap: 12px;
}

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

.logo {
  width: 54px;
  height: 54px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #fff, #edf3ff);
  border: 1px solid var(--line);
  box-shadow: 0 12px 30px rgba(62, 92, 180, .14);
  color: #315bd8;
  font-size: 16px;
  font-weight: 950;
  letter-spacing: 0;
}

.brand h1 {
  margin: 0;
  font-size: 22px;
  letter-spacing: 0;
}

.brand p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.mini-card {
  flex: 0 0 auto;
  border-radius: 18px;
  background: var(--panel-strong);
  border: 1px solid var(--line);
  padding: 13px;
}

.title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 9px;
}

.title-row strong {
  font-size: 15px;
}

.tag {
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 12px;
  color: #2550b9;
  background: rgba(47, 114, 255, .1);
  border: 1px solid rgba(47, 114, 255, .15);
  white-space: nowrap;
}

.tag.ok {
  color: #168461;
  background: rgba(22, 185, 130, .11);
  border-color: rgba(22, 185, 130, .2);
}

.tag.warn {
  color: #c14656;
  background: rgba(255, 91, 110, .1);
  border-color: rgba(255, 91, 110, .16);
}

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

input {
  width: 100%;
  height: 42px;
  border: 1px solid rgba(90, 111, 160, .18);
  border-radius: 14px;
  padding: 0 12px;
  outline: none;
  background: #fff;
  color: var(--text);
  font-size: 14px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .8);
}

input:focus {
  border-color: rgba(47, 114, 255, .55);
  box-shadow: 0 0 0 4px rgba(47, 114, 255, .08);
}

button {
  height: 42px;
  border: 0;
  border-radius: 14px;
  padding: 0 15px;
  color: #fff;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  background: linear-gradient(135deg, var(--blue), var(--purple));
  box-shadow: 0 12px 25px rgba(58, 91, 255, .24);
}

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

.ghost {
  color: #2e55c7;
  background: rgba(47, 114, 255, .1);
  box-shadow: none;
  border: 1px solid rgba(47, 114, 255, .12);
}

.number-box {
  border-radius: 18px;
  padding: 14px;
  background: linear-gradient(135deg, rgba(47, 114, 255, .1), rgba(112, 87, 255, .12));
  border: 1px solid rgba(47, 114, 255, .14);
}

.number-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
}

.receive-actions {
  margin-top: 12px;
  display: grid;
  gap: 8px;
}

.receive-actions button {
  width: 100%;
}

.phone {
  min-width: 0;
  font-size: 23px;
  font-weight: 900;
  letter-spacing: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sub {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.session-meta {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.session-meta span {
  color: var(--muted);
  font-size: 12px;
}

.session-meta b {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  flex: 0 0 auto;
}

.stat {
  border-radius: 16px;
  background: rgba(255, 255, 255, .78);
  border: 1px solid var(--line);
  padding: 12px;
}

.stat b {
  display: block;
  font-size: 21px;
  margin-bottom: 3px;
}

.notice {
  margin-top: auto;
  border-radius: 16px;
  padding: 12px;
  background: rgba(22, 185, 130, .09);
  border: 1px solid rgba(22, 185, 130, .17);
  color: #287c62;
  font-size: 12px;
  line-height: 1.55;
  flex: 0 0 auto;
}

.notice.error {
  color: #ba4050;
  background: rgba(255, 91, 110, .09);
  border-color: rgba(255, 91, 110, .2);
}

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

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

.panel-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.messages {
  min-height: 0;
  overflow: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scrollbar-width: thin;
}

.msg {
  border-radius: 18px;
  background: rgba(255, 255, 255, .86);
  border: 1px solid var(--line);
  padding: 12px;
  cursor: pointer;
  transition: transform .15s, border-color .15s, background .15s;
}

.msg:hover,
.msg.active {
  transform: translateY(-1px);
  border-color: rgba(47, 114, 255, .35);
  background: #fff;
}

.msg-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 7px;
}

.sender {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 900;
  font-size: 14px;
}

.time {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.preview {
  color: #435079;
  font-size: 13px;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.code-pill {
  margin-top: 9px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding: 6px 10px;
  border-radius: 999px;
  font-weight: 900;
  color: #1f55c9;
  background: rgba(47, 114, 255, .1);
  border: 1px solid rgba(47, 114, 255, .12);
  font-size: 13px;
}

.detail-body {
  min-height: 0;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: 12px;
  padding: 16px;
}

.hero-code {
  border-radius: 22px;
  padding: 22px;
  background:
    radial-gradient(circle at 95% 10%, rgba(255, 255, 255, .75), transparent 26%),
    linear-gradient(135deg, #2f72ff, #7057ff);
  color: #fff;
  box-shadow: 0 22px 50px rgba(65, 90, 255, .25);
}

.hero-code .label {
  opacity: .82;
  font-size: 13px;
  font-weight: 700;
}

.hero-code .big {
  margin-top: 8px;
  font-size: clamp(42px, 5.6vw, 76px);
  font-weight: 950;
  letter-spacing: 6px;
  line-height: 1;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hero-code .actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
  flex-wrap: wrap;
}

.hero-code .actions button {
  background: rgba(255, 255, 255, .2);
  border: 1px solid rgba(255, 255, 255, .24);
  box-shadow: none;
}

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

.info {
  border-radius: 16px;
  background: rgba(255, 255, 255, .86);
  border: 1px solid var(--line);
  padding: 12px;
  min-width: 0;
}

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

.info b {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
}

.sms-full {
  min-height: 0;
  overflow: auto;
  border-radius: 20px;
  background: rgba(255, 255, 255, .86);
  border: 1px solid var(--line);
  padding: 16px;
  line-height: 1.7;
  color: #354061;
  font-size: 15px;
}

.empty {
  height: 100%;
  display: grid;
  place-items: center;
  color: var(--muted);
  text-align: center;
}

.empty p {
  margin: 0;
}

.empty-icon {
  font-size: 32px;
  font-weight: 950;
  opacity: .48;
  margin-bottom: 10px;
  letter-spacing: 0;
}

@media (max-width: 1180px) {
  body {
    padding: 10px;
  }

  .app {
    grid-template-columns: 300px minmax(0, 1fr);
    gap: 10px;
  }

  .left,
  .detail-body {
    padding: 12px;
  }

  .panel-head {
    padding: 12px;
  }

  .brand h1 {
    font-size: 19px;
  }

  .phone {
    font-size: 20px;
  }
}

@media (max-height: 760px) {
  body {
    padding: 8px;
  }

  .app {
    gap: 8px;
  }

  .left {
    gap: 8px;
    padding: 10px;
  }

  .mini-card,
  .stat,
  .notice {
    padding: 9px;
  }

  .logo {
    width: 46px;
    height: 46px;
    border-radius: 15px;
    font-size: 14px;
  }

  .brand h1 {
    font-size: 18px;
  }

  .brand p,
  .sub,
  .tag,
  .time {
    font-size: 11px;
  }

  input,
  button {
    height: 36px;
    border-radius: 12px;
  }

  .receive-actions {
    margin-top: 8px;
  }

  .panel-head {
    padding: 10px;
  }

  .panel-head h2 {
    font-size: 18px;
  }

  .messages {
    padding: 8px;
    gap: 8px;
  }

  .msg {
    padding: 9px;
    border-radius: 15px;
  }

  .preview {
    -webkit-line-clamp: 1;
  }

  .detail-body {
    padding: 10px;
    gap: 8px;
  }

  .hero-code {
    padding: 16px;
    border-radius: 18px;
  }

  .hero-code .big {
    font-size: clamp(34px, 5vw, 52px);
  }

  .hero-code .actions {
    margin-top: 12px;
  }

  .info {
    padding: 9px;
  }

  .sms-full {
    padding: 12px;
    font-size: 13px;
  }

  .notice {
    display: none;
  }
}

@media (max-width: 960px) {
  body {
    padding: 8px;
  }

  .app {
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 8px;
  }

  .field {
    gap: 6px;
  }

  button {
    padding: 0 12px;
  }
}
