/* 移动端专用样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
    overflow-x: hidden;
}

/* 移动端应用容器 */
.mobile-app {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    width: 100%;
}

/* 顶部导航栏 */
.mobile-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    height: 56px;
}

.app-title {
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.menu-toggle {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    padding: 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.menu-toggle:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* 侧边栏 */
.mobile-sidebar {
    position: fixed;
    top: 0;
    left: -280px;
    width: 280px;
    height: 100vh;
    background: white;
    z-index: 1001;
    transition: left 0.3s ease;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
}

.mobile-sidebar.active {
    left: 0;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: #667eea;
    color: white;
}

.sidebar-header h2 {
    font-size: 18px;
    font-weight: 600;
}

.close-sidebar {
    background: none;
    border: none;
    color: white;
    font-size: 18px;
    padding: 8px;
    border-radius: 6px;
    cursor: pointer;
}

.sidebar-menu {
    list-style: none;
    padding: 16px 0;
    display: flex;
    flex-direction: column;
    height: calc(100vh - 32px);
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    cursor: pointer;
    transition: background-color 0.3s;
    border-left: 3px solid transparent;
}

.menu-item:hover {
    background-color: #f5f5f5;
}

.menu-item.active {
    background-color: #e6f7ff;
    border-left-color: #1890ff;
    color: #1890ff;
}

.menu-item i {
    width: 20px;
    text-align: center;
}

/* 退出登录菜单项样式 */
.menu-item.logout-menu {
    margin-top: auto;
    border-top: 1px solid #f0f0f0;
    background-color: #fff2f0;
    color: #ff4d4f;
}

.menu-item.logout-menu:hover {
    background-color: #ff4d4f;
    color: white;
    border-left-color: #ff4d4f;
}

.menu-item.logout-menu i {
    color: #ff4d4f;
}

.menu-item.logout-menu:hover i {
    color: white;
}

/* 主要内容区域 */
.mobile-main {
    margin-top: 56px;
    flex: 1;
    padding: 16px;
    overflow-y: auto;
}

/* 视图容器 */
.view-container {
    display: none;
}

.view-container.active {
    display: block;
}

/* 筛选器区域 */
.mobile-filters {
    background: white;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    position: relative; /* 为loading覆盖层提供定位参考 */
}

.filter-row {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}

.filter-row:last-child {
    margin-bottom: 0;
}

.filter-group {
    flex: 1;
}

.filter-group label {
    display: block;
    font-size: 12px;
    color: #666;
    margin-bottom: 4px;
    font-weight: 500;
}

.mobile-select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    background: white;
    color: #333;
}

.mobile-select:focus {
    outline: none;
    border-color: #1890ff;
    box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.1);
}

.mobile-select:disabled {
    background-color: #f5f5f5;
    color: #999;
    cursor: not-allowed;
    border-color: #d9d9d9;
}

.refresh-btn, .search-btn {
    flex: 1;
    padding: 10px 16px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.refresh-btn {
    background: #52c41a;
    color: white;
}

.refresh-btn:hover {
    background: #389e0d;
}

.search-btn {
    background: #1890ff;
    color: white;
}

.search-btn:hover {
    background: #096dd9;
}

/* 筛选loading */
.filter-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    z-index: 10;
}

.filter-loading-content {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #1890ff;
    font-size: 14px;
    font-weight: 500;
}

.filter-loading i {
    font-size: 16px;
}

/* 工单列表 */
.mobile-ticket-list {
    margin-bottom: 16px;
}

.mobile-ticket-item {
    background: white;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    border-left: 4px solid #e0e0e0;
    transition: transform 0.2s, box-shadow 0.2s;
}

.mobile-ticket-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.mobile-ticket-item.priority-high {
    border-left-color: #ff4d4f;
}

.mobile-ticket-item.priority-medium {
    border-left-color: #faad14;
}

.mobile-ticket-item.priority-low {
    border-left-color: #52c41a;
}

.ticket-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.ticket-code {
    font-size: 16px;
    font-weight: 600;
    color: #1890ff;
    text-decoration: none;
}

.ticket-status {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    color: white;
}

.ticket-status.status-0 {
    background: #fa8c16;
}

.ticket-status.status-1 {
    background: #1890ff;
}

.ticket-status.status-2 {
    background: #52c41a;
}

.ticket-status.status-3 {
    background: #8c8c8c;
}

.ticket-title {
    font-size: 14px;
    color: #333;
    margin-bottom: 8px;
    line-height: 1.4;
}

.ticket-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 12px;
    color: #666;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.meta-item i {
    color: #999;
}

/* 加载指示器 */
.loading-indicator {
    display: none;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 20px;
    color: #666;
}

.loading-indicator.active {
    display: flex;
}

/* 分页控件 */
.mobile-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    border-radius: 12px;
    padding: 12px 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.page-btn {
    background: #1890ff;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.3s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.page-btn:hover {
    background: #096dd9;
}

.page-btn:disabled {
    background: #d9d9d9;
    cursor: not-allowed;
}

.page-info {
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

/* 用户搜索 */
.search-container {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.search-input-group {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.mobile-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
}

.mobile-input:focus {
    outline: none;
    border-color: #1890ff;
    box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.1);
}

.search-submit-btn {
    background: #1890ff;
    color: white;
    border: none;
    padding: 12px 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.search-submit-btn:hover {
    background: #096dd9;
}

.search-results {
    margin-top: 16px;
}

.user-result-item {
    background: #f9f9f9;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 8px;
    border-left: 3px solid #1890ff;
}

.user-name {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}

.user-details {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}

.user-detail-item {
    background: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    color: #666;
}

.user-actions {
    display: flex;
    gap: 8px;
}

.action-btn {
    background: #1890ff;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.action-btn:hover {
    background: #096dd9;
}

.action-btn.copy-btn {
    background: #52c41a;
}

.action-btn.copy-btn:hover {
    background: #389e0d;
}

/* 设置页面 */
.settings-container {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.setting-item {
    margin-bottom: 16px;
}

.setting-item:last-child {
    margin-bottom: 0;
}

.setting-item label {
    display: block;
    font-size: 14px;
    color: #333;
    margin-bottom: 8px;
    font-weight: 500;
}

/* 弹窗 */
.mobile-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    display: none;
    justify-content: center;
    align-items: flex-start;
    padding: 20px;
    overflow-y: auto;
}

.mobile-modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 12px;
    width: 100%;
    max-width: 400px;
    max-height: 80vh;
    overflow-y: auto;
    margin-top: 40px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #f0f0f0;
}

.modal-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.modal-close {
    background: none;
    border: none;
    font-size: 18px;
    color: #999;
    cursor: pointer;
    padding: 4px;
}

.modal-body {
    padding: 20px;
}

/* 工单详情样式 */
.detail-section {
    margin-bottom: 16px;
}

.detail-section:last-child {
    margin-bottom: 0;
}

.detail-label {
    display: block;
    font-size: 12px;
    color: #666;
    margin-bottom: 4px;
    font-weight: 500;
}

.detail-value {
    font-size: 14px;
    color: #333;
    word-break: break-word;
}

.detail-value a {
    color: #1890ff;
    text-decoration: none;
}

.detail-value a:hover {
    text-decoration: underline;
}

/* 详情行样式 - 标签和值在同一行 */
.detail-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 8px;
}

.detail-label {
    font-size: 14px;
    color: #666;
    font-weight: 500;
    white-space: nowrap;
    flex-shrink: 0;
    min-width: 80px;
}

.detail-value {
    font-size: 14px;
    color: #333;
    flex: 1;
    word-break: break-word;
    line-height: 1.4;
}

/* 可复制文本样式 */
.copyable-text {
    color: #1890ff;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
    position: relative;
}

.copyable-text:hover {
    background-color: #e6f7ff;
    color: #0050b3;
}

.copyable-text:active {
    background-color: #bae7ff;
    transform: scale(0.98);
}

/* 工作流列表样式 - 仿照参考图 */
.workflow-list {
    margin-top: 8px;
    background: white;
    border-radius: 8px;
    overflow: hidden;
}

.workflow-item {
    border-bottom: 1px solid #f0f0f0;
    padding: 12px 16px;
}

.workflow-item:last-child {
    border-bottom: none;
}

.workflow-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.workflow-left {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.workflow-role {
    font-size: 13px;
    color: #333;
    font-weight: 500;
}

.workflow-user {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #666;
}

.workflow-user i {
    width: 20px;
    height: 20px;
    background: #1890ff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 10px;
}

.workflow-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.workflow-status .status-badge {
    font-size: 11px;
    color: white;
    padding: 3px 8px;
    border-radius: 4px;
    font-weight: 500;
    white-space: nowrap;
}

.workflow-time {
    font-size: 11px;
    color: #999;
    white-space: nowrap;
}

.workflow-remark {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #f5f5f5;
    font-size: 12px;
    color: #666;
    line-height: 1.4;
}

/* 钉钉用户名样式 - 移动端 */
.dingtalk-user {
    color: #1890ff !important;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 3px;
    transition: all 0.2s ease;
    text-decoration: none;
    position: relative;
    -webkit-tap-highlight-color: rgba(24, 144, 255, 0.1);
}

.dingtalk-user:hover,
.dingtalk-user:active {
    background-color: #e6f7ff;
    color: #0050b3 !important;
}

/* 移动端触摸反馈 */
.dingtalk-user:active {
    background-color: #bae7ff;
    transform: scale(0.98);
}

/* 添加钉钉图标提示 */
.dingtalk-user::after {
    content: "📱";
    font-size: 9px;
    margin-left: 3px;
    opacity: 0.7;
}

/* 消息提示 */
.toast-container {
    position: fixed;
    top: 70px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3000;
    pointer-events: none;
}

.toast {
    background: #333;
    color: white;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-20px);
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: auto;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast.success {
    background: #52c41a;
}

.toast.error {
    background: #ff4d4f;
}

.toast.warning {
    background: #faad14;
}

.toast.info {
    background: #1890ff;
}

/* 响应式调整 */
@media (max-width: 480px) {
    .mobile-main {
        padding: 12px;
    }
    
    .mobile-filters {
        padding: 12px;
    }
    
    .mobile-ticket-item {
        padding: 12px;
    }
    
    .search-container {
        padding: 12px;
    }
    
    .settings-container {
        padding: 12px;
    }
    
    .modal-content {
        margin-top: 20px;
    }
    
    .modal-body {
        padding: 16px;
    }
}

/* 移动端操作按钮 */
.status-action-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.status-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    color: white;
}

.mobile-status-0 {
    background: #fa8c16; /* 待受理 */
}

.mobile-status-1 {
    background: #1890ff; /* 受理中 */
}

.mobile-status-2 {
    background: #52c41a; /* 已解决 */
}

.mobile-status-3 {
    background: #8c8c8c; /* 已关闭 */
}

.mobile-status-4 {
    background: #faad14; /* 已挂起 */
}

.mobile-action-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.mobile-action-btn {
    background: #1890ff;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.mobile-action-btn:hover {
    background: #096dd9;
    transform: translateY(-1px);
}

.mobile-action-btn:active {
    transform: translateY(0);
}

.mobile-action-btn.accept-btn {
    background: #52c41a;
}

.mobile-action-btn.accept-btn:hover {
    background: #389e0d;
}

.mobile-action-btn.resolve-btn {
    background: #722ed1;
}

.mobile-action-btn.resolve-btn:hover {
    background: #531dab;
}

.mobile-action-btn.transfer-btn {
    background: #fa8c16;
}

.mobile-action-btn.transfer-btn:hover {
    background: #d46b08;
}

.mobile-action-btn.suspend-btn {
    background: #faad14;
}

.mobile-action-btn.suspend-btn:hover {
    background: #d48806;
}

.mobile-action-btn.resume-btn {
    background: #52c41a;
}

.mobile-action-btn.resume-btn:hover {
    background: #389e0d;
}

.mobile-action-btn i {
    font-size: 11px;
}

/* 深色模式 */
@media (prefers-color-scheme: dark) {
    body {
        background-color: #1a1a1a;
        color: #e6e6e6;
    }
    
    .mobile-filters,
    .mobile-ticket-item,
    .search-container,
    .settings-container,
    .mobile-pagination {
        background: #2a2a2a;
        color: #e6e6e6;
    }
    
    .mobile-select,
    .mobile-input {
        background: #3a3a3a;
        border-color: #4a4a4a;
        color: #e6e6e6;
    }
    
    .modal-content {
        background: #2a2a2a;
        color: #e6e6e6;
    }
    
    .mobile-sidebar {
        background: #2a2a2a;
    }
    
    .user-result-item {
        background: #3a3a3a;
    }
    
    .user-detail-item {
        background: #4a4a4a;
        color: #e6e6e6;
    }
}
