/* --- 1. 整体容器布局：卡片式设计 --- */
/* 限制最大宽度并居中，添加阴影让表单浮起，增加留白 */
.webform-submission-form {
    max-width: 800px; /* 限制宽度，防止在大屏上太宽难读 */
    margin: 40px auto;
    padding: 40px;
    background-color: #ffffff;
    border-radius: 12px; /* 圆角 */
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.08); /* 柔和的阴影 */
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* --- 2. 进度条 (Progress Tracker) 美化 --- */
.webform-progress {
    margin-bottom: 40px;
}

/* 调整进度文字 */
.webform-progress-tracker .progress-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #6c757d;
    margin-top: 10px;
}

/* --- 3. 字段集 (Fieldset) 与 标题 --- */
/* 移除默认边框，使用空白分隔 */
fieldset.webform-type-fieldset {
    border: none !important;
    padding: 0 !important;
    margin-bottom: 2rem !important;
    box-shadow: none !important;
}

/* 标题样式：左侧加竖线强调，显得专业 */
fieldset legend .fieldset-legend {
    font-size: 1.5rem;
    font-weight: 700;
    color: #111827;
    border-left: 5px solid #37b7ff; /* 蓝色竖条装饰 */
    padding-left: 15px;
    margin-bottom: 25px;
    display: inline-block;
    line-height: 1.2;
}

/* --- 4. 输入框与标签 (Form Controls) --- */
/* 标签样式 */
.webform-submission-form label {
    font-size: 1rem !important;
    font-weight: 600 !important;
    color: #374151 !important;
    margin-bottom: 8px !important;
    display: block !important;
    width: auto !important;
}

/* 输入框样式：加大高度，圆角，柔和边框 */
.form-control {
    height: auto;
    padding: 12px 16px;
    font-size: 1rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background-color: #f9fafb; /* 极淡的灰色背景 */
    transition: all 0.3s ease;
}

/* 文本域 (Textarea) 特殊处理 */
textarea.form-control {
    min-height: 160px; /* 给写作留出足够空间 */
    line-height: 1.6;
}

/* 输入框聚焦效果 */
.form-control:focus {
    background-color: #fff;
    border-color: #37b7ff;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
    outline: none;
}

/* --- 5. 描述文字 (Descriptions) --- */
/* 统一描述文字样式，放在输入框下方更清晰 */
.description, .webform-element-description {
    font-size: 0.875rem;
    color: #6b7280;
    margin-top: 8px;
    line-height: 1.5;
    background: transparent;
}

/* 针对字段集底部的描述文字（如“只为建立人...”） */
#edit-basic-information--description {
    background-color: #eff6ff; /* 淡蓝色背景 */
    color: #1e40af;
    padding: 10px 15px;
    border-radius: 6px;
    border-left: 4px solid #3b82f6;
    margin-top: 10px;
}

/* --- 6. 按钮 (Actions) --- */
.form-actions {
    margin-top: 40px;
    border-top: 1px solid #e5e7eb;
    padding-top: 20px;
    text-align: center; /* 按钮居右，或者居中看喜好 */
}

/* 下一步按钮美化 */
.webform-button--next, .form-submit {
    background-color: #37b7ff;
    color: white;
    font-weight: 600;
    padding: 12px 32px;
    border-radius: 50px; /* 胶囊型按钮 */
    border: none;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.2s;
    width: 100%; /* 移动端友好，宽按钮 */
}

@media (min-width: 600px) {
    .webform-button--next, .form-submit {
        width: auto; /* 桌面端自适应宽度 */
        min-width: 160px;
    }
}

.webform-button--next:hover, .form-submit:hover {
    background-color: #1d4ed8;
    transform: translateY(-1px); /* 轻微上浮 */
}

.webform-type-radios legend .fieldset-legend,
.webform-type-checkboxes legend .fieldset-legend {
    font-size: 1rem !important;  /* 强制恢复为普通字体大小 (16px) */
    font-weight: 600 !important; /* 保持加粗 */
    color: #374151;              /* 深灰色 */
    
    /* 去除之前给大标题添加的蓝色竖线装饰 */
    border-left: none !important; 
    padding-left: 0 !important;
    
    margin-bottom: 8px;
    display: inline-block; /* 确保必填星号能跟在文字后面 */
    line-height: 1.5;
}
/* --- 修复：Webform Buttons 模式的卡片样式 --- */

/* 1. 布局容器：应用 Grid 到最外层容器 */
.webform-options-display-buttons {
    display: grid;
    /* 自动适应宽度：手机一列，平板两列，桌面自动铺开 */
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 15px; /* 卡片间距 */
    width: 100%;
    margin-top: 10px;
}

/* 2. 处理多余的 Wrapper 层级 */
/* Drupal 额外生成的 wrapper 和 item div 需要设为 100% 宽高，
   否则卡片无法填满格子 */
.webform-options-display-buttons-wrapper,
.webform-options-display-buttons-wrapper .js-form-item {
    display: flex;
    width: 100%;
    height: 100%;
    margin: 0 !important; /* 去除 Bootstrap 可能带有的 margin */
    padding: 0 !important;
}

/* 3. 输入框 (Input) 处理 */
/* 虽然它有 visually-hidden 类，但我们要确保它不占位置且能被选中 */
.webform-options-display-buttons .form-check-input {
    position: absolute;
    opacity: 0;
    z-index: -1;
}

/* 4. 标签 (Label) 美化 -> 变成卡片 */
.webform-options-display-buttons .form-check-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    
    width: 100%; /* 撑满父容器 */
    min-height: 80px; /* 设定最小高度 */
    padding: 15px 10px;
    
    background-color: #fff;
    border: 2px solid #e5e7eb; /* 默认浅灰边框 */
    border-radius: 8px;
    
    color: #4b5563;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

/* 5. 悬停效果 (Hover) */
.webform-options-display-buttons .form-check-label:hover {
    background-color: #f9fafb;
    border-color: #9ca3af;
    transform: translateY(-2px); /* 轻微上浮 */
}

/* 6. 选中状态 (Checked) */
/* 核心选择器：当 input 被选中时，修改它紧邻的 label 样式 */
.webform-options-display-buttons .form-check-input:checked + .form-check-label {
    background-color: #eff6ff; /* 淡蓝色背景 */
    border-color: #37b7ff;     /* 亮蓝色边框 */
    color: #37b7ff;            /* 亮蓝色文字 */
    box-shadow: 0 4px 6px rgba(37, 99, 235, 0.15); /* 阴影 */
    font-weight: 700;
}
.form-actions .button{
    width: auto !important;
}