/**
 * AerMusic 设置面板增强样式
 */

/* 设置面板容器 */
#theme-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.98);
    backdrop-filter: blur(3vh);
    z-index: 1600;
    display: none;
    overflow-y: auto;
    padding: 4vh 6vw;
}

#theme-overlay.active {
    display: block;
}

.settings-main-title {
    font-size: 3.5vh;
    font-weight: 700;
    color: #fff;
    margin-bottom: 4vh;
}

.settings-section {
    margin-bottom: 5vh;
}

.settings-label {
    font-size: 1.8vh;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 2vh;
    font-weight: 600;
}

/* 设置项横向布局 */
.settings-flex-row {
    display: flex;
    flex-wrap: wrap;
    gap: 2vh 3vw;
    align-items: center;
}

/* 单个设置项 */
.setting-item {
    display: flex;
    align-items: center;
    gap: 1.5vh;
    padding: 1.5vh 2vh;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 1.2vh;
    min-width: 20vh;
}

.setting-item span {
    font-size: 1.5vh;
    color: #fff;
}

/* Apple 风格开关 */
.apple-switch {
    position: relative;
    display: inline-block;
    width: 5vh;
    height: 2.8vh;
}

.apple-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.apple-switch .slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.2);
    transition: 0.3s;
    border-radius: 2.8vh;
}

.apple-switch .slider:before {
    position: absolute;
    content: "";
    height: 2.2vh;
    width: 2.2vh;
    left: 0.3vh;
    bottom: 0.3vh;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
    box-shadow: 0 0.1vh 0.3vh rgba(0,0,0,0.3);
}

.apple-switch input:checked + .slider {
    background-color: var(--apple-red, #24c8fa);
}

.apple-switch input:checked + .slider:before {
    transform: translateX(2.2vh);
}

/* 颜色选择器 */
input[type="color"] {
    width: 5vh;
    height: 3.5vh;
    border: none;
    border-radius: 0.8vh;
    cursor: pointer;
    background: transparent;
}

.hex-input {
    width: 12vh;
    padding: 1vh 1.5vh;
    background: rgba(255, 255, 255, 0.1);
    border: 0.1vh solid rgba(255, 255, 255, 0.2);
    border-radius: 0.8vh;
    color: #fff;
    font-size: 1.4vh;
    font-family: monospace;
}

/* 样式预览卡片 */
.style-preview-card {
    position: relative;
    width: 100%;
    min-width: 15vh;
    max-width: 22vh;
    height: 15vh;
    border-radius: 1.5vh;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 0.2vh solid transparent;
}

.style-preview-card:hover {
    transform: translateY(-0.5vh);
    box-shadow: 0 1vh 3vh rgba(0, 0, 0, 0.3);
}

.style-preview-card.active {
    border-color: var(--apple-red, #24c8fa);
}

.style-preview-bg {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.style-preview-color {
    width: 100%;
    height: 100%;
}

.style-preview-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1.5vh;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
}

.style-preview-name {
    font-size: 1.4vh;
    color: #fff;
    font-weight: 600;
}

.style-preview-desc {
    font-size: 1.1vh;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 0.3vh;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 自定义样式区域 */
.custom-style-section {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 1.5vh;
    padding: 2vh;
    margin-top: 2vh;
}

.custom-style-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2vh;
}

.add-style-btn {
    display: flex;
    align-items: center;
    gap: 0.8vh;
    padding: 1vh 2vh;
    background: var(--apple-red, #24c8fa);
    border-radius: 1vh;
    cursor: pointer;
    font-size: 1.4vh;
    color: #fff;
    transition: all 0.3s ease;
}

.add-style-btn:hover {
    opacity: 0.9;
    transform: scale(1.02);
}

/* 自定义样式表单 */
.custom-style-form {
    display: none;
    padding: 2vh;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 1.2vh;
    margin-top: 1.5vh;
}

.custom-style-form.active {
    display: block;
}

.form-group {
    margin-bottom: 2vh;
}

.form-group label {
    display: block;
    font-size: 1.4vh;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 1vh;
}

.form-input {
    width: 100%;
    padding: 1.2vh 1.5vh;
    background: rgba(255, 255, 255, 0.1);
    border: 0.1vh solid rgba(255, 255, 255, 0.2);
    border-radius: 0.8vh;
    color: #fff;
    font-size: 1.4vh;
}

.form-input:focus {
    outline: none;
    border-color: var(--apple-red, #24c8fa);
}

.source-selector {
    display: flex;
    gap: 1vh;
    margin-bottom: 1.5vh;
}

.source-option {
    padding: 1vh 1.5vh;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 0.8vh;
    cursor: pointer;
    font-size: 1.3vh;
    color: rgba(255, 255, 255, 0.7);
    transition: all 0.2s ease;
}

.source-option.active {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

.file-input-wrapper {
    position: relative;
    overflow: hidden;
}

.file-input-wrapper input[type="file"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.file-input-display {
    display: flex;
    align-items: center;
    gap: 1vh;
    padding: 1.2vh 1.5vh;
    background: rgba(255, 255, 255, 0.1);
    border: 0.1vh dashed rgba(255, 255, 255, 0.3);
    border-radius: 0.8vh;
    font-size: 1.3vh;
    color: rgba(255, 255, 255, 0.6);
}

/* 已保存的自定义样式列表 */
.saved-styles-list {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5vh;
    margin-top: 1.5vh;
}

.saved-style-item {
    position: relative;
    width: 18vh;
    padding: 1.5vh;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 1vh;
}

.saved-style-item .delete-btn {
    position: absolute;
    top: 0.8vh;
    right: 0.8vh;
    width: 2.2vh;
    height: 2.2vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 0, 0, 0.3);
    border-radius: 50%;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.saved-style-item:hover .delete-btn {
    opacity: 1;
}

/* 播放样式网格与平台设置区域统一样式 */
#style-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(25vh, 1fr));
    gap: 1.5vh;
}

/* 平台设置区域 */
.platform-settings {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(25vh, 1fr));
    gap: 1.5vh;
}

.platform-setting-item {
    display: flex;
    align-items: center;
    gap: 1.5vh;
    padding: 1.5vh;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 1.2vh;
}

.platform-icon {
    width: 3.5vh;
    height: 3.5vh;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.8vh;
}

.platform-info {
    flex: 1;
}

.platform-name {
    font-size: 1.5vh;
    color: #fff;
}

.platform-status {
    font-size: 1.2vh;
    color: rgba(255, 255, 255, 0.5);
}

/* 平台设置项完整样式 */
.platform-setting-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5vh 2vh;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 1.2vh;
    margin-bottom: 1.5vh;
}

.platform-info {
    display: flex;
    align-items: center;
    gap: 1.5vh;
    flex: 1;
}

.platform-icon {
    width: 4vh;
    height: 4vh;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 1vh;
    font-size: 1.8vh;
    font-weight: 700;
    color: #fff;
}

.platform-details {
    flex: 1;
}

.platform-name {
    font-size: 1.5vh;
    color: #fff;
    font-weight: 600;
}

.platform-desc {
    font-size: 1.2vh;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 0.3vh;
}

/* 自定义样式徽章 */
.custom-badge {
    position: absolute;
    top: 1vh;
    right: 1vh;
    padding: 0.3vh 0.8vh;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 0.5vh;
    font-size: 1vh;
    color: #fff;
}

/* 已保存样式项完整样式 */
.saved-style-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5vh;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 1vh;
    width: 100%;
}

.saved-style-info {
    flex: 1;
}

.saved-style-name {
    font-size: 1.4vh;
    color: #fff;
    font-weight: 600;
}

.saved-style-desc {
    font-size: 1.2vh;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 0.3vh;
}

.saved-style-actions {
    display: flex;
    gap: 1vh;
}

.saved-style-btn {
    padding: 0.8vh 1.5vh;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 0.6vh;
    cursor: pointer;
    font-size: 1.2vh;
    color: #fff;
    transition: all 0.2s ease;
}

.saved-style-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.saved-style-btn.delete {
    background: rgba(255, 59, 48, 0.2);
    color: #ff3b30;
}

.saved-style-btn.delete:hover {
    background: rgba(255, 59, 48, 0.3);
}

/* Toast 容器 */
#toast-container {
    position: fixed;
    bottom: 6vh;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 1vh;
    pointer-events: none;
}

.toast-message {
    padding: 1.5vh 3vh;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(1vh);
    border-radius: 1vh;
    color: #fff;
    font-size: 1.4vh;
    animation: toast-in 0.3s ease;
    pointer-events: auto;
}

.toast-message.fade-out {
    animation: toast-out 0.3s ease forwards;
}

@keyframes toast-in {
    from {
        opacity: 0;
        transform: translateY(2vh);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes toast-out {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-2vh);
    }
}

/* GPU 加速样式 */
body.gpu-accelerated {
   /** transform: translateZ(0); **/
}

body.gpu-accelerated * {
    backface-visibility: hidden;
}

body.gpu-accelerated .gpu-accelerated {
    will-change: transform, opacity;
}

/* 确认对话框样式 */
#confirm-dialog {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    align-items: center;
    justify-content: center;
}

.confirm-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(1vh);
}

.confirm-content {
    position: relative;
    background: rgba(30, 30, 30, 0.95);
    border-radius: 1.5vh;
    padding: 3vh;
    max-width: 40vh;
    width: 80%;
    box-shadow: 0 2vh 6vh rgba(0, 0, 0, 0.4);
}

.confirm-title {
    font-size: 2vh;
    color: #fff;
    margin: 0 0 1.5vh 0;
    font-weight: 600;
}

.confirm-message {
    font-size: 1.4vh;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.6;
    margin: 0 0 2.5vh 0;
}

.confirm-buttons {
    display: flex;
    gap: 1.5vh;
    justify-content: flex-end;
}

.confirm-btn {
    padding: 1vh 2.5vh;
    border-radius: 0.8vh;
    font-size: 1.4vh;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.confirm-btn.cancel {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
}

.confirm-btn.cancel:hover {
    background: rgba(255, 255, 255, 0.15);
}

.confirm-btn.ok {
    background: rgba(255, 59, 48, 0.2);
    color: #ff3b30;
}

.confirm-btn.ok:hover {
    background: rgba(255, 59, 48, 0.3);
}
