:root {
    --main-bg-color: hsl(0, 0%, 100%);
    --stream-bg-color: hsl(0, 0%, 85%);
    --shell-bg-color: hsl(0, 0%, 0%);
    --text-shadow-color: hsl(218, 67%, 95%);
    --header-bg-color: hsl(0, 0%, 95%);
    --controls-bg-color: hsla(0, 0%, 95%, 0.8);
    --control-buttons-bg-color: hsl(0, 0%, 95%);
    --text-color: hsl(210, 16%, 22%);
    --text-color-light: hsl(200, 16%, 52%);
    --link-color: hsl(218, 85%, 43%);
    --link-color-light: hsl(218, 85%, 73%);
    --link-color_visited: hsl(271, 68%, 32%);
    --link-color_visited-light: hsl(271, 68%, 72%);
    --svg-checkbox-bg-color: hsl(172, 100%, 37%);
    --svg-button-fill: hsl(199, 17%, 46%);
    --kill-button-hover-color: hsl(342, 100%, 37%);
    --url-color: hsl(0, 0%, 60%);
    --button-text-color: hsl(214, 82%, 51%);
    --button-border-color: hsl(0, 0%, 70%);
    --progress-background-color: hsla(225, 100%, 50%, 0.2);
    --progress-background-error-color: hsla(0, 100%, 50%, 0.2);
    --font-size: 14px;
}

@media (prefers-color-scheme: dark) {
    :root {
        --main-bg-color: hsl(0, 0%, 14%);
        --stream-bg-color: hsl(0, 0%, 20%);
        --shell-bg-color: hsl(0, 0%, 0%);
        --text-shadow-color: hsl(218, 17%, 18%);
        --header-bg-color: hsl(0, 0%, 20%);
        --controls-bg-color: hsla(201, 18%, 19%, 0.8);
        --control-buttons-bg-color: hsl(201, 18%, 19%);
        --text-color: hsl(0, 0%, 90%);
        --text-color-light: hsl(0, 0%, 60%);
        --link-color: hsl(218, 63%, 70%);
        --link-color-light: hsl(218, 63%, 50%);
        --link-color_visited: hsl(267, 31%, 47%);
        --link-color_visited-light: hsl(267, 31%, 27%);
        --svg-checkbox-bg-color: hsl(172, 100%, 27%);
        --svg-button-fill: hsl(0, 0%, 100%);
        --kill-button-hover-color: hsl(342, 100%, 27%);
        --url-color: hsl(0, 0%, 60%);
        --device-list-stripe-color: hsl(0, 0%, 16%);
        --device-list-default-color: hsl(0, 0%, 14%);
        --button-text-color: hsl(214, 82%, 76%);
        --button-border-color: hsl(213, 5%, 39%);
        --progress-background-color: hsla(225, 100%, 50%, 0.2);
        --progress-background-error-color: hsla(0, 100%, 50%, 0.2);
    }
}

html {
    font-size: var(--font-size);
}

a {
    color: var(--link-color);
}

a:visited {
    color: var(--link-color_visited);
}

body {
    color: var(--text-color);
    background-color: var(--main-bg-color);
    position: absolute;
    margin: 0;
    height: 100%;
    width: 100%;
    overflow: hidden;
}


body.shell {
    background-color: var(--shell-bg-color);
}

body.stream {
    background-color: var(--stream-bg-color);
}

.terminal-container {
    width: 100%;
    height: 100%;
    padding: 5px;
}

:focus {
    outline: none;
}

.flex-center {
    display: flex;
    align-items: center;
}

.wait {
    cursor: wait;
}

.device-view {
    z-index: 1;
    float: right;
    display: inline-block;
    position: relative;
    /* 移动端适配 */
    max-width: 100vw;
    max-height: 100vh;
    /* 确保不影响子元素交互 */
    pointer-events: none;
}

.device-view > * {
    pointer-events: auto; /* 恢复子元素的点击事件 */
}

.video-layer {
    position: absolute;
    z-index: 0;
    /* 画质优化 */
    image-rendering: -webkit-optimize-contrast;
    image-rendering: high-quality;
    transform: translateZ(0);  /* 启用GPU加速 */
    will-change: transform;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    -webkit-font-smoothing: subpixel-antialiased;
    /* 高质量缩放 */
    -webkit-transform: scale3d(1,1,1); /* 启用硬件加速 */
    transform-style: preserve-3d;
}

.touch-layer {
    position: absolute;
    z-index: 1;
}

.video {
    float: right;
    max-height: 100%;
    max-width: 100%;
    background-color: #000000;
    position: relative;
}

.floating-fullscreen-btn {
    position: absolute;
    bottom: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    padding: 8px;
    background: rgba(0, 0, 0, 0.6);
    border: none;
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    z-index: 10;
    opacity: 0.7;
    transition: opacity 0.2s, transform 0.2s;
}

.floating-fullscreen-btn:hover {
    opacity: 1;
    transform: scale(1.1);
}

.floating-fullscreen-btn svg {
    width: 100%;
    height: 100%;
}

.device-view.fullscreen .floating-fullscreen-btn {
    display: none;
}


.control-buttons-list {
    float: right;
    width: 3.715rem;
    background-color: var(--control-buttons-bg-color);
    position: relative;
    z-index: 100; /* 确保控制按钮在视频层之上 */
}

.control-button {
    margin: .357rem .786rem;
    padding: 0;
    width: 2.143rem;
    height: 2.143rem;
    border: none;
    opacity: 0.75;
    background-color: var(--control-buttons-bg-color);
    position: relative;
    z-index: 101; /* 确保按钮可点击 */
    pointer-events: auto; /* 确保接收点击事件 */
}

.control-button:hover {
    opacity: 1;
}

.control-wrapper > input[type=checkbox] {
    display: none;
}

.control-wrapper > label {
    display: inline-block;
}

.control-button > svg {
    fill: var(--svg-button-fill);
}

.control-wrapper > input[type=checkbox].two-images:checked + label > svg.image-on {
    display: block;
}

.control-wrapper > input[type=checkbox].two-images:not(:checked) + label > svg.image-on {
    display: none;
}

.control-wrapper > input[type=checkbox].two-images:checked + label > svg.image-off {
    display: none;
}

.control-wrapper > input[type=checkbox].two-images:not(:checked) + label > svg.image-off {
    display: block;
}

.control-wrapper > input[type=checkbox]:checked + label > svg {
    fill: var(--svg-checkbox-bg-color);
}

.text-area {
    width: 100%;
    resize: vertical;
}

.more-box {
    display: none;
    position: absolute;
    background-color: var(--controls-bg-color);
    z-index: 2;
    padding: 0 .714rem .714rem .714rem;
}

.text-with-shadow, .more-box label {
    color: var(--text-color);
    text-shadow: var(--text-shadow-color) 0 0 .357rem;
}

.spoiler > input ~ .box {
    display: none;
}

.spoiler > input:checked ~ .box {
    display: block;
}

.spoiler > label::before {
    content: '►';
    margin-right: 5px;
}

.spoiler > input:checked ~ label::before {
    content: '▼';
}

.spoiler > input:checked ~ div {
    display: block;
    padding: 10px;
}

.spoiler > input {
    display: none;
}

/* Modern Toolbox Styles */

/* 
 * 只增强视觉效果，不改变布局和交互
 * 保持原有的 width、margin、padding 设置
 */

.control-buttons-list.control-wrapper {
    background: var(--panel-bg, rgba(30, 30, 30, 0.95));
    border-radius: 12px;
    border: 1px solid var(--panel-border, rgba(255, 255, 255, 0.1));
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.control-buttons-list .control-button {
    border-radius: 8px;
    background: transparent;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.15s ease;
}

.control-buttons-list .control-button:hover {
    background: rgba(255, 255, 255, 0.1);
}

.control-buttons-list .control-button:active {
    transform: scale(0.95);
    background: rgba(255, 255, 255, 0.15);
}

.control-buttons-list .control-button svg {
    transition: fill 0.2s ease;
}

.control-buttons-list .control-button:hover svg {
    fill: var(--svg-checkbox-bg-color, #00d4aa);
}

/* Checkbox buttons (toggles) */
.control-wrapper > input[type=checkbox]:checked + label.control-button {
    background: rgba(0, 212, 170, 0.2);
}

/* Light mode adjustments */
@media (prefers-color-scheme: light) {
    .control-buttons-list.control-wrapper {
        background: rgba(255, 255, 255, 0.98);
        border-color: rgba(0, 0, 0, 0.08);
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    }
    
    .control-buttons-list .control-button:hover {
        background: rgba(0, 0, 0, 0.05);
    }
    
    .control-buttons-list .control-button:active {
        background: rgba(0, 0, 0, 0.1);
    }
}

/* Animation for button press */
@keyframes buttonPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 212, 170, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(0, 212, 170, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(0, 212, 170, 0);
    }
}

.control-buttons-list .control-button.pulse {
    animation: buttonPulse 0.6s ease-out;
}

/* Modern Player Settings Panel */
:root {
    --panel-bg: rgba(30, 30, 30, 0.95);
    --panel-border: rgba(255, 255, 255, 0.1);
    --panel-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    --accent-color: #00d4aa;
    --accent-hover: #00f5c4;
    --accent-glow: rgba(0, 212, 170, 0.3);
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --text-muted: rgba(255, 255, 255, 0.5);
    --input-bg: rgba(255, 255, 255, 0.08);
    --input-border: rgba(255, 255, 255, 0.15);
    --input-focus: rgba(0, 212, 170, 0.5);
    --danger-color: #ff4757;
    --danger-hover: #ff6b7a;
    --success-color: #2ed573;
    --warning-color: #ffa502;
    --slider-track: rgba(255, 255, 255, 0.15);
    --slider-fill: linear-gradient(90deg, #00d4aa, #00f5c4);
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s ease;
    --border-radius-sm: 6px;
    --border-radius-md: 10px;
    --border-radius-lg: 16px;
}

@media (prefers-color-scheme: light) {
    :root {
        --panel-bg: rgba(255, 255, 255, 0.98);
        --panel-border: rgba(0, 0, 0, 0.08);
        --panel-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
        --text-primary: #1a1a2e;
        --text-secondary: rgba(26, 26, 46, 0.7);
        --text-muted: rgba(26, 26, 46, 0.5);
        --input-bg: rgba(0, 0, 0, 0.04);
        --input-border: rgba(0, 0, 0, 0.12);
        --slider-track: rgba(0, 0, 0, 0.12);
    }
}

/* Panel Container */
.modern-settings-panel {
    position: fixed;
    top: 20px;
    right: 80px;
    width: 320px;
    max-height: calc(100vh - 40px);
    max-height: calc(100dvh - 40px);
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--panel-shadow);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 1000;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: translateX(20px) scale(0.95);
    transition: opacity var(--transition-normal), transform var(--transition-normal), visibility var(--transition-normal);
    pointer-events: none;
    visibility: hidden;
}

.modern-settings-panel.visible {
    opacity: 1;
    transform: translateX(0) scale(1);
    pointer-events: auto;
    visibility: visible;
}

/* Panel Header */
.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--panel-border);
    background: linear-gradient(180deg, rgba(255,255,255,0.05) 0%, transparent 100%);
}

.panel-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.panel-title-icon {
    width: 20px;
    height: 20px;
    fill: var(--accent-color);
}

.panel-close-btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: var(--border-radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.panel-close-btn:hover {
    background: var(--input-bg);
    color: var(--text-primary);
}

.panel-close-btn svg {
    width: 16px;
    height: 16px;
}

/* Panel Content */
.panel-content {
    padding: 16px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.panel-content::-webkit-scrollbar {
    width: 6px;
}

.panel-content::-webkit-scrollbar-track {
    background: transparent;
}

.panel-content::-webkit-scrollbar-thumb {
    background: var(--input-border);
    border-radius: 3px;
}

.panel-content::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Settings Section */
.settings-section {
    margin-bottom: 20px;
}

.settings-section:last-child {
    margin-bottom: 0;
}

.section-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--panel-border);
}

.section-icon {
    width: 16px;
    height: 16px;
    fill: var(--accent-color);
    opacity: 0.8;
}

.section-title {
    font-size: 13px;
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0;
    color: var(--text-secondary);
    margin: 0;
}

.settings-card {
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--panel-border);
    border-radius: var(--border-radius-md);
    margin-bottom: 8px;
}

.settings-card:last-child {
    margin-bottom: 0;
}

/* Tab Bar */
.tab-bar {
    display: flex;
    gap: 4px;
    padding: 8px 16px;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid var(--panel-border);
}

.tab-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 10px 8px;
    background: transparent;
    border: none;
    border-radius: var(--border-radius-md);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.tab-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.tab-btn.active {
    background: var(--accent-color);
    color: #000;
}

.tab-btn .tab-icon {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.tab-btn .tab-label {
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

/* Tab Panel */
.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
}

/* Option Label */
.option-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

/* Option Group */
.option-group {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.option-btn {
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--panel-border);
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.option-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.option-btn.selected {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: #000;
}

/* Setting Item */
.setting-item {
    margin-bottom: 16px;
}

.setting-item:last-child {
    margin-bottom: 0;
}

.setting-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.setting-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
}

.setting-value {
    font-size: 12px;
    font-weight: 600;
    color: var(--accent-color);
    font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
    background: var(--input-bg);
    padding: 2px 8px;
    border-radius: var(--border-radius-sm);
    min-width: 60px;
    text-align: center;
}

/* Modern Slider */
.modern-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    background: var(--slider-track);
    border-radius: 3px;
    outline: none;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.modern-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: var(--accent-color);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 8px var(--accent-glow);
    transition: all var(--transition-fast);
}

.modern-slider::-webkit-slider-thumb:hover {
    transform: scale(1.15);
    background: var(--accent-hover);
    box-shadow: 0 4px 12px var(--accent-glow);
}

.modern-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: var(--accent-color);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 8px var(--accent-glow);
    transition: all var(--transition-fast);
}

.modern-slider::-moz-range-thumb:hover {
    transform: scale(1.15);
    background: var(--accent-hover);
}

.modern-slider:focus {
    box-shadow: 0 0 0 3px var(--input-focus);
}

/* Modern Input */
.modern-input {
    width: 100%;
    padding: 10px 14px;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: var(--border-radius-md);
    color: var(--text-primary);
    font-size: 13px;
    transition: all var(--transition-fast);
    box-sizing: border-box;
}

.modern-input:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px var(--input-focus);
}

.modern-input::placeholder {
    color: var(--text-muted);
}

/* Input Group */
.input-group {
    display: flex;
    gap: 10px;
}

.input-group .modern-input {
    flex: 1;
}

.input-suffix {
    display: flex;
    align-items: center;
    padding: 0 12px;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: var(--border-radius-md);
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 500;
}

/* Modern Button */
.modern-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    font-size: 13px;
    font-weight: 600;
    border: none;
    border-radius: var(--border-radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.modern-btn svg {
    width: 16px;
    height: 16px;
}

.modern-btn-primary {
    background: var(--accent-color);
    color: #000;
}

.modern-btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px var(--accent-glow);
}

.modern-btn-secondary {
    background: var(--input-bg);
    color: var(--text-primary);
    border: 1px solid var(--input-border);
}

.modern-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: var(--text-muted);
}

.modern-btn-danger {
    background: var(--danger-color);
    color: #fff;
}

.modern-btn-danger:hover {
    background: var(--danger-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 71, 87, 0.3);
}

.modern-btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    padding: 8px 12px;
}

.modern-btn-ghost:hover {
    background: var(--input-bg);
    color: var(--text-primary);
}

/* Button Group */
.btn-group {
    display: flex;
    gap: 8px;
    margin-top: 16px;
}

.btn-group .modern-btn {
    flex: 1;
}

/* Modern Toggle */
.modern-toggle {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
}

.modern-toggle input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-track {
    width: 44px;
    height: 24px;
    background: var(--slider-track);
    border-radius: 12px;
    transition: all var(--transition-fast);
    position: relative;
}

.toggle-thumb {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: #fff;
    border-radius: 50%;
    transition: all var(--transition-fast);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.modern-toggle input:checked + .toggle-track {
    background: var(--accent-color);
}

.modern-toggle input:checked + .toggle-track .toggle-thumb {
    transform: translateX(20px);
}

.modern-toggle input:focus + .toggle-track {
    box-shadow: 0 0 0 3px var(--input-focus);
}

/* Toggle Item */
.toggle-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
}

.toggle-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
}

.toggle-description {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Quick Actions */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 16px;
}

.quick-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 8px;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: var(--border-radius-md);
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.quick-action-btn svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.quick-action-btn:hover {
    background: rgba(0, 212, 170, 0.1);
    border-color: var(--accent-color);
    color: var(--accent-color);
}

.quick-action-btn:active {
    transform: scale(0.95);
}

/* Preset Buttons */
.preset-group {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.preset-btn {
    padding: 6px 12px;
    font-size: 11px;
    font-weight: 600;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: var(--border-radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.preset-btn:hover {
    background: rgba(0, 212, 170, 0.1);
    border-color: var(--accent-color);
    color: var(--accent-color);
}

.preset-btn.active {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: #000;
}

/* Device Info */
.device-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--input-bg);
    border-radius: var(--border-radius-md);
    margin-bottom: 16px;
}

.device-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--accent-color), var(--accent-hover));
    border-radius: var(--border-radius-sm);
}

.device-icon svg {
    width: 20px;
    height: 20px;
    fill: #000;
}

.device-details {
    flex: 1;
    min-width: 0;
}

.device-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.device-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

.status-dot {
    width: 6px;
    height: 6px;
    background: var(--success-color);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Stats Display */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.stat-card {
    padding: 12px;
    background: var(--input-bg);
    border-radius: var(--border-radius-md);
    text-align: center;
}

.stat-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--accent-color);
    font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
}

.stat-label {
    font-size: 10px;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 4px;
}

/* Textarea */
.modern-textarea {
    width: 100%;
    min-height: 80px;
    padding: 12px;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: var(--border-radius-md);
    color: var(--text-primary);
    font-size: 13px;
    font-family: inherit;
    resize: vertical;
    transition: all var(--transition-fast);
    box-sizing: border-box;
}

.modern-textarea:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px var(--input-focus);
}

/* Divider */
.panel-divider {
    height: 1px;
    background: var(--panel-border);
    margin: 16px 0;
}

/* Tooltip */
.tooltip {
    position: relative;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 6px 10px;
    background: var(--text-primary);
    color: var(--panel-bg);
    font-size: 11px;
    font-weight: 500;
    border-radius: var(--border-radius-sm);
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-fast);
    pointer-events: none;
    z-index: 1001;
}

.tooltip:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-4px);
}

/* Animations */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.settings-section {
    animation: slideIn 0.3s ease forwards;
}

.settings-section:nth-child(1) { animation-delay: 0.05s; }
.settings-section:nth-child(2) { animation-delay: 0.1s; }
.settings-section:nth-child(3) { animation-delay: 0.15s; }
.settings-section:nth-child(4) { animation-delay: 0.2s; }

/* Responsive */
@media (max-width: 400px) {
    .modern-settings-panel {
        width: calc(100vw - 80px);
        right: 50px;
    }
    
    .quick-actions {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Landscape mode - optimize for horizontal screens */
@media (orientation: landscape) and (max-height: 500px) {
    .modern-settings-panel {
        top: 10px;
        max-height: calc(100vh - 20px);
        max-height: calc(100dvh - 20px);
    }
    
    .panel-header {
        padding: 10px 16px;
    }
    
    .panel-content {
        padding: 10px 16px;
    }
    
    .settings-card {
        padding: 8px 10px;
        margin-bottom: 6px;
    }
    
    .tab-bar {
        padding: 6px 12px;
    }
    
    .tab-btn {
        padding: 6px 10px;
    }
}

:root {
    --block-top-padding: 0.5rem;
    --block-bottom-padding: 0.5rem;
    --button-top-padding: 0.2rem;
    --button-bottom-padding: 0.2rem;
    --header-height: 3rem;
    --footer-height: 1.55rem;
}

.dialog-background {
    width: 100%;
    height: 100%;
    position: fixed;
    top: 0;
    left: 0;
    background-color: rgba(0, 0, 0, 0.75);
    z-index: 3;
}

.dialog-container {
    font-family: monospace;
    width: 75%;
    max-width: 30rem;
    min-width: 20rem;
    background-color: var(--main-bg-color);
    /*border-radius: 0.3rem;*/
    overflow: hidden;
}

.dialog-container.ready {
    height: 100%;
    min-height: 100%;
}

.dialog-container button, .dialog-container select, .dialog-container input {
    font-family: monospace;
}

.dialog-container button {
    font-size: var(--font-size);
}

.dialog-container select {
    text-overflow: ellipsis;
}

.dialog-block {
}

.dialog-header {
    background-color: var(--header-bg-color);
    height: var(--header-height);
    overflow: hidden;
    display: flex;
    align-items: center;
    width: auto;
    position: initial;
}

.dialog-header span.dialog-title {
    display: inline-block;
    padding: 0 0.5rem;
}

.dialog-body {
    padding: var(--block-top-padding) 0.5rem var(--block-bottom-padding);
    background-color: var(--control-buttons-bg-color);
    overflow: auto;
}

.dialog-body.hidden {
    height: 0;
    padding: 0;
}

.dialog-body.visible {
    height: calc(
            100%
            - 2 * var(--block-top-padding)
            - 2 * var(--block-bottom-padding)
            - var(--header-height)
            - var(--footer-height)
    );
}

.dialog-footer {
    /*display: flex;*/
    /*flex-direction: row-reverse;*/
    padding: var(--block-top-padding) 0.5rem var(--block-bottom-padding);
    background-color: var(--stream-bg-color);
    height: var(--footer-height);
    overflow: hidden;
}

.dialog-footer span.subtitle {
    font-weight: lighter;
    line-height: var(--footer-height);
    float: left;
}

.dialog-footer button {
    padding: var(--button-top-padding) 0.5rem var(--button-bottom-padding);
    margin: 0 0 0 0.5rem;
    border-radius: 0.3rem;
    /*background-color: var(--main-bg-color);*/
    color: var(--button-text-color);
    border: 1px solid var(--button-border-color);
    cursor: pointer;
    background-color: rgba(0, 0, 0, 0);
    height: var(--footer-height);
    float: right;
}

.dialog-footer button:disabled {
    cursor: not-allowed;
    color: var(--text-color-light);
}

.controls .label {
    grid-column: labels;
}

.controls .input {
    grid-column: controls;
    box-sizing: border-box;
    margin: 0;
    /*height: 2.75ex;*/
}

.controls .button {
    grid-column: controls;
}

.controls {
    display: grid;
    grid-template-columns: [labels] 35% [controls] 65%;
    padding: 1rem;
    grid-gap: 0.2rem;
    align-items: center;
}

:root {
    --device-border-color: hsl(0, 0%, 82%);
    --device-list-stripe-color: hsl(0, 0%, 96%);
    --device-list-default-color: hsl(0, 0%, 100%);
    --device-list-hover-color: hsl(218, 67%, 95%);
}

@media (prefers-color-scheme: dark) {
    :root {
        --device-border-color: hsl(0, 0%, 32%);
        --device-list-stripe-color: hsl(0, 0%, 16%);
        --device-list-default-color: hsl(0, 0%, 14%);
        --device-list-hover-color: hsl(218, 17%, 18%);
    }
}


body.list {
    height: auto;
    width: auto;
    overflow: auto;
}

#devices {
    padding: 20px 0;
    width: 100%;
    height: calc(100% - 40px);
    overflow-y: auto;
}

body.stream #devices {
    background-color: var(--device-list-default-color);
    opacity: .8;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 3;
}

body.list #device_list_menu {
    display: none;
}

#device_list_menu {
    display: block;
    position: absolute;
    bottom: 0;
    left: 0;
    z-index: 4;
}

#devices .device-list button {
    font-size: var(--font-size);
    color: var(--button-text-color);
}

#devices .device-list div.device:nth-child(2n+1){
    background-color: var(--device-list-default-color);
}

#devices .device-list div.device:nth-child(2n){
    background-color: var(--device-list-stripe-color);
}

#devices .device-header {
    padding: 2px 0;
}

#devices .device-header div {
    display: inline-flex;
}

#devices .device-name {
    font-size: 120%;
}

#devices .device-model {
    font-size: 110%;
}

#devices .device-serial {
    color: var(--url-color);
    font-size: 80%;
    margin-left: 6px;
}

#devices .device-version {
    font-size: 100%;
    margin-left: 6px;
    align-items: baseline;
}

#devices .device-version .sdk-version {
    font-size: 75%;
    color: var(--url-color);
    margin-left: 0.2em;
}

#devices .device-state {
    border-radius: 25px;
    background-color: red;
    font-size: 80%;
    margin-left: 6px;
    width: 1em;
    height: 1em;
}

#devices .device.active .device-state {
    background-color: green;
}

#devices .device-list {
    position: relative;
    bottom: 0;
    left: 0;
    width: 100%;
}

#devices .device-list {
    border-spacing: 0;
    border-collapse: collapse;
    font-family: monospace;
    font-size: var(--font-size);
}

#devices .device-list div.device {
    padding: 5px 20px 5px;
}

#devices .device-list div.device:hover {
    background-color: var(--device-list-hover-color)
}

#devices .device-list div.device select {
    color: var(--text-color);
    background-color: var(--main-bg-color);
    margin-left: 0;
    border: none;
}

#devices .device-list div.device:hover select {
    background-color: var(--device-list-hover-color);;
}

#devices .device-list div.desc-block {
    margin: .3em;
    display: inline-flex;
}

#devices .device-list div.desc-block.hidden {
    display: none;
}

#devices .device-list div.desc-block.stream,
#devices .device-list div.desc-block.server_pid,
#devices .device-list div.desc-block.net_interface {
    border: 1px solid var(--device-border-color);
    border-radius: .3em;
    overflow: hidden;
    white-space: nowrap;
}

#devices .device-list div.device div.desc-block.stream button.action-button {
    color: var(--button-text-color);
}

#devices .device-list div.desc-block button {
    fill: var(--text-color)
}

#devices .device-list div.desc-block button > span {
    padding: 0 .5em;
}

#devices .device-list div.desc-block button > span,
#devices .device-list div.desc-block button > svg {
    vertical-align: middle;
}

#devices .device-list div.desc-block button > svg {
    width: var(--font-size);
    height: var(--font-size);
}

#devices .device-list div.desc-block button > svg > path {
    fill: var(--text-color);
}

#devices .device-list .device.not-active div.desc-block button > svg > path {
    fill: var(--text-color-light);
}

#devices .device-list .device.not-active select {
    color: var(--text-color-light);
}

#devices .device-list .device.not-active {
    color: var(--text-color-light);
}

#devices .device-list .device.not-active a {
    color: var(--link-color-light);
}

#devices .device-list .device.not-active a:visited {
    color: var(--link-color_visited-light);
}

#devices .device-list div.device div.desc-block .action-button {
    border: none;
    background-color: rgba(0, 0, 0, 0);
    color: inherit;
}

#devices .device-list div.device div.desc-block .action-button.update-interfaces-button {
    margin-right: 0;
}

#devices .device-list div.device div.desc-block .action-button.active {
    cursor: pointer;
}

#devices .device-list .device.active div.desc-block .action-button:hover {
    color: var(--kill-button-hover-color);
}

#devices .device-list .device.active div.desc-block button.action-button:hover > svg > path {
    fill: var(--kill-button-hover-color);
}

#devices .tracker-name {
    padding: 5px 20px 5px;
    font-size: larger;
    font-weight: bolder;
}

/* Fullscreen Mode Styles */

/* Body in fullscreen mode */
body.fullscreen-mode {
    overflow: hidden !important;
    background: #000 !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Device view in fullscreen */
.device-view.fullscreen {
    position: fixed !important;
    inset: 0 !important;
    z-index: 9998 !important;
    width: 100vw !important;
    height: 100vh !important;
    max-width: none !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 0 !important;
    float: none !important;
    display: block !important;
    background: #000 !important;
}

/* Video container - JS will position and scale it */
.device-view.fullscreen .video {
    border-radius: 0 !important;
    box-shadow: none !important;
    float: none !important;
    background: transparent !important;
}

/* Control buttons hidden by default in fullscreen */
.control-buttons-list.fullscreen-hidden {
    position: fixed !important;
    right: 16px !important;
    top: 50% !important;
    transform: translateY(-50%) translateX(12px) scale(0.96) !important;
    transform-origin: right center;
    z-index: 10000 !important;
    float: none !important;
    width: auto !important;
    opacity: 0;
    pointer-events: none;
    transition: transform 0.3s ease, opacity 0.3s ease;
    display: flex !important;
    flex-direction: column !important;
    background: var(--mdp-surface, #fff) !important;
    border-radius: 12px !important;
    padding: 8px 4px !important;
    gap: 4px !important;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18), 0 2px 8px rgba(0, 0, 0, 0.08) !important;
    border: 1px solid var(--mdp-border, rgba(0, 0, 0, 0.08)) !important;
}

/* Control buttons visible when toggled */
.control-buttons-list.fullscreen-hidden.visible {
    transform: translateY(-50%) translateX(0) scale(1) !important;
    opacity: 1;
    pointer-events: auto;
}

.control-buttons-list.fullscreen-hidden .control-button {
    width: 28px !important;
    height: 26px !important;
    margin: 0 !important;
    padding: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border: none !important;
    border-radius: 4px !important;
    background: transparent !important;
    color: var(--mdp-text-secondary, #616161) !important;
    opacity: 1 !important;
    cursor: pointer;
    transition: all 0.1s;
    box-sizing: border-box;
}

.control-buttons-list.fullscreen-hidden .control-button:hover {
    background: var(--mdp-surface-hover, #f0f0f0) !important;
    color: var(--mdp-text, #242424) !important;
    opacity: 1 !important;
}

.control-buttons-list.fullscreen-hidden .control-button:active {
    transform: scale(0.92);
}

.control-buttons-list.fullscreen-hidden .control-button svg {
    width: 14px !important;
    height: 14px !important;
    fill: currentColor !important;
}

.control-buttons-list.fullscreen-hidden.control-wrapper > input[type=checkbox]:checked + label.control-button {
    background: var(--mdp-accent-light, rgba(0, 120, 212, 0.08)) !important;
    color: var(--mdp-accent, #0078d4) !important;
}

/* Floating toggle button */
.fullscreen-floating-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.8);
    cursor: grab;
    z-index: 10002;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: left 0.18s ease, top 0.18s ease, transform 0.2s ease, background 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
}

.fullscreen-floating-btn.docked-left {
    border-top-left-radius: 16px;
    border-bottom-left-radius: 16px;
}

.fullscreen-floating-btn.docked-right {
    border-top-right-radius: 16px;
    border-bottom-right-radius: 16px;
}

.fullscreen-floating-btn:hover {
    background: rgba(0, 0, 0, 0.8);
    border-color: rgba(255, 255, 255, 0.4);
    color: #fff;
    transform: scale(1.1);
}

.fullscreen-floating-btn.active {
    background: rgba(0, 212, 170, 0.3);
    border-color: rgba(0, 212, 170, 0.6);
    color: #00d4aa;
    box-shadow: 0 6px 20px rgba(0, 212, 170, 0.22);
}

.fullscreen-floating-btn.edge-collapsed,
.fullscreen-floating-btn.edge-collapsed:hover {
    opacity: 0.94;
    transform: none;
}

.fullscreen-floating-btn.edge-collapsed.docked-left {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    justify-content: flex-end;
    padding-right: 4px;
}

.fullscreen-floating-btn.edge-collapsed.docked-right {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    justify-content: flex-start;
    padding-left: 4px;
}

.fullscreen-floating-btn.shifted {
    right: 80px;
}

.fullscreen-floating-btn.dragging,
.fullscreen-floating-btn.dragging:hover {
    cursor: grabbing;
    transform: none;
    transition: none;
}

.fullscreen-floating-btn svg {
    width: 20px;
    height: 20px;
}

/* Settings panel in fullscreen */
body.fullscreen-mode .modern-settings-panel {
    z-index: 10001 !important;
    right: 80px !important;
    top: 20px !important;
}

/* Hide more-box in fullscreen */
.device-view.fullscreen .more-box {
    display: none !important;
}

/* Responsive fullscreen for mobile */
@media (max-width: 768px) {
    .control-buttons-list.fullscreen-hidden.visible {
        right: 8px !important;
        padding: 4px 2px !important;
    }
    
    .fullscreen-floating-btn {
        top: 10px;
        right: 10px;
        width: 40px;
        height: 40px;
    }
    
    body.fullscreen-mode .modern-settings-panel {
        right: 56px !important;
        width: calc(100vw - 72px) !important;
        max-width: 280px !important;
    }
}

/* Double-click hint on video hover */
.device-view .video {
    cursor: pointer;
}

/* ====== Multi-device page fullscreen support (UserDevicePage) ====== */

/* Black overlay behind the fixed video — hides page content in letterbox areas */
body.fullscreen-mode::before {
    content: '';
    position: fixed;
    inset: 0;
    background: #000;
    z-index: 9990;
    pointer-events: none;
}

/* mdp-video-wrapper as fullscreen deviceView:
   position/dimensions are set by JS updateFullscreenLayout(),
   CSS provides fallback fixed positioning + z-index stacking + background.
   JS inline styles override these with precise viewport-aware dimensions. */
.mdp-video-wrapper.fullscreen {
    position: fixed !important;
    z-index: 9998 !important;
    background: #000 !important;
    overflow: hidden !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    margin: 0 !important;
}

.mdp-mobile-focus-window.fullscreen-active {
    position: fixed !important;
    inset: 0 !important;
    z-index: 9997 !important;
    width: 100vw !important;
    height: 100vh !important;
    max-width: none !important;
    max-height: none !important;
    overflow: visible !important;
    transform: none !important;
    will-change: auto !important;
    transition: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    background: #000 !important;
}

.mdp-split-main.fullscreen-active {
    z-index: auto !important;
    overflow: visible !important;
}

.mdp-card.fullscreen-active {
    z-index: auto !important;
    overflow: visible !important;
    background: transparent !important;
    border-color: transparent !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}

.mdp-card.fullscreen-active .mdp-card-header {
    display: none !important;
}

.mdp-card.fullscreen-active .mdp-card-video {
    overflow: visible !important;
    background: transparent !important;
    border-radius: 0 !important;
}

/* mdp-card-controls as control panel in fullscreen — mirrors .control-buttons-list.fullscreen-hidden */
.mdp-card-controls.fullscreen-hidden {
    position: fixed !important;
    right: 16px !important;
    top: 50% !important;
    transform: translateY(-50%) translateX(12px) scale(0.96) !important;
    transform-origin: right center;
    z-index: 10000 !important;
    opacity: 0;
    pointer-events: none;
    transition: transform 0.3s ease, opacity 0.3s ease;
    display: flex !important;
    flex-direction: column !important;
    background: var(--mdp-surface, #fff) !important;
    border-radius: 12px !important;
    padding: 8px 4px !important;
    gap: 4px !important;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18), 0 2px 8px rgba(0, 0, 0, 0.08) !important;
    border: 1px solid var(--mdp-border, rgba(0, 0, 0, 0.08)) !important;
}

.mdp-card-controls.fullscreen-hidden.visible {
    transform: translateY(-50%) translateX(0) scale(1) !important;
    opacity: 1;
    pointer-events: auto;
}

@media (max-width: 768px) {
    .mdp-card-controls.fullscreen-hidden.visible {
        right: 8px !important;
        padding: 4px 2px !important;
    }
}

.control-buttons-list.fullscreen-hidden,
.mdp-card-controls.fullscreen-hidden {
    right: 72px !important;
    top: 20px !important;
    width: min(320px, calc(100vw - 96px)) !important;
    max-height: calc(100vh - 40px) !important;
    max-height: calc(100dvh - 40px) !important;
    transform: translateX(28px) scale(0.96) !important;
    transform-origin: right top;
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    align-content: start !important;
    gap: 8px !important;
    padding: 44px 12px 12px !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
    touch-action: pan-y;
    background: rgba(44, 46, 54, 0.72) !important;
    border: 1px solid rgba(255, 255, 255, 0.16) !important;
    border-radius: 18px !important;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.12) !important;
    backdrop-filter: blur(24px) saturate(140%);
    -webkit-backdrop-filter: blur(24px) saturate(140%);
    color: #fff;
    box-sizing: border-box;
}

.control-buttons-list.fullscreen-hidden::before,
.mdp-card-controls.fullscreen-hidden::before {
    content: '操作';
    position: absolute;
    left: 16px;
    top: 14px;
    color: rgba(255, 255, 255, 0.62);
    font-size: 13px;
    font-weight: 500;
    line-height: 1;
}

.control-buttons-list.fullscreen-hidden.visible,
.mdp-card-controls.fullscreen-hidden.visible {
    transform: translateX(0) scale(1) !important;
}

.control-buttons-list.fullscreen-hidden .control-button,
.mdp-card-controls.fullscreen-hidden .mdp-ctrl-btn {
    width: 100% !important;
    min-width: 0 !important;
    height: 64px !important;
    min-height: 64px !important;
    margin: 0 !important;
    padding: 8px 6px !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    border: 1px solid rgba(255, 255, 255, 0.06) !important;
    border-radius: 12px !important;
    background: rgba(255, 255, 255, 0.14) !important;
    color: rgba(255, 255, 255, 0.92) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
    opacity: 1 !important;
    font-size: 11px;
    line-height: 1.2;
    text-align: center;
    box-sizing: border-box;
}

.control-buttons-list.fullscreen-hidden .control-button:hover,
.mdp-card-controls.fullscreen-hidden .mdp-ctrl-btn:hover {
    background: rgba(255, 255, 255, 0.22) !important;
    color: #fff !important;
}

.control-buttons-list.fullscreen-hidden .control-button:active,
.mdp-card-controls.fullscreen-hidden .mdp-ctrl-btn:active {
    transform: scale(0.96);
}

.control-buttons-list.fullscreen-hidden .control-button svg,
.mdp-card-controls.fullscreen-hidden .mdp-ctrl-btn svg,
.mdp-card-controls.fullscreen-hidden .mdp-ctrl-icon svg {
    width: 20px !important;
    height: 20px !important;
    fill: currentColor !important;
}

.control-buttons-list.fullscreen-hidden .control-button::after,
.mdp-card-controls.fullscreen-hidden .mdp-ctrl-btn[data-display-mode="icon"]::after {
    content: attr(title);
    display: block;
    max-width: 100%;
    overflow: hidden;
    color: rgba(255, 255, 255, 0.78);
    font-size: 11px;
    font-weight: 500;
    line-height: 1.15;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mdp-card-controls.fullscreen-hidden .mdp-ctrl-label {
    color: rgba(255, 255, 255, 0.78);
    font-size: 11px;
}

.mdp-card-controls.fullscreen-hidden .mdp-ctrl-divider {
    grid-column: 1 / -1;
    width: 100%;
    height: 1px;
    margin: 2px 0;
    background: rgba(255, 255, 255, 0.12);
}

.mdp-fullscreen-device-switcher {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
    margin-top: 2px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.mdp-fullscreen-status {
    display: none;
}

.mdp-card-controls.fullscreen-hidden.mdp-fullscreen-switcher-open {
    grid-template-columns: minmax(0, 1fr) !important;
}

.mdp-card-controls.fullscreen-hidden.mdp-fullscreen-switcher-open::before {
    content: '选择设备';
}

.mdp-card-controls.fullscreen-hidden.mdp-fullscreen-switcher-open > :not(.mdp-fullscreen-device-switcher) {
    display: none !important;
}

.mdp-fullscreen-device-switcher.is-open {
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
}

.mdp-fullscreen-switcher-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
}

.mdp-fullscreen-switcher-header span span {
    margin-left: 6px;
    color: rgba(255, 255, 255, 0.58);
    font-size: 11px;
    font-weight: 500;
}

.mdp-fullscreen-switcher-back {
    flex: 0 0 auto;
    height: 28px;
    padding: 0 10px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.86);
    cursor: pointer;
    font-size: 12px;
}

.mdp-fullscreen-switcher-back:hover {
    background: rgba(255, 255, 255, 0.2);
}

.mdp-fullscreen-switcher-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.mdp-fullscreen-device-switcher.is-open .mdp-fullscreen-switcher-list {
    grid-template-columns: minmax(0, 1fr);
}

.mdp-fullscreen-switcher-list.grouped {
    gap: 10px;
}

.mdp-fullscreen-switcher-group {
    display: flex;
    flex-direction: column;
    gap: 7px;
    min-width: 0;
}

.mdp-fullscreen-switcher-group-header {
    width: 100%;
    min-width: 0;
    height: 34px;
    display: grid;
    grid-template-columns: 4px 18px minmax(0, 1fr) auto;
    align-items: center;
    gap: 7px;
    padding: 0 8px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 11px;
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.86);
    cursor: pointer;
    box-sizing: border-box;
    font: inherit;
    text-align: left;
}

.mdp-fullscreen-switcher-group-header:hover {
    background: rgba(255, 255, 255, 0.16);
    border-color: rgba(255, 255, 255, 0.14);
}

.mdp-fullscreen-switcher-group-color {
    width: 4px;
    height: 18px;
    border-radius: 999px;
}

.mdp-fullscreen-switcher-group-caret {
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.64);
    transition: transform 0.16s ease;
}

.mdp-fullscreen-switcher-group.collapsed .mdp-fullscreen-switcher-group-caret {
    transform: rotate(-90deg);
}

.mdp-fullscreen-switcher-group-caret svg {
    width: 15px;
    height: 15px;
}

.mdp-fullscreen-switcher-group-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12px;
    font-weight: 600;
}

.mdp-fullscreen-switcher-group-count {
    min-width: 22px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    color: rgba(255, 255, 255, 0.72);
    font-size: 10px;
    font-weight: 700;
}

.mdp-fullscreen-switcher-group-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 7px;
    min-width: 0;
}

.mdp-fullscreen-switcher-group.collapsed .mdp-fullscreen-switcher-group-body {
    display: none;
}

.mdp-fullscreen-switch-device {
    width: 100%;
    min-width: 0;
    height: 52px;
    display: grid;
    grid-template-columns: 8px minmax(0, 1fr);
    grid-template-rows: 1fr 1fr;
    column-gap: 8px;
    align-items: center;
    padding: 8px 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.9);
    cursor: pointer;
    box-sizing: border-box;
    text-align: left;
    transition: background 0.16s ease, border-color 0.16s ease, transform 0.16s ease;
}

.mdp-fullscreen-switch-device:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.16);
}

.mdp-fullscreen-switch-device:active {
    transform: scale(0.98);
}

.mdp-fullscreen-switch-device-dot {
    grid-row: 1 / 3;
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.34);
}

.mdp-fullscreen-switch-device-dot.streaming {
    background: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.22);
}

.mdp-fullscreen-switch-device-name,
.mdp-fullscreen-switch-device-state {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mdp-fullscreen-switch-device-name {
    align-self: end;
    font-size: 12px;
    font-weight: 600;
}

.mdp-fullscreen-switch-device-state {
    align-self: start;
    color: rgba(255, 255, 255, 0.58);
    font-size: 10px;
}

.mdp-fullscreen-switcher-empty {
    padding: 10px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.58);
    font-size: 12px;
    text-align: center;
}

.control-buttons-list.fullscreen-hidden.control-wrapper > input[type=checkbox]:checked + label.control-button,
.mdp-card-controls.fullscreen-hidden .mdp-ctrl-btn.active,
.mdp-card-controls.fullscreen-hidden .mdp-stream-toggle.active {
    background: #3b82f6 !important;
    border-color: rgba(255, 255, 255, 0.18) !important;
    color: #fff !important;
}

.fullscreen-floating-btn.active {
    background: #3b82f6;
    border-color: rgba(255, 255, 255, 0.35);
    color: #fff;
    box-shadow: 0 10px 28px rgba(59, 130, 246, 0.34);
}

@media (max-width: 768px) {
    .control-buttons-list.fullscreen-hidden,
    .control-buttons-list.fullscreen-hidden.visible,
    .mdp-card-controls.fullscreen-hidden,
    .mdp-card-controls.fullscreen-hidden.visible {
        right: 62px !important;
        top: 10px !important;
        width: min(300px, calc(100vw - 78px)) !important;
        max-height: calc(100vh - 20px) !important;
        max-height: calc(100dvh - 20px) !important;
        padding: 44px 12px 12px !important;
    }
}

@media (max-width: 480px) {
    .control-buttons-list.fullscreen-hidden,
    .mdp-card-controls.fullscreen-hidden {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

body.fullscreen-mode.fullscreen-style-leidian-sidebar {
    --fullscreen-leidian-sidebar-width: 64px;
    --fullscreen-leidian-toolbar-height: 64px;
    --fullscreen-leidian-sidebar-top: 0px;
    --fullscreen-leidian-sidebar-right: 0px;
    --fullscreen-leidian-sidebar-height: 100vh;
    --fullscreen-leidian-status-left: 0px;
    --fullscreen-leidian-status-top: 0px;
    --fullscreen-leidian-status-width: calc(100vw - var(--fullscreen-leidian-sidebar-width));
    --fullscreen-leidian-status-height: 36px;
}

.control-buttons-list.fullscreen-hidden.fullscreen-style-leidian-sidebar,
.mdp-card-controls.fullscreen-hidden.fullscreen-style-leidian-sidebar,
.control-buttons-list.fullscreen-hidden.visible.fullscreen-style-leidian-sidebar,
.mdp-card-controls.fullscreen-hidden.visible.fullscreen-style-leidian-sidebar {
    position: fixed !important;
    right: var(--fullscreen-leidian-sidebar-right, 0px) !important;
    top: var(--fullscreen-leidian-sidebar-top, 0px) !important;
    bottom: auto !important;
    left: auto !important;
    width: var(--fullscreen-leidian-sidebar-width) !important;
    height: var(--fullscreen-leidian-sidebar-height, 100vh) !important;
    max-width: var(--fullscreen-leidian-sidebar-width) !important;
    max-height: var(--fullscreen-leidian-sidebar-height, 100vh) !important;
    transform: none !important;
    transform-origin: right center !important;
    z-index: 10000 !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    display: block !important;
    flex-direction: column !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
    grid-template-columns: none !important;
    gap: 0 !important;
    padding: 0 !important;
    overflow-x: hidden !important;
    overflow-y: scroll !important;
    overscroll-behavior: contain !important;
    touch-action: pan-y !important;
    -webkit-overflow-scrolling: touch;
    /* Firefox 常驻滑块 */
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.35) transparent;
    border: 0 !important;
    border-left: 1px solid rgba(255, 255, 255, 0.12) !important;
    border-radius: 0 !important;
    background: linear-gradient(180deg, rgba(22, 24, 34, 0.98), rgba(14, 16, 24, 0.98)) !important;
    box-shadow: -10px 0 26px rgba(0, 0, 0, 0.34), inset 1px 0 0 rgba(255, 255, 255, 0.05) !important;
    backdrop-filter: blur(12px) saturate(130%);
    -webkit-backdrop-filter: blur(12px) saturate(130%);
    box-sizing: border-box;
}

.control-buttons-list.fullscreen-hidden.fullscreen-style-leidian-sidebar > .mdp-fullscreen-sidebar-scroll-content,
.mdp-card-controls.fullscreen-hidden.fullscreen-style-leidian-sidebar > .mdp-fullscreen-sidebar-scroll-content {
    width: 100%;
    min-height: max-content;
    padding: 8px 4px;
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
    gap: 2px !important;
    box-sizing: border-box;
}

/* WebKit (Chrome / Safari / iOS Safari)：常驻细滑块，让用户直观知道可以上下滚动 */
.control-buttons-list.fullscreen-hidden.fullscreen-style-leidian-sidebar::-webkit-scrollbar,
.mdp-card-controls.fullscreen-hidden.fullscreen-style-leidian-sidebar::-webkit-scrollbar {
    width: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
}

.control-buttons-list.fullscreen-hidden.fullscreen-style-leidian-sidebar::-webkit-scrollbar-track,
.mdp-card-controls.fullscreen-hidden.fullscreen-style-leidian-sidebar::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.06);
    border-radius: 999px;
    margin: 4px 0;
}

.control-buttons-list.fullscreen-hidden.fullscreen-style-leidian-sidebar::-webkit-scrollbar-thumb,
.mdp-card-controls.fullscreen-hidden.fullscreen-style-leidian-sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.38);
    border-radius: 999px;
    min-height: 32px;
}

.control-buttons-list.fullscreen-hidden.fullscreen-style-leidian-sidebar::-webkit-scrollbar-thumb:hover,
.mdp-card-controls.fullscreen-hidden.fullscreen-style-leidian-sidebar::-webkit-scrollbar-thumb:hover,
.control-buttons-list.fullscreen-hidden.fullscreen-style-leidian-sidebar::-webkit-scrollbar-thumb:active,
.mdp-card-controls.fullscreen-hidden.fullscreen-style-leidian-sidebar::-webkit-scrollbar-thumb:active {
    background: rgba(255, 255, 255, 0.6);
}

.control-buttons-list.fullscreen-hidden.fullscreen-style-leidian-sidebar::before,
.mdp-card-controls.fullscreen-hidden.fullscreen-style-leidian-sidebar::before {
    content: none !important;
}

body.fullscreen-mode.fullscreen-style-leidian-sidebar .mdp-fullscreen-status {
    position: fixed;
    left: var(--fullscreen-leidian-status-left, 0px);
    top: var(--fullscreen-leidian-status-top, 0px);
    width: var(--fullscreen-leidian-status-width, calc(100vw - var(--fullscreen-leidian-sidebar-width)));
    height: var(--fullscreen-leidian-status-height, 36px);
    padding: 0 10px;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
    gap: 0;
    z-index: 10000;
    pointer-events: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    background: linear-gradient(180deg, rgba(22, 24, 34, 0.96), rgba(14, 16, 24, 0.92));
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.28), inset 0 -1px 0 rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(12px) saturate(130%);
    -webkit-backdrop-filter: blur(12px) saturate(130%);
    box-sizing: border-box;
}

body.fullscreen-mode.fullscreen-style-leidian-sidebar .mdp-fullscreen-status-name {
    min-width: 0;
    overflow: hidden;
    flex: 1 1 auto;
    color: rgba(255, 255, 255, 0.92);
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
    text-overflow: ellipsis;
    white-space: nowrap;
}

body.fullscreen-mode.fullscreen-style-leidian-sidebar .mdp-fullscreen-latency-badge {
    flex: 0 0 auto;
    min-height: 18px;
    padding: 4px 7px;
    display: inline-flex;
    justify-content: center;
    gap: 4px;
    border-radius: 999px;
    font-size: 11px;
    line-height: 1;
}

body.fullscreen-mode.fullscreen-style-leidian-sidebar .mdp-fullscreen-latency-badge .mdp-latency-badge-icon svg {
    width: 11px;
    height: 11px;
}

.control-buttons-list.fullscreen-hidden.fullscreen-style-leidian-sidebar .control-button,
.mdp-card-controls.fullscreen-hidden.fullscreen-style-leidian-sidebar .mdp-ctrl-btn {
    width: 100% !important;
    min-width: 0 !important;
    height: 54px !important;
    min-height: 54px !important;
    margin: 0 !important;
    padding: 4px 2px !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    flex: 0 0 auto !important;
    gap: 4px !important;
    border: 1px solid transparent !important;
    border-radius: 10px !important;
    background: transparent !important;
    box-shadow: none !important;
    color: rgba(255, 255, 255, 0.86) !important;
    font-size: 10px !important;
    line-height: 1.1 !important;
    text-align: center !important;
    box-sizing: border-box;
}

.control-buttons-list.fullscreen-hidden.fullscreen-style-leidian-sidebar .control-button:hover,
.mdp-card-controls.fullscreen-hidden.fullscreen-style-leidian-sidebar .mdp-ctrl-btn:hover {
    border-color: rgba(255, 255, 255, 0.12) !important;
    background: rgba(255, 255, 255, 0.12) !important;
    color: #fff !important;
}

.control-buttons-list.fullscreen-hidden.fullscreen-style-leidian-sidebar .control-button svg,
.mdp-card-controls.fullscreen-hidden.fullscreen-style-leidian-sidebar .mdp-ctrl-btn svg,
.mdp-card-controls.fullscreen-hidden.fullscreen-style-leidian-sidebar .mdp-ctrl-icon svg {
    width: 20px !important;
    height: 20px !important;
}

.control-buttons-list.fullscreen-hidden.fullscreen-style-leidian-sidebar .control-button::after,
.mdp-card-controls.fullscreen-hidden.fullscreen-style-leidian-sidebar .mdp-ctrl-btn[data-display-mode="icon"]::after {
    color: rgba(255, 255, 255, 0.66);
    font-size: 10px;
    line-height: 1.1;
    max-width: 100%;
}

.mdp-card-controls.fullscreen-hidden.fullscreen-style-leidian-sidebar .mdp-ctrl-label {
    color: rgba(255, 255, 255, 0.7);
    font-size: 10px;
    line-height: 1.1;
}

.mdp-card-controls.fullscreen-hidden.fullscreen-style-leidian-sidebar .mdp-ctrl-divider {
    width: 28px;
    height: 1px;
    min-height: 1px;
    margin: 5px auto;
    flex: 0 0 auto;
    background: rgba(255, 255, 255, 0.14);
}

.mdp-card-controls.fullscreen-hidden.fullscreen-style-leidian-sidebar .mdp-fullscreen-device-switcher {
    width: 100%;
    margin: 0;
    padding: 0;
    border-top: 0;
    flex: 0 0 auto;
}

.mdp-card-controls.fullscreen-hidden.fullscreen-style-leidian-sidebar.mdp-fullscreen-switcher-open {
    grid-template-columns: none !important;
}

.mdp-card-controls.fullscreen-hidden.fullscreen-style-leidian-sidebar.mdp-fullscreen-switcher-open > .mdp-fullscreen-sidebar-scroll-content {
    display: flex !important;
}

.mdp-card-controls.fullscreen-hidden.fullscreen-style-leidian-sidebar.mdp-fullscreen-switcher-open > :not(.mdp-fullscreen-device-switcher),
.mdp-card-controls.fullscreen-hidden.fullscreen-style-leidian-sidebar.mdp-fullscreen-switcher-open > .mdp-fullscreen-sidebar-scroll-content > :not(.mdp-fullscreen-device-switcher) {
    display: flex !important;
}

.mdp-card-controls.fullscreen-hidden.fullscreen-style-leidian-sidebar.mdp-fullscreen-switcher-open > .mdp-ctrl-divider,
.mdp-card-controls.fullscreen-hidden.fullscreen-style-leidian-sidebar.mdp-fullscreen-switcher-open > .mdp-fullscreen-sidebar-scroll-content > .mdp-ctrl-divider {
    display: block !important;
}

.mdp-card-controls.fullscreen-hidden.fullscreen-style-leidian-sidebar .mdp-fullscreen-switch-device,
body.fullscreen-mode.fullscreen-style-leidian-sidebar > .mdp-fullscreen-device-switcher.is-open .mdp-fullscreen-switch-device {
    height: 52px;
    padding: 6px 4px;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto;
    row-gap: 3px;
    justify-items: center;
    text-align: center;
}

.mdp-card-controls.fullscreen-hidden.fullscreen-style-leidian-sidebar .mdp-fullscreen-switch-device-dot,
body.fullscreen-mode.fullscreen-style-leidian-sidebar > .mdp-fullscreen-device-switcher.is-open .mdp-fullscreen-switch-device-dot {
    display: none;
}

.mdp-card-controls.fullscreen-hidden.fullscreen-style-leidian-sidebar .mdp-fullscreen-switch-device-name,
.mdp-card-controls.fullscreen-hidden.fullscreen-style-leidian-sidebar .mdp-fullscreen-switch-device-state,
body.fullscreen-mode.fullscreen-style-leidian-sidebar > .mdp-fullscreen-device-switcher.is-open .mdp-fullscreen-switch-device-name,
body.fullscreen-mode.fullscreen-style-leidian-sidebar > .mdp-fullscreen-device-switcher.is-open .mdp-fullscreen-switch-device-state {
    width: 100%;
    text-align: center;
}

body.fullscreen-mode.fullscreen-style-leidian-sidebar > .mdp-fullscreen-device-switcher.is-open {
    position: fixed;
    right: var(--fullscreen-leidian-sidebar-width);
    top: 12px;
    z-index: 10002;
    width: min(330px, calc(100vw - var(--fullscreen-leidian-sidebar-width) - 24px));
    max-height: calc(100vh - 24px);
    max-height: calc(100dvh - 24px);
    padding: 12px;
    display: flex !important;
    pointer-events: auto;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 18px;
    background: rgba(28, 30, 42, 0.94);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.42);
    backdrop-filter: blur(18px) saturate(135%);
    -webkit-backdrop-filter: blur(18px) saturate(135%);
    overflow-y: auto;
    box-sizing: border-box;
}

body.fullscreen-mode.fullscreen-style-leidian-sidebar.fullscreen-leidian-projected-bottom {
    --fullscreen-leidian-sidebar-width: 0px;
}

.control-buttons-list.fullscreen-hidden.fullscreen-style-leidian-sidebar.fullscreen-leidian-projected-bottom,
.mdp-card-controls.fullscreen-hidden.fullscreen-style-leidian-sidebar.fullscreen-leidian-projected-bottom,
.control-buttons-list.fullscreen-hidden.visible.fullscreen-style-leidian-sidebar.fullscreen-leidian-projected-bottom,
.mdp-card-controls.fullscreen-hidden.visible.fullscreen-style-leidian-sidebar.fullscreen-leidian-projected-bottom {
    right: 0 !important;
    left: 0 !important;
    top: var(--fullscreen-leidian-toolbar-top, auto) !important;
    bottom: var(--fullscreen-leidian-toolbar-bottom, 0px) !important;
    width: 100vw !important;
    height: var(--fullscreen-leidian-toolbar-height) !important;
    max-width: 100vw !important;
    max-height: var(--fullscreen-leidian-toolbar-height) !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 0 !important;
    padding: 0 !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    overscroll-behavior: contain !important;
    touch-action: none !important;
    -webkit-overflow-scrolling: touch;
    border-left: 0 !important;
    border-top: 1px solid rgba(255, 255, 255, 0.12) !important;
    background: linear-gradient(90deg, rgba(22, 24, 34, 0.98), rgba(14, 16, 24, 0.98)) !important;
    box-shadow: 0 -10px 26px rgba(0, 0, 0, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.05) !important;
}

.control-buttons-list.fullscreen-hidden.fullscreen-style-leidian-sidebar.fullscreen-leidian-projected-bottom > .mdp-fullscreen-sidebar-scroll-content,
.mdp-card-controls.fullscreen-hidden.fullscreen-style-leidian-sidebar.fullscreen-leidian-projected-bottom > .mdp-fullscreen-sidebar-scroll-content {
    width: max-content;
    min-width: 100%;
    height: 100%;
    min-height: 100%;
    padding: 4px 8px;
    flex-direction: row-reverse !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 4px !important;
}

body.fullscreen-mode.fullscreen-style-leidian-sidebar.fullscreen-leidian-device-landscape .mdp-fullscreen-status {
    display: none !important;
}

.control-buttons-list.fullscreen-hidden.fullscreen-style-leidian-sidebar.fullscreen-leidian-projected-bottom .control-button,
.mdp-card-controls.fullscreen-hidden.fullscreen-style-leidian-sidebar.fullscreen-leidian-projected-bottom .mdp-ctrl-btn {
    width: 56px !important;
    min-width: 56px !important;
    height: 54px !important;
    min-height: 54px !important;
    flex: 0 0 56px !important;
    transform: rotate(90deg) !important;
    transform-origin: center center !important;
}

.control-buttons-list.fullscreen-hidden.fullscreen-style-leidian-sidebar.fullscreen-leidian-projected-bottom .control-button:active,
.mdp-card-controls.fullscreen-hidden.fullscreen-style-leidian-sidebar.fullscreen-leidian-projected-bottom .mdp-ctrl-btn:active {
    transform: rotate(90deg) scale(0.92) !important;
}

.mdp-card-controls.fullscreen-hidden.fullscreen-style-leidian-sidebar.fullscreen-leidian-projected-bottom .mdp-ctrl-divider {
    width: 1px;
    height: 28px;
    min-height: 28px;
    margin: auto 5px;
}

.mdp-card-controls.fullscreen-hidden.fullscreen-style-leidian-sidebar.fullscreen-leidian-projected-bottom .mdp-fullscreen-device-switcher {
    width: auto;
}

body.fullscreen-mode.fullscreen-style-leidian-sidebar.fullscreen-leidian-projected-bottom > .mdp-fullscreen-device-switcher.is-open {
    right: 12px;
    left: 12px;
    top: 12px;
    bottom: auto;
    width: auto;
    max-height: min(420px, calc(100vh - var(--fullscreen-leidian-toolbar-height) - 24px));
    max-height: min(420px, calc(100dvh - var(--fullscreen-leidian-toolbar-height) - 24px));
}

@media (max-width: 768px) {
    body.fullscreen-mode.fullscreen-style-leidian-sidebar {
        --fullscreen-leidian-sidebar-width: 56px;
        --fullscreen-leidian-toolbar-height: 56px;
    }

    .control-buttons-list.fullscreen-hidden.fullscreen-style-leidian-sidebar,
    .mdp-card-controls.fullscreen-hidden.fullscreen-style-leidian-sidebar,
    .control-buttons-list.fullscreen-hidden.visible.fullscreen-style-leidian-sidebar,
    .mdp-card-controls.fullscreen-hidden.visible.fullscreen-style-leidian-sidebar {
        right: 0 !important;
        top: var(--fullscreen-leidian-sidebar-top, 0px) !important;
        width: var(--fullscreen-leidian-sidebar-width) !important;
        max-width: var(--fullscreen-leidian-sidebar-width) !important;
        padding: 0 !important;
    }

    .control-buttons-list.fullscreen-hidden.fullscreen-style-leidian-sidebar > .mdp-fullscreen-sidebar-scroll-content,
    .mdp-card-controls.fullscreen-hidden.fullscreen-style-leidian-sidebar > .mdp-fullscreen-sidebar-scroll-content {
        padding: 6px 3px;
    }

    .control-buttons-list.fullscreen-hidden.fullscreen-style-leidian-sidebar:not(.fullscreen-leidian-projected-bottom),
    .mdp-card-controls.fullscreen-hidden.fullscreen-style-leidian-sidebar:not(.fullscreen-leidian-projected-bottom),
    .control-buttons-list.fullscreen-hidden.visible.fullscreen-style-leidian-sidebar:not(.fullscreen-leidian-projected-bottom),
    .mdp-card-controls.fullscreen-hidden.visible.fullscreen-style-leidian-sidebar:not(.fullscreen-leidian-projected-bottom) {
        overflow-x: hidden !important;
        /* 强制常驻滑动条，避免 iOS Safari 默认把滚动条隐藏导致用户不知道可以上下滚 */
        overflow-y: scroll !important;
        overscroll-behavior-y: contain !important;
        touch-action: pan-y !important;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
        scrollbar-color: rgba(255, 255, 255, 0.35) transparent;
    }

    .control-buttons-list.fullscreen-hidden.fullscreen-style-leidian-sidebar .control-button,
    .mdp-card-controls.fullscreen-hidden.fullscreen-style-leidian-sidebar .mdp-ctrl-btn {
        height: 50px !important;
        min-height: 50px !important;
    }

    .control-buttons-list.fullscreen-hidden.fullscreen-style-leidian-sidebar:not(.fullscreen-leidian-projected-bottom) .control-button,
    .mdp-card-controls.fullscreen-hidden.fullscreen-style-leidian-sidebar:not(.fullscreen-leidian-projected-bottom) .mdp-ctrl-btn {
        flex: 0 0 auto !important;
        touch-action: pan-y !important;
    }

    .control-buttons-list.fullscreen-hidden.fullscreen-style-leidian-sidebar.fullscreen-leidian-projected-bottom,
    .mdp-card-controls.fullscreen-hidden.fullscreen-style-leidian-sidebar.fullscreen-leidian-projected-bottom,
    .control-buttons-list.fullscreen-hidden.visible.fullscreen-style-leidian-sidebar.fullscreen-leidian-projected-bottom,
    .mdp-card-controls.fullscreen-hidden.visible.fullscreen-style-leidian-sidebar.fullscreen-leidian-projected-bottom {
        width: 100vw !important;
        max-width: 100vw !important;
        height: var(--fullscreen-leidian-toolbar-height) !important;
        max-height: var(--fullscreen-leidian-toolbar-height) !important;
        padding: 0 !important;
    }

    .control-buttons-list.fullscreen-hidden.fullscreen-style-leidian-sidebar.fullscreen-leidian-projected-bottom > .mdp-fullscreen-sidebar-scroll-content,
    .mdp-card-controls.fullscreen-hidden.fullscreen-style-leidian-sidebar.fullscreen-leidian-projected-bottom > .mdp-fullscreen-sidebar-scroll-content {
        padding: 3px 6px;
    }

    .control-buttons-list.fullscreen-hidden.fullscreen-style-leidian-sidebar.fullscreen-leidian-projected-bottom .control-button,
    .mdp-card-controls.fullscreen-hidden.fullscreen-style-leidian-sidebar.fullscreen-leidian-projected-bottom .mdp-ctrl-btn {
        width: 50px !important;
        min-width: 50px !important;
        height: 50px !important;
        min-height: 50px !important;
        flex-basis: 50px !important;
    }
}

/* Modern Device View Container */

/* 
 * 注意：不要覆盖 .device-view 的基础布局样式，
 * 只添加视觉增强效果，保持原有的交互功能
 */

/* Video container with modern styling - 只添加视觉效果 */
.device-view .video {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 
        0 0 0 1px rgba(255, 255, 255, 0.1),
        0 10px 40px rgba(0, 0, 0, 0.3);
    transition: box-shadow 0.3s ease;
}

.device-view .video:hover {
    box-shadow: 
        0 0 0 1px rgba(0, 212, 170, 0.3),
        0 15px 50px rgba(0, 0, 0, 0.4);
}

/* Video layer enhancements - 保持圆角一致 */
.device-view .video-layer {
    border-radius: 12px;
}

.device-view .touch-layer {
    border-radius: 12px;
}

/* Light mode */
@media (prefers-color-scheme: light) {
    .device-view .video {
        box-shadow: 
            0 0 0 1px rgba(0, 0, 0, 0.1),
            0 10px 40px rgba(0, 0, 0, 0.12);
    }
    
    .device-view .video:hover {
        box-shadow: 
            0 0 0 1px rgba(0, 168, 138, 0.3),
            0 15px 50px rgba(0, 0, 0, 0.15);
    }
}

/* Multi-Device Page Styles — Microsoft Fluent-inspired */

/* ====== Light Theme (Default) ====== */
:root,
[data-theme="light"] {
    --mdp-bg: #f5f5f5;
    --mdp-surface: #ffffff;
    --mdp-surface-hover: #f0f0f0;
    --mdp-border: #e0e0e0;
    --mdp-accent: #0078d4;
    --mdp-accent-hover: #106ebe;
    --mdp-accent-light: rgba(0, 120, 212, 0.08);
    --mdp-danger: #d13438;
    --mdp-success: #107c10;
    --mdp-warning: #ffb900;
    --mdp-text: #242424;
    --mdp-text-secondary: #616161;
    --mdp-text-dim: #a0a0a0;
    --mdp-card-radius: 8px;
    --mdp-header-height: 48px;
    --mdp-shadow: 0 2px 4px rgba(0,0,0,0.06), 0 0 1px rgba(0,0,0,0.08);
    --mdp-shadow-hover: 0 4px 12px rgba(0,0,0,0.1);
    --mdp-video-bg: #1a1a1a;
    --mdp-glow-primary: rgba(0, 120, 212, 0.45);
    --mdp-glow-secondary: rgba(0, 120, 212, 0.28);
    --mdp-glow-primary-strong: rgba(0, 120, 212, 0.62);
    --mdp-glow-secondary-strong: rgba(0, 120, 212, 0.4);
}

/* ====== Dark Theme ====== */
[data-theme="dark"] {
    --mdp-bg: #1b1b1b;
    --mdp-surface: #2d2d2d;
    --mdp-surface-hover: #383838;
    --mdp-border: #404040;
    --mdp-accent: #4cc2ff;
    --mdp-accent-hover: #62cdff;
    --mdp-accent-light: rgba(76, 194, 255, 0.1);
    --mdp-danger: #ff6767;
    --mdp-success: #6ccb5f;
    --mdp-warning: #ffb900;
    --mdp-text: #e5e5e5;
    --mdp-text-secondary: #999;
    --mdp-text-dim: #666;
    --mdp-card-radius: 8px;
    --mdp-header-height: 48px;
    --mdp-shadow: 0 2px 4px rgba(0,0,0,0.2);
    --mdp-shadow-hover: 0 4px 12px rgba(0,0,0,0.3);
    --mdp-video-bg: #000;
    --mdp-glow-primary: rgba(76, 194, 255, 0.5);
    --mdp-glow-secondary: rgba(76, 194, 255, 0.3);
    --mdp-glow-primary-strong: rgba(76, 194, 255, 0.7);
    --mdp-glow-secondary-strong: rgba(76, 194, 255, 0.42);
}

.multi-device-page {
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--mdp-bg);
    color: var(--mdp-text);
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, Helvetica, Arial, sans-serif;
    overflow: hidden;
    position: absolute;
    top: 0;
    left: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ====== Header ====== */
.mdp-header {
    display: flex;
    align-items: center;
    padding: 0 16px;
    height: var(--mdp-header-height);
    background: var(--mdp-surface);
    border-bottom: 1px solid var(--mdp-border);
    flex-shrink: 0;
    gap: 10px;
    z-index: 100;
    box-shadow: var(--mdp-shadow);
    overflow: visible;
    min-width: 0;
}

.mdp-header-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    color: var(--mdp-text);
    flex-shrink: 1;
    min-width: 0;
    overflow: hidden;
}

.mdp-header-title svg {
    width: 18px;
    height: 18px;
    fill: var(--mdp-accent);
}

/* （移除）旧的头部「当前分组」徽标 .mdp-header-group-tag —— 已并入 .mdp-group-toggle-btn */

.mdp-header-stats {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 4px;
    font-size: 12px;
    color: var(--mdp-text-secondary);
    flex-shrink: 1;
    min-width: 0;
    overflow: hidden;
}

.mdp-stat-badge {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 10px;
    background: var(--mdp-accent-light);
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mdp-stat-badge .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--mdp-success);
}

.mdp-header-spacer {
    flex: 1;
}

/* ====== Toolbar Toggle ====== */
.mdp-toolbar-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--mdp-text-secondary);
    cursor: pointer;
    transition: all 0.15s;
    padding: 0;
    flex-shrink: 0;
}

.mdp-toolbar-toggle:hover {
    background: var(--mdp-surface-hover);
    color: var(--mdp-text);
}

.mdp-toolbar-toggle.active {
    background: var(--mdp-accent-light);
    color: var(--mdp-accent);
}

.mdp-toolbar-toggle svg {
    width: 18px;
    height: 18px;
}

/* ====== Batch Toggle + Inline Actions ====== */
.mdp-batch-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border: 1px solid var(--mdp-border);
    border-radius: 6px;
    background: var(--mdp-surface);
    color: var(--mdp-text-secondary);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    flex-shrink: 0;
    white-space: nowrap;
}

.mdp-batch-toggle-btn:hover {
    background: var(--mdp-surface-hover);
    color: var(--mdp-text);
    border-color: var(--mdp-accent);
}

.mdp-batch-toggle-btn.active {
    background: var(--mdp-accent-light);
    color: var(--mdp-accent);
    border-color: var(--mdp-accent);
}

.mdp-batch-toggle-btn svg {
    flex-shrink: 0;
}

.mdp-batch-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.mdp-header-logout {
    flex-shrink: 0;
    padding: 4px 8px !important;
    border-radius: 6px;
}

.mdp-header-logout svg {
    width: 16px;
    height: 16px;
}

/* ====== Theme Toggle ====== */
.mdp-theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--mdp-text-secondary);
    cursor: pointer;
    transition: all 0.15s;
    padding: 0;
    flex-shrink: 0;
}

.mdp-theme-toggle:hover {
    background: var(--mdp-surface-hover);
    color: var(--mdp-text);
}

.mdp-theme-toggle svg {
    width: 18px;
    height: 18px;
}

/* ====== Back to Admin Button ====== */
.mdp-back-admin-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 4px;
    border: 1px solid var(--mdp-border);
    background: var(--mdp-surface);
    color: var(--mdp-text);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
    flex-shrink: 0;
    margin-left: 8px;
}

.mdp-back-admin-btn:hover {
    background: var(--mdp-primary);
    color: #fff;
    border-color: var(--mdp-primary);
}

.mdp-back-admin-btn svg {
    width: 14px;
    height: 14px;
}

/* ====== Header Controls Wrapper (Collapsible Dropdown) ====== */
.mdp-header-controls-wrapper {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    position: relative;
}

.mdp-collapse-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 6px;
    background: var(--mdp-accent-light);
    color: var(--mdp-accent);
    cursor: pointer;
    transition: all 0.15s;
    padding: 0;
    flex-shrink: 0;
}

.mdp-collapse-btn:hover {
    background: var(--mdp-surface-hover);
    color: var(--mdp-text);
}

.mdp-collapse-btn svg {
    width: 18px;
    height: 18px;
}

/* Arrow directions: up arrow when expanded, down arrow when collapsed */
.mdp-collapse-btn .arrow-up { display: block; }
.mdp-collapse-btn .arrow-down { display: none; }
.mdp-collapse-btn.collapsed .arrow-up { display: none; }
.mdp-collapse-btn.collapsed .arrow-down { display: block; }

/* Controls dropdown panel — positioned below the header */
.mdp-header-controls-wrapper .mdp-header-controls {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--mdp-surface);
    border: 1px solid var(--mdp-border);
    border-radius: 10px;
    padding: 10px 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12), 0 0 1px rgba(0,0,0,0.1);
    z-index: 1000;
    min-width: 300px;
    max-width: 90vw;
    flex-wrap: wrap;
    gap: 8px;
    animation: mdp-dropdown-in 0.18s ease;
}

@keyframes mdp-dropdown-in {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* When collapsed, hide the dropdown panel */
.mdp-header-controls-wrapper.collapsed .mdp-header-controls {
    display: none;
}

/* Mobile toggle button — hidden on desktop, shown on mobile */
.mdp-toggle-btn-mobile {
    display: none;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border: 1px solid var(--mdp-border);
    border-radius: 6px;
    background: var(--mdp-surface);
    color: var(--mdp-text-secondary);
    cursor: pointer;
    font-size: 11px;
    font-family: inherit;
    font-weight: 500;
    flex-shrink: 0;
    transition: all 0.15s;
}

.mdp-toggle-btn-mobile:hover {
    background: var(--mdp-surface-hover);
    color: var(--mdp-text);
}

.mdp-toggle-btn-mobile svg {
    width: 14px;
    height: 14px;
}

.mdp-toggle-btn-mobile .arrow-up { display: block; }
.mdp-toggle-btn-mobile .arrow-down { display: none; }
.mdp-toggle-btn-mobile.collapsed .arrow-up { display: none; }
.mdp-toggle-btn-mobile.collapsed .arrow-down { display: block; }

@media (max-width: 768px) {
    .mdp-collapse-btn {
        display: none;
    }

    .mdp-toggle-btn-mobile {
        display: flex;
    }

    .mdp-header-controls-wrapper .mdp-header-controls {
        position: fixed;
        top: 44px;
        left: 0;
        right: 0;
        border-radius: 0 0 10px 10px;
        border-left: none;
        border-right: none;
        min-width: 0;
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

@media (max-width: 480px) {
    .mdp-header-controls-wrapper .mdp-header-controls {
        top: 40px;
    }
}

/* ====== Collapsible Toolbar Panel ====== */
.mdp-toolbar-panel {
    display: none;
    background: var(--mdp-surface);
    border-bottom: 1px solid var(--mdp-border);
    padding: 10px 16px;
    flex-shrink: 0;
    z-index: 99;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
    animation: mdp-slide-down 0.2s ease;
}

.mdp-toolbar-panel.open {
    display: block;
}

@keyframes mdp-slide-down {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.mdp-toolbar-inner {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    overflow: visible;
}

.mdp-header-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    flex-shrink: 0;
}

.mdp-header-group {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border: 1px solid var(--mdp-border);
    border-radius: 6px;
    background: var(--mdp-bg);
}

.mdp-group-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--mdp-text-secondary);
    white-space: nowrap;
    letter-spacing: 0.5px;
}

.mdp-select {
    background: var(--mdp-surface);
    color: var(--mdp-text);
    border: 1px solid var(--mdp-border);
    border-radius: 4px;
    padding: 5px 8px;
    font-size: 12px;
    cursor: pointer;
    outline: none;
    transition: border-color 0.15s;
    font-family: inherit;
}

.mdp-select:hover,
.mdp-select:focus {
    border-color: var(--mdp-accent);
}

.mdp-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 5px 12px;
    border: 1px solid var(--mdp-border);
    border-radius: 4px;
    background: var(--mdp-surface);
    color: var(--mdp-text);
    font-size: 12px;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.1s;
    white-space: nowrap;
}

.mdp-btn:hover {
    background: var(--mdp-surface-hover);
    border-color: var(--mdp-accent);
}

.mdp-btn:active {
    transform: scale(0.97);
}

.mdp-btn svg {
    width: 14px;
    height: 14px;
}

.mdp-btn-primary {
    background: var(--mdp-accent);
    border-color: var(--mdp-accent);
    color: #fff;
}

.mdp-btn-primary:hover {
    background: var(--mdp-accent-hover);
}

.mdp-btn-danger {
    border-color: var(--mdp-danger);
    color: var(--mdp-danger);
}

.mdp-btn-danger:hover {
    background: rgba(209, 52, 56, 0.08);
}

.mdp-back-link {
    color: var(--mdp-text-secondary);
    text-decoration: none;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 5px 8px;
    border-radius: 4px;
    transition: all 0.15s;
}

.mdp-back-link:hover {
    color: var(--mdp-text);
    background: var(--mdp-surface-hover);
}

.mdp-back-link svg {
    width: 14px;
    height: 14px;
}

/* ====== Desktop Sidebar Navigation ====== */
.mdp-sidebar {
    display: none;
    flex-direction: column;
    width: 64px;
    min-width: 64px;
    height: 100%;
    background: var(--mdp-surface);
    border-right: 1px solid var(--mdp-border);
    z-index: 110;
    flex-shrink: 0;
    transition: width 0.2s cubic-bezier(.4,0,.2,1), min-width 0.2s cubic-bezier(.4,0,.2,1);
    overflow: hidden;
    user-select: none;
}

.mdp-sidebar.expanded {
    width: 200px;
    min-width: 200px;
}

/* Sidebar toggle (hamburger) */
.mdp-sidebar-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 48px;
    border: none;
    background: none;
    color: var(--mdp-text-secondary);
    cursor: pointer;
    flex-shrink: 0;
    padding: 0 20px;
    transition: color 0.15s;
}

.mdp-sidebar-toggle:hover {
    color: var(--mdp-text);
}

.mdp-sidebar-toggle svg {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
}

/* Sidebar nav items */
.mdp-sidebar-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 8px 8px;
    overflow-y: auto;
    overflow-x: hidden;
}

.mdp-sidebar-item {
    display: flex;
    align-items: center;
    gap: 12px;
    height: 42px;
    padding: 0 14px;
    border: none;
    border-radius: 8px;
    background: none;
    color: var(--mdp-text-secondary);
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    white-space: nowrap;
    overflow: hidden;
    transition: all 0.15s;
    flex-shrink: 0;
}

.mdp-sidebar-item:hover {
    background: var(--mdp-surface-hover);
    color: var(--mdp-text);
}

.mdp-sidebar-item.active {
    background: var(--mdp-accent-light);
    color: var(--mdp-accent);
    font-weight: 600;
}

.mdp-sidebar-item svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.mdp-sidebar-item span {
    opacity: 0;
    transition: opacity 0.15s;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mdp-sidebar.expanded .mdp-sidebar-item span {
    opacity: 1;
}

/* Sidebar badge (device count etc.) */
.mdp-sidebar-badge {
    margin-left: auto;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: var(--mdp-accent);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.15s;
    flex-shrink: 0;
}

.mdp-sidebar.expanded .mdp-sidebar-badge {
    opacity: 1;
}

/* Sidebar bottom section */
.mdp-sidebar-bottom {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 8px;
    border-top: 1px solid var(--mdp-border);
    flex-shrink: 0;
}

.mdp-sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    overflow: hidden;
    white-space: nowrap;
}

.mdp-sidebar-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--mdp-accent-light);
    color: var(--mdp-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
}

.mdp-sidebar-username {
    font-size: 12px;
    font-weight: 600;
    color: var(--mdp-text);
    overflow: hidden;
    text-overflow: ellipsis;
    opacity: 0;
    transition: opacity 0.15s;
}

.mdp-sidebar.expanded .mdp-sidebar-username {
    opacity: 1;
}

/* ====== My Devices Panel (desktop sidebar) ====== */
.mdp-my-devices-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 12px;
    border: 1px solid var(--mdp-border);
    background: var(--mdp-surface);
    color: var(--mdp-text);
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}

.mdp-my-devices-btn:hover {
    background: var(--mdp-surface-hover);
    color: var(--mdp-text);
    border-color: var(--mdp-accent);
}

.mdp-my-devices-btn.active {
    background: var(--mdp-accent-light);
    color: var(--mdp-accent);
    border-color: var(--mdp-accent);
}

.mdp-my-devices-btn svg {
    flex-shrink: 0;
}

/* ====== Arrange Windows Button (desktop only) ====== */
.mdp-arrange-windows-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: var(--mdp-surface);
    color: var(--mdp-text-secondary);
    border: 1px solid var(--mdp-border);
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.mdp-arrange-windows-btn:hover {
    background: var(--mdp-surface-hover);
    color: var(--mdp-text);
    border-color: var(--mdp-accent);
}

/* 当存在可见放大窗口时，按钮被高亮显示，提示用户可以使用 */
.mdp-arrange-windows-btn.mdp-arrange-windows-btn-active {
    background: var(--mdp-accent-light);
    color: var(--mdp-accent);
    border-color: var(--mdp-accent);
}

.mdp-arrange-windows-btn svg {
    flex-shrink: 0;
}

/* 移动端隐藏「排列窗口」按钮（仅桌面端有放大悬浮窗概念） */
.multi-device-page.has-bottom-nav .mdp-arrange-windows-btn {
    display: none !important;
}

/* 面板默认隐藏 */
.mdp-devices-panel {
    display: none;
    flex-direction: column;
    background: var(--mdp-surface);
    min-height: 0;
    flex: 1;
    overflow: hidden;
}

/* 仅当 has-devices-panel 激活时显示面板 */
.mdp-sidebar.has-devices-panel .mdp-devices-panel {
    display: flex;
}

/* 面板激活时：侧边栏加宽 + 隐藏 hamburger 与 nav 入口（允许未 expanded 状态直接显示） */
.mdp-sidebar.has-devices-panel {
    width: 280px;
    min-width: 280px;
}

.mdp-sidebar.has-devices-panel .mdp-sidebar-toggle,
.mdp-sidebar.has-devices-panel .mdp-sidebar-nav {
    display: none;
}

/* 面板激活时底部区域（主题/用户/退出）展开显示文字（无论之前是否 expanded） */
.mdp-sidebar.has-devices-panel .mdp-sidebar-item span,
.mdp-sidebar.has-devices-panel .mdp-sidebar-username {
    opacity: 1;
}

/* ====== Panel Head ====== */
.mdp-devices-panel-head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--mdp-border);
    background: var(--mdp-bg);
    flex-shrink: 0;
}

.mdp-devices-panel-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--mdp-text);
    flex: 1;
    min-width: 0;
}

.mdp-devices-panel-title svg {
    width: 16px;
    height: 16px;
    color: var(--mdp-accent);
    flex-shrink: 0;
}

.mdp-devices-panel-title span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mdp-devices-panel-head-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.mdp-devices-panel-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 4px;
    background: transparent;
    color: var(--mdp-text-secondary);
    cursor: pointer;
    transition: all 0.15s;
}

.mdp-devices-panel-btn:hover {
    background: var(--mdp-surface-hover);
    color: var(--mdp-text);
    border-color: var(--mdp-border);
}

.mdp-devices-panel-btn svg {
    width: 14px;
    height: 14px;
}

/* 选中提示条 */
.mdp-devices-panel-hint {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: var(--mdp-accent-light);
    color: var(--mdp-accent);
    font-size: 11px;
    border-bottom: 1px solid var(--mdp-border);
    flex-wrap: wrap;
    flex-shrink: 0;
}

.mdp-devices-panel-hint b {
    font-weight: 700;
}

.mdp-devices-panel-hint-btn {
    padding: 2px 8px;
    border: 1px solid currentColor;
    background: transparent;
    color: inherit;
    font-size: 11px;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.15s;
}

.mdp-devices-panel-hint-btn:hover {
    background: var(--mdp-accent);
    color: #fff;
    border-color: var(--mdp-accent);
}

/* 主滚动区 */
.mdp-devices-panel-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 4px 0;
}

.mdp-devices-panel-body::-webkit-scrollbar {
    width: 6px;
}

.mdp-devices-panel-body::-webkit-scrollbar-thumb {
    background: var(--mdp-border);
    border-radius: 3px;
}

.mdp-devices-panel-drop-tail {
    margin: 12px 8px;
    padding: 10px;
    border: 1px dashed var(--mdp-border);
    border-radius: 6px;
    text-align: center;
    font-size: 11px;
    color: var(--mdp-text-dim);
    transition: all 0.15s;
}

.mdp-devices-panel-drop-tail.drop-hover {
    border-color: var(--mdp-accent);
    background: var(--mdp-accent-light);
    color: var(--mdp-accent);
}

/* ====== 分组 section ====== */
.mdp-devices-group {
    padding: 0 6px;
    margin-bottom: 2px;
}

.mdp-devices-group-hidden {
    opacity: 0.55;
}

.mdp-devices-group-header {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s;
    user-select: none;
}

.mdp-devices-group-header:hover {
    background: var(--mdp-surface-hover);
}

.mdp-devices-group-header.drop-hover {
    background: var(--mdp-accent-light);
    outline: 2px dashed var(--mdp-accent);
    outline-offset: -2px;
}

.mdp-devices-group-color {
    width: 4px;
    align-self: stretch;
    border-radius: 2px;
    flex-shrink: 0;
}

.mdp-devices-group-caret {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--mdp-text-secondary);
    transition: transform 0.15s;
}

.mdp-devices-group-caret.collapsed {
    transform: rotate(-90deg);
}

.mdp-devices-group-caret svg {
    width: 14px;
    height: 14px;
}

.mdp-devices-group-name {
    flex: 1;
    min-width: 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--mdp-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mdp-devices-group-count {
    min-width: 20px;
    height: 18px;
    padding: 0 6px;
    border-radius: 9px;
    background: var(--mdp-border);
    color: var(--mdp-text-secondary);
    font-size: 10px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.mdp-devices-group-ops {
    display: flex;
    align-items: center;
    gap: 2px;
    opacity: 0;
    transition: opacity 0.15s;
    flex-shrink: 0;
}

.mdp-devices-group-header:hover .mdp-devices-group-ops,
.mdp-devices-group-hidden .mdp-devices-group-ops {
    opacity: 1;
}

.mdp-devices-group-op {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    padding: 0;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 4px;
    color: var(--mdp-text-secondary);
    cursor: pointer;
    transition: all 0.15s;
}

.mdp-devices-group-op:hover {
    background: var(--mdp-surface);
    border-color: var(--mdp-border);
    color: var(--mdp-text);
}

.mdp-devices-group-op-danger:hover {
    color: var(--mdp-danger);
    border-color: var(--mdp-danger);
}

.mdp-devices-group-op svg {
    width: 12px;
    height: 12px;
}

/* 分组内设备列表 */
.mdp-devices-group-list {
    padding: 2px 0 6px 20px;
}

.mdp-devices-group-empty {
    padding: 6px 10px;
    font-size: 11px;
    color: var(--mdp-text-dim);
    font-style: italic;
}

.mdp-devices-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 8px;
    border-radius: 4px;
    cursor: grab;
    transition: background 0.1s;
    user-select: none;
}

.mdp-devices-row:hover {
    background: var(--mdp-surface-hover);
}

.mdp-devices-row:active {
    cursor: grabbing;
}

.mdp-devices-row.dragging {
    opacity: 0.4;
}

.mdp-devices-row-check {
    margin: 0;
    flex-shrink: 0;
    width: 14px;
    height: 14px;
    cursor: pointer;
    accent-color: var(--mdp-accent);
}

.mdp-devices-row-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

.mdp-devices-row-dot.online {
    background: var(--mdp-success, #16a34a);
    box-shadow: 0 0 4px var(--mdp-success, #16a34a);
}

.mdp-devices-row-dot.offline {
    background: var(--mdp-text-dim);
}

.mdp-devices-row-name {
    flex: 1;
    min-width: 0;
    font-size: 12px;
    color: var(--mdp-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 管理员模式隐藏「我的设备」按钮（冗余保护） */
.multi-device-page:not(.has-sidebar) .mdp-my-devices-btn {
    display: none !important;
}

/* 移动端隐藏「我的设备」按钮 */
.multi-device-page.has-bottom-nav .mdp-my-devices-btn {
    display: none !important;
}

/* ====================================================================
   Mobile Group Panel (分组栏)
   ==================================================================== */

/* "分组" 切换按钮：标准圆矩形，与 .mdp-batch-toggle-btn 视觉一致 */
.mdp-group-toggle-btn {
    display: none;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border: 1px solid var(--mdp-border);
    border-radius: 6px;
    background: var(--mdp-surface);
    color: var(--mdp-text-secondary);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
    flex-shrink: 0;
    font-family: inherit;
    line-height: 1.2;
}

.mdp-group-toggle-btn:hover {
    background: var(--mdp-surface-hover);
    border-color: var(--mdp-accent);
    color: var(--mdp-text);
}

.mdp-group-toggle-btn.active {
    background: var(--mdp-accent-light);
    color: var(--mdp-accent);
    border-color: var(--mdp-accent);
}

.mdp-group-toggle-btn svg {
    flex-shrink: 0;
    width: 14px;
    height: 14px;
}

/* 按钮内「当前分组」色块（替代文件夹图标） */
.mdp-group-toggle-btn .mdp-group-toggle-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* 按钮内标签文字：超出省略 */
.mdp-group-toggle-btn .mdp-group-toggle-label {
    max-width: 96px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 按钮内「已记住」pin 图标（仅 sticky 时显示）*/
.mdp-group-toggle-btn .mdp-group-toggle-pin {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 12px;
    height: 12px;
    color: currentColor;
    flex-shrink: 0;
    opacity: 0.85;
}

/* 「有过滤器」态：按钮高亮为 accent 色 + 主文本色；点击语义 = 清除过滤 */
.mdp-group-toggle-btn.mdp-group-toggle-btn-filtered {
    color: var(--mdp-accent);
    border-color: var(--mdp-accent);
    background: var(--mdp-accent-light);
}

.mdp-group-toggle-btn.mdp-group-toggle-btn-filtered:hover {
    background: var(--mdp-accent);
    color: #fff;
    border-color: var(--mdp-accent);
}

/* 记住了该分组：加粗边框 */
.mdp-group-toggle-btn.mdp-group-toggle-btn-sticky {
    border-width: 1.5px;
}

.multi-device-page.has-bottom-nav .mdp-group-toggle-btn {
    display: inline-flex;
}

/* 分组操作行：默认隐藏（toggle 切换），横向排列 */
.mdp-group-actions {
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--mdp-surface);
    border-bottom: 1px solid var(--mdp-border);
    box-sizing: border-box;
}

.mdp-group-actions .mdp-btn {
    flex-shrink: 0;
}

/* 批量加入分组按钮：语义独立于"新建"，用淡色背景 + 主色边框区分 */
.mdp-group-action-assign {
    background: var(--mdp-accent-light) !important;
    color: var(--mdp-accent) !important;
    border-color: var(--mdp-accent) !important;
}

.mdp-group-action-assign:hover {
    background: var(--mdp-accent) !important;
    color: #fff !important;
}

/* 「记住/已记住」按钮：默认态与普通 mdp-btn 一致；active 态（已记住）高亮为主色 */
.mdp-group-action-sticky.active {
    background: var(--mdp-accent) !important;
    color: #fff !important;
    border-color: var(--mdp-accent) !important;
}

.mdp-group-action-sticky.active:hover {
    background: var(--mdp-accent-hover, var(--mdp-accent)) !important;
    filter: brightness(0.95);
}

/* 桌面端隐藏分组操作行（始终） */
.multi-device-page.has-sidebar .mdp-group-actions {
    display: none !important;
}

/* 分组芯片栏：横向可滚动 */
.mdp-group-chips {
    display: flex;
    flex-wrap: nowrap;
    gap: 5px;
    padding: 4px 8px;
    background: var(--mdp-surface);
    border-bottom: 1px solid var(--mdp-border);
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    box-sizing: border-box;
    scrollbar-width: thin;
    scrollbar-color: var(--mdp-border) transparent;
}

.mdp-group-chips::-webkit-scrollbar {
    height: 4px;
}

.mdp-group-chips::-webkit-scrollbar-thumb {
    background: var(--mdp-border);
    border-radius: 2px;
}

.mdp-group-chips::-webkit-scrollbar-track {
    background: transparent;
}

/* 桌面端隐藏芯片栏（始终） */
.multi-device-page.has-sidebar .mdp-group-chips {
    display: none !important;
}

/* 分组标签按钮（移动端）：矩形圆角，与上方操作行 .mdp-btn 视觉一致 */
.mdp-group-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    border: 1px solid var(--mdp-border);
    border-radius: 4px;
    background: var(--mdp-surface);
    color: var(--mdp-text);
    font-size: 12px;
    font-weight: 500;
    line-height: 1.2;
    cursor: pointer;
    transition: all 0.1s;
    flex-shrink: 0;
    white-space: nowrap;
    user-select: none;
    font-family: inherit;
}

.mdp-group-chip:hover {
    background: var(--mdp-surface-hover);
    border-color: var(--mdp-accent);
}

.mdp-group-chip:active {
    transform: scale(0.97);
}

.mdp-group-chip.active {
    background: var(--chip-accent, var(--mdp-accent));
    border-color: var(--chip-accent, var(--mdp-accent));
    color: #fff;
}

/* 有自定义色的分组：在按钮左侧显示一道色条作为可识别标记 */
.mdp-group-chip.has-color:not(.active) {
    border-left: 3px solid var(--chip-accent);
    padding-left: 10px;
}

.mdp-group-chip-label {
    max-width: 96px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mdp-group-chip-count {
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 3px;
    background: rgba(0, 0, 0, 0.08);
    color: inherit;
    font-size: 10px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.mdp-group-chip.active .mdp-group-chip-count {
    background: rgba(255, 255, 255, 0.25);
    color: #fff;
}

[data-theme="dark"] .mdp-group-chip-count {
    background: rgba(255, 255, 255, 0.1);
}

/* （移除）旧 sticky 芯片样式 —— 功能已迁移到分组操作行的「记住/已记住」按钮 */

/* 移动端批量操作栏中的"加入分组"按钮：需要与改名/取消按钮排列美观 */
.mdp-batch-bar-assign-group {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.mdp-batch-bar-assign-group svg {
    width: 14px;
    height: 14px;
}

/* Desktop layout with sidebar: flex-row instead of flex-column */
.multi-device-page.has-sidebar {
    flex-direction: row;
}

.multi-device-page.has-sidebar .mdp-sidebar {
    display: flex;
}

.multi-device-page.has-sidebar .mdp-main-area {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

/* Desktop tab containers */
.mdp-desktop-tab {
    display: none;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.mdp-desktop-tab.active {
    display: flex;
    flex-direction: column;
}

/* ====== Grid Area ====== */
.mdp-content {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
    min-height: 0;
}

/* 放大模式：让网格占满可视区高度，避免卡片仅按内容高度收缩、下方大块空白 */
.mdp-content.mdp-focus-mode {
    display: flex;
    flex-direction: column;
}

.mdp-content.mdp-focus-mode .mdp-grid {
    flex: 1;
    min-height: 0;
}

/* ====== 桌面端分屏放大模式 ====== */
.mdp-content.mdp-split-focus-mode {
    overflow-y: auto;
    overflow-x: hidden;
    box-sizing: border-box;
}

.mdp-content.mdp-split-focus-mode .mdp-grid {
    width: 100%;
    min-width: 0;
    max-width: none;
    align-content: start;
}

.mdp-content.mdp-split-focus-mode .mdp-grid .mdp-card {
    cursor: pointer;
    transition: box-shadow 0.15s, border-color 0.15s;
}

.mdp-content.mdp-split-focus-mode .mdp-grid .mdp-card:hover {
    border-color: var(--mdp-accent);
    box-shadow: var(--mdp-shadow-hover);
}

.mdp-focus-window-placeholder {
    appearance: none;
    width: 100%;
    height: 100%;
    min-height: 0;
    padding: 12px;
    border-radius: var(--mdp-card-radius);
    border: 1px dashed rgba(99, 102, 241, 0.42);
    background: linear-gradient(180deg, rgba(99, 102, 241, 0.08), rgba(15, 23, 42, 0.08));
    color: var(--mdp-text-dim);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    cursor: pointer;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03);
    transition: border-color 0.15s, box-shadow 0.15s, color 0.15s, background 0.15s;
}

.mdp-focus-window-placeholder:hover {
    border-color: var(--mdp-accent);
    color: var(--mdp-text);
    box-shadow: var(--mdp-shadow-hover);
    background: linear-gradient(180deg, rgba(99, 102, 241, 0.12), rgba(15, 23, 42, 0.12));
}

.mdp-focus-window-placeholder-label {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 13px;
    font-weight: 600;
}

/* 右侧放大设备主面板 */
.mdp-split-main {
    position: absolute;
    z-index: 120;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 280px;
    min-height: 320px;
    pointer-events: auto;
    transition: box-shadow 0.15s ease;
}

.mdp-split-main.dragging,
.mdp-split-main.resizing,
.mdp-split-main.mdp-split-main-active {
    box-shadow: 0 18px 42px rgba(15, 23, 42, 0.3);
}

.mdp-split-main.mdp-split-main-minimized {
    display: none;
}

/* 放大卡片充满主面板 */
.mdp-split-main .mdp-card.focus-mode-active {
    flex: 1;
    min-height: 0;
    width: 100%;
    height: 100%;
    max-height: none;
    grid-column: unset;
    grid-row: unset;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

.mdp-split-main .mdp-card.focus-mode-active .mdp-card-header {
    cursor: grab;
    touch-action: none;
}

.mdp-split-main.dragging .mdp-card.focus-mode-active .mdp-card-header {
    cursor: grabbing;
}

.mdp-split-main .mdp-card.focus-mode-active .mdp-card-video {
    flex: 1;
    min-height: 0;
    height: auto;
    max-height: none;
}

.mdp-focus-window-resize-handle {
    position: absolute;
    width: 18px;
    height: 18px;
    z-index: 4;
    touch-action: none;
    background: linear-gradient(135deg, transparent 0 44%, rgba(255, 255, 255, 0.2) 44% 54%, transparent 54% 66%, rgba(255, 255, 255, 0.42) 66% 76%, transparent 76% 100%);
}

.mdp-focus-window-resize-handle[data-corner="top-left"] {
    left: 0;
    top: 0;
    cursor: nwse-resize;
    transform: rotate(180deg);
}

.mdp-focus-window-resize-handle[data-corner="top-right"] {
    right: 0;
    top: 0;
    cursor: nesw-resize;
    transform: rotate(90deg);
}

.mdp-focus-window-resize-handle[data-corner="bottom-left"] {
    left: 0;
    bottom: 0;
    cursor: nesw-resize;
    transform: rotate(270deg);
}

.mdp-focus-window-resize-handle[data-corner="bottom-right"] {
    right: 0;
    bottom: 0;
    cursor: nwse-resize;
}

.mdp-focus-dock {
    position: absolute;
    left: 50%;
    bottom: 16px;
    transform: translateX(-50%) translateY(10px);
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: calc(100% - 24px);
    padding: 10px 12px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 18px;
    background: rgba(20, 24, 31, 0.62);
    box-shadow: 0 20px 44px rgba(15, 23, 42, 0.28);
    backdrop-filter: blur(16px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    z-index: 220;
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
    overflow-x: auto;
}

.mdp-focus-dock.visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
}

.mdp-focus-dock-item {
    min-width: 92px;
    max-width: 144px;
    height: 44px;
    padding: 0 14px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.18);
    transition: transform 0.16s ease, background 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.mdp-focus-dock-item:hover {
    transform: translateY(-2px) scale(1.04);
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.24);
    box-shadow: 0 14px 28px rgba(15, 23, 42, 0.24);
}

.mdp-focus-dock-item-label {
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: center;
    font-size: 12px;
    font-weight: 600;
}

.mdp-mobile-focus-placeholder {
    appearance: none;
    min-height: 82px;
    border: 1px dashed rgba(0, 120, 212, 0.36);
    border-radius: var(--mdp-card-radius);
    background: var(--mdp-accent-light);
    color: var(--mdp-accent);
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    text-align: center;
}

/* 注意：will-change 中不再默认包含 transform。Chromium 把 will-change: transform 视为
   "为元素预先建立固定包含块 (containing block)"，会让其后代 position: fixed 元素改为
   相对于该祖先而非 viewport 定位。手机端从放大模式进入全屏时，wrapper 加 .fullscreen
   并由 FullscreenManager.updateFullscreenLayout 设置 position: fixed + left/top/width/height
   (基于 viewport)；若 .mdp-mobile-focus-window 上残留 will-change: transform，
   即使 .fullscreen-active 写了 will-change: auto !important，已经创建的包含块也不一定立即解除
   (Chromium 标记为 WontFix)，结果 wrapper 的 fixed 仍被锁在 panel 上，全屏画面错位/黑屏。
   桌面端 .mdp-split-main 没有 will-change: transform，所以同路径在桌面端表现正常。
   修复策略：默认不预热 transform 层，仅在真正会用到 transform 的交互状态下临时启用，
   交互结束/CLASS 切走后立即释放，避免长期保留导致的包含块陷阱。 */
.mdp-mobile-focus-window {
    position: absolute;
    z-index: 180;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 184px;
    min-height: 156px;
    border-radius: 18px;
    box-shadow: 0 18px 46px rgba(15, 23, 42, 0.42);
    background: var(--mdp-video-bg);
    pointer-events: auto;
    touch-action: none;
    transform-origin: center center;
    will-change: left, top, width, height, opacity;
    transition: left 0.22s cubic-bezier(0.2, 0.9, 0.22, 1), top 0.22s cubic-bezier(0.2, 0.9, 0.22, 1), width 0.22s cubic-bezier(0.2, 0.9, 0.22, 1), height 0.22s cubic-bezier(0.2, 0.9, 0.22, 1), transform 0.2s cubic-bezier(0.2, 0.9, 0.22, 1), box-shadow 0.16s ease, border-radius 0.16s ease, opacity 0.16s ease;
}

/* 仅在拖动 / 缩放 / 边缘吸附 / 挂起 / 缩小拖拽等真正会触发 transform 的交互状态下
   预热 transform layer，结束后立即回退到默认 will-change，让浏览器释放包含块。 */
.mdp-mobile-focus-window.dragging,
.mdp-mobile-focus-window.resizing,
.mdp-mobile-focus-window.mdp-mobile-focus-gesture-active,
.mdp-mobile-focus-window.mdp-mobile-focus-edge-left,
.mdp-mobile-focus-window.mdp-mobile-focus-edge-right,
.mdp-mobile-focus-window.mdp-mobile-focus-hang-ready,
.mdp-mobile-focus-window.mdp-mobile-focus-fullscreen-ready,
.mdp-mobile-focus-window.mdp-mobile-focus-close-ready,
.mdp-mobile-focus-window.mdp-mobile-focus-compact-pressing,
.mdp-mobile-focus-window.mdp-mobile-focus-compact-dragging {
    will-change: left, top, width, height, transform, opacity;
}

.mdp-mobile-focus-window.mdp-mobile-focus-active,
.mdp-mobile-focus-window.dragging,
.mdp-mobile-focus-window.resizing {
    box-shadow: 0 22px 56px rgba(0, 120, 212, 0.34), 0 16px 40px rgba(15, 23, 42, 0.38);
}

.mdp-mobile-focus-window.mdp-mobile-focus-gesture-active {
    transition: left 0.08s linear, top 0.08s linear, width 0.08s linear, height 0.08s linear, transform 0.08s linear, box-shadow 0.12s ease, border-radius 0.12s ease, opacity 0.08s linear;
}

.mdp-mobile-focus-window.mdp-mobile-focus-gesture-active.dragging {
    transition: box-shadow 0.12s ease, border-radius 0.12s ease, opacity 0.08s linear;
}

.mdp-mobile-focus-window.dragging {
    transform: scale(1.015);
}

.mdp-mobile-focus-window.resizing {
    box-shadow: 0 24px 62px rgba(0, 120, 212, 0.4), 0 18px 42px rgba(15, 23, 42, 0.4);
}

.mdp-mobile-focus-window.mdp-mobile-focus-edge-left,
.mdp-mobile-focus-window.mdp-mobile-focus-edge-right {
    border-radius: 22px;
    box-shadow: 0 24px 64px rgba(0, 120, 212, 0.54), 0 0 0 2px rgba(0, 120, 212, 0.44), 0 18px 42px rgba(15, 23, 42, 0.36);
    opacity: 0.9;
}

.mdp-mobile-focus-window.mdp-mobile-focus-edge-left {
    transform: translateX(-10px) scale(0.92);
}

.mdp-mobile-focus-window.mdp-mobile-focus-edge-right {
    transform: translateX(10px) scale(0.92);
}

.mdp-mobile-focus-window.mdp-mobile-focus-hang-ready {
    transform: scale(0.96);
    border-radius: 24px;
    box-shadow: 0 20px 54px rgba(0, 120, 212, 0.46), 0 0 0 2px rgba(0, 120, 212, 0.34);
}

.mdp-mobile-focus-window.mdp-mobile-focus-fullscreen-ready {
    transform: scale(1.035);
    box-shadow: 0 28px 76px rgba(16, 137, 62, 0.44), 0 0 0 2px rgba(16, 137, 62, 0.36);
}

.mdp-mobile-focus-window.mdp-mobile-focus-close-ready {
    box-shadow: 0 24px 64px rgba(209, 52, 56, 0.4), 0 0 0 2px rgba(209, 52, 56, 0.34);
}

.mdp-mobile-focus-window .mdp-card.focus-mode-active {
    width: 100%;
    height: 100%;
    max-height: none !important;
    border-radius: inherit;
    display: flex;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.mdp-mobile-focus-window .mdp-card.focus-mode-active .mdp-card-header {
    cursor: grab;
    touch-action: none;
}

.mdp-mobile-focus-window.dragging .mdp-card.focus-mode-active .mdp-card-header {
    cursor: grabbing;
}

.mdp-mobile-focus-window .mdp-card.focus-mode-active .mdp-card-video {
    flex: 1;
    min-height: 0;
    height: auto;
    max-height: none !important;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.92), rgba(2, 6, 23, 0.9));
}

.mdp-mobile-focus-window .mdp-card.focus-mode-active .mdp-card-controls {
    flex-shrink: 0;
}

.mdp-mobile-focus-resize-handle {
    position: absolute;
    bottom: 0;
    width: 48px;
    height: 48px;
    z-index: 8;
    touch-action: none;
}

.mdp-mobile-focus-resize-handle::after {
    content: '';
    position: absolute;
    right: 10px;
    bottom: 10px;
    width: 18px;
    height: 18px;
    border-right: 3px solid rgba(255, 255, 255, 0.62);
    border-bottom: 3px solid rgba(255, 255, 255, 0.62);
    border-radius: 2px;
    transition: border-color 0.12s ease, transform 0.12s ease;
}

.mdp-mobile-focus-resize-handle[data-corner="bottom-left"] {
    left: 0;
}

.mdp-mobile-focus-resize-handle[data-corner="bottom-left"]::after {
    left: 10px;
    right: auto;
    transform: scaleX(-1);
}

.mdp-mobile-focus-window.resizing .mdp-mobile-focus-resize-handle::after,
.mdp-mobile-focus-window.mdp-mobile-focus-fullscreen-ready .mdp-mobile-focus-resize-handle::after,
.mdp-mobile-focus-window.mdp-mobile-focus-hang-ready .mdp-mobile-focus-resize-handle::after {
    border-color: rgba(255, 255, 255, 0.92);
}

.mdp-mobile-focus-resize-handle[data-corner="bottom-right"] {
    right: 0;
}

.mdp-mobile-focus-close-handle {
    position: absolute;
    left: 50%;
    bottom: 0;
    width: 86px;
    height: 42px;
    transform: translateX(-50%);
    z-index: 7;
    touch-action: none;
}

.mdp-mobile-focus-close-handle::before {
    content: '';
    position: absolute;
    left: 50%;
    bottom: 10px;
    width: 42px;
    height: 5px;
    border-radius: 999px;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.48);
    transition: width 0.14s ease, height 0.14s ease, background 0.14s ease, box-shadow 0.14s ease;
}

.mdp-mobile-focus-window.closing .mdp-mobile-focus-close-handle::before {
    width: 54px;
    background: rgba(255, 255, 255, 0.74);
}

.mdp-mobile-focus-window.mdp-mobile-focus-close-ready .mdp-mobile-focus-close-handle::before {
    height: 6px;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 0 18px rgba(209, 52, 56, 0.44);
}

.mdp-mobile-focus-window.mdp-mobile-focus-minimized {
    min-width: 72px;
    min-height: 132px;
    border-radius: 28px;
    opacity: 0.98;
    transform: scale(1);
    cursor: pointer;
    box-shadow: 0 22px 48px rgba(15, 23, 42, 0.28), 0 0 0 7px rgba(255, 255, 255, 0.58), 0 0 0 1px rgba(255, 255, 255, 0.76) inset;
}

.mdp-mobile-focus-window.mdp-mobile-focus-minimized:active {
    opacity: 1;
    transform: scale(1.04);
}

.mdp-mobile-focus-window.mdp-mobile-focus-minimized .mdp-card-header,
.mdp-mobile-focus-window.mdp-mobile-focus-minimized .mdp-card-controls,
.mdp-mobile-focus-window.mdp-mobile-focus-minimized .mdp-mobile-focus-resize-handle,
.mdp-mobile-focus-window.mdp-mobile-focus-minimized .mdp-mobile-focus-close-handle {
    display: none !important;
}

.mdp-mobile-focus-window.mdp-mobile-focus-minimized::after {
    content: '';
    display: none;
}

.mdp-mobile-focus-window.mdp-mobile-focus-minimized[data-dock-side="left"]::after {
    content: '›';
    right: 4px;
    font-size: 28px;
}

.mdp-mobile-focus-window.mdp-mobile-focus-minimized[data-dock-side="right"]::after {
    content: '‹';
    left: 4px;
    font-size: 28px;
}

.mdp-mobile-focus-window.mdp-mobile-focus-hanging {
    min-width: 136px;
    min-height: 172px;
    border-radius: 24px;
    opacity: 0.98;
    box-shadow: 0 22px 52px rgba(15, 23, 42, 0.3), 0 0 0 8px rgba(255, 255, 255, 0.58), 0 0 0 1px rgba(255, 255, 255, 0.76) inset;
    transform: scale(1);
}

.mdp-mobile-focus-window.mdp-mobile-focus-compact-pressing {
    box-shadow: 0 24px 58px rgba(15, 23, 42, 0.32), 0 0 0 8px rgba(255, 255, 255, 0.68), 0 0 0 1px rgba(255, 255, 255, 0.82) inset;
}

.mdp-mobile-focus-window.mdp-mobile-focus-compact-dragging {
    transform: scale(1.035);
    box-shadow: 0 28px 68px rgba(15, 23, 42, 0.36), 0 0 0 9px rgba(255, 255, 255, 0.72), 0 0 0 1px rgba(255, 255, 255, 0.86) inset;
}

.mdp-mobile-focus-window.mdp-mobile-focus-hanging .mdp-card-controls,
.mdp-mobile-focus-window.mdp-mobile-focus-hanging .mdp-card-udid,
.mdp-mobile-focus-window.mdp-mobile-focus-hanging .mdp-card-header-actions,
.mdp-mobile-focus-window.mdp-mobile-focus-hanging .mdp-mobile-focus-resize-handle,
.mdp-mobile-focus-window.mdp-mobile-focus-hanging .mdp-mobile-focus-close-handle {
    display: none !important;
}

.mdp-mobile-focus-window.mdp-mobile-focus-hanging .mdp-card-header {
    min-height: 30px;
    padding: 5px 8px;
}

.mdp-mobile-focus-window.mdp-mobile-focus-hanging .mdp-card-name {
    font-size: 11px;
}

.mdp-mobile-focus-close-zone,
.mdp-mobile-focus-maximize-hint,
.mdp-mobile-focus-hang-hint {
    position: absolute;
    z-index: 260;
    opacity: 0;
    pointer-events: none;
    transform: scale(0.92);
    transition: opacity 0.14s ease, transform 0.14s ease;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    text-align: center;
}

.mdp-mobile-focus-close-zone.active,
.mdp-mobile-focus-maximize-hint.active,
.mdp-mobile-focus-hang-hint.active {
    opacity: 1;
    transform: scale(1);
}

.mdp-mobile-focus-close-zone {
    left: 50%;
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    width: 112px;
    height: 44px;
    margin-left: -56px;
    border-radius: 999px;
    background: rgba(209, 52, 56, 0.86);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 12px 28px rgba(209, 52, 56, 0.28);
}

.mdp-mobile-focus-maximize-hint {
    left: 50%;
    top: calc(var(--mdp-header-height) + 8px);
    width: 112px;
    height: 40px;
    margin-left: -56px;
    border-radius: 999px;
    background: rgba(16, 137, 62, 0.86);
    display: flex;
    align-items: center;
    justify-content: center;
}

.mdp-mobile-focus-hang-hint {
    top: calc(var(--mdp-header-height) + 8px);
    width: 98px;
    height: 40px;
    border-radius: 999px;
    background: rgba(0, 120, 212, 0.86);
    display: flex;
    align-items: center;
    justify-content: center;
}

.mdp-mobile-focus-hang-hint[data-side="left"] {
    left: 10px;
}

.mdp-mobile-focus-hang-hint[data-side="right"] {
    right: 10px;
}

/* 侧边栏切换提示文字（悬停在设备名上显示） */
.mdp-content.mdp-split-focus-mode .mdp-grid .mdp-card .mdp-device-name-overlay {
    display: flex;
}

.mdp-grid {
    display: grid;
    gap: 8px;
    /* 列数可由工具栏「布局」修改；行高由 UserDevicePage.updateGridRowHeight 按可视区高度计算，保证一屏约 3 行（可纵向滚动） */
    grid-template-columns: repeat(3, 1fr);
    /* JS 未运行时近似三分屏，避免首屏挤满过多行 */
    grid-auto-rows: minmax(100px, 28vh);
}

/* ====== Device Card ====== */
.mdp-card {
    background: var(--mdp-surface);
    border-radius: var(--mdp-card-radius);
    border: 1px solid var(--mdp-border);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 0;
    transition: box-shadow 0.15s, border-color 0.15s;
    box-shadow: var(--mdp-shadow);
    position: relative;
}

/* ===== 大设备数（60+）渲染优化：视口外卡片跳过 layout/paint =====
 *
 * 60 设备账号实测：即使只跑 1 路视频流，仍因为 60 张 .mdp-card 的整体
 * 渲染管线开销（每张约 15 个 DOM 节点 → 总计 900+ 节点）持续占用主线程，
 * 导致顶部 1 路流的解码 / 渲染 rAF 被挤压；同设备转到「只有 1 台」的账号
 * 即流畅。差异只在 DOM 数量。
 *
 * 浏览器原生 `content-visibility: auto` 在卡片**离开视口**时自动跳过
 * style/layout/paint/render-tree-construction 三阶段，把 N 张卡片的总渲染
 * 开销降到「视口内可见的若干张」级别。视口内卡片仍正常渲染，无视觉副作用。
 *
 * 仅作用于 grid 直接子级：focus 模式 / 浮动放大窗口的卡片已被 grid.ts
 * 移到 .mdp-split-main / .mdp-mobile-focus-window 容器下，不命中本选择器，
 * 不会影响放大体验。
 *
 * `contain-intrinsic-size: auto 320px` 给浏览器一个 placeholder 占位高度。
 * grid 行高由 JS 通过 `grid-auto-rows` 动态设置（典型 200-400px），320px 取
 * 中位值减少首次进入视口前的滚动条尺寸跳动；卡片首次被测量后浏览器会
 * 用真实高度替代该估值（auto 关键字的语义）。
 *
 * 浏览器支持：Chrome 85+ / Edge 85+ / Safari 18+。不支持时该规则被忽略，
 * 退化为原行为（无 content-visibility 优化），不影响功能。
 *
 * 调试 / 回退：浏览器 DevTools → 元素 .mdp-card → 设置 `content-visibility: visible`
 * 即可恢复对照。或本规则块整体回滚。
 */
.mdp-grid > .mdp-card {
    content-visibility: auto;
    contain-intrinsic-size: auto 320px;
}

.mdp-card:hover {
    box-shadow: var(--mdp-shadow-hover);
}

.mdp-card.focused {
    border-color: var(--mdp-accent);
    box-shadow: 0 0 0 1px var(--mdp-accent), var(--mdp-shadow-hover);
}

.mdp-card.streaming {
    border-color: var(--mdp-success);
}

.mdp-card.streaming.focused {
    border-color: var(--mdp-accent);
    box-shadow: 0 0 0 1px var(--mdp-accent), var(--mdp-shadow-hover);
}

/* ====== Drag-and-drop sort ====== */
.mdp-card[draggable="true"] {
    cursor: grab;
}

.mdp-card.mdp-drag-dragging {
    opacity: 0.45;
    cursor: grabbing;
    box-shadow: var(--mdp-shadow-hover);
}

.mdp-card.mdp-drag-over {
    border-color: var(--mdp-accent);
    box-shadow: 0 0 0 2px var(--mdp-accent), var(--mdp-shadow-hover);
    transform: scale(1.02);
    transition: transform 0.12s ease, box-shadow 0.12s ease;
}

/* Sort button active state */
.mdp-btn.mdp-sort-btn.active {
    background: var(--mdp-accent-light);
    border-color: var(--mdp-accent);
    color: var(--mdp-accent);
}

/* Card Header */
.mdp-card-header {
    display: flex;
    align-items: center;
    padding: 8px 10px;
    gap: 6px;
    border-bottom: 1px solid var(--mdp-border);
    flex-shrink: 0;
}

.mdp-device-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.mdp-device-dot.online {
    background: var(--mdp-success);
}

.mdp-device-dot.offline {
    background: var(--mdp-text-dim);
}

.mdp-device-dot.streaming {
    background: var(--mdp-accent);
    animation: mdp-pulse 2s infinite;
}

@keyframes mdp-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.mdp-card-info {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.mdp-latency-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    color: var(--mdp-accent);
    background: var(--mdp-accent-light);
    white-space: nowrap;
    flex-shrink: 0;
    min-width: 0;
    font-variant-numeric: tabular-nums;
    line-height: 1;
}

.mdp-latency-badge.is-low {
    color: var(--mdp-success);
    background: rgba(16, 124, 16, 0.12);
}

.mdp-latency-badge.is-medium {
    color: var(--mdp-warning);
    background: rgba(255, 185, 0, 0.16);
}

.mdp-latency-badge.is-high {
    color: var(--mdp-danger);
    background: rgba(209, 52, 56, 0.12);
}

.mdp-latency-badge-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.mdp-latency-badge-icon svg {
    width: 12px;
    height: 12px;
    display: block;
}

.mdp-latency-badge-text {
    font-variant-numeric: tabular-nums;
}

.mdp-latency-badge:empty {
    display: none;
}

.mdp-card-header-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
    flex-shrink: 0;
}

.mdp-card-name {
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.mdp-card-udid {
    font-size: 10px;
    color: var(--mdp-text-dim);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mdp-card-player-select {
    display: none;
}

.mdp-edit-name-btn {
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 4px;
    background: transparent;
    color: var(--mdp-text-dim);
    cursor: pointer;
    transition: all 0.15s;
    padding: 0;
    flex-shrink: 0;
}

.mdp-edit-name-btn:hover {
    background: var(--mdp-surface-hover);
    color: var(--mdp-accent);
}

.mdp-edit-name-btn svg {
    width: 14px;
    height: 14px;
    fill: currentColor;
}

/* ====== Dialog ====== */
.mdp-dialog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10050;
    backdrop-filter: blur(4px);
    padding: 16px;
    box-sizing: border-box;
}

.mdp-dialog {
    background: var(--mdp-surface);
    border: 1px solid var(--mdp-border);
    border-radius: 8px;
    padding: 24px;
    min-width: 320px;
    width: min(420px, calc(100vw - 32px));
    max-width: 90vw;
    max-height: calc(100vh - 32px);
    overflow: auto;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

.mdp-dialog-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--mdp-text);
    margin-bottom: 16px;
}

.mdp-dialog-input {
    width: 100%;
    box-sizing: border-box;
    background: var(--mdp-bg);
    color: var(--mdp-text);
    border: 1px solid var(--mdp-border);
    border-radius: 4px;
    padding: 8px 12px;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.15s;
}

.mdp-dialog-input:focus {
    border-color: var(--mdp-accent);
    box-shadow: 0 0 0 1px var(--mdp-accent);
}

.mdp-dialog-input::placeholder {
    color: var(--mdp-text-dim);
}

.mdp-dialog-hint {
    font-size: 11px;
    color: var(--mdp-text-dim);
    margin-top: 8px;
}

.mdp-dialog-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 20px;
}

.mdp-dialog-btn {
    padding: 6px 16px;
    border: 1px solid var(--mdp-border);
    border-radius: 4px;
    background: var(--mdp-surface);
    color: var(--mdp-text);
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.1s;
}

.mdp-dialog-btn:hover {
    background: var(--mdp-surface-hover);
    border-color: var(--mdp-accent);
}

.mdp-dialog-btn-primary {
    background: var(--mdp-accent);
    border-color: var(--mdp-accent);
    color: #fff;
}

.mdp-dialog-btn-primary:hover {
    background: var(--mdp-accent-hover);
}

.mdp-dialog-btn-secondary {
    color: var(--mdp-text-secondary);
}

.mdp-dialog-btn-secondary:hover {
    color: var(--mdp-text);
}

/* Card Video Area */
.mdp-card-video {
    position: relative;
    background: var(--mdp-video-bg);
    width: 100%;
    flex: 1;
    min-height: 0;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Wrapper: sized by JS in onVideoResize to match video aspect ratio at card width.
   Players skip applyAdaptiveScaling when they detect this class. */
.mdp-video-wrapper {
    position: relative;
    overflow: hidden;
    margin: 0 auto;
}

/* Touch canvas overlays the video exactly */
.mdp-video-wrapper > .touch-layer {
    position: absolute;
    top: 0;
    left: 0;
}

.mdp-video-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--mdp-text-dim);
    padding: 10px;
    text-align: center;
    gap: 6px;
    width: 100%;
    height: 100%;
    transition: background 0.15s ease, color 0.15s ease;
}

/* 在线且未投屏时，整个占位符区域可点击以直接开始投屏 */
.mdp-video-placeholder[data-mdp-clickable="1"] {
    cursor: pointer;
}

.mdp-video-placeholder[data-mdp-clickable="1"]:hover,
.mdp-video-placeholder[data-mdp-clickable="1"]:focus-visible {
    color: var(--mdp-accent);
    background: var(--mdp-accent-light);
    outline: none;
}

.mdp-video-placeholder[data-mdp-clickable="1"]:hover svg,
.mdp-video-placeholder[data-mdp-clickable="1"]:focus-visible svg {
    opacity: 0.85;
    transform: scale(1.08);
}

.mdp-video-placeholder[data-mdp-clickable="1"]:active svg {
    transform: scale(0.96);
}

.mdp-video-placeholder svg {
    width: 40px;
    height: 40px;
    opacity: 0.4;
    transition: opacity 0.15s ease, transform 0.1s ease;
}

.mdp-video-placeholder p {
    margin: 0;
    font-size: 12px;
}

/* ===========================================================================
 * 预览占位风格变体（管理员可配置）
 * 通过 .multi-device-page[data-preview-placeholder-style="..."] 切换
 * - classic : 保持现有深色视频背景（默认）
 * - minimal : 浅色磨砂背景，与卡片表面色融合，去除"黑屏感"
 *
 * 重要：所有变体都加 .mdp-card:not(.focus-mode-active) 限定，仅作用于
 * 预览（grid view）卡片；进入放大模式（focusMode / 浮动窗）的卡片不受影响，
 * 保持原视频深色背景，避免渐变背景在过渡瞬间穿帮。
 *
 * 投流后视频 wrapper 覆盖整层，背景不可见，故仅在 placeholder 可见时生效。
 * =========================================================================== */

/* minimal — 浅色磨砂表面，与卡片整体融合 */
.multi-device-page[data-preview-placeholder-style="minimal"] .mdp-card:not(.focus-mode-active) .mdp-card-video {
    background: linear-gradient(135deg, var(--mdp-surface-hover) 0%, var(--mdp-surface) 100%);
}
.multi-device-page[data-preview-placeholder-style="minimal"] .mdp-card:not(.focus-mode-active) .mdp-video-placeholder {
    color: var(--mdp-text-secondary);
}
.multi-device-page[data-preview-placeholder-style="minimal"] .mdp-card:not(.focus-mode-active) .mdp-video-placeholder svg {
    opacity: 0.55;
}

.mdp-video-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    color: var(--mdp-text-secondary);
    font-size: 12px;
}

.mdp-video-loading-overlay {
    position: absolute;
    inset: 0;
    z-index: 5;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--mdp-video-bg);
}

.mdp-spinner {
    width: 24px;
    height: 24px;
    border: 2px solid var(--mdp-border);
    border-top-color: var(--mdp-accent);
    border-radius: 50%;
    animation: mdp-spin 0.8s linear infinite;
}

@keyframes mdp-spin {
    to { transform: rotate(360deg); }
}

/* Card Controls */
.mdp-card-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px 6px;
    gap: 2px;
    border-top: 1px solid var(--mdp-border);
    flex-shrink: 0;
    flex-wrap: wrap;
}

.mdp-ctrl-btn {
    width: 28px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 4px;
    background: transparent;
    color: var(--mdp-text-secondary);
    cursor: pointer;
    transition: all 0.1s;
    padding: 0;
}

.mdp-ctrl-btn:hover {
    background: var(--mdp-surface-hover);
    color: var(--mdp-text);
}

.mdp-ctrl-btn:active {
    transform: scale(0.92);
}

.mdp-ctrl-btn svg {
    width: 14px;
    height: 14px;
    fill: currentColor;
}

.mdp-sensor-test-btn {
    width: auto;
    padding: 0 10px;
    gap: 6px;
    white-space: nowrap;
    color: var(--mdp-accent);
    font-size: 12px;
}

.mdp-sensor-test-btn span {
    line-height: 1;
}

.mdp-sensor-test-spin {
    animation: mdp-spin 0.8s linear infinite;
}

.mdp-ctrl-btn.mdp-stream-toggle {
    color: var(--mdp-accent);
    font-weight: 600;
}

.mdp-ctrl-btn.mdp-stream-toggle.active {
    color: var(--mdp-danger);
}

.mdp-ctrl-btn.mdp-stream-toggle svg {
    width: 16px;
    height: 16px;
}

.mdp-ctrl-btn.mdp-ime-btn.keyboard-mode {
    color: var(--mdp-accent);
    background: rgba(33, 150, 243, 0.15);
}

/* ====== 工具栏按钮显示模式（管理员可配置：仅图标 / 仅文字 / 图标+文字 H / 图标+文字 V） ======
   通过 button[data-display-mode] 切换布局；icon / label 拆分为独立 span，便于尺寸/间距控制。
   svg 大小默认通过外层 .mdp-ctrl-btn svg 规则控制；当 .mdp-ctrl-icon 包裹时也兼容。 */
.mdp-ctrl-btn .mdp-ctrl-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    line-height: 0;
}

.mdp-ctrl-btn .mdp-ctrl-icon svg {
    width: 14px;
    height: 14px;
    fill: currentColor;
}

.mdp-ctrl-btn .mdp-ctrl-label {
    font-size: 12px;
    font-weight: 500;
    line-height: 1.1;
    white-space: nowrap;
    color: inherit;
}

.mdp-ctrl-btn[data-display-mode="text"] {
    width: auto;
    padding: 0 10px;
    gap: 0;
}

.mdp-ctrl-btn[data-display-mode="icon-text-h"] {
    width: auto;
    padding: 0 10px;
    gap: 6px;
    flex-direction: row;
}

.mdp-ctrl-btn[data-display-mode="icon-text-v"] {
    width: auto;
    height: auto;
    min-height: 30px;
    padding: 4px 8px;
    gap: 1px;
    flex-direction: column;
}

.mdp-ctrl-btn[data-display-mode="icon-text-v"] .mdp-ctrl-label {
    font-size: 10px;
}

/* 图标风格：outline / rounded 在线宽较粗，需要稍微放大可视区域以保持视觉权重 */
.mdp-ctrl-btn[data-icon-style="outline"] svg,
.mdp-ctrl-btn[data-icon-style="rounded"] svg {
    width: 15px;
    height: 15px;
}

.mdp-ctrl-btn[data-icon-style="outline"] svg path,
.mdp-ctrl-btn[data-icon-style="outline"] svg rect,
.mdp-ctrl-btn[data-icon-style="outline"] svg circle,
.mdp-ctrl-btn[data-icon-style="outline"] svg polygon,
.mdp-ctrl-btn[data-icon-style="outline"] svg polyline,
.mdp-ctrl-btn[data-icon-style="outline"] svg line,
.mdp-ctrl-btn[data-icon-style="rounded"] svg path,
.mdp-ctrl-btn[data-icon-style="rounded"] svg rect,
.mdp-ctrl-btn[data-icon-style="rounded"] svg circle,
.mdp-ctrl-btn[data-icon-style="rounded"] svg polygon,
.mdp-ctrl-btn[data-icon-style="rounded"] svg polyline,
.mdp-ctrl-btn[data-icon-style="rounded"] svg line {
    /* outline / rounded 系列已在 SVG 内通过 stroke 属性表达，
       这里强制 fill:none 避免管理员把 solid 切到 outline 时浏览器残留默认填充。 */
    fill: none;
}

/* ====== Text Input Overlay (手机端文本输入) ====== */
.mdp-text-input-overlay {
    position: absolute;
    bottom: 60px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 400px;
    background: var(--mdp-surface, #fff);
    border: 1px solid var(--mdp-border, #e0e0e0);
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    z-index: 100;
    touch-action: auto;
    pointer-events: auto;
}

.mdp-text-input-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.mdp-text-input {
    width: 100%;
    min-height: 80px;
    padding: 12px;
    border: 1px solid var(--mdp-border, #e0e0e0);
    border-radius: 8px;
    font-size: 16px;
    resize: vertical;
    background: var(--mdp-background, #f5f5f5);
    color: var(--mdp-text, #333);
    box-sizing: border-box;
    touch-action: auto;
    -webkit-user-select: text;
    user-select: text;
}

.mdp-text-input:focus {
    outline: none;
    border-color: var(--mdp-accent, #2196f3);
}

.mdp-text-input-buttons {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.mdp-text-input-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    touch-action: manipulation;
}

.mdp-text-input-send {
    background: var(--mdp-accent, #2196f3);
    color: white;
}

.mdp-text-input-send:hover {
    background: #1976d2;
}

.mdp-text-input-hide {
    background: var(--mdp-surface, #f5f5f5);
    color: var(--mdp-text-secondary, #666);
    border: 1px solid var(--mdp-border, #e0e0e0);
}

.mdp-text-input-hide:hover {
    background: var(--mdp-border, #e0e0e0);
}

/* 全屏模式下的文本输入覆盖层 */
.mdp-text-input-overlay-fullscreen {
    position: fixed !important;
    bottom: 80px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    width: 90% !important;
    max-width: 500px !important;
    z-index: 10010 !important;
    background: var(--mdp-surface, #1e1e1e) !important;
    border: 1px solid var(--mdp-border, rgba(255, 255, 255, 0.1)) !important;
    border-radius: 16px !important;
    padding: 20px !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4) !important;
}

.mdp-text-input-overlay-fullscreen .mdp-text-input {
    background: var(--mdp-background, rgba(255, 255, 255, 0.08)) !important;
    color: var(--mdp-text, #fff) !important;
    border-color: var(--mdp-border, rgba(255, 255, 255, 0.15)) !important;
}

.mdp-text-input-overlay-fullscreen .mdp-text-input-buttons {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 12px;
}

.mdp-text-input-overlay-fullscreen .mdp-text-input-btn {
    padding: 10px 20px;
    font-size: 14px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-block;
}

.mdp-text-input-overlay-fullscreen .mdp-text-input-send {
    background: var(--mdp-accent, #00d4aa) !important;
    color: #000 !important;
}

.mdp-text-input-overlay-fullscreen .mdp-text-input-hide {
    background: rgba(255, 255, 255, 0.9) !important;
    color: var(--mdp-text, #000) !important;
    border: 1px solid rgba(0, 0, 0, 0.25) !important;
}

.mdp-ctrl-divider {
    width: 1px;
    height: 18px;
    background: var(--mdp-border);
    margin: 0 2px;
}

/* ====== Synchronizer (同步器) ====== */
.mdp-btn-gc {
    border: 1px solid var(--mdp-border);
    background: var(--mdp-surface);
    transition: all 0.15s;
}

.mdp-btn-gc.active {
    background: rgba(16, 124, 16, 0.1);
    border-color: var(--mdp-success);
    color: var(--mdp-success);
}

.mdp-btn-gc.active span {
    color: var(--mdp-success);
}

/* 主控/被控身份标识直接显示在卡片上（预览模式下 header 隐藏，此处用卡片本身 ::after） */
.mdp-card.mdp-gc-master {
    border-color: #e17055;
    box-shadow: 0 0 0 2px rgba(225, 112, 85, 0.35);
}

.mdp-card.mdp-gc-master::after {
    content: '主控';
    position: absolute;
    top: 6px;
    right: 6px;
    font-size: 10px;
    font-weight: 700;
    color: #fff;
    background: #e17055;
    padding: 2px 7px;
    border-radius: 4px;
    z-index: 10;
    pointer-events: none;
    letter-spacing: 0.5px;
}

.mdp-card.mdp-gc-slave {
    border-color: #0078d4;
    box-shadow: 0 0 0 2px rgba(0, 120, 212, 0.3);
}

.mdp-card.mdp-gc-slave::after {
    content: '被控';
    position: absolute;
    top: 6px;
    right: 6px;
    font-size: 10px;
    font-weight: 700;
    color: #fff;
    background: #0078d4;
    padding: 2px 7px;
    border-radius: 4px;
    z-index: 10;
    pointer-events: none;
    letter-spacing: 0.5px;
}

/* 同步器激活时：未选卡片显示点击提示 */
.mdp-sync-active .mdp-card {
    cursor: pointer;
}

.mdp-sync-active .mdp-card:not(.mdp-gc-master):not(.mdp-gc-slave) {
    border-style: dashed;
    border-color: var(--mdp-border);
}

.mdp-sync-active .mdp-card:not(.mdp-gc-master):not(.mdp-gc-slave)::after {
    content: '点击选择';
    position: absolute;
    top: 6px;
    right: 6px;
    font-size: 9px;
    font-weight: 600;
    color: var(--mdp-text-dim);
    background: var(--mdp-surface-hover);
    border: 1px dashed var(--mdp-border);
    padding: 1px 6px;
    border-radius: 4px;
    z-index: 10;
    pointer-events: none;
    opacity: 0.85;
}

.mdp-sync-active .mdp-card:not(.mdp-gc-master):not(.mdp-gc-slave):hover {
    border-color: var(--mdp-accent);
    border-style: solid;
}

.mdp-card-header {
    position: relative;
}

/* ====== Batch Rename (批量改名) ====== */

/* 批量改名按钮激活态 */
.mdp-btn-batch.active {
    background: var(--mdp-accent-light);
    border-color: var(--mdp-accent);
    color: var(--mdp-accent);
}

/* 批量模式下：未选中卡片虚线边框 + 点击提示 */
.mdp-batch-active .mdp-card {
    cursor: pointer;
}

.mdp-batch-active .mdp-card:not(.mdp-batch-selected) {
    border-style: dashed;
    border-color: var(--mdp-border);
}

.mdp-batch-active .mdp-card:not(.mdp-batch-selected)::after {
    content: '点击选择';
    position: absolute;
    top: 6px;
    right: 6px;
    font-size: 9px;
    font-weight: 600;
    color: var(--mdp-text-dim);
    background: var(--mdp-surface-hover);
    border: 1px dashed var(--mdp-border);
    padding: 1px 6px;
    border-radius: 4px;
    z-index: 10;
    pointer-events: none;
    opacity: 0.85;
}

.mdp-batch-active .mdp-card:not(.mdp-batch-selected):hover {
    border-color: var(--mdp-accent);
    border-style: solid;
}

/* 已选中的卡片：蓝色边框 + 光晕（便于快速定位） + 勾选标识
   覆盖两类选中源：
   - .mdp-batch-selected：批量改名模式下点选卡片
   - .mdp-card-highlighted：左侧「我的设备」侧边面板勾选
   样式共享，视觉表现一致，方便用户在主网格中快速定位 */
.mdp-card.mdp-batch-selected,
.mdp-card.mdp-card-highlighted {
    border-color: var(--mdp-accent);
    border-style: solid;
    /* 多层 box-shadow：实线描边 + 柔光环 + 外扩光晕 + 投影 */
    box-shadow:
        0 0 0 2px var(--mdp-accent),
        0 0 0 6px var(--mdp-accent-light),
        0 0 18px 4px var(--mdp-glow-primary),
        0 8px 24px var(--mdp-glow-secondary);
    transform: translateZ(0) scale(1.015);
    animation: mdp-batch-glow-pulse 1.8s ease-in-out infinite;
    /* 确保光晕层级高于相邻未选卡片，避免被遮挡 */
    z-index: 5;
    position: relative;
}

@keyframes mdp-batch-glow-pulse {
    0%, 100% {
        box-shadow:
            0 0 0 2px var(--mdp-accent),
            0 0 0 6px var(--mdp-accent-light),
            0 0 18px 4px var(--mdp-glow-primary),
            0 8px 24px var(--mdp-glow-secondary);
    }
    50% {
        box-shadow:
            0 0 0 2px var(--mdp-accent),
            0 0 0 10px var(--mdp-accent-light),
            0 0 28px 8px var(--mdp-glow-primary-strong),
            0 12px 32px var(--mdp-glow-secondary-strong);
    }
}

/* 降低动效偏好：保留静态光晕，停止脉动 */
@media (prefers-reduced-motion: reduce) {
    .mdp-card.mdp-batch-selected,
    .mdp-card.mdp-card-highlighted {
        animation: none;
    }
}

/* 移动端：关闭抬升与脉动以减轻视觉噪声，仅保留静态光晕 */
@media (max-width: 768px) {
    .mdp-card.mdp-batch-selected,
    .mdp-card.mdp-card-highlighted {
        transform: none;
        animation: none;
        box-shadow:
            0 0 0 2px var(--mdp-accent),
            0 0 0 4px var(--mdp-accent-light),
            0 0 12px 2px var(--mdp-glow-primary),
            0 4px 16px var(--mdp-glow-secondary);
    }
}

.mdp-card.mdp-batch-selected::after {
    content: '✓ 已选';
    position: absolute;
    top: 6px;
    right: 6px;
    font-size: 10px;
    font-weight: 700;
    color: #fff;
    background: var(--mdp-accent);
    padding: 2px 7px;
    border-radius: 4px;
    z-index: 10;
    pointer-events: none;
    letter-spacing: 0.3px;
    /* 勾选徽章也跟随做极轻微的呼吸，强化「已选」感 */
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.65), 0 2px 6px var(--mdp-glow-secondary);
}

/* 悬浮操作栏 */
.mdp-batch-bar {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--mdp-surface);
    border: 1px solid var(--mdp-border);
    border-radius: 10px;
    padding: 10px 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.18);
    z-index: 2000;
    white-space: nowrap;
    animation: mdp-slide-down 0.18s ease;
}

.mdp-batch-bar-count {
    font-size: 13px;
    font-weight: 600;
    color: var(--mdp-text);
    margin-right: 4px;
}

/* 批量改名对话框 */
.mdp-batch-dialog {
    min-width: 360px;
    max-width: 520px;
    width: 92vw;
}

/* 表单行（标签 + 输入） */
.mdp-batch-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.mdp-batch-row label {
    font-size: 12px;
    font-weight: 600;
    color: var(--mdp-text-secondary);
    width: 60px;
    flex-shrink: 0;
}

.mdp-batch-row .mdp-dialog-input {
    flex: 1;
    margin-bottom: 0;
}

.mdp-batch-digits-hint {
    font-size: 11px;
    color: var(--mdp-text-dim);
    white-space: nowrap;
}

/* 预览区 */
.mdp-batch-preview-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--mdp-text-secondary);
    margin: 12px 0 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mdp-batch-preview {
    max-height: 180px;
    overflow-y: auto;
    border: 1px solid var(--mdp-border);
    border-radius: 6px;
    background: var(--mdp-bg);
}

.mdp-batch-preview-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 10px;
    font-size: 12px;
    border-bottom: 1px solid var(--mdp-border);
}

.mdp-batch-preview-item:last-child {
    border-bottom: none;
}

.mdp-batch-old {
    flex: 1;
    color: var(--mdp-text-dim);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mdp-batch-arrow {
    color: var(--mdp-text-dim);
    flex-shrink: 0;
}

.mdp-batch-new {
    flex: 1;
    color: var(--mdp-accent);
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ====== Empty State ====== */
.mdp-empty {
    grid-column: 1 / -1;
    justify-self: stretch;
    width: 100%;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 200px);
    color: var(--mdp-text-dim);
    text-align: center;
    gap: 12px;
    padding: 20px;
}

.mdp-empty svg {
    width: 60px;
    height: 60px;
    opacity: 0.3;
}

.mdp-empty p {
    margin: 0;
    font-size: 14px;
}

.mdp-empty span {
    font-size: 12px;
    color: var(--mdp-text-dim);
}

.mdp-empty-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 4px;
    flex-wrap: wrap;
}

.mdp-empty-action {
    min-width: 88px;
    height: 34px;
    border-radius: 999px;
    font-size: 13px;
}

/* ====== Responsive ====== */

/* Tablet: iPad, small laptops */
@media (max-width: 1024px) {
    .mdp-header {
        padding: 0 12px;
    }

    .mdp-content {
        padding: 6px;
    }

    .mdp-grid {
        gap: 6px;
    }

    .mdp-toolbar-inner {
        gap: 6px;
    }

    .mdp-toolbar-panel {
        padding: 8px 12px;
    }

    .mdp-header-group {
        padding: 3px 8px;
    }

    .mdp-btn {
        padding: 4px 10px;
        font-size: 11px;
    }
}

/* Mobile landscape / large phone */
@media (max-width: 768px) {
    .mdp-header {
        padding: 0 8px;
        height: 44px;
        gap: 6px;
    }

    .mdp-header-title {
        font-size: clamp(11px, 3vw, 13px);
        /* Allow title to shrink but prevent it from pushing controls off screen */
        max-width: 45%;
        flex-shrink: 1;
    }

    .mdp-header-title span {
        display: inline;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .mdp-header-stats {
        display: none;
    }

    .mdp-header-spacer {
        flex: 1;
        min-width: 4px;
        max-width: 8px;
    }

    .mdp-toolbar-toggle,
    .mdp-theme-toggle {
        width: 36px;
        height: 36px;
        flex-shrink: 0;
    }

    .mdp-back-admin-btn {
        padding: 4px 8px;
        font-size: 11px;
        margin-left: 4px;
        flex-shrink: 0;
        white-space: nowrap;
        overflow: hidden;
        max-width: 80px;
    }

    .mdp-back-admin-btn svg {
        width: 12px;
        height: 12px;
        flex-shrink: 0;
    }

    .mdp-content {
        padding: 4px;
    }

    .mdp-grid {
        gap: 4px;
        /* 移动端：默认 2 列，横屏时 3 列 */
        grid-template-columns: repeat(2, 1fr);
        grid-auto-rows: minmax(120px, 22vh);
    }

    .mdp-toolbar-panel {
        padding: 6px 8px;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
    }

    .mdp-toolbar-inner {
        gap: 4px;
        flex-wrap: nowrap;
    }

    .mdp-header-controls {
        gap: 4px;
        flex-shrink: 0;
    }

    .mdp-header-group {
        padding: 3px 6px;
        gap: 4px;
        flex-shrink: 0;
        /* Prevent group from overflowing */
        max-width: 100%;
        overflow: hidden;
    }

    .mdp-group-label {
        font-size: 10px;
        /* Allow text to truncate */
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 50px;
    }

    .mdp-select {
        padding: 4px 6px;
        font-size: 11px;
        flex-shrink: 0;
    }

    .mdp-btn {
        padding: 4px 8px;
        font-size: 11px;
        gap: 3px;
        flex-shrink: 0;
        white-space: nowrap;
    }

    .mdp-btn svg {
        width: 12px;
        height: 12px;
    }

    .mdp-card-header {
        padding: 5px 6px;
    }

    .mdp-card-controls {
        padding: 3px 4px;
        gap: 1px;
    }

    .mdp-ctrl-btn {
        width: 30px;
        height: 28px;
    }

    .mdp-ctrl-btn svg {
        width: 14px;
        height: 14px;
    }

    .mdp-card-name {
        font-size: 11px;
    }

    .mdp-card-udid {
        font-size: 9px;
    }

    .mdp-device-dot {
        width: 7px;
        height: 7px;
    }

    .mdp-edit-name-btn {
        width: 20px;
        height: 20px;
    }

    .mdp-edit-name-btn svg {
        width: 12px;
        height: 12px;
    }

    .mdp-ctrl-divider {
        height: 14px;
    }

    /* 移动端文本输入优化 */
    .mdp-text-input-overlay {
        bottom: 50px;
        width: 92%;
        padding: 12px;
    }

    .mdp-text-input {
        min-height: 60px;
        padding: 10px;
        font-size: 15px; /* 防止 iOS 缩放 */
    }

    .mdp-text-input-btn {
        padding: 8px 14px;
        font-size: 13px;
    }

    /* 移动端专注模式 */
    .mdp-card.focus-mode-active {
        max-height: calc(100vh - 120px);
    }

    .mdp-card.focus-mode-active .mdp-card-video {
        max-height: calc(100vh - 180px);
    }

    .mdp-focus-mode-close {
        width: 36px;
        height: 36px;
    }

}

/* Small mobile: phones */
@media (max-width: 480px) {
    .mdp-header {
        height: 40px;
        padding: 0 6px;
        gap: 4px;
    }

    .mdp-header-title {
        font-size: clamp(10px, 2.8vw, 12px);
        max-width: 40%;
        flex-shrink: 1;
    }

    .mdp-header-title svg {
        width: 15px;
        height: 15px;
        flex-shrink: 0;
    }

    .mdp-back-admin-btn {
        padding: 3px 6px;
        font-size: 10px;
        margin-left: 2px;
        flex-shrink: 0;
        white-space: nowrap;
        overflow: hidden;
        max-width: 70px;
    }

    .mdp-back-admin-btn svg {
        width: 11px;
        height: 11px;
        flex-shrink: 0;
    }

    .mdp-content {
        padding: 3px;
    }

    .mdp-grid {
        gap: 3px;
        /* 小屏手机：强制 1 列，全屏占满宽度 */
        grid-template-columns: repeat(1, 1fr);
        grid-auto-rows: minmax(160px, 30vh);
    }

    .mdp-toolbar-panel {
        padding: 5px 6px;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
    }

    .mdp-toolbar-inner {
        gap: 3px;
        flex-wrap: nowrap;
    }

    .mdp-header-controls {
        gap: 3px;
        flex-shrink: 0;
    }

    .mdp-header-group {
        padding: 2px 5px;
        gap: 3px;
        flex-shrink: 0;
        max-width: 100%;
        overflow: hidden;
    }

    .mdp-group-label {
        font-size: 9px;
        letter-spacing: 0;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 40px;
    }

    .mdp-select {
        padding: 3px 5px;
        font-size: 10px;
        flex-shrink: 0;
    }

    .mdp-btn {
        padding: 3px 6px;
        font-size: 10px;
        gap: 2px;
        flex-shrink: 0;
        white-space: nowrap;
    }

    .mdp-btn svg {
        width: 11px;
        height: 11px;
    }

    .mdp-card-header {
        padding: 4px 5px;
    }

    .mdp-card-controls {
        padding: 2px 3px;
        gap: 1px;
    }

    .mdp-ctrl-btn {
        width: 32px;
        height: 30px;
    }

    .mdp-ctrl-btn svg {
        width: 15px;
        height: 15px;
    }

    .mdp-card-name {
        font-size: 12px;
    }

    .mdp-card-udid {
        font-size: 10px;
    }

    .mdp-device-dot {
        width: 8px;
        height: 8px;
    }

    .mdp-edit-name-btn {
        width: 22px;
        height: 22px;
    }

    .mdp-edit-name-btn svg {
        width: 13px;
        height: 13px;
    }

    /* 小屏手机专注模式：全屏 */
    .mdp-card.focus-mode-active {
        max-height: calc(100vh - 100px);
    }

    .mdp-card.focus-mode-active .mdp-card-video {
        max-height: calc(100vh - 150px);
    }

    /* 移动端对话框 */
    .mdp-dialog {
        min-width: 280px;
        padding: 16px;
    }

    .mdp-dialog-title {
        font-size: 14px;
    }

    .mdp-dialog-input {
        font-size: 15px;
    }

    .mdp-dialog-btn {
        padding: 5px 12px;
        font-size: 12px;
    }
}

/* Extra small mobile: small Android devices */
@media (max-width: 360px) {
    .mdp-header {
        height: 38px;
    }

    .mdp-header-title {
        font-size: clamp(9px, 2.5vw, 11px);
        max-width: 35%;
    }

    .mdp-grid {
        grid-auto-rows: minmax(140px, 28vh);
    }

    .mdp-ctrl-btn {
        width: 36px;
        height: 32px;
    }

    .mdp-ctrl-btn svg {
        width: 16px;
        height: 16px;
    }

    .mdp-toolbar-toggle,
    .mdp-theme-toggle {
        width: 34px;
        height: 34px;
    }

    .mdp-toolbar-toggle svg,
    .mdp-theme-toggle svg {
        width: 16px;
        height: 16px;
    }
}

/* Landscape mobile */
@media (orientation: landscape) and (max-height: 600px) {
    .mdp-header {
        height: 36px;
        padding: 0 8px;
    }

    .mdp-header-title span {
        display: none;
    }

    .mdp-content {
        padding: 3px;
    }

    .mdp-grid {
        gap: 3px;
        /* 横屏：2-3 列，充分利用高度 */
        grid-template-columns: repeat(3, 1fr);
        grid-auto-rows: minmax(100px, 28vh);
    }

    .mdp-card-header {
        padding: 4px 6px;
    }

    .mdp-card-controls {
        padding: 2px 4px;
    }

    .mdp-ctrl-btn {
        width: 28px;
        height: 26px;
    }

    .mdp-ctrl-btn svg {
        width: 13px;
        height: 13px;
    }

    .mdp-toolbar-panel {
        padding: 5px 8px;
    }

    /* 横屏专注模式：最大高度限制 */
    .mdp-card.focus-mode-active {
        max-height: calc(100vh - 80px);
    }

    .mdp-card.focus-mode-active .mdp-card-video {
        max-height: calc(100vh - 130px);
    }

    .mdp-focus-mode-close {
        width: 30px;
        height: 30px;
    }
}

/* ====== 设备名称覆盖层 ====== */
.mdp-device-name-overlay {
    position: absolute;
    left: 50%;
    bottom: 8px;
    transform: translateX(-50%);
    padding: 2px 8px;
    background: rgba(0, 0, 0, 0.24);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    border-radius: 8px;
    cursor: inherit;
    z-index: 10;
    transition: opacity 0.2s;
    user-select: none;
    pointer-events: none;
    display: -webkit-box;
    overflow: hidden;
    text-overflow: ellipsis;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    line-height: 1.25;
    max-width: calc(100% - 12px);
    text-align: center;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.75);
}

.mdp-device-name-overlay:hover {
    background: rgba(0, 0, 0, 0.24);
    transform: translateX(-50%);
}

.mdp-card.focus-mode-active .mdp-device-name-overlay {
    display: none;
}

/* ====== 默认隐藏标题和控制栏 ====== */
.mdp-card-header-hidden {
    display: none !important;
}

.mdp-card-controls-hidden {
    display: none !important;
}

/* ====== 专注模式 ====== */
.mdp-card.focus-mode-hidden {
    display: none;
}

/* ===== 手机端经典全屏放大模式（只显示一台设备） =====
 * enterMobileClassicFocus 在容器 + grid 上打 mdp-mobile-classic-focus-active，
 * 通过以下规则隐藏其它卡片、让选中卡占满主区。
 */
.multi-device-page.mdp-mobile-classic-focus-active .mdp-grid > .mdp-card:not(.focus-mode-active) {
    display: none !important;
}
.multi-device-page.mdp-mobile-classic-focus-active .mdp-grid {
    grid-template-columns: 1fr !important;
    grid-auto-rows: 1fr !important;
    grid-template-rows: 1fr !important;
    overflow: hidden;
    gap: 0 !important;
    padding: 0 !important;
    height: 100%;
}
.multi-device-page.mdp-mobile-classic-focus-active .mdp-card.focus-mode-active.mdp-mobile-classic-card {
    width: 100%;
    height: 100%;
    max-height: none !important;
    border-radius: 0;
    box-shadow: none;
    transition: opacity 0.24s ease, transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
    will-change: opacity, transform;
}
.multi-device-page.mdp-mobile-classic-focus-active.mdp-mobile-classic-switch-next .mdp-card.mdp-mobile-classic-switch-out {
    opacity: 0;
    transform: translateX(-24px) scale(0.985);
    pointer-events: none;
}
.multi-device-page.mdp-mobile-classic-focus-active.mdp-mobile-classic-switch-prev .mdp-card.mdp-mobile-classic-switch-out {
    opacity: 0;
    transform: translateX(24px) scale(0.985);
    pointer-events: none;
}
.multi-device-page.mdp-mobile-classic-focus-active.mdp-mobile-classic-switch-next .mdp-card.mdp-mobile-classic-switch-in {
    opacity: 0;
    transform: translateX(24px) scale(0.985);
}
.multi-device-page.mdp-mobile-classic-focus-active.mdp-mobile-classic-switch-prev .mdp-card.mdp-mobile-classic-switch-in {
    opacity: 0;
    transform: translateX(-24px) scale(0.985);
}

.mdp-card.focus-mode-active {
    grid-column: 1;
    grid-row: 1;
    width: 100%;
    height: 100%;
    min-height: 0;
    max-height: calc(100vh - 160px); /* 预留顶部导航、标题栏、底部操作栏空间 */
    align-self: stretch;
    box-sizing: border-box;
}

.mdp-card.focus-mode-active .mdp-card-video {
    flex: 1;
    min-height: 0;
    height: auto;
    max-height: calc(100vh - 220px); /* 预留 header 和 controls 高度 */
}

.mdp-focus-mode-minimize,
.mdp-focus-mode-fullscreen,
.mdp-focus-mode-close,
.mdp-mobile-classic-switch-btn {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s, box-shadow 0.2s, border-color 0.2s;
    padding: 0;
    flex-shrink: 0;
}

.mdp-focus-mode-minimize {
    border: 1px solid rgba(0, 120, 212, 0.22);
    background: rgba(0, 120, 212, 0.08);
    color: var(--mdp-accent);
}

.mdp-focus-mode-minimize:hover {
    background: rgba(0, 120, 212, 0.14);
    border-color: rgba(0, 120, 212, 0.36);
    box-shadow: 0 4px 12px rgba(0, 120, 212, 0.18);
    transform: translateY(-1px);
}

.mdp-focus-mode-minimize svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

/* 专注模式全屏按钮 */
.mdp-focus-mode-fullscreen {
    border: 1px solid rgba(16, 137, 62, 0.24);
    background: rgba(16, 137, 62, 0.08);
    color: #107c41;
}

.mdp-focus-mode-fullscreen:hover {
    background: rgba(16, 137, 62, 0.14);
    border-color: rgba(16, 137, 62, 0.4);
    box-shadow: 0 4px 12px rgba(16, 137, 62, 0.2);
    transform: translateY(-1px);
}

.mdp-focus-mode-fullscreen svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.mdp-mobile-classic-switch-btn {
    border: 1px solid rgba(124, 58, 237, 0.24);
    background: rgba(124, 58, 237, 0.08);
    color: #7c3aed;
}

.mdp-mobile-classic-switch-btn:hover,
.mdp-mobile-classic-switch-btn.is-active {
    background: rgba(124, 58, 237, 0.14);
    border-color: rgba(124, 58, 237, 0.4);
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.2);
    transform: translateY(-1px);
}

.mdp-mobile-classic-switch-btn svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.mdp-mobile-classic-switch-toolbar {
    position: fixed;
    left: 50%;
    bottom: calc(84px + env(safe-area-inset-bottom, 0px));
    z-index: 99990;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border: 1px solid rgba(255, 255, 255, 0.62);
    border-radius: 999px;
    background: rgba(17, 24, 39, 0.82);
    color: #fff;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.28);
    backdrop-filter: blur(18px) saturate(1.35);
    -webkit-backdrop-filter: blur(18px) saturate(1.35);
    opacity: 0;
    pointer-events: none;
    touch-action: none;
    transform: translateX(-50%) translateY(12px) scale(0.96);
    transition: opacity 0.18s ease, transform 0.24s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.18s ease;
}

.mdp-mobile-classic-switch-toolbar.is-visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0) scale(1);
}

.mdp-mobile-classic-switch-toolbar.is-pressing,
.mdp-mobile-classic-switch-toolbar.is-dragging {
    box-shadow: 0 20px 48px rgba(15, 23, 42, 0.36);
}

.mdp-mobile-classic-switch-nav {
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
    cursor: pointer;
    padding: 0;
    transition: background 0.15s ease, transform 0.15s ease, opacity 0.15s ease;
}

.mdp-mobile-classic-switch-nav:active {
    transform: scale(0.94);
}

.mdp-mobile-classic-switch-nav:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.mdp-mobile-classic-switch-nav svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

.mdp-mobile-classic-switch-status {
    min-width: 54px;
    text-align: center;
    font-size: 14px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    line-height: 1;
    user-select: none;
}

@media (prefers-reduced-motion: reduce) {
    .multi-device-page.mdp-mobile-classic-focus-active .mdp-card.focus-mode-active.mdp-mobile-classic-card,
    .mdp-mobile-classic-switch-toolbar,
    .mdp-mobile-classic-switch-nav,
    .mdp-mobile-classic-switch-btn {
        transition: none;
    }
}

/* 专注模式关闭按钮 */
.mdp-focus-mode-close {
    border: 1px solid rgba(209, 52, 56, 0.22);
    background: rgba(209, 52, 56, 0.08);
    color: var(--mdp-danger);
}

.mdp-focus-mode-close:hover {
    background: rgba(209, 52, 56, 0.14);
    border-color: rgba(209, 52, 56, 0.36);
    box-shadow: 0 4px 12px rgba(209, 52, 56, 0.18);
    transform: translateY(-1px);
}

.mdp-focus-mode-close svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

/* 多选模式样式 */
.mdp-card.selection-mode {
    outline: 3px solid #3b82f6;
}

.mdp-card-checkbox {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid #cbd5e1;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: all 0.2s;
}

.mdp-card-checkbox svg {
    width: 16px;
    height: 16px;
    stroke: #3b82f6;
    display: none;
}

.selection-mode .mdp-card-checkbox {
    display: flex;
}

.selection-mode .mdp-card-checkbox {
    border-color: #3b82f6;
    background: #fff;
}

.selection-mode .mdp-card-checkbox svg {
    display: block;
}

.mdp-card.selected .mdp-card-checkbox {
    background: #3b82f6;
    border-color: #3b82f6;
}

.mdp-card.selected .mdp-card-checkbox svg {
    stroke: #fff;
}

/* ====== Enhanced Mobile Optimizations ====== */

/* Ensure video area takes maximum space on mobile */
@media (max-width: 768px) {
    .mdp-card {
        min-height: 0;
        height: 100%;
    }

    .mdp-card-video {
        flex: 1 1 0;
        min-height: 120px;
    }

    /* Better touch targets for controls */
    .mdp-ctrl-btn {
        min-width: 36px;
        min-height: 36px;
        width: auto;
        height: auto;
        padding: 6px 8px;
    }

    /* 移动端文字模式下提供合理 padding 与较大触控区域；
       icon-text-v 在窄屏上文字字号略缩，保留双行布局可读性。 */
    .mdp-ctrl-btn[data-display-mode="text"],
    .mdp-ctrl-btn[data-display-mode="icon-text-h"] {
        padding: 6px 10px;
    }

    .mdp-ctrl-btn[data-display-mode="icon-text-v"] {
        padding: 4px 6px;
        gap: 1px;
    }

    .mdp-ctrl-btn .mdp-ctrl-label {
        font-size: 11px;
    }

    .mdp-ctrl-btn[data-display-mode="icon-text-v"] .mdp-ctrl-label {
        font-size: 9px;
    }

    /* Prevent text selection on cards */
    .mdp-card-name,
    .mdp-card-udid {
        user-select: none;
        -webkit-user-select: none;
    }

    /* Balance display on mobile - show balance only, hide extra text */
    .mdp-header-group .mdp-group-label {
        display: none;
    }

    /* Better scroll on mobile */
    .mdp-content {
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
    }

    /* Toolbar panel scroll horizontal on mobile */
    .mdp-toolbar-panel {
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
    }

    .mdp-toolbar-inner {
        flex-wrap: nowrap;
        min-width: max-content;
    }

    /* Header controls scroll horizontal */
    .mdp-header-controls {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        flex-wrap: nowrap;
        min-width: max-content;
        max-width: 100%;
    }

    /* Hide udid on very small screens */
    @media (max-width: 380px) {
        .mdp-card-udid {
            display: none;
        }
    }
}

/* High-DPI mobile optimizations */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .mdp-card-video video {
        image-rendering: -webkit-optimize-contrast;
    }
}

/* Safe area insets for notched devices (iPhone X and newer) */
@supports (padding: max(0px)) {
    @media (max-width: 768px) {
        .mdp-header {
            padding-left: max(12px, env(safe-area-inset-left));
            padding-right: max(12px, env(safe-area-inset-right));
        }

        .mdp-content {
            padding-bottom: max(8px, env(safe-area-inset-bottom));
        }

        .mdp-text-input-overlay {
            padding-left: max(16px, env(safe-area-inset-left));
            padding-right: max(16px, env(safe-area-inset-right));
            padding-bottom: max(16px, env(safe-area-inset-bottom));
        }
    }
}

/* Better video placeholder icons on mobile */
@media (max-width: 768px) {
    .mdp-video-placeholder svg {
        width: 48px;
        height: 48px;
    }

    .mdp-video-placeholder p {
        font-size: 13px;
    }

    /* Loading spinner size on mobile */
    .mdp-spinner {
        width: 32px;
        height: 32px;
        border-width: 3px;
    }

    /* Prevent pull-to-refresh on content area */
    .mdp-content {
        overscroll-behavior-y: contain;
        touch-action: pan-y;
    }
}

/* Dark mode touch-friendly improvements */
@media (max-width: 768px) and (prefers-color-scheme: dark) {
    .mdp-text-input-overlay,
    .mdp-dialog {
        backdrop-filter: blur(20px) saturate(1.5);
        -webkit-backdrop-filter: blur(20px) saturate(1.5);
    }
}

/* Landscape mobile: maximize video area */
@media (orientation: landscape) and (max-height: 500px) {
    .mdp-card {
        flex-direction: row;
    }

    .mdp-card.focus-mode-active {
        flex-direction: column;
    }

    .mdp-card-header {
        writing-mode: vertical-lr;
        text-orientation: mixed;
        border-bottom: none;
        border-right: 1px solid var(--mdp-border);
        width: 32px;
        padding: 8px 4px;
        flex-shrink: 0;
    }

    .mdp-card.focus-mode-active .mdp-card-header {
        writing-mode: horizontal-tb;
        text-orientation: initial;
        border-right: none;
        border-bottom: 1px solid var(--mdp-border);
        width: auto;
        padding: 6px 8px;
    }

    .mdp-card-header-hidden {
        display: none !important;
    }

    .mdp-card-controls {
        writing-mode: vertical-lr;
        text-orientation: mixed;
        border-top: none;
        border-left: 1px solid var(--mdp-border);
        width: 32px;
        padding: 8px 4px;
        flex-shrink: 0;
        flex-direction: column;
        overflow-y: auto;
    }

    .mdp-card.focus-mode-active .mdp-card-controls {
        writing-mode: horizontal-tb;
        text-orientation: initial;
        border-left: none;
        border-top: 1px solid var(--mdp-border);
        width: auto;
        padding: 4px 6px;
        flex-direction: row;
        overflow-x: auto;
        overflow-y: hidden;
    }

    .mdp-card.focus-mode-active .mdp-sensor-test-btn {
        min-width: 96px;
    }

    .mdp-card.focus-mode-active .mdp-card-header-actions {
        gap: 4px;
    }

    .mdp-card-controls-hidden {
        display: none !important;
    }

    .mdp-card-video {
        flex: 1;
        min-height: 0;
        height: auto;
    }
}

/* ====== Toast Notifications ====== */
.mdp-toast-container {
    position: fixed;
    top: 72px;
    right: 20px;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.mdp-toast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    min-width: 240px;
    max-width: 380px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.18), 0 1px 4px rgba(0, 0, 0, 0.12);
    pointer-events: auto;
    opacity: 0;
    transform: translateX(110%);
    transition: opacity 0.35s ease, transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.mdp-toast-enter {
    opacity: 1;
    transform: translateX(0);
}

.mdp-toast-exit {
    opacity: 0;
    transform: translateX(110%);
    transition: opacity 0.35s ease, transform 0.35s ease-in;
}

.mdp-toast-icon {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.mdp-toast-icon svg {
    width: 20px;
    height: 20px;
}

.mdp-toast-msg {
    flex: 1;
    line-height: 1.4;
    color: inherit;
}

/* Warn — amber */
.mdp-toast-warn {
    background: #fff8e1;
    border: 1px solid #ffd54f;
    color: #bf360c;
}

.mdp-toast-warn .mdp-toast-icon {
    color: #f57f17;
}

/* Info — blue */
.mdp-toast-info {
    background: #e3f2fd;
    border: 1px solid #90caf9;
    color: #0d47a1;
}

.mdp-toast-info .mdp-toast-icon {
    color: #1565c0;
}

/* Error — red */
.mdp-toast-error {
    background: #ffebee;
    border: 1px solid #ef9a9a;
    color: #b71c1c;
}

.mdp-toast-error .mdp-toast-icon {
    color: #c62828;
}

/* Success — green */
.mdp-toast-success {
    background: #e8f5e9;
    border: 1px solid #a5d6a7;
    color: #1b5e20;
}

.mdp-toast-success .mdp-toast-icon {
    color: #2e7d32;
}

/* Dark theme overrides */
[data-theme="dark"] .mdp-toast-success {
    background: #1b3a1b;
    border-color: #2e7d32;
    color: #a5d6a7;
}

[data-theme="dark"] .mdp-toast-success .mdp-toast-icon {
    color: #66bb6a;
}

[data-theme="dark"] .mdp-toast-warn {
    background: #3e2723;
    border-color: #6d4c41;
    color: #ffcc80;
}

[data-theme="dark"] .mdp-toast-warn .mdp-toast-icon {
    color: #ffa726;
}

[data-theme="dark"] .mdp-toast-info {
    background: #1a237e;
    border-color: #3949ab;
    color: #90caf9;
}

[data-theme="dark"] .mdp-toast-info .mdp-toast-icon {
    color: #64b5f6;
}

[data-theme="dark"] .mdp-toast-error {
    background: #4a148c;
    border-color: #7b1fa2;
    color: #f8bbd0;
}

[data-theme="dark"] .mdp-toast-error .mdp-toast-icon {
    color: #f06292;
}

/* Mobile responsive */
@media (max-width: 640px) {
    .mdp-toast-container {
        top: max(10px, env(safe-area-inset-top));
        right: 10px;
        left: 10px;
        align-items: center;
    }

    .mdp-toast {
        gap: 8px;
        min-width: 0;
        width: auto;
        max-width: min(88vw, 360px);
        padding: 8px 12px;
        border-radius: 999px;
        font-size: 12px;
        box-shadow: 0 3px 14px rgba(0, 0, 0, 0.18), 0 1px 3px rgba(0, 0, 0, 0.12);
        transform: translateY(-120%);
    }

    .mdp-toast-enter {
        transform: translateY(0);
    }

    .mdp-toast-exit {
        transform: translateY(-120%);
    }

    .mdp-toast-icon svg {
        width: 16px;
        height: 16px;
    }

    .mdp-toast-msg {
        max-width: calc(88vw - 64px);
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}

/* ====== Mobile Bottom Navigation ====== */
.mdp-bottom-nav {
    display: none;
}

.mdp-bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    height: 100%;
    gap: 3px;
    border: none;
    background: transparent;
    color: var(--mdp-text-secondary);
    font-size: 10px;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.15s;
    padding: 0;
    font-family: inherit;
    -webkit-tap-highlight-color: transparent;
    position: relative;
}

.mdp-bottom-nav-item svg {
    width: 22px;
    height: 22px;
    transition: transform 0.15s;
}

.mdp-bottom-nav-item.active {
    color: var(--mdp-accent);
    font-weight: 600;
}

.mdp-bottom-nav-item.active::after {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 28px;
    height: 3px;
    border-radius: 0 0 3px 3px;
    background: var(--mdp-accent);
}

.mdp-bottom-nav-badge {
    position: absolute;
    top: 2px;
    right: 50%;
    transform: translateX(14px);
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 999px;
    background: var(--mdp-danger);
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* ====== Device Expiry Badge (top-left of video area) ====== */
/* 紧凑单行角标：只显示 "剩N天" / "今天到期" / "已到期"；完整到期日期通过 title 与点击后的操作面板副标题呈现 */
.mdp-expiry-badge {
    position: absolute;
    top: 5px;
    left: 5px;
    z-index: 12;
    display: inline-flex;
    align-items: center;
    max-width: 88px;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #fff;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.15s, transform 0.1s;
    pointer-events: auto;
}

.mdp-expiry-badge:active {
    transform: scale(0.94);
}

.mdp-expiry-badge.expiring-soon {
    background: rgba(234, 88, 12, 0.85);
}

.mdp-expiry-badge.expired {
    background: rgba(220, 38, 38, 0.85);
}

/* 到期角标仅在预览模式显示；放大（focus-mode-active）与全屏（body.fullscreen-mode）模式下隐藏 */
.mdp-card.focus-mode-active .mdp-expiry-badge,
body.fullscreen-mode .mdp-expiry-badge {
    display: none !important;
}

/* ====== Device Action Sheet (bottom sheet triggered by expiry-badge click) ====== */
.mdp-action-sheet-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0, 0, 0, 0);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    transition: background 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.mdp-action-sheet-overlay.mdp-action-sheet-overlay-enter {
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

.mdp-action-sheet-overlay.mdp-action-sheet-overlay-leave {
    background: rgba(0, 0, 0, 0);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.mdp-action-sheet {
    width: 100%;
    max-width: 520px;
    max-height: 80vh;
    background: var(--mdp-surface);
    color: var(--mdp-text);
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.18);
    display: flex;
    flex-direction: column;
    padding: 10px 0 max(16px, env(safe-area-inset-bottom, 16px));
    transform: translateY(100%);
    transition: transform 0.22s cubic-bezier(0.2, 0.8, 0.25, 1);
    overflow: hidden;
    /* 桌面端留一些底部间距，避免贴到屏幕最下沿 */
}

.mdp-action-sheet.mdp-action-sheet-enter {
    transform: translateY(0);
}

.mdp-action-sheet.mdp-action-sheet-leave {
    transform: translateY(100%);
}

.mdp-action-sheet-grip {
    width: 44px;
    height: 4px;
    border-radius: 999px;
    background: var(--mdp-border);
    margin: 4px auto 10px;
    flex-shrink: 0;
}

.mdp-action-sheet-header {
    padding: 6px 20px 14px;
    border-bottom: 1px solid var(--mdp-border);
    flex-shrink: 0;
}

.mdp-action-sheet-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--mdp-text);
    line-height: 1.3;
    word-break: break-all;
}

.mdp-action-sheet-subtitle {
    margin-top: 4px;
    font-size: 12px;
    color: var(--mdp-text-dim);
    line-height: 1.4;
    word-break: break-all;
}

.mdp-action-sheet-actions {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px 12px;
    overflow-y: auto;
    flex: 1 1 auto;
    min-height: 0;
    -webkit-overflow-scrolling: touch;
}

.mdp-action-sheet-btn {
    appearance: none;
    -webkit-appearance: none;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 10px;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    font: inherit;
    color: var(--mdp-text);
    text-align: left;
    cursor: pointer;
    transition: background 0.12s, border-color 0.12s;
    min-height: 56px;
}

.mdp-action-sheet-btn:hover {
    background: var(--mdp-surface-hover);
}

.mdp-action-sheet-btn:active {
    background: var(--mdp-accent-light);
}

.mdp-action-sheet-btn-disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.mdp-action-sheet-btn-disabled:hover {
    background: transparent;
}

.mdp-action-sheet-btn-icon {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--mdp-accent-light);
    color: var(--mdp-accent);
}

.mdp-action-sheet-btn-icon svg {
    width: 18px;
    height: 18px;
}

.mdp-action-sheet-btn-primary .mdp-action-sheet-btn-icon {
    background: rgba(22, 163, 74, 0.12);
    color: #16a34a;
}

.mdp-action-sheet-btn-info .mdp-action-sheet-btn-icon {
    background: var(--mdp-accent-light);
    color: var(--mdp-accent);
}

.mdp-action-sheet-btn-warn .mdp-action-sheet-btn-icon {
    background: rgba(245, 158, 11, 0.14);
    color: #f59e0b;
}

.mdp-action-sheet-btn-danger .mdp-action-sheet-btn-icon {
    background: rgba(220, 38, 38, 0.12);
    color: var(--mdp-danger);
}

.mdp-action-sheet-btn-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.mdp-action-sheet-btn-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--mdp-text);
    line-height: 1.3;
}

.mdp-action-sheet-btn-desc {
    font-size: 11px;
    color: var(--mdp-text-dim);
    line-height: 1.4;
}

.mdp-action-sheet-btn-chevron {
    flex-shrink: 0;
    color: var(--mdp-text-dim);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.mdp-action-sheet-btn-chevron svg {
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.mdp-action-sheet-footer {
    padding: 8px 12px 4px;
    border-top: 1px solid var(--mdp-border);
    flex-shrink: 0;
}

.mdp-action-sheet-cancel {
    appearance: none;
    -webkit-appearance: none;
    width: 100%;
    padding: 12px 14px;
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    color: var(--mdp-text-secondary);
    background: transparent;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    min-height: 44px;
    transition: background 0.12s;
}

.mdp-action-sheet-cancel:hover {
    background: var(--mdp-surface-hover);
}

/* Desktop: center the sheet vertically and apply a smaller width */
@media (min-width: 768px) {
    .mdp-action-sheet-overlay {
        align-items: center;
    }

    .mdp-action-sheet {
        max-width: 480px;
        max-height: 82vh;
        border-radius: 16px;
        padding-bottom: 16px;
        transform: translateY(30px) scale(0.98);
        opacity: 0;
    }

    .mdp-action-sheet.mdp-action-sheet-enter {
        transform: translateY(0) scale(1);
        opacity: 1;
    }

    .mdp-action-sheet.mdp-action-sheet-leave {
        transform: translateY(20px) scale(0.98);
        opacity: 0;
    }

    .mdp-action-sheet-grip {
        display: none;
    }
}

/* ====== Release Dialog (used by action sheet 释放) ====== */
.mdp-release-dialog {
    max-width: 460px;
    border: 2px solid var(--mdp-danger);
}

.mdp-release-dialog-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.mdp-release-dialog-icon {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    background: rgba(220, 38, 38, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--mdp-danger);
}

.mdp-release-dialog-icon svg {
    width: 20px;
    height: 20px;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.mdp-release-dialog-heading h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: var(--mdp-danger);
    line-height: 1.2;
}

.mdp-release-dialog-heading p {
    margin: 3px 0 0;
    font-size: 12px;
    color: var(--mdp-text-secondary);
    line-height: 1.3;
    word-break: break-all;
}

.mdp-release-dialog-warn {
    padding: 12px 14px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 13px;
    line-height: 1.7;
    background: rgba(220, 38, 38, 0.05);
    border: 1px solid rgba(220, 38, 38, 0.28);
    color: var(--mdp-danger);
}

.mdp-release-dialog-confirm {
    background: var(--mdp-danger) !important;
    color: #fff !important;
    font-weight: 600;
}

.mdp-release-dialog-confirm:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ====== Cloud-Drive File Picker (used by action sheet 网盘发送文件) ====== */
.mdp-action-sheet-file-list {
    max-height: 320px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
    border: 1px solid var(--mdp-border);
    border-radius: 8px;
    padding: 4px;
    margin-bottom: 10px;
    background: var(--mdp-bg);
    -webkit-overflow-scrolling: touch;
}

.mdp-action-sheet-file-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.12s;
    min-height: 48px;
}

.mdp-action-sheet-file-row:hover {
    background: var(--mdp-surface-hover);
}

.mdp-action-sheet-file-row input[type="radio"] {
    flex-shrink: 0;
    accent-color: var(--mdp-accent);
}

.mdp-action-sheet-file-text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.mdp-action-sheet-file-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--mdp-text);
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mdp-action-sheet-file-meta {
    font-size: 11px;
    color: var(--mdp-text-dim);
    line-height: 1.3;
}

.mdp-action-sheet-empty {
    padding: 32px 12px;
    text-align: center;
    color: var(--mdp-text-dim);
    font-size: 12px;
    line-height: 1.6;
}

.mdp-action-sheet-auto-install {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    margin-bottom: 14px;
    background: var(--mdp-bg);
    border: 1px solid var(--mdp-border);
    border-radius: 8px;
    cursor: pointer;
    font-size: 12px;
    color: var(--mdp-text);
}

.mdp-action-sheet-auto-install input[type="checkbox"] {
    accent-color: var(--mdp-accent);
    margin-top: 2px;
}

/* Tab content containers (used only on mobile) */
.mdp-tab-launcher,
.mdp-tab-settings,
.mdp-tab-store,
.mdp-tab-cloud-drive,
.mdp-tab-my,
.mdp-tab-notifications {
    display: none;
    flex: 1;
    min-height: 0;
}

.mdp-tab-launcher.active,
.mdp-tab-settings.active,
.mdp-tab-store.active,
.mdp-tab-cloud-drive.active,
.mdp-tab-my.active,
.mdp-tab-notifications.active {
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
}

/* Ensure cloud drive tab content isn't hidden behind fixed bottom nav */
.has-bottom-nav .mdp-tab-cloud-drive.active {
    padding-bottom: calc(56px + env(safe-area-inset-bottom, 0px) + 16px);
}

.mdp-my-scroll {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
    padding: 18px 14px;
    padding-bottom: calc(56px + env(safe-area-inset-bottom, 0px) + 20px);
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.mdp-my-scroll-desktop {
    width: 100%;
    max-width: 760px;
    margin: 0 auto;
    padding: 24px;
    padding-bottom: 32px;
}

.mdp-my-scroll-mobile {
    padding: clamp(10px, 3.4vw, 14px);
    padding-bottom: calc(56px + env(safe-area-inset-bottom, 0px) + clamp(12px, 3.4vw, 18px));
    gap: clamp(9px, 2.8vw, 12px);
}

.mdp-my-scroll-mobile .mdp-my-page-title {
    font-size: clamp(18px, 5.2vw, 20px);
}

.mdp-my-scroll-mobile .mdp-my-profile-card {
    gap: clamp(10px, 3.2vw, 14px);
    padding: clamp(6px, 2vw, 10px) 0 clamp(4px, 1.6vw, 8px);
}

.mdp-my-scroll-mobile .mdp-my-avatar {
    width: clamp(48px, 14.5vw, 56px);
    height: clamp(48px, 14.5vw, 56px);
    font-size: clamp(21px, 6vw, 24px);
    box-shadow: 0 8px 18px rgba(37, 99, 235, 0.16);
}

.mdp-my-scroll-mobile .mdp-my-username {
    font-size: clamp(17px, 5vw, 19px);
}

.mdp-my-scroll-mobile .mdp-my-user-id {
    margin-top: 4px;
    font-size: 12px;
}

.mdp-my-scroll-mobile .mdp-my-copy-id {
    width: 20px;
    height: 20px;
}

.mdp-my-scroll-mobile .mdp-my-service-card {
    gap: clamp(10px, 3vw, 14px);
    min-height: clamp(96px, 28vw, 112px);
    padding: clamp(12px, 3.6vw, 16px);
    border-radius: 12px;
    box-shadow: 0 10px 22px rgba(2, 132, 255, 0.2);
}

.mdp-my-scroll-mobile .mdp-my-service-card::after {
    right: -34px;
    top: -36px;
    width: 96px;
    height: 96px;
}

.mdp-my-scroll-mobile .mdp-my-service-robot {
    width: clamp(54px, 17vw, 66px);
    min-width: clamp(54px, 17vw, 66px);
}

.mdp-my-scroll-mobile .mdp-my-service-head {
    width: clamp(42px, 13vw, 48px);
    height: clamp(34px, 10.5vw, 40px);
    border-radius: 18px;
    border-width: 3px;
    gap: 9px;
}

.mdp-my-scroll-mobile .mdp-my-service-head span {
    width: 6px;
    height: 6px;
}

.mdp-my-scroll-mobile .mdp-my-service-band {
    width: clamp(56px, 17vw, 64px);
    height: 18px;
    border-width: 6px;
}

.mdp-my-scroll-mobile .mdp-my-service-title {
    font-size: clamp(15px, 4.2vw, 16px);
}

.mdp-my-scroll-mobile .mdp-my-service-subtitle {
    margin-top: 3px;
    font-size: 12px;
}

.mdp-my-scroll-mobile .mdp-my-service-btn {
    margin-top: 10px;
    min-height: 36px;
    padding: 0 16px;
    align-self: flex-start;
    font-size: 13px;
}

.mdp-my-scroll-mobile .mdp-my-section {
    padding: clamp(10px, 3.2vw, 13px);
    border-radius: 12px;
}

.mdp-my-scroll-mobile .mdp-my-section-title {
    font-size: 14px;
    margin-bottom: 10px;
}

.mdp-my-scroll-mobile .mdp-my-function-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px 6px;
}

.mdp-my-scroll-mobile .mdp-my-function-btn {
    gap: 5px;
    padding: 2px 1px;
    font-size: 11.5px;
}

.mdp-my-scroll-mobile .mdp-my-function-btn span:last-child {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mdp-my-scroll-mobile .mdp-my-function-icon {
    width: 28px;
    height: 28px;
}

.mdp-my-scroll-mobile .mdp-my-function-icon svg {
    width: 22px;
    height: 22px;
}

.mdp-my-scroll-mobile .mdp-my-logout-btn {
    min-height: 44px;
    font-size: 14px;
}

.mdp-my-scroll-mobile .mdp-my-logout-btn svg {
    width: 16px;
    height: 16px;
}

.mdp-my-page-title {
    color: var(--mdp-text);
    font-size: 22px;
    font-weight: 800;
    line-height: 1.2;
}

.mdp-my-profile-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 2px 10px;
}

.mdp-my-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #e0f2fe 0%, #60a5fa 52%, #818cf8 100%);
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.18);
    color: #ffffff;
    font-size: 28px;
    font-weight: 800;
}

.mdp-my-profile-main {
    min-width: 0;
    flex: 1;
}

.mdp-my-username {
    color: var(--mdp-text);
    font-size: 21px;
    font-weight: 700;
    line-height: 1.25;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mdp-my-user-id {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
    color: var(--mdp-text-secondary);
    font-size: 13px;
}

.mdp-my-copy-id {
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: var(--mdp-text-secondary);
    cursor: pointer;
    padding: 0;
}

.mdp-my-copy-id svg {
    width: 15px;
    height: 15px;
}

.mdp-my-service-card {
    position: relative;
    overflow: hidden;
    display: flex;
    gap: 16px;
    min-height: 128px;
    padding: 18px 22px;
    border-radius: 14px;
    background: linear-gradient(135deg, #14c8ff 0%, #0284ff 54%, #0969f5 100%);
    color: #ffffff;
    box-shadow: 0 12px 28px rgba(2, 132, 255, 0.24);
}

.mdp-my-service-card::after {
    content: '';
    position: absolute;
    right: -28px;
    top: -30px;
    width: 110px;
    height: 110px;
    border-radius: 999px;
    background: rgba(255,255,255,0.12);
}

.mdp-my-service-robot {
    width: 82px;
    min-width: 82px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.mdp-my-service-head {
    width: 58px;
    height: 48px;
    border-radius: 22px;
    background: linear-gradient(135deg, #eff6ff 0%, #bfdbfe 100%);
    border: 4px solid rgba(255,255,255,0.32);
    box-shadow: 0 10px 18px rgba(30, 64, 175, 0.24);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.mdp-my-service-head span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #2563eb;
}

.mdp-my-service-band {
    position: absolute;
    width: 78px;
    height: 24px;
    border-radius: 999px;
    border: 8px solid rgba(99,102,241,0.5);
}

.mdp-my-service-body {
    position: relative;
    z-index: 1;
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.mdp-my-service-title {
    font-size: 18px;
    font-weight: 800;
    letter-spacing: 0.02em;
}

.mdp-my-service-subtitle {
    margin-top: 5px;
    font-size: 13px;
    opacity: 0.86;
}

.mdp-my-service-btn {
    margin-top: 16px;
    min-height: 44px;
    border: none;
    border-radius: 999px;
    background: #ffffff;
    color: #1677d2;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.12);
    font-family: inherit;
}

.mdp-my-section {
    background: var(--mdp-surface);
    border: 1px solid var(--mdp-border);
    border-radius: 14px;
    padding: 16px;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.04);
}

.mdp-my-section-title {
    font-size: 15px;
    font-weight: 800;
    color: var(--mdp-text);
    margin-bottom: 14px;
}

.mdp-my-function-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px 8px;
}

.mdp-my-function-btn {
    appearance: none;
    border: none;
    background: transparent;
    color: var(--mdp-text-secondary);
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 4px 2px;
    cursor: pointer;
    font-size: 12px;
    font-family: inherit;
    -webkit-tap-highlight-color: transparent;
}

.mdp-my-function-icon {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--mdp-text-secondary);
}

.mdp-my-function-icon svg {
    width: 27px;
    height: 27px;
}

.mdp-my-function-btn:hover {
    color: var(--mdp-accent);
}

.mdp-my-logout-section {
    padding: 0;
    overflow: hidden;
}

.mdp-my-logout-btn {
    appearance: none;
    width: 100%;
    min-height: 52px;
    border: none;
    background: transparent;
    color: var(--mdp-danger);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 700;
    font-family: inherit;
}

.mdp-my-logout-btn svg {
    width: 18px;
    height: 18px;
}

.mdp-my-orders-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
    background: rgba(15, 23, 42, 0.48);
    backdrop-filter: blur(4px);
}

.mdp-my-orders-dialog {
    width: min(560px, 100%);
    max-height: min(82vh, 720px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--mdp-border);
    border-radius: 16px;
    background: var(--mdp-surface);
    color: var(--mdp-text);
    font-size: 13px;
    box-shadow: 0 22px 68px rgba(15, 23, 42, 0.24);
}

.mdp-my-orders-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 18px;
    border-bottom: 1px solid var(--mdp-border);
    background: linear-gradient(180deg, rgba(37, 99, 235, 0.06), rgba(37, 99, 235, 0));
}

.mdp-my-orders-title {
    font-size: 19px;
    font-weight: 800;
    line-height: 1.2;
    color: #0f172a;
    letter-spacing: 0.01em;
}

.mdp-my-orders-subtitle {
    margin-top: 5px;
    font-size: 12.5px;
    font-weight: 500;
    color: #64748b;
}

.mdp-my-orders-close {
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 50%;
    background: rgba(100, 116, 139, 0.1);
    color: #475569;
    cursor: pointer;
    font-size: 22px;
    line-height: 1;
}

.mdp-my-orders-close:hover {
    background: rgba(37, 99, 235, 0.1);
    color: #1d4ed8;
}

.mdp-my-orders-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 14px;
}

.mdp-my-orders-loading,
.mdp-my-orders-empty,
.mdp-my-orders-error {
    padding: 42px 16px;
    text-align: center;
    color: #64748b;
    font-size: 13.5px;
    font-weight: 600;
}

.mdp-my-orders-error {
    color: #dc2626;
}

.mdp-my-orders-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mdp-my-order-card {
    padding: 14px 15px;
    border: 1px solid rgba(148, 163, 184, 0.24);
    border-radius: 12px;
    background: linear-gradient(180deg, #ffffff 0%, rgba(248, 250, 252, 0.96) 100%);
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.05);
}

.mdp-my-order-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.mdp-my-order-title {
    min-width: 0;
    color: #111827;
    font-size: 15px;
    font-weight: 800;
    line-height: 1.35;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mdp-my-order-amount {
    flex-shrink: 0;
    color: #0f766e;
    font-size: 17px;
    font-weight: 800;
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
}

.mdp-my-order-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}

.mdp-my-order-meta span {
    padding: 3px 8px;
    border-radius: 999px;
    background: rgba(37, 99, 235, 0.09);
    color: #2563eb;
    font-size: 11.5px;
    font-weight: 700;
    line-height: 1.25;
}

.mdp-my-order-status.paid {
    background: rgba(22, 163, 74, 0.14);
    color: #166534;
}

.mdp-my-order-status.pending {
    background: rgba(245, 158, 11, 0.18);
    color: #92400e;
}

.mdp-my-order-status.closed {
    background: rgba(100, 116, 139, 0.14);
    color: #475569;
}

.mdp-my-order-status.error {
    background: rgba(220, 38, 38, 0.14);
    color: #b91c1c;
}

.mdp-my-order-status.default {
    background: rgba(99, 102, 241, 0.12);
    color: #4338ca;
}

.mdp-my-order-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding-top: 6px;
    color: #64748b;
    font-size: 12.5px;
    line-height: 1.45;
}

.mdp-my-order-row span {
    flex-shrink: 0;
    font-weight: 600;
}

.mdp-my-order-row strong {
    min-width: 0;
    color: #334155;
    font-weight: 700;
    text-align: right;
    word-break: break-all;
}

[data-theme="dark"] .mdp-my-orders-header {
    background: linear-gradient(180deg, rgba(76, 194, 255, 0.08), rgba(76, 194, 255, 0));
}

[data-theme="dark"] .mdp-my-orders-title,
[data-theme="dark"] .mdp-my-order-title {
    color: #f8fafc;
}

[data-theme="dark"] .mdp-my-orders-subtitle,
[data-theme="dark"] .mdp-my-orders-loading,
[data-theme="dark"] .mdp-my-orders-empty,
[data-theme="dark"] .mdp-my-order-row {
    color: #94a3b8;
}

[data-theme="dark"] .mdp-my-orders-close {
    background: rgba(148, 163, 184, 0.14);
    color: #cbd5e1;
}

[data-theme="dark"] .mdp-my-order-card {
    border-color: rgba(148, 163, 184, 0.2);
    background: linear-gradient(180deg, rgba(30, 41, 59, 0.92), rgba(15, 23, 42, 0.82));
}

[data-theme="dark"] .mdp-my-order-amount {
    color: #5eead4;
}

[data-theme="dark"] .mdp-my-order-row strong {
    color: #e2e8f0;
}

/* ---- 用户协议查看弹窗 ---- */
.mdp-my-agreement-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
    background: rgba(15, 23, 42, 0.48);
    backdrop-filter: blur(4px);
}

.mdp-my-agreement-dialog {
    width: min(560px, 100%);
    max-height: min(82vh, 720px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--mdp-border);
    border-radius: 16px;
    background: var(--mdp-surface);
    color: var(--mdp-text);
    font-size: 13px;
    box-shadow: 0 22px 68px rgba(15, 23, 42, 0.24);
}

.mdp-my-agreement-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 18px;
    border-bottom: 1px solid var(--mdp-border);
    background: linear-gradient(180deg, rgba(37, 99, 235, 0.06), rgba(37, 99, 235, 0));
}

.mdp-my-agreement-title {
    font-size: 19px;
    font-weight: 800;
    line-height: 1.2;
    color: #0f172a;
    letter-spacing: 0.01em;
}

.mdp-my-agreement-subtitle {
    margin-top: 5px;
    font-size: 12.5px;
    font-weight: 500;
    color: #64748b;
}

.mdp-my-agreement-close {
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 50%;
    background: rgba(100, 116, 139, 0.1);
    color: #475569;
    cursor: pointer;
    font-size: 22px;
    line-height: 1;
}

.mdp-my-agreement-close:hover {
    background: rgba(37, 99, 235, 0.1);
    color: #1d4ed8;
}

.mdp-my-agreement-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 14px;
}

.mdp-my-agreement-loading,
.mdp-my-agreement-empty,
.mdp-my-agreement-error {
    padding: 42px 16px;
    text-align: center;
    color: #64748b;
    font-size: 13.5px;
    font-weight: 600;
}

.mdp-my-agreement-error {
    color: #dc2626;
}

.mdp-my-agreement-card {
    padding: 14px 15px;
    margin-bottom: 10px;
    border: 1px solid rgba(148, 163, 184, 0.24);
    border-radius: 12px;
    background: linear-gradient(180deg, #ffffff 0%, rgba(248, 250, 252, 0.96) 100%);
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.05);
}

.mdp-my-agreement-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

.mdp-my-agreement-card-num {
    color: #111827;
    font-size: 15px;
    font-weight: 800;
}

.mdp-my-agreement-card-source {
    font-size: 11.5px;
    font-weight: 600;
    color: #2563eb;
    background: rgba(37, 99, 235, 0.08);
    padding: 2px 10px;
    border-radius: 20px;
}

.mdp-my-agreement-card-meta {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 3px 12px;
    font-size: 12.5px;
    line-height: 1.7;
    margin-bottom: 8px;
}

.mdp-my-agreement-card-label {
    color: #64748b;
    font-weight: 600;
}

.mdp-my-agreement-card-value {
    color: #334155;
}

.mdp-my-agreement-card-value code {
    background: rgba(37, 99, 235, 0.08);
    color: #1d4ed8;
    padding: 1px 8px;
    border-radius: 4px;
    font-size: 11.5px;
    font-weight: 700;
}

.mdp-my-agreement-card-details {
    margin-top: 4px;
}

.mdp-my-agreement-card-summary {
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
    color: #2563eb;
    user-select: none;
}

.mdp-my-agreement-card-summary:hover {
    color: #1d4ed8;
}

.mdp-my-agreement-card-content {
    white-space: pre-wrap;
    word-break: break-all;
    font-size: 11.5px;
    line-height: 1.7;
    background: #f8fafc;
    padding: 12px;
    border-radius: 8px;
    max-height: 220px;
    overflow-y: auto;
    margin-top: 8px;
    color: #334155;
    border: 1px solid rgba(148, 163, 184, 0.18);
}

/* 暗色主题 */
[data-theme="dark"] .mdp-my-agreement-title {
    color: #f1f5f9;
}

[data-theme="dark"] .mdp-my-agreement-subtitle {
    color: #94a3b8;
}

[data-theme="dark"] .mdp-my-agreement-card {
    background: linear-gradient(180deg, rgba(30, 41, 59, 0.9) 0%, rgba(30, 41, 59, 0.7) 100%);
    border-color: rgba(71, 85, 105, 0.3);
}

[data-theme="dark"] .mdp-my-agreement-card-num {
    color: #e2e8f0;
}

[data-theme="dark"] .mdp-my-agreement-card-source {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
}

[data-theme="dark"] .mdp-my-agreement-card-label {
    color: #94a3b8;
}

[data-theme="dark"] .mdp-my-agreement-card-value {
    color: #cbd5e1;
}

[data-theme="dark"] .mdp-my-agreement-card-value code {
    background: rgba(59, 130, 246, 0.15);
    color: #93c5fd;
}

[data-theme="dark"] .mdp-my-agreement-card-content {
    background: rgba(15, 23, 42, 0.5);
    color: #cbd5e1;
    border-color: rgba(71, 85, 105, 0.25);
}

[data-theme="dark"] .mdp-my-agreement-card-summary {
    color: #60a5fa;
}

[data-theme="dark"] .mdp-my-agreement-card-summary:hover {
    color: #93c5fd;
}

.mdp-device-transfer-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
    background: rgba(15, 23, 42, 0.48);
    backdrop-filter: blur(4px);
}

.mdp-device-transfer-dialog {
    width: min(640px, 100%);
    max-height: min(86vh, 760px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--mdp-border);
    border-radius: 16px;
    background: var(--mdp-surface);
    color: var(--mdp-text);
    font-size: 13px;
    box-shadow: 0 22px 68px rgba(15, 23, 42, 0.24);
}

.mdp-device-transfer-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 18px;
    border-bottom: 1px solid var(--mdp-border);
    background: linear-gradient(180deg, rgba(15, 118, 110, 0.08), rgba(15, 118, 110, 0));
}

.mdp-device-transfer-title {
    font-size: 19px;
    font-weight: 800;
    line-height: 1.2;
    color: #0f172a;
    letter-spacing: 0.01em;
}

.mdp-device-transfer-subtitle {
    margin-top: 5px;
    font-size: 12.5px;
    font-weight: 500;
    color: #64748b;
}

.mdp-device-transfer-close {
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 50%;
    background: rgba(100, 116, 139, 0.1);
    color: #475569;
    cursor: pointer;
    font-size: 22px;
    line-height: 1;
}

.mdp-device-transfer-close:hover {
    background: rgba(15, 118, 110, 0.12);
    color: #0f766e;
}

.mdp-device-transfer-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 14px;
}

.mdp-device-transfer-loading,
.mdp-device-transfer-empty,
.mdp-device-transfer-error {
    padding: 42px 16px;
    text-align: center;
    color: #64748b;
    font-size: 13.5px;
    font-weight: 600;
}

.mdp-device-transfer-error {
    color: #dc2626;
}

.mdp-device-transfer-alert {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 12px;
    padding: 12px 14px;
    border: 1px solid rgba(20, 184, 166, 0.25);
    border-radius: 12px;
    background: rgba(240, 253, 250, 0.9);
    color: #0f766e;
    line-height: 1.6;
}

.mdp-device-transfer-alert strong {
    color: #134e4a;
    font-size: 13.5px;
}

.mdp-device-transfer-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 12px;
}

.mdp-device-transfer-field {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    color: #334155;
    font-size: 12px;
    font-weight: 700;
}

.mdp-device-transfer-field-full {
    grid-column: 1 / -1;
}

.mdp-device-transfer-field input {
    width: 100%;
    min-height: 40px;
    box-sizing: border-box;
    border: 1px solid rgba(148, 163, 184, 0.42);
    border-radius: 10px;
    background: #fff;
    color: #0f172a;
    padding: 0 12px;
    font: inherit;
    outline: none;
}

.mdp-device-transfer-field input:focus {
    border-color: #0f766e;
    box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.14);
}

.mdp-device-transfer-picker {
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 12px;
    overflow: hidden;
    background: rgba(248, 250, 252, 0.7);
}

.mdp-device-transfer-picker-head {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border: none;
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
    background: rgba(255, 255, 255, 0.82);
    color: inherit;
    cursor: pointer;
    font: inherit;
    text-align: left;
}

.mdp-device-transfer-picker-title {
    color: #0f172a;
    font-size: 14px;
    font-weight: 800;
}

.mdp-device-transfer-picker-subtitle {
    margin-top: 3px;
    color: #64748b;
    font-size: 12px;
    font-weight: 600;
}

.mdp-device-transfer-picker-toggle-text {
    flex-shrink: 0;
    border-radius: 999px;
    background: rgba(15, 118, 110, 0.1);
    color: #0f766e;
    padding: 5px 10px;
    font-size: 12px;
    font-weight: 800;
}

.mdp-device-transfer-picker-panel {
    display: block;
}

.mdp-device-transfer-picker.collapsed .mdp-device-transfer-picker-panel {
    display: none;
}

.mdp-device-transfer-picker-tools {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(255, 255, 255, 0.58);
}

.mdp-device-transfer-search {
    min-width: 0;
    flex: 1;
    min-height: 36px;
    box-sizing: border-box;
    border: 1px solid rgba(148, 163, 184, 0.38);
    border-radius: 10px;
    background: #fff;
    color: #0f172a;
    padding: 0 11px;
    font: inherit;
    outline: none;
}

.mdp-device-transfer-search:focus {
    border-color: #0f766e;
    box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.14);
}

.mdp-device-transfer-select-all {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #0f766e;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
    white-space: nowrap;
}

.mdp-device-transfer-list {
    max-height: 280px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 8px;
}

.mdp-device-transfer-device {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 11px 12px;
    border: 1px solid transparent;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.12s, border-color 0.12s;
}

.mdp-device-transfer-device:hover {
    background: rgba(15, 118, 110, 0.06);
}

.mdp-device-transfer-device.selected {
    border-color: rgba(15, 118, 110, 0.45);
    background: rgba(204, 251, 241, 0.55);
}

.mdp-device-transfer-device input {
    margin-top: 3px;
    accent-color: #0f766e;
    flex-shrink: 0;
}

.mdp-device-transfer-device-main {
    min-width: 0;
    flex: 1;
}

.mdp-device-transfer-device-name {
    color: #0f172a;
    font-size: 14px;
    font-weight: 800;
    line-height: 1.3;
}

.mdp-device-transfer-device-meta,
.mdp-device-transfer-device-udid {
    margin-top: 3px;
    color: #64748b;
    font-size: 12px;
    line-height: 1.35;
    word-break: break-all;
}

.mdp-device-transfer-device-udid {
    color: #94a3b8;
}

.mdp-device-transfer-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 14px;
}

.mdp-device-transfer-cancel,
.mdp-device-transfer-submit {
    min-height: 38px;
    border-radius: 10px;
    padding: 0 16px;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
}

.mdp-device-transfer-cancel {
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: #fff;
    color: #475569;
}

.mdp-device-transfer-submit {
    border: none;
    background: #0f766e;
    color: #fff;
}

.mdp-device-transfer-submit:disabled,
.mdp-device-transfer-cancel:disabled {
    opacity: 0.56;
    cursor: not-allowed;
}

.mdp-device-transfer-status {
    min-height: 18px;
    margin-top: 10px;
    color: #64748b;
    font-size: 12px;
    font-weight: 700;
    text-align: right;
}

.mdp-device-transfer-status.error {
    color: #dc2626;
}

.mdp-device-transfer-confirm-overlay {
    position: fixed;
    inset: 0;
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
    background: rgba(15, 23, 42, 0.58);
    backdrop-filter: blur(5px);
}

.mdp-device-transfer-confirm-dialog {
    width: min(420px, 100%);
    box-sizing: border-box;
    border: 1px solid rgba(20, 184, 166, 0.22);
    border-radius: 18px;
    background: var(--mdp-surface);
    color: var(--mdp-text);
    box-shadow: 0 24px 72px rgba(15, 23, 42, 0.32);
    padding: 22px;
    text-align: center;
}

.mdp-device-transfer-confirm-icon {
    width: 48px;
    height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    background: rgba(204, 251, 241, 0.82);
    color: #0f766e;
    margin-bottom: 14px;
}

.mdp-device-transfer-confirm-icon svg {
    width: 24px;
    height: 24px;
}

.mdp-device-transfer-confirm-title {
    color: #0f172a;
    font-size: 18px;
    font-weight: 850;
    line-height: 1.25;
}

.mdp-device-transfer-confirm-desc {
    margin-top: 8px;
    color: #64748b;
    font-size: 13px;
    line-height: 1.65;
}

.mdp-device-transfer-confirm-summary {
    display: grid;
    gap: 8px;
    margin: 16px 0 12px;
    padding: 12px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 14px;
    background: rgba(248, 250, 252, 0.72);
    text-align: left;
}

.mdp-device-transfer-confirm-summary div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    color: #64748b;
    font-size: 12.5px;
    line-height: 1.45;
}

.mdp-device-transfer-confirm-summary span {
    flex-shrink: 0;
    font-weight: 700;
}

.mdp-device-transfer-confirm-summary strong {
    min-width: 0;
    color: #0f172a;
    font-weight: 850;
    text-align: right;
    word-break: break-all;
}

.mdp-device-transfer-confirm-warning {
    border-radius: 12px;
    background: rgba(245, 158, 11, 0.13);
    color: #92400e;
    padding: 10px 12px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.55;
    text-align: left;
}

.mdp-device-transfer-confirm-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 18px;
}

.mdp-device-transfer-confirm-cancel,
.mdp-device-transfer-confirm-submit {
    min-height: 38px;
    border-radius: 10px;
    padding: 0 16px;
    font: inherit;
    font-weight: 850;
    cursor: pointer;
}

.mdp-device-transfer-confirm-cancel {
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: #fff;
    color: #475569;
}

.mdp-device-transfer-confirm-submit {
    border: none;
    background: #0f766e;
    color: #fff;
}

[data-theme="dark"] .mdp-device-transfer-confirm-title,
[data-theme="dark"] .mdp-device-transfer-confirm-summary strong {
    color: #f8fafc;
}

[data-theme="dark"] .mdp-device-transfer-confirm-desc,
[data-theme="dark"] .mdp-device-transfer-confirm-summary div {
    color: #94a3b8;
}

[data-theme="dark"] .mdp-device-transfer-confirm-icon {
    background: rgba(20, 184, 166, 0.16);
    color: #5eead4;
}

[data-theme="dark"] .mdp-device-transfer-confirm-summary {
    border-color: rgba(148, 163, 184, 0.2);
    background: rgba(15, 23, 42, 0.48);
}

[data-theme="dark"] .mdp-device-transfer-confirm-warning {
    background: rgba(245, 158, 11, 0.14);
    color: #facc15;
}

[data-theme="dark"] .mdp-device-transfer-confirm-cancel {
    border-color: rgba(148, 163, 184, 0.28);
    background: rgba(15, 23, 42, 0.74);
    color: #f8fafc;
}

[data-theme="dark"] .mdp-device-transfer-header {
    background: linear-gradient(180deg, rgba(94, 234, 212, 0.08), rgba(94, 234, 212, 0));
}

[data-theme="dark"] .mdp-device-transfer-title,
[data-theme="dark"] .mdp-device-transfer-picker-title,
[data-theme="dark"] .mdp-device-transfer-device-name {
    color: #f8fafc;
}

[data-theme="dark"] .mdp-device-transfer-subtitle,
[data-theme="dark"] .mdp-device-transfer-picker-subtitle,
[data-theme="dark"] .mdp-device-transfer-device-meta {
    color: #94a3b8;
}

[data-theme="dark"] .mdp-device-transfer-alert {
    border-color: rgba(94, 234, 212, 0.22);
    background: rgba(20, 184, 166, 0.1);
    color: #99f6e4;
}

[data-theme="dark"] .mdp-device-transfer-alert strong {
    color: #ccfbf1;
}

[data-theme="dark"] .mdp-device-transfer-field {
    color: #cbd5e1;
}

[data-theme="dark"] .mdp-device-transfer-field input,
[data-theme="dark"] .mdp-device-transfer-cancel {
    border-color: rgba(148, 163, 184, 0.28);
    background: rgba(15, 23, 42, 0.74);
    color: #f8fafc;
}

[data-theme="dark"] .mdp-device-transfer-picker {
    border-color: rgba(148, 163, 184, 0.2);
    background: rgba(15, 23, 42, 0.45);
}

[data-theme="dark"] .mdp-device-transfer-picker-head {
    border-color: rgba(148, 163, 184, 0.2);
    background: rgba(30, 41, 59, 0.72);
}

[data-theme="dark"] .mdp-device-transfer-picker-toggle-text {
    background: rgba(20, 184, 166, 0.16);
    color: #5eead4;
}

[data-theme="dark"] .mdp-device-transfer-picker-tools {
    border-color: rgba(148, 163, 184, 0.18);
    background: rgba(15, 23, 42, 0.38);
}

[data-theme="dark"] .mdp-device-transfer-search {
    border-color: rgba(148, 163, 184, 0.28);
    background: rgba(15, 23, 42, 0.74);
    color: #f8fafc;
}

[data-theme="dark"] .mdp-device-transfer-device.selected {
    border-color: rgba(94, 234, 212, 0.42);
    background: rgba(20, 184, 166, 0.12);
}

@media (max-width: 380px) {
    .mdp-my-scroll-mobile {
        padding-left: 10px;
        padding-right: 10px;
        gap: 8px;
    }

    .mdp-my-scroll-mobile .mdp-my-function-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 8px 4px;
    }

    .mdp-my-scroll-mobile .mdp-my-service-card {
        min-height: 92px;
        padding: 11px;
        gap: 8px;
    }

    .mdp-my-scroll-mobile .mdp-my-service-robot {
        width: 50px;
        min-width: 50px;
    }

    .mdp-my-scroll-mobile .mdp-my-service-btn {
        min-height: 34px;
        margin-top: 8px;
        padding: 0 14px;
    }

    .mdp-my-orders-overlay {
        padding: 10px;
    }

    .mdp-device-transfer-overlay {
        padding: 10px;
    }

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

    .mdp-device-transfer-picker-tools {
        align-items: stretch;
        flex-direction: column;
    }

    .mdp-device-transfer-list {
        max-height: 240px;
    }

    .mdp-device-transfer-dialog {
        border-radius: 14px;
    }

    .mdp-my-orders-header {
        padding: 14px;
    }

    .mdp-my-orders-body {
        padding: 10px;
    }

    .mdp-my-order-card {
        padding: 12px;
    }

    .mdp-my-order-title {
        font-size: 14px;
    }

    .mdp-my-order-amount {
        font-size: 16px;
    }
}

@media (max-height: 720px) and (max-width: 600px) {
    .mdp-my-scroll-mobile {
        gap: 8px;
    }

    .mdp-my-scroll-mobile .mdp-my-page-title {
        font-size: 18px;
    }

    .mdp-my-scroll-mobile .mdp-my-profile-card {
        padding-top: 4px;
        padding-bottom: 2px;
    }

    .mdp-my-scroll-mobile .mdp-my-service-card {
        min-height: 88px;
    }

    .mdp-my-scroll-mobile .mdp-my-section-title {
        margin-bottom: 8px;
    }

    .mdp-my-scroll-mobile .mdp-my-function-grid {
        gap: 8px 5px;
    }
}

/* ====== Store Tab (购买页面) ====== */

.mdp-store-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    height: 200px;
    color: var(--mdp-text-dim);
    font-size: 13px;
}

.mdp-store-spinner {
    width: 28px;
    height: 28px;
    border: 3px solid var(--mdp-border);
    border-top-color: var(--mdp-accent);
    border-radius: 50%;
    animation: mdp-spin 0.7s linear infinite;
}

@keyframes mdp-spin {
    to { transform: rotate(360deg); }
}

.mdp-store-scroll {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
    padding: 14px;
    padding-bottom: calc(56px + env(safe-area-inset-bottom, 0px) + 20px);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.mdp-store-balance-card {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    border-radius: 14px;
    padding: 20px;
    color: #ffffff;
}

.mdp-store-balance-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.mdp-store-balance-main {
    flex: 1;
    min-width: 0;
}

.mdp-store-balance-label {
    font-size: 12px;
    opacity: 0.85;
    margin-bottom: 4px;
}

.mdp-store-balance-value {
    font-size: 32px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    margin-bottom: 8px;
}

.mdp-store-balance-info {
    font-size: 12px;
    opacity: 0.8;
}

.mdp-store-balance-info strong {
    color: #ffffff;
}

.mdp-store-balance-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.mdp-store-balance-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 18px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.24);
    background: rgba(255, 255, 255, 0.14);
    color: #ffffff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.mdp-store-balance-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.34);
}

.mdp-store-balance-btn.active {
    background: rgba(255, 255, 255, 0.28);
    border-color: rgba(255, 255, 255, 0.42);
}

.mdp-store-balance-btn:active {
    transform: scale(0.98);
}

.mdp-store-section {
    background: var(--mdp-surface);
    border-radius: 12px;
    border: 1px solid var(--mdp-border);
    padding: 16px;
}

.mdp-store-section-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--mdp-text);
    margin-bottom: 12px;
}

.mdp-store-pricing-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

/* 试用档启用时：价格网格改为 4 列，试用与 1/7/30 天水平并列 */
.mdp-store-pricing-grid.has-trial {
    grid-template-columns: repeat(4, 1fr);
}

/* 手机端：套餐改为横向滑动，避免折行显示两排 */
@media (max-width: 520px) {
    .mdp-store-pricing-grid,
    .mdp-store-pricing-grid.has-trial {
        display: flex;
        grid-template-columns: none;
        gap: 10px;
        overflow-x: auto;
        overflow-y: hidden;
        padding: 2px 2px 6px;
        margin: 0 -2px;
        scroll-snap-type: x proximity;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
        scrollbar-color: rgba(37, 99, 235, 0.35) transparent;
    }

    .mdp-store-pricing-grid::-webkit-scrollbar {
        height: 4px;
    }

    .mdp-store-pricing-grid::-webkit-scrollbar-track {
        background: transparent;
    }

    .mdp-store-pricing-grid::-webkit-scrollbar-thumb {
        background: rgba(37, 99, 235, 0.35);
        border-radius: 4px;
    }

    .mdp-store-pricing-grid > .mdp-store-price-card {
        flex: 0 0 auto;
        width: 112px;
        min-width: 112px;
        padding-top: 22px;
        scroll-snap-align: start;
    }

    .mdp-store-pricing-grid.mdp-store-standard-grid > .mdp-store-standard-card {
        width: 168px;
        min-width: 168px;
        padding-top: 16px;
    }

    /* 横向滚动下徽标需移到卡片内部，避免被 overflow-x 裁切 */
    .mdp-store-pricing-grid > .mdp-store-price-card > .mdp-store-price-badge {
        top: 6px;
    }
}

.mdp-store-price-card {
    position: relative;
    border: 2px solid var(--mdp-border);
    border-radius: 10px;
    padding: 14px 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--mdp-surface);
}

.mdp-store-price-card:active {
    transform: scale(0.97);
}

.mdp-store-price-card.selected,
.mdp-store-price-card:hover {
    border-color: #2563eb;
    background: rgba(37, 99, 235, 0.04);
}

.mdp-store-price-card.popular {
    border-color: rgba(37, 99, 235, 0.4);
}

.mdp-store-price-card.best {
    border-color: rgba(234, 88, 12, 0.4);
}

.mdp-store-standard-grid {
    grid-template-columns: repeat(auto-fit, minmax(142px, 1fr));
    gap: 10px;
}

.mdp-store-standard-card {
    min-height: 112px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 8px;
    text-align: left;
    border-color: rgba(37, 99, 235, 0.18);
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.08), rgba(255, 255, 255, 0.96));
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.04);
}

.mdp-store-standard-card:hover:not(.disabled) {
    border-color: #2563eb;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.12), rgba(255, 255, 255, 1));
    box-shadow: 0 12px 28px rgba(37, 99, 235, 0.12);
}

.mdp-store-standard-card.disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.mdp-store-standard-card-main {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.mdp-store-standard-card .mdp-store-price-duration {
    font-size: 14px;
    margin-bottom: 0;
}

.mdp-store-standard-card .mdp-store-price-amount {
    font-size: 20px;
}

.mdp-store-standard-card-cta {
    font-size: 12px;
    font-weight: 700;
    color: #2563eb;
}

.mdp-store-standard-card.disabled .mdp-store-standard-card-cta {
    color: var(--mdp-text-dim);
}

.mdp-store-package-remark {
    width: 100%;
    padding: 4px 6px;
    border-radius: 4px;
    background: rgba(251, 146, 60, 0.22);
    color: #c2410c;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.25;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    box-sizing: border-box;
}

@media (max-width: 520px) {
    .mdp-store-standard-section {
        padding: 12px;
    }

    .mdp-store-standard-section .mdp-store-section-title {
        margin-bottom: 10px;
    }

    .mdp-store-pricing-grid.mdp-store-standard-grid {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 6px;
        overflow: visible;
        padding: 0;
        margin: 0;
        scroll-snap-type: none;
        scrollbar-width: auto;
    }

    .mdp-store-pricing-grid.mdp-store-standard-grid > .mdp-store-standard-card {
        width: auto;
        min-width: 0;
        min-height: 88px;
        padding: 10px 8px;
        scroll-snap-align: unset;
    }

    .mdp-store-standard-card .mdp-store-price-duration {
        font-size: 12px;
    }

    .mdp-store-standard-card .mdp-store-price-amount {
        font-size: 16px;
    }

    .mdp-store-standard-card .mdp-store-price-unit {
        font-size: 10px;
    }

    .mdp-store-standard-card-cta {
        font-size: 11px;
    }

    .mdp-store-package-remark {
        padding: 3px 4px;
        font-size: 9px;
        line-height: 1.2;
    }
}

.mdp-store-price-badge {
    position: absolute;
    top: -9px;
    left: 50%;
    transform: translateX(-50%);
    background: #2563eb;
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 8px;
    white-space: nowrap;
}

.mdp-store-price-card.best .mdp-store-price-badge {
    background: #ea580c;
}

/* 试用卡片：与 1/7/30 天卡片水平并列 */
.mdp-store-price-card.trial {
    border-color: rgba(16, 185, 129, 0.45);
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.08) 0%, rgba(34, 197, 94, 0.04) 100%);
    cursor: default;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 6px;
}

.mdp-store-price-card.trial:hover,
.mdp-store-price-card.trial.selected {
    border-color: rgba(16, 185, 129, 0.45);
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.08) 0%, rgba(34, 197, 94, 0.04) 100%);
}

.mdp-store-price-card.trial:active {
    transform: none;
}

.mdp-store-price-card.trial .mdp-store-price-badge.trial-badge {
    background: #10b981;
}

.mdp-store-price-card.trial .mdp-store-price-amount.trial-amount {
    font-size: 15px;
    color: #059669;
}

.mdp-store-price-duration {
    font-size: 13px;
    font-weight: 600;
    color: var(--mdp-text);
    margin-bottom: 6px;
}

.mdp-store-price-amount {
    font-size: 18px;
    font-weight: 700;
    color: #2563eb;
}

.mdp-store-price-unit {
    font-size: 11px;
    color: var(--mdp-text-dim);
    margin-top: 2px;
}

.mdp-store-price-save {
    font-size: 10px;
    color: #16a34a;
    font-weight: 600;
    margin-top: 4px;
}

.mdp-store-hint {
    margin-top: 10px;
    font-size: 12px;
    color: var(--mdp-text-dim);
    text-align: center;
}

.mdp-store-buy-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.mdp-store-day-btns {
    display: flex;
    gap: 8px;
}

.mdp-store-day-btn {
    flex: 1;
    padding: 9px 6px;
    border: 1px solid var(--mdp-border);
    border-radius: 8px;
    background: var(--mdp-surface);
    color: var(--mdp-text);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    text-align: center;
}

.mdp-store-day-btn.active {
    border-color: #2563eb;
    background: rgba(37, 99, 235, 0.08);
    color: #2563eb;
    font-weight: 600;
}

.mdp-store-custom-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--mdp-text-dim);
}

.mdp-store-input {
    width: 72px;
    text-align: center;
    padding: 8px 10px;
    background: var(--mdp-surface);
    color: var(--mdp-text);
    border: 1px solid var(--mdp-border);
    border-radius: 8px;
    font-size: 14px;
    box-sizing: border-box;
}

.mdp-store-input.wide {
    flex: 1;
    width: auto;
    text-align: left;
}

.mdp-store-summary {
    padding: 12px 14px;
    background: rgba(37, 99, 235, 0.05);
    border: 1px solid rgba(37, 99, 235, 0.12);
    border-radius: 8px;
    font-size: 14px;
    color: var(--mdp-text-dim);
}

.mdp-store-buy-btn {
    width: 100%;
    padding: 13px;
    border: none;
    border-radius: 10px;
    background: #2563eb;
    color: #ffffff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.15s;
}

.mdp-store-buy-btn:active {
    opacity: 0.85;
}

.mdp-store-buy-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 试用卡片内紧凑按钮（适配窄列） */
.mdp-store-trial-btn {
    width: 100%;
    padding: 7px 8px;
    border: none;
    border-radius: 6px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #ffffff;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 4px;
    box-shadow: 0 1px 3px rgba(16, 185, 129, 0.25);
    transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mdp-store-trial-btn:active {
    transform: scale(0.97);
}

.mdp-store-trial-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    box-shadow: none;
    background: #9ca3af;
}

.mdp-store-bind-form {
    display: flex;
    gap: 10px;
    align-items: center;
}

.mdp-store-bind-btn {
    padding: 9px 18px;
    border: none;
    border-radius: 8px;
    background: #2563eb;
    color: #ffffff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
}

.mdp-store-bind-btn:disabled {
    opacity: 0.5;
}

/* 支付方式切换（微信 / 支付宝）；仅当两种支付都启用时渲染 */
.mdp-store-pay-method-selector {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin: 8px 0 12px;
}

.mdp-store-pay-method-btn {
    padding: 10px 14px;
    border: 1px solid var(--mdp-border);
    border-radius: 10px;
    background: var(--mdp-surface);
    color: var(--mdp-text);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.mdp-store-pay-method-btn:hover {
    border-color: var(--mdp-pay-brand, #2563eb);
    color: var(--mdp-pay-brand, #2563eb);
}

.mdp-store-pay-method-btn.active {
    border-color: var(--mdp-pay-brand, #2563eb);
    background: color-mix(in srgb, var(--mdp-pay-brand, #2563eb) 12%, transparent);
    color: var(--mdp-pay-brand, #2563eb);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--mdp-pay-brand, #2563eb) 14%, transparent);
}

.mdp-store-pay-quick-amounts {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.mdp-store-pay-quick-btn {
    padding: 6px 12px;
    border: 1px solid var(--mdp-border);
    border-radius: 999px;
    background: var(--mdp-surface);
    color: var(--mdp-text);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.mdp-store-package-pay-methods {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.mdp-store-package-pay-method {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 10px 12px;
    border: 1px solid var(--mdp-border);
    border-radius: 10px;
    background: var(--mdp-bg);
    color: var(--mdp-text);
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, opacity 0.15s;
}

.mdp-store-package-pay-method span {
    font-size: 13px;
    font-weight: 700;
}

.mdp-store-package-pay-method small {
    font-size: 11px;
    line-height: 1.4;
    color: var(--mdp-text-dim);
}

.mdp-store-package-pay-method.active {
    border-color: #2563eb;
    background: rgba(37, 99, 235, 0.08);
}

.mdp-store-package-pay-method:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.mdp-store-pay-status {
    margin-top: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 12px;
    line-height: 1.5;
    border: 1px solid rgba(37, 99, 235, 0.14);
    background: rgba(37, 99, 235, 0.06);
    color: #1d4ed8;
}

.mdp-store-pay-status[data-state="success"] {
    border-color: rgba(22, 163, 74, 0.18);
    background: rgba(22, 163, 74, 0.08);
    color: #15803d;
}

.mdp-store-pay-status[data-state="warn"] {
    border-color: rgba(234, 88, 12, 0.2);
    background: rgba(234, 88, 12, 0.08);
    color: #c2410c;
}

.mdp-store-pay-status[data-state="error"] {
    border-color: rgba(220, 38, 38, 0.2);
    background: rgba(220, 38, 38, 0.08);
    color: #dc2626;
}

.mdp-store-pending-orders {
    margin: 12px 0 4px;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid rgba(234, 179, 8, 0.32);
    background: rgba(254, 252, 232, 0.85);
}

.mdp-store-my-orders-panel {
    border-color: rgba(37, 99, 235, 0.16);
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.07), rgba(255, 255, 255, 0.92));
}

.mdp-store-pending-title {
    font-size: 13px;
    font-weight: 700;
    color: #92400e;
    margin-bottom: 4px;
}

.mdp-store-pending-hint {
    font-size: 12px;
    line-height: 1.5;
    color: #78350f;
    margin-bottom: 10px;
}

.mdp-store-pending-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mdp-store-pending-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    background: #ffffff;
    border: 1px solid rgba(234, 179, 8, 0.18);
}

.mdp-store-pending-info {
    display: flex;
    align-items: baseline;
    gap: 12px;
    min-width: 0;
    flex: 1;
    flex-wrap: wrap;
}

.mdp-store-pending-info .amt {
    font-size: 15px;
    font-weight: 700;
    color: var(--mdp-text);
}

.mdp-store-pending-info .method {
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.06);
    color: var(--mdp-text);
}

.mdp-store-pending-info .time {
    font-size: 11px;
    color: var(--mdp-text-dim);
}

.mdp-store-pending-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.mdp-store-pending-btn {
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 6px;
    border: 1px solid var(--mdp-border);
    background: #ffffff;
    color: var(--mdp-text);
    cursor: pointer;
    transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.mdp-store-pending-btn:hover:not(:disabled) {
    background: rgba(15, 23, 42, 0.04);
}

.mdp-store-pending-btn.primary {
    background: #2563eb;
    border-color: #2563eb;
    color: #ffffff;
}

.mdp-store-pending-btn.primary:hover:not(:disabled) {
    background: #1d4ed8;
    border-color: #1d4ed8;
}

.mdp-store-pending-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.mdp-store-pending-modal {
    background: var(--mdp-surface);
    color: var(--mdp-text);
    border-radius: 16px;
    padding: 20px;
    width: 460px;
    max-width: 95%;
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    border: 1px solid var(--mdp-border);
}

.mdp-store-pending-modal-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--mdp-text);
}

.mdp-store-pending-modal-desc {
    font-size: 13px;
    line-height: 1.6;
    color: var(--mdp-text-dim);
}

.mdp-store-pending-modal-info {
    display: grid;
    gap: 8px;
    padding: 12px;
    border-radius: 10px;
    background: var(--mdp-bg);
    border: 1px solid var(--mdp-border);
}

.mdp-store-pending-modal-info div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: 13px;
}

.mdp-store-pending-modal-info span {
    color: var(--mdp-text-dim);
    flex-shrink: 0;
}

.mdp-store-pending-modal-info strong {
    text-align: right;
    word-break: break-all;
}

.mdp-store-pending-modal-qr {
    display: flex;
    justify-content: center;
}

.mdp-store-pending-modal-qr:empty {
    display: none;
}

.mdp-store-pending-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

@media (max-width: 720px) {
    .mdp-store-pending-row {
        flex-direction: column;
        align-items: stretch;
    }
    .mdp-store-pending-actions {
        justify-content: flex-end;
    }

    .mdp-store-pending-modal {
        width: 100%;
        max-width: none;
    }

    .mdp-store-pending-modal-actions {
        flex-direction: row;
    }

    .mdp-store-pending-modal-actions .mdp-store-pending-btn {
        flex: 1;
    }

    .mdp-store-package-pay-methods {
        grid-template-columns: 1fr;
    }
}

.mdp-store-pay-qr {
    display: none;
    margin-top: 14px;
    padding: 14px;
    border-radius: 12px;
    border: 1px dashed var(--mdp-border);
    background: var(--mdp-bg);
    align-items: center;
    gap: 16px;
}

.mdp-store-pay-qr.active {
    display: flex;
}

.mdp-store-pay-canvas {
    width: 220px;
    height: 220px;
    border-radius: 10px;
    background: #ffffff;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
    flex-shrink: 0;
}

.mdp-store-pay-meta {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.mdp-store-pay-meta-line {
    font-size: 13px;
    font-weight: 600;
    color: var(--mdp-text);
    word-break: break-all;
}

.mdp-store-pay-tip {
    font-size: 12px;
    line-height: 1.6;
    color: var(--mdp-text-dim);
}

@media (max-width: 720px) {
    .mdp-store-pay-qr.active {
        flex-direction: column;
        align-items: stretch;
    }

    .mdp-store-pay-canvas {
        margin: 0 auto;
    }

    .mdp-store-balance-top {
        flex-direction: row;
        align-items: center;
        gap: 12px;
    }

    .mdp-store-balance-btn {
        width: auto;
        flex-shrink: 0;
        padding: 8px 14px;
    }
}

.mdp-store-device-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mdp-store-device-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: var(--mdp-bg);
    border: 1px solid var(--mdp-border);
    border-radius: 8px;
}

.mdp-store-device-info {
    flex: 1;
    min-width: 0;
}

.mdp-store-device-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--mdp-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mdp-store-device-expiry {
    font-size: 11px;
    color: var(--mdp-text-dim);
    margin-top: 2px;
    line-height: 1.45;
    word-break: break-word;
}

.mdp-store-device-expiry.expired {
    color: #dc2626;
    font-weight: 600;
}

.mdp-store-device-expiry.expiring {
    color: #ea580c;
    font-weight: 600;
}

.mdp-store-renew-btn {
    padding: 6px 14px;
    border: 1px solid #2563eb;
    border-radius: 6px;
    background: transparent;
    color: #2563eb;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    flex-shrink: 0;
    margin-left: 10px;
}

.mdp-store-renew-btn:active {
    background: rgba(37, 99, 235, 0.08);
}

/* Renew overlay dialog */
.mdp-store-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
    backdrop-filter: blur(4px);
}

/* ===== 商店 购买/续费 切换栏 ===== */
.mdp-store-mode-tabs {
    display: flex;
    gap: 0;
    width: 100%;
    min-height: 44px;
    background: rgba(37, 99, 235, 0.06);
    border: 1px solid rgba(37, 99, 235, 0.16);
    border-radius: 10px;
    overflow: hidden;
    box-sizing: border-box;
    flex-shrink: 0;
}
.mdp-store-mode-tab {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    min-height: 42px;
    padding: 10px 0;
    font-size: 14px;
    font-weight: 500;
    border: none;
    background: transparent;
    color: #2563eb;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    text-align: center;
    line-height: 1.2;
    appearance: none;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}
.mdp-store-mode-tab.active {
    background: rgba(37, 99, 235, 0.16);
    color: #1d4ed8;
    font-weight: 600;
    box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.14);
}

/* ===== 续费面板 ===== */
.mdp-store-panel-purchase,
.mdp-store-panel-renewal {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.mdp-store-panel-purchase[hidden],
.mdp-store-panel-renewal[hidden] {
    display: none !important;
}

/* 续费 全选按钮 */
.mdp-store-renew-select-all-btn {
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 500;
    border: 1px solid var(--mdp-border);
    border-radius: 6px;
    background: var(--mdp-surface);
    color: var(--mdp-primary, #2563eb);
    cursor: pointer;
    transition: background 0.15s;
}
.mdp-store-renew-select-all-btn:hover {
    background: rgba(37, 99, 235, 0.06);
}

/* 续费 搜索栏 */
.mdp-store-renew-search {
    margin-top: 8px;
    margin-bottom: 4px;
}

/* 续费 设备多选列表 */
.mdp-store-renew-device-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 320px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
.mdp-store-renew-device-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid var(--mdp-border);
    background: var(--mdp-surface);
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}
.mdp-store-renew-device-row:hover {
    background: rgba(37, 99, 235, 0.03);
}
.mdp-store-renew-device-row.selected {
    border-color: var(--mdp-primary, #2563eb);
    background: rgba(37, 99, 235, 0.06);
}
.mdp-store-renew-checkbox {
    width: 18px;
    height: 18px;
    accent-color: var(--mdp-primary, #2563eb);
    flex-shrink: 0;
    cursor: pointer;
}

/* 续费 摘要区 */
.mdp-store-renew-summary-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 14px;
    border-radius: 10px;
    background: rgba(37, 99, 235, 0.04);
    border: 1px solid rgba(37, 99, 235, 0.12);
}
.mdp-store-renew-summary-text {
    font-size: 14px;
    line-height: 1.6;
    color: var(--mdp-text);
}
.mdp-store-batch-renew-btn {
    width: 100%;
}

/* 移动端小屏适配 */
@media (max-width: 480px) {
    .mdp-store-renew-device-list {
        max-height: 240px;
    }
}

.mdp-store-renew-dialog {
    background: var(--mdp-surface);
    color: var(--mdp-text);
    border-radius: 14px;
    padding: 20px;
    width: 400px;
    max-width: 95%;
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    border: 1px solid var(--mdp-border);
}

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

.mdp-store-renew-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.mdp-store-renew-header button {
    background: none;
    border: none;
    color: var(--mdp-text-dim);
    font-size: 22px;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}

.mdp-store-renew-device {
    font-size: 13px;
    padding: 10px 12px;
    background: rgba(37, 99, 235, 0.05);
    border: 1px solid rgba(37, 99, 235, 0.12);
    border-radius: 8px;
    font-weight: 500;
}

.mdp-store-renew-balance {
    font-size: 14px;
    color: #b45309;
    padding: 10px 12px;
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.2);
    border-radius: 8px;
}

.mdp-store-recharge-dialog {
    background: var(--mdp-surface);
    color: var(--mdp-text);
    border-radius: 16px;
    padding: 20px;
    width: 520px;
    max-width: 95%;
    max-height: min(90vh, 760px);
    display: flex;
    flex-direction: column;
    gap: 14px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.18);
    border: 1px solid var(--mdp-border);
    overflow: hidden;
}

.mdp-store-recharge-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.mdp-store-recharge-title {
    min-width: 0;
}

.mdp-store-recharge-title h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.mdp-store-recharge-title p {
    margin: 6px 0 0;
    font-size: 13px;
    line-height: 1.6;
    color: var(--mdp-text-dim);
}

.mdp-store-recharge-close {
    background: none;
    border: none;
    color: var(--mdp-text-dim);
    font-size: 22px;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
    flex-shrink: 0;
}

.mdp-store-recharge-balance {
    font-size: 14px;
    color: #b45309;
    padding: 10px 12px;
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.2);
    border-radius: 10px;
}

.mdp-store-recharge-balance strong {
    color: #92400e;
}

.mdp-store-recharge-methods {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.mdp-store-recharge-method {
    padding: 10px 14px;
    border: 1px solid var(--mdp-border);
    border-radius: 10px;
    background: var(--mdp-bg);
    color: var(--mdp-text);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.mdp-store-recharge-method.active {
    border-color: #2563eb;
    background: rgba(37, 99, 235, 0.08);
    color: #2563eb;
}

.mdp-store-recharge-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 0;
    overflow-y: auto;
}

.mdp-store-recharge-panel {
    display: none;
}

.mdp-store-recharge-panel.active {
    display: block;
}

@media (max-width: 720px) {
    .mdp-store-recharge-dialog {
        width: 100%;
        max-width: none;
        max-height: calc(100vh - 24px);
        padding: 16px;
        gap: 12px;
    }

    .mdp-store-recharge-methods {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .mdp-store-recharge-content .mdp-store-bind-form {
        flex-wrap: wrap;
    }

    .mdp-store-recharge-content .mdp-store-bind-btn {
        width: 100%;
    }
}

/* Settings tab mobile layout */
.mdp-settings-scroll {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
    padding: 12px;
    padding-bottom: calc(56px + env(safe-area-inset-bottom, 0px) + 16px);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.mdp-settings-section {
    background: var(--mdp-surface);
    border: 1px solid var(--mdp-border);
    border-radius: 10px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mdp-settings-section-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--mdp-text);
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 2px;
}

.mdp-settings-section-title svg {
    width: 16px;
    height: 16px;
    color: var(--mdp-accent);
    flex-shrink: 0;
}

.mdp-settings-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 36px;
}

.mdp-settings-label {
    font-size: 13px;
    color: var(--mdp-text-secondary);
    flex-shrink: 0;
}

.mdp-settings-row .mdp-select {
    flex: 1;
    max-width: 180px;
    padding: 6px 10px;
    font-size: 13px;
}

.mdp-settings-visual-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 4px 0;
}

.mdp-settings-visual-header {
    appearance: none;
    width: 100%;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border: 1px solid var(--mdp-border);
    border-radius: 10px;
    background: var(--mdp-surface);
    color: var(--mdp-text);
    padding: 8px 10px;
    cursor: pointer;
    font-family: inherit;
    text-align: left;
    transition: border-color 0.15s ease, background 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}

.mdp-settings-visual-header:hover {
    border-color: var(--mdp-accent);
}

.mdp-settings-visual-row.expanded .mdp-settings-visual-header {
    border-color: var(--mdp-accent);
    background: color-mix(in srgb, var(--mdp-accent) 6%, var(--mdp-surface));
}

.mdp-settings-visual-main {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.mdp-settings-visual-label {
    font-size: 13px;
    font-weight: 700;
    color: var(--mdp-text);
    flex-shrink: 0;
}

.mdp-settings-visual-summary {
    min-width: 0;
    font-size: 12px;
    color: var(--mdp-accent);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mdp-settings-visual-chevron {
    position: relative;
    width: 8px;
    height: 8px;
    flex-shrink: 0;
    border-right: 2px solid var(--mdp-text-secondary);
    border-bottom: 2px solid var(--mdp-text-secondary);
    transform: rotate(45deg);
    transition: transform 0.15s ease;
}

.mdp-settings-visual-row.expanded .mdp-settings-visual-chevron {
    transform: rotate(225deg);
}

.mdp-settings-option-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(156px, 1fr));
    gap: 10px;
}

.mdp-settings-option-grid[hidden] {
    display: none;
}

.mdp-settings-option-card {
    appearance: none;
    border: 1px solid var(--mdp-border);
    border-radius: 12px;
    background: var(--mdp-surface);
    color: var(--mdp-text);
    padding: 0;
    overflow: hidden;
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease, background 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}

.mdp-settings-option-card:hover {
    border-color: var(--mdp-accent);
    transform: translateY(-1px);
}

.mdp-settings-option-card.active,
.mdp-settings-option-card[aria-pressed="true"] {
    border-color: var(--mdp-accent);
    background: color-mix(in srgb, var(--mdp-accent) 8%, var(--mdp-surface));
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--mdp-accent) 18%, transparent);
}

.mdp-settings-option-preview {
    position: relative;
    height: 88px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0f172a, #1e293b);
    overflow: hidden;
}

.mdp-settings-option-body {
    padding: 10px 11px 11px;
}

.mdp-settings-option-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--mdp-text);
    margin-bottom: 4px;
}

.mdp-settings-option-desc {
    font-size: 11px;
    line-height: 1.55;
    color: var(--mdp-text-secondary);
}

.mdp-preview-phone {
    position: relative;
    width: 126px;
    height: 70px;
    border-radius: 13px;
    background: #020617;
    border: 2px solid rgba(255,255,255,0.16);
    box-shadow: 0 12px 26px rgba(0,0,0,0.24);
}

.mdp-preview-screen {
    position: absolute;
    inset: 7px;
    border-radius: 8px;
    background: linear-gradient(135deg, #2563eb, #38bdf8);
}

.mdp-preview-sidebar {
    position: absolute;
    top: 8px;
    right: 8px;
    bottom: 8px;
    width: 20px;
    border-radius: 8px;
    background: rgba(15,23,42,0.88);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.mdp-preview-sidebar span {
    width: 10px;
    height: 4px;
    border-radius: 999px;
    background: rgba(255,255,255,0.78);
}

.mdp-preview-floating-dot {
    position: absolute;
    right: 14px;
    top: 13px;
    width: 18px;
    height: 18px;
    border-radius: 999px;
    background: rgba(255,255,255,0.92);
    box-shadow: 0 4px 10px rgba(15,23,42,0.22);
}

.mdp-preview-floating-panel {
    position: absolute;
    right: 13px;
    bottom: 11px;
    width: 48px;
    height: 22px;
    border-radius: 10px;
    background: rgba(15,23,42,0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.mdp-preview-floating-panel span {
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: #fff;
}

.mdp-preview-grid-bg {
    position: relative;
    width: 132px;
    height: 76px;
}

.mdp-preview-grid-bg > span {
    position: absolute;
    border-radius: 8px;
    background: rgba(148,163,184,0.28);
    border: 1px solid rgba(255,255,255,0.12);
}

.mdp-preview-grid-bg > span:nth-child(1) {
    left: 0;
    top: 8px;
    width: 54px;
    height: 31px;
}

.mdp-preview-grid-bg > span:nth-child(2) {
    right: 0;
    top: 6px;
    width: 54px;
    height: 35px;
}

.mdp-preview-grid-bg > span:nth-child(3) {
    left: 18px;
    bottom: 4px;
    width: 64px;
    height: 32px;
}

.mdp-preview-focus-window {
    position: absolute;
    right: 18px;
    bottom: 9px;
    width: 70px;
    height: 45px;
    border-radius: 12px;
    background: linear-gradient(135deg, #2563eb, #06b6d4);
    border: 2px solid rgba(255,255,255,0.34);
    box-shadow: 0 10px 22px rgba(37,99,235,0.38);
}

.mdp-preview-classic-focus {
    position: relative;
    width: 116px;
    height: 76px;
}

.mdp-preview-focus-main {
    position: absolute;
    inset: 0 17px;
    border-radius: 12px;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    border: 2px solid rgba(255,255,255,0.22);
}

.mdp-preview-focus-toolbar {
    position: absolute;
    left: 26px;
    right: 26px;
    bottom: 8px;
    height: 13px;
    border-radius: 999px;
    background: rgba(15,23,42,0.82);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.mdp-preview-focus-toolbar span {
    width: 5px;
    height: 5px;
    border-radius: 999px;
    background: rgba(255,255,255,0.86);
}

.mdp-preview-click-flow {
    width: 136px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.mdp-preview-mini-card,
.mdp-preview-focus-card,
.mdp-preview-fullscreen-card {
    border-radius: 10px;
    background: linear-gradient(135deg, #2563eb, #38bdf8);
    border: 2px solid rgba(255,255,255,0.22);
    box-shadow: 0 8px 18px rgba(37,99,235,0.25);
}

.mdp-preview-mini-card {
    width: 34px;
    height: 48px;
}

.mdp-preview-focus-card {
    width: 58px;
    height: 58px;
}

.mdp-preview-fullscreen-card {
    width: 70px;
    height: 70px;
    border-radius: 14px;
}

.mdp-preview-arrow {
    position: relative;
    width: 18px;
    height: 2px;
    border-radius: 999px;
    background: rgba(255,255,255,0.78);
}

.mdp-preview-arrow::after {
    content: '';
    position: absolute;
    right: -1px;
    top: -4px;
    width: 0;
    height: 0;
    border-top: 5px solid transparent;
    border-bottom: 5px solid transparent;
    border-left: 6px solid rgba(255,255,255,0.78);
}

.mdp-preview-rotate-flow {
    position: relative;
    width: 136px;
    height: 76px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mdp-preview-rotate-phone {
    position: relative;
    width: 48px;
    height: 68px;
    border-radius: 14px;
    background: #020617;
    border: 2px solid rgba(255,255,255,0.2);
    box-shadow: 0 10px 22px rgba(0,0,0,0.25);
}

.mdp-preview-rotate-screen {
    position: absolute;
    inset: 7px;
    border-radius: 9px;
    background: linear-gradient(135deg, #2563eb, #38bdf8);
    transition: transform 0.15s ease;
}

.mdp-preview-rotate-screen.rotated {
    left: -4px;
    right: -4px;
    top: 15px;
    bottom: 15px;
    transform: rotate(90deg);
    box-shadow: 0 8px 18px rgba(37,99,235,0.28);
}

.mdp-preview-rotate-badge {
    position: absolute;
    right: 22px;
    top: 10px;
    min-width: 30px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: rgba(34,197,94,0.95);
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    box-shadow: 0 8px 16px rgba(34,197,94,0.28);
}

.mdp-preview-rotate-off-mark {
    position: absolute;
    left: 9px;
    right: 9px;
    top: 50%;
    height: 3px;
    border-radius: 999px;
    background: rgba(248,113,113,0.95);
    transform: rotate(-35deg);
    box-shadow: 0 0 0 1px rgba(255,255,255,0.18);
}

.mdp-settings-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 14px;
    border: 1px solid var(--mdp-border);
    border-radius: 8px;
    background: var(--mdp-surface);
    color: var(--mdp-text);
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.15s;
    -webkit-tap-highlight-color: transparent;
}

.mdp-settings-action-btn:active {
    transform: scale(0.97);
}

.mdp-settings-action-btn svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.mdp-settings-action-btn.primary {
    background: var(--mdp-accent);
    border-color: var(--mdp-accent);
    color: #fff;
}

.mdp-settings-action-btn.full-width {
    grid-column: 1 / -1;
}

/* Launcher tab embedded container */
.mdp-launcher-embed {
    flex: 1;
    min-height: 0;
    padding-bottom: calc(56px + env(safe-area-inset-bottom, 0px));
}

/* ====== Mobile bottom nav responsive ====== */
@media (max-width: 768px) {
    .multi-device-page.has-bottom-nav .mdp-bottom-nav {
        display: flex;
        align-items: center;
        justify-content: space-around;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: 56px;
        background: var(--mdp-surface);
        border-top: 1px solid var(--mdp-border);
        z-index: 200;
        box-shadow: 0 -2px 8px rgba(0,0,0,0.06);
        padding-bottom: env(safe-area-inset-bottom, 0px);
    }

    .multi-device-page.has-bottom-nav .mdp-content {
        padding-bottom: calc(56px + env(safe-area-inset-bottom, 0px) + 4px);
    }

    /* Hide toolbar toggle and panel on mobile when bottom nav is present */
    .multi-device-page.has-bottom-nav .mdp-toolbar-toggle,
    .multi-device-page.has-bottom-nav .mdp-theme-toggle,
    .multi-device-page.has-bottom-nav .mdp-header-logout {
        display: none !important;
    }

    .multi-device-page.has-bottom-nav .mdp-toolbar-panel {
        display: none !important;
    }

    .multi-device-page.has-bottom-nav #udp-vm-control-placeholder {
        display: none !important;
    }

    /* Mobile: hide user badge and stats in header to save space */
    .multi-device-page.has-bottom-nav .mdp-stat-badge,
    .multi-device-page.has-bottom-nav .mdp-header-stats {
        display: none !important;
    }

    /* Mobile: move batch toggle button to the right side */
    .multi-device-page.has-bottom-nav .mdp-batch-toggle-btn {
        margin-left: auto;
    }

    /* Mobile: batch actions as a horizontally scrollable bar below header */
    .multi-device-page.has-bottom-nav .mdp-batch-actions {
        position: fixed;
        top: var(--mdp-header-height);
        left: 0;
        right: 0;
        background: var(--mdp-surface);
        border-bottom: 1px solid var(--mdp-border);
        padding: 8px 12px;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        z-index: 99;
        box-shadow: 0 2px 6px rgba(0,0,0,0.06);
        gap: 8px;
        white-space: nowrap;
        flex-wrap: nowrap !important;
    }

    /* Hide scrollbar visually but keep it functional */
    .multi-device-page.has-bottom-nav .mdp-batch-actions::-webkit-scrollbar {
        height: 3px;
    }

    .multi-device-page.has-bottom-nav .mdp-batch-actions::-webkit-scrollbar-thumb {
        background: var(--mdp-border);
        border-radius: 2px;
    }

    .multi-device-page.has-bottom-nav .mdp-batch-actions .mdp-btn {
        flex-shrink: 0;
    }

    /* ===== Auxiliary bars stacking (batch + group-actions + chips) ===== */
    /* 用 CSS 变量记录每个 bar 是否可见及其高度，避免多 class 组合展开 */
    .multi-device-page.has-bottom-nav {
        --aux-bar-batch: 0px;
        --aux-bar-group-actions: 0px;
        --aux-bar-group-chips: 0px;
    }

    .multi-device-page.has-bottom-nav.mdp-batch-expanded {
        --aux-bar-batch: 42px;
    }

    .multi-device-page.has-bottom-nav.mdp-group-expanded {
        --aux-bar-group-actions: 42px;
    }

    .multi-device-page.has-bottom-nav.mdp-has-group-chips {
        --aux-bar-group-chips: 32px;
    }

    /* Shift content down when any auxiliary bar is visible */
    .multi-device-page.has-bottom-nav .mdp-content {
        margin-top: calc(var(--aux-bar-batch, 0px) + var(--aux-bar-group-actions, 0px) + var(--aux-bar-group-chips, 0px));
        transition: margin-top 0.15s;
    }

    /* Group actions row: fixed below header + any batch bar */
    .multi-device-page.has-bottom-nav .mdp-group-actions {
        position: fixed;
        left: 0;
        right: 0;
        top: calc(var(--mdp-header-height) + var(--aux-bar-batch, 0px));
        z-index: 98;
        padding: 6px 8px;
        gap: 6px;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        white-space: nowrap;
        flex-wrap: nowrap !important;
        box-shadow: 0 2px 6px rgba(0,0,0,0.06);
    }

    .multi-device-page.has-bottom-nav .mdp-group-actions::-webkit-scrollbar {
        height: 3px;
    }

    .multi-device-page.has-bottom-nav .mdp-group-actions::-webkit-scrollbar-thumb {
        background: var(--mdp-border);
        border-radius: 2px;
    }

    /* Group chips bar: fixed below group actions (or header if no actions) */
    .multi-device-page.has-bottom-nav .mdp-group-chips {
        position: fixed;
        left: 0;
        right: 0;
        top: calc(var(--mdp-header-height) + var(--aux-bar-batch, 0px) + var(--aux-bar-group-actions, 0px));
        z-index: 97;
        padding: 6px 8px;
        box-shadow: 0 2px 6px rgba(0,0,0,0.04);
    }

    /* Hide bottom nav during focus mode and fullscreen */
    .multi-device-page.has-bottom-nav.mdp-hide-bottom-nav .mdp-bottom-nav {
        display: none !important;
    }

    .multi-device-page.has-bottom-nav.mdp-hide-bottom-nav .mdp-content {
        padding-bottom: 4px;
    }

    /* Focus mode adjustments with bottom nav */
    .multi-device-page.has-bottom-nav .mdp-card.focus-mode-active {
        max-height: calc(100vh - 120px);
    }

    .multi-device-page.has-bottom-nav .mdp-card.focus-mode-active .mdp-card-video {
        max-height: calc(100vh - 180px);
    }

    /* Batch bar should be above bottom nav */
    .multi-device-page.has-bottom-nav .mdp-batch-bar {
        bottom: calc(56px + env(safe-area-inset-bottom, 0px) + 12px);
    }
}

@supports (padding: max(0px)) {
    @media (max-width: 768px) {
        .multi-device-page.has-bottom-nav .mdp-bottom-nav {
            padding-bottom: max(0px, env(safe-area-inset-bottom));
        }

        .multi-device-page.has-bottom-nav .mdp-content {
            padding-bottom: max(60px, calc(56px + env(safe-area-inset-bottom) + 4px));
        }
    }
}


/**
 * Copyright (c) 2014 The xterm.js authors. All rights reserved.
 * Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
 * https://github.com/chjj/term.js
 * @license MIT
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 *
 * Originally forked from (with the author's permission):
 *   Fabrice Bellard's javascript vt100 for jslinux:
 *   http://bellard.org/jslinux/
 *   Copyright (c) 2011 Fabrice Bellard
 *   The original design remains. The terminal itself
 *   has been extended to include xterm CSI codes, among
 *   other features.
 */

/**
 *  Default styles for xterm.js
 */

.xterm {
    cursor: text;
    position: relative;
    user-select: none;
    -ms-user-select: none;
    -webkit-user-select: none;
}

.xterm.focus,
.xterm:focus {
    outline: none;
}

.xterm .xterm-helpers {
    position: absolute;
    top: 0;
    /**
     * The z-index of the helpers must be higher than the canvases in order for
     * IMEs to appear on top.
     */
    z-index: 5;
}

.xterm .xterm-helper-textarea {
    padding: 0;
    border: 0;
    margin: 0;
    /* Move textarea out of the screen to the far left, so that the cursor is not visible */
    position: absolute;
    opacity: 0;
    left: -9999em;
    top: 0;
    width: 0;
    height: 0;
    z-index: -5;
    /** Prevent wrapping so the IME appears against the textarea at the correct position */
    white-space: nowrap;
    overflow: hidden;
    resize: none;
}

.xterm .composition-view {
    /* TODO: Composition position got messed up somewhere */
    background: #000;
    color: #FFF;
    display: none;
    position: absolute;
    white-space: nowrap;
    z-index: 1;
}

.xterm .composition-view.active {
    display: block;
}

.xterm .xterm-viewport {
    /* On OS X this is required in order for the scroll bar to appear fully opaque */
    background-color: #000;
    overflow-y: scroll;
    cursor: default;
    position: absolute;
    right: 0;
    left: 0;
    top: 0;
    bottom: 0;
}

.xterm .xterm-screen {
    position: relative;
}

.xterm .xterm-screen canvas {
    position: absolute;
    left: 0;
    top: 0;
}

.xterm .xterm-scroll-area {
    visibility: hidden;
}

.xterm-char-measure-element {
    display: inline-block;
    visibility: hidden;
    position: absolute;
    top: 0;
    left: -9999em;
    line-height: normal;
}

.xterm.enable-mouse-events {
    /* When mouse events are enabled (eg. tmux), revert to the standard pointer cursor */
    cursor: default;
}

.xterm.xterm-cursor-pointer,
.xterm .xterm-cursor-pointer {
    cursor: pointer;
}

.xterm.column-select.focus {
    /* Column selection mode */
    cursor: crosshair;
}

.xterm .xterm-accessibility,
.xterm .xterm-message {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    right: 0;
    z-index: 10;
    color: transparent;
}

.xterm .live-region {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.xterm-dim {
    opacity: 0.5;
}

.xterm-underline {
    text-decoration: underline;
}

.xterm-strikethrough {
    text-decoration: line-through;
}

.xterm-screen .xterm-decoration-container .xterm-decoration {
	z-index: 6;
	position: absolute;
}

.xterm-decoration-overview-ruler {
    z-index: 7;
    position: absolute;
    top: 0;
    right: 0;
    pointer-events: none;
}

.xterm-decoration-top {
    z-index: 2;
    position: relative;
}


body.devtools {
    font-family: Ubuntu, Arial, sans-serif;
    font-size: 13px;
}

body.devtools .device {
    padding: 20px;
}

body.devtools .device-header {
    -webkit-box-align: baseline;
    -webkit-box-orient: horizontal;
    display: -webkit-box;
    margin: 10px 0 0;
    padding: 2px 0;
}

body.devtools .device-name {
    font-size: 150%;
}

body.devtools .device-serial {
    color: var(--url-color);
    font-size: 80%;
    margin-left: 6px;
}

body.devtools .browser-header {
    align-items: center;
    display: flex;
    flex-flow: row wrap;
    min-height: 33px;
    padding-top: 10px;
}

body.devtools .browser-header > .browser-name {
    font-size: 110%;
    font-weight: bold;
}

body.devtools div.list {
    margin-top: 5px;
}

body.devtools div.list > .row {
    padding: 6px 0;
    position: relative;
}

body.devtools .properties-box {
    display: flex;
}

body.devtools .properties-box > img {
    flex-shrink: 0;
    height: 23px;
    padding-left: 2px;
    padding-right: 5px;
    vertical-align: top;
    width: 23px;
}

body.devtools .subrow-box {
    display: inline-block;
    vertical-align: top;
}

body.devtools .subrow {
    display: flex;
    flex-flow: row wrap;
}

body.devtools .subrow > div {
    margin-right: 0.5em;
}

.body.devtools url {
    color: var(--url-color);
    max-width: 200px;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
}

body.devtools .action {
    color: var(--link-color);
    cursor: pointer;
    margin-right: 15px;
}

body.devtools .action.disabled {
    color: var(--url-color);
    cursor: not-allowed;
}

body.devtools a.action {
    text-decoration: none;
}

body.devtools a.action.copy {
    cursor: copy;
}

body.devtools .browser-header .action {
    margin-left: 10px;
}

body.devtools .open > input {
    border: 1px solid #aaa;
    height: 17px;
    line-height: 17px;
    margin-left: 20px;
    padding: 0 2px;
}

body.devtools .tooltip {
    z-index: 1;
    position: absolute;
    padding: 2px;
    color: var(--controls-bg-color);
    background-color: var(--text-color);
}

body.file-listing {
    display: block;
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: auto;
}

.file-listing h1 {
    border-bottom: 1px solid var(--button-border-color);
    margin-bottom: 10px;
    padding-bottom: 10px;
    white-space: nowrap;
}

.file-listing tr:hover {
    background-color: var(--controls-bg-color);
}

.file-listing .quick-link-box {
    display: inline-block;
    margin-bottom: 10px;
    padding-bottom: 10px;
}

.file-listing .quick-link-box.hidden {
    display: none;
}

.file-listing a.icon {
    -webkit-padding-start: 1.5em;
    -moz-padding-start: 1.5em;
    text-decoration: none;
    user-select: auto;
}

.file-listing a.icon:hover {
    text-decoration: underline;
}

.file-listing a.link {
    background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAACAElEQVQ4y4WSzUsVYRjFf897RwUz+wK7LiSIyKCoyEUXDFzcqYhq0R+R4J/gMqilf0VC7VwUuBUxobJumyLTvjDIG0TcO96J7sw8T4t3Rp0kfDYH3o/DOc85Qj4LCwvGPpOmKfPz88zMzEhxFux+cGV8HARE/H2BqopzjpWVV4RhSPNH02YfzkqJwMwwDDHxKIKZR+ccAEmSMDExQZZldLY6Njc3J64gUNVtEswTFsTFdDodFhcXCYKAqakp9ijAjOK5AJbbKJSEYZ3N75t0u10+rK2VCVSVX+0elpfe8mxpHTCvCgM1btw8S71+hupwFYD3q6sAlCw4gXp4jno4ShA4nJNclf43mW0FWZbhHLTbHVZefgUxkiQlTf+QqZKmqd9NvuAsy/ZaqFSMx4+W2fjW5HccY5bgKg7BSNNunpLfjarutfCm8ZEXz9+xFbVRSxg8dIDr1y7m3Sii9lgQBLtb1ni9TqUiiBh9vT1MT9/hePUw/f29iI/KJ4N4S//GqKpUnJd4dzJkaGgQy5Rbt8fY2Pi50wnZ6ce2hVarxfkLJzDg6JEBxi6dBDNEfD9GRo5hlqswo9VqlQmiKKJWO83l2ilU1W9ZduIy9R+LwkVRVLYQxzFOYHLyKp8/NWk0vjA6OszAwT7MBFXfiaKjcRyXCaIo4v6De6WSPHnKvvMXLQgqHcJs3fIAAAAASUVORK5CYII=) left top no-repeat;
}
.file-listing a.file {
    background : url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAACQkWg2AAAABnRSTlMAAAAAAABupgeRAAABHUlEQVR42o2RMW7DIBiF3498iHRJD5JKHurL+CRVBp+i2T16tTynF2gO0KSb5ZrBBl4HHDBuK/WXACH4eO9/CAAAbdvijzLGNE1TVZXfZuHg6XCAQESAZXbOKaXO57eiKG6ft9PrKQIkCQqFoIiQFBGlFIB5nvM8t9aOX2Nd18oDzjnPgCDpn/BH4zh2XZdlWVmWiUK4IgCBoFMUz9eP6zRN75cLgEQhcmTQIbl72O0f9865qLAAsURAAgKBJKEtgLXWvyjLuFsThCSstb8rBCaAQhDYWgIZ7myM+TUBjDHrHlZcbMYYk34cN0YSLcgS+wL0fe9TXDMbY33fR2AYBvyQ8L0Gk8MwREBrTfKe4TpTzwhArXWi8HI84h/1DfwI5mhxJamFAAAAAElFTkSuQmCC) left top no-repeat;
}

.file-listing a.dir {
    background : url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAd5JREFUeNqMU79rFUEQ/vbuodFEEkzAImBpkUabFP4ldpaJhZXYm/RiZWsv/hkWFglBUyTIgyAIIfgIRjHv3r39MePM7N3LcbxAFvZ2b2bn22/mm3XMjF+HL3YW7q28YSIw8mBKoBihhhgCsoORot9d3/ywg3YowMXwNde/PzGnk2vn6PitrT+/PGeNaecg4+qNY3D43vy16A5wDDd4Aqg/ngmrjl/GoN0U5V1QquHQG3q+TPDVhVwyBffcmQGJmSVfyZk7R3SngI4JKfwDJ2+05zIg8gbiereTZRHhJ5KCMOwDFLjhoBTn2g0ghagfKeIYJDPFyibJVBtTREwq60SpYvh5++PpwatHsxSm9QRLSQpEVSd7/TYJUb49TX7gztpjjEffnoVw66+Ytovs14Yp7HaKmUXeX9rKUoMoLNW3srqI5fWn8JejrVkK0QcrkFLOgS39yoKUQe292WJ1guUHG8K2o8K00oO1BTvXoW4yasclUTgZYJY9aFNfAThX5CZRmczAV52oAPoupHhWRIUUAOoyUIlYVaAa/VbLbyiZUiyFbjQFNwiZQSGl4IDy9sO5Wrty0QLKhdZPxmgGcDo8ejn+c/6eiK9poz15Kw7Dr/vN/z6W7q++091/AQYA5mZ8GYJ9K0AAAAAASUVORK5CYII=) left top no-repeat;
}

.file-listing a.up {
    background : url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAmlJREFUeNpsU0toU0EUPfPysx/tTxuDH9SCWhUDooIbd7oRUUTMouqi2iIoCO6lceHWhegy4EJFinWjrlQUpVm0IIoFpVDEIthm0dpikpf3ZuZ6Z94nrXhhMjM3c8895977BBHB2PznK8WPtDgyWH5q77cPH8PpdXuhpQT4ifR9u5sfJb1bmw6VivahATDrxcRZ2njfoaMv+2j7mLDn93MPiNRMvGbL18L9IpF8h9/TN+EYkMffSiOXJ5+hkD+PdqcLpICWHOHc2CC+LEyA/K+cKQMnlQHJX8wqYG3MAJy88Wa4OLDvEqAEOpJd0LxHIMdHBziowSwVlF8D6QaicK01krw/JynwcKoEwZczewroTvZirlKJs5CqQ5CG8pb57FnJUA0LYCXMX5fibd+p8LWDDemcPZbzQyjvH+Ki1TlIciElA7ghwLKV4kRZstt2sANWRjYTAGzuP2hXZFpJ/GsxgGJ0ox1aoFWsDXyyxqCs26+ydmagFN/rRjymJ1898bzGzmQE0HCZpmk5A0RFIv8Pn0WYPsiu6t/Rsj6PauVTwffTSzGAGZhUG2F06hEc9ibS7OPMNp6ErYFlKavo7MkhmTqCxZ/jwzGA9Hx82H2BZSw1NTN9Gx8ycHkajU/7M+jInsDC7DiaEmo1bNl1AMr9ASFgqVu9MCTIzoGUimXVAnnaN0PdBBDCCYbEtMk6wkpQwIG0sn0PQIUF4GsTwLSIFKNqF6DVrQq+IWVrQDxAYQC/1SsYOI4pOxKZrfifiUSbDUisif7XlpGIPufXd/uvdvZm760M0no1FZcnrzUdjw7au3vu/BVgAFLXeuTxhTXVAAAAAElFTkSuQmCC) left top no-repeat;
}

.file-listing a.push {
    color: var(--text-color);
}

.file-listing .listing {
    margin: 8px;
}

.file-listing .foreground {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    z-index: 1000;
    background-color: var(--controls-bg-color);
}

.file-listing .foreground-message {
    flex: auto;
    font-size: 30px;
    color: #999;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 20px;
    pointer-events: none;
}

.file-listing .foreground-message.drop-target-message {
    border: 4px dashed #ddd;
}

.file-listing .entry-name {
    position: relative;
}

.file-listing .background-progress {
    position: absolute;
    left: 0;
    top: 0;
    background-color: var(--progress-background-color);
    height: 100%;
    width: 100%;
    margin: 0;
    padding: 0;
    border-spacing: 0;
}

.file-listing .background-progress.error {
    background-color: var(--progress-background-error-color);
}

