/* --- 外观设置页 (Appearance Settings) --- */
#appearance-settings-screen {
    background: #f7f7f8;
    min-height: 100%;
}

.appearance-settings-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.appearance-content {
    padding: 16px 0 80px;
    overflow-y: auto;
    flex: 1;
}

/* 独立区块 (每个APP/功能的设置区) */
.appearance-section {
    background: #fff;
    margin-bottom: 20px;
    padding: 20px 0;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
}

.appearance-section:first-child {
    border-top: none;
    margin-top: 0;
}

.appearance-section-header {
    padding: 0 20px;
    margin-bottom: 16px;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.appearance-section-title {
    font-size: 17px;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.appearance-section-desc {
    font-size: 12px;
    color: #999;
}

/* 横向滚动的缩略图容器 */
.appearance-thumbnail-container {
    display: flex;
    overflow-x: auto;
    padding: 4px 20px 16px;
    gap: 16px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
}

.appearance-thumbnail-container::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

/* 单个缩略图项 */
.appearance-thumbnail-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    scroll-snap-align: start;
    cursor: pointer;
    flex-shrink: 0;
}

/* 手机外壳框 */
.appearance-thumbnail-box {
    width: 100px;
    height: 180px;
    border-radius: 16px;
    border: 3px solid #e0e0e0;
    background: #fff;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    transition: all 0.2s ease;
    padding: 2px;
}

.appearance-thumbnail-item:active .appearance-thumbnail-box {
    transform: scale(0.96);
}

.appearance-thumbnail-item.selected .appearance-thumbnail-box {
    border-color: #6C8CD5;
    box-shadow: 0 6px 16px rgba(108, 140, 213, 0.25);
}

/* 选中状态的勾选图标 */
.thumbnail-check-icon {
    position: absolute;
    bottom: 8px;
    right: 8px;
    width: 22px;
    height: 22px;
    background: #6C8CD5;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 10;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.appearance-thumbnail-item.selected .thumbnail-check-icon {
    opacity: 1;
    transform: scale(1);
}

/* 底部标签 */
.appearance-thumbnail-label {
    font-size: 13px;
    color: #666;
    font-weight: 500;
    transition: color 0.2s;
}

.appearance-thumbnail-item.selected .appearance-thumbnail-label {
    color: #6C8CD5;
    font-weight: 600;
}

/* --- 内部微缩 UI 模拟 --- */
.thumb-screen {
    width: 100%;
    height: 100%;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
}

.thumb-header {
    height: 16px;
    background: #eaeaea;
    margin-bottom: 8px;
}

/* 经典版微缩 */
.thumb-classic {
    background: #f2f2f2;
    padding: 6px;
}
.thumb-classic .thumb-card {
    background: #fff;
    height: 24px;
    border-radius: 4px;
    margin-bottom: 6px;
    border: 1px solid #e0e0e0;
}

/* 简约版微缩 */
.thumb-modern {
    background: #f2f2f7;
    padding: 6px;
}
.thumb-modern .thumb-group {
    background: #fff;
    border-radius: 6px;
    margin-bottom: 8px;
    overflow: hidden;
}
.thumb-modern .thumb-row {
    height: 16px;
    border-bottom: 1px solid #e5e5ea;
}
.thumb-modern .thumb-row:last-child {
    border-bottom: none;
}

/* 白兔岛微缩 */
.thumb-rabbit {
    background: linear-gradient(135deg, #fff0f5 0%, #ffe4e1 100%);
    padding: 6px;
}
.thumb-rabbit .thumb-header {
    background: transparent;
    border-bottom: 2px dashed #ffb6c1;
    margin-bottom: 10px;
}
.thumb-rabbit .thumb-rabbit-card {
    background: rgba(255,255,255,0.8);
    height: 30px;
    border-radius: 8px;
    margin-bottom: 8px;
    border: 1px solid #fff;
    box-shadow: 0 2px 4px rgba(255,182,193,0.3);
}

/* --- 自定义 CSS 编辑区 --- */
.custom-css-area {
    padding: 0 20px 20px;
}

.custom-css-toggle-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.custom-css-toggle-label {
    font-size: 15px;
    color: #333;
    font-weight: 500;
}

.custom-css-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 26px;
}

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

.custom-css-switch-slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #ccc;
    transition: 0.3s;
    border-radius: 26px;
}

.custom-css-switch-slider::before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: #fff;
    transition: 0.3s;
    border-radius: 50%;
}

.custom-css-switch input:checked + .custom-css-switch-slider {
    background-color: #6C8CD5;
}

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

.custom-css-textarea {
    width: 100%;
    min-height: 160px;
    max-height: 400px;
    padding: 12px;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    font-family: 'SF Mono', 'Menlo', 'Monaco', 'Consolas', monospace;
    font-size: 13px;
    line-height: 1.6;
    color: #333;
    background: #fafafa;
    resize: vertical;
    box-sizing: border-box;
    transition: border-color 0.2s, background 0.2s;
    tab-size: 2;
}

.custom-css-textarea:focus {
    outline: none;
    border-color: #6C8CD5;
    background: #fff;
}

.custom-css-textarea:disabled {
    opacity: 0.5;
    background: #f0f0f0;
    cursor: not-allowed;
}

.custom-css-btn-row {
    display: flex;
    gap: 10px;
    margin-top: 12px;
}

.custom-css-btn {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: opacity 0.2s;
}

.custom-css-btn:active {
    opacity: 0.7;
}

.custom-css-btn.primary {
    background: #6C8CD5;
    color: #fff;
}

.custom-css-btn.neutral {
    background: #f0f0f0;
    color: #666;
}

.custom-css-hint {
    margin-top: 12px;
    font-size: 12px;
    color: #999;
    line-height: 1.5;
    display: flex;
    gap: 4px;
}
