/* ========== iOS 26 Liquid Glass Theme Adaptation ========== */

/* General Liquid Glass Utilities */
.liquid-glass {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(40px) saturate(200%);
    -webkit-backdrop-filter: blur(40px) saturate(200%);
    border: 1px solid rgba(255, 255, 255, 0.35);
    box-shadow: 
        0 8px 32px 0 rgba(31, 38, 135, 0.1),
        inset 0 0 0 1px rgba(255, 255, 255, 0.2);
}

/* Action Panel (New Structure) */
.chat-action-panel {
    /* Override existing styles */
    background-color: transparent !important; /* Was var(--chat-safe-area-color) */
    padding: 20px 0 !important;
    border-radius: 32px !important;
    
    /* Control Center Style */
    position: absolute !important; /* Was likely static/relative in flow */
    bottom: 100px !important;
    left: 16px !important;
    right: 16px !important;
    max-height: none !important; /* Was max-height transition */
    
    background: rgba(245, 245, 245, 0.65) !important;
    backdrop-filter: blur(50px) saturate(200%) !important;
    -webkit-backdrop-filter: blur(50px) saturate(200%) !important;
    border: 1px solid rgba(255, 255, 255, 0.5) !important;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.15),
        inset 0 0 0 1px rgba(255,255,255,0.2) !important;
        
    transform: translateY(150%) scale(0.95); /* Hidden state */
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.19, 1, 0.22, 1) !important;
    pointer-events: none;
    z-index: 100 !important;
    overflow: hidden !important;
}

.chat-action-panel.open {
    max-height: none !important; /* Override old style */
    transform: translateY(0) scale(1);
    opacity: 1;
    pointer-events: auto;
}

/* Action Pages & Grid */
.action-pages {
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 10px;
}
.action-pages::-webkit-scrollbar { display: none; }

.action-page {
    flex: 0 0 100%;
    width: 100%;
    scroll-snap-align: start;
    padding: 0 20px;
    box-sizing: border-box;
}

.action-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px 12px;
}

/* Action Items (Replacements for .action-panel-item) */
.action-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    position: relative;
}

.action-icon {
    width: 58px;
    height: 58px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0,0,0,0.05);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.action-item:active .action-icon {
    transform: scale(0.92);
    background: rgba(255, 255, 255, 1);
}

.action-icon svg {
    width: 28px;
    height: 28px;
    color: #333;
    stroke-width: 2;
    transition: color 0.2s;
}

.action-label {
    font-size: 12px;
    color: rgba(0, 0, 0, 0.7);
    font-weight: 500;
    letter-spacing: 0.2px;
}

/* Page Indicators */
.page-indicators {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 16px;
}
.page-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(0,0,0,0.1);
    transition: all 0.3s;
}
.page-dot.active {
    background: #007AFF;
    width: 20px;
    border-radius: 4px;
}

/* Sticker Panel Adaptation */
.sticker-panel {
    /* Floating Glass Panel */
    position: absolute !important;
    bottom: 100px !important;
    left: 16px !important;
    right: 16px !important;
    height: 350px !important;
    max-height: 50vh !important;
    border-radius: 32px !important;
    
    background: rgba(245, 245, 245, 0.85) !important; /* Slightly more opaque than action panel */
    backdrop-filter: blur(50px) saturate(200%) !important;
    -webkit-backdrop-filter: blur(50px) saturate(200%) !important;
    border: 1px solid rgba(255, 255, 255, 0.5) !important;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.15),
        inset 0 0 0 1px rgba(255,255,255,0.2) !important;
    
    z-index: 101 !important; /* Above action panel */
    /* display logic handled by JS (flex/none) */
    flex-direction: column;
    overflow: hidden !important;
}

/* Tabs in Sticker Panel */
.sticker-panel-header {
    background: transparent !important;
    border-bottom: 1px solid rgba(0,0,0,0.05) !important;
    padding: 12px 16px !important;
}

.sticker-tab {
    background: rgba(255,255,255,0.5) !important;
    border: 1px solid rgba(0,0,0,0.05) !important;
    color: #333 !important;
    border-radius: 14px !important;
    padding: 6px 14px !important;
}
.sticker-tab.active {
    background: #000 !important;
    color: #fff !important;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1) !important;
}

/* Sticker Grid */
.sticker-grid {
    padding: 16px !important;
    gap: 12px !important;
}
.sticker-item {
    border-radius: 16px !important;
    border: none !important;
    background: rgba(255,255,255,0.6) !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05) !important;
}

/* Sticker Search Input */
.sticker-panel-search input {
    background: rgba(255, 255, 255, 0.5) !important;
    border: 1px solid rgba(0,0,0,0.05) !important;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.05) !important;
    color: #333 !important;
}
.sticker-panel-search input:focus {
    background: rgba(255, 255, 255, 0.8) !important;
    box-shadow: 0 0 0 2px rgba(0,122,255,0.2) !important;
}

/* Sticker Manager Modal (Glass Sheet) */
.sticker-manager-container {
    background: rgba(245, 245, 245, 0.75) !important;
    backdrop-filter: blur(50px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(50px) saturate(180%) !important;
    border-radius: 32px !important;
    border: 1px solid rgba(255, 255, 255, 0.6) !important;
    box-shadow: 
        0 25px 50px -12px rgba(0, 0, 0, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.8),
        inset 0 0 20px rgba(255, 255, 255, 0.2) !important;
    width: 90% !important;
    max-width: 440px !important;
    max-height: 80vh !important;
    overflow: hidden !important;
    animation: modalFloatIn 0.4s cubic-bezier(0.19, 1, 0.22, 1);
}

/* 弹窗动画 */
@keyframes modalFloatIn {
    from { opacity: 0; transform: scale(0.9) translateY(20px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.sticker-manager-header {
    background: transparent !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05) !important;
    padding: 20px 24px !important;
}

.sticker-manager-header h2 {
    font-weight: 600 !important;
    font-size: 20px !important;
    color: #1d1d1f !important;
    letter-spacing: -0.5px !important;
}

.sticker-manager-tabs {
    background: transparent !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05) !important;
    padding: 10px 20px !important;
    gap: 10px !important;
}

.sticker-manager-tab.active {
    background: #fff !important;
    color: #000 !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08) !important;
    transform: scale(1.02);
}

/* Modal Overlay (Shared) */
.modal-overlay {
    background: rgba(0, 0, 0, 0.25) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    transition: all 0.3s ease;
}

/* Sticker Manager Input Styles */
.sticker-add-section input[type="text"],
.sticker-add-section textarea,
.sticker-manager-filter input,
.sticker-manager-filter select {
    background: rgba(255, 255, 255, 0.5) !important;
    border: 1px solid rgba(0,0,0,0.1) !important;
    border-radius: 12px !important;
}

/* 关闭按钮 */
.sticker-manager-close {
    color: rgba(0, 0, 0, 0.4) !important;
    background: rgba(0,0,0,0.05) !important;
    width: 30px;
    height: 30px;
    border-radius: 50% !important;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px !important;
    transition: all 0.2s;
}
.sticker-manager-close:hover {
    background: rgba(0,0,0,0.1) !important;
    color: #000 !important;
}

/* 标签栏 - 胶囊风格 */
.sticker-manager-tab {
    border-radius: 20px !important;
    padding: 8px 16px !important;
    border: none !important;
    background: transparent !important;
    color: rgba(0, 0, 0, 0.5) !important;
    font-weight: 500 !important;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1) !important;
}

/* ========== 上传区域 (Glowing Dash) ========== */
.sticker-upload-area {
    border: 2px dashed rgba(0, 122, 255, 0.3) !important;
    background: rgba(255, 255, 255, 0.3) !important;
    border-radius: 20px !important;
    padding: 30px 20px !important;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1) !important;
    cursor: pointer !important;
    color: rgba(0, 0, 0, 0.5) !important;
}

/* 悬停 / 拖拽激活状态 */
.sticker-upload-area:hover,
.sticker-upload-area.dragover {
    border-color: #007aff !important;
    background: rgba(0, 122, 255, 0.08) !important;
    color: #007aff !important;
    
    /* 呼吸发光效果 */
    box-shadow: 
        0 0 0 4px rgba(0, 122, 255, 0.1),
        0 0 20px rgba(0, 122, 255, 0.2),
        inset 0 0 10px rgba(0, 122, 255, 0.05) !important;
    
    transform: scale(1.02);
}

.sticker-upload-area svg {
    color: inherit !important;
    transition: all 0.3s ease;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.05));
}

.sticker-upload-area:hover svg {
    transform: translateY(-5px) scale(1.1);
    filter: drop-shadow(0 5px 10px rgba(0, 122, 255, 0.3));
}

/* 上传提示文字 */
.sticker-upload-area p {
    font-weight: 500 !important;
    margin-top: 10px !important;
}

.sticker-upload-area .upload-hint {
    font-size: 12px !important;
    opacity: 0.7 !important;
    font-weight: 400 !important;
}

/* ========== 极简主义重构：���置界面 (Pure Liquid) ========== */

/* 1. 全屏容器：统一的高级磨砂背景 */
#chat-settings-screen {
    /* 使用极高模糊抹平背景，只保留色调 */
    background: rgba(245, 245, 245, 0.4) !important;
    backdrop-filter: blur(60px) saturate(150%) !important;
    -webkit-backdrop-filter: blur(60px) saturate(150%) !important;
}

/* 内容区域限制宽度，防止在大屏拉伸 */
.chat-settings-content {
    max-width: 600px !important;
    margin: 0 auto !important;
    padding: 20px 20px 80px !important; /* 底部留白 */
}

/* 2. 顶部导航：隐形化 */
.chat-settings-header {
    background: transparent !important;
    border-bottom: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

.chat-settings-header h2 {
    font-weight: 600 !important;
    font-size: 18px !important;
    color: #000 !important;
    opacity: 0.8;
}

/* 3. 标签页：iOS 分段控制器风格 (Segmented Control) */
.chat-settings-tabs {
    background: rgba(118, 118, 128, 0.12) !important; /* iOS 灰色槽 */
    border-radius: 9px !important; /* iOS 标准圆角 */
    padding: 2px !important;
    border: none !important;
    margin: 0 20px 20px !important;
    height: 36px !important;
    display: flex !important;
    backdrop-filter: none !important;
}

.chat-setting-tab {
    flex: 1 !important;
    border-radius: 7px !important; /* 略小于容器 */
    font-size: 13px !important;
    font-weight: 500 !important;
    color: #000 !important;
    background: transparent !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
    opacity: 0.6;
}

.chat-setting-tab:hover {
    background: transparent !important;
    opacity: 1;
}

.chat-setting-tab.active {
    background: #fff !important;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.12), 0 3px 1px rgba(0, 0, 0, 0.04) !important;
    color: #000 !important;
    opacity: 1;
    transform: none !important; /* 去掉缩放 */
}

/* 4. 分组卡片：通透的大白卡片 */
.chat-setting-group {
    background: rgba(255, 255, 255, 0.55) !important; /* 更通透的白 */
    border-radius: 16px !important; /* 更克制的圆角 */
    padding: 20px !important;
    margin-bottom: 20px !important;
    box-shadow: none !important; /* 去掉阴影，平面化 */
    border: none !important; /* 去掉描边 */
}

.chat-setting-group h3 {
    font-size: 13px !important;
    color: rgba(60, 60, 67, 0.6) !important; /* iOS次级文本色 */
    margin-bottom: 12px !important;
    font-weight: 400 !important;
    text-transform: none !important; /* 不强制大写 */
    letter-spacing: 0 !important;
}

/* 5. 列表项：更紧凑 */
.chat-setting-item {
    margin-bottom: 20px !important;
    border-bottom: 1px solid rgba(0,0,0,0.05) !important;
    padding-bottom: 20px !important;
}
.chat-setting-item:last-child {
    margin-bottom: 0 !important;
    border-bottom: none !important;
    padding-bottom: 0 !important;
}

.chat-setting-label {
    font-size: 16px !important;
    font-weight: 500 !important;
    color: #000 !important;
    margin-bottom: 8px !important;
}

.chat-setting-description {
    font-size: 13px !important;
    color: rgba(60, 60, 67, 0.6) !important;
    line-height: 1.4 !important;
}

/* 6. 输入框：极简无边框 */
.chat-setting-input, 
.chat-setting-textarea {
    background: rgba(0, 0, 0, 0.05) !important; /* 浅灰背景 */
    border: none !important; /* 去边框 */
    border-radius: 10px !important;
    padding: 10px 12px !important;
    font-size: 16px !important; /* 更大的字号 */
    color: #000 !important;
    box-shadow: none !important;
}

.chat-setting-input:focus, 
.chat-setting-textarea:focus {
    background: rgba(0, 0, 0, 0.08) !important;
    box-shadow: none !important;
    outline: none !important;
}

/* 7. 按钮：主要按钮与次级按钮 */
.save-chat-settings-btn {
    background: #007AFF !important; /* 纯正 iOS 蓝 */
    border-radius: 12px !important;
    padding: 14px !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    box-shadow: none !important;
    letter-spacing: 0 !important;
}
.save-chat-settings-btn:active {
    opacity: 0.7 !important;
    transform: scale(0.98) !important;
}

.avatar-upload-btn {
    background: rgba(0, 122, 255, 0.1) !important; /* 浅蓝底 */
    color: #007aff !important;
    border: none !important;
    border-radius: 8px !important;
    font-size: 13px !important;
    padding: 6px 12px !important;
}

/* 8. 头像预览：干净 */
.avatar-preview {
    border: none !important;
    box-shadow: none !important;
    background: #f2f2f7 !important;
}

/* 9. 滑块 */
.chat-setting-slider,
.history-depth-slider {
    height: 4px !important;
    background: rgba(0,0,0,0.1) !important;
}
.chat-setting-slider::-webkit-slider-thumb,
.history-depth-slider::-webkit-slider-thumb {
    box-shadow: 0 2px 5px rgba(0,0,0,0.2) !important;
    border: none !important;
    width: 28px !important;
    height: 28px !important;
}