/* ========================================
   工单详情弹窗 - 简约现代风格 v1.0
   ======================================== */

/* 弹窗遮罩层 */
.ticket-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    overflow-y: auto;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* 弹窗内容容器 */
.ticket-modal-content {
    background: #fff;
    margin: 3% auto;
    padding: 0;
    border-radius: 20px;
    width: 92%;
    max-width: 900px;
    max-height: 92vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideInDown 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* 弹窗头部 */
.ticket-modal-header {
    background: linear-gradient(135deg, #F57F17 0%, #FF9800 100%);
    color: white;
    padding: 28px 35px;
    position: relative;
    border-radius: 20px 20px 0 0;
    box-shadow: 0 4px 12px rgba(245, 127, 23, 0.2);
}

.ticket-modal-header h2,
.ticket-modal-header h3 {
    margin: 0;
    font-size: 1.6rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 12px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    letter-spacing: 0.3px;
}

.ticket-modal-header h3 {
    font-size: 1.4rem;
}

.ticket-modal-header i.fa-ticket-alt,
.ticket-modal-header i.fas {
    font-size: 1.4rem;
    filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.2));
}

/* 关闭按钮 */
.ticket-modal-header button {
    position: absolute;
    right: 25px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 28px;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
    font-weight: 300;
    line-height: 1;
}

.ticket-modal-header button:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-50%) rotate(90deg);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* 弹窗主体 */
.ticket-modal-body {
    padding: 30px 35px;
    overflow-y: auto;
    flex: 1;
    background: #fafafa;
}

/* 工单操作栏 */
.ticket-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 15px;
    background: #fff;
    padding: 18px 22px;
    border-radius: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.ticket-actions button {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
    letter-spacing: 0.3px;
}

.ticket-actions button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(76, 175, 80, 0.4);
}

.ticket-actions button i {
    font-size: 14px;
}

.ticket-actions select {
    padding: 10px 18px;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    background: white;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    outline: none;
    font-weight: 500;
    min-width: 140px;
}

.ticket-actions select:hover {
    border-color: #F57F17;
}

.ticket-actions select:focus {
    border-color: #F57F17;
    box-shadow: 0 0 0 3px rgba(245, 127, 23, 0.1);
}

/* 工单列表容器 */
#ticketsList {
    max-height: 450px;
    overflow-y: auto;
    padding-right: 5px;
}

/* 自定义滚动条 */
#ticketsList::-webkit-scrollbar {
    width: 6px;
}

#ticketsList::-webkit-scrollbar-track {
    background: #f0f0f0;
    border-radius: 10px;
}

#ticketsList::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #F57F17, #FF9800);
    border-radius: 10px;
}

#ticketsList::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #E65100, #F57F17);
}

/* 工单卡片基础样式（通过JavaScript动态生成，这里提供增强） */
#ticketsList > div {
    border: 1px solid #e8e8e8 !important;
    border-radius: 16px !important;
    padding: 22px !important;
    margin-bottom: 18px !important;
    background: white !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    position: relative;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04) !important;
}

#ticketsList > div:hover {
    box-shadow: 0 8px 24px rgba(245, 127, 23, 0.15) !important;
    transform: translateY(-4px) !important;
    border-color: rgba(245, 127, 23, 0.3) !important;
}

/* 工单卡片按钮优化 */
#ticketsList button {
    padding: 10px 20px !important;
    border-radius: 25px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1) !important;
}

#ticketsList button:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15) !important;
}

/* 空状态样式优化 */
#ticketsList > div[style*="text-align: center"] {
    background: white !important;
    border-radius: 20px !important;
    padding: 60px 30px !important;
    border: 2px dashed #e0e0e0 !important;
}

#ticketsList > div[style*="text-align: center"]:hover {
    transform: none !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04) !important;
}

/* 加载状态优化 */
.fa-spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* 创建工单表单弹窗 */
#createTicketModal .ticket-modal-content {
    max-width: 580px;
    animation: scaleIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

#createTicketModal .ticket-modal-header {
    padding: 24px 30px;
}

#createTicketModal .ticket-modal-body {
    background: #fff;
}

/* 表单样式 */
#createTicketForm label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

#createTicketForm input,
#createTicketForm select,
#createTicketForm textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 14px;
    transition: all 0.3s ease;
    outline: none;
    box-sizing: border-box;
    font-family: inherit;
}

#createTicketForm input:focus,
#createTicketForm select:focus,
#createTicketForm textarea:focus {
    border-color: #F57F17;
    box-shadow: 0 0 0 3px rgba(245, 127, 23, 0.1);
}

#createTicketForm textarea {
    min-height: 120px;
    resize: vertical;
}

#createTicketForm div[style*="margin-bottom"] {
    margin-bottom: 20px !important;
}

/* 表单按钮 */
#createTicketForm button[type="submit"] {
    padding: 12px 28px !important;
    border: none !important;
    background: linear-gradient(135deg, #F57F17 0%, #FF9800 100%) !important;
    color: white !important;
    border-radius: 25px !important;
    cursor: pointer !important;
    font-weight: 700 !important;
    font-size: 15px !important;
    box-shadow: 0 4px 12px rgba(245, 127, 23, 0.3) !important;
    transition: all 0.3s ease !important;
}

#createTicketForm button[type="submit"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(245, 127, 23, 0.4) !important;
}

#createTicketForm button[type="button"] {
    padding: 12px 28px !important;
    border: 2px solid #e0e0e0 !important;
    background: #f8f9fa !important;
    color: #666 !important;
    border-radius: 25px !important;
    cursor: pointer !important;
    font-weight: 600 !important;
    font-size: 15px !important;
    transition: all 0.3s ease !important;
    margin-right: 12px !important;
}

#createTicketForm button[type="button"]:hover {
    background: #e9ecef !important;
    border-color: #ccc !important;
}

/* 工单详情弹窗特殊样式 */
#ticketDetailModal {
    z-index: 10001 !important;
}

#ticketDetailModal .ticket-modal-content {
    max-width: 1000px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .ticket-modal-content {
        width: 95%;
        margin: 5% auto;
        border-radius: 16px;
    }
    
    .ticket-modal-header {
        padding: 20px 20px;
    }
    
    .ticket-modal-header h2,
    .ticket-modal-header h3 {
        font-size: 1.3rem;
    }
    
    .ticket-modal-header button {
        right: 15px;
        width: 36px;
        height: 36px;
        font-size: 24px;
    }
    
    .ticket-modal-body {
        padding: 20px;
    }
    
    .ticket-actions {
        padding: 15px 18px;
        gap: 12px;
    }
    
    .ticket-actions button {
        padding: 10px 20px;
        font-size: 14px;
    }
    
    .ticket-actions select {
        width: 100%;
        min-width: auto;
    }
    
    #ticketsList {
        max-height: 350px;
    }
    
    #ticketsList > div {
        padding: 18px !important;
        margin-bottom: 15px !important;
    }
    
    #createTicketModal .ticket-modal-content {
        width: 95%;
        max-width: 95%;
    }
}

@media (max-width: 480px) {
    .ticket-modal-content {
        width: 98%;
        margin: 2% auto;
        max-height: 96vh;
    }
    
    .ticket-modal-header {
        padding: 18px 15px;
    }
    
    .ticket-modal-header h2,
    .ticket-modal-header h3 {
        font-size: 1.15rem;
        gap: 8px;
    }
    
    .ticket-modal-header i.fa-ticket-alt,
    .ticket-modal-header i.fas {
        font-size: 1.15rem;
    }
    
    .ticket-modal-body {
        padding: 15px;
    }
    
    .ticket-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .ticket-actions button,
    .ticket-actions select {
        width: 100%;
        justify-content: center;
    }
    
    #ticketsList {
        max-height: 300px;
    }
    
    #ticketsList > div {
        padding: 15px !important;
    }
}

/* 性能优化 */
.ticket-modal-content {
    will-change: transform, opacity;
}

#ticketsList > div {
    will-change: transform;
}

/* 确保不与其他样式冲突 */
.ticket-modal * {
    box-sizing: border-box;
}

