    :root{
      --bg:#07070a;
      --panel:rgba(20,22,30,.48);
      --text:#f8fafc;
      --muted:rgba(255,255,255,.68);
      --muted-2:rgba(255,255,255,.48);
      --primary:#7c3aed;
      --primary-dark:#6d28d9;
      --danger:#ef4444;
      --ok:#10b981;
      --stroke:rgba(255,255,255,.10);
      --stroke-soft:rgba(255,255,255,.07);
      --shadow:0 20px 60px rgba(0,0,0,.38);
      --safe-bottom: env(safe-area-inset-bottom, 0px);
      --safe-top: env(safe-area-inset-top, 0px);
    }

    *{ box-sizing:border-box; }

    html, body{
      margin:0;
      width:100%;
      height:100%;
      background:#000;
      font-family:"Noto Sans TC", sans-serif;
      overflow:hidden;
    }

    body{
      color:var(--text);
      background:
        radial-gradient(circle at top left, rgba(124,58,237,.14), transparent 28%),
        linear-gradient(180deg, #06070b 0%, #090a0f 100%);
    }

    .app{
      position:relative;
      width:100%;
      height:100dvh;
      background:
        radial-gradient(circle at top left, rgba(124,58,237,.18), transparent 28%),
        radial-gradient(circle at top right, rgba(59,130,246,.12), transparent 25%),
        linear-gradient(180deg, #0b0c11 0%, #07070a 100%);
      overflow:hidden;
    }

    .camera-wrap{
      position:absolute;
      inset:0;
      background:#000;
    }

    video#preview{
      position:absolute;
      inset:0;
      width:100%;
      height:100%;
      object-fit:cover;
      object-position:center center;
      transform:scaleX(-1);
      background:#000;
    }

    .camera-fallback{
      position:absolute;
      inset:0;
      display:flex;
      align-items:center;
      justify-content:center;
      padding:28px;
      text-align:center;
      background:
        radial-gradient(circle at 20% 20%, rgba(124,58,237,.18), transparent 30%),
        radial-gradient(circle at 80% 0%, rgba(255,255,255,.08), transparent 26%),
        linear-gradient(180deg, #11131a 0%, #090a0f 100%);
      z-index:3;
    }

    .fallback-card{
      width:min(420px, 100%);
      padding:22px 18px;
      border-radius:28px;
      background:rgba(255,255,255,.06);
      border:1px solid rgba(255,255,255,.08);
      backdrop-filter:blur(18px);
      -webkit-backdrop-filter:blur(18px);
      box-shadow:var(--shadow);
    }

    .fallback-card .icon{
      width:68px;
      height:68px;
      margin:0 auto 12px;
      border-radius:999px;
      display:flex;
      align-items:center;
      justify-content:center;
      background:rgba(124,58,237,.14);
      border:1px solid rgba(124,58,237,.24);
    }

    .fallback-card .icon .material-symbols-outlined{
      font-size:34px;
      color:#d8b4fe;
    }

    .fallback-title{
      font-size:20px;
      font-weight:900;
      margin:0 0 8px;
      letter-spacing:-.3px;
    }

    .fallback-desc{
      margin:0;
      color:var(--muted);
      line-height:1.6;
      font-size:14px;
    }

    .top-fade{
      position:absolute;
      inset:0 0 auto 0;
      height:180px;
      background:linear-gradient(180deg, rgba(0,0,0,.45), transparent);
      pointer-events:none;
      z-index:2;
    }

    .bottom-fade{
      position:absolute;
      inset:auto 0 0 0;
      height:240px;
      background:linear-gradient(180deg, transparent, rgba(0,0,0,.36));
      pointer-events:none;
      z-index:2;
    }

    .topbar{
      position:absolute;
      top:0;
      left:0;
      right:0;
      z-index:5;
      padding:
        calc(10px + var(--safe-top))
        14px
        10px;
      display:flex;
      align-items:center;
      justify-content:space-between;
      gap:12px;
    }

    .circle-btn{
      width:44px;
      height:44px;
      border:none;
      border-radius:999px;
      display:flex;
      align-items:center;
      justify-content:center;
      cursor:pointer;
      color:#fff;
      background:rgba(15,16,22,.52);
      border:1px solid rgba(255,255,255,.10);
      backdrop-filter:blur(14px);
      -webkit-backdrop-filter:blur(14px);
      box-shadow:0 10px 24px rgba(0,0,0,.22);
      flex:0 0 auto;
    }

    .circle-btn:hover{
      background:rgba(25,26,34,.68);
    }

    .circle-btn .material-symbols-outlined{
      font-size:22px;
    }

    .top-center{
      min-width:0;
      flex:1;
      display:flex;
      justify-content:center;
    }

    .status-pill{
      display:inline-flex;
      align-items:center;
      gap:8px;
      max-width:100%;
      padding:10px 14px;
      border-radius:999px;
      background:rgba(15,16,22,.52);
      border:1px solid rgba(255,255,255,.10);
      backdrop-filter:blur(14px);
      -webkit-backdrop-filter:blur(14px);
      box-shadow:0 10px 24px rgba(0,0,0,.22);
      white-space:nowrap;
      overflow:hidden;
      text-overflow:ellipsis;
    }

    .status-dot{
      width:8px;
      height:8px;
      border-radius:999px;
      background:var(--ok);
      box-shadow:0 0 0 6px rgba(16,185,129,.12);
      flex:0 0 auto;
    }

    .status-pill span{
      font-size:13px;
      color:#fff;
      font-weight:700;
      letter-spacing:.1px;
    }

    .hero-copy{
      position:absolute;
      left:18px;
      right:18px;
      top:92px;
      z-index:4;
      display:flex;
      flex-direction:column;
      gap:6px;
      pointer-events:none;
    }

    .hero-title{
      font-size:30px;
      line-height:1.05;
      letter-spacing:-1px;
      font-weight:900;
      margin:0;
      text-shadow:0 10px 30px rgba(0,0,0,.35);
    }

    .hero-sub{
      margin:0;
      color:rgba(255,255,255,.82);
      font-size:13px;
      line-height:1.5;
      text-shadow:0 8px 24px rgba(0,0,0,.35);
      max-width:320px;
    }

    .dock{
      position:absolute;
      left:12px;
      right:12px;
      bottom:calc(12px + var(--safe-bottom));
      z-index:6;
      border-radius:32px;
      background:var(--panel);
      border:1px solid var(--stroke);
      backdrop-filter:blur(26px) saturate(130%);
      -webkit-backdrop-filter:blur(26px) saturate(130%);
      box-shadow:var(--shadow);
      overflow:hidden;
    }

    .dock-inner{
      padding:16px 14px 14px;
    }

    .dock-head{
      display:flex;
      align-items:center;
      justify-content:space-between;
      gap:12px;
      margin-bottom:12px;
    }

    .dock-title{
      font-size:17px;
      font-weight:900;
      letter-spacing:-.3px;
      margin:0;
    }

    .dock-sub{
      margin:3px 0 0;
      font-size:12px;
      color:var(--muted);
    }

    .camera-mini{
      width:38px;
      height:38px;
      border-radius:999px;
      background:rgba(255,255,255,.06);
      border:1px solid rgba(255,255,255,.09);
      display:flex;
      align-items:center;
      justify-content:center;
      flex:0 0 auto;
    }

    .camera-mini .material-symbols-outlined{
      font-size:20px;
      color:#fff;
    }

    .stack{
      display:flex;
      flex-direction:column;
      gap:10px;
    }

    .row{
      display:grid;
      grid-template-columns:minmax(0, 1fr) auto;
      gap:12px;
      align-items:center;
      padding:14px 14px;
      border-radius:22px;
      background:rgba(255,255,255,.06);
      border:1px solid var(--stroke-soft);
    }

    .row-left{
      min-width:0;
      display:flex;
      align-items:center;
      gap:12px;
    }

    .row-icon{
      width:42px;
      height:42px;
      border-radius:999px;
      display:flex;
      align-items:center;
      justify-content:center;
      background:rgba(255,255,255,.07);
      border:1px solid rgba(255,255,255,.08);
      flex:0 0 auto;
    }

    .row-icon .material-symbols-outlined{
      font-size:22px;
      color:#fff;
    }

    .row-copy{
      min-width:0;
    }

    .row-title{
      font-size:15px;
      font-weight:800;
      margin:0 0 3px;
      color:#fff;
    }

    .row-desc{
      margin:0;
      font-size:12px;
      color:var(--muted);
      line-height:1.4;
    }

    .row-right{
      display:flex;
      align-items:center;
      gap:10px;
      flex-wrap:nowrap;
    }

    .switch{
      position:relative;
      width:54px;
      height:32px;
      flex:0 0 auto;
    }

    .switch input{
      display:none;
    }

    .slider{
      position:absolute;
      inset:0;
      border-radius:999px;
      background:rgba(255,255,255,.16);
      border:1px solid rgba(255,255,255,.10);
      cursor:pointer;
      transition:.22s ease;
    }

    .slider:before{
      content:"";
      position:absolute;
      width:24px;
      height:24px;
      left:3px;
      top:3px;
      border-radius:999px;
      background:#fff;
      box-shadow:0 4px 14px rgba(0,0,0,.22);
      transition:.22s ease;
    }

    .switch input:checked + .slider{
      background:linear-gradient(135deg, var(--primary), #8b5cf6);
      border-color:rgba(255,255,255,.14);
    }

    .switch input:checked + .slider:before{
      transform:translateX(22px);
    }

    .price-wrap{
      display:flex;
      align-items:center;
      gap:6px;
      padding:0 10px;
      height:38px;
      border-radius:999px;
      background:rgba(255,255,255,.08);
      border:1px solid rgba(255,255,255,.10);
      flex:0 0 auto;
    }

    .price-select{
      appearance:none;
      -webkit-appearance:none;
      -moz-appearance:none;
      background:transparent;
      border:none;
      color:#fff;
      font-size:14px;
      font-weight:800;
      outline:none;
      cursor:pointer;
      min-width:48px;
    }

    .price-select option{
      color:#111827;
    }

    .price-unit{
      font-size:13px;
      color:var(--muted);
      white-space:nowrap;
      font-weight:700;
    }

    .price-wrap.disabled{
      opacity:.42;
    }

    .go-live{
      margin-top:12px;
      width:100%;
      border:none;
      border-radius:999px;
      height:56px;
      background:linear-gradient(135deg, var(--primary), #8b5cf6);
      color:#fff;
      font-size:17px;
      font-weight:900;
      letter-spacing:.2px;
      cursor:pointer;
      box-shadow:0 14px 34px rgba(124,58,237,.34);
      transition:transform .16s ease, box-shadow .16s ease, opacity .16s ease;
    }

    .go-live:hover{
      transform:translateY(-1px);
      box-shadow:0 18px 40px rgba(124,58,237,.38);
    }

    .go-live:active{
      transform:translateY(0);
    }

    .go-live[disabled]{
      opacity:.46;
      cursor:not-allowed;
      box-shadow:none;
    }

    .live-note{
      margin:10px 2px 0;
      text-align:center;
      font-size:12px;
      color:var(--muted);
      line-height:1.5;
    }

    @media (min-width:768px){
      body{
        display:flex;
        align-items:center;
        justify-content:center;
        padding:24px;
      }

      .app{
        width:min(430px, 100%);
        height:min(860px, calc(100vh - 48px));
        aspect-ratio:9 / 19.5;
        border-radius:36px;
        box-shadow:
          0 0 0 1px rgba(255,255,255,.05),
          0 30px 80px rgba(0,0,0,.42);
      }
    }

    /* ===== Second Part ===== */
    .hidden { display:none !important; }

    .status-live-wrap{
      display:flex;
      align-items:center;
      gap:8px;
      min-width:0;
      max-width:100%;
    }

    .offline-btn{
      border:none;
      border-radius:999px;
      height:40px;
      padding:0 16px;
      background:#ef4444;
      color:#fff;
      font-size:13px;
      font-weight:900;
      cursor:pointer;
      box-shadow:0 10px 24px rgba(239,68,68,.28);
      white-space:nowrap;
    }

    .offline-btn:hover{
      filter:brightness(1.04);
    }

    .status-pill.live{
      background:rgba(15,16,22,.58);
    }

    .status-pill.live .status-dot{
      background:#10b981;
      box-shadow:0 0 0 6px rgba(16,185,129,.12);
    }

    /* Incoming iOS-like bottom sheet */
    .incoming-sheet{
      position:fixed;
      left:16px;
      right:16px;
      bottom:calc(16px + env(safe-area-inset-bottom));
      z-index:1200;
      transform:translateY(140%);
      opacity:0;
      transition:transform .28s ease, opacity .28s ease;
      pointer-events:none;
    }

    .incoming-sheet.show{
      transform:translateY(0);
      opacity:1;
      pointer-events:auto;
    }

    .incoming-card{
      border-radius:28px;
      padding:16px;
      background:rgba(19,20,28,.90);
      backdrop-filter:blur(18px);
      -webkit-backdrop-filter:blur(18px);
      border:1px solid rgba(255,255,255,.10);
      box-shadow:0 18px 50px rgba(0,0,0,.32);
      color:#fff;
    }

    .incoming-top{
      display:flex;
      align-items:flex-start;
      gap:12px;
    }

    .incoming-icon{
      width:46px;
      height:46px;
      border-radius:16px;
      display:flex;
      align-items:center;
      justify-content:center;
      background:rgba(255,255,255,.10);
      flex:0 0 auto;
    }

    .incoming-icon .material-symbols-outlined{
      font-size:24px;
    }

    .incoming-copy{
      min-width:0;
      flex:1;
    }

    .incoming-kicker{
      font-size:12px;
      line-height:1;
      color:rgba(255,255,255,.62);
      margin:2px 0 8px;
      font-weight:700;
      letter-spacing:.2px;
    }

    .incoming-name{
      font-size:24px;
      line-height:1.1;
      font-weight:900;
      margin:0 0 6px;
      word-break:break-word;
    }

    .incoming-desc{
      margin:0;
      font-size:13px;
      color:rgba(255,255,255,.74);
      line-height:1.45;
    }

    .incoming-actions{
      display:flex;
      gap:12px;
      margin-top:16px;
    }

    .call-action{
      flex:1;
      border:none;
      border-radius:999px;
      height:52px;
      display:flex;
      align-items:center;
      justify-content:center;
      gap:8px;
      font-size:15px;
      font-weight:900;
      color:#fff;
      cursor:pointer;
    }

    .call-action .material-symbols-outlined{
      font-size:21px;
    }

    .call-action.reject{
      background:#ef4444;
      box-shadow:0 12px 28px rgba(239,68,68,.25);
    }

    .call-action.accept{
      background:#22c55e;
      box-shadow:0 12px 28px rgba(34,197,94,.25);
    }

    /* In-call overlay */
    .call-stage{
      position:fixed;
      inset:0;
      z-index:1100;
      background:#000;
      display:none;
    }

    .call-stage.show{
      display:block;
    }

    .remote-video{
      position:absolute;
      inset:0;
      background:#000;
    }

    .local-pip{
      position:absolute;
      right:16px;
      top:calc(82px + env(safe-area-inset-top));
      width:30vw;
      max-width:142px;
      min-width:92px;
      aspect-ratio:9 / 16;
      border-radius:20px;
      overflow:hidden;
      background:#111;
      border:1px solid rgba(255,255,255,.12);
      box-shadow:0 18px 40px rgba(0,0,0,.34);
      z-index:3;
      display:none;
    }

    .local-pip.show{
      display:block;
    }

    .call-head{
      position:absolute;
      left:0;
      right:0;
      top:0;
      z-index:4;
      padding:
        calc(18px + env(safe-area-inset-top))
        20px
        18px;
      background:linear-gradient(180deg, rgba(0,0,0,.52), rgba(0,0,0,0));
      pointer-events:none;
      text-align:center;
      color:#fff;
    }

    .call-type{
      font-size:12px;
      color:rgba(255,255,255,.72);
      letter-spacing:.2px;
      margin-bottom:8px;
      font-weight:700;
    }

    .call-name{
      font-size:28px;
      line-height:1.1;
      font-weight:900;
      margin:0 0 8px;
    }

    .call-sub{
      font-size:14px;
      color:rgba(255,255,255,.72);
      margin:0;
    }

    .audio-call-center{
      position:absolute;
      inset:0;
      display:none;
      align-items:center;
      justify-content:center;
      text-align:center;
      padding:24px;
      z-index:2;
      color:#fff;
      background:
        radial-gradient(circle at 50% 35%, rgba(255,255,255,.08), transparent 30%),
        radial-gradient(circle at 50% 50%, rgba(16,185,129,.10), transparent 40%),
        #000;
    }

    .audio-call-center.show{
      display:flex;
    }

    .audio-call-card{
      width:min(100%, 320px);
    }

    .audio-avatar{
      width:108px;
      height:108px;
      border-radius:999px;
      margin:0 auto 18px;
      display:flex;
      align-items:center;
      justify-content:center;
      background:rgba(255,255,255,.08);
      box-shadow:0 0 0 18px rgba(255,255,255,.03);
    }

    .audio-avatar .material-symbols-outlined{
      font-size:48px;
    }

    .audio-name{
      font-size:28px;
      font-weight:900;
      margin:0 0 8px;
    }

    .audio-desc{
      font-size:14px;
      color:rgba(255,255,255,.72);
      margin:0;
      line-height:1.5;
    }

    .call-actions-bottom{
      position:absolute;
      left:0;
      right:0;
      bottom:0;
      z-index:5;
      padding:18px 18px calc(26px + env(safe-area-inset-bottom));
      display:flex;
      justify-content:center;
      background:linear-gradient(0deg, rgba(0,0,0,.58), rgba(0,0,0,0));
    }

    .hangup-btn{
      width:72px;
      height:72px;
      border:none;
      border-radius:999px;
      background:#ef4444;
      color:#fff;
      display:flex;
      align-items:center;
      justify-content:center;
      cursor:pointer;
      box-shadow:0 20px 44px rgba(239,68,68,.30);
    }

    .hangup-btn .material-symbols-outlined{
      font-size:34px;
    }

    .call-timer{
      margin:10px 0 0;
      font-size:18px;
      font-weight:900;
      letter-spacing:.6px;
      color:#fff;
    }

    .call-reward{
      margin-top:14px;
      display:none;
      justify-content:center;
      animation:rewardPop .35s ease;
    }

    .call-reward.show{
      display:flex;
    }

    .call-reward-inner{
      display:flex;
      align-items:center;
      gap:12px;
      padding:12px 16px;
      min-width:220px;
      border-radius:18px;
      background:rgba(255,255,255,.12);
      border:1px solid rgba(255,255,255,.18);
      box-shadow:0 10px 30px rgba(0,0,0,.22);
      backdrop-filter:blur(14px);
      -webkit-backdrop-filter:blur(14px);
    }

    .call-reward-icon{
      width:42px;
      height:42px;
      border-radius:50%;
      display:flex;
      align-items:center;
      justify-content:center;
      background:linear-gradient(135deg, rgba(255,215,90,.28), rgba(255,180,0,.12));
      color:#ffd54f;
      flex:0 0 42px;
    }

    .call-reward-icon .material-symbols-outlined{
      font-size:22px;
    }

    .call-reward-copy{
      text-align:left;
    }

    .call-reward-label{
      margin:0 0 2px;
      font-size:12px;
      color:rgba(255,255,255,.72);
      letter-spacing:.08em;
    }

    .call-reward-value{
      margin:0;
      font-size:18px;
      font-weight:800;
      color:#fff;
    }

    .call-reward-value span{
      color:#ffd54f;
      font-size:22px;
    }

    .call-reward-meta{
      margin:6px 0 0;
      font-size:13px;
      font-weight:600;
      color:rgba(255,255,255,.78);
    }
    
    .call-reward-meta span{
      color:#fff;
    }

    @keyframes rewardPop{
      0%{
        opacity:0;
        transform:translateY(10px) scale(.96);
      }
      100%{
        opacity:1;
        transform:translateY(0) scale(1);
      }
    }

    .hangup-btn.ended{
      background:rgba(255,255,255,.2) !important;
      border:1px solid rgba(255,255,255,.16);
      box-shadow:0 8px 24px rgba(0,0,0,.24);
    }

    .hangup-btn.ended:hover{
      transform:none;
      opacity:1;
    }