/* 针对不同内容的颜色微调 (可选) */
.type-ip .copy-text { color: #007bff; }
.type-port .copy-text { color: #28a745; }
.type-doh .copy-text { color: #8728a7; }
.type-ech .copy-text { color: #28a7a7; }
.type-preferred-ip .copy-text { color: #28a781; }

body {
scrollbar-gutter: stable;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    background-color: #f5f5f5;
    gap: 30px; /* 两个示例之间的间距 */
}

/* --- 核心样式 --- */
.copy-item {
    position: relative; /* 为绝对定位的提示框提供参照 */
    display: inline-block;
    cursor: pointer;
    padding: 10px 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    transition: all 0.2s ease;
    user-select: none; /* 防止双击选中文本，优化点击体验 */
    -webkit-tap-highlight-color: transparent;
}

/* 点击时的按压效果 */
.copy-item:active {
    transform: scale(0.98);
    background-color: #fafafa;
}

/* 可复制的文字样式 */
.copy-text {
    font-size: 18px;
    color: #333;
    font-weight: 500;
    pointer-events: none; /* 让点击事件穿透文字直达父容器 */
}

/* --- 悬浮提示框 (默认隐藏) --- */
.copy-tooltip {
    position: absolute;
    bottom: 100%; /* 位于文字上方 */
    left: 50%;
    transform: translateX(-50%) translateY(5px); /* 居中并稍微下移 */
    background-color: #333;
    color: #fff;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55); /* 带有弹性的动画 */
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* 提示框的小三角 */
.copy-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #333 transparent transparent transparent;
}

/* --- 激活状态 (点击后显示) --- */
.copy-item.active .copy-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-5px); /* 向上浮动 */
}





/* 1. 强制始终显示滚动条轨道，占据空间 */
html {
  overflow-y: scroll;
}

/* 2. 自定义滚动条样式，使其在默认状态下“隐形” */
/* 设置滚动条的宽度 */
::-webkit-scrollbar {
  width: 12px; /* 这个宽度就是预留的空间 */
}

/* 设置滚动条轨道（背景） */
::-webkit-scrollbar-track {
  background: transparent; /* 轨道背景透明 */
}

/* 设置滚动滑块（默认透明，看起来像没有滚动条） */
::-webkit-scrollbar-thumb {
  background-color: transparent;
  border-radius: 6px;
}

/* 3. 当鼠标悬停在页面上时，让滑块显现出来 */
html:hover::-webkit-scrollbar-thumb {
  background-color: #c1c1c1; /* 滑块变为可见的灰色 */
}

/* 鼠标悬停在滑块上时，颜色更深 */
::-webkit-scrollbar-thumb:hover {
  background-color: #a8a8a8;
}