* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: "Microsoft YaHei", "微软雅黑", sans-serif; background: #f0f2f5; color: #333; height: 100vh; overflow: hidden; }

/* ===== 登录页 ===== */
.login-overlay { position: fixed; inset: 0; background: linear-gradient(135deg,#4472C4,#2f5597); display: flex; align-items: center; justify-content: center; z-index: 3000; }
.login-box { background: #fff; border-radius: 12px; padding: 36px 32px; width: 340px; max-width: 90vw; box-shadow: 0 12px 40px rgba(0,0,0,0.2); }
.login-box h1 { font-size: 20px; color: #2f5597; text-align: center; }
.login-sub { text-align: center; color: #999; font-size: 13px; margin: 6px 0 22px; }
.login-form input { width: 100%; padding: 11px 14px; margin-bottom: 14px; border: 1px solid #d9d9d9; border-radius: 6px; font-size: 14px; outline: none; }
.login-form input:focus { border-color: #4472C4; }
.btn-block { width: 100%; padding: 11px; font-size: 15px; }
.login-err { color: #ff4d4f; font-size: 13px; min-height: 18px; text-align: center; }
.login-foot { text-align: center; color: #bbb; font-size: 12px; margin-top: 14px; }

/* ===== 顶栏 ===== */
.topbar { height: 52px; background: #2f5597; color: #fff; display: flex; align-items: center; justify-content: space-between; padding: 0 20px; flex-shrink: 0; }
.topbar-title { font-size: 16px; font-weight: bold; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.current-user { font-size: 13px; opacity: 0.95; }

.app { display: flex; flex-direction: column; height: 100vh; }
.body { display: flex; flex: 1; overflow: hidden; }

/* ===== 左侧人员列表 ===== */
.sidebar { width: 320px; background: #fff; border-right: 1px solid #e0e0e0; display: flex; flex-direction: column; flex-shrink: 0; }
.sidebar-header { padding: 16px; background: #4472C4; color: #fff; }
.sidebar-header h1 { font-size: 16px; margin-bottom: 10px; }
.search-box { width: 100%; padding: 8px 12px; border: none; border-radius: 4px; font-size: 13px; outline: none; }
.stats-bar { padding: 8px 16px; background: #f7f8fa; font-size: 12px; color: #666; display: flex; justify-content: space-between; }
.stats-bar span { font-weight: bold; color: #4472C4; }
.people-list { flex: 1; overflow-y: auto; }
.person-item { padding: 10px 16px; border-bottom: 1px solid #f0f0f0; cursor: pointer; transition: background 0.2s; display: flex; justify-content: space-between; align-items: center; }
.person-item:hover { background: #f0f5ff; }
.person-item.active { background: #e6f0ff; border-left: 3px solid #4472C4; padding-left: 13px; }
.person-info { flex: 1; }
.person-name { font-size: 14px; font-weight: bold; }
.person-detail { font-size: 11px; color: #999; margin-top: 2px; }
.status-badge { font-size: 11px; padding: 2px 8px; border-radius: 10px; flex-shrink: 0; }
.status-done { background: #e6f7e6; color: #52c41a; }
.status-pending { background: #fff7e6; color: #faad14; }
.status-incomplete { background: #fff1f0; color: #ff4d4f; }

/* ===== 右侧主区 ===== */
.main { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.tab-bar { display: flex; background: #fff; border-bottom: 1px solid #e0e0e0; padding: 0 20px; }
.tab { padding: 12px 24px; cursor: pointer; font-size: 14px; color: #666; border-bottom: 2px solid transparent; transition: all 0.2s; }
.tab:hover { color: #4472C4; }
.tab.active { color: #4472C4; border-bottom-color: #4472C4; font-weight: bold; }
.tab-content { flex: 1; overflow-y: auto; padding: 20px; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

.empty-state { text-align: center; padding: 80px 20px; color: #999; }
.empty-state .icon { font-size: 48px; margin-bottom: 16px; }
.person-header { background: #fff; border-radius: 8px; padding: 16px 20px; margin-bottom: 16px; box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
.person-header-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; padding-bottom: 12px; border-bottom: 1px solid #f0f0f0; }
.person-header-top h2 { font-size: 18px; color: #333; }
.person-header-top .sub { font-size: 12px; color: #999; margin-top: 2px; }
.info-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px 16px; }
.info-item { font-size: 13px; }
.info-item .label { color: #999; font-size: 11px; margin-bottom: 2px; }
.info-item .value { color: #333; font-weight: 500; word-break: break-all; }
.info-item.full { grid-column: span 2; }
.smoke-tag { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 12px; font-weight: bold; }
.smoke-yes { background: #fff1f0; color: #ff4d4f; }
.smoke-no { background: #f6ffed; color: #52c41a; }

.btn { padding: 8px 16px; border: none; border-radius: 4px; cursor: pointer; font-size: 13px; transition: all 0.2s; }
.btn-primary { background: #4472C4; color: #fff; }
.btn-primary:hover { background: #3a5fa8; }
.btn-success { background: #52c41a; color: #fff; }
.btn-success:hover { background: #45a815; }
.btn-default { background: #f0f0f0; color: #333; }
.btn-default:hover { background: #e0e0e0; }
.btn-warning { background: #faad14; color: #fff; }
.btn-warning:hover { background: #e09b0c; }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-block { display: block; }

.questionnaire { background: #fff; border-radius: 8px; padding: 20px; box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
.q-section { margin-bottom: 24px; padding-bottom: 20px; border-bottom: 1px solid #f0f0f0; }
.q-section:last-child { border-bottom: none; margin-bottom: 0; }
.q-title { font-size: 15px; font-weight: bold; color: #333; margin-bottom: 12px; }
.q-title .q-num { display: inline-block; background: #4472C4; color: #fff; width: 24px; height: 24px; line-height: 24px; text-align: center; border-radius: 50%; font-size: 12px; margin-right: 8px; }
.q-type-tag { display: inline-block; font-size: 11px; font-weight: normal; padding: 1px 8px; border-radius: 8px; margin-left: 8px; vertical-align: middle; }
.q-type-radio { background: #e6f0ff; color: #4472C4; }
.q-type-checkbox { background: #f6ffed; color: #52c41a; }
.q-options { display: flex; flex-wrap: wrap; gap: 10px; }
.radio-option, .checkbox-option { display: flex; align-items: center; gap: 6px; padding: 6px 14px; border: 1px solid #d9d9d9; border-radius: 4px; cursor: pointer; font-size: 13px; transition: all 0.2s; user-select: none; }
.radio-option:hover, .checkbox-option:hover { border-color: #4472C4; background: #f0f5ff; }
.radio-option.selected { border-color: #4472C4; background: #e6f0ff; color: #4472C4; font-weight: bold; }
.radio-option.radio-disabled { border-style: dashed; }
.radio-option.radio-disabled.selected { border-color: #4472C4; background: #e6f0ff; color: #4472C4; font-weight: bold; border-style: solid; }
.checkbox-option.checked { border-color: #4472C4; background: #e6f0ff; color: #4472C4; }
.radio-option input, .checkbox-option input { cursor: pointer; }
.q-hidden { display: none; }

.form-actions { margin-top: 20px; display: flex; gap: 10px; justify-content: flex-end; }

/* 状态选择 */
.status-selector { display: flex; gap: 6px; flex-wrap: wrap; }
.status-btn { padding: 4px 12px; border: 1px solid #d9d9d9; border-radius: 4px; cursor: pointer; font-size: 12px; background: #fff; transition: all 0.2s; }
.status-btn:hover { border-color: #4472C4; }
.status-btn.active-pending { background: #fff7e6; border-color: #faad14; color: #faad14; font-weight: bold; }
.status-btn.active-done { background: #e6f7e6; border-color: #52c41a; color: #52c41a; font-weight: bold; }
.status-btn.active-incomplete { background: #fff1f0; border-color: #ff4d4f; color: #ff4d4f; font-weight: bold; }
.incomplete-reason { margin-top: 8px; padding: 10px; background: #fff7f7; border: 1px solid #ffccc7; border-radius: 4px; }
.incomplete-reason label { font-size: 12px; color: #666; display: block; margin-bottom: 6px; }
.incomplete-reason select { width: 100%; padding: 6px 10px; border: 1px solid #d9d9d9; border-radius: 4px; font-size: 13px; outline: none; }

/* 统计面板 */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat-card { background: #fff; border-radius: 8px; padding: 20px; box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
.stat-card h3 { font-size: 14px; color: #666; margin-bottom: 12px; }
.stat-number { font-size: 32px; font-weight: bold; color: #4472C4; }
.stat-number .unit { font-size: 14px; color: #999; font-weight: normal; }
.progress-bar { height: 8px; background: #f0f0f0; border-radius: 4px; margin-top: 10px; overflow: hidden; }
.progress-fill { height: 100%; background: #52c41a; border-radius: 4px; transition: width 0.3s; }
.dist-list { margin-top: 8px; }
.dist-item { display: flex; justify-content: space-between; align-items: center; padding: 4px 0; font-size: 13px; }
.dist-item .label { color: #555; }
.dist-item .value { color: #4472C4; font-weight: bold; }
.dist-bar { height: 6px; background: #f0f0f0; border-radius: 3px; margin-top: 2px; overflow: hidden; }
.dist-bar-fill { height: 100%; background: #4472C4; border-radius: 3px; }

/* 工具栏 */
.toolbar { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.toast { position: fixed; top: 20px; right: 20px; padding: 12px 24px; border-radius: 4px; color: #fff; font-size: 14px; z-index: 2000; opacity: 0; transition: opacity 0.3s; }
.toast.show { opacity: 1; }
.toast.success { background: #52c41a; }
.toast.error { background: #ff4d4f; }
.toast.info { background: #4472C4; }

/* 弹窗 */
.modal-overlay { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.5); z-index: 1000; justify-content: center; align-items: center; }
.modal-overlay.show { display: flex; }
.modal { background: #fff; border-radius: 8px; width: 480px; max-width: 90vw; max-height: 80vh; overflow-y: auto; }
.modal-header { padding: 16px 20px; border-bottom: 1px solid #f0f0f0; display: flex; justify-content: space-between; align-items: center; }
.modal-header h3 { font-size: 16px; }
.modal-close { cursor: pointer; font-size: 20px; color: #999; background: none; border: none; }
.modal-body { padding: 20px; }
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 13px; color: #666; margin-bottom: 4px; }
.form-group input, .form-group select { width: 100%; padding: 8px 12px; border: 1px solid #d9d9d9; border-radius: 4px; font-size: 13px; outline: none; }
.form-group input:focus { border-color: #4472C4; }
.modal-footer { padding: 12px 20px; border-top: 1px solid #f0f0f0; display: flex; justify-content: flex-end; gap: 10px; }

/* 用户管理 */
.user-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 8px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
.user-table th, .user-table td { padding: 10px 14px; text-align: left; border-bottom: 1px solid #f0f0f0; font-size: 13px; }
.user-table th { background: #f7f8fa; color: #666; font-weight: normal; }
.role-tag { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 12px; }
.role-admin { background: #e6f0ff; color: #4472C4; }
.role-entry { background: #f6ffed; color: #52c41a; }
.user-actions button { margin-left: 6px; }
