/* ============================================================
   【11. App 容器 (自适应主题)】
   ============================================================ */
.app-overlay { 
    position: absolute; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%; 
    background: var(--bg-body); 
    z-index: 100; 
    transform: translateY(100%); 
    transition: transform 0.5s cubic-bezier(0.32, 0.72, 0, 1), background-color 0.3s; 
    display: flex; 
    flex-direction: column; 
    color: var(--text-primary); 
} 

.app-overlay.active { 
    transform: translateY(0); 
}

.header { 
    padding-top: var(--safe-top); 
    height: calc(44px + var(--safe-top)); 
    display: flex; 
    align-items: center; 
    padding-left: 15px; 
    padding-right: 15px; 
    border-bottom: 0.5px solid rgba(0,0,0,0.05); 
    background: var(--bg-header); 
    backdrop-filter: blur(15px); 
    flex-shrink: 0; 
    z-index: 50; 
    transition: background-color 0.3s; 
}

.header-title { 
    flex: 1; 
    text-align: center; 
    font-weight: 600; 
    font-size: 18px; 
    letter-spacing: 1px; 
    color: var(--text-primary); 
} 

.header-btn { 
    color: var(--ios-blue); 
    background: none; 
    border: none; 
    font-size: 16px; 
    cursor: pointer; 
    padding: 5px; 
    display: flex; 
    align-items: center; 
    font-family: 'InsFont'; 
} 

.header-right-group { 
    display: flex; 
    gap: 15px; 
    width: 70px; 
    justify-content: flex-end; 
} 

.header-icon { 
    width: 22px; 
    height: 22px; 
    fill: var(--text-primary); 
    cursor: pointer; 
}

/* ============================================================
   【12. 通用列表与表单 (自适应主题)】
   ============================================================ */
.ios-list-container { 
    padding: 20px 15px; 
}

.ios-group-card { 
    background: var(--bg-card); 
    border-radius: 12px; 
    overflow: hidden; 
    margin-bottom: 20px; 
    transition: background-color 0.3s; 
}

.list-row { 
    display: flex; 
    align-items: center; 
    padding: 15px; 
    border-bottom: 0.5px solid var(--separator); 
    background: var(--bg-card); 
    cursor: pointer; 
    color: var(--text-primary); 
    transition: background-color 0.3s; 
} 

.list-row:last-child { 
    border-bottom: none; 
}

.list-row:active { 
    background: rgba(128,128,128,0.1); 
}

.ios-switch { 
    position: relative; 
    display: inline-block; 
    width: 51px; 
    height: 31px; 
} 

.ios-switch input { 
    opacity: 0; 
    width: 0; 
    height: 0; 
} 

.slider { 
    position: absolute; 
    cursor: pointer; 
    top: 0; 
    left: 0; 
    right: 0; 
    bottom: 0; 
    background-color: #e0e0e0; 
    transition: .4s; 
    border-radius: 34px; 
} 

.slider:before { 
    position: absolute; 
    content: ""; 
    height: 27px; 
    width: 27px; 
    left: 2px; 
    bottom: 2px; 
    background-color: white; 
    transition: .4s; 
    border-radius: 50%; 
    box-shadow: 0 2px 5px rgba(0,0,0,0.1); 
} 

input:checked + .slider { 
    background-color: #34C759; 
} 

input:checked + .slider:before { 
    transform: translateX(20px); 
}

/* ============================================================
   【13. 显示与亮度 UI】
   ============================================================ */
.appearance-selector { 
    display: flex; 
    justify-content: space-around; 
    padding: 20px; 
}

.mode-option { 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    gap: 10px; 
    cursor: pointer; 
}

.preview-card {
    width: 100px; 
    height: 150px; 
    border-radius: 12px; 
    border: 1px solid var(--separator);
    position: relative; 
    overflow: hidden; 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    justify-content: center;
    transition: border-color 0.3s;
}

.preview-card.light { 
    background: #f2f2f7; 
}

.preview-card.dark { 
    background: #000000; 
}

.preview-ui-mock { 
    width: 80%; 
    height: 5px; 
    border-radius: 3px; 
    margin-bottom: 5px; 
}

.preview-card.light .preview-ui-mock { 
    background: #fff; 
    box-shadow: 0 1px 3px rgba(0,0,0,0.1); 
}

.preview-card.dark .preview-ui-mock { 
    background: #1c1c1e; 
}

.mode-label { 
    font-size: 14px; 
    color: var(--text-primary); 
}

.radio-circle {
    width: 22px; 
    height: 22px; 
    border-radius: 50%; 
    border: 1px solid var(--separator);
    display: flex; 
    justify-content: center; 
    align-items: center; 
    margin-top: 5px;
}

.radio-circle.checked { 
    border-color: var(--ios-blue); 
    background: var(--ios-blue); 
} 

.radio-circle.checked::after { 
    content: '✓'; 
    color: white; 
    font-size: 14px; 
    font-weight: bold; 
}

.option-desc { 
    padding: 0 15px 10px; 
    font-size: 13px; 
    color: var(--text-secondary); 
    line-height: 1.4; 
}

/* ============================================================
   【14. API 布局适配】
   ============================================================ */
.form-group { 
    background: var(--bg-card); 
    border-radius: 12px; 
    padding: 20px; 
    margin-bottom: 20px; 
    display: block; 
} 

.form-label-row { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    margin-bottom: 8px; 
    font-size: 14px; 
    color: var(--text-secondary); 
    font-weight: 500; 
} 

.form-input-box { 
    width: 100%; 
    padding: 12px; 
    background: var(--bg-input); 
    border-radius: 8px; 
    border: 1px solid transparent; 
    font-size: 16px; 
    outline: none; 
    margin-bottom: 15px; 
    box-sizing: border-box; 
    display: block; 
    color: var(--text-primary); 
} 

.form-input-box:focus { 
    background: var(--bg-card); 
    border-color: #ddd; 
} 

.form-select-box { 
    width: 100%; 
    padding: 12px; 
    background: var(--bg-input); 
    border-radius: 8px; 
    border: none; 
    font-size: 16px; 
    outline: none; 
    appearance: none; 
    -webkit-appearance: none; 
    display: block; 
    color: var(--text-primary); 
} 

.button-group { 
    display: flex; 
    gap: 15px; 
    justify-content: flex-end; 
    margin-top: 5px; 
} 

.fetch-btn { 
    font-size: 14px; 
    color: var(--text-primary); 
    border: none; 
    background: none; 
    font-weight: 600; 
    cursor: pointer; 
    padding: 5px 0; 
    border-bottom: 1px solid #ddd; 
}

/* ============================================================
   【15. Talk UI 适配】
   ============================================================ */
.messenger-main { 
    flex: 1; 
    display: flex; 
    flex-direction: column; 
    overflow: hidden; 
    position: relative; 
} 

.tab-view { 
    display: none; 
    flex: 1; 
    width: 100%; 
    height: 100%; 
    overflow-y: auto; 
    background: var(--bg-body); 
    flex-direction: column; 
    color: var(--text-primary); 
} 

.tab-view.active { 
    display: flex; 
} 

.tab-bar { 
    height: calc(50px + var(--safe-bottom)); 
    background: var(--bg-header); 
    border-top: 0.5px solid var(--separator); 
    display: flex; 
    justify-content: space-around; 
    padding-bottom: var(--safe-bottom); 
    flex-shrink: 0; 
    z-index: 60; 
    backdrop-filter: blur(10px); 
} 

.tab-item { 
    flex: 1; 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    justify-content: center; 
    color: #ccc; 
    cursor: pointer; 
} 

.tab-item.active { 
    color: #07C160; 
}

.contact-item { 
    display: flex; 
    align-items: center; 
    padding: 15px; 
    border-bottom: 0.5px solid var(--separator); 
    cursor: pointer; 
    flex-shrink: 0; 
} 

.contact-avatar { 
    width: 45px; 
    height: 45px; 
    border-radius: 12px; 
    margin-right: 15px; 
    object-fit: cover; 
    background: #eee; 
} 

.chat-full-layer { 
    position: absolute; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%; 
    background: var(--bg-body); 
    transform: translateX(100%); 
    transition: transform 0.4s cubic-bezier(0.32, 0.72, 0, 1); 
    z-index: 999; 
    display: flex; 
    flex-direction: column; 
    color: var(--text-primary); 
} 

.chat-full-layer.active { 
    transform: translateX(0); 
} 

.chat-content { 
    flex: 1; 
    overflow-y: auto; 
    padding: 20px 15px; 
    display: flex; 
    flex-direction: column; 
    gap: 15px; 
} 

.msg-row { 
    display: flex; 
    margin-bottom: 4px; 
    width: 100%; 
} 

.msg-row.me { 
    justify-content: flex-end; 
} 

.msg-row.friend { 
    justify-content: flex-start; 
} 

.msg-bubble { 
    max-width: 75%; 
    width: fit-content; 
    padding: 12px 16px; 
    border-radius: 20px; 
    font-size: 15px; 
    line-height: 1.6; 
    word-wrap: break-word; 
    overflow-wrap: break-word; 
    word-break: normal; 
    white-space: pre-wrap; 
    box-shadow: 0 2px 5px rgba(0,0,0,0.03); 
}

.msg-row.me .msg-bubble { 
    background: var(--msg-me-bg); 
    color: var(--msg-me-text); 
    border-bottom-right-radius: 4px; 
} 

.msg-row.friend .msg-bubble { 
    background: var(--msg-friend-bg); 
    color: var(--text-primary); 
    border: 1px solid var(--separator); 
    border-bottom-left-radius: 4px; 
} 

.typing-indicator { 
    font-size: 12px; 
    color: var(--text-secondary); 
    margin-left: 15px; 
    display: none; 
    margin-bottom: 10px; 
    font-style: italic; 
} 

.input-area { 
    padding: 10px 15px calc(10px + var(--safe-bottom)); 
    background: var(--bg-card); 
    display: flex; 
    align-items: flex-end; 
    gap: 10px; 
    border-top: 0.5px solid var(--separator); 
} 

.input-area input { 
    flex: 1; 
    padding: 10px 15px; 
    border-radius: 20px; 
    border: 1px solid var(--separator); 
    outline: none; 
    font-size: 16px; 
    background: var(--bg-input); 
    transition: 0.3s; 
    color: var(--text-primary); 
} 

.input-area input:focus { 
    background: var(--bg-card); 
    border-color: #ccc; 
} 

.input-area button { 
    color: var(--text-primary); 
    font-weight: bold; 
    background: none; 
    border: none; 
    font-size: 16px; 
    padding-bottom: 10px; 
    cursor: pointer; 
}

/* ================= 电话 App 样式 ================= */
.phone-tab-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 83px; /* iOS 标准高度 */
    background: var(--bg-header);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 0.5px solid var(--separator);
    display: flex;
    justify-content: space-around;
    padding-top: 8px;
    padding-bottom: 20px;
    z-index: 100;
}

.phone-tab-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--text-secondary);
    font-size: 10px;
    cursor: pointer;
}

.phone-tab-item.active {
    color: var(--ios-blue); /* 选中变蓝 */
}

.phone-tab-item .tab-icon {
    font-size: 24px;
    margin-bottom: 2px;
}

/* 键盘布局 */
.keypad-container {
    padding: 0 40px;
    margin-bottom: 20px;
}

.key-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
}

.key-btn {
    width: 75px;
    height: 75px;
    border-radius: 50%;
    background: #e5e5e5; /* 浅色模式按钮底色 */
    color: black;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    font-weight: 400;
    transition: 0.2s;
    cursor: pointer;
}

/* 深色模式适配 */
body.dark-mode .key-btn {
    background: #333333; /* 深色模式按钮底色 */
    color: white;
}

.key-btn:active {
    background: #bbb; /* 按下变暗 */
}
body.dark-mode .key-btn:active {
    background: #555;
}

.sub-text {
    font-size: 10px;
    font-weight: bold;
    letter-spacing: 2px;
    margin-top: -5px;
}

/* 呼叫按钮 (绿色) */
.key-btn.call-btn {
    background: #34C759;
}
.key-btn.call-btn:active {
    background: #28a745;
}

.key-placeholder {
    width: 75px; 
    height: 75px;
}
/* 通话中的聊天气泡 */
.call-bubble {
    padding: 10px 15px;
    border-radius: 18px;
    max-width: 80%;
    font-size: 15px;
    line-height: 1.4;
    color: white;
    margin-bottom: 5px;
}
.call-bubble.me {
    background: #0A84FF;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}
.call-bubble.friend {
    background: rgba(255,255,255,0.2);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}
