/* 组件样式 - 罕见病患者管理系统 */

/* 顶部导航栏 */
.navbar {
    position: sticky;
    top: 0;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    background-color: var(--white);
    box-shadow: var(--shadow-sm);
    z-index: 100;
  }
  
  .navbar-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--dark);
  }
  
  .navbar-left, .navbar-right {
    display: flex;
    align-items: center;
  }
  
  .navbar-back {
    margin-right: 8px;
    font-size: 24px;
    color: var(--dark);
  }
  
  .icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    color: var(--dark);
    position: relative;
  }
  
  .badge {
    position: absolute;
    top: -2px;
    right: -2px;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    background-color: var(--danger);
    color: white;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
  }
  
  /* 底部导航栏 */
  .tabbar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 56px;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    background-color: var(--white);
    box-shadow: 0 -1px 8px rgba(0, 0, 0, 0.05);
    z-index: 100;
  }
  
  .tab-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--gray);
    font-size: 12px;
    padding: 6px 0;
    transition: var(--transition);
  }
  
  .tab-item i {
    font-size: 22px;
    margin-bottom: 2px;
  }
  
  .tab-item.active {
    color: var(--primary);
  }
  
  /* 加载组件 */
  .loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
  }
  
  .loading-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--light-gray);
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 8px;
  }
  
  .loading-text {
    color: var(--gray);
    font-size: 14px;
  }
  
  @keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
  }
  
  /* 通知组件 */
  .notification {
    position: fixed;
    top: 16px;
    left: 16px;
    right: 16px;
    padding: 16px;
    background-color: var(--white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    z-index: 200;
    transform: translateY(-100px);
    opacity: 0;
    transition: all 0.3s ease;
  }
  
  .notification.show {
    transform: translateY(0);
    opacity: 1;
  }
  
  .notification-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    font-size: 20px;
  }
  
  .notification-icon.success { color: var(--success); }
  .notification-icon.error { color: var(--danger); }
  .notification-icon.warning { color: var(--warning); }
  .notification-icon.info { color: var(--info); }
  
  .notification-content {
    flex: 1;
  }
  
  .notification-title {
    font-weight: 600;
    margin-bottom: 4px;
  }
  
  .notification-close {
    margin-left: 12px;
    color: var(--gray);
    font-size: 20px;
  }
  
  /* 用户信息卡片 */
  .user-card {
    display: flex;
    align-items: center;
    padding: 16px;
    background-color: var(--white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
  }
  
  .user-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    overflow: hidden;
    margin-right: 16px;
    background-color: var(--light-gray);
  }
  
  .user-info {
    flex: 1;
  }
  
  .user-name {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 4px;
  }
  
  .user-detail {
    color: var(--gray);
    font-size: 14px;
  }
  
  /* 项目列表 */
  .list-item {
    display: flex;
    align-items: center;
    padding: 16px;
    background-color: var(--white);
    border-bottom: 1px solid var(--light-gray);
  }
  
  .list-item:last-child {
    border-bottom: none;
  }
  
  .list-item-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 16px;
    background-color: var(--primary-light);
    color: var(--white);
    font-size: 20px;
  }
  
  .list-item-content {
    flex: 1;
  }
  
  .list-item-title {
    font-weight: 500;
    margin-bottom: 4px;
  }
  
  .list-item-desc {
    color: var(--gray);
    font-size: 14px;
  }
  
  .list-item-action {
    margin-left: 8px;
    color: var(--gray);
  }
  
  /* 标签 */
  .tag {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    margin-right: 8px;
    margin-bottom: 8px;
  }
  
  .tag-primary {
    background-color: rgba(75, 108, 183, 0.1);
    color: var(--primary);
  }
  
  .tag-success {
    background-color: rgba(76, 175, 80, 0.1);
    color: var(--success);
  }
  
  .tag-warning {
    background-color: rgba(255, 193, 7, 0.1);
    color: var(--warning);
  }
  
  .tag-danger {
    background-color: rgba(244, 67, 54, 0.1);
    color: var(--danger);
  }
  
  /* 空状态 */
  .empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 16px;
    text-align: center;
  }
  
  .empty-state-icon {
    font-size: 60px;
    color: var(--light-gray);
    margin-bottom: 16px;
  }
  
  .empty-state-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
  }
  
  .empty-state-desc {
    color: var(--gray);
    margin-bottom: 24px;
  }
  
  /* 悬浮按钮 */
  .floating-button {
    position: fixed;
    right: 20px;
    bottom: 80px;
    z-index: 99;
  }
  
  .floating-btn {
    width: 56px;
    height: 56px;
    border-radius: 28px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    box-shadow: var(--shadow-md);
    border: none;
    cursor: pointer;
    transition: var(--transition);
  }
  
  .floating-btn:active {
    transform: scale(0.95);
  }
  
  /* 药品卡片 */
  .medicine-card {
    background-color: var(--white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    margin-bottom: 16px;
  }
  
  .medicine-header {
    padding: 16px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--light-gray);
  }
  
  .medicine-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background-color: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 16px;
    color: var(--white);
    font-size: 24px;
  }
  
  .medicine-info {
    flex: 1;
  }
  
  .medicine-name {
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 4px;
  }
  
  .medicine-dose {
    font-size: 14px;
    color: var(--gray);
  }
  
  .medicine-body {
    padding: 16px;
  }
  
  .medicine-time {
    display: flex;
    flex-wrap: wrap;
    margin-bottom: 12px;
  }
  
  .time-tag {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    background-color: rgba(75, 108, 183, 0.1);
    color: var(--primary);
    border-radius: var(--radius-sm);
    margin-right: 8px;
    margin-bottom: 8px;
    font-size: 14px;
  }
  
  .time-tag i {
    margin-right: 4px;
  }
  
  .medicine-status {
    margin-top: 8px;
    display: flex;
    align-items: center;
  }
  
  /* 卡片悬停效果 */
  .card-hover {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
  }
  
  .card-hover:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
  }
  
  /* 按钮点击效果 */
  .btn {
    position: relative;
    overflow: hidden;
  }
  
  .btn::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.2);
    top: 0;
    left: 0;
    opacity: 0;
    transition: opacity 0.3s ease;
  }
  
  .btn:active::after {
    opacity: 1;
  }

  /* 导航栏高亮样式 */
  .tabbar .tab-item.active {
    color: var(--primary);
  }

  .tabbar .tab-item.active i {
    color: var(--primary);
  }

  /* 状态指示器样式 */
  .status-indicator {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
  }

  .status-indicator.success {
    background-color: rgba(76, 175, 80, 0.1);
    color: #4CAF50;
  }

  .status-indicator.warning {
    background-color: rgba(255, 152, 0, 0.1);
    color: #FF9800;
  }

  .status-indicator.danger {
    background-color: rgba(244, 67, 54, 0.1);
    color: #F44336;
  }

  .status-indicator.info {
    background-color: rgba(33, 150, 243, 0.1);
    color: #2196F3;
  }

  .status-indicator i {
    margin-right: 4px;
    font-size: 14px;
  }

  /* 数据卡片通用样式 */
  .data-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-sm);
  }

  .data-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
  }

  .data-card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--dark);
    display: flex;
    align-items: center;
  }

  .data-card-title i {
    margin-right: 8px;
    font-size: 18px;
    color: var(--primary);
  }

  /* 多行文本截断通用类 */
  .text-truncate-2lines {
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    max-height: 2.8em; /* 行高 1.4em × 2行 */
    position: relative;
  }

  .text-truncate-2lines::after {
    content: "...";
    position: absolute;
    right: 0;
    bottom: 0;
    padding-left: 40px;
    background: linear-gradient(to right, transparent, white 50%);
  }

  /* 发布选项 */
  .post-options {
    padding: 16px;
  }

  .post-option-item {
    display: flex;
    align-items: center;
    padding: 16px;
    border: 1px solid #eee;
    border-radius: 12px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
  }

  .post-option-item:last-child {
    margin-bottom: 0;
  }

  .post-option-item:active {
    background: #f5f5f5;
  }

  .post-option-icon {
    width: 48px;
    height: 48px;
    border-radius: 24px;
    background: rgba(var(--primary-rgb, 33, 150, 243), 0.1);
    color: rgb(var(--primary-rgb, 33, 150, 243));
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 16px;
    font-size: 24px;
  }

  .post-option-info {
    flex: 1;
  }

  .post-option-title {
    font-size: 16px;
    font-weight: 500;
    color: #333;
    margin-bottom: 4px;
  }

  .post-option-desc {
    font-size: 13px;
    color: #666;
  }