/* ===========================================================
   enhance.css — 顶部导航 + 进度条 + 回到顶部 + 移动端适配
   =========================================================== */
*,*::before,*::after{box-sizing:border-box}

/* 给导航栏让出空间 */
body.typora-export { padding-top: 0 !important; }
#write { padding-top: 60px !important; }

/* ----- 阅读进度条 ----- */
.reading-progress {
  position:fixed; top:0; left:0; height:3px;
  background:linear-gradient(90deg,#3db8bf,#80F7C4); z-index:9999;
  transition:width .12s linear; pointer-events:none;
}

/* ----- 顶部固定导航栏 ----- */
.top-nav-bar {
  position:fixed; top:0; left:50%; transform:translateX(-50%); z-index:100;
  max-width:860px; width:74%; display:flex; gap:12px; align-items:center; justify-content:center;
  background:rgba(255,220,225,.50); backdrop-filter:blur(10px);
  border-bottom:1px solid rgba(0,0,0,.06); border-radius:0 0 12px 12px;
  padding:8px 20px; box-shadow:0 1px 8px rgba(0,0,0,.05);
  font-size:.88rem;
}
.top-nav-bar a {
  text-decoration:none; color:#555; padding:5px 14px; border-radius:16px;
  transition:all .2s; white-space:nowrap; font-weight:500;
  display:flex; align-items:center; gap:4px; font-size:.85rem;
}
.top-nav-bar a:hover { background:rgba(61,184,191,.1); color:#3db8bf; }
.top-nav-bar .sep { color:#ddd; margin:0 2px; user-select:none; }
.top-nav-bar .nav-home { font-weight:700; color:#3db8bf; font-size:.9rem; }

/* ----- 回到顶部 ----- */
.back-to-top {
  position:fixed; bottom:24px; right:24px; width:42px; height:42px;
  border-radius:50%; background:#3db8bf; color:#fff; border:none;
  font-size:1.2rem; cursor:pointer; z-index:99; opacity:0;
  transform:translateY(20px); transition:all .3s;
  box-shadow:0 2px 14px rgba(61,184,191,.4);
}
.back-to-top.visible { opacity:1; transform:translateY(0); }
.back-to-top:hover { background:#089ba3; }

/* ----- 移动端适配 ----- */
@media screen and (max-width:1024px) {
  body.typora-export{overflow-x:hidden}
  .typora-export-sidebar { display:none!important; }
  .typora-export-sidebar+#write { margin-left:auto!important; margin-right:auto!important; }
  .typora-export #write {
    margin:0!important; width:100%!important; max-width:100vw!important;
    border-radius:0!important; box-shadow:none!important;
    padding:16px 14px!important; min-height:100vh!important;
  }
  .top-nav-bar {width:92%;max-width:100vw;padding:7px 16px;font-size:.82rem;gap:6px}
  .top-nav-bar a { padding:4px 12px; font-size:.8rem; }
  .back-to-top { bottom:16px; right:16px; width:38px; height:38px; }
}

@media screen and (max-width:768px) {
  body.typora-export { padding-left:0!important; padding-right:0!important; overflow-x:hidden; }
  .typora-export #write { padding:56px 14px 20px!important; max-width:100vw!important; }
  #write img { max-width:100%!important; height:auto!important; max-height:350px; }
  #write table { display:block; overflow-x:auto; max-width:100%; }
  #write pre, #write .highlight { max-width:100%; overflow-x:auto; }
  .top-nav-bar { width:94%;max-width:100vw;border-radius:0 0 10px 10px;padding:6px 12px}
  .top-nav-bar a { padding:3px 10px; font-size:.74rem; }
}

@media screen and (max-width:480px) {
  .typora-export #write { width:100%!important;max-width:100vw!important;padding:50px 8px 16px!important;font-size:.88rem!important }
  #write h1 { font-size:1.2rem!important; }
  #write h2 { font-size:1rem!important; }
  #write img { max-height:240px; }
  .top-nav-bar { width:96%;max-width:100vw;padding:4px 8px;gap:3px }
  .top-nav-bar a { padding:2px 7px; font-size:.68rem; }
  .top-nav-bar .sep { margin:0 1px; }
  .back-to-top { bottom:10px; right:10px; width:34px; height:34px; }
}
