/* ==========================================================================
   刘氏家谱 — CRUD 弹窗与操作按钮样式
   ==========================================================================
   毛玻璃风格的模态弹窗，用于成员/配偶的增删改查操作。
   ========================================================================== */

/* --------------------------------------------------------------------------
   弹窗遮罩层
   -------------------------------------------------------------------------- */
#crud-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);           /* 高斯模糊背景，突出弹窗内容 */
    -webkit-backdrop-filter: blur(4px);
    z-index: 1000;                        /* 确保覆盖所有其他 UI 元素 */
    display: none;                        /* 默认隐藏，通过 .open 类显示 */
    justify-content: center;
    align-items: center;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

#crud-modal.open {
    display: flex;                        /* 显示弹窗 */
}

/* --------------------------------------------------------------------------
   弹窗内容容器
   -------------------------------------------------------------------------- */
.crud-content {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;                     /* 高度限制，超出可滚动 */
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 16px 48px rgba(0,0,0,0.2);
    overflow: hidden;
}

/* --------------------------------------------------------------------------
   头部
   -------------------------------------------------------------------------- */
.crud-header {
    padding: 20px;
    border-bottom: 1px solid rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.crud-header h2 {
    margin: 0;
    color: #8a1d1d;                       /* 朱红色标题 */
    font-size: 20px;
}

.crud-close {
    cursor: pointer;
    font-size: 24px;
    color: #999;
}

/* --------------------------------------------------------------------------
   正文（表单区域，可滚动）
   -------------------------------------------------------------------------- */
.crud-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

/* --------------------------------------------------------------------------
   底部（操作按钮）
   -------------------------------------------------------------------------- */
.crud-footer {
    padding: 15px 20px;
    border-top: 1px solid rgba(0,0,0,0.1);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* --------------------------------------------------------------------------
   表单组
   -------------------------------------------------------------------------- */
.crud-form-group {
    margin-bottom: 15px;
}

.crud-form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #444;
    font-size: 14px;
}

.crud-form-group input[type="text"],
.crud-form-group input[type="number"],
.crud-form-group select,
.crud-form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    box-sizing: border-box;
    font-size: 14px;
    background: rgba(255,255,255,0.8);
}

.crud-form-group textarea {
    height: 100px;
    resize: vertical;
}

/* --------------------------------------------------------------------------
   通用按钮
   -------------------------------------------------------------------------- */
.btn-primary {
    background: #8a1d1d;
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
}

.btn-secondary {
    background: #eee;
    color: #333;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
}

/* --------------------------------------------------------------------------
   抽屉底部的 CRUD 操作按钮条
   -------------------------------------------------------------------------- */
.crud-buttons-bar {
    display: contents;
}

.crud-action-btn {
    flex: 1;
    min-width: 80px;
    height: 36px;
    border-radius: 6px;
    border: 1px solid #8a1d1d;           /* 朱红边框 */
    background: rgba(138, 29, 29, 0.05);  /* 极淡朱红底色 */
    color: #8a1d1d;
    cursor: pointer;
    font-size: 13px;
    font-weight: bold;
    transition: background 0.2s;
}

.crud-action-btn:hover {
    background: rgba(138, 29, 29, 0.1);
}

/* 删除按钮使用红色系，与普通操作按钮区分 */
.crud-action-btn.delete {
    border-color: #d9363e;
    color: #d9363e;
    background: rgba(217, 54, 62, 0.05);
}

.crud-action-btn.delete:hover {
    background: rgba(217, 54, 62, 0.1);
}

/* --------------------------------------------------------------------------
   分配权限模式的上方横幅
   -------------------------------------------------------------------------- */
.editor-mode-banner {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: rgba(138, 29, 29, 0.95);
    color: white;
    text-align: center;
    padding: 12px;
    font-size: 16px;
    font-weight: bold;
    z-index: 9999;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    display: none;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.editor-mode-banner.open {
    display: flex;
}

.btn-cancel-banner {
    background: white;
    color: #8a1d1d;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
}

/* 一键复制相关的输入框 */
.token-input-wrapper {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}
.token-input-wrapper input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    background: #f5f5f5;
    font-family: monospace;
}
.token-input-wrapper button {
    background: #8a1d1d;
    color: white;
    border: none;
    padding: 0 15px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
}

