:root{
  --bg:#07372f;
  --card:#f7f7f8;
  --text:#14171f;
  --muted:#667085;
  --line:#d8dde5;
  --tip:#e8f1fb;
  --tipText:#37516f;
  --blue:#1677e8;
  --shadow:0 24px 70px rgba(0,0,0,.24);
}

*{box-sizing:border-box}

html,
body{
  margin:0;
  width:100%;
  min-height:100%;
  font-family:
    -apple-system,
    BlinkMacSystemFont,
    "SF Pro Display",
    "SF Pro Text",
    "Helvetica Neue",
    Arial,
    "PingFang SC",
    "Hiragino Sans",
    "Noto Sans",
    sans-serif;
  background:var(--bg);
  color:var(--text);
}

button{font:inherit}

/* =========================
   页面背景示例
========================= */
.demo-page{
  min-height:100dvh;
  background:
    linear-gradient(rgba(2,42,35,.84),rgba(2,42,35,.92)),
    radial-gradient(circle at 75% 20%,rgba(255,255,255,.12),transparent 34%),
    #07372f;
  color:#fff;
  padding:88px 28px 44px;
}

.demo-wrap{
  max-width:680px;
  margin:0 auto;
}

.demo-kicker{
  letter-spacing:.22em;
  font-size:12px;
  opacity:.72;
}

.demo-title{
  font-size:48px;
  line-height:1.06;
  margin:22px 0 18px;
  font-weight:780;
}

.demo-text{
  font-size:18px;
  line-height:1.65;
  opacity:.78;
  max-width:560px;
}

.demo-cta{
  display:inline-flex;
  align-items:center;
  gap:14px;
  margin-top:34px;
  background:#e0c026;
  color:#15221e;
  padding:18px 22px;
  border-radius:10px;
  font-weight:760;
}

/* =========================
   Safari handoff 遮罩
========================= */
.handoff-mask{
  position:fixed;
  inset:0;
  z-index:999999;
  background:rgba(0,0,0,.34);
  -webkit-backdrop-filter:blur(1.5px);
  backdrop-filter:blur(1.5px);
  display:none;
  align-items:flex-start;
  justify-content:center;
  padding:
    max(74px, env(safe-area-inset-top))
    16px
    max(24px, env(safe-area-inset-bottom));
}

.handoff-mask.is-visible{
  display:flex;
}

.handoff-card{
  width:min(100%,560px);
  border-radius:30px;
  background:rgba(248,248,250,.985);
  box-shadow:var(--shadow);
  border:1px solid rgba(255,255,255,.72);
  overflow:hidden;
  animation:cardIn .22s ease-out;
}

@keyframes cardIn{
  from{
    opacity:0;
    transform:translateY(-10px) scale(.985);
  }
  to{
    opacity:1;
    transform:none;
  }
}

.handoff-inner{
  padding:24px 26px 26px;
}

.handoff-top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  margin-bottom:18px;
}

.brand{
  display:flex;
  align-items:center;
  gap:10px;
  min-width:0;
  color:#4e655f;
  font-size:13px;
  font-weight:800;
  letter-spacing:.22em;
  text-transform:uppercase;
  white-space:nowrap;
}

.brand-dot{
  width:16px;
  height:16px;
  border-radius:4px;
  border:2px solid #5c7c74;
  transform:rotate(30deg);
}

.brand small{
  color:#7b8593;
  font-weight:650;
  letter-spacing:.12em;
}

.close-btn{
  width:34px;
  height:34px;
  border:0;
  border-radius:50%;
  background:transparent;
  color:#667085;
  font-size:28px;
  line-height:1;
  display:grid;
  place-items:center;
  cursor:pointer;
  -webkit-tap-highlight-color:transparent;
}

.app-row{
  display:flex;
  align-items:center;
  gap:16px;
}

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

.safari-icon{
  width:70px;
  height:70px;
  flex:0 0 70px;
  border-radius:20px;
  background:linear-gradient(145deg,#57cbff 0%,#118dff 52%,#1268d7 100%);
  display:grid;
  place-items:center;
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,.45),
    0 8px 20px rgba(16,112,220,.22);
  position:relative;
}

.safari-icon::before{
  content:"";
  width:42px;
  height:42px;
  border-radius:50%;
  border:3px solid rgba(255,255,255,.96);
  position:absolute;
}

.needle{
  width:6px;
  height:36px;
  border-radius:6px;
  background:linear-gradient(to bottom,#fff 0 49%,#ef3b4f 50% 100%);
  transform:rotate(43deg);
  position:relative;
  z-index:2;
  box-shadow:0 0 0 1px rgba(0,0,0,.04);
}

.headline{
  font-size:29px;
  line-height:1.08;
  font-weight:800;
  letter-spacing:-.02em;
}

.domain{
  margin-top:7px;
  color:#667085;
  font-size:17px;
  line-height:1.2;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  max-width:390px;
  direction:ltr;
  text-align:start;
}

.desc{
  margin-top:19px;
  color:#667085;
  font-size:17px;
  line-height:1.55;
}

.tip{
  margin-top:20px;
  padding:16px 18px;
  border-radius:15px;
  background:var(--tip);
  color:var(--tipText);
  font-size:17px;
  line-height:1.45;
}

.tip strong{
  color:#126fd1;
}

.open-btn{
  width:100%;
  min-height:58px;
  margin-top:20px;
  border:0;
  border-radius:16px;
  background:linear-gradient(180deg,#2089ff,#0876e8);
  color:#fff;
  font-size:18px;
  font-weight:800;
  box-shadow:0 9px 22px rgba(8,118,232,.2);
  cursor:pointer;
  -webkit-tap-highlight-color:transparent;
}

.open-btn:active{
  transform:scale(.985);
}

.other{
  width:auto;
  margin:19px 0 0;
  padding:0;
  border:0;
  background:transparent;
  display:flex;
  align-items:center;
  gap:8px;
  color:#667085;
  font-size:16px;
  cursor:pointer;
}

.fallback{
  display:none;
  margin-top:16px;
  padding-top:16px;
  border-top:1px solid var(--line);
}

.fallback.is-visible{
  display:block;
}

.copy-btn{
  width:100%;
  min-height:50px;
  border:1px solid #d5d9e0;
  border-radius:14px;
  background:#fff;
  color:#344054;
  font-weight:720;
  cursor:pointer;
}

.status{
  min-height:22px;
  margin-top:10px;
  color:#7a8390;
  font-size:14px;
  text-align:center;
}

/* =========================
   微信专用引导
========================= */
.wechat-guide{
  display:none;
  margin-top:20px;
  padding:18px;
  border-radius:18px;
  background:#eef7f1;
  border:1px solid #d7ebdd;
}

.wechat-guide.is-visible{
  display:block;
}

.wechat-guide-title{
  font-size:18px;
  font-weight:800;
  color:#1f3d2d;
  margin-bottom:10px;
}

.wechat-step{
  display:flex;
  gap:10px;
  align-items:flex-start;
  color:#486155;
  font-size:16px;
  line-height:1.55;
  margin-top:8px;
}

.wechat-step-num{
  width:24px;
  height:24px;
  flex:0 0 24px;
  border-radius:50%;
  background:#20a65a;
  color:#fff;
  display:grid;
  place-items:center;
  font-size:13px;
  font-weight:800;
  margin-top:1px;
}

.wechat-arrow{
  position:fixed;
  top:max(18px, env(safe-area-inset-top));
  right:18px;
  z-index:1000000;
  color:#fff;
  font-size:44px;
  font-weight:300;
  line-height:1;
  transform:rotate(-12deg);
  text-shadow:0 2px 8px rgba(0,0,0,.35);
  display:none;
  pointer-events:none;
}

.wechat-arrow.is-visible{
  display:block;
}

/* =========================
   RTL：阿拉伯语/波斯语/希伯来语
========================= */
html[dir="rtl"] .handoff-card{
  direction:rtl;
  text-align:right;
}

html[dir="rtl"] .handoff-top,
html[dir="rtl"] .app-row{
  flex-direction:row-reverse;
}

html[dir="rtl"] .brand{
  direction:ltr;
}

html[dir="rtl"] .other{
  margin-inline-start:auto;
}

html[dir="rtl"] .wechat-step{
  flex-direction:row-reverse;
}

html[dir="rtl"] .status{
  text-align:right;
}

/* =========================
   手机
========================= */
@media(max-width:480px){
  .handoff-mask{
    padding-left:14px;
    padding-right:14px;
  }

  .handoff-inner{
    padding:22px 22px 24px;
  }

  .headline{
    font-size:26px;
  }

  .safari-icon{
    width:64px;
    height:64px;
    flex-basis:64px;
    border-radius:18px;
  }

  .safari-icon::before{
    width:38px;
    height:38px;
  }

  .needle{
    height:32px;
  }

  .brand{
    font-size:12px;
    letter-spacing:.18em;
  }

  .brand small{
    letter-spacing:.08em;
  }

  .domain{
    max-width:235px;
  }

  .demo-title{
    font-size:40px;
  }
}


/* JS 生成的复制/调试辅助元素 */
.clipboard-helper{
  position:fixed;
  left:-9999px;
  top:0;
  opacity:0;
}

.debug-box{
  position:fixed;
  left:8px;
  right:8px;
  bottom:8px;
  z-index:1000001;
  max-height:42vh;
  overflow:auto;
  white-space:pre-wrap;
  word-break:break-all;
  margin:0;
  padding:12px;
  border-radius:10px;
  background:rgba(0,0,0,.88);
  color:#fff;
  font:12px/1.45 monospace;
  direction:ltr;
  text-align:left;
}
