/*
 * 语工单Pro - 前端样式
 * 
 * @package YugongdanPro
 * @version 1.0.0
 */

/* 用户中心工单图标样式 */
.yugongdan-icon {
    display: inline-block;
    vertical-align: middle;
}

/* 工单图标包裹容器 */
.yugongdan-icon-wrapper {
    display: inline-block !important;
    vertical-align: middle !important;
    line-height: 1 !important;
}

/* 图标容器内部元素大小控制 */
.yugongdan-icon-wrapper img,
.yugongdan-icon-wrapper svg {
    width: 1em !important;
    height: 1em !important;
    display: inline-block;
    vertical-align: middle;
}

.yugongdan-icon-wrapper i {
    font-size: inherit !important;
}

/* 确保子比SVG图标响应大小 */
.yugongdan-icon-wrapper .icon {
    width: 1em !important;
    height: 1em !important;
}

/* 工单按钮样式 */
.yugongdan-pro-button {
    transition: all 0.3s ease;
}

.yugongdan-pro-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* 工单计数样式 */
.yugongdan-workorder-page .title-h-left + .muted-2-color .c-blue {
    font-weight: 600;
}

/* 工单搜索框样式 */
.yugongdan-search-container {
    margin-bottom: 20px;
}

.yugongdan-search-container .flex {
    display: flex;
    align-items: center;
    justify-content: flex-start; /* 靠左对齐 */
}

.yugongdan-search-container .flex.jsb {
    justify-content: space-between; /* 两端对齐 */
}

.yugongdan-search-container .line-form {
    margin-bottom: 0;
    width: 300px; /* 固定宽度，不要太长 */
}

.yugongdan-search-container .line-form-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid transparent;
    border-bottom: 1px solid var(--muted-border-color);
    border-radius: 0;
    background: transparent;
    color: var(--text-color);
    font-size: 14px;
    transition: all 0.3s ease;
}

.yugongdan-search-container .line-form-input:focus {
    outline: none;
    border-bottom-color: var(--focus-color);
    background: transparent;
}

.yugongdan-search-container .line-form-input::placeholder {
    color: var(--muted-3-color);
}

.yugongdan-search-container .line-form-line {
    display: block;
    height: 2px;
    background: var(--focus-color);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.yugongdan-search-container .line-form-input:focus ~ .line-form-line {
    transform: scaleX(1);
}

.yugongdan-search-btn {
    padding: 8px 16px;
    white-space: nowrap;
    margin-left: 10px;
}

.yugongdan-clear-search {
    padding: 8px 16px;
    white-space: nowrap;
    margin-left: 6px;
}

/* 状态筛选按钮样式 */
.yugongdan-status-filter {
    gap: 6px;
}

.yugongdan-status-filter-btn {
    padding: 6px 14px;
    border: 1px solid var(--muted-border-color);
    background: var(--body-bg-color);
    color: var(--main-color);
    transition: all 0.3s ease;
    cursor: pointer;
    white-space: nowrap;
}

.yugongdan-status-filter-btn:hover {
    border-color: var(--focus-color);
    color: var(--focus-color);
}

.yugongdan-status-filter-btn.active {
    background: var(--focus-color);
    color: #fff !important;
    border-color: var(--focus-color);
}

/* 状态筛选按钮 - 带颜色标识 */
.yugongdan-status-filter-btn.status-submitted.active {
    background: linear-gradient(135deg, #4A90E2 0%, #2E5BBA 100%);
    border-color: #4A90E2;
    color: #fff !important;
}

.yugongdan-status-filter-btn.status-processing.active {
    background: linear-gradient(135deg, #FF9500 0%, #FF6B35 100%);
    border-color: #FF9500;
    color: #fff !important;
}

.yugongdan-status-filter-btn.status-completed.active {
    background: linear-gradient(135deg, #7ED321 0%, #56C596 100%);
    border-color: #7ED321;
    color: #fff !important;
}

.yugongdan-status-filter-btn.status-closed.active {
    background: linear-gradient(135deg, #FF6B9D 0%, #E91E63 100%);
    border-color: #FF6B9D;
    color: #fff !important;
}

/* 工单列表容器 */
.yugongdan-list-container {
    min-height: 200px;
    margin-top: 10px;
}

.yugongdan-list-container .table-responsive {
    margin-top: 10px;
}

/* PC端显示表格，隐藏卡片 */
.yugongdan-table-view {
    display: block;
}

.yugongdan-card-view {
    display: none;
}

/* 卡片视图样式 */
.yugongdan-card {
    position: relative;
    background: var(--body-bg-color);
    border: 1px solid var(--muted-border-color);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 12px;
    transition: all 0.3s ease;
    overflow: visible; /* 确保下拉框能显示 */
    z-index: 1;
}

.yugongdan-card:hover {
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    border-color: var(--main-color);
}

/* 手机端卡片背景和阴影 - 适配日间和暗黑模式 */
@media (max-width: 768px) {
    /* 日间模式 */
    .yugongdan-card {
        background: #ffffff !important;
        box-shadow: 0 1px 3px rgba(0,0,0,0.08) !important;
        border: 1px solid rgba(0,0,0,0.06) !important;
    }
    
    .yugongdan-card:hover {
        box-shadow: 0 2px 8px rgba(0,0,0,0.12) !important;
    }
    
    /* 暗黑模式 - 使用浅灰色背景 */
    body.dark-theme .yugongdan-card,
    body[data-theme="dark"] .yugongdan-card,
    .dark .yugongdan-card {
        background: #3e3e3e !important;
        box-shadow: 0 1px 3px rgba(0,0,0,0.2) !important;
        border: 1px solid rgba(255,255,255,0.1) !important;
    }
    
    body.dark-theme .yugongdan-card:hover,
    body[data-theme="dark"] .yugongdan-card:hover,
    .dark .yugongdan-card:hover {
        box-shadow: 0 2px 8px rgba(0,0,0,0.3) !important;
        border: 1px solid rgba(255,255,255,0.15) !important;
    }
}

/* 当卡片内有下拉框打开时，提升该卡片的z-index */
.yugongdan-card:has(.yugongdan-status-select.show) {
    z-index: 100 !important;
}

/* 移动端卡片视图完全去除所有聚焦效果 */
@media (max-width: 768px) {
    /* 去除卡片本身的所有可能的聚焦效果 */
    .yugongdan-card,
    .yugongdan-card:hover,
    .yugongdan-card:focus,
    .yugongdan-card:active,
    .yugongdan-card:focus-visible,
    .yugongdan-card:focus-within {
        outline: 0 !important;
        outline-width: 0 !important;
        outline-style: none !important;
        outline-color: transparent !important;
        -webkit-tap-highlight-color: transparent !important;
        -webkit-touch-callout: none !important;
        -webkit-user-select: none !important;
        -moz-user-select: none !important;
        -ms-user-select: none !important;
        user-select: none !important;
    }
    
    /* 覆盖卡片的box-shadow，确保点击时不变化 */
    .yugongdan-card:active {
        box-shadow: 0 1px 3px rgba(0,0,0,0.08) !important;
        border: 1px solid rgba(0,0,0,0.06) !important;
    }
    
    /* 去除卡片内所有元素的聚焦效果 */
    .yugongdan-card *,
    .yugongdan-card *:hover,
    .yugongdan-card *:focus,
    .yugongdan-card *:active,
    .yugongdan-card *:focus-visible {
        outline: 0 !important;
        outline-width: 0 !important;
        outline-style: none !important;
        outline-color: transparent !important;
        -webkit-tap-highlight-color: transparent !important;
    }
    
    /* 去除所有按钮的聚焦效果 */
    .yugongdan-card .but,
    .yugongdan-card .but:hover,
    .yugongdan-card .but:focus,
    .yugongdan-card .but:active,
    .yugongdan-card .but:focus-visible,
    .yugongdan-card button,
    .yugongdan-card button:hover,
    .yugongdan-card button:focus,
    .yugongdan-card button:active,
    .yugongdan-card button:focus-visible,
    .yugongdan-card a,
    .yugongdan-card a:hover,
    .yugongdan-card a:focus,
    .yugongdan-card a:active,
    .yugongdan-card a:focus-visible {
        outline: 0 !important;
        outline-width: 0 !important;
        outline-style: none !important;
        -webkit-tap-highlight-color: transparent !important;
        -webkit-user-select: none !important;
        user-select: none !important;
    }
    
    /* 去除更新状态按钮的聚焦效果 */
    .yugongdan-update-status-btn,
    .yugongdan-update-status-btn:hover,
    .yugongdan-update-status-btn:focus,
    .yugongdan-update-status-btn:active,
    .yugongdan-update-status-btn:focus-visible {
        outline: 0 !important;
        outline-width: 0 !important;
        -webkit-tap-highlight-color: transparent !important;
    }
    
    /* 轻微的按压反馈，但不要聚焦框 */
    .yugongdan-card .but:active,
    .yugongdan-card button:active {
        opacity: 0.8;
        transition: opacity 0.1s ease;
    }
    
    /* 禁用卡片视图容器的用户选择 */
    .yugongdan-card-view {
        -webkit-user-select: none !important;
        -moz-user-select: none !important;
        -ms-user-select: none !important;
        user-select: none !important;
    }
    
    /* 允许卡片内文本可选择，但不显示选择框 */
    .yugongdan-card-title,
    .yugongdan-card-user,
    .yugongdan-card-time {
        -webkit-user-select: text !important;
        -moz-user-select: text !important;
        -ms-user-select: text !important;
        user-select: text !important;
    }
}

/* PC端保持正常的聚焦效果 */
@media (min-width: 769px) {
    .yugongdan-card .but:focus,
    .yugongdan-card button:focus,
    .yugongdan-card a:focus {
        outline: none !important;
        box-shadow: 0 0 0 2px var(--main-color) !important;
        border-color: var(--main-color) !important;
    }
}

/* 卡片头部 - 仅用户名 */
.yugongdan-card-header {
    margin-bottom: 10px;
}

.yugongdan-card-user {
    display: flex;
    align-items: center;
    font-size: 14px;
    color: var(--text-color);
}

.yugongdan-card-user i {
    font-size: 18px;
}

/* 卡片按钮组 - 独立容器，右上角绝对定位 */
.yugongdan-card-actions {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    z-index: 10;
}

.yugongdan-card-actions .but {
    padding: 5px 12px;
    font-size: 12px;
    white-space: nowrap;
}

.yugongdan-card-actions .yugongdan-status-update-container {
    position: relative;
    z-index: 20;
}

/* 卡片标题区域 */
.yugongdan-card-title {
    margin-bottom: 12px;
}

.yugongdan-card-title h4 {
    margin: 0;
    font-size: 15px;
    color: var(--main-color);
    font-weight: 500;
    line-height: 1.4;
    word-wrap: break-word;
    word-break: break-word;
}

/* 卡片头像样式 */
.yugongdan-card-user .avatar-img {
    display: inline-block;
    width: 24px !important;
    height: 24px !important;
    border-radius: 50%;
    vertical-align: middle;
    overflow: hidden;
    flex-shrink: 0;
}

.yugongdan-card-user .avatar-img img {
    width: 24px !important;
    height: 24px !important;
    border-radius: 50%;
    display: block;
}

/* 卡片标签组 */
.yugongdan-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.yugongdan-card-tag {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
}

.yugongdan-card-tag.tag-number {
    background: #f2d7d2;
    color: #8b4513;
}

.yugongdan-card-tag.tag-category {
    background: rgba(46, 204, 113, 0.1);
    color: #27ae60;
}

/* 工单状态标签样式 - 统一标签风格，使用渐变色 */
.yugongdan-card-tag.tag-status {
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    color: white;
}

.yugongdan-card-tag.tag-status.status-submitted {
    background: linear-gradient(135deg, #4A90E2 0%, #2E5BBA 100%);
}

.yugongdan-card-tag.tag-status.status-processing {
    background: linear-gradient(135deg, #FF9500 0%, #FF6B35 100%);
}

.yugongdan-card-tag.tag-status.status-completed {
    background: linear-gradient(135deg, #7ED321 0%, #56C596 100%);
}

.yugongdan-card-tag.tag-status.status-closed {
    background: linear-gradient(135deg, #FF6B9D 0%, #E91E63 100%);
}

.yugongdan-card-tag code {
    background: none;
    padding: 0;
    font-size: 12px;
}

/* 卡片底部 - 时间 */
.yugongdan-card-footer {
    border-top: 1px solid var(--muted-border-color);
    padding-top: 10px;
    margin-top: 12px;
}

.yugongdan-card-time {
    font-size: 12px;
    color: var(--muted-2-color);
}

/* 暗黑模式适配 */
.dark-theme .yugongdan-card {
    background: var(--main-bg-color);
    border-color: var(--main-border-color);
}

.dark-theme .yugongdan-card:hover {
    box-shadow: 0 2px 12px rgba(0,0,0,0.3);
}

.dark-theme .yugongdan-card-footer {
    border-top-color: var(--main-border-color);
}

/* 暗黑模式适配 */
.dark-theme .yugongdan-search-container .line-form-input {
    background: transparent;
    color: var(--text-color);
    border-bottom-color: var(--muted-border-color);
}

.dark-theme .yugongdan-search-container .line-form-input:focus {
    border-bottom-color: var(--focus-color);
    background: transparent;
}

.dark-theme .yugongdan-status-filter-btn {
    background: var(--main-bg-color);
    border-color: rgba(255, 255, 255, 0.1);
    color: var(--text-color);
}

.dark-theme .yugongdan-status-filter-btn:hover {
    border-color: var(--focus-color);
}

.dark-theme .yugongdan-status-filter-btn.active {
    color: #fff !important;
}

/* 响应式设计 */
@media (max-width: 768px) {
    /* 手机端隐藏表格，显示卡片 */
    .yugongdan-table-view {
        display: none !important;
    }
    
    .yugongdan-card-view {
        display: block !important;
    }
    
    .yugongdan-search-container .flex.jsb {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .yugongdan-search-container .line-form {
        width: 200px; /* 手机端更短 */
    }
    
    .yugongdan-search-container .line-form-input {
        padding: 6px 10px;
        font-size: 13px;
    }
    
    .yugongdan-search-btn,
    .yugongdan-clear-search {
        padding: 6px 12px;
        font-size: 13px;
    }
    
    .yugongdan-search-btn .hide-sm,
    .yugongdan-clear-search .hide-sm {
        display: none;
    }
    
    .yugongdan-status-filter {
        width: 100%;
        justify-content: center; /* 居中显示 */
        flex-wrap: wrap;
        gap: 6px;
    }
    
    .yugongdan-status-filter-btn {
        padding: 5px 10px;
        font-size: 11px;
        white-space: nowrap;
    }
    
    /* 手机端显示完整文字，隐藏单字 */
    .yugongdan-status-filter-btn .show-sm {
        display: none !important;
    }
    
    .yugongdan-status-filter-btn .hide-sm {
        display: inline !important;
    }
    
    /* 手机端卡片样式优化 */
    .yugongdan-card {
        padding: 12px;
        margin-bottom: 10px;
        border-radius: 6px;
    }
    
    .yugongdan-card-header {
        margin-bottom: 10px;
    }
    
    .yugongdan-card-user {
        font-size: 13px;
    }
    
    .yugongdan-card-user i {
        font-size: 16px;
    }
    
    .yugongdan-card-title {
        margin-bottom: 10px;
    }
    
    .yugongdan-card-title h4 {
        font-size: 14px !important;
        display: block !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
        max-width: calc(100% - 120px) !important;
        word-break: normal !important;
        line-height: 1.4 !important;
        height: 1.4em !important;
    }
    
    .yugongdan-card-tags {
        gap: 5px;
        margin-bottom: 10px;
    }
    
    .yugongdan-card-tag {
        padding: 2px 6px;
        font-size: 10px;
    }
    
    .yugongdan-card-tag code {
        font-size: 10px;
    }
    
    .yugongdan-card-tag.tag-status {
        padding: 2px 6px;
        font-size: 10px;
    }
    
    .yugongdan-card-footer {
        padding-top: 6px;
        margin-top: 8px;
    }
    
    .yugongdan-card-time {
        font-size: 11px;
        margin-top: 0;
    }
    
    /* 手机端卡片按钮组 */
    .yugongdan-card-actions .but {
        padding: 4px 10px !important;
        font-size: 11px !important;
    }
}

/* 工单列表样式 */
.yugongdan-pro-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.yugongdan-pro-item {
    padding: 15px;
    margin-bottom: 10px;
    border: 1px solid var(--muted-border-color);
    border-radius: 8px;
    background: var(--body-bg-color);
    transition: all 0.3s ease;
}

.yugongdan-pro-item:hover {
    border-color: var(--main-color);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}


/* 工单状态标签 */
.yugongdan-status {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
}

.yugongdan-status.pending {
    background-color: #ffeaa7;
    color: #fdcb6e;
}

.yugongdan-status.processing {
    background-color: #74b9ff;
    color: #0984e3;
}

.yugongdan-status.resolved {
    background-color: #00b894;
    color: #00cec9;
}

.yugongdan-status.closed {
    background-color: #636e72;
    color: #2d3436;
}


/* 工单表格样式 */
.yugongdan-workorder-table {
    margin-top: 20px;
    table-layout: auto; /* PC端自动布局 */
    width: 100%;
}

.yugongdan-workorder-table .table {
    background: var(--body-bg-color);
    border: 1px solid var(--muted-border-color);
    border-radius: 8px;
    overflow: hidden;
}

.yugongdan-workorder-table .table th {
    background: var(--muted-bg-color);
    border-bottom: 1px solid var(--muted-border-color);
    font-weight: 600;
    color: var(--text-color);
    padding: 12px 8px;
    white-space: nowrap;
}

.yugongdan-workorder-table .table td {
    padding: 12px 8px;
    border: none !important; /* 完全去除边框 */
    vertical-align: middle;
}

.yugongdan-workorder-table .table td code {
    white-space: nowrap;
}

.yugongdan-workorder-table .table tbody tr:hover {
    background: transparent !important; /* 去除悬停效果 */
}

.yugongdan-workorder-table .table tbody tr:last-child td {
    border-bottom: none;
}

/* 工单详情样式 */
.yugongdan-workorder-detail .workorder-info {
    background: var(--muted-bg-color);
    padding: 15px;
    border-radius: 8px;
    border: 1px solid var(--muted-border-color);
}

.yugongdan-workorder-detail .info-item {
    margin-bottom: 10px;
}

.yugongdan-workorder-detail .info-item label {
    font-weight: 600;
    color: var(--muted-2-color);
    margin-right: 8px;
}

.yugongdan-workorder-detail .workorder-title h4 {
    color: var(--text-color);
    margin: 0;
    padding: 0;
}

.yugongdan-workorder-detail .content-box {
    background: var(--body-bg-color);
    border: 1px solid var(--muted-border-color);
    border-radius: 8px;
    padding: 15px;
    line-height: 1.6;
}

/* 状态标签样式 - 限定在yugongdan容器内 */
.yugongdan-workorder-page .badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
}

.yugongdan-workorder-page .badge.c-yellow {
    background-color: #ffeaa7;
    color: #fdcb6e;
}

.yugongdan-workorder-page .badge.c-blue {
    background-color: #74b9ff;
    color: #0984e3;
}

.yugongdan-workorder-page .badge.c-green {
    background-color: #00b894;
    color: #00cec9;
}

.yugongdan-workorder-page .badge.muted-2-color {
    background-color: #636e72;
    color: #2d3436;
}

/* 工单模态框样式 - 完全使用子比主题样式 */
.yugongdan-submit-form {
    padding: 0;
}

/* 修复输入框和提示重叠问题 */
.yugongdan-submit-form .line-form {
    position: relative;
    margin-bottom: 20px;
}

.yugongdan-submit-form .line-form-input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--muted-border-color);
    border-radius: 6px;
    background: var(--body-bg-color);
    color: var(--text-color);
    font-size: 14px;
    transition: all 0.3s ease;
    box-sizing: border-box;
    position: relative;
    z-index: 2;
}

.yugongdan-submit-form .line-form-input:focus {
    outline: none;
    border-color: var(--main-color);
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.1);
}

.yugongdan-submit-form .line-form-input::placeholder {
    color: var(--muted-2-color);
    opacity: 0.8;
}

.yugongdan-submit-form textarea.line-form-input {
    resize: vertical;
    min-height: 100px;
    line-height: 1.5;
    font-family: inherit;
}

/* 覆盖 zyx-auth 插件的全局 select 样式 - 使用更强的选择器优先级 */
.yugongdan-submit-form select.line-form-input.yugongdan-category-select,
.yugongdan-submit-form .yugongdan-category-select,
.yugongdan-submit-form select.yugongdan-category-select {
    cursor: pointer !important;
    appearance: none !important;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e") !important;
    background-position: right 12px center !important;
    background-repeat: no-repeat !important;
    background-size: 16px !important;
    padding-right: 40px !important;
    /* 覆盖 zyx-auth 插件的全局 select 样式，确保文字正常显示 */
    line-height: normal !important;
    height: auto !important;
    min-height: 42px !important;
    color: var(--text-color, #333) !important;
    background-color: var(--body-bg-color, #fff) !important;
    font-size: 14px !important;
    padding: 12px 40px 12px 15px !important;
}

/* 确保 option 元素的文字颜色正常显示 - 使用更强的选择器 */
.yugongdan-submit-form select.line-form-input.yugongdan-category-select option,
.yugongdan-submit-form .yugongdan-category-select option,
.yugongdan-submit-form select.yugongdan-category-select option {
    color: var(--text-color, #333) !important;
    background-color: var(--body-bg-color, #fff) !important;
    padding: 8px 12px !important;
    line-height: normal !important;
    font-size: 14px !important;
}

/* 确保按钮默认是蓝色的 */
.yugongdan-submit-form .but.jb-blue {
    background-color: var(--main-color) !important;
    color: #fff !important;
    border-color: var(--main-color) !important;
}

/* 表单帮助文本样式 */
.form-help-text {
    font-size: 12px;
    color: var(--muted-2-color);
    margin-top: 5px;
    text-align: right;
}

.char-count {
    font-weight: 500;
}

.char-count.warning {
    color: #ff9500;
}

.char-count.danger {
    color: #e74c3c;
}

/* 防止模态框关闭后页面偏移 - 这个规则保持全局，因为它只是修复可能的bug，不会影响其他页面 */
body:not(.modal-open) {
    padding-right: 0 !important;
    overflow: visible !important;
    margin-right: 0 !important;
}

/* 工单私信框样式补充 */
.workorder-meta-info {
    font-size: 12px;
}

.workorder-title {
    color: var(--main-color);
}

/* 优化消息内容显示，去除多余空白 - 限定在工单模态框内 */
.yugongdan-modal .private-content p:last-child,
.yugongdan-workorder-detail .private-content p:last-child {
    margin-bottom: 0 !important;
}

.yugongdan-modal .private-content p,
.yugongdan-workorder-detail .private-content p {
    margin-bottom: 8px;
}

/* 表情图片样式 - 限定在工单模态框内，避免影响子比主题的私信框 */
/* 使用!important覆盖子比主题的全局.smilie-icon规则（width: 30px !important;），并设置height确保不压扁 */
/* 表情大小与子比主题私信框保持一致：30px x 30px */
.yugongdan-modal .private-content .smilie-icon,
.yugongdan-modal .private-content img.smilie-icon,
.yugongdan-workorder-detail .private-content .smilie-icon,
.yugongdan-workorder-detail .private-content img.smilie-icon {
    width: 30px !important;
    height: 30px !important;
    max-width: 30px !important;
    max-height: 30px !important;
    min-width: 30px !important;
    min-height: 30px !important;
    vertical-align: middle !important;
    margin: 0 2px !important;
    display: inline-block !important;
    object-fit: contain !important;
}

/* 代码块样式 - 限定在工单模态框内 */
.yugongdan-modal .private-content pre,
.yugongdan-workorder-detail .private-content pre {
    background: rgba(0,0,0,0.05);
    padding: 8px;
    border-radius: 4px;
    margin: 8px 0;
    font-size: 12px;
    overflow-x: auto;
}

.yugongdan-modal .private-content pre code,
.yugongdan-workorder-detail .private-content pre code {
    background: none;
    padding: 0;
    border: none;
}

/* 图片样式 - 限定在工单模态框内，避免影响子比主题的私信框 */
.yugongdan-modal .private-content img:not(.smilie-icon),
.yugongdan-workorder-detail .private-content img:not(.smilie-icon) {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin: 4px 0;
}

.yugongdan-submit-form .but.jb-blue:hover {
    background-color: var(--main-hover-color) !important;
    border-color: var(--main-hover-color) !important;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .yugongdan-pro-item {
        padding: 10px;
    }
    
    .yugongdan-status {
        font-size: 10px;
        padding: 1px 6px;
    }
    
    .yugongdan-workorder-table .table th,
    .yugongdan-workorder-table .table td {
        padding: 8px 4px;
        font-size: 12px; 
    }
    
    .yugongdan-workorder-table .table th:nth-child(3),
    .yugongdan-workorder-table .table td:nth-child(3) {
        max-width: 120px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    
    .yugongdan-workorder-detail .workorder-info {
        padding: 10px;
    }
    
    .yugongdan-submit-form .line-form-input {
        padding: 10px 12px;
        font-size: 14px;
    }
    
    .yugongdan-submit-form textarea.line-form-input {
        min-height: 100px;
    }
    
    .yugongdan-submit-form select.line-form-input {
        padding: 10px 12px;
    }
    
    /* 优化提交新工单按钮 - 手机端 */
    .yugongdan-new-workorder {
        padding: 6px 12px !important;
        font-size: 13px !important;
        white-space: nowrap;
        min-height: auto;
    }
    
    /* 优化工单管理页面标题 - 手机端 */
    .yugongdan-workorder-page .title-h-left {
        font-size: 15px;
    }
    
    /* 优化表单提交按钮 - 手机端 */
    .yugongdan-submit-form .but.jb-blue {
        padding: 10px 20px;
        font-size: 14px;
    }
}

/* 工单状态标签样式 */
.status-submitted {
    background: linear-gradient(135deg, #4A90E2 0%, #2E5BBA 100%);
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    display: inline-block;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
    box-shadow: 0 2px 4px rgba(74, 144, 226, 0.3);
}

.status-processing {
    background: linear-gradient(135deg, #FF9500 0%, #FF6B35 100%);
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    display: inline-block;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
    box-shadow: 0 2px 4px rgba(255, 149, 0, 0.3);
}

.status-completed {
    background: linear-gradient(135deg, #7ED321 0%, #56C596 100%);
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    display: inline-block;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
    box-shadow: 0 2px 4px rgba(126, 211, 33, 0.3);
}

.status-closed {
    background: linear-gradient(135deg, #FF6B9D 0%, #E91E63 100%);
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    display: inline-block;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
    box-shadow: 0 2px 4px rgba(255, 107, 157, 0.3);
}

/* 状态更新动画 */
#workorder-status-badge {
    transition: all 0.3s ease;
}

#workorder-status-badge:hover {
    transform: scale(1.05);
}

/* 状态更新容器样式 */
.yugongdan-status-update-container {
    position: relative;
    display: inline-block;
}

/* 防止下拉框影响布局 */
.yugongdan-status-update-container .yugongdan-status-select {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 99999;
    white-space: nowrap;
}

/* 更新状态按钮样式 */
.yugongdan-update-status-btn {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    border: none;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.yugongdan-update-status-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(40, 167, 69, 0.3);
}

.yugongdan-update-status-btn.active {
    background: linear-gradient(135deg, #dc3545 0%, #fd7e14 100%);
}

/* 状态下拉框样式 */
.yugongdan-status-select {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 999999 !important;
    margin-top: 2px;
    background: var(--body-bg-color, white);
    border: 1px solid var(--border-color, #ddd);
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    overflow: visible;
    opacity: 0;
    transform: translateY(-10px) scale(0.95);
    visibility: hidden;
    transition: all 0.2s ease;
    white-space: nowrap;
    width: 100%;
}

.yugongdan-status-select.show {
    opacity: 1;
    transform: translateY(0) scale(1);
    visibility: visible;
}

/* 状态选项样式 */
.yugongdan-status-option {
    padding: 8px 12px;
    cursor: pointer;
    border-bottom: 1px solid var(--border-color-light, #f0f0f0);
    transition: background-color 0.2s ease;
    text-align: center;
}

.yugongdan-status-option:last-child {
    border-bottom: none;
}

.yugongdan-status-option:hover {
    background-color: var(--hover-bg-color, #f8f9fa);
}

/* 暗黑模式适配 */
.dark-theme .yugongdan-status-select {
    background: var(--main-bg-color) !important;
    border: none !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.5) !important;
}

.dark-theme .yugongdan-status-option {
    border: none !important;
    border-bottom: none !important;
}

.dark-theme .yugongdan-status-option:hover {
    background-color: var(--muted-bg-color) !important;
}

.dark-theme .yugongdan-status-option:last-child {
    border: none !important;
    border-bottom: none !important;
}

.yugongdan-status-option .badge {
    font-size: 11px;
    pointer-events: none;
}

/* 表格容器默认设置 - 不产生额外滚动条 - 限定在yugongdan容器内 */
.yugongdan-workorder-page .table-responsive {
    overflow: visible; /* 默认不滚动，避免双滚动条问题 */
}

/* 确保widget容器不限制滚动 - 限定在yugongdan容器内 */
.yugongdan-workorder-page.zib-widget,
.yugongdan-workorder-page .zib-widget {
    overflow: visible !important;
}

/* PC端取消滚动条，确保下拉框显示 - 限定在yugongdan容器内 */
@media (min-width: 769px) {
    .yugongdan-workorder-page .table-responsive {
        overflow: visible !important;
    }
    
    .yugongdan-workorder-page {
        overflow: visible !important;
    }
    
    .yugongdan-workorder-page .yugongdan-workorder-table {
        position: relative;
    }
}


/* 新建工单模态框样式适配 */
.yugongdan-submit-form .line-form-input {
    background: var(--main-bg-color);
    color: var(--main-color);
    border-color: var(--main-border-color);
}

.yugongdan-submit-form .line-form-input:focus {
    border-color: var(--focus-color);
    background: var(--main-bg-color);
    color: var(--main-color);
}

.yugongdan-submit-form .line-form-input::placeholder {
    color: var(--muted-3-color);
}

/* 暗黑模式下的表单适配 */
.dark-theme .yugongdan-submit-form .line-form-input {
    background: var(--main-bg-color) !important;
    color: var(--main-color) !important;
    border-color: var(--main-border-color) !important;
}

.dark-theme .yugongdan-submit-form .line-form-input:focus {
    background: var(--main-bg-color) !important;
    color: var(--main-color) !important;
    border-color: var(--focus-color) !important;
}

.dark-theme .yugongdan-submit-form .line-form-input::placeholder {
    color: var(--muted-3-color) !important;
}

.dark-theme .yugongdan-submit-form .line-form-input option {
    background: var(--main-bg-color) !important;
    color: var(--main-color) !important;
}

/* 暗黑模式下覆盖 zyx-auth 插件的 select 样式 - 使用更强的选择器 */
.dark-theme .yugongdan-submit-form select.line-form-input.yugongdan-category-select,
.dark-theme .yugongdan-submit-form .yugongdan-category-select,
.dark-theme .yugongdan-submit-form select.yugongdan-category-select,
[data-theme="dark"] .yugongdan-submit-form select.yugongdan-category-select,
body.dark .yugongdan-submit-form select.yugongdan-category-select,
html.dark .yugongdan-submit-form select.yugongdan-category-select,
body[data-night="true"] .yugongdan-submit-form select.yugongdan-category-select {
    color: var(--main-color, #e0e0e0) !important;
    background-color: var(--main-bg-color, #2d2d2d) !important;
    line-height: normal !important;
    height: auto !important;
    min-height: 42px !important;
}

.dark-theme .yugongdan-submit-form select.line-form-input.yugongdan-category-select option,
.dark-theme .yugongdan-submit-form .yugongdan-category-select option,
.dark-theme .yugongdan-submit-form select.yugongdan-category-select option,
[data-theme="dark"] .yugongdan-submit-form select.yugongdan-category-select option,
body.dark .yugongdan-submit-form select.yugongdan-category-select option,
html.dark .yugongdan-submit-form select.yugongdan-category-select option,
body[data-night="true"] .yugongdan-submit-form select.yugongdan-category-select option {
    color: var(--main-color, #e0e0e0) !important;
    background-color: var(--main-bg-color, #2d2d2d) !important;
    line-height: normal !important;
}

/* 图片预览容器样式 - 查看工单（回复）- 浮动在外部 */
.yugongdan-image-preview-container {
    position: absolute;
    bottom: 100%;
    left: 0;
    right: 0;
    margin-bottom: 5px;
    padding: 8px;
    background: var(--body-bg-color, #f8f9fa);
    border: 1px solid var(--border-color, #ddd);
    border-radius: 6px;
    text-align: center;
    box-shadow: 0 2px 12px rgba(0,0,0,0.15);
    z-index: 1;
    animation: slideInUp 0.3s ease-out;
}

/* 图片预览容器样式 - 新建工单 - 在输入框内右下角显示 */
.yugongdan-submit-preview {
    position: absolute;
    bottom: 5px;
    right: 5px;
    padding: 0;
    background: transparent;
    border: none;
    margin-bottom: 0;
    box-shadow: none;
    z-index: 5;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes zoomOut {
    0% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.5;
        transform: scale(0.8);
    }
    100% {
        opacity: 0;
        transform: scale(0);
    }
}

.yugongdan-image-preview.removing {
    animation: zoomOut 0.3s ease-out forwards;
}

/* 图片预览 - 查看工单（回复）- 正常大小 */
.yugongdan-image-preview {
    position: relative;
    display: inline-block;
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: visible; /* 改为visible让删除按钮显示在外面 */
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* 图片预览 - 新建工单 - 小尺寸 */
.yugongdan-submit-preview .yugongdan-image-preview {
    width: 50px;
    height: 50px;
    border-radius: 6px;
    overflow: visible; /* 让删除按钮显示在外面 */
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    border: 2px solid #fff;
}

.yugongdan-image-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: inherit; /* 继承父元素的圆角 */
}

/* 删除按钮 - 查看工单（回复）- 正常大小 */
.yugongdan-image-remove {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 24px;
    height: 24px;
    background: #ff4444;
    color: white;
    border: 2px solid #fff;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: all 0.2s ease;
    z-index: 2;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* 删除按钮 - 新建工单 - 小尺寸 */
.yugongdan-submit-preview .yugongdan-image-remove {
    top: -6px;
    right: -6px;
    width: 18px;
    height: 18px;
    font-size: 9px;
}

.yugongdan-image-remove:hover {
    background: #ff0000;
    transform: scale(1.1);
}

.yugongdan-image-remove i {
    line-height: 1;
}

/* 暗黑模式下的图片预览适配 */
.dark-theme .yugongdan-image-preview-container {
    background: var(--main-bg-color) !important;
    border-color: var(--border-color) !important;
}

.dark-theme .yugongdan-submit-preview {
    background: transparent !important;
    border: none !important;
}

.dark-theme .yugongdan-image-preview {
    box-shadow: 0 2px 8px rgba(0,0,0,0.3) !important;
}

.dark-theme .yugongdan-submit-preview .yugongdan-image-preview {
    box-shadow: 0 2px 8px rgba(0,0,0,0.5) !important;
    border-color: rgba(255,255,255,0.1) !important;
}

/* 用户名称样式（仅文本） */
.user-name-only {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-color);
    display: block;
    white-space: nowrap;
    width: 100%;
    padding: 4px 8px;
}

/* PC端表格优化 */
@media (min-width: 769px) {
    .yugongdan-workorder-table {
        table-layout: auto !important;
        width: 100%;
    }
    
    .yugongdan-workorder-table td {
        white-space: normal;
        overflow: visible;
    }
    
    /* 用户名列 - 自适应宽度，单行显示，包含头像 */
    .yugongdan-workorder-table td:first-child {
        max-width: 150px;
        overflow: hidden;
    }
    
    /* 用户信息容器 */
    .yugongdan-table-user {
        display: flex !important;
        align-items: center !important;
        gap: 6px !important;
    }
    
    /* 头像样式 */
    .yugongdan-table-user .avatar-img {
        flex-shrink: 0 !important;
        width: 24px !important;
        height: 24px !important;
        border-radius: 50% !important;
        overflow: hidden !important;
        display: inline-block !important;
    }
    
    .yugongdan-table-user .avatar-img img {
        width: 24px !important;
        height: 24px !important;
        border-radius: 50% !important;
        display: block !important;
        object-fit: cover !important;
    }
    
    /* 用户名文字 */
    .yugongdan-table-user .user-name {
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
        flex: 1 !important;
        min-width: 0 !important;
    }
    
    /* 工单号列 */
    .yugongdan-workorder-table td:nth-child(2) {
        white-space: nowrap;
    }
    
    /* 分类列 */
    .yugongdan-workorder-table td:nth-child(3) {
        white-space: nowrap;
    }
    
    /* 标题列 - 单行显示，超出省略 */
    .yugongdan-workorder-table td:nth-child(4) {
        max-width: 200px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap !important;
    }
    
    /* 普通用户视图标题列（没有用户列时标题是第3列） */
    .yugongdan-workorder-table tbody tr td:nth-child(4):last-child ~ td:nth-child(3) {
        max-width: 200px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap !important;
    }
    
    /* 时间列 */
    .yugongdan-workorder-table td:nth-child(5) {
        white-space: nowrap;
    }
    
    /* 状态列 */
    .yugongdan-workorder-table td:nth-child(6) {
        white-space: nowrap;
    }
    
    /* 操作列按钮优化 */
    .yugongdan-workorder-table td:last-child {
        min-width: 120px;
        white-space: nowrap;
    }
    
    .yugongdan-workorder-table .but {
        padding: 4px 8px;
        font-size: 12px;
        white-space: nowrap;
    }
    
    .yugongdan-workorder-table .yugongdan-status-update-container {
        display: inline-block;
        vertical-align: middle;
    }
    
    /* 布局宽度1200px-1400px优化 */
    @media (max-width: 1400px) {
        /* 用户名列宽度减小（包含头像） */
        .yugongdan-workorder-table td:first-child {
            max-width: 100px;
        }
        
        /* 标题列宽度减小 */
        .yugongdan-workorder-table td:nth-child(4) {
            max-width: 150px;
        }
        
        /* 操作列按钮垂直排列 */
        .yugongdan-workorder-table td:last-child {
            white-space: normal;
        }
        
        .yugongdan-workorder-table .but {
            display: block;
            margin-bottom: 4px;
            width: 100%;
        }
        
        .yugongdan-workorder-table .but:last-child {
            margin-bottom: 0;
        }
        
        .yugongdan-workorder-table .yugongdan-status-update-container {
            display: block;
            width: 100%;
        }
        
        .yugongdan-workorder-table .yugongdan-update-status-btn {
            width: 100%;
        }
    }
    
    /* 布局宽度1400px-1600px优化 */
    @media (min-width: 1401px) and (max-width: 1600px) {
        /* 用户名列（包含头像） */
        .yugongdan-workorder-table td:first-child {
            max-width: 120px;
        }
        
        /* 标题列 */
        .yugongdan-workorder-table td:nth-child(4) {
            max-width: 180px;
        }
    }
    
    /* 布局宽度1600px以上优化 */
    @media (min-width: 1601px) {
        /* 用户名列（包含头像） */
        .yugongdan-workorder-table td:first-child {
            max-width: 180px;
        }
        
        /* 标题列 */
        .yugongdan-workorder-table td:nth-child(4) {
            max-width: 250px;
        }
    }
}

/* 手机端才使用固定布局 */
@media (max-width: 768px) {
    .yugongdan-workorder-table {
        table-layout: fixed;
        width: 100%;
    }
    
    /* 表格单元格文本截断 */
    .yugongdan-workorder-table td {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        padding: 8px 4px;
    }
    
    .yugongdan-workorder-table th {
        padding: 8px 4px;
        font-size: 13px;
    }
}

/* 客服视图表格调整 */
.yugongdan-workorder-table th:first-child,
.yugongdan-workorder-table td:first-child {
    width: 80px;
}

/* 工单标题列 */
.yugongdan-workorder-table th:nth-child(4),
.yugongdan-workorder-table td:nth-child(4) {
    width: 120px;
}

/* 普通用户视图工单标题列 */
.yugongdan-workorder-table th:nth-child(3),
.yugongdan-workorder-table td:nth-child(3) {
    width: 120px;
}

/* 工单编号列 */
.yugongdan-workorder-table th:nth-child(2),
.yugongdan-workorder-table td:nth-child(2) {
    width: 100px;
}

/* 工单分类列 */
.yugongdan-workorder-table th:nth-child(3),
.yugongdan-workorder-table td:nth-child(3) {
    width: 80px;
}

/* 创建时间列 */
.yugongdan-workorder-table th:nth-child(5),
.yugongdan-workorder-table td:nth-child(5) {
    width: 120px;
}

/* 工单状态列 */
.yugongdan-workorder-table th:nth-child(6),
.yugongdan-workorder-table td:nth-child(6) {
    width: 80px;
}

/* 操作列 */
.yugongdan-workorder-table th:last-child,
.yugongdan-workorder-table td:last-child {
    width: 120px;
}

/* 移动端状态标签调整 */
@media (max-width: 768px) {
    .status-submitted,
    .status-processing,
    .status-completed,
    .status-closed {
        font-size: 11px;
        padding: 3px 8px;
    }
    
    /* 移动端用户名调整 */
    .user-name-only {
        font-size: 12px;
        text-align: center;
        padding: 2px 4px;
    }
    
    /* 移动端表格容器 - 因为手机端使用卡片视图，不需要表格滚动 - 限定在yugongdan容器内 */
    .yugongdan-workorder-page .table-responsive {
        width: 100%;
        overflow: hidden !important; /* 隐藏溢出，避免双滚动条 */
    }
    
    /* 移动端表格设置最小宽度，确保可以滚动 - 限定在yugongdan容器内 */
    .yugongdan-workorder-page .yugongdan-workorder-table {
        min-width: 600px; /* 设置最小宽度，超出屏幕会出现滚动条 */
    }
    
    /* 确保widget容器不产生额外滚动 - 限定在yugongdan容器内 */
    .yugongdan-workorder-page.zib-widget,
    .yugongdan-workorder-page .zib-widget {
        overflow: visible !important; /* 移除滚动，使用页面主滚动条 */
    }
    
    /* 移动端表格列宽调整 */
    .yugongdan-workorder-table th:first-child,
    .yugongdan-workorder-table td:first-child {
        width: 60px;
    }
    
    .yugongdan-workorder-table th:nth-child(2),
    .yugongdan-workorder-table td:nth-child(2) {
        width: 80px;
    }
    
    .yugongdan-workorder-table th:nth-child(3),
    .yugongdan-workorder-table td:nth-child(3) {
        width: 60px;
    }
    
    .yugongdan-workorder-table th:nth-child(4),
    .yugongdan-workorder-table td:nth-child(4) {
        width: 100px;
    }
    
    .yugongdan-workorder-table th:nth-child(5),
    .yugongdan-workorder-table td:nth-child(5) {
        width: 90px;
    }
    
    .yugongdan-workorder-table th:nth-child(6),
    .yugongdan-workorder-table td:nth-child(6) {
        width: 60px;
    }
    
    .yugongdan-workorder-table th:last-child,
    .yugongdan-workorder-table td:last-child {
        width: 100px;
    }
}

/* 彻底去除工单表格的所有横线和悬停效果 - 限定在yugongdan容器内 */
.yugongdan-workorder-page .table-responsive .table td,
.yugongdan-workorder-page .table-responsive .table tbody tr,
.yugongdan-workorder-page .yugongdan-workorder-table .table td,
.yugongdan-workorder-page .yugongdan-workorder-table .table tbody tr {
    border-bottom: none !important;
    border-top: none !important;
    border-left: none !important;
    border-right: none !important;
}

/* 去除所有悬停效果 - 限定在yugongdan容器内 */
.yugongdan-workorder-page .table-responsive .table tbody tr:hover,
.yugongdan-workorder-page .yugongdan-workorder-table .table tbody tr:hover {
    background: transparent !important;
    background-color: transparent !important;
}

/* 暗黑模式下也去除悬停效果 - 限定在yugongdan容器内 */
[data-theme="dark"] .yugongdan-workorder-page .table-responsive .table tbody tr:hover,
[data-theme="dark"] .yugongdan-workorder-page .yugongdan-workorder-table .table tbody tr:hover,
.dark .yugongdan-workorder-page .table tbody tr:hover,
body.dark .yugongdan-workorder-page .table tbody tr:hover,
html.dark .yugongdan-workorder-page .table tbody tr:hover,
body[data-night="true"] .yugongdan-workorder-page .table tbody tr:hover {
    background: transparent !important;
    background-color: transparent !important;
}

/* 保持表格头部样式 */
.yugongdan-workorder-table .table th {
    border-bottom: 1px solid var(--muted-border-color) !important;
}

/* 暗黑模式下的表格头部 */
[data-theme="dark"] .yugongdan-workorder-table .table th,
.dark .yugongdan-workorder-table .table th,
body.dark .yugongdan-workorder-table .table th,
html.dark .yugongdan-workorder-table .table th,
body[data-night="true"] .yugongdan-workorder-table .table th {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
}

/* 工单公告样式 */
.workorder-notice-content {
    background: var(--body-bg-color);
    border: 1px solid var(--muted-border-color);
    border-radius: 8px;
    padding: 15px;
    line-height: 1.8;
    font-size: 15px;
    margin-left: 0;
}

.workorder-notice-content p {
    margin-bottom: 12px;
    color: var(--text-color);
    font-size: 15px;
}

.workorder-notice-content p:last-child {
    margin-bottom: 0;
}

/* 暗黑模式下的公告样式 */
.dark-theme .workorder-notice-content {
    background: var(--main-bg-color);
    border-color: var(--main-border-color);
}

/* 响应式调整 */
@media (max-width: 768px) {
    .workorder-notice-content {
        padding: 12px;
        font-size: 14px;
    }
    
    .workorder-notice-content p {
        font-size: 14px;
    }
}

/* ============================================
   悬浮按钮样式
   ============================================ */

/* 悬浮按钮容器 */
.yugongdan-float-button-container {
    position: fixed;
    z-index: 9999;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

/* 确保未登录和登录状态的样式一致 */
.yugongdan-float-button-container.yugongdan-user-logged-in,
.yugongdan-float-button-container.yugongdan-user-not-logged-in {
    /* 统一的基础样式，确保两种状态下显示一致 */
}

/* 在工单页面隐藏悬浮按钮 */
.yugongdan-float-button-container.yugongdan-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* 拖拽状态 */
.yugongdan-float-button-container.yugongdan-dragging {
    cursor: move;
    cursor: grab;
    cursor: -webkit-grab;
    opacity: 0.8;
}

.yugongdan-float-button-container.yugongdan-dragging .yugongdan-float-button {
    cursor: grabbing;
    cursor: -webkit-grabbing;
}

/* 拖拽时隐藏菜单 */
.yugongdan-float-button-container.yugongdan-dragging .yugongdan-float-menu {
    display: none !important;
}

/* 悬浮按钮主体 */
.yugongdan-float-button {
    --h-button: 48px;
    --w-button: 102px;
    --round: 0.75rem;
    cursor: move;
    cursor: grab;
    cursor: -webkit-grab;
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transition: all 0.25s ease;
    background: radial-gradient(
        65.28% 65.28% at 50% 100%,
        rgba(223, 113, 255, 0.8) 0%,
        rgba(223, 113, 255, 0) 100%
    ),
    linear-gradient(0deg, #7a5af8, #7a5af8);
    border-radius: var(--round);
    border: none;
    outline: none;
    padding: 12px 18px;
    min-width: fit-content;
    max-width: 90vw;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.yugongdan-float-button:active {
    cursor: grabbing;
    cursor: -webkit-grabbing;
}

.yugongdan-float-button::before,
.yugongdan-float-button::after {
    content: "";
    position: absolute;
    inset: var(--space);
    transition: all 0.5s ease-in-out;
    border-radius: calc(var(--round) - var(--space));
    z-index: 0;
}

.yugongdan-float-button::before {
    --space: 1px;
    background: linear-gradient(
        177.95deg,
        rgba(255, 255, 255, 0.19) 0%,
        rgba(255, 255, 255, 0) 100%
    );
}

.yugongdan-float-button::after {
    --space: 2px;
    background: radial-gradient(
        65.28% 65.28% at 50% 100%,
        rgba(223, 113, 255, 0.8) 0%,
        rgba(223, 113, 255, 0) 100%
    ),
    linear-gradient(0deg, #7a5af8, #7a5af8);
}

/* 移除原来的active缩放效果，避免和拖拽冲突 */

/* 折角效果 */
.yugongdan-float-button .fold {
    z-index: 1;
    position: absolute;
    top: 0;
    right: 0;
    height: 1rem;
    width: 1rem;
    display: inline-block;
    transition: all 0.5s ease-in-out;
    background: radial-gradient(
        100% 75% at 55%,
        rgba(223, 113, 255, 0.8) 0%,
        rgba(223, 113, 255, 0) 100%
    );
    box-shadow: 0 0 3px black;
    border-bottom-left-radius: 0.5rem;
    border-top-right-radius: var(--round);
}

.yugongdan-float-button .fold::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    width: 150%;
    height: 150%;
    transform: rotate(45deg) translateX(0%) translateY(-18px);
    background-color: #e8e8e8;
    pointer-events: none;
}

.yugongdan-float-button:hover .fold {
    margin-top: -1rem;
    margin-right: -1rem;
}

/* 点效果容器 */
.yugongdan-float-button .points_wrapper {
    overflow: hidden;
    width: 100%;
    height: 100%;
    pointer-events: none;
    position: absolute;
    z-index: 1;
}

.yugongdan-float-button .points_wrapper .point {
    bottom: -10px;
    position: absolute;
    animation: floating-points infinite ease-in-out;
    pointer-events: none;
    width: 2px;
    height: 2px;
    background-color: #fff;
    border-radius: 9999px;
}

@keyframes floating-points {
    0% {
        transform: translateY(0);
    }
    85% {
        opacity: 0;
    }
    100% {
        transform: translateY(-55px);
        opacity: 0;
    }
}

.yugongdan-float-button .points_wrapper .point:nth-child(1) {
    left: 10%;
    opacity: 1;
    animation-duration: 2.35s;
    animation-delay: 0.2s;
}

.yugongdan-float-button .points_wrapper .point:nth-child(2) {
    left: 30%;
    opacity: 0.7;
    animation-duration: 2.5s;
    animation-delay: 0.5s;
}

.yugongdan-float-button .points_wrapper .point:nth-child(3) {
    left: 25%;
    opacity: 0.8;
    animation-duration: 2.2s;
    animation-delay: 0.1s;
}

.yugongdan-float-button .points_wrapper .point:nth-child(4) {
    left: 44%;
    opacity: 0.6;
    animation-duration: 2.05s;
}

.yugongdan-float-button .points_wrapper .point:nth-child(5) {
    left: 50%;
    opacity: 1;
    animation-duration: 1.9s;
}

.yugongdan-float-button .points_wrapper .point:nth-child(6) {
    left: 75%;
    opacity: 0.5;
    animation-duration: 1.5s;
    animation-delay: 1.5s;
}

.yugongdan-float-button .points_wrapper .point:nth-child(7) {
    left: 88%;
    opacity: 0.9;
    animation-duration: 2.2s;
    animation-delay: 0.2s;
}

.yugongdan-float-button .points_wrapper .point:nth-child(8) {
    left: 58%;
    opacity: 0.8;
    animation-duration: 2.25s;
    animation-delay: 0.2s;
}

.yugongdan-float-button .points_wrapper .point:nth-child(9) {
    left: 98%;
    opacity: 0.6;
    animation-duration: 2.6s;
    animation-delay: 0.1s;
}

.yugongdan-float-button .points_wrapper .point:nth-child(10) {
    left: 65%;
    opacity: 1;
    animation-duration: 2.5s;
    animation-delay: 0.2s;
}

/* 按钮内容 */
.yugongdan-float-button .inner {
    z-index: 2;
    gap: 6px;
    position: relative;
    width: 100%;
    color: white;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 500;
    line-height: 1.5;
    transition: color 0.2s ease-in-out;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.yugongdan-float-button .inner svg.icon {
    width: 18px;
    height: 18px;
    transition: fill 0.1s linear;
}

.yugongdan-float-button:focus svg.icon {
    fill: white;
}

.yugongdan-float-button:hover svg.icon {
    fill: transparent;
    animation:
        dasharray 1s linear forwards,
        filled 0.1s linear forwards 0.95s;
}

@keyframes dasharray {
    from {
        stroke-dasharray: 0 0 0 0;
    }
    to {
        stroke-dasharray: 68 68 0 0;
    }
}

@keyframes filled {
    to {
        fill: white;
    }
}

/* 悬浮菜单 */
.yugongdan-float-menu {
    position: absolute;
    bottom: 60px;
    right: 0;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    padding: 8px 0;
    min-width: 160px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
    z-index: 10;
}

/* PC端悬停显示 */
.yugongdan-float-button-container:hover .yugongdan-float-menu,
.yugongdan-float-menu:hover {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* 移动端点击显示 */
.yugongdan-float-menu.mobile-show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.yugongdan-float-menu-item {
    padding: 12px 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #333;
    font-size: 14px;
}

.yugongdan-float-menu-item:hover {
    background: #f5f5f5;
    color: #7a5af8;
}

.yugongdan-float-menu-item i {
    font-size: 16px;
}

/* 暗黑模式下的悬浮菜单 */
[data-theme="dark"] .yugongdan-float-menu,
.dark .yugongdan-float-menu,
body.dark .yugongdan-float-menu,
html.dark .yugongdan-float-menu,
body[data-night="true"] .yugongdan-float-menu {
    background: #2d2d2d;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .yugongdan-float-menu-item,
.dark .yugongdan-float-menu-item,
body.dark .yugongdan-float-menu-item,
html.dark .yugongdan-float-menu-item,
body[data-night="true"] .yugongdan-float-menu-item {
    color: #e0e0e0;
}

[data-theme="dark"] .yugongdan-float-menu-item:hover,
.dark .yugongdan-float-menu-item:hover,
body.dark .yugongdan-float-menu-item:hover,
html.dark .yugongdan-float-menu-item:hover,
body[data-night="true"] .yugongdan-float-menu-item:hover {
    background: #3d3d3d;
    color: #9d7bff;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .yugongdan-float-button {
        padding: 10px 14px;
        font-size: 14px;
        max-width: calc(100vw - 20px);
    }
    
    .yugongdan-float-button .inner {
        font-size: 14px;
        gap: 4px;
        max-width: 100%;
    }
    
    .yugongdan-float-button .inner svg.icon {
        width: 16px;
        height: 16px;
        flex-shrink: 0;
    }
    
    .yugongdan-float-menu {
        min-width: 140px;
        bottom: 50px;
    }
    
    .yugongdan-float-menu-item {
        padding: 10px 16px;
        font-size: 13px;
    }
}

/* 小屏幕手机适配（宽度<400px） */
@media (max-width: 400px) {
    .yugongdan-float-button {
        font-size: 12px;
        padding: 8px 12px;
    }
    
    .yugongdan-float-button .inner {
        font-size: 12px;
        gap: 3px;
    }
    
    .yugongdan-float-button .inner svg.icon {
        width: 14px;
        height: 14px;
    }
}
