* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}
body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    max-width: 900px;
    margin: 20px auto;
    padding: 0 16px;
    background-color: #f7f9fc;
    color: #222;
    line-height: 1.7;
    padding-bottom: 100px;
}
h1 {
    text-align: center;
    margin-bottom: 20px;
    color: #1f2937;
}
.search-box-wrap {
    margin-bottom: 24px;
    background:#fff;
    padding:12px;
    border-radius:8px;
    box-shadow:0 1px 4px rgba(0,0,0,0.08);
}
#searchInput {
    width:100%;
    padding: 10px 14px;
    font-size: 16px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    outline: none;
    background: #fff;
}
#searchInput:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59,130,246,0.2);
}

/* ================= 搜索导航面板（支持拖拽） ================= */
.float-nav-panel{
    position: fixed;
    z-index: 999;
    /* 初始定位在右下角 */
    bottom: calc(140px + env(safe-area-inset-bottom,0px)); 
    right: calc(16px + env(safe-area-inset-right,0px));
    background:#ffffff;
    padding:10px;
    border-radius:10px;
    box-shadow:0 2px 12px rgba(0,0,0,0.18);
    display:none; 
    flex-direction: column;
    gap:8px;
    align-items:center;
    /* 拖拽相关设置 */
    user-select: none; /* 防止拖拽时选中文本 */
    touch-action: none; /* 防止拖拽时触发页面滚动 */
    cursor: grab;
}
/* 增加一个顶部的拖拽把手视觉提示 */
.float-nav-panel::before {
    content: "";
    width: 36px;
    height: 4px;
    background-color: #cbd5e1;
    border-radius: 2px;
    margin-bottom: 4px;
    cursor: grab;
}
.float-nav-panel:active {
    cursor: grabbing;
}
.float-nav-panel.show{
    display:flex;
}
.btn-nav{
    width: 100%;
    padding:8px 12px;
    border:1px solid #cbd5e1;
    background:#f8fafc;
    border-radius:6px;
    cursor:pointer;
    font-size:14px;
    white-space: nowrap;
}
.btn-nav:active{
    background:#e2e8f0;
}
.match-counter{
    font-size:13px;
    color:#475569;
    font-weight: 500;
    text-align:center;
    margin-bottom: 4px;
}

/* ================= 置顶按钮 ================= */
.back-to-top {
    position: fixed;
    z-index: 998;
    bottom: calc(80px + env(safe-area-inset-bottom,0px)); 
    right: calc(16px + env(safe-area-inset-right,0px));
    width: 44px;
    height: 44px;
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #3b82f6;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.back-to-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.back-to-top:active {
    transform: scale(0.9);
    background-color: #f1f5f9;
}

/* ================= 内容卡片样式 ================= */
.content-card {
    background: #ffffff;
    padding: 20px 24px;
    border-radius: 10px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    margin-bottom: 16px;
}
.section-title {
    font-size: 18px;
    font-weight: 600;
    margin: 12px 0 8px;
    color: #2563eb;
}
pre {
    background-color: #f1f5f9;
    padding:10px 12px;
    border-radius:6px;
    overflow-x:auto;
    font-size:14px;
}
.search-hl{
    background-color:#fef08a;
}
.search-hl-active{
    background-color:#fb923c;
    color:#000;
}

/* ================= 悬浮按钮公共样式 (新加的) ================= */
.floating-btn {
    position: fixed;
    top: calc(20px + env(safe-area-inset-top, 0px));
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: rgba(26, 35, 51, 0.85);
    border: 1px solid rgba(148, 163, 184, 0.3);
    border-radius: 50%;
    color: #e2e8f0;
    text-decoration: none;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
    font-size: 20px;
}
.floating-btn:active {
    transform: scale(0.9);
}
.btn-left {
    left: calc(20px + env(safe-area-inset-left, 0px));
}
.btn-right {
    right: calc(20px + env(safe-area-inset-right, 0px));
}

/* ================= 手机端适配 ================= */
@media(max-width:600px){
    body{
        margin:12px auto;
        padding-top: 60px; /* 防止悬浮按钮挡住标题 */
    }
    .content-card{padding:14px 16px;}
    .float-nav-panel{right:12px;}
    .back-to-top {right:12px;}
}