/* 基础重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* 全局样式 */
body {
    padding: 10px;
    background-color: #f5f5f5;
    padding-bottom: 80px; /* 预留手机端Toast位置 */
}

/* 按钮组样式 */
.btn-group {
    display: flex;
    gap: 12px;
    margin-bottom: 15px;
    flex-wrap: wrap; /* 手机端按钮自动换行，避免挤压 */
}

button {
    flex: 1;
    min-width: 120px; /* 保证手机端触摸区域 */
    padding: 12px 0;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    color: white;
    background-color: #2563eb;
    cursor: pointer;
}

button:nth-child(2) {
    background-color: #10b981;
}

/* 表格容器（核心：手机端横向滚动） */
.table-container {
    overflow-x: auto;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin: 0 auto;
    max-width: 100%;
}

table {
    width: 100%;
    min-width: 900px; /* 保证桌面端列宽充足 */
    border-collapse: collapse;
    background-color: white;
}

th, td {
    padding: 12px 8px;
    text-align: left;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
}

th {
    background-color: #f8f9fa;
    color: #666;
    font-weight: 600;
}

/* 接种状态列单独设置最小宽度（第8列） */
th:nth-child(8),
td:nth-child(8) {
    min-width: 120px; 
}

/* 疫苗类型标签 */
.type-tag {
    display: inline-block;
    padding: 4px 6px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.type-free {
    background-color: #d1fae5;
    color: #059669;
}

.type-supplement {
    background-color: #e9f2ff;
    color: #2563eb;
}

/* 表单元素（适配手机端） */
.status-select {
    width: 100%;
    padding: 6px 4px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background-color: white;
    appearance: auto;
    -webkit-appearance: menulist;
}

.date-input {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background-color: white;
}

.static-text {
    line-height: 1.4;
    color: #333;
}

/* Toast 提示（响应式位置：桌面顶部、手机底部） */
.toast-container {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 85%;
    max-width: 400px;
}

/* 桌面端 Toast 位置（≥768px） */
@media (min-width: 768px) {
    .toast-container {
        top: 20px;
        bottom: auto;
    }
}

/* 手机端 Toast 位置（≤767px） */
@media (max-width: 767px) {
    .toast-container {
        bottom: 20px;
        top: auto;
    }

    /* 手机端字体缩小，避免挤压 */
    body, th, td, .status-select, .date-input, button {
        font-size: 13px;
    }

    /* 手机端按钮内边距调整 */
    button {
        padding: 10px 0;
    }

    /* 手机端表格内边距优化 */
    th, td {
        padding: 10px 6px;
    }
}

/* Toast 样式细节 */
.toast {
    padding: 14px 18px;
    border-radius: 8px;
    color: white;
    font-size: 14px;
    line-height: 1.5;
    text-align: center;
    box-shadow: 0 3px 10px rgba(0,0,0,0.2);
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Toast 状态色 */
.toast.success {
    background-color: #10b981;
}
.toast.warning {
    background-color: #f59e0b;
}
.toast.error {
    background-color: #ef4444;
}
.toast.info {
    background-color: #2563eb;
}

/* Toast 显示状态 */
.toast.show {
    opacity: 1;
    transform: translateY(0);
}
