/* =========================================================
   弹层 / Bottom Sheet / 分类管理
   源文件行号：607-688
   ========================================================= */

/* ============ 弹层 ============ */
.modal-overlay {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.4); z-index: 1000; display: none !important;
    align-items: flex-end; justify-content: center;
    transition: padding-bottom 0.2s ease;
}
.modal-overlay.show { display: flex !important; }
.modal-content {
    background: var(--bg-color); width: 100%; border-radius: 20px 20px 0 0;
    padding: 10px 20px 24px; box-shadow: 0 -10px 30px rgba(0,0,0,0.2);
    transform: translateY(100%); max-height: 85%; display: flex; flex-direction: column;
}
.modal-overlay.show .modal-content { animation: slideUpContent 0.3s cubic-bezier(0.25, 0.8, 0.25, 1) forwards; }
@keyframes slideUpContent { from { transform: translateY(100%); } to { transform: translateY(0); } }
.modal-drag-handle { width: 40px; height: 4px; background: #D5D0C6; border-radius: 2px; margin: 0 auto 16px; flex-shrink: 0; }
.modal-content h3 { font-size: 15px; margin-bottom: 14px; color: var(--text-main); font-weight: 700; text-align: center; flex-shrink: 0; }

/* 富文本自适应高度 */
.modal-content textarea { 
    width: 100%; 
    height: 100px; 
    min-height: 100px;
    max-height: 380px; 
    border: 1px solid var(--border-color); 
    border-radius: 12px; 
    padding: 12px; 
    font-family: inherit; 
    font-size: 15px; 
    resize: none; 
    outline: none; 
    background: white; 
    margin-bottom: 12px; 
    -webkit-appearance: none; 
    appearance: none; 
    line-height: 1.6; 
    overflow-y: auto;
}
.modal-content textarea:focus { border-color: var(--accent-gold); }
.modal-content input[type="date"] { width: 100%; border: 1px solid var(--border-color); border-radius: 12px; padding: 12px; font-family: inherit; font-size: 14px; outline: none; background: white; margin-bottom: 12px; }
.modal-actions { display: flex; gap: 10px; flex-shrink: 0; }
.modal-actions button { flex: 1; padding: 12px 18px; border-radius: 14px; font-size: 15px; border: none; cursor: pointer; font-family: inherit; font-weight: 600; }
.modal-actions .btn-cancel { background: #EBE7DF; color: var(--text-main); }
.modal-actions .btn-confirm { background: var(--accent-dark); color: white; }

/* 新建笔记弹窗补充 */
.modal-title { font-size: 16px; font-weight: 700; text-align: center; margin-bottom: 16px; }
.modal-input { width: 100%; border: 1px solid var(--border-color); border-radius: 8px; padding: 12px; font-size: 15px; margin-bottom: 16px; outline: none; background: #fff; font-family: inherit; }
.note-type-tabs { display: flex; background: #EBE7DF; border-radius: 10px; padding: 3px; margin-bottom: 20px; }
.note-type-tab { flex: 1; text-align: center; padding: 8px 0; border-radius: 8px; font-size: 14px; color: var(--text-sub); cursor: pointer; transition: all 0.2s; }
.note-type-tab.active { background: #fff; color: var(--text-main); font-weight: 600; box-shadow: 0 1px 4px rgba(0,0,0,0.05); }
.tuiyan-options { display: none; gap: 10px; margin-bottom: 20px; }
.tuiyan-options.show { display: flex; }
.tuiyan-btn { flex: 1; padding: 12px; border-radius: 8px; border: 1px solid var(--border-color); background: #fff; text-align: center; font-size: 14px; cursor: pointer; transition: all 0.2s; }
.tuiyan-btn.active { border-color: var(--accent-dark); background: rgba(62,58,54,0.05); color: var(--accent-dark); font-weight: 600; }

/* 分类管理弹窗专用 */
.cat-list { flex: 1; overflow-y: auto; margin-bottom: 16px; border: 1px solid var(--border-color); border-radius: 12px; background: #fff; }
.cat-item { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-bottom: 1px solid #F5F2EC; font-size: 14px; }
.cat-item:last-child { border-bottom: none; }
.cat-actions { display: flex; gap: 8px; }
.cat-btn { background: transparent; border: none; font-family: inherit; font-size: 12px; cursor: pointer; padding: 4px 8px; border-radius: 4px; }
.cat-btn-rename { color: var(--accent-gold); }
.cat-btn-delete { color: var(--accent-red); }

.cat-add-row { display: flex; gap: 8px; margin-bottom: 16px; }
.cat-add-row input { flex: 1; min-width: 0; border: 1px solid var(--border-color); border-radius: 10px; padding: 10px 12px; font-size: 14px; font-family: inherit; outline: none; }

.cat-action-btn { 
    flex-shrink: 0; padding: 0 20px; border-radius: 10px; font-size: 14px; 
    border: none; cursor: pointer; font-family: inherit; font-weight: 600; 
    background: var(--accent-dark); color: #FFFFFF; 
}
.cat-cancel-btn { 
    flex-shrink: 0; padding: 0 20px; border-radius: 10px; font-size: 14px; 
    border: none; cursor: pointer; font-family: inherit; font-weight: 600; 
    background: #EBE7DF; color: var(--text-main); display: none;
}

#toast { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); background: rgba(62, 58, 54, 0.9); color: white; padding: 10px 20px; border-radius: 20px; font-size: 14px; z-index: 3000; opacity: 0; pointer-events: none; transition: opacity 0.3s; white-space: nowrap; }
#toast.show { opacity: 1; }

/* 新建盘面：推演方式下拉箭头 */
#bc-method {
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23999690' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 12px 8px;
    padding-right: 38px;
}

.bc-method-picker.show { z-index: 1120; }

/* 新建盘面：四柱公历/农历 */
.bc-birth-mode { display: flex; gap: 6px; margin-bottom: 10px; }
.bc-mode-btn {
    flex: 1; border: 1px solid var(--border-color); border-radius: 10px;
    background: #FFFFFF; color: var(--text-sub); font-family: inherit;
    font-size: 12px; padding: 7px 0; cursor: pointer;
}
.bc-mode-btn.active { background: var(--accent-dark); color: #FFFFFF; border-color: var(--accent-dark); }
.bc-lunar-selects { display: flex; gap: 6px; margin-bottom: 10px; }
.bc-lunar-selects .bc-lunar-select { flex: 1; min-width: 0; font-size: 11px; text-align: center; padding: 0 4px; }

/* 通用弹窗：记录日期支持公历/农历 */
.modal-date-mode { display: flex; gap: 6px; margin-bottom: 10px; }
.modal-date-mode-btn {
    flex: 1; border: 1px solid var(--border-color); border-radius: 10px;
    background: #FFFFFF; color: var(--text-sub); font-family: inherit;
    font-size: 12px; padding: 7px 0; cursor: pointer;
}
.modal-date-mode-btn.active { background: var(--accent-dark); color: #FFFFFF; border-color: var(--accent-dark); }
.modal-lunar-selects { display: flex; gap: 6px; margin-bottom: 10px; }
.modal-lunar-select {
    flex: 1; min-width: 0; border: 1px solid var(--border-color); border-radius: 10px;
    background: #FFFFFF; color: var(--text-main); font-family: inherit;
    font-size: 11px; padding: 9px 4px; text-align: center; outline: none;
}
