/* ============ 电话 APP：仿 iOS 原生电话 ============ */
.tel-app{position:absolute;inset:var(--status-h,51px) 0 0;z-index:17;background:#fff;display:flex;flex-direction:column;min-height:0;color:#000}
.tel-app[hidden]{display:none}
.tel-screen{flex:1;min-height:0;display:flex;flex-direction:column}

/* 顶部导航：白底 + 细分隔线，标题居中 */
.tel-navbar{height:48px;flex:0 0 48px;background:#f9f9f9;border-bottom:.5px solid #d6d6d6;display:flex;align-items:center;justify-content:space-between;padding:0 8px;position:relative}
.tel-title{margin:0;font-size:17px;font-weight:600;letter-spacing:.2px;color:#000;position:absolute;left:50%;transform:translateX(-50%);pointer-events:none}
.tel-back,.tel-add,.tel-done{min-width:44px;height:44px;padding:0 10px;display:grid;place-items:center;background:none;color:#007aff;font-size:16px}
.tel-back svg{width:23px;height:23px;stroke-width:2.2}
.tel-add svg{width:24px;height:24px;stroke-width:2}
.tel-done{font-weight:600}
.tel-back{justify-items:start}
.tel-add{justify-items:end}

/* 四个分页 */
.tel-views{flex:1;min-height:0;position:relative;overflow:hidden}
.tel-view{position:absolute;inset:0;overflow-y:auto;scrollbar-width:none;background:#fff;display:none}
.tel-view::-webkit-scrollbar{display:none}
.tel-view.is-active{display:block}

/* iOS 分组列表 */
.tel-list{padding-top:6px}
.tel-list::-webkit-scrollbar{display:none}
.tel-group-label{padding:18px 16px 6px;font-size:13px;font-weight:400;color:#6d6d72;text-transform:uppercase;letter-spacing:.3px}
.tel-row{display:flex;align-items:center;gap:12px;min-height:54px;margin:0 16px;padding:8px 0;border-bottom:.5px solid #c6c6c8;background:transparent;text-align:left;width:calc(100% - 32px)}
.tel-row:last-child{border-bottom:0}
/* 最近通话：左右滑动删除 */
.tel-swipe{position:relative;overflow:hidden}
.tel-swipe-act{position:absolute;top:0;bottom:0;width:84px;display:flex}
.tel-swipe-act-left{left:0}
.tel-swipe-act-right{right:0}
.tel-swipe-del{width:100%;height:100%;border:0;border-radius:0;background:#ff3b30;color:#fff;font-size:16px;font-weight:500;display:grid;place-items:center}
.tel-swipe-del:active{background:#dc332b}
.tel-swipe-body{position:relative;z-index:1;background:#fff;touch-action:pan-y;transition:transform .22s cubic-bezier(.22,.61,.36,1);will-change:transform}
.tel-swipe.dragging .tel-swipe-body{transition:none}
.tel-swipe:last-child .tel-row{border-bottom:0}
.tel-row-ava{width:40px;height:40px;flex:0 0 40px;border-radius:50%;overflow:hidden;background:#e5e5ea;display:grid;place-items:center;color:#8e8e93;font-size:18px;font-weight:400}
.tel-row-ava img{width:100%;height:100%;object-fit:cover;display:block}
.tel-row-main{flex:1;min-width:0}
.tel-row-name{font-size:16px;color:#000;line-height:1.35;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.tel-row-sub{font-size:12px;color:#8e8e93;margin-top:2px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.tel-row-side{display:flex;flex-direction:row;align-items:center;gap:8px;color:#8e8e93;font-size:12px;flex:0 0 auto}
.tel-rec-meta{display:flex;flex-direction:column;align-items:flex-end;gap:3px;text-align:right}
.tel-rec-time{font-size:12px}
.tel-rec-dur{font-size:11px;color:#8e8e93}
.tel-rec-dur.is-timed{color:#6d6d72}
.tel-rec-total{color:#8e8e93;font-weight:400;font-size:12px}
.tel-info{width:26px;height:26px;display:grid;place-items:center;color:#007aff}
.tel-info svg{width:19px;height:19px;stroke-width:1.8}
.tel-missed{color:#ff3b30;font-weight:600}
.tel-empty{padding:90px 30px;text-align:center;color:#8e8e93;font-size:13px;line-height:2}
.tel-empty b{display:block;color:#3c3c43;font-size:15px;font-weight:600;margin-bottom:4px}
.tel-ava-badge{position:absolute;right:-2px;bottom:-2px;width:18px;height:18px;border-radius:50%;background:#ff3b30;color:#fff;font-size:10px;display:grid;place-items:center;border:2px solid #fff}

/* 底部 Tabbar：仿 iOS 半透明 */
/* 底部导航框加高，预留出全局小黑条(home indicator)的安全区，避免文字被压住 */
.tel-tabbar{height:72px;flex:0 0 72px;display:grid;grid-template-columns:repeat(4,1fr);background:#f8f8f8f2;border-top:.5px solid #c6c6c8;padding-bottom:calc(16px + env(safe-area-inset-bottom))}
.tel-tab{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;color:#8e8e93;font-size:10px;padding:4px 0 2px}
.tel-tab.is-active{color:#007aff}
.tel-tabico{display:grid;place-items:center;height:25px}
.tel-tabico svg{width:24px;height:24px;stroke-width:1.7}
.tel-tab.is-active .tel-tabico svg{stroke-width:2.1}

/* 拨号键盘 */
/* 整组放大 + 在可视区垂直居中（上下留白均衡），不是单纯往下堆 padding */
.tel-dial{display:flex;flex-direction:column;align-items:center;justify-content:center;min-height:100%;padding:14px 0}
/* 号码长方框：把输入的数字框住 */
.tel-dial-number{box-sizing:border-box;height:76px;min-height:76px;font-size:44px;font-weight:300;letter-spacing:1px;color:#000;text-align:center;display:flex;align-items:center;justify-content:center;width:100%;max-width:320px;margin:0 auto;border:1.5px solid #c7c7cc;border-radius:16px;background:#fff;overflow:hidden;white-space:nowrap;padding:0 10px}
.tel-dial-number:empty:before{content:" ";white-space:pre}
.tel-dial-contact{height:22px;font-size:14px;color:#007aff;margin-top:8px}
.tel-dial-pad{display:grid;grid-template-columns:repeat(3,1fr);gap:20px 0;width:100%;max-width:344px;margin:26px auto 0}
.tel-dial-key{height:72px;display:flex;flex-direction:column;align-items:center;justify-content:center;border-radius:50%;margin:0 auto;width:72px;background:#f2f2f7}
.tel-dial-key:active{background:#d9d9de}
.tel-dial-key b{font-size:34px;font-weight:400;line-height:1;color:#000}
.tel-dial-key small{font-size:10px;letter-spacing:1.5px;color:#8e8e93;margin-top:3px;height:11px}
.tel-dial-key.tel-dial-fn b{font-size:29px}
.tel-dial-call{width:78px;height:78px;border-radius:50%;background:#34c759;display:grid;place-items:center;color:#fff;margin-top:30px;box-shadow:0 4px 12px #34c75955}
.tel-dial-call svg{width:36px;height:36px;stroke-width:2;transform:rotate(135deg)}
.tel-dial-call:active{background:#2bb34c}

/* 联系人详情（iOS 联系人卡片） */
.tel-detail{position:absolute;inset:0;z-index:2;background:#f2f2f7;display:flex;flex-direction:column}
.tel-detail[hidden]{display:none}
.tel-detail-body{flex:1;min-height:0;overflow-y:auto;scrollbar-width:none;padding-bottom:30px}
.tel-detail-body::-webkit-scrollbar{display:none}
.tel-hero{background:#fff;padding:20px 16px 18px;text-align:center;border-bottom:.5px solid #c6c6c8;margin-bottom:20px}
.tel-hero-ava{width:76px;height:76px;border-radius:50%;background:#e5e5ea;display:grid;place-items:center;color:#8e8e93;font-size:34px;overflow:hidden;margin:0 auto 12px}
.tel-hero-ava img{width:100%;height:100%;object-fit:cover}
.tel-hero-name{display:block;width:100%;text-align:center;border:0;background:transparent;font-size:24px;font-weight:600;color:#000;padding:4px 8px;outline:none}
.tel-hero-sub{display:block;width:100%;text-align:center;border:0;background:transparent;font-size:13px;color:#8e8e93;padding:4px 8px;outline:none}
.tel-group{background:#fff;margin:0 16px 18px;border-radius:11px;overflow:hidden}
.tel-group-title{padding:11px 14px 6px;font-size:12px;color:#6d6d72}
.tel-field-row{display:flex;align-items:center;min-height:50px;padding:0 14px;border-bottom:.5px solid #c6c6c8}
.tel-field-row:last-child{border-bottom:0}
.tel-field-row label{font-size:12px;color:#6d6d72;width:70px;flex:0 0 70px}
.tel-field-row input{border:0;background:transparent;outline:none;flex:1;font-size:16px;color:#000;min-width:0;padding:8px 0}
.tel-field-row input::placeholder{color:#b0b0b5}
.tel-field-row input.tel-phone-input{color:#007aff}
.tel-rm{width:28px;height:28px;color:#ff3b30;display:grid;place-items:center;flex:0 0 28px}
.tel-rm svg{width:18px;height:18px;stroke-width:2}
.tel-addphone{display:block;margin:0 16px 18px;width:calc(100% - 32px);text-align:left;padding:13px 14px;background:#fff;border-radius:11px;color:#007aff;font-size:16px}
.tel-switches{padding:0 14px}
.tel-switch-row{display:flex;align-items:center;justify-content:space-between;min-height:50px;border-bottom:.5px solid #c6c6c8;font-size:16px;color:#000}
.tel-switch-row:last-child{border-bottom:0}
.tel-switch{width:51px;height:31px;border-radius:16px;background:#e5e5ea;position:relative;transition:background .2s;flex:0 0 51px}
.tel-switch i{position:absolute;top:2px;left:2px;width:27px;height:27px;border-radius:50%;background:#fff;box-shadow:0 2px 4px #0003;transition:transform .2s}
.tel-switch[aria-checked="true"]{background:#34c759}
.tel-switch[aria-checked="true"] i{transform:translateX(20px)}
.tel-detail-call{display:flex;align-items:center;justify-content:center;gap:8px;width:calc(100% - 32px);margin:0 16px 14px;height:50px;background:#34c759;color:#fff;border-radius:11px;font-size:17px;font-weight:600}
.tel-detail-call svg{width:22px;height:22px;stroke-width:2;transform:rotate(135deg)}
.tel-detail-delete{display:block;width:calc(100% - 32px);margin:0 16px;height:50px;background:#fff;color:#ff3b30;border-radius:11px;font-size:17px}
.tel-detail-incoming{display:flex;align-items:center;justify-content:center;gap:8px;width:calc(100% - 32px);margin:0 16px 14px;height:50px;background:#fff;color:#007aff;border-radius:11px;font-size:17px;font-weight:600}
.tel-detail-incoming svg{width:22px;height:22px;stroke-width:2;transform:rotate(135deg)}

/* 来电横幅：灵动岛正下方的长条弹窗（接听 / 拒绝），全局层，任意页面可响起 */
.tel-incoming{position:absolute;left:0;right:0;top:calc(var(--status-h,51px) + 6px);z-index:45;padding:0 12px;pointer-events:none}
.tel-incoming[hidden]{display:none}
.tel-incoming-card{pointer-events:auto;display:flex;align-items:center;gap:10px;padding:12px 12px;border-radius:20px;background:#fff;border:1px solid #e5e5ea;box-shadow:0 12px 40px #0003;animation:telInSlide .32s cubic-bezier(.2,.8,.3,1)}
@keyframes telInSlide{from{opacity:0;transform:translateY(-26px)}to{opacity:1;transform:translateY(0)}}
.tel-incoming-ava{width:48px;height:48px;flex:0 0 48px;border-radius:50%;overflow:hidden;background:#e5e5ea;color:#8e8e93;font-size:22px;display:grid;place-items:center}
.tel-incoming-ava img{width:100%;height:100%;object-fit:cover}
.tel-incoming-meta{flex:1;min-width:0}
.tel-incoming-label{font-size:11px;color:#8e8e93}
.tel-incoming-name{font-size:16px;font-weight:600;color:#000;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.tel-incoming-num{font-size:11px;color:#8e8e93;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.tel-in-btn{width:46px;height:46px;flex:0 0 46px;border-radius:50%;display:grid;place-items:center;color:#fff}
.tel-in-btn svg{width:22px;height:22px;stroke-width:2.2;transform:rotate(135deg)}
.tel-in-decline{background:#ff3b30}
.tel-in-answer{background:#34c759}
.tel-in-answer svg{transform:none}
.tel-in-btn:active{opacity:.75}

/* 通话界面（白底仿 iOS 通话） */
.tel-call{position:absolute;inset:0;z-index:4;background:#fff;display:flex;flex-direction:column;align-items:center;color:#1c1c1e;padding:0 24px 26px}
.tel-call[hidden]{display:none}
.tel-call-top{margin-top:44px;display:flex;flex-direction:column;align-items:center;text-align:center;flex:0 0 auto}
.tel-call-ava{width:88px;height:88px;border-radius:50%;background:#e5e5ea;display:grid;place-items:center;color:#8e8e93;font-size:40px;overflow:hidden;margin-bottom:12px}
.tel-call-ava img{width:100%;height:100%;object-fit:cover}
.tel-call-name{font-size:26px;font-weight:300;letter-spacing:.5px;color:#1c1c1e}
.tel-call-num{font-size:13px;color:#8e8e93;margin-top:4px}
.tel-call-state{font-size:13px;color:#1aad19;margin-top:12px;min-height:18px}
.tel-call-state.is-busy{color:#ff9f0a}
/* 通话中段：纯占位（真实语音通话，不显示字幕/转文字） */
.tel-call-mid{flex:1;min-height:20px;width:100%}
/* 状态提示：仅用于必要的技术提示（如没听清 / 没配 API），不显示任何对话台词 */
.tel-call-tip{min-height:16px;font-size:12px;color:#d9730d;text-align:center;margin-bottom:4px;padding:0 10px}
/* 按住说话 */
.tel-call-talk{flex:0 0 auto;width:100%;max-width:300px;height:46px;border-radius:23px;background:#e9e9eb;color:#1c1c1e;font-size:15px;letter-spacing:.5px;user-select:none;-webkit-user-select:none;touch-action:none;margin-bottom:16px}
.tel-call-talk.is-pressing{background:#d1d1d6;transform:scale(.98)}
.tel-call-talk.is-busy{opacity:.55;pointer-events:none}
.tel-call-actions{flex:0 0 auto;display:grid;grid-template-columns:repeat(3,1fr);gap:24px;width:100%;max-width:300px}
.tel-call-act{display:flex;flex-direction:column;align-items:center;gap:9px;color:#3c3c43}
.tel-call-act>span{width:56px;height:56px;border-radius:50%;background:#e9e9eb;display:grid;place-items:center}
.tel-call-act svg{width:25px;height:25px;stroke-width:1.8}
.tel-call-act.is-on>span{background:#1c1c1e;color:#fff}
.tel-call-act small{font-size:11px;color:#6d6d72}
.tel-call-hang{flex:0 0 auto;width:64px;height:64px;border-radius:50%;background:#ff3b30;display:grid;place-items:center;color:#fff;margin-top:22px}
.tel-call-hang svg{width:32px;height:32px;stroke-width:2;transform:rotate(135deg)}
.tel-call-hang:active{background:#e0342c}

/* 矮屏适配：浏览器地址栏展开、分屏、小屏手机时可视高度会被压到 660~780，
   拨号盘整组固定尺寸会撑出屏幕、把呼叫键挤到看不见。
   这里按高度分三档等比压缩（仍是居中版式，不是往下堆 padding）。 */
@media(max-height:820px){
  .tel-dial{padding:8px 0}
  .tel-dial-number{height:66px;min-height:66px;font-size:38px}
  .tel-dial-pad{margin-top:20px;gap:16px 0;max-width:320px}
  .tel-dial-key{width:64px;height:64px}
  .tel-dial-key b{font-size:30px}
  .tel-dial-call{width:70px;height:70px;margin-top:22px}
  .tel-dial-call svg{width:32px;height:32px}
}
@media(max-height:720px){
  .tel-dial-number{height:58px;min-height:58px;font-size:34px}
  .tel-dial-pad{margin-top:14px;gap:12px 0;max-width:290px}
  .tel-dial-key{width:56px;height:56px}
  .tel-dial-key b{font-size:26px}
  .tel-dial-key small{font-size:9px;margin-top:1px;height:9px}
  .tel-dial-call{width:62px;height:62px;margin-top:16px}
  .tel-dial-call svg{width:28px;height:28px}
}
@media(max-height:620px){
  .tel-dial-number{height:48px;min-height:48px;font-size:28px;border-radius:13px}
  .tel-dial-contact{display:none}
  .tel-dial-pad{margin-top:10px;gap:8px 0;max-width:250px}
  .tel-dial-key{width:48px;height:48px}
  .tel-dial-key b{font-size:22px}
  .tel-dial-key small{display:none}
  .tel-dial-call{width:54px;height:54px;margin-top:12px}
  .tel-dial-call svg{width:24px;height:24px}
}
/* 通话中界面同样按高度收紧，保证挂断键始终在屏幕内 */
@media(max-height:720px){
  .tel-call-hang{width:56px;height:56px;margin-top:14px}
  .tel-call-act>span{width:50px;height:50px}
  .tel-call-talk{margin-bottom:12px}
}
