/* 全局样式 */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Microsoft YaHei', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 20px;
}

h1 {
    text-align: center;
    color: #1e88e5;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e0e0e0;
}

h2 {
    color: #0d47a1;
    margin-bottom: 15px;
    font-size: 1.3rem;
}

/* 表单部分样式 */
.form-section {
    margin-bottom: 30px;
    padding: 15px;
    background-color: #f9f9f9;
    border-radius: 5px;
    border-left: 4px solid #1e88e5;
}

.basic-info {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

.form-group {
    margin-bottom: 15px;
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #555;
}

input[type="text"],
input[type="date"],
select,
textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #1e88e5;
    box-shadow: 0 0 0 2px rgba(30, 136, 229, 0.2);
}

/* 工作项表格样式 */
.work-items {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 15px;
}

th, td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

th {
    background-color: #1e88e5;
    color: white;
}

tr:nth-child(even) {
    background-color: #f2f2f2;
}

tr:hover {
    background-color: #e3f2fd;
}

/* 按钮样式 */
.btn {
    padding: 10px 15px;
    background-color: #f5f5f5;
    color: #333;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s;
}

.btn:hover {
    background-color: #e0e0e0;
}

.btn.primary {
    background-color: #1e88e5;
    color: white;
}

.btn.primary:hover {
    background-color: #1976d2;
}

.buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
}

/* 说明部分样式 */
.instructions ol {
    padding-left: 20px;
}

.instructions li {
    margin-bottom: 8px;
}

/* 确认声明部分样式 */
.confirmation {
    padding: 15px;
    background-color: #e3f2fd;
    border-radius: 5px;
}

.signature-area {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 15px;
}

/* 工作项操作按钮 */
.action-btn {
    padding: 5px 10px;
    margin-right: 5px;
    background-color: #f5f5f5;
    border: none;
    border-radius: 3px;
    cursor: pointer;
}

.delete-btn {
    background-color: #ffcdd2;
    color: #c62828;
}

.delete-btn:hover {
    background-color: #ef9a9a;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .basic-info {
        grid-template-columns: 1fr;
    }
    
    .signature-area {
        flex-direction: column;
        gap: 10px;
    }
    
    th, td {
        padding: 8px 10px;
    }
    
    .buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .btn {
        width: 100%;
        margin-bottom: 10px;
    }
    
    /* 移动端工作项表格优化 */
    #workTable {
        display: block;
    }
    
    #workTable thead {
        display: none;
    }
    
    #workTable tbody, 
    #workTable tr {
        display: block;
        width: 100%;
    }
    
    #workTable tr {
        margin-bottom: 15px;
        border: 1px solid #ddd;
        border-radius: 5px;
        padding: 10px;
        background-color: #fff;
        box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    }
    
    #workTable td {
        display: block;
        padding: 8px;
        position: relative;
        border-bottom: 1px solid #eee;
        text-align: left;
    }
    
    #workTable td:last-child {
        border-bottom: none;
    }
    
    #workTable td:before {
        content: attr(data-label);
        display: block;
        font-weight: bold;
        margin-bottom: 5px;
        color: #555;
        font-size: 0.9em;
    }
    
    #workTable td input, 
    #workTable td select, 
    #workTable td textarea {
        width: 100%;
        margin-top: 20px;
    }
}

/* 添加工作项按钮位置 */
#addWorkItem {
    margin-top: 15px;
}

/* 工作周期下拉菜单样式 */
select.work-cycle {
    background-color: white;
}

/* 工作改善设想文本框样式 */
textarea.improvement, textarea.work-content {
    min-height: 60px;
    resize: vertical;
    overflow-y: hidden;
    transition: height 0.2s ease;
    line-height: 1.5;
    font-family: inherit;
    width: 100%;
    padding: 8px;
    box-sizing: border-box;
}

/* 确保文本框在移动端也有良好的体验 */
@media (max-width: 768px) {
    textarea.improvement, textarea.work-content {
        min-height: 60px;
    }
}
/* 工作信息录入表专用样式 */

/* 表格列宽度设置 */
#basicWorkTable th:nth-child(1),
#qualityWorkTable th:nth-child(1) {
    min-width: 60px; /* 序号列 */
}

#basicWorkTable th:nth-child(2),
#qualityWorkTable th:nth-child(2) {
    min-width: 200px; /* 工作内容/工作流程列 */
}

#basicWorkTable th:nth-child(3),
#qualityWorkTable th:nth-child(3) {
    min-width: 120px; /* 工作周期列 */
}

#basicWorkTable th:nth-child(4),
#qualityWorkTable th:nth-child(4) {
    min-width: 180px; /* 工作方式或工具/流程运作方式列 */
}

#basicWorkTable th:nth-child(5) {
    min-width: 120px; /* 承接科室列 */
}

#basicWorkTable th:nth-child(6) {
    min-width: 120px; /* 承接岗位列 */
}

#basicWorkTable th:nth-child(7),
#qualityWorkTable th:nth-child(5),
#qualityWorkTable th:nth-child(6) {
    min-width: 100px; /* 承接人数/是否跨科室/是否跨部门列 */
}

#basicWorkTable th:nth-child(8),
#qualityWorkTable th:nth-child(8) {
    min-width: 150px; /* 工作效能分类列 */
}

#basicWorkTable th:nth-child(9),
#qualityWorkTable th:nth-child(7) {
    min-width: 180px; /* 低效工作提效方式/无效点识别列 */
}

#basicWorkTable th:nth-child(10),
#qualityWorkTable th:nth-child(9) {
    min-width: 180px; /* 提效方式列 */
}

#basicWorkTable th:nth-child(11),
#qualityWorkTable th:nth-child(10) {
    min-width: 180px; /* 改善设想列 */
}

#basicWorkTable th:nth-child(12),
#qualityWorkTable th:nth-child(11) {
    min-width: 120px; /* 预计可提效人数列 */
}

#basicWorkTable th:nth-child(13) {
    min-width: 80px; /* 操作列 */
}

/* 表格容器样式 */
.table-container {
    margin-bottom: 30px;
    overflow-x: auto;
    max-width: 100%;
    display: block;
    width: 100%;
    position: relative;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 15px;
    white-space: nowrap;
}

table {
    width: 100%;
    min-width: max-content;
    table-layout: auto;
}

.table-title {
    font-weight: bold;
    margin-bottom: 10px;
    color: #1e88e5;
}

/* 工作方式工具样式 */
.work-method-tools {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

/* 复选框组样式 */
.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.checkbox-item {
    display: flex;
    align-items: center;
    margin-right: 15px;
}

.checkbox-item input[type="checkbox"] {
    margin-right: 5px;
}

/* 导航链接样式 */
.nav-links {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.nav-links a {
    margin: 0 15px;
    text-decoration: none;
    color: #1e88e5;
    font-weight: bold;
    padding: 5px 10px;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.nav-links a:hover {
    background-color: #e3f2fd;
}

.nav-links a.active {
    background-color: #1e88e5;
    color: white;
}

/* 下拉框样式 */
select {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #fff;
}

/* 数字输入框样式 */
#basicWorkTable input[type="number"].people-count,
#basicWorkTable input[type="number"].efficiency-count,
#qualityWorkTable input[type="number"].workflow-efficiency-count {
    width: 100px;
    height: 40px;
    padding: 10px;
    text-align: center;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background-color: #fff;
    transition: border-color 0.3s, box-shadow 0.3s;
    margin: 2px 0;
    appearance: textfield;
}

#basicWorkTable input[type="number"].people-count:focus,
#basicWorkTable input[type="number"].efficiency-count:focus,
#qualityWorkTable input[type="number"].workflow-efficiency-count:focus {
    border-color: #1e88e5;
    box-shadow: 0 0 0 2px rgba(30, 136, 229, 0.2);
    outline: none;
}

#basicWorkTable input[type="number"].people-count:hover,
#basicWorkTable input[type="number"].efficiency-count:hover,
#qualityWorkTable input[type="number"].workflow-efficiency-count:hover {
    border-color: #1e88e5;
}

/* 文本区域样式 */
textarea.work-content,
textarea.workflow-content,
textarea.improvement-idea,
textarea.workflow-improvement-idea {
    min-height: 60px;
    resize: vertical;
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

/* 移动端适配样式 */
@media (max-width: 768px) {
    /* 整体容器样式调整 */
    .container {
        padding: 10px;
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }
    
    /* 移动端表格布局优化 */
    #basicWorkTable, #qualityWorkTable {
        display: block;
        width: 100%;
        border-collapse: collapse;
        table-layout: fixed;
    }

    #basicWorkTable thead, #qualityWorkTable thead {
        display: none;
    }

    #basicWorkTable tbody, #basicWorkTable tr,
    #qualityWorkTable tbody, #qualityWorkTable tr {
        display: block;
        width: 100%;
    }

    #basicWorkTable tr, #qualityWorkTable tr {
        margin-bottom: 20px;
        border: 1px solid #e0e0e0;
        border-radius: 8px;
        padding: 15px;
        background-color: #fff;
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
        width: 100%;
        box-sizing: border-box;
        display: flex;
        flex-direction: column;
        gap: 15px;
    }

    #basicWorkTable td, #qualityWorkTable td {
        display: block;
        width: 100%;
        text-align: left;
        padding: 10px 0;
        border-bottom: 1px solid #f0f0f0;
        position: relative;
        box-sizing: border-box;
        word-wrap: break-word;
        overflow-wrap: break-word;
        white-space: normal;
    }

    #basicWorkTable td:last-child, #qualityWorkTable td:last-child {
        border-bottom: none;
    }

    #basicWorkTable td:before, #qualityWorkTable td:before {
        content: attr(data-label);
        display: block;
        font-weight: bold;
        margin-bottom: 12px;
        color: #333;
        font-size: 14px;
    }

    /* 动态行特定样式 */
    .dynamic-row td {
        margin-bottom: 20px;
        padding: 15px 0;
    }

    .dynamic-row td:before {
        margin-bottom: 15px;
    }

    .dynamic-row input[type="text"],
    .dynamic-row input[type="number"],
    .dynamic-row select,
    .dynamic-row textarea {
        margin-top: 8px;
    }

    /* 移动端输入框样式优化 */
    #basicWorkTable input[type="text"],
    #basicWorkTable input[type="number"],
    #basicWorkTable select,
    #basicWorkTable textarea,
    #qualityWorkTable input[type="text"],
    #qualityWorkTable input[type="number"],
    #qualityWorkTable select,
    #qualityWorkTable textarea {
        width: 100%;
        margin: 5px 0;
        padding: 10px;
        font-size: 14px;
        border: 1px solid #ddd;
        border-radius: 4px;
        box-sizing: border-box;
        max-width: 100%;
    }

    .btn {
        width: 100%;
        margin: 10px 0;
        padding: 12px;
        font-size: 16px;
        border-radius: 4px;
        box-sizing: border-box;
    }

    /* 移动端表格容器样式优化 */
    .table-container {
        padding: 10px;
        margin-bottom: 20px;
        overflow-x: hidden;
        border: none;
        width: 100%;
        box-sizing: border-box;
        white-space: normal;
    }

    .table-title {
        font-size: 18px;
        margin-bottom: 15px;
        text-align: center;
        padding-bottom: 10px;
        border-bottom: 1px solid #e0e0e0;
        width: 100%;
    }

    /* 表单编辑模式样式 */
    .form-edit-mode {
        display: flex;
        flex-direction: column;
        background-color: #f9f9f9;
        padding: 15px;
        border-radius: 8px;
        margin-bottom: 20px;
        box-shadow: 0 2px 5px rgba(0,0,0,0.1);
        width: 100%;
        box-sizing: border-box;
    }

    .form-edit-mode .form-group {
        margin-bottom: 15px;
        display: flex;
        flex-direction: column;
        width: 100%;
    }

    .form-edit-mode label {
        font-weight: bold;
        margin-bottom: 8px;
        color: #333;
    }

    .form-edit-mode input[type="text"],
    .form-edit-mode input[type="number"],
    .form-edit-mode select,
    .form-edit-mode textarea {
        padding: 12px;
        border: 1px solid #ddd;
        border-radius: 4px;
        font-size: 16px;
        width: 100%;
        background-color: #fff;
        box-sizing: border-box;
    }

    .form-edit-mode textarea {
        min-height: 100px;
    }

    .form-edit-mode .btn-group {
        display: flex;
        justify-content: space-between;
        margin-top: 15px;
        width: 100%;
    }

    .form-edit-mode .btn {
        flex: 1;
        margin: 0 5px;
        padding: 12px;
        font-size: 16px;
    }
    
    /* 修复移动端表格行样式 */
    #basicWorkTable tr td, 
    #qualityWorkTable tr td {
        clear: both;
        overflow: hidden;
        margin-bottom: 10px;
        width: 100%;
    }
    
    /* 修复移动端删除按钮样式 */
    #basicWorkTable .delete-btn {
        margin-top: 10px;
        background-color: #f44336;
        color: white;
        border: none;
        width: 100%;
    }
    
    /* 基本信息区域移动端优化 */
    .basic-info {
        display: flex;
        flex-direction: column;
        width: 100%;
    }
    
    .basic-info .form-group {
        margin-bottom: 15px;
        width: 100%;
    }
    
    .basic-info input {
        width: 100%;
        padding: 10px;
        border: 1px solid #ddd;
        border-radius: 4px;
        box-sizing: border-box;
    }
    
    /* 确认声明区域移动端优化 */
    .confirmation {
        padding: 15px;
        width: 100%;
        box-sizing: border-box;
    }
    
    .signature-area {
        display: flex;
        flex-direction: column;
        width: 100%;
    }
    
    .signature-area .form-group {
        margin-bottom: 15px;
        width: 100%;
    }
    
    .signature-area input {
        width: 100%;
        padding: 10px;
        border: 1px solid #ddd;
        border-radius: 4px;
        box-sizing: border-box;
    }
    
    /* 按钮区域移动端优化 */
    .buttons {
        display: flex;
        flex-direction: column;
        width: 100%;
    }
    
    .buttons .btn {
        margin-bottom: 10px;
    }
    
    /* 表单区域移动端优化 */
    .form-section {
        width: 100%;
        box-sizing: border-box;
        padding: 0;
        margin-bottom: 20px;
    }
    
    h1, h2 {
        font-size: 20px;
        text-align: center;
        margin: 15px 0;
    }
}