/* 全局样式 */
* {
  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-color: #f5f5f5;
  color: #333;
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* 侧边栏 */
.sidebar {
  width: 260px;
  background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
  color: white;
  display: flex;
  flex-direction: column;
  box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
}

.logo {
  padding: 30px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.logo h2 {
  font-size: 24px;
  margin-bottom: 5px;
}

.logo p {
  font-size: 14px;
  opacity: 0.9;
}

.nav-menu {
  flex: 1;
  padding: 20px 0;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  padding: 15px 20px;
  color: white;
  text-decoration: none;
  transition: background-color 0.3s;
  gap: 12px;
}

.nav-item:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.nav-item.active {
  background-color: rgba(255, 255, 255, 0.2);
  border-left: 4px solid white;
}

.nav-item .icon {
  font-size: 20px;
}

.user-info {
  padding: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-info .avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.3);
}

.user-details {
  flex: 1;
}

.user-name {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 4px;
}

.user-title {
  font-size: 13px;
  opacity: 0.9;
}

/* 主内容区 */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* 顶部栏 */
.top-bar {
  background-color: white;
  padding: 20px 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  z-index: 10;
}

.search-box {
  display: flex;
  align-items: center;
  background-color: #f5f5f5;
  border-radius: 25px;
  padding: 8px 20px;
  width: 400px;
}

.search-input {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  font-size: 14px;
}

.search-btn {
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 18px;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 15px;
}

.notification-btn {
  position: relative;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 24px;
  padding: 8px;
}

.notification-btn .badge {
  position: absolute;
  top: 5px;
  right: 5px;
  background-color: #FF5722;
  color: white;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 10px;
}

.logout-btn {
  padding: 8px 20px;
  border: 1px solid #ddd;
  background-color: white;
  border-radius: 20px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.3s;
}

.logout-btn:hover {
  background-color: #f5f5f5;
}

/* 页面内容 */
.page {
  display: none;
  padding: 30px;
  overflow-y: auto;
  flex: 1;
}

.page.active {
  display: block;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
}

.page-header h2 {
  font-size: 28px;
  color: #333;
}

/* 统计卡片 */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 30px;
}

.stat-card {
  background-color: white;
  border-radius: 12px;
  padding: 25px;
  display: flex;
  align-items: center;
  gap: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.stat-icon {
  width: 60px;
  height: 60px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
}

.stat-info {
  flex: 1;
}

.stat-value {
  font-size: 32px;
  font-weight: bold;
  color: #333;
  margin-bottom: 5px;
}

.stat-label {
  font-size: 14px;
  color: #666;
}

/* 内容网格 */
.content-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-bottom: 30px;
}

/* 卡片 */
.card {
  background-color: white;
  border-radius: 12px;
  padding: 25px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  margin-bottom: 20px;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.card-header h3 {
  font-size: 18px;
  color: #333;
}

.view-all {
  color: #4CAF50;
  text-decoration: none;
  font-size: 14px;
  transition: color 0.3s;
}

.view-all:hover {
  color: #45a049;
}

/* 咨询列表 */
.consultation-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.consultation-item {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 15px;
  border-radius: 8px;
  background-color: #f9f9f9;
  transition: background-color 0.3s;
}

.consultation-item:hover {
  background-color: #f0f0f0;
}

.patient-avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  object-fit: cover;
}

.consultation-info {
  flex: 1;
}

.patient-name {
  font-size: 15px;
  font-weight: 600;
  color: #333;
  margin-bottom: 5px;
}

.consultation-message {
  font-size: 14px;
  color: #666;
  margin-bottom: 5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.consultation-time {
  font-size: 12px;
  color: #999;
}

.reply-btn {
  padding: 8px 20px;
  background-color: #4CAF50;
  color: white;
  border: none;
  border-radius: 20px;
  cursor: pointer;
  font-size: 14px;
  transition: background-color 0.3s;
}

.reply-btn:hover {
  background-color: #45a049;
}

/* 预约列表 */
.appointment-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.appointment-item {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 15px;
  border-radius: 8px;
  background-color: #f9f9f9;
}

.appointment-time {
  text-align: center;
  min-width: 80px;
}

.appointment-time .time {
  font-size: 20px;
  font-weight: bold;
  color: #4CAF50;
  margin-bottom: 5px;
}

.appointment-time .duration {
  font-size: 12px;
  color: #999;
}

.appointment-info {
  flex: 1;
}

.appointment-type {
  font-size: 13px;
  color: #666;
  margin-top: 5px;
}

.start-btn {
  padding: 8px 20px;
  background-color: #4CAF50;
  color: white;
  border: none;
  border-radius: 20px;
  cursor: pointer;
  font-size: 14px;
  transition: background-color 0.3s;
}

.start-btn:hover {
  background-color: #45a049;
}

.start-btn.disabled {
  background-color: #ccc;
  cursor: not-allowed;
}

.start-btn.disabled:hover {
  background-color: #ccc;
}

/* 表格 */
.patients-table {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead {
  background-color: #f9f9f9;
}

th {
  padding: 15px;
  text-align: left;
  font-size: 14px;
  font-weight: 600;
  color: #666;
  border-bottom: 2px solid #e0e0e0;
}

td {
  padding: 15px;
  font-size: 14px;
  color: #333;
  border-bottom: 1px solid #f0f0f0;
}

.patient-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.table-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}

.status-badge {
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
}

.status-good {
  background-color: #E8F5E9;
  color: #4CAF50;
}

.status-warning {
  background-color: #FFF3E0;
  color: #FF9800;
}

.status-danger {
  background-color: #FFEBEE;
  color: #F44336;
}

.action-btn {
  padding: 6px 16px;
  background-color: #4CAF50;
  color: white;
  border: none;
  border-radius: 16px;
  cursor: pointer;
  font-size: 13px;
  transition: background-color 0.3s;
}

.action-btn:hover {
  background-color: #45a049;
}

/* 按钮 */
.primary-btn {
  padding: 10px 24px;
  background-color: #4CAF50;
  color: white;
  border: none;
  border-radius: 24px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: background-color 0.3s;
}

.primary-btn:hover {
  background-color: #45a049;
}

/* 筛选栏 */
.filter-bar {
  display: flex;
  gap: 15px;
  margin-bottom: 20px;
}

.filter-input {
  flex: 1;
  padding: 10px 20px;
  border: 1px solid #ddd;
  border-radius: 24px;
  font-size: 14px;
  outline: none;
}

.filter-input:focus {
  border-color: #4CAF50;
}

.filter-select {
  padding: 10px 20px;
  border: 1px solid #ddd;
  border-radius: 24px;
  font-size: 14px;
  outline: none;
  cursor: pointer;
  background-color: white;
}

.filter-select:focus {
  border-color: #4CAF50;
}

/* 占位文本 */
.placeholder-text {
  text-align: center;
  color: #999;
  font-size: 16px;
  padding: 60px 20px;
}

/* 响应式设计 */
@media (max-width: 1200px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .content-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .sidebar {
    width: 80px;
  }

  .sidebar .logo p,
  .sidebar .nav-item span:not(.icon),
  .sidebar .user-details {
    display: none;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .search-box {
    width: 200px;
  }
}

/* WellAlly 集成：表单与布局辅助 */
.form-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.input { padding: 10px 12px; border: 1px solid #ddd; border-radius: 8px; font-size: 14px; min-width: 220px; }
.mt { margin-top: 20px; }
.mt-small { margin-top: 10px; }
.empty { color: #888; font-size: 14px; padding: 8px 0; }
.kv { display:flex; gap:12px; padding:6px 0; }
.kv .k { min-width: 90px; color:#666; }
.kv .v { flex:1; }
.interaction-box { background:#fff; border:1px solid #eee; border-radius: 10px; padding: 14px; }
.interaction-box .title { font-weight:600; margin-bottom:6px; }
.interaction-box .sev { margin: 6px 0 8px; }
.interaction-box .sev-tag { display:inline-block; background:#fef3c7; color:#b45309; padding:2px 8px; border-radius: 12px; font-size: 12px; }
.interaction-box .sub { margin-top: 10px; font-weight: 600; }
.interaction-box .list { margin: 6px 0 0 18px; }

/* 标签与简单表格 */
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag { display:inline-block; padding:6px 10px; background:#f4f4f5; border:1px solid #eee; border-radius:12px; font-size:12px; color:#555; }
.simple-table { width:100%; border-collapse: collapse; }
.simple-table th, .simple-table td { border:1px solid #eee; padding:8px 10px; font-size: 14px; }
