/* 
 * X AI 控制面板 - 核心样式表 (style.css)
 * 采用深色系与磨砂玻璃质感 (Glassmorphic Dark Theme) 设计 
 */

/* 根源层局 全局锁死水平溢出 */
html {
    overflow-x: hidden;
    width: 100%;
}

:root {
    --bg-gradient: linear-gradient(135deg, #0f0f15 0%, #1a1a2e 100%);
    --glass-bg: rgba(30, 30, 45, 0.55);
    --glass-border: rgba(255, 255, 255, 0.08);
    --neon-blue: #00f0ff;
    --neon-purple: #9d4edd;
    --neon-pink: #ff007f;
    --text-main: #f8f9fa;
    --text-muted: #a0aec0;
    --card-glow: 0 8px 32px 0 rgba(0, 240, 255, 0.1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Outfit', 'Noto Sans SC', sans-serif;
    user-select: none;
    /* 触控设备上禁用双击缩放，让按钮点击更灵敏 */
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

/* 滑动条允许垂直滚动页面的同时横向拖拽调值 */
input[type="range"] {
    touch-action: pan-y;
}

body {
    background: var(--bg-gradient);
    color: var(--text-main);
    min-height: 100vh;
    width: 100%;          /* 锁定 body 不超出视口宽度 */
    max-width: 100vw;
    overflow-x: hidden;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 20px;
}

.container {
    width: 100%;
    max-width: 1200px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 30px;
    box-shadow: var(--card-glow);
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 30px;
    row-gap: 25px; /* 统一主网格纵向间距为 25px，与其它容器保持一致 */
    position: relative;
    overflow: hidden;  /* 局内绝对定位装饰无法溢出容器 */
    min-width: 0;      /* grid 子项防溢 */
}

/* ======================================================
 * 响应式布局 - 敲三个层级断点：PC / 平板 / 手机
 * PC    ≥ 901px    : 2 列布局
 * 平板  481-900px : 单列布局，保留边距
 * 手机 ≤ 480px   : 极简布局，无边距完全寄满
 * ====================================================== */

/* ---- 平板 (481-900px) ---- */
@media (max-width: 900px) {
    body {
        padding: 12px;
    }

    .container {
        grid-template-columns: 1fr;
        padding: 20px;
        row-gap: 25px; /* 统一移动端单列布局纵向间距为 25px */
        border-radius: 18px;
    }

    .app-title {
        font-size: 22px;
    }

    .header-section {
        gap: 10px;
        padding-bottom: 14px;
    }

    .header-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .form-grid {
        grid-template-columns: 1fr 1fr;
    }

    .checkbox-grid {
        grid-template-columns: 1fr 1fr;
    }

    /* 平板上将键盘选择器宽度调为 90% */
    .keyboard-selector-card {
        width: 95% !important;
        max-width: 600px !important;
    }
}

/* ---- 手机 (max 480px) ---- */
@media (max-width: 480px) {
    body {
        padding: 0;
        align-items: flex-start;
    }

    .container {
        grid-template-columns: 1fr;
        padding: 14px;
        gap: 16px;
        border-radius: 0;           /* 手机全屏展开，去採角 */
        border-left: none;
        border-right: none;
        max-width: 100%;
    }

    /* 标题缩小 */
    .app-title {
        font-size: 18px;
        gap: 6px;
    }

    /* Header 各节 改为垂直堆叠，更易操作 */
    .header-section {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        padding-bottom: 12px;
    }

    .header-license-row {
        width: 100%;
        min-width: unset;
    }

    .header-actions {
        width: 100%;
        flex-wrap: wrap;
        gap: 6px;
    }

    /* 按钮触控目标大小至少 40px ，符合 WCAG 触控标准 */
    .btn {
        padding: 10px 14px;
        font-size: 13px;
        min-height: 40px;
    }

    /* 卡片内当 form-grid 1 列排列 */
    .form-grid {
        grid-template-columns: 1fr;
    }

    /* checkbox 排成单列 */
    .checkbox-grid {
        grid-template-columns: 1fr;
    }

    /* 卡片内边距和圆角缩小 */
    .card {
        padding: 14px;
        border-radius: 14px;
    }

    /* select 和 input 加大触控区域（iOS 退缩进安全） */
    select, input[type="text"], input[type="number"] {
        padding: 12px 10px;
        font-size: 15px;  /* iOS 要民16px 才不自动缩放，14px 也基本天 */
    }

    /* 加大自定义按件选择按钮的高度 */
    .mouse-select-btn,
    .keyboard-select-btn {
        padding: 12px 14px;
        font-size: 15px;
        min-height: 44px;
    }

    /* 模态卡片全幕 */
    .modal-card {
        width: 96% !important;
        max-width: 96% !important;
        padding: 20px 16px;
        border-radius: 18px;
    }

    /* 键盘选择器全屏 */
    .keyboard-selector-card {
        width: 98% !important;
        max-width: 98% !important;
    }

    /* 鼠标选择器适当缩小 */
    .mouse-selector-card {
        max-width: 92% !important;
    }

    /* 标签 Tab 寽手不画面 */
    .tab-btn {
        padding: 8px 12px;
        font-size: 12px;
    }

    /* 將转动范围预览框自动隐藏（手机屏小，无意义展示） */
    .fov-preview-box {
        display: none;
    }

    /* 虽然手机内核心弹出键盘尺寸小，键和按钮对豐到屏宽 */
    .virtual-keyboard {
        padding: 10px;
        gap: 5px;
    }

    .keyboard-row {
        gap: 3px;
    }

    .key {
        height: 32px;
        min-width: 24px;
        font-size: 9px;
        border-radius: 4px;
    }

    .key-space {
        flex: 5;
    }

    /* 信息网格单列展示 */
    .info-grid {
        grid-template-columns: auto 1fr;
    }

    /* 手机上隐藏无内容的备用地址展示行（避免换行） */
    .info-value a {
        font-size: 11px;
    }
}

/* 背景发光微粒装饰 (增加呼吸起伏动画效果) */
@keyframes bgPulse {
    0%, 100% {
        transform: scale(1) translate(0, 0);
        opacity: 0.12;
    }
    50% {
        transform: scale(1.3) translate(15px, 15px);
        opacity: 0.22;
    }
}

.container::before {
    content: '';
    position: absolute;
    width: 180px;
    height: 180px;
    background: var(--neon-blue);
    filter: blur(100px);
    top: -50px;
    left: -50px;
    opacity: 0.15;
    z-index: -1;
    animation: bgPulse 10s ease-in-out infinite;
}

.container::after {
    content: '';
    position: absolute;
    width: 180px;
    height: 180px;
    background: var(--neon-purple);
    filter: blur(100px);
    bottom: -50px;
    right: -50px;
    opacity: 0.15;
    z-index: -1;
    animation: bgPulse 12s ease-in-out infinite reverse;
}

h1, h2, h3 {
    font-weight: 600;
    letter-spacing: 0.5px;
}

.header-section {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 16px;
    /* margin-bottom: 10px; */
}

/* 头部授权配置行 */
.header-license-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;  /* 删除原来的 280px 固定 min-width，防止手机窺展 */
}

.header-license-row input[type="text"] {
    flex: 1;
    padding: 7px 12px;
    font-size: 13px;
    background: rgba(10, 10, 15, 0.7);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    color: var(--text-main);
    outline: none;
    min-width: 0;
}

.header-license-row input[type="text"]:focus {
    border-color: var(--neon-blue);
    box-shadow: 0 0 0 3px rgba(0, 240, 255, 0.08);
}

/* 卡密过期时间徽标 */
.expiry-badge {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--glass-border);
    color: var(--text-sub);
    white-space: nowrap;
}

/* 头部操作按钮区域 */
.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.app-title {
    font-size: 28px;
    font-weight: 800;
    background: linear-gradient(to right, #00f0ff, #9d4edd);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: flex;
    align-items: center;
    gap: 10px;
}

.app-status {
    padding: 8px 16px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ff4d4d;
    box-shadow: 0 0 10px #ff4d4d;
}

.status-dot.active {
    background: #2ed573;
    box-shadow: 0 0 10px #2ed573;
}

.status-dot.paused {
    background: #ffa502;
    box-shadow: 0 0 10px #ffa502;
}

.panel-column {
    display: flex;
    flex-direction: column;
    gap: 25px;
    min-width: 0;  /* flex/grid 子项必须设为 0，否则内容可以不收缩而溢出 */
    overflow: visible; /* 改为 visible 确保悬浮说明 Tooltip 弹出时不会被列容器裁剪 */
}

/* 页面加载时卡片顺序划入的关键帧动画 */
@keyframes cardEntrance {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card {
    background: rgba(20, 20, 30, 0.4);
    border: 1px solid var(--glass-border);
    border-radius: 18px;
    padding: 20px;
    transition: background 0.4s ease, background-color 0.4s ease, border-color 0.4s ease, box-shadow 0.4s cubic-bezier(0.25, 0.8, 0.25, 1), transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1), color 0.4s ease;
    min-width: 0;   /* 确保卡片内容不溢出布局网格 */
    overflow: visible; /* 改为 visible 确保悬浮说明 Tooltip 弹出时不会被卡片容器裁剪 */
    
    /* 顺序渐入加载动画配置 */
    animation: cardEntrance 0.7s cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* 针对两列下的所有卡片定义错开的淡入时间差 */
.panel-column:nth-child(1) .card:nth-child(1) { animation-delay: 0.05s; }
.panel-column:nth-child(1) .card:nth-child(2) { animation-delay: 0.15s; }
.panel-column:nth-child(1) .card:nth-child(3) { animation-delay: 0.25s; }
.panel-column:nth-child(2) .card:nth-child(1) { animation-delay: 0.1s; }
.panel-column:nth-child(2) .card:nth-child(2) { animation-delay: 0.2s; }
.panel-column:nth-child(2) .card:nth-child(3) { animation-delay: 0.3s; }
.panel-column:nth-child(2) .card:nth-child(4) { animation-delay: 0.4s; }

.card:hover {
    transform: translateY(-5px);
    border-color: rgba(0, 240, 255, 0.25);
    box-shadow: var(--card-glow);
}

.card-title {
    font-size: 16px;
    color: var(--neon-blue);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 参数设置网格布局 */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 600;
}

select, input[type="text"], input[type="number"] {
    background: rgba(10, 10, 15, 0.8);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 10px 12px;
    color: var(--text-main);
    font-size: 14px;
    outline: none;
    transition: background 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease, color 0.4s ease;
    width: 100%;
    min-width: 0;
}

select:focus, input[type="text"]:focus, input[type="number"]:focus {
    border-color: var(--neon-blue);
    box-shadow: 0 0 8px rgba(0, 240, 255, 0.2);
}

/* 滑动条及进度样式 */
.slider-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}

.slider-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.slider-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--neon-blue);
}

input[type="range"] {
    -webkit-appearance: none;
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--neon-blue);
    cursor: pointer;
    box-shadow: 0 0 10px var(--neon-blue);
    transition: transform 0.1s;
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

/* 多选框及网格样式 */
.checkbox-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

input[type="checkbox"] {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border: 1px solid var(--glass-border);
    border-radius: 4px;
    background: rgba(10, 10, 15, 0.8);
    outline: none;
    display: grid;
    place-content: center;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
}

input[type="checkbox"]:hover {
    border-color: rgba(0, 240, 255, 0.4);
    box-shadow: 0 0 6px rgba(0, 240, 255, 0.15);
}

input[type="checkbox"]::before {
    content: "";
    width: 10px;
    height: 10px;
    transform: scale(0);
    transition: 0.1s transform ease-in-out;
    background-color: var(--neon-blue);
    clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
}

input[type="checkbox"]:checked {
    border-color: var(--neon-blue);
    background: rgba(0, 240, 255, 0.1);
}

input[type="checkbox"]:checked::before {
    transform: scale(1);
}

.checkbox-label {
    font-size: 14px;
    color: var(--text-main);
}

/* 模型骨骼/识别部位列表 */
.label-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 150px;
    overflow-y: auto;
    padding-right: 5px;
}

.label-list::-webkit-scrollbar {
    width: 6px;
}

.label-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.label-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: rgba(10, 10, 15, 0.5);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
}

/* 控制按钮及选项网格 */
.action-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 15px;
}

.btn {
    padding: 12px 20px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    outline: none;
    border: 1px solid transparent;
    transition: all 0.2s;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.btn-start {
    background: linear-gradient(135deg, #00f0ff 0%, #0072ff 100%);
    color: #101015;
    box-shadow: 0 4px 15px rgba(0, 240, 255, 0.3);
}

.btn-start:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 240, 255, 0.5);
}

.btn-pause {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: var(--text-main);
}

.btn-pause:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--neon-purple);
}

.btn-exit {
    background: rgba(255, 77, 77, 0.1);
    border: 1px solid rgba(255, 77, 77, 0.2);
    color: #ff4d4d;
}

.btn-exit:hover {
    background: #ff4d4d;
    color: #101015;
    box-shadow: 0 4px 15px rgba(255, 77, 77, 0.4);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* 控制台日志打印控制 */
.log-console {
    background: #050508;
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 15px;
    font-family: monospace;
    font-size: 12px;
    color: #39ff14;
    height: 220px;
    overflow-y: auto;
    white-space: pre-wrap;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.8);
}

.log-line {
    margin-bottom: 4px;
    line-height: 1.4;
}

.log-line.error { color: #ff4d4d; }
.log-line.warning { color: #ffa502; }
.log-line.info { color: #00f0ff; }

/* 卡密信息细节展示 */
.info-grid {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 10px 20px;
    font-size: 14px;
}

.info-label {
    color: var(--text-muted);
    font-weight: 600;
}

.info-value {
    color: var(--text-main);
    /* text-align: right; */
}

/* 骨骼模型限制高度和美化滚动条 */
.label-list {
    max-height: 380px;
    overflow-y: auto;
    padding-right: 6px;
}

.label-list::-webkit-scrollbar {
    width: 6px;
}

.label-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 3px;
}

.label-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.label-list::-webkit-scrollbar-thumb:hover {
    background: var(--neon-blue);
}

/* 网页端自定义模态弹窗样式 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(5, 5, 8, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

.modal-card {
    background: rgba(20, 20, 30, 0.9);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid rgba(0, 240, 255, 0.15);
    border-radius: 20px;
    padding: 30px;
    width: 90%;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 15px 45px rgba(0, 240, 255, 0.12), inset 0 0 15px rgba(255, 255, 255, 0.02);
    animation: modalEnter 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalEnter {
    from {
        transform: scale(0.92);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.modal-icon-wrapper {
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
}

/* 模态框中 Font Awesome 字体图标的发光阴影效果 */
.modal-icon-wrapper.error i {
    text-shadow: 0 0 15px rgba(255, 77, 77, 0.6);
}

.modal-icon-wrapper.warning i {
    text-shadow: 0 0 15px rgba(255, 165, 2, 0.6);
}

.modal-icon-wrapper.success i {
    text-shadow: 0 0 15px rgba(46, 213, 115, 0.6);
}

.modal-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 12px;
    letter-spacing: 0.5px;
}

.modal-message {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 25px;
    white-space: pre-line;
}

.modal-btn {
    background: linear-gradient(135deg, #00f0ff 0%, #0072ff 100%);
    color: #101015;
    border: none;
    border-radius: 12px;
    padding: 11px 28px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 240, 255, 0.3);
    transition: all 0.2s;
}

.modal-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 240, 255, 0.5);
}

.modal-btn:active {
    transform: translateY(0);
}

/* 自定义确认模态框中的“取消”按钮样式 */
.modal-btn.cancel {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: var(--text-muted);
    box-shadow: none;
}

.modal-btn.cancel:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
    box-shadow: none;
}

/* 自瞄范围网页端实时预览框 */
.fov-preview-box {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border: 2px solid #ff4d4d;
    box-shadow: 0 0 15px rgba(255, 77, 77, 0.45), inset 0 0 15px rgba(255, 77, 77, 0.2);
    pointer-events: none;
    z-index: 9999;
    box-sizing: border-box;
    background: rgba(255, 77, 77, 0.02);
    border-radius: 6px;
    transition: opacity 0.15s ease;
}

/* 硬件/串流配置标签页切换按钮 */
.tab-header {
    display: flex;
    gap: 8px;
    margin-bottom: 15px;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 10px;
}

.tab-btn {
    flex: 1;
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tab-btn:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(0, 240, 255, 0.3);
}

.tab-btn.active {
    color: #101015;
    background: linear-gradient(135deg, #00f0ff 0%, #0072ff 100%);
    border-color: transparent;
    box-shadow: 0 2px 10px rgba(0, 240, 255, 0.2);
}

/* 隐藏 Chrome, Safari, Edge, Opera 的 number 输入框原生上下微调按钮 */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* 隐藏 Firefox 的 number 输入框原生上下微调按钮 */
input[type="number"] {
    -moz-appearance: textfield;
}

/* 鼠标选择器模态窗专有样式 */
.mouse-selector-card {
    max-width: 340px !important;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* 鼠标主容器 */
.mouse-diagram {
    position: relative;
    width: 160px;
    height: 260px;
    background: rgba(10, 10, 15, 0.6);
    border: 3px solid var(--glass-border);
    border-radius: 80px 80px 60px 60px;
    margin: 20px 0;
    box-shadow: 0 0 25px rgba(0, 0, 0, 0.4), inset 0 0 15px rgba(255, 255, 255, 0.05);
    overflow: visible;
}

/* 鼠标左/右键公共样式 */
.mouse-left, .mouse-right {
    position: absolute;
    top: 0;
    height: 110px;
    width: 77px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.mouse-left {
    left: 0;
    border-radius: 77px 0 0 0;
    border-right: 1px dashed rgba(255, 255, 255, 0.15);
}

.mouse-right {
    right: 0;
    border-radius: 0 77px 0 0;
    border-left: 1px dashed rgba(255, 255, 255, 0.15);
}

/* 鼠标按键激活与悬停样式 */
.mouse-left:hover, .mouse-left.active {
    background: linear-gradient(to bottom, rgba(0, 240, 255, 0.2) 0%, transparent 100%);
    box-shadow: inset 3px 3px 10px rgba(0, 240, 255, 0.15);
}

.mouse-right:hover, .mouse-right.active {
    background: linear-gradient(to bottom, rgba(0, 240, 255, 0.2) 0%, transparent 100%);
    box-shadow: inset -3px 3px 10px rgba(0, 240, 255, 0.15);
}

/* 鼠标滚轮 */
.mouse-wheel {
    position: absolute;
    top: 25px;
    left: 50%;
    transform: translateX(-50%);
    width: 14px;
    height: 40px;
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid var(--glass-border);
    border-radius: 7px;
    z-index: 10;
    cursor: pointer;
    transition: all 0.3s ease;
}

.mouse-wheel:hover, .mouse-wheel.active {
    background: #00f0ff;
    border-color: #00f0ff;
    box-shadow: 0 0 12px rgba(0, 240, 255, 0.8);
}

/* 鼠标下半部分身体 */
.mouse-body {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 150px;
    border-top: 2px solid var(--glass-border);
    border-radius: 0 0 57px 57px;
    pointer-events: none;
}

/* 侧边按键定位 */
.mouse-side {
    position: absolute;
    left: -8px; /* 稍微伸出鼠标边缘，更容易点击且视觉清晰 */
    width: 12px;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid var(--glass-border);
    border-radius: 4px;
    cursor: pointer;
    pointer-events: auto;
    transition: all 0.3s ease;
    z-index: 5;
}

/* 侧键2 - 前侧 */
.mouse-side-forward {
    top: 20px;
    height: 30px;
}

/* 侧键1 - 后侧 */
.mouse-side-back {
    top: 55px;
    height: 30px;
}

.mouse-side:hover, .mouse-side.active {
    background: #00f0ff;
    border-color: #00f0ff;
    box-shadow: 0 0 12px rgba(0, 240, 255, 0.8);
    left: -10px;
    width: 14px;
}

/* 网页按键设置里新的触发按钮样式 */
.mouse-select-btn {
    background: rgba(10, 10, 15, 0.8);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 10px 12px;
    color: var(--neon-blue);
    font-size: 14px;
    font-weight: 600;
    width: 100%;
    text-align: left;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.2s ease;
}

.mouse-select-btn:hover {
    border-color: var(--neon-blue);
    background: rgba(0, 240, 255, 0.05);
    box-shadow: 0 0 8px rgba(0, 240, 255, 0.15);
}

/* 虚拟键盘选择器弹窗布局 */
.keyboard-selector-card {
    max-width: 640px !important;
    width: 90%;
}

.virtual-keyboard {
    width: 100%;
    background: rgba(5, 5, 8, 0.4);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 15px;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.keyboard-row {
    display: flex;
    gap: 6px;
    width: 100%;
    justify-content: flex-start;
}

/* 虚拟键盘按键公共样式 */
.key {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 6px;
    height: 38px;
    min-width: 32px;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: bold;
    cursor: pointer;
    user-select: none;
    transition: all 0.2s ease;
}

.key:hover {
    background: rgba(0, 240, 255, 0.1);
    border-color: var(--neon-blue);
    color: var(--text-main);
    box-shadow: 0 0 8px rgba(0, 240, 255, 0.25);
    transform: translateY(-1px);
}

.key.active {
    background: linear-gradient(135deg, #00f0ff 0%, #0072ff 100%);
    border-color: transparent;
    color: #101015;
    box-shadow: 0 2px 12px rgba(0, 240, 255, 0.4);
    transform: none;
}

/* 特定键盘功能键的缩放比例 */
.key-esc { flex: 1.2; }
.key-spacer { width: 15px; }
.key-backspace { flex: 2.2; background: rgba(255, 255, 255, 0.05); }
.key-tab { flex: 1.6; background: rgba(255, 255, 255, 0.05); }
.key-caps { flex: 1.9; background: rgba(255, 255, 255, 0.05); }
.key-enter { flex: 2.1; background: rgba(255, 255, 255, 0.05); }
.key-shift { flex: 2.6; background: rgba(255, 255, 255, 0.05); }
.key-ctrl { flex: 1.8; background: rgba(255, 255, 255, 0.05); }
.key-alt { flex: 1.8; background: rgba(255, 255, 255, 0.05); }
.key-space { flex: 7; }

/* 导航按键组与方向按键组的自适应排列 */
.key-nav {
    height: 34px;
    font-size: 10px;
}

.arrow-keys-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 120px;
}

.key-arrow {
    width: 34px;
    height: 34px;
    flex: none;
}

/* 网页按键设置里新的触发按钮样式（紫色氛围灯效果） */
.keyboard-select-btn {
    background: rgba(10, 10, 15, 0.8);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 10px 12px;
    color: var(--neon-purple);
    font-size: 14px;
    font-weight: 600;
    width: 100%;
    text-align: left;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.2s ease;
}

.keyboard-select-btn:hover {
    border-color: var(--neon-purple);
    background: rgba(157, 0, 255, 0.05);
    box-shadow: 0 0 8px rgba(157, 0, 255, 0.15);
}

/* ======================================================
 * 系统公告弹窗专属样式 (Announcements Pop-up Styles)
 * ====================================================== */

/* 公告卡片：半透明毛玻璃质感，突出紫色与青色霓虹发光阴影 */
.announcement-card {
    max-width: 500px !important;
    text-align: left !important;
    border: 1px solid rgba(157, 78, 221, 0.25) !important;
    box-shadow: 0 15px 45px rgba(157, 78, 221, 0.15), inset 0 0 15px rgba(255, 255, 255, 0.02) !important;
}

/* 公告头部布局：左右排列 */
.announcement-header {
    display: flex;
    align-items: center;
}

/* 公告标题：主色文本 */
.announcement-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: 0.5px;
}

/* 公告内容排版：限制最大高度且支持纵向滚动，允许文本选择与复制 */
.announcement-content {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.6;
    max-height: 280px;
    overflow-y: auto;
    padding-right: 6px;
    user-select: text;         /* 允许用户选择与复制公告内容 */
    -webkit-user-select: text; /* 兼容 Webkit 内核浏览器 */
}

/* 公告内部小标题 */
.announcement-content h4 {
    font-weight: 700;
    margin-top: 12px;
}

/* 公告内段落样式 */
.announcement-content p {
    margin-bottom: 6px;
    text-align: justify;
}

/* 优化公告滚轮样式，与全局保持一致的微型滚动条 */
.announcement-content::-webkit-scrollbar {
    width: 4px;
}

.announcement-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.01);
    border-radius: 2px;
}

.announcement-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 2px;
}

.announcement-content::-webkit-scrollbar-thumb:hover {
    background: var(--neon-purple);
}

/* 我知道了关闭按钮：紫色氛围霓虹质感 */
.announcement-close-btn {
    width: 100%;
    background: linear-gradient(135deg, var(--neon-purple) 0%, #7b2cbf 100%) !important;
    color: var(--text-main) !important;
    box-shadow: 0 4px 15px rgba(157, 78, 221, 0.3) !important;
}

/* 悬停微动画与更强的发光效果 */
.announcement-close-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(157, 78, 221, 0.5) !important;
}

/* ==========================================
 * 鼠标悬浮说明 Tooltip 样式
 * ========================================== */

/* Tooltip 容器，提供相对定位及悬停触发 */
.tooltip {
    position: relative;
    display: inline-block;
    cursor: pointer;
    margin-left: 6px;
    color: var(--text-muted);
    font-size: 13px;
    transition: color 0.2s ease;
    vertical-align: middle;
}

/* 悬停时激活霓虹青色发光 */
.tooltip:hover {
    color: var(--neon-blue);
}

/* Tooltip 弹出层，采用深色玻璃卡片质感 */
.tooltip .tooltiptext {
    visibility: hidden;
    width: 240px;
    background-color: rgba(18, 18, 28, 0.95);
    color: var(--text-main);
    text-align: left;
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    padding: 10px 14px;
    position: absolute;
    z-index: 999;
    bottom: 135%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    opacity: 0;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1), transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6), 0 0 10px rgba(0, 240, 255, 0.1);
    font-size: 11px;
    line-height: 1.5;
    white-space: normal;
    font-weight: normal;
    pointer-events: none; /* 屏蔽鼠标穿透，防晃动闪烁 */
}

/* Tooltip 尾部指向小三角形 */
.tooltip .tooltiptext::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -6px;
    border-width: 6px;
    border-style: solid;
    border-color: rgba(18, 18, 28, 0.95) transparent transparent transparent;
}

/* 悬停展示与平滑上浮动画 */
.tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* 顶部操作栏专属的字号选择下拉框样式 */
.header-font-select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none; /* 移除浏览器默认的下拉箭头 */
    background: rgba(0, 240, 255, 0.08) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path fill='%2300f0ff' d='M0 0l5 5 5-5z'/></svg>") no-repeat right 12px center;
    background-size: 10px 6px;
    padding: 6px 28px 6px 12px !important;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid var(--neon-blue);
    color: var(--neon-blue);
    cursor: pointer;
    outline: none;
    height: 32px;
    width: auto !important; /* 强制覆盖全局 select 的 100% 宽度，防止撑满整行换行 */
    min-width: 95px; /* 设定最小宽度，保证文字及箭头能完整美观排版 */
    transition: all 0.2s;
}

/* 鼠标悬停时的亮化发光效果 */
.header-font-select:hover {
    background-color: rgba(0, 240, 255, 0.15);
    border-color: rgba(0, 240, 255, 0.4);
    box-shadow: 0 0 8px rgba(0, 240, 255, 0.2);
}

/* ==========================================================================
   全局卡片布局拖动排序样式 (SortableJS 插件集成效果)
   ========================================================================== */

/* 可拖动的卡片标题指示手柄 */
.card-title {
    cursor: grab;
}
.card-title:active {
    cursor: grabbing;
}

/* 拖拽排序中的占位虚线框 (Ghost) */
.sortable-ghost {
    opacity: 0.45;
    border: 2px dashed var(--neon-blue) !important;
    background: rgba(0, 240, 255, 0.05) !important;
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.12) !important;
}

/* 被拖动的卡片悬浮形态 (Drag) */
.sortable-drag {
    opacity: 0.95;
    transform: scale(1.02);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6) !important;
}


