body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; background-color: #f3f4f6; margin: 0; color: #333; }
.login-body { display: flex; justify-content: center; align-items: center; height: 100vh; padding: 20px; box-sizing: border-box; }
.login-box { background: #ffffff; padding: 40px; border-radius: 8px; box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); width: 100%; max-width: 320px; box-sizing: border-box; }
.login-box h2 { margin-top: 0; margin-bottom: 24px; text-align: center; }
.form-group { margin-bottom: 16px; }
.form-group input { width: 100%; padding: 10px; border: 1px solid #ddd; border-radius: 4px; box-sizing: border-box; font-size: 14px; }
.form-group input:focus { border-color: #3b82f6; outline: none; }
.btn-primary { width: 100%; padding: 10px; background-color: #3b82f6; color: white; border: none; border-radius: 4px; font-size: 16px; cursor: pointer; transition: background-color 0.2s; box-sizing: border-box; text-align: center; }
.btn-primary:hover { background-color: #2563eb; }
.error-msg { font-size: 14px; margin-bottom: 16px; text-align: center; display: none; }
.app-container { display: flex; height: 100vh; overflow: hidden; }
.sidebar { width: 220px; background: #1e293b; color: white; display: flex; flex-direction: column; flex-shrink: 0; }
.sidebar-logo { padding: 20px; font-size: 18px; font-weight: bold; background: #0f172a; text-align: center; letter-spacing: 1px; }
.sidebar-menu { list-style: none; padding: 0; margin: 0; }
.sidebar-menu li a { display: block; padding: 16px 20px; color: #cbd5e1; text-decoration: none; border-bottom: 1px solid #334155; transition: background 0.2s; }
.sidebar-menu li a:hover { background: #3b82f6; color: white; }
.text-danger { color: #f87171 !important; }
.main-content { flex: 1; display: flex; flex-direction: column; background: #f1f5f9; overflow-y: auto; overflow-x: hidden; }
.topbar { background: white; padding: 15px 25px; display: flex; justify-content: space-between; align-items: center; box-shadow: 0 1px 3px rgba(0,0,0,0.05); }
.page-title { font-size: 18px; font-weight: 500; }
.user-info { font-size: 14px; color: #64748b; }
.user-info span { color: #3b82f6; font-weight: bold; }
.content-body { padding: 25px; }
.card-panel { background: white; padding: 20px; border-radius: 8px; box-shadow: 0 2px 4px rgba(0,0,0,0.05); box-sizing: border-box; }
.stat-cards { display: flex; gap: 20px; }
.stat-card { flex: 1; padding: 25px 20px; border-radius: 8px; color: white; box-shadow: 0 4px 6px rgba(0,0,0,0.1); box-sizing: border-box; }
.stat-card h3 { margin: 0 0 10px 0; font-size: 16px; font-weight: 500; opacity: 0.9; }
.stat-card .num { font-size: 36px; font-weight: bold; margin-bottom: 5px; }
.stat-card .desc { font-size: 13px; opacity: 0.8; }
.bg-green { background: linear-gradient(135deg, #059669, #10b981); }
.bg-blue { background: linear-gradient(135deg, #2563eb, #3b82f6); }
.bg-orange { background: linear-gradient(135deg, #d97706, #f59e0b); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; }
.form-item label { display: block; font-size: 14px; font-weight: 500; margin-bottom: 8px; color: #475569; }
.form-item input[type="text"], .form-item input[type="tel"], .form-item input[type="date"], .form-item input[type="password"], .form-item select, .form-item textarea { width: 100%; padding: 10px; border: 1px solid #cbd5e1; border-radius: 4px; box-sizing: border-box; font-family: inherit; font-size: 14px; }
.form-item input:focus, .form-item select:focus, .form-item textarea:focus { border-color: #3b82f6; outline: none; }
.form-item textarea { resize: vertical; min-height: 80px; }
.radio-group { display: flex; gap: 15px; padding-top: 8px; flex-wrap: wrap; }
.radio-group label { display: flex; align-items: center; gap: 5px; font-weight: normal; cursor: pointer; }
.form-actions { display: flex; gap: 15px; margin-top: 30px; padding-top: 20px; border-top: 1px solid #e2e8f0; }
.btn-secondary { padding: 10px 20px; background-color: #f1f5f9; color: #334155; border: 1px solid #cbd5e1; border-radius: 4px; font-size: 14px; cursor: pointer; text-decoration: none; text-align: center; box-sizing: border-box; }
.btn-secondary:hover { background-color: #e2e8f0; }
.data-table { width: 100%; border-collapse: collapse; margin-top: 15px; background: white; font-size: 14px; }
.data-table th, .data-table td { padding: 12px; text-align: left; border-bottom: 1px solid #e2e8f0; }
.data-table th { background-color: #f8fafc; font-weight: 500; color: #475569; }
.data-table tr:hover { background-color: #f1f5f9; }
.toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; gap: 10px; }
.search-box { display: flex; gap: 10px; flex: 1; min-width: 200px; }
.search-box input { padding: 8px; border: 1px solid #cbd5e1; border-radius: 4px; flex: 1; }
.btn-sm { padding: 5px 10px; font-size: 12px; border-radius: 3px; cursor: pointer; text-decoration: none; display: inline-block; }
.btn-edit { background: #3b82f6; color: white; border: none; }
.btn-delete { background: #ef4444; color: white; border: none; }
.pagination { display: flex; gap: 10px; justify-content: center; margin-top: 20px; align-items: center; flex-wrap: wrap; }
.pagination a, .pagination span { padding: 6px 12px; border: 1px solid #cbd5e1; border-radius: 4px; text-decoration: none; color: #333; }
.pagination .active { background: #3b82f6; color: white; border-color: #3b82f6; }
.pwd-card { max-width: 500px; width: 100%; }
.pwd-card h2 { margin-top: 0; margin-bottom: 20px; }
.pwd-form .form-item { margin-bottom: 15px; }
.pwd-form .form-actions { margin-top: 25px; padding-top: 20px; border-top: 1px solid #e2e8f0; }
.btn-pwd { width: auto; padding: 10px 30px; }
.toast-container { position: fixed; top: 30px; left: 50%; transform: translateX(-50%); z-index: 9999; display: flex; flex-direction: column; gap: 10px; pointer-events: none; }
.toast-msg { min-width: 200px; padding: 12px 24px; border-radius: 4px; color: #fff; text-align: center; box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); font-size: 14px; opacity: 0; transform: translateY(-20px); transition: opacity 0.3s ease, transform 0.3s ease; }
.toast-msg.show { opacity: 1; transform: translateY(0); }
.toast-success { background-color: #10b981; }
.toast-error { background-color: #ef4444; }

@media (max-width: 768px) {
    .app-container { flex-direction: column; }
    .sidebar { width: 100%; height: auto; flex-shrink: 0; }
    .sidebar-logo { padding: 15px; font-size: 16px; }
    .sidebar-menu { display: flex; overflow-x: auto; white-space: nowrap; -webkit-overflow-scrolling: touch; }
    .sidebar-menu li { flex: 1 1 auto; }
    .sidebar-menu li a { border-bottom: none; border-right: 1px solid #334155; padding: 12px 15px; text-align: center; font-size: 14px; }
    .content-body { padding: 15px; }
    .topbar { flex-direction: column; align-items: flex-start; gap: 10px; padding: 15px; }
    .stat-cards { flex-direction: column; gap: 15px; }
    .form-grid { grid-template-columns: 1fr; gap: 15px; }
    .toolbar { flex-direction: column; align-items: stretch; }
    .search-box { flex-direction: column; width: 100%; }
    .search-box input { width: 100%; box-sizing: border-box; }
    .search-box button, .search-box a { width: 100%; box-sizing: border-box; }
    .toolbar > a.btn-primary { width: 100% !important; text-align: center; box-sizing: border-box; }
    .form-actions { flex-direction: column; gap: 10px; }
    .form-actions button, .form-actions a { width: 100% !important; box-sizing: border-box; }
    .data-table { display: block; overflow-x: auto; white-space: nowrap; -webkit-overflow-scrolling: touch; border: 1px solid #e2e8f0; border-radius: 4px; }
    .login-box { padding: 30px 20px; }
}
/* ================= 表单分块与人体工学布局优化 ================= */
.form-section {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px dashed #e2e8f0;
}
.form-section:last-of-type {
    border-bottom: none;
    padding-bottom: 0;
}
.form-section-title {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 18px;
    border-left: 4px solid #3b82f6;
    padding-left: 10px;
    line-height: 1;
}
.form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 15px;
}
.form-row .form-item {
    margin-bottom: 0; /* 抵消原有 .form-item 的 margin */
}
/* 利用 flex 按比例分配宽度，并设置最小宽度防止挤压 */
.form-row .col-1 { flex: 1; min-width: 150px; }
.form-row .col-2 { flex: 2; min-width: 200px; }
.form-row .col-3 { flex: 3; min-width: 250px; }

/* 移动端自动转为单列 */
@media (max-width: 768px) {
    .form-row {
        flex-direction: column;
        gap: 15px;
    }
    .form-row .col-1,
    .form-row .col-2,
    .form-row .col-3 {
        width: 100%;
        flex: none;
    }
}