/**
 * PHP轻论坛 v3.0 样式表
 */

/* 全局样式重置 */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

/* 基本table样式 */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 10px 0;
}

table, th, td {
    border: 1px solid #000;
}

th, td {
    padding: 8px;
    text-align: left;
}


/* 图片和视频自适应 */
img {
    max-width: 100%;
    height: auto;
    display: inline-block;
    vertical-align: middle;
}

/* 强力图片居中样式 - 使用!important确保优先级 */

/* 当父元素有text-align: center时，图片应该居中 */
[style*="text-align: center"] img,
[style*="text-align:center"] img {
    display: inline-block !important;
}

/* 当图片自身有居中样式时 */
img[style*="display: block"],
img[style*="display:block"],
img[style*="margin: 0 auto"],
img[style*="margin:0 auto"] {
    display: block !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

/* 确保div内的图片也能正确响应居中 */
div > img {
    display: inline-block;
}

/* 图片居中容器 - 用于包裹需要居中的图片 */
.img-center-wrapper {
    text-align: center !important;
    display: block;
    width: 100%;
}

.img-center-wrapper img {
    display: inline-block !important;
}

/* 主题页和回复内容中的图片居中 - 针对实际HTML结构 */
table td div[style*="text-align: center"],
table td div[style*="text-align:center"] {
    text-align: center !important;
}

table td div[style*="text-align: center"] img,
table td div[style*="text-align:center"] img {
    display: inline-block !important;
}

/* 确保所有div内的图片居中都能生效 */
div[style*="text-align: center"],
div[style*="text-align:center"] {
    text-align: center !important;
}

div[style*="text-align: center"] img,
div[style*="text-align:center"] img {
    display: inline-block !important;
}

/* 终极图片居中方案 - 使用属性选择器匹配所有可能的情况 */
*[style*="text-align: center"] img,
*[style*="text-align:center"] img {
    display: inline-block !important;
    vertical-align: middle !important;
}

/* 强制图片居中 - 最高优先级 */
img.centered,
.centered img {
    display: block !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

/* 直接针对ICE编辑器生成的结构 */
[style^="text-align"] img {
    display: inline-block !important;
}

/* 最高优先级 - 直接针对div内的img */
table tr td div[style*="text-align: center"] > img,
table tr td div[style*="text-align:center"] > img,
table tr td div > img {
    display: inline-block !important;
}

/* 通用居中容器样式 */
[style*="text-align: center"],
[style*="text-align:center"] {
    text-align: center !important;
}

/* 通用右对齐 */
[style*="text-align: right"],
[style*="text-align:right"] {
    text-align: right !important;
}

/* 通用左对齐 */
[style*="text-align: left"],
[style*="text-align:left"] {
    text-align: left !important;
}

/* 视频和iframe自适应 - 排除ICE编辑器 */
video,
iframe:not([id^="_iframe"]) {
    max-width: 100%;
    height: auto;
    display: block;
}



/* 视频容器响应式处理 */
.video-container {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 比例 */
    height: 0;
    overflow: hidden;
    max-width: 100%;
}

.video-container iframe,
.video-container video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* 响应式表格处理 */
@media screen and (max-width: 768px) {
    /* 小屏幕设备上的表格适配 */
    table {
        font-size: 14px;
    }
    
    th, td {
        padding: 6px;
    }
    
    /* 侧边栏适配 */
    table[border="1"] > tbody > tr > td:first-child {
        width: 150px;
    }
    
    /* 输入框和按钮适配 */
    input, select, textarea, button {
        width: 100%;
        padding: 8px;
        margin: 4px 0;
    }
    
    /* 标题大小适配 */
    h1 {
        font-size: 20px;
    }
    
    h2 {
        font-size: 18px;
    }
    
    h3, h4, h5 {
        font-size: 16px;
    }
}

@media screen and (max-width: 480px) {
    /* 超小屏幕设备上的适配 */
    table {
        font-size: 12px;
    }
    
    th, td {
        padding: 4px;
    }
    
    /* 侧边栏适配 */
    table[border="1"] > tbody > tr > td:first-child {
        width: 120px;
    }
    
    /* 标题大小适配 */
    h1 {
        font-size: 18px;
    }
    
    h2 {
        font-size: 16px;
    }
    
    h3, h4, h5 {
        font-size: 14px;
    }
}

/* 排版优化 */
a {
    color: #0066cc;
    text-decoration: none;
}

/* 去掉悬停效果 */
a:hover {
    text-decoration: none;
    color: #0066cc;
}

/* 表单元素样式 */
input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
input[type="date"],
select,
textarea {
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 8px;
    font-size: 14px;
}

button {
    background-color: #f0f0f0;
    color: #333;
    border: 1px solid #ddd;
    padding: 6px 12px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    font-size: 14px;
    margin: 2px 1px;
    cursor: pointer;
    border-radius: 2px;
}

button:hover {
    background-color: #e0e0e0;
}

/* 内容区域容器 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 10px;
}

/* 响应式布局容器 */
@media screen and (max-width: 768px) {
    .container {
        padding: 5px;
    }
}

/* 表格内容溢出处理 */
td {
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* 禁用引用内容的悬停效果 */
.quote-table, .quote-table tr, .quote-table td {
    transition: none !important;
}

.quote-table tr:hover, .quote-table td:hover {
    background-color: inherit !important;
}

/* 错误和成功消息样式 */
.error {
    color: #d32f2f !important;
    font-weight: bold !important;
    background-color: #ffebee !important;
    padding: 10px !important;
    border-radius: 4px !important;
    margin: 10px 0 !important;
    border-left: 4px solid #d32f2f !important;
}

.success {
    color: #2e7d32 !important;
    font-weight: bold !important;
    background-color: #e8f5e8 !important;
    padding: 10px !important;
    border-radius: 4px !important;
    margin: 10px 0 !important;
    border-left: 4px solid #2e7d32 !important;
}

.warning {
    color: #f57c00 !important;
    font-weight: bold !important;
    background-color: #fff3e0 !important;
    padding: 10px !important;
    border-radius: 4px !important;
    margin: 10px 0 !important;
    border-left: 4px solid #f57c00 !important;
}

.info {
    color: #1565c0 !important;
    font-weight: bold !important;
    background-color: #e3f2fd !important;
    padding: 10px !important;
    border-radius: 4px !important;
    margin: 10px 0 !important;
    border-left: 4px solid #1565c0 !important;
}

/* 表格中的提示信息 */
table td.error,
table td.success,
table td.warning,
table td.info {
    color: inherit !important;
    font-weight: inherit !important;
    background-color: inherit !important;
    padding: 10px !important;
    border-radius: 4px !important;
    margin: 10px 0 !important;
    border-left: 4px solid transparent !important;
}

table td.error {
    color: #d32f2f !important;
    background-color: #ffebee !important;
    border-left-color: #d32f2f !important;
}

table td.success {
    color: #2e7d32 !important;
    background-color: #e8f5e8 !important;
    border-left-color: #2e7d32 !important;
}

table td.warning {
    color: #f57c00 !important;
    background-color: #fff3e0 !important;
    border-left-color: #f57c00 !important;
}

table td.info {
    color: #1565c0 !important;
    background-color: #e3f2fd !important;
    border-left-color: #1565c0 !important;
}

/* 内联提示信息 */
.error-inline {
    color: #d32f2f;
    font-weight: bold;
}

.success-inline {
    color: #2e7d32;
    font-weight: bold;
}

.warning-inline {
    color: #f57c00;
    font-weight: bold;
}

.info-inline {
    color: #1565c0;
    font-weight: bold;
}

/* ICE编辑器样式 */
.iceEditor {
    position: relative;
    width: 100%;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
}

.iceEditor iframe {
    display: block;
    border: none;
    width: 100%;
}

.iceEditor-tool {
    background-color: #f5f5f5;
    border-bottom: 1px solid #ddd;
    padding: 5px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
}

.iceEditor-tool li {
    list-style: none;
    display: inline-block;
    margin: 0 2px;
    position: relative;
}

.iceEditor-exec {
    display: inline-block;
    width: 28px;
    height: 28px;
    line-height: 28px;
    text-align: center;
    cursor: pointer;
    border-radius: 2px;
}

.iceEditor-exec:hover {
    background-color: #e0e0e0;
}

.iceEditor-actives {
    background-color: #d0e5f5;
}

/* ICE编辑器下拉菜单样式由内联CSS控制，不要在这里覆盖 */

/* 弹窗样式 */
.iceEditor-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    display: none;
    z-index: 2000;
}

.iceEditor-popupBox {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.iceEditor-popupMain {
    position: absolute;
    background-color: white;
    border-radius: 4px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    overflow: hidden;
}

.iceEditor-popupTitle {
    background-color: #f5f5f5;
    border-bottom: 1px solid #ddd;
    padding: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.iceEditor-popupTitle span:first-child {
    font-weight: bold;
}

.iceEditor-popupClose {
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
}

.iceEditor-popupContent {
    padding: 15px;
}

/* 上传按钮样式 */
.iceEditor-uploadBtn {
    display: inline-block;
    padding: 6px 12px;
    background-color: #f0f0f0;
    color: #333;
    border: 1px solid #ddd;
    border-radius: 2px;
    cursor: pointer;
    margin-top: 10px;
}

.iceEditor-uploadBtn:hover {
    background-color: #e0e0e0;
}

.iceEditor-uploadInput {
    display: none;
}

/* 响应式适配 */
@media screen and (max-width: 768px) {
    .iceEditor-popupMain {
        width: 90% !important;
        max-width: 400px;
        left: 5% !important;
    }
    
    .iceEditor-tool {
        padding: 3px;
    }
    
    .iceEditor-exec {
        width: 24px;
        height: 24px;
        line-height: 24px;
    }
    
    .iceEditor-popupContent {
        padding: 10px;
    }
}

@media screen and (max-width: 480px) {
    .iceEditor-popupMain {
        width: 95% !important;
        left: 2.5% !important;
    }
    
    .iceEditor-tool {
        padding: 2px;
    }
    
    .iceEditor-exec {
        width: 20px;
        height: 20px;
        line-height: 20px;
        font-size: 12px;
    }
}

