/* ============================================================
   1. DNN Data Grid Style (数据表格 - 保持不变)
   ============================================================ */
table.dnnGrid {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid #c9c9c9;
    background-color: #ffffff;
    font-family: "Segoe UI", Tahoma, Helvetica, Arial, sans-serif;
    font-size: 13px;
    margin-bottom: 20px;
    color: #333;
}

table.dnnGrid th,
table.dnnGrid tr.dnnGridHeader td,
table.dnnGrid tr.dnnGridHeader th {
    background: #f0f2f1; 
    background: linear-gradient(to bottom, #ffffff 0%, #f0f2f1 100%);
    border: 1px solid #c9c9c9;
    padding: 10px 12px;
    color: #333;
    font-weight: 700;
    text-align: left;
    text-shadow: 0 1px 0 #fff;
    vertical-align: middle;
}

table.dnnGrid tr td {
    border: 1px solid #c9c9c9;
    padding: 8px 10px;
    line-height: 1.4;
    vertical-align: middle;
}
table.dnnGrid tr td:last-child{
    width: 0;
}

table.dnnGrid tr.dnnGridAltItem td,
table.dnnGrid tr:nth-child(even) td {
    background-color: #f7f7f7;
}
table.dnnGrid tr.dnnGridItem td,
table.dnnGrid tr:nth-child(odd) td {
    background-color: #ffffff;
}

table.dnnGrid tr:hover td {
    background-color: #eef4fa !important;
    color: #000;
}

table.dnnGrid a.dnnSecondaryAction {
    display: inline-block;
    text-decoration: none;
    font-size: 12px;
    margin-right: 10px;
    cursor: pointer;
    font-weight: 600;
}
table.dnnGrid a[id*="btnEdit"] { color: #005a9c; }
table.dnnGrid a[id*="btnEdit"]:hover { text-decoration: underline; color: #003366; }
table.dnnGrid a[id*="btnDelete"] { color: #cc0000; }
table.dnnGrid a[id*="btnDelete"]:hover { text-decoration: underline; color: #990000; }


/* ============================================================
   2. DNN Form Style (表单风格 - 更窄的 Label)
   ============================================================ */

/* 表单行容器 */
.dnnFormItem {
    margin-bottom: 18px;
    overflow: visible;
    width: 100%;
    display: block;
    clear: both;
    position: relative; /* 确保子元素定位正确 */
}

/* 清除浮动 helper */
.dnnClear:after,
.dnnFormItem:after {
    content: ".";
    display: block;
    height: 0;
    clear: both;
    visibility: hidden;
}

/* === 1. Label 样式 (宽度调小) === */
.dnnFormItem > .dnnLabel {
    float: left;
    width: 18%; /* 【修改点】从 32% 减小到 18%，更紧凑 */
    min-width: 120px; /* 防止过窄换行 */
    padding-right: 15px;
    text-align: right;
    box-sizing: border-box;
    margin-top: 8px; /* 文字垂直对齐 */
}

.dnnFormItem > .dnnLabel > label {
    font-weight: 700;
    color: #333;
    font-size: 13px;
}

/* === 2. 通用输入控件 (右侧区域) === */
.dnnFormItem input[type="text"],
.dnnFormItem input[type="number"],
.dnnFormItem select {
    float: left;
    width: 50%; /* 稍微增加输入框宽度以利用多余空间 */
    max-width: 500px;
    padding: 8px;
    border: 1px solid #c9c9c9;
    background: #fff;
    border-radius: 3px;
    color: #333;
    font-family: inherit;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.1);
    transition: all 0.2s;
}

.dnnFormItem input:focus,
.dnnFormItem select:focus,
.dnnFormItem textarea:focus {
    border-color: #005a9c;
    box-shadow: 0 0 5px rgba(0, 90, 156, 0.3);
    outline: none;
}

/* === 3. 富文本编辑器 (CKEditor) 特殊处理 === */
/* 编辑器容器，需要浮动在 Label 右侧 */
.dnnFormItem .dnnTextEditor {
    float: left;
    width: 100%; /* 占据剩余宽度 (100% - 18% Label - 1% Gap) */
    box-sizing: border-box;
    margin-top: -25px;
}

/* 编辑器顶部选项栏 (Basic/Rich Radio) */
.dnnTextPanelView {
    padding-left: calc( 18% + 1% );
    margin-bottom: 10px;
    padding-bottom: 5px;
    border-bottom: 1px solid #eee;
    font-size: 12px;
    box-sizing: border-box;
}

/* 单选按钮组样式 */
.dnnTextPanelView input[type="radio"] + span.dnnRadiobutton {
    display: inline-block;
    vertical-align: middle;
    margin-right: 5px;
}

.dnnTextPanelView label.dnnBoxLabel {
    margin-right: 20px;
    vertical-align: middle;
    color: #555;
    cursor: pointer;
}

/* 隐藏编辑器内部那个多余的 "Editor:" Label，避免视觉混乱 */
.dnnTextPanelView > .dnnLabel {
    display: none !important; 
}

/* CKEditor 实体样式 */
.cke_chrome {
    border: 1px solid #c9c9c9 !important;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05) !important;
}

/* 底部 "Custom Editor Options" 链接 */
.dnnTextEditor p {
    text-align: left !important; /* 强制靠左对齐编辑器，而不是居中 */
    margin-top: 5px;
}
.dnnTextEditor a.CommandButton {
    color: #666;
    text-decoration: none;
    font-size: 11px;
    border-bottom: 1px dashed #999;
}
.dnnTextEditor a.CommandButton:hover {
    color: #005a9c;
    border-bottom-style: solid;
}
.dnnTextEditor textarea{
    max-width: 100%;
    box-sizing: border-box;
}


/* === 4. Locations 表格 (复选框组) === */
table.dnnLocationStates {
    float: left;
    width: calc( 100% - 18% - 15px - 1%); /* 与编辑器同宽 */
    border: none;
    background: none;
    margin: 0;
}
table.dnnLocationStates tr td {
    border: none !important;
    background: none !important;
    padding: 4px 15px 4px 0;
    white-space: nowrap;
}
table.dnnLocationStates label.dnnBoxLabel {
    margin-left: 5px;
    color: #444;
}


/* === 5. 提示信息与独立复选框 === */
/* 独立复选框 (Is Default) */
.dnnFormItem > input[type="checkbox"] + span.dnnCheckbox {
    float: left;
    margin-top: 8px;
}

/* 提示文字 (Info/Error) */
.dnnFormItem span.dnnFormInfo,
.dnnFormItem span.dnnFormMessage {
    display: block;
    clear: both;
    margin-left: 18%; /* 【关键】与 Label 宽度一致，保持对齐 */
    margin-top: 5px;
    padding: 8px;
    font-size: 12px;
    line-height: 1.4;
    border-radius: 3px;
    width: 50%;
    position: relative;
    left: 10px; /* 微调一点间距 */
}

.dnnFormItem span.dnnFormInfo {
    background-color: #eef4fa;
    color: #005a9c;
    border: 1px solid #bcdff1;
}

.dnnFormItem span.dnnFormError {
    background-color: #fdeeee;
    color: #cc0000;
    border: 1px solid #f7caca;
}

/* 图标垂直居中修正 */
.dnnCheckbox img, .dnnRadiobutton img {
    vertical-align: middle;
    margin-top: -2px;
}
