.resignation-detail-panel {
  display: flex;
  flex-direction: column;
  height: 100vh;
  max-height: 90vh;
  width: 100%;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  overflow: hidden;
  border: 1px solid #e2e8f0;
  
  /* 确保在任意缩放比例下都能正常显示 */
  @media (max-width: 768px) {
    border-radius: 12px;
  }
  
  @media (max-width: 480px) {
    border-radius: 0;
  }

  .panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;

    .header-content {
      display: flex;
      align-items: center;
      gap: 16px;

      .reason-icon {
        font-size: 32px;
        width: 32px;
        height: 32px;
      }

      .header-text {
        h2 {
          margin: 0;
          font-size: 24px;
          font-weight: 600;
        }

        .category-chip {
          display: inline-block;
          background: rgba(255, 255, 255, 0.2);
          padding: 4px 12px;
          border-radius: 16px;
          font-size: 12px;
          margin-top: 4px;
        }
      }
    }

    button {
      color: white;
    }
    // 统一头部关闭/图标按钮样式（与财务页对齐）
    button.mat-mdc-icon-button,
    button[mat-icon-button] {
      color: #ffffff;
      width: 36px;
      height: 36px;
      border-radius: 8px;
      background: rgba(255, 255, 255, 0.12);
      border: 1px solid rgba(255, 255, 255, 0.25);
      transition: all 0.2s ease;
      box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);

      &:hover {
        background: rgba(255, 255, 255, 0.18);
        transform: translateY(-1px);
        box-shadow: 0 6px 16px rgba(0, 0, 0, 0.22);
      }

      &:active {
        transform: translateY(0);
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
      }
    }
  }

  .panel-content {
    flex: 1;
    overflow: hidden;
    min-height: 0;
    display: flex;
    flex-direction: column;

    ::ng-deep .mat-mdc-tab-group {
      height: 100%;
      display: flex;
      flex-direction: column;

      .mat-mdc-tab-header {
        border-bottom: 1px solid #e0e0e0;
        flex-shrink: 0;
      }

      .mat-mdc-tab-body-wrapper {
        flex: 1;
        overflow: hidden;
        min-height: 0;
        max-height: calc(90vh - 200px);
      }

      .mat-mdc-tab-body {
        height: 100%;
        overflow: hidden;
      }
      
      .mat-mdc-tab-body-content {
        height: 100%;
        overflow-y: auto;
        overflow-x: hidden;
        padding-bottom: 20px;
      }
    }

    .tab-content {
      padding: 24px;
      height: auto;
      min-height: 100%;
      overflow-y: auto;
      overflow-x: hidden;
      scrollbar-width: thin;
      scrollbar-color: #667eea #f1f1f1;
      
      /* 响应式padding */
      @media (max-width: 768px) {
        padding: 16px;
      }
      
      @media (max-width: 480px) {
        padding: 12px;
      }
      
      &::-webkit-scrollbar {
        width: 8px;
      }
      
      &::-webkit-scrollbar-track {
        background: #f1f1f1;
        border-radius: 4px;
      }
      
      &::-webkit-scrollbar-thumb {
        background: #667eea;
        border-radius: 4px;
        
        &:hover {
          background: #5a6fd8;
        }
        
        &:hover {
          background: #764ba2;
        }
      }
    }

    .stats-section {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 16px;
      margin-bottom: 32px;

      .stat-card {
        text-align: center;
        padding: 20px;
        background: #f8f9fa;
        border-radius: 12px;
        border: 1px solid #e9ecef;

        .stat-value {
          font-size: 28px;
          font-weight: 700;
          color: #2c3e50;
          margin-bottom: 8px;

          &.trend {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 4px;

            &.trend-up {
              color: #e74c3c;
            }

            &.trend-down {
              color: #27ae60;
            }

            &.trend-stable {
              color: #f39c12;
            }

            mat-icon {
              font-size: 20px;
              width: 20px;
              height: 20px;
            }
          }
        }

        .stat-label {
          font-size: 14px;
          color: #6c757d;
          font-weight: 500;
        }
      }
    }

    .analysis-section {
      h3 {
        color: #2c3e50;
        font-size: 18px;
        font-weight: 600;
        margin: 24px 0 12px 0;
        border-bottom: 2px solid #667eea;
        padding-bottom: 8px;
      }

      .overview-text {
        line-height: 1.6;
        color: #495057;
        margin-bottom: 24px;
      }

      .factors-list {
        margin-bottom: 24px;

        ::ng-deep mat-chip {
          background: #e3f2fd;
          color: #1976d2;
        }
      }

      .impact-analysis {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 24px;
        margin-bottom: 24px;

        .impact-section {
          h4 {
            color: #495057;
            font-size: 16px;
            margin-bottom: 12px;
          }

          ul {
            list-style: none;
            padding: 0;

            li {
              padding: 8px 0;
              padding-left: 20px;
              position: relative;
              color: #6c757d;

              &::before {
                content: '•';
                color: #667eea;
                font-weight: bold;
                position: absolute;
                left: 0;
              }
            }
          }
        }
      }

      .time-distribution {
        margin-bottom: 32px;
        
        .period-item {
          display: grid;
          grid-template-columns: 100px 1fr 60px;
          align-items: center;
          gap: 16px;
          margin-bottom: 12px;
          padding: 8px 0;

          .period-label {
            font-weight: 500;
            color: #495057;
          }

          .period-bar {
            height: 8px;
            background: #e9ecef;
            border-radius: 4px;
            overflow: hidden;

            .bar-fill {
              height: 100%;
              background: linear-gradient(90deg, #667eea, #764ba2);
              border-radius: 4px;
            }
          }

          .period-count {
            text-align: right;
            font-weight: 500;
            color: #6c757d;
          }
        }
      }
    }

    .improvement-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      margin-bottom: 24px;
      padding: 16px;
      background: #f8f9fa;
      border-radius: 8px;

      .priority-badge {
        padding: 6px 16px;
        border-radius: 20px;
        font-weight: 600;
        font-size: 12px;

        &.priority-high {
          background: #ffebee;
          color: #c62828;
        }

        &.priority-medium {
          background: #fff3e0;
          color: #ef6c00;
        }

        &.priority-low {
          background: #e8f5e8;
          color: #2e7d32;
        }
      }

      .timeline {
        color: #6c757d;
        font-weight: 500;
      }
    }

    .expected-outcome {
      margin-bottom: 32px;

      h3 {
        color: #2c3e50;
        font-size: 18px;
        font-weight: 600;
        margin-bottom: 12px;
      }

      p {
        line-height: 1.6;
        color: #495057;
      }
    }

    .action-plan {
      margin-bottom: 32px;

      h3 {
        color: #2c3e50;
        font-size: 18px;
        font-weight: 600;
        margin-bottom: 16px;
      }

      .actions-list {
        .action-item {
          background: #f8f9fa;
          border-radius: 8px;
          padding: 20px;
          margin-bottom: 16px;
          border-left: 4px solid #667eea;

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

            h4 {
              margin: 0;
              color: #2c3e50;
              font-size: 16px;
            }

            .action-status {
              padding: 4px 12px;
              border-radius: 12px;
              font-size: 12px;
              font-weight: 500;

              &.status-pending {
                background: #fff3cd;
                color: #856404;
              }

              &.status-in_progress {
                background: #d1ecf1;
                color: #0c5460;
              }

              &.status-completed {
                background: #d4edda;
                color: #155724;
              }
            }
          }

          .action-description {
            color: #6c757d;
            line-height: 1.5;
            margin-bottom: 12px;
          }

          .action-meta {
            display: flex;
            gap: 24px;
            font-size: 14px;
            color: #6c757d;

            .responsible,
            .deadline {
              font-weight: 500;
            }
          }
        }
      }
    }

    .success-metrics {
      margin-bottom: 32px;

      h3 {
        color: #2c3e50;
        font-size: 18px;
        font-weight: 600;
        margin-bottom: 12px;
      }

      ul {
        list-style: none;
        padding: 0;

        li {
          padding: 8px 0;
          padding-left: 24px;
          position: relative;
          color: #495057;

          &::before {
            content: '✓';
            color: #27ae60;
            font-weight: bold;
            position: absolute;
            left: 0;
          }
        }
      }
    }

    .resources {
      margin-bottom: 32px;
      
      h3 {
        color: #2c3e50;
        font-size: 18px;
        font-weight: 600;
        margin-bottom: 16px;
      }

      .resource-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
        gap: 24px;
        margin-bottom: 24px;

        .resource-item {
          background: #f8f9fa;
          padding: 24px;
          border-radius: 8px;
          min-height: 140px;

          h4 {
            margin: 0 0 16px 0;
            color: #495057;
            font-size: 16px;
            font-weight: 600;
          }

          p {
            margin: 0;
            color: #6c757d;
            line-height: 1.5;
            word-wrap: break-word;
          }

          .personnel-list,
          .tools-list {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
            margin-top: 12px;

            ::ng-deep mat-chip {
              background: #e3f2fd;
              color: #1976d2;
              font-size: 12px;
              margin: 2px;
              max-width: 100%;
              word-wrap: break-word;
            }
          }
        }
      }
    }
  }

  .panel-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px; // from 20px to 16px to match finance style
    border-top: 1px solid #e2e8f0; // unify border color
    background: #ffffff; // unify background
    position: sticky; // make footer sticky
    bottom: 0;
    z-index: 1;
  
    button {
      min-width: 100px;
    }
    
    // 底部按钮统一风格
    .mat-mdc-button,
    .mat-mdc-raised-button {
      border-radius: 8px;
      padding: 8px 16px;
      font-weight: 500;
      transition: all 0.2s ease;
      box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
    }
    
    .mat-mdc-button {
      color: #64748b;
      background: #ffffff;
      border: 1px solid #e2e8f0;
    
      &:hover {
        background: #f8fafc;
        transform: translateY(-1px);
      }
    }
    
    .mat-mdc-raised-button.mat-primary {
      color: #ffffff;
      background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
      box-shadow: 0 4px 12px rgba(102, 126, 234, 0.25);
    
      &:hover {
        filter: brightness(1.03);
        transform: translateY(-1px);
        box-shadow: 0 8px 20px rgba(102, 126, 234, 0.35);
      }
    }
  }

  // Tab 激活态与指示条颜色统一（从 .panel-footer 中移出，作用于整体）
  & ::ng-deep .mat-mdc-tab-group .mdc-tab__text-label {
    color: #64748b;
    font-weight: 600;
  }
  & ::ng-deep .mat-mdc-tab-group .mdc-tab--active .mdc-tab__text-label {
    color: #4f46e5;
  }
  & ::ng-deep .mat-mdc-tab-group .mdc-tab-indicator__content--underline {
    border-color: #4f46e5 !important;
  }
  
  // 统计卡片统一卡片化风格与悬浮反馈（从 .panel-footer 中移出，作用于整体）
  & .panel-content .stats-section {
    gap: 24px; // 统一网格间距 24px
  }
  & .panel-content .stats-section .stat-card {
    padding: 16px; // unify padding
    background: #ffffff; // ensure card background is white
    border: 1px solid #e2e8f0; // unify border color
  }
  & .panel-content .stats-section .stat-card .stat-label {
    color: #64748b; // unify text secondary color
    font-weight: 500;
  }
  
  // 分析区统一色彩与元素样式（从 .panel-footer 中移出，作用于整体）
  & .panel-content .analysis-section h3 {
    border-bottom: 2px solid #4f46e5; // unify accent color
  }
  & .panel-content .analysis-section .overview-text,
  & .panel-content .analysis-section .impact-analysis .impact-section h4,
  & .panel-content .analysis-section .impact-analysis .impact-section ul li,
  & .panel-content .analysis-section .time-distribution .period-item .period-label,
  & .panel-content .analysis-section .time-distribution .period-item .period-count {
    color: #64748b; // unify text secondary color in analysis section
  }
  & .panel-content .analysis-section .impact-analysis .impact-section ul li::before {
    color: #4f46e5; // unify bullet accent color
  }
  & .panel-content .analysis-section .time-distribution .period-item .period-bar {
    background: #e2e8f0; // unify bar background color
  }
  & .panel-content .analysis-section .time-distribution .period-item .period-bar .bar-fill {
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
  }
  & .panel-content .analysis-section ::ng-deep mat-chip {
    background: #eef2ff;
    color: #4f46e5;
  }
    
    }

    @media (max-width: 768px) {
      .resignation-detail-panel {
        .panel-content {
          .stats-section {
            grid-template-columns: 1fr;
          }

          .analysis-section {
            .impact-analysis {
              grid-template-columns: 1fr;
            }

            .time-distribution {
              .period-item {
                grid-template-columns: 1fr;
                gap: 8px;
                text-align: center;
              }
            }
          }

          .resources {
            .resource-grid {
              grid-template-columns: 1fr;
            }
          }
        }

        .panel-footer {
          flex-direction: column;
          gap: 8px;

          button {
            width: 100%;
          }
        }
      }
    }