/* WhatsApp Web 风格 */
:root {
  --wa-green: #00a884;
  --wa-green-dark: #017d6b;
  --wa-light: #25d366;
  --bg: #0b141a;
  --card: #ffffff;
  --text: #3b4a54;
  --muted: #667781;
  --border: #d9dbdc;
  --danger: #d64545;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg); color: var(--text); min-height: 100vh;
  display: flex; flex-direction: column; align-items: center;
}
.topband {
  position: absolute; top: 0; left: 0; right: 0; height: 222px;
  background: var(--wa-green); z-index: 0;
}

.card {
  position: relative; z-index: 1;
  margin-top: 60px; width: min(880px, calc(100vw - 40px));
  background: var(--card); border-radius: 10px;
  box-shadow: 0 12px 32px rgba(11, 20, 26, .28);
  display: grid; grid-template-columns: 1fr 1fr; min-height: 480px;
}
.left { padding: 42px 40px; border-right: 1px solid #e9edef; }
.right { padding: 42px 36px; display: flex; align-items: center; justify-content: center; }

.logo { margin-bottom: 18px; }
h1 { font-size: 26px; font-weight: 400; color: #1f2c34; line-height: 1.35; }
.sub { margin-top: 14px; font-size: 14px; line-height: 1.8; color: var(--muted); }

.phone-form { margin-top: 26px; }
.phone-row { display: flex; gap: 10px; }
.phone-row select {
  width: 100px; padding: 11px 8px; font-size: 15px; color: var(--text);
  border: 1px solid var(--border); border-radius: 8px; background: #fff; outline: none;
}
.phone-row select:focus { border-color: var(--wa-green); }
.phone-row input {
  flex: 1; padding: 11px 14px; font-size: 16px; color: var(--text);
  border: 1px solid var(--border); border-radius: 8px; outline: none; letter-spacing: .5px;
}
.phone-row input:focus { border-color: var(--wa-green); }

.btn-primary {
  margin-top: 16px; width: 100%; padding: 12px; font-size: 15px; font-weight: 500;
  color: #fff; background: var(--wa-green); border: none; border-radius: 8px; cursor: pointer;
  transition: background .15s;
}
.btn-primary:hover { background: var(--wa-green-dark); }
.btn-primary:disabled { background: #9ec9bf; cursor: not-allowed; }

.note { margin-top: 22px; font-size: 12px; line-height: 1.9; color: #8696a0; }

/* 右侧面板各状态 */
.panel-inner { text-align: center; width: 100%; }
.idle p { margin-top: 16px; font-size: 14px; color: var(--muted); line-height: 1.8; }

.spinner {
  width: 34px; height: 34px; border: 4px solid #e9edef; border-top-color: var(--wa-green);
  border-radius: 50%; animation: spin .8s linear infinite; margin: 0 auto;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading p { margin-top: 16px; font-size: 14px; color: var(--muted); }

.code-label { font-size: 15px; color: var(--text); margin-bottom: 18px; }
.code-box {
  display: flex; justify-content: center; gap: 14px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 44px; font-weight: 600; letter-spacing: 4px; color: #1f2c34;
}
.code-box .grp {
  background: #f0f2f2; border-radius: 10px; padding: 16px 20px; min-width: 190px;
}
.code-countdown { margin-top: 16px; font-size: 13px; color: var(--muted); }
.code-countdown.over { color: var(--danger); }

.steps { margin: 26px 0 0 4px; text-align: left; list-style: none; }
.steps li {
  display: flex; align-items: flex-start; gap: 12px;
  font-size: 13.5px; color: var(--text); line-height: 1.7; margin-bottom: 14px;
}
.steps .n {
  flex-shrink: 0; width: 22px; height: 22px; border-radius: 50%; background: var(--wa-green);
  color: #fff; font-size: 12px; display: flex; align-items: center; justify-content: center;
  margin-top: 1px;
}

.btn-ghost {
  margin-top: 10px; padding: 9px 22px; font-size: 14px; cursor: pointer;
  background: #fff; color: var(--wa-green-dark); border: 1px solid var(--wa-green);
  border-radius: 8px; transition: background .15s;
}
.btn-ghost:hover { background: #e7f8f3; }

/* 已连接 */
.ok-icon {
  width: 72px; height: 72px; border-radius: 50%; background: var(--wa-light);
  margin: 0 auto; display: flex; align-items: center; justify-content: center;
}
.ok-icon svg { width: 38px; height: 38px; }
.connected h2 { margin-top: 20px; font-size: 22px; font-weight: 500; color: #1f2c34; }
.connected p { margin-top: 10px; font-size: 14px; color: var(--muted); line-height: 1.8; }
.connected .num { font-weight: 600; color: #1f2c34; }

.toast {
  position: fixed; top: 20px; left: 50%; transform: translateX(-50%);
  background: #233138; color: #fff; padding: 10px 20px; border-radius: 8px; font-size: 14px;
  opacity: 0; pointer-events: none; transition: opacity .25s; z-index: 100; max-width: 90vw;
}
.toast.show { opacity: 1; }
.toast.err { background: var(--danger); }

@media (max-width: 760px) {
  .card { grid-template-columns: 1fr; margin-top: 34px; }
  .left { border-right: none; border-bottom: 1px solid #e9edef; padding: 30px 24px; }
  .right { padding: 30px 20px; }
  .code-box { font-size: 32px; }
  .code-box .grp { min-width: 0; padding: 12px 14px; }
}
