* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    background: #f0f4f8;
    padding: 20px;
    min-height: 100vh;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    border-radius: 32px;
    box-shadow: 0 20px 40px -12px rgba(0, 0, 0, 0.12);
    overflow: hidden;
}

.header {
    padding: 40px 38px 0 28px;
    text-align: center;
}

.header h1 {
    font-size: 28px;
    color: #0f3b4f;
}

.sub-tabs {
    display: flex;
    gap: 12px;
    padding: 0 28px;
    border-bottom: 1px solid #e2e8f0;
    margin-top: 20px;
}

.sub-tab {
    padding: 10px 20px;
    font-size: 18px;
    font-weight: 500;
    background: transparent;
    border: none;
    cursor: pointer;
    color: #4a5b6e;
    border-radius: 40px 40px 0 0;
}

.sub-tab.active {
    color: #2c7da0;
    background: #f8fafc;
    font-weight: 600;
    border-bottom: 2px solid #2c7da0;
}

.subtab-content {
    padding: 28px;
}

.card {
    background: white;
    border-radius: 24px;
    padding: 24px;
    margin-bottom: 28px;
    border: 1px solid #e9edf2;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
}

.card-title {
    font-size: 18px;
    font-weight: 600;
    color: #1e4a6e;
    margin-bottom: 18px;
    padding-bottom: 8px;
    border-bottom: 2px solid #eef2f6;
}

input,
textarea,
select {
    width: 100%;
    padding: 12px 16px;
    font-size: 18px;
    border: 1px solid #cbd5e1;
    border-radius: 40px;
    margin-bottom: 18px;
    outline: none;
}

textarea {
    border-radius: 24px;
    resize: vertical;
}

button {
    background: #2c7da0;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 40px;
    cursor: pointer;
    font-size: 15px;
}

button:hover {
    background: #1e5a74;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 16px;
    table-layout: fixed;
}

.data-table th,
.data-table td {
    border: 1px solid #e2e8f0;
    padding: 10px 12px;
    text-align: center;
    vertical-align: middle;
    white-space: normal;
    word-break: break-word;
}

.data-table th {
    background: #f8fafc;
    font-weight: 600;
    color: #1e4a6e;
}

.data-table tr:hover {
    background: #f8fafc;
}

.data-table a {
    color: #2c7da0;
    text-decoration: none;
    font-size: 16px;
}

.data-table a:hover {
    text-decoration: underline;
}

.data-table button {
    background: none;
    border: none;
    color: #2c7da0;
    cursor: pointer;
    padding: 0;
    font-size: 16px;
}

.data-table button:hover {
    text-decoration: underline;
    background: none;
}

/* 报价单表格列宽 */
.quote-table th:nth-child(1) {
    width: 140px;
} /* 报价日期 */
.quote-table th:nth-child(2) {
    /* 客户自适应 */
}
.quote-table th:nth-child(3) {
    width: 140px;
} /* 代理事项 */
.quote-table th:nth-child(4) {
    width: 90px;
} /* 代理费 */
.quote-table th:nth-child(5) {
    width: 90px;
} /* 确认方式 */
.quote-table th:nth-child(6) {
    width: 80px;
} /* 状态 */
.quote-table th:nth-child(7) {
    width: 80px;   /* 归属 */
}
.quote-table th:nth-child(8) {
    width: 252px;
} /* 操作，原220px加32px */

/* 代理业务表格列宽 */
.agent-table th:nth-child(1) {
    width: 140px;
} /* 承接日期 */
.agent-table th:nth-child(2) {
    /* 客户自适应 */
}
.agent-table th:nth-child(3) {
    width: 140px;
} /* 代理事项 */
.agent-table th:nth-child(4) {
    width: 90px;
} /* 代理费 */
.agent-table th:nth-child(5) {
    width: 80px;
} /* 状态 */
.agent-table th:nth-child(6) {
    width: 90px;
} /* 支付情况 */
.agent-table th:nth-child(7) {
    width: 80px;
} /* 归属 */
.agent-table th:nth-child(8) {
    width: 252px;
} /* 操作，原220px加32px */

/* 交付单表格列宽 */
.delivery-table th:nth-child(1) {
    width: 140px;
} /* 交付日期 */
.delivery-table th:nth-child(2) {
    /* 客户自适应 */
}
.delivery-table th:nth-child(3) {
    width: 140px;
} /* 代理事项 */
.delivery-table th:nth-child(4) {
    width: 90px;
} /* 交付方式 */
.delivery-table th:nth-child(5) {
    width: 90px;
} /* 支付情况 */
.delivery-table th:nth-child(6) {
    width: 80px;   /* 归属 */
}
.delivery-table th:nth-child(7) {
    width: 252px;
} /* 操作，原220px加32px */

.material-item {
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 16px;
    background: #fefefe;
}

.image-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 8px 0;
}

.uploaded-image {
    position: relative;
    display: inline-block;
}

.uploaded-image img {
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    max-width: 100px;
}

.remove-img {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #e53e3e;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    text-align: center;
    line-height: 18px;
    font-size: 12px;
    cursor: pointer;
}

.action-bar {
    position: fixed;
    bottom: 20px;
    right: 20px;
    display: flex;
    gap: 12px;
    z-index: 100;
}

footer {
    text-align: center;
    padding: 20px;
    font-size: 12px;
    color: #8ba0bc;
    border-top: 1px solid #eef2f6;
}

.modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.4);
}

.modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-width: 1000px;
    border-radius: 24px;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: black;
}

@media print {
    .action-bar {
        display: none;
    }
    body {
        background: white;
        padding: 0;
    }
    .container {
        box-shadow: none;
    }
}

@media (max-width: 800px) {
    .sub-tabs {
        flex-wrap: wrap;
    }
    .data-table {
        font-size: 12px;
    }
    .modal-content {
        width: 95%;
        margin: 10% auto;
    }
}

.form-row {
    display: flex;
    margin-bottom: 16px;
    align-items: flex-start;
}

.form-row label {
    width: 100px;
    text-align: right;
    padding-right: 12px;
    margin-top: 8px;
    font-weight: 500;
}

.form-row input,
.form-row textarea,
.form-row select {
    flex: 1;
}

.cost-table td {
    padding: 2px 4px;
}

.cost-table input {
    margin: 0;
    padding: 4px 6px;
    font-size: 16px;
}

#addCostRow,
#editAddCostRow {
    background: #6c9a9f;
    font-size: 13px;
    padding: 4px 12px;
}

.tabs-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: nowrap;
    padding: 0 28px;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 30px;
}

.sub-tabs {
    display: flex;
    gap: 12px;
    flex-shrink: 0;
}

.right-info {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-shrink: 0;
}

.avatar-btn {
    width: 44px;
    height: 44px;
    background-color: #5a9bb5;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.avatar-btn:hover {
    background-color: #3f7a94;
}

.datetime {
    text-align: center;
    font-size: 14px;
    font-weight: 700;
    color: #2c7da0;
    line-height: 1.4;
    white-space: nowrap;
}

.datetime .date {
    font-weight: bold;
}

.datetime .time {
    font-size: 16px;
    font-weight: bold;
}

@media (max-width: 800px) {
    .tabs-bar {
        flex-wrap: wrap;
    }
    .right-info {
        justify-content: flex-end;
        margin-top: 8px;
    }
    .form-row {
        flex-direction: column;
    }
    .form-row label {
        width: auto;
        text-align: left;
        margin-bottom: 4px;
    }
}

/* 交付材料中的材料说明输入框 */
.material-item .material-text {
    font-size: 20px;   /* 根据需求可改为 18px 或更大 */
    line-height: 1.5;
}

/* 后续交代输入框（交付单编辑表单中的 id） */
#edit_delivery_follow_up {
    font-size: 18px;
}

/* 增大事项说明、其他说明输入框字体 */
#quoteForm textarea[name="description"],
#quoteForm textarea[name="other_notes"],
#editQuoteForm #edit_description,
#editQuoteForm #edit_other_notes {
    font-size: 18px;
}

/* 确认交付模态框（代理业务）中的材料说明和后续交代输入框字号 */
#deliveryFromAgentModal .material-text,
#deliveryFromAgentModal textarea[name="follow_up"] {
    font-size: 18px;
}

/* 编辑交付单模态框（交付单列表）中的材料说明和后续交代输入框字号 */
#editDeliveryModal .material-text,
#editDeliveryModal #edit_delivery_follow_up {
    font-size: 18px;
}

/* 可选：报价单中的事项说明、其他说明（为保持一致性，也可自行添加） */
#quoteForm textarea[name="description"],
#quoteForm textarea[name="other_notes"],
#editQuoteForm #edit_description,
#editQuoteForm #edit_other_notes {
    font-size: 18px;
}