/* もしもし 网页拨号：清爽浅色、电话键盘风格。不引入框架。 */
:root {
  --bg: #eef3f8;
  --bg-accent: #d9e8f5;
  --surface: #ffffff;
  --ink: #1a2b3c;
  --muted: #5f7388;
  --line: #d5e0ea;
  --brand: #1f6f8b;
  --brand-soft: #e4f2f7;
  --call: #1f9d6a;
  --call-press: #178556;
  --danger: #d64545;
  --warn: #b8860b;
  --radius: 18px;
  --shadow: 0 10px 30px rgba(31, 61, 90, 0.08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Hiragino Sans", "PingFang SC", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  background:
    radial-gradient(1200px 600px at 10% -10%, var(--bg-accent), transparent 55%),
    radial-gradient(900px 500px at 100% 0%, #e8f6ef, transparent 50%),
    var(--bg);
}

.app {
  max-width: 420px;
  margin: 0 auto;
  padding: 20px 16px 36px;
}

.app-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.header-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.lang-switch {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
  background: var(--surface);
}

.lang-btn {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  padding: 4px 10px;
  cursor: pointer;
  line-height: 1.4;
}

.lang-btn[aria-pressed="true"] {
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 600;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-mark {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 0 6px var(--brand-soft);
}

.app-header h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.status-pill {
  font-size: 12px;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
}

.status-online {
  background: #e8f8ef;
  border-color: #b7e4c7;
  color: #1a7a4c;
}
.status-offline {
  background: #fff1ef;
  border-color: #f0c4be;
  color: #b84337;
}
.status-connecting {
  background: #fff8e8;
  border-color: #ecd9a2;
  color: var(--warn);
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 18px 18px;
  box-shadow: var(--shadow);
}

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

.hint {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.error {
  min-height: 18px;
  margin: 10px 0 0;
  color: var(--danger);
  font-size: 13px;
}

label {
  display: block;
  margin-bottom: 12px;
  font-size: 13px;
  color: var(--muted);
}

input {
  width: 100%;
  margin-top: 6px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f7fafc;
  color: var(--ink);
  font-size: 16px;
  outline: none;
}

input:focus {
  border-color: #9ec5d6;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(31, 111, 139, 0.12);
}

button {
  font: inherit;
  cursor: pointer;
  border: none;
}

.btn-primary,
.btn-call {
  width: 100%;
  padding: 13px 16px;
  border-radius: 14px;
  background: var(--brand);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
}

.btn-primary:active,
.btn-call:active { opacity: 0.92; }

.btn-call {
  margin-top: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--call);
}

.btn-call:active { background: var(--call-press); }

.call-icon {
  width: 14px;
  height: 14px;
  border-radius: 4px 10px 8px 10px;
  background: currentColor;
  transform: rotate(-35deg);
  display: inline-block;
}

.link-btn {
  background: transparent;
  color: var(--muted);
  padding: 4px 2px;
  font-size: 13px;
  text-decoration: underline;
  text-underline-offset: 3px;
  width: auto;
}

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

.tabs {
  display: inline-flex;
  padding: 4px;
  border-radius: 999px;
  background: #edf2f7;
  border: 1px solid var(--line);
}

.tab {
  border: none;
  background: transparent;
  color: var(--muted);
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  width: auto;
}

.tab.active {
  background: var(--surface);
  color: var(--brand);
  box-shadow: 0 1px 4px rgba(31, 61, 90, 0.08);
}

.contacts {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.contact-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #f8fbfd;
}

.contact-btn:active { background: var(--brand-soft); }

.contact-btn .ext {
  min-width: 52px;
  font-size: 18px;
  font-weight: 700;
  color: var(--brand);
  letter-spacing: 0.02em;
}

.contact-btn .label {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.35;
}

.dial-display {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.dial-display input {
  margin-top: 0;
  text-align: center;
  font-size: 28px;
  font-weight: 600;
  letter-spacing: 0.08em;
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 8px 4px;
}

.dial-display input:focus {
  box-shadow: none;
  border: none;
}

.icon-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #edf2f7;
  color: var(--ink);
  font-size: 18px;
  flex-shrink: 0;
}

.keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px 14px;
  max-width: 300px;
  margin: 0 auto;
  padding: 6px 0 4px;
}

.key {
  width: 74px;
  height: 74px;
  margin: 0 auto;
  border-radius: 50%;
  background: #f3f7fb;
  border: 1px solid #e2ebf3;
  color: var(--ink);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.key:active {
  background: var(--brand-soft);
  border-color: #b9d7e4;
}

.key .digit {
  font-size: 26px;
  font-weight: 600;
  line-height: 1;
}

.key .letters {
  font-size: 9px;
  letter-spacing: 0.12em;
  color: var(--muted);
  text-transform: uppercase;
  min-height: 10px;
}

.call-panel {
  text-align: center;
  padding-top: 28px;
  padding-bottom: 24px;
}

.call-avatar {
  width: 72px;
  height: 72px;
  margin: 0 auto 14px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 30%, #ffffff 0 18%, transparent 19%),
    linear-gradient(145deg, #7ec8b3, var(--brand));
}

.call-status {
  margin-bottom: 22px;
  font-size: 15px;
}

.call-controls {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.btn-soft,
.btn-hangup {
  width: auto;
  min-width: 120px;
  padding: 14px 18px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
}

.btn-soft {
  background: #edf2f7;
  color: var(--ink);
}

.btn-hangup {
  background: var(--danger);
  color: #fff;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 60vh;
  overflow-y: auto;
}

.history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #f8fbfd;
  cursor: pointer;
  text-align: left;
  width: 100%;
}

.history-item:active { background: var(--brand-soft); }

.history-main { min-width: 0; }
.history-peer {
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
}
.history-meta {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}
.history-dir {
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  color: var(--brand);
}
.history-dir.missed { color: var(--danger); }

.tabs {
  flex-wrap: wrap;
  max-width: 100%;
}
.tab { padding: 8px 12px; font-size: 13px; }

.hidden { display: none !important; }

@media (max-width: 380px) {
  .key { width: 66px; height: 66px; }
  .key .digit { font-size: 24px; }
  .dial-display input { font-size: 24px; }
}
