/**
 * 自定义右键菜单 — 参考 codernav.com #acm
 * 毛玻璃圆角 + 主题色 hover 描边 + 暗色适配。
 */
#io-acm {
    position: fixed;
    z-index: 10002;
    display: none;
    --io-acm-color: var(--theme-color, #007AFF);
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(15px) saturate(180%);
    -webkit-backdrop-filter: blur(15px) saturate(180%);
    width: 190px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1), 0 0 0 0px var(--io-acm-color);
    transition: box-shadow 0.3s, border 0.3s, opacity 0.2s, transform 0.2s;
    opacity: 0;
    transform: scale(0.95);
    user-select: none;
    font-size: 14px;
}
#io-acm.io-acm-show {
    opacity: 1;
    transform: scale(1);
}
#io-acm:hover {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1), 0 0 0 2px var(--io-acm-color);
}
#io-acm ul {
    list-style: none;
    margin: 0;
    padding: 0;
}
#io-acm ul li {
    margin: 0;
    padding: 0;
    position: relative;
}
#io-acm ul li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: var(--io-acm-color);
    opacity: 0;
    transition: opacity 0.2s;
    z-index: -1;
    border-radius: 0;
}
#io-acm ul li:hover::before {
    opacity: 0.14;
}
#io-acm ul li a {
    color: #555;
    padding: 9px 16px;
    display: flex;
    align-items: center;
    transition: color 0.2s;
    position: relative;
    z-index: 1;
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
#io-acm ul li a .io-acm-ico,
#io-acm ul li a > i,
#io-acm ul li a > svg {
    /* 统一图标列宽，保证所有菜单项（内置+自定义）文字左对齐 */
    width: 16px !important;
    height: 16px !important;
    margin-right: 12px; /* 图标与文字间距 */
    flex-shrink: 0;
    color: #666;
}
#io-acm ul li a > i {
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    font-size: 14px;
}
#io-acm ul li a .io-acm-ico,
#io-acm ul li a > svg {
    display: block;
    font-size: 14px;
    vertical-align: middle;
}
#io-acm ul li a:hover {
    color: var(--io-acm-color);
}
#io-acm ul li a:hover .io-acm-ico,
#io-acm ul li a:hover > i,
#io-acm ul li a:hover > svg {
    color: var(--io-acm-color);
}
#io-acm ul li.divider {
    height: 1px;
    background: transparent;
    margin: 4px 14px;
    opacity: 0.6;
    border-top: 1px dashed var(--io-acm-color);
}

/* 导航小工具「添加导航」项：作为内置操作项与复制地址/全屏等同区，样式与其他内置项一致。
   禁用态灰显（URL 已存在时不可点击）。 */
#io-acm ul li a.io-acm-nav-disabled {
    opacity: 0.4;
    cursor: default;
    pointer-events: none;
}

/* 顶部快捷导航 */
#io-acm .io-acm-quick-nav {
    display: flex;
    justify-content: space-around;
    padding: 4px 6px;
    margin-top: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 3px;
}
#io-acm .io-acm-quick-nav a {
    border-radius: 6px;
    transition: color 0.25s, transform 0.25s;
    color: rgba(85, 85, 85, 0.9);
    font-size: 16px;
    background: transparent;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    text-decoration: none;
}
#io-acm .io-acm-quick-nav a::before {
    content: "";
    position: absolute;
    inset: 0;
    background: var(--io-acm-color);
    border-radius: 6px;
    opacity: 0;
    transition: opacity 0.25s;
    z-index: -1;
}
#io-acm .io-acm-quick-nav a:hover::before {
    opacity: 0.15;
}
#io-acm .io-acm-quick-nav a:hover {
    color: var(--io-acm-color);
    transform: scale(0.98);
}
#io-acm .io-acm-quick-nav a.nav-disabled {
    opacity: 0.35;
    cursor: not-allowed;
    pointer-events: none;
}

/* 右上角 toast */
#io-acm-tip {
    position: fixed;
    top: 20px;
    right: 8px;
    background: #ff6a00;
    color: #fff;
    padding: 14px 24px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    z-index: 99999;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
    transition: opacity 0.3s;
    max-width: 340px;
    text-align: center;
    line-height: 1.5;
    opacity: 0;
    pointer-events: none;
}

/* 暗色模式 */
.io-black-mode #io-acm {
    background: rgba(30, 30, 30, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.1);
}
.io-black-mode #io-acm ul li a {
    color: #eee;
}
.io-black-mode #io-acm ul li a i {
    color: #bbb;
}
.io-black-mode #io-acm .io-acm-quick-nav a {
    color: rgba(230, 230, 230, 0.9);
}
.io-black-mode #io-acm .io-acm-quick-nav {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
