/* 誉健平台全局样式 */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif; background: #f0f2f5; color: #333; }

/* 布局 */
.layout { display: flex; min-height: 100vh; }
.sidebar { width: 220px; background: linear-gradient(180deg, #1a5c3a 0%, #0f3d26 100%); color: #fff; position: fixed; top: 0; left: 0; bottom: 0; overflow-y: auto; z-index: 100; }
.sidebar-logo { padding: 24px 20px; text-align: center; border-bottom: 1px solid rgba(255,255,255,0.1); }
.sidebar-logo h1 { font-size: 24px; }
.sidebar-logo p { font-size: 12px; opacity: 0.7; margin-top: 4px; }
.sidebar-nav { padding: 16px 0; }
.nav-item { display: flex; align-items: center; padding: 12px 24px; color: rgba(255,255,255,0.8); text-decoration: none; font-size: 15px; transition: all .2s; cursor: pointer; }
.nav-item:hover { background: rgba(255,255,255,0.1); color: #fff; }
.nav-item.active { background: rgba(255,255,255,0.15); color: #fff; border-right: 3px solid #4ade80; }
.nav-item .icon { margin-right: 12px; font-size: 18px; }

.main { margin-left: 220px; flex: 1; }
.topbar { background: #fff; padding: 16px 32px; display: flex; justify-content: space-between; align-items: center; box-shadow: 0 1px 4px rgba(0,0,0,0.06); position: sticky; top: 0; z-index: 50; }
.topbar h2 { font-size: 18px; font-weight: 600; }
.topbar-right { display: flex; align-items: center; gap: 16px; }
.topbar-user { font-size: 14px; color: #666; }
.btn-logout { color: #999; cursor: pointer; font-size: 14px; background: none; border: none; }
.btn-logout:hover { color: #e74c3c; }

.content { padding: 24px 32px; }

/* 卡片 */
.card { background: #fff; border-radius: 12px; padding: 24px; box-shadow: 0 1px 3px rgba(0,0,0,0.08); margin-bottom: 20px; }
.card-title { font-size: 16px; font-weight: 600; margin-bottom: 16px; color: #1a5c3a; }

/* 统计卡片 */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; margin-bottom: 24px; }
.stat-card { background: #fff; border-radius: 12px; padding: 24px; box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
.stat-card .label { color: #888; font-size: 14px; margin-bottom: 8px; }
.stat-card .value { font-size: 32px; font-weight: 700; color: #1a5c3a; }
.stat-card .sub { font-size: 12px; color: #aaa; margin-top: 4px; }
.stat-card.hot .value { color: #e74c3c; }
.stat-card.new .value { color: #3498db; }
.stat-card.msg .value { color: #f39c12; }

/* 表格 */
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 16px; text-align: left; border-bottom: 1px solid #f0f0f0; font-size: 14px; }
th { color: #888; font-weight: 500; background: #fafafa; }
tr:hover { background: #f9f9f9; }

/* 标签 */
.tag { display: inline-block; padding: 2px 10px; border-radius: 12px; font-size: 12px; margin: 2px; }
.tag-cold { background: #e8f4fd; color: #3498db; }
.tag-warm { background: #fff3e0; color: #f39c12; }
.tag-hot { background: #fde8e8; color: #e74c3c; }
.tag-deal { background: #e8f8f0; color: #27ae60; }
.tag-default { background: #f0f0f0; color: #666; }

/* 按钮 */
.btn { padding: 8px 20px; border: none; border-radius: 6px; cursor: pointer; font-size: 14px; transition: opacity .2s; }
.btn-primary { background: #2d8a5e; color: #fff; }
.btn-primary:hover { opacity: 0.9; }
.btn-sm { padding: 4px 12px; font-size: 12px; }
.btn-danger { background: #e74c3c; color: #fff; }

/* 搜索栏 */
.toolbar { display: flex; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; align-items: center; }
.toolbar input, .toolbar select { padding: 8px 14px; border: 1px solid #ddd; border-radius: 6px; font-size: 14px; }
.toolbar input:focus, .toolbar select:focus { outline: none; border-color: #2d8a5e; }

/* 模态框 */
.modal-overlay { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.5); z-index: 1000; align-items: center; justify-content: center; }
.modal-overlay.show { display: flex; }
.modal { background: #fff; border-radius: 12px; padding: 30px; width: 500px; max-height: 80vh; overflow-y: auto; }
.modal h3 { margin-bottom: 20px; color: #1a5c3a; }
.modal .form-group { margin-bottom: 16px; }
.modal .form-group label { display: block; margin-bottom: 6px; font-size: 14px; color: #555; }
.modal .form-group input, .modal .form-group textarea, .modal .form-group select {
    width: 100%; padding: 10px 14px; border: 1px solid #ddd; border-radius: 6px; font-size: 14px; box-sizing: border-box;
}
.modal .form-group textarea { min-height: 80px; resize: vertical; }
.modal-actions { display: flex; gap: 12px; justify-content: flex-end; margin-top: 24px; }

/* 对话气泡 */
.chat-container { max-height: 500px; overflow-y: auto; padding: 10px; }
.chat-msg { margin-bottom: 16px; display: flex; }
.chat-msg.user { justify-content: flex-end; }
.chat-msg .bubble { max-width: 70%; padding: 10px 16px; border-radius: 12px; font-size: 14px; line-height: 1.6; }
.chat-msg.user .bubble { background: #2d8a5e; color: #fff; border-bottom-right-radius: 4px; }
.chat-msg.assistant .bubble { background: #f0f2f5; color: #333; border-bottom-left-radius: 4px; }
.chat-msg .time { font-size: 11px; color: #aaa; margin-top: 4px; }

/* 分页 */
.pagination { display: flex; justify-content: center; gap: 8px; margin-top: 20px; }
.pagination button { padding: 6px 14px; border: 1px solid #ddd; background: #fff; border-radius: 4px; cursor: pointer; }
.pagination button.active { background: #2d8a5e; color: #fff; border-color: #2d8a5e; }
.pagination button:disabled { opacity: 0.5; cursor: not-allowed; }

/* 设置表单 */
.settings-section { margin-bottom: 32px; }
.settings-section h3 { font-size: 15px; color: #1a5c3a; margin-bottom: 16px; padding-bottom: 8px; border-bottom: 1px solid #eee; }
.form-row { display: flex; gap: 16px; margin-bottom: 16px; }
.form-row .form-group { flex: 1; }
