.ticket-item {
    background: #fff;
    padding: 20px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.ticket-item h3 {
    margin: 0 0 15px;
    font-size: 18px;
}

.ticket-item-info {
    color: #999;
    font-size: 14px;
    margin-bottom: 20px;
}

.ticket-item-content dl {
    display: flex;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.ticket-item-content dt {
    width: 50px;
    margin-right: 15px;
}

.ticket-item-content dd {
    flex: 1;
}

.ticket-item-reply {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 4px;
}

/* 其他样式... */

.er-gongdan-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    min-height: calc(100vh - 200px);
    position: relative;
    z-index: 1;
}

.er-gongdan-message {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 4px;
}

.er-gongdan-error {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.er-gongdan-success {
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.er-gongdan-form {
    background: #fff;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.er-gongdan-form h3 {
    margin: 0 0 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
    font-size: 20px;
    font-weight: 500;
}

.er-gongdan-form-group {
    margin-bottom: 20px;
}

.er-gongdan-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
}

.er-gongdan-form-group input[type="text"],
.er-gongdan-form-group input[type="email"],
.er-gongdan-form-group select,
.er-gongdan-form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    font-size: 14px;
}

.er-gongdan-form-group textarea {
    min-height: 150px;
    resize: vertical;
}

/* 文件上传样式 */
.er-gongdan-form-group input[type="file"] {
    display: block;
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    margin-bottom: 10px;
}

.er-gongdan-form-group .description {
    color: #666;
    font-size: 13px;
    margin-top: 5px;
}

/* 提交按钮组样式 */
.form-actions {
    margin-top: 30px;
}

.submit-group {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* 提交按钮样式 */
.er-gongdan-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 25px;
    background: #2271b1;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.3s ease;
    text-align: center;
    width: fit-content;
    min-width: 120px;
    height: 40px;
}

.er-gongdan-submit:hover {
    background: #135e96;
}

.er-gongdan-submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    background-color: #666;
}

/* 提交状态样式 */
.submitting-text {
    display: flex;
    align-items: center;
    gap: 5px;
}

.submitting-text .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    animation: spin 2s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 图床部分样式 */
.imghosting-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.imghosting-links {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.imghosting-link {
    display: inline-block;
    padding: 8px 16px;
    background: #f0f0f1;
    color: #2271b1;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.imghosting-link:hover {
    background: #e0e0e1;
    color: #135e96;
}

.imghosting-tip {
    color: #666;
    font-size: 13px;
    font-style: italic;
}

/* 文件预览样式 */
#file-preview {
    margin-top: 10px;
}

.file-item {
    display: flex;
    align-items: center;
    padding: 8px;
    background: #f8f9fa;
    border-radius: 4px;
    margin-bottom: 5px;
}

.file-item span {
    margin-left: 5px;
    color: #666;
    font-size: 13px;
}

/* 响应式调整 */
@media screen and (max-width: 768px) {
    .er-gongdan-container {
        padding: 15px;
    }
    
    .er-gongdan-form {
        padding: 15px;
    }
    
    .er-gongdan-submit {
        width: 100%;
    }
    
    .imghosting-links {
        flex-direction: column;
    }
    
    .imghosting-link {
        text-align: center;
    }
}

/* 用户中心工单样式 */
.user-tickets {
    min-height: calc(100vh - 200px);
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    margin-bottom: 30px;
    position: relative;
    z-index: 1;
}

.user-box-header {
    margin: 0 0 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.user-box-title {
    margin: 0;
    font-size: 18px;
    font-weight: 500;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.view-history-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 8px 16px;
    background: #f0f0f1;
    color: #2271b1;
    text-decoration: none;
    border-radius: 4px;
    font-size: 14px;
    transition: all 0.3s ease;
    margin-left: auto;
}

.view-history-btn:hover {
    background: #e0e0e1;
    color: #135e96;
    text-decoration: none;
}

.view-history-btn .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

/* 响应式调整 */
@media screen and (max-width: 768px) {
    .user-box-title {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
    
    .view-history-btn {
        margin-left: 0;
        width: 100%;
        justify-content: center;
    }
}

/* 工单列表样式 */
.ticket-item {
    background: #f8f9fa;
    padding: 15px;
    margin-bottom: 15px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.ticket-item:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.ticket-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.ticket-content {
    color: #666;
    margin-bottom: 10px;
    word-break: break-word;
}

.ticket-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #999;
    font-size: 13px;
}

/* 空状态样式 */
.ticket-empty {
    min-height: calc(100vh - 300px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 60px 20px;
    background: #fff;
    border-radius: 8px;
}

.ticket-empty .dashicons {
    font-size: 48px;
    width: 48px;
    height: 48px;
    color: #ccc;
    margin-bottom: 20px;
}

.ticket-empty-text {
    font-size: 18px;
    color: #444;
    margin-bottom: 10px;
}

.ticket-empty-description {
    color: #666;
    margin-bottom: 20px;
}

/* 添加新工单按钮 */
.add-new-btn {
    display: inline-block;
    padding: 8px 16px;
    background: #2271b1;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    transition: background 0.3s ease;
}

.add-new-btn:hover {
    background: #135e96;
    color: #fff;
    text-decoration: none;
}

/* 工单状态标签样式 */
.ticket-status {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
}

/* 待处理状态 - 橙色系 */
.ticket-status-0 {
    background-color: #fff3e0;
    color: #e65100;
    border: 1px solid #ffe0b2;
}

/* 处理中状态 - 蓝色系 */
.ticket-status-1 {
    background-color: #e3f2fd;
    color: #1565c0;
    border: 1px solid #bbdefb;
}

/* 已解决状态 - 绿色系 */
.ticket-status-2 {
    background-color: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #c8e6c9;
}

/* 已关闭状态 - 灰色系 */
.ticket-status-3 {
    background-color: #f5f5f5;
    color: #616161;
    border: 1px solid #e0e0e0;
}

/* 鼠标悬停效果 */
.ticket-status:hover {
    opacity: 0.9;
}

/* 移除之前的白色文字设置 */
.ticket-status span {
    color: inherit;
}

/* 工单详情弹窗 */
.modal {
    position: fixed;
    z-index: 999999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 20px;
    border-radius: 4px;
    width: 80%;
    max-width: 800px;
    position: relative;
}

.close {
    position: absolute;
    right: 20px;
    top: 15px;
    font-size: 28px;
    font-weight: bold;
    color: #666;
    cursor: pointer;
}

/* 提交状态样式 */
.ticket-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ticket-loading {
    background: #fff;
    padding: 20px 40px;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    font-size: 16px;
    color: #333;
}

button.submitting {
    opacity: 0.7;
    cursor: not-allowed;
}

button.submitting i {
    margin-right: 5px;
}

.history-header .user-box-title {
    margin-top: 20px;
}

/* 后台图床设置样式 */
.imghosting-site {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
    align-items: center;
}

.imghosting-site input {
    margin-right: 10px;
}

/* 加载动画 */
.dashicons.spin {
    animation: spin 2s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 工单列表容器 */
.ticket-list {
    min-height: calc(100vh - 300px);
    display: flex;
    flex-direction: column;
}

/* 工单表单头部样式 */
.er-gongdan-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.er-gongdan-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 500;
    color: #333;
}

.view-history-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 8px 16px;
    background: #f0f0f1;
    color: #2271b1;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.view-history-btn:hover {
    background: #e0e0e1;
    color: #135e96;
    text-decoration: none;
}

.view-history-btn .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

/* 响应式调整 */
@media screen and (max-width: 768px) {
    .er-gongdan-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
    
    .view-history-btn {
        width: 100%;
        justify-content: center;
    }
}

/* 回复表单样式 */
.ticket-reply-form {
    margin: 20px 0;
    padding: 20px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.ticket-reply-form .form-group {
    margin-bottom: 15px;
}

.ticket-reply-form textarea {
    width: 100%;
    min-height: 100px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.ticket-reply-form .form-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}

.ticket-reply-form .file-upload {
    position: relative;
    display: inline-block;
}

.ticket-reply-form input[type="file"] {
    display: none;
}

.ticket-reply-form .file-preview {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.ticket-reply-form .file-preview-item {
    position: relative;
    width: 80px;
    height: 80px;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
}

.ticket-reply-form .file-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ticket-reply-form .file-preview-item .remove {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 20px;
    height: 20px;
    line-height: 20px;
    text-align: center;
    background: rgba(0,0,0,0.5);
    color: #fff;
    border-radius: 50%;
    cursor: pointer;
}

/* 上传图片按钮样式 */
.ticket-reply-form .file-upload label.button {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 8px 16px;
    background: #f0f0f1;
    color: #2271b1;
    border: 1px solid #2271b1;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
}

.ticket-reply-form .file-upload label.button:hover {
    background: #2271b1;
    color: #fff;
}

.ticket-reply-form .file-upload label.button .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
    margin-right: 4px;
}

/* 图床链接按钮样式统一 */
.ticket-reply-form .imghosting-link {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    background: #f0f0f1;
    color: #2271b1;
    border: 1px solid #2271b1;
    border-radius: 4px;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s ease;
}

.ticket-reply-form .imghosting-link:hover {
    background: #2271b1;
    color: #fff;
    text-decoration: none;
}

/* 图床部分样式 */
.imghosting-section {
    margin: 10px 0;
}

.imghosting-links {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.imghosting-tip {
    margin-top: 5px;
    font-size: 12px;
    color: #666;
}

/* 工单聊天界面样式 */
.ticket-timeline {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin: 30px 0;
}

.timeline-item {
    display: flex;
    gap: 15px;
    max-width: 80%;
}

.timeline-avatar {
    flex-shrink: 0;
}

.timeline-avatar img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.timeline-content {
    flex: 1;
    padding: 15px;
    border-radius: 8px;
    position: relative;
}

/* 用户消息靠右 */
.user-item {
    flex-direction: row-reverse;
    align-self: flex-end;
}

.user-item .timeline-content {
    background: #e3f2fd;
    color: #1565c0;
}

/* 管理员消息靠左 */
.admin-item {
    align-self: flex-start;
}

.admin-item .timeline-content {
    background: #f5f5f5;
    color: #333;
}

/* 消息头部 */
.timeline-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 0.9em;
}

.timeline-author {
    font-weight: 500;
}

.timeline-time {
    color: #666;
}

/* 消息内容 */
.timeline-body {
    line-height: 1.5;
}

.timeline-body p:last-child {
    margin-bottom: 0;
}

/* 图片附件 */
.reply-images {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.image-item {
    width: 100px;
    height: 100px;
    border-radius: 4px;
    overflow: hidden;
}

.image-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 回复表单 */
.ticket-reply {
    margin-top: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.form-group textarea {
    width: 100%;
    min-height: 100px;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    resize: vertical;
}

.form-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 15px;
}

/* 响应式调整 */
@media screen and (max-width: 768px) {
    .timeline-item {
        max-width: 100%;
    }
}

/* 文件上传和预览样式 */
.file-upload-section {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

/* 隐藏原生文件输入框但保持可访问性 */
.file-input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.upload-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 8px 16px;
    background: #2271b1;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.upload-btn:hover {
    background: #135e96;
}

.upload-btn .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

.upload-status {
    display: inline-flex;
    align-items: center;
    margin-left: 10px;
}

.upload-info-box {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    background: #f0f6fc;
    border: 1px solid #c6d8e4;
    border-radius: 4px;
    color: #2271b1;
    font-size: 13px;
}

.upload-info-box .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    margin-right: 5px;
}

/* 文件预览样式 */
.file-preview {
    margin-top: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.file-preview-item {
    display: flex;
    align-items: center;
    padding: 8px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    gap: 10px;
}

.file-preview-item img {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 4px;
}

.file-info {
    flex: 1;
    overflow: hidden;
}

.file-name {
    display: block;
    font-size: 13px;
    color: #333;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-preview-item .remove {
    width: 24px;
    height: 24px;
    line-height: 24px;
    text-align: center;
    background: #f5f5f5;
    color: #666;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
}

.file-preview-item .remove:hover {
    background: #e0e0e0;
    color: #333;
} 