/* ============ 基础重置 ============ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    color: #1a1a1a;
    background: linear-gradient(135deg, #f5f7fa 0%, #e8edf3 100%);
    overflow: hidden;
}

/* ============ 顶部标题栏 ============ */
.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 28px;
    background: #fff;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    z-index: 10;
}

.brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.brand-logo {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
    color: #fff;
    font-size: 26px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(238, 90, 111, 0.35);
}

.brand-text h1 {
    font-size: 20px;
    font-weight: 600;
    color: #1a1a1a;
}

.brand-text p {
    font-size: 13px;
    color: #6b7280;
    margin-top: 2px;
}

/* ============ 按钮 ============ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 22px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
    color: #fff;
    box-shadow: 0 4px 12px rgba(238, 90, 111, 0.35);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(238, 90, 111, 0.45);
}

/* ============ 主舞台 ============ */
.stage {
    display: flex;
    height: calc(100vh - 80px - 40px);
    padding: 20px;
    gap: 20px;
    overflow: hidden;
}

/* ============ 模拟桌面区 ============ */
.desktop {
    flex: 1;
    position: relative;
    background:
        radial-gradient(ellipse at top, #4a90e2 0%, #2d5a8c 100%);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: inset 0 0 80px rgba(0, 0, 0, 0.2);
    user-select: none;
}

.fake-icon {
    position: absolute;
    color: #fff;
    font-size: 12px;
    text-align: center;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
    line-height: 1.6;
    opacity: 0.85;
}

.fake-icon::first-line {
    font-size: 28px;
}

/* ============ 阿星角色 ============ */
.companion {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 256px;
    height: 320px;
    cursor: grab;
    transition: left 0.2s linear;
    z-index: 5;
}

.companion:active {
    cursor: grabbing;
    transition: none;
}

.companion img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    image-rendering: -webkit-optimize-contrast;
    pointer-events: none;
    /* 用 mask 让 PNG 的纯色背景变透明（兜底，源图通常已透明） */
    mix-blend-mode: normal;
}

.state-tip {
    position: absolute;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 13px;
    backdrop-filter: blur(8px);
    pointer-events: none;
    transition: opacity 0.3s;
}

/* ============ 右侧控制面板 ============ */
.panel {
    width: 320px;
    background: #fff;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
    overflow-y: auto;
}

.panel h2 {
    font-size: 16px;
    color: #1a1a1a;
    margin-bottom: 8px;
}

.panel-hint {
    font-size: 12px;
    color: #9ca3af;
    margin-bottom: 14px;
}

.action-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.action-btn {
    padding: 10px 8px;
    border: 1px solid #e5e7eb;
    background: #fff;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    color: #374151;
    transition: all 0.15s;
    text-align: center;
}

.action-btn:hover {
    border-color: #ee5a6f;
    color: #ee5a6f;
    transform: translateY(-1px);
}

.action-btn.active {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 3px 10px rgba(238, 90, 111, 0.35);
}

.panel-divider {
    height: 1px;
    background: #f0f0f0;
    margin: 20px 0;
}

.control-row {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
}

/* ============ 开关组件 ============ */
.switch {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
}

.switch input {
    display: none;
}

.switch-slider {
    width: 38px;
    height: 22px;
    background: #d1d5db;
    border-radius: 11px;
    position: relative;
    transition: background 0.2s;
    flex-shrink: 0;
}

.switch-slider::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    background: #fff;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: transform 0.2s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.switch input:checked + .switch-slider {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
}

.switch input:checked + .switch-slider::before {
    transform: translateX(16px);
}

.switch input:disabled + .switch-slider {
    opacity: 0.5;
    cursor: not-allowed;
}

.switch-label {
    color: #374151;
}

/* ============ 信息卡 ============ */
.info-card {
    background: #f9fafb;
    border-radius: 10px;
    padding: 14px;
}

.info-card h3 {
    font-size: 14px;
    color: #1a1a1a;
    margin-bottom: 6px;
}

.info-card p {
    font-size: 12px;
    color: #6b7280;
    line-height: 1.7;
    margin-bottom: 6px;
}

.info-card .version {
    color: #9ca3af;
    font-size: 11px;
    margin: 0;
}

.download-help ol {
    padding-left: 16px;
    margin-bottom: 8px;
}

.download-help li {
    font-size: 12px;
    color: #4b5563;
    line-height: 1.8;
    margin-bottom: 4px;
}

.download-help .help-note {
    font-size: 11px;
    color: #9ca3af;
    margin: 0;
    padding-top: 4px;
    border-top: 1px dashed #e5e7eb;
}

/* ============ 页脚 ============ */
.footer {
    text-align: center;
    padding: 10px;
    font-size: 12px;
    color: #9ca3af;
}

/* ============ 移动端适配 ============ */
@media (max-width: 768px) {
    .stage {
        flex-direction: column;
        padding: 12px;
        gap: 12px;
        height: auto;
        min-height: calc(100vh - 80px - 40px);
    }

    .desktop {
        height: 360px;
        flex: none;
    }

    .panel {
        width: 100%;
    }

    .topbar {
        padding: 12px 16px;
    }

    .brand-text h1 {
        font-size: 16px;
    }

    .brand-text p {
        font-size: 11px;
    }

    .companion {
        width: 180px;
        height: 225px;
    }
}
