/* ============================================================
   版本切换组件（融合自 change.licenseinstaller.dpdns.org）
   仅作用于本组件，不改原站样式
   当前 UI：导航栏下拉版本列表 + 教程区「选择版本」下拉，
           命令/提示不在页面展示，切换版本只影响复制内容与页面文案
   ============================================================ */

.pd-version-switch {
    position: relative;
    display: inline-block;
    vertical-align: middle;
}

.pd-version-switch .pd-current-version {
    font-size: .85em;
    opacity: .85;
    margin-left: 2px;
}

/* ---------- 下拉菜单 ---------- */
.pd-version-menu {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 10px);
    width: 360px;
    max-width: calc(100vw - 24px);
    background: #fff;
    border: 1px solid #e6e9f0;
    border-radius: 12px;
    box-shadow: 0 14px 40px rgba(20, 30, 70, .18);
    z-index: 9999;
    padding: 12px;
    text-align: left;
    color: #333;
    font-weight: 400;
}

.pd-version-menu.show {
    display: block;
}

.pd-menu-head {
    font-size: .82rem;
    font-weight: 700;
    color: #6b7280;
    letter-spacing: .02em;
    padding: 2px 6px 8px;
}

.pd-menu-list {
    overflow-y: auto;
    border: 1px solid #eef0f5;
    border-radius: 8px;
    padding: 4px;
}

.pd-version-item {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 8px 10px;
    border-radius: 6px;
    font-size: .92rem;
    color: #2b3044;
    text-decoration: none;
    white-space: nowrap;
    transition: background .15s;
}

.pd-version-item:hover,
.pd-version-item:focus {
    background: #f3f5fa;
    text-decoration: none;
    color: #2b3044;
}

.pd-version-item.active {
    background: #eef3ff;
    font-weight: 700;
}

.pd-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    flex: 0 0 9px;
    display: inline-block;
}

.pd-version-item .pd-item-name {
    flex: 1 1 auto;
}

.pd-item-num {
    font-weight: 800;
    min-width: 34px;
    text-align: right;
}

/* ---------- 教程区「选择版本」 ---------- */
.pd-version-panel {
    background: #fff;
    border: 1px solid #e6e9f0;
    border-radius: 10px;
    padding: 12px 14px;
    margin: 0 0 14px;
    box-shadow: 0 6px 20px rgba(20, 30, 70, .06);
}

.pd-panel-head {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.pd-panel-label {
    font-size: .86rem;
    font-weight: 700;
    color: #2b3044;
    margin: 0;
}

.pd-select {
    padding: 7px 32px 7px 10px;
    border: 1px solid #d9deea;
    border-radius: 6px;
    font-size: .88rem;
    min-width: 210px;
    outline: none;
    cursor: pointer;
    appearance: none;
    background: #fff url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23333' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center;
}

.pd-select:focus {
    border-color: #026e00;
    box-shadow: 0 0 0 2px rgba(2, 110, 0, .1);
}

.pd-panel-badge {
    font-size: .82rem;
    font-weight: 800;
}

/* ---------- 复制成功居中提示 ---------- */
.pd-copy-toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #026e00;
    color: #fff;
    padding: 12px 24px;
    border-radius: 8px;
    opacity: 0;
    pointer-events: none;
    transition: opacity .3s;
    z-index: 10000;
    font-size: 1rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .18);
}

.pd-copy-toast.show {
    opacity: 1;
}

/* ---------- 移动端适配 ---------- */
@media (max-width: 767px) {
    .pd-version-menu {
        position: fixed;
        left: 12px;
        right: 12px;
        top: 72px;
        width: auto;
        max-width: none;
        max-height: calc(100vh - 88px);
        overflow-y: auto;
    }
    .pd-menu-list {
        max-height: 210px;
    }
    .pd-version-panel {
        padding: 10px;
    }
    .pd-select {
        min-width: 0;
        flex: 1 1 160px;
    }
}
