/* @budding */
/* --- APL 应用屏幕样式 --- */
.setting-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    background-color: var(--widget-bg-color);
    padding: 15px;
    border-radius: 12px;
}

.row-group {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
}

.flex-input {
    flex-grow: 1;
    margin-right: 10px;
}

.setting-group label {
    font-size: 14px;
    color: var(--text-color);
    font-weight: bold;
}

.setting-group input[type="text"],
.setting-group input[type="password"],
.setting-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--icon-bg-color);
    border-radius: 8px;
    font-size: 14px;
    box-sizing: border-box;
    background-color: var(--bg-color);
    outline: none;
    color: var(--text-color);
}

.action-btn {
    background-color: #e4e6eb;
    color: var(--text-color);
    border: none;
    padding: 12px;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    font-weight: bold;
}

.action-btn-small {
    background-color: #e4e6eb;
    color: var(--text-color);
    border: none;
    padding: 10px 15px;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    font-weight: bold;
    white-space: nowrap;
}

.switch-group {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
}

.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 28px;
}

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

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 28px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #4cd964;
}

input:checked + .slider:before {
    transform: translateX(22px);
}

.range-container {
    flex-direction: row;
    align-items: center;
}

.range-container input[type="range"] {
    flex-grow: 1;
    margin-right: 15px;
}

.range-container span {
    font-weight: bold;
    color: var(--text-color);
    min-width: 30px;
    text-align: right;
}

.main-save-btn {
    width: 100%;
    background-color: #007aff;
    color: white;
    border: none;
    padding: 15px;
    border-radius: 12px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
}

.select-selected {
    background-color: var(--bg-color);
    padding: 10px;
    border: 1px solid var(--icon-bg-color);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.select-items {
    position: absolute;
    background-color: var(--widget-bg-color);
    top: 100%;
    left: 0;
    right: 0;
    z-index: 99;
    border: 1px solid var(--icon-bg-color);
    border-radius: 8px;
    margin-top: 4px;
    max-height: 150px;
    overflow-y: auto;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.select-hide {
    display: none;
}
.preset-option-item {
    padding: 10px 12px;
    cursor: pointer;
    border-bottom: 1px solid var(--bg-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.preset-option-item:hover {
    background-color: var(--bg-color);
}
.preset-option-item:last-child {
    border-bottom: none;
}
.preset-name {
    flex-grow: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.preset-actions button {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 12px;
    padding: 2px 5px;
    margin-left: 5px;
    color: #888;
    border-radius: 4px;
}
.preset-actions button:hover {
    background-color: #e0e0e0;
    color: #333;
}
.select-arrow {
    transition: transform 0.2s ease;
}
.select-arrow.rotate {
    transform: rotate(180deg);
}

/* --- 预设管理中心弹窗样式 --- */
.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.4);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 200;
}
.modal-content {
    background-color: var(--bg-color);
    width: 90%;
    max-width: 400px;
    border-radius: 16px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
    height: 55vh; /* 看这里！我把它焊死在屏幕高度的55%，雷打不动！ */
    max-height: 500px; /* 再加个保险，在特别长的屏幕上，最高也不超过500像素 */
}
.modal-header {
    padding: 15px 20px;
    border-bottom: 1px solid var(--icon-bg-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: var(--text-color);
}
.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: #aaa;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}
.modal-body {
    padding: 10px;
    overflow-y: auto;
    flex-grow: 1;
}
.modal-preset-item {
    background-color: var(--widget-bg-color);
    border-radius: 10px;
    padding: 12px 15px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    cursor: pointer;
}
.modal-preset-item:hover {
    background-color: #f0f0f0;
}
.modal-preset-name {
    flex-grow: 1;
    font-weight: bold;
    color: var(--text-color);
}
.modal-preset-actions button {
    background: none; border: none; cursor: pointer;
    font-size: 13px; padding: 4px 8px; margin-left: 5px;
    color: #555; border-radius: 6px;
}
.modal-preset-actions button:hover {
    background-color: var(--icon-bg-color);
}
.modal-footer {
    padding: 15px 20px;
    border-top: 1px solid var(--icon-bg-color);
}
.modal-footer .action-btn {
    width: 100%;
}
