/* 全局样式 */
* {
    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;
    }
}