
:root {
  --primary-blue: #3465df;
  --secondary-blue: #3498db;
  --dark-blue: #2980b9;
  --light-blue: #6ab0f3;
  --accent-blue: #86a8fc;
  --background-light: #f8faff;
  --background-card: #ffffff;
  --text-dark: #24201f;
  --text-medium: #6d6c74;
  --text-light: rgba(255, 255, 255, 0.8);
  --shadow-light: 0 4px 20px rgba(52, 101, 223, 0.1);
  --shadow-medium: 0 8px 30px rgba(52, 101, 223, 0.15);
  --shadow-heavy: 0 15px 40px rgba(52, 101, 223, 0.2);
  --border-radius: 16px;
  --border-radius-small: 8px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 主要功能區域 */
.employee-section-improved {
  padding: 80px 0;
  background: #f4f5f8;
  position: relative;
  overflow: hidden;
}

.employee-container-improved {
  max-width: 1400px;
  margin: 0 auto;
  background: var(--background-card);
  overflow: hidden;
  display: flex;
  min-height: 600px;
  box-shadow: var(--shadow-heavy);
  position: relative;
  z-index: 1;
}

.sidebar-improved {
  width: 320px;
  background: #3465df;
  padding: 40px 0;
  position: relative;
}

.sidebar-improved::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 1px;
  height: 100%;
  background: linear-gradient(180deg, transparent 0%, rgba(255,255,255,0.2) 50%, transparent 100%);
}

.sidebar-improved .title {
  color: white;
  text-align: center;
  margin-bottom: 50px;
  font-size: 26px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

/* 選項列表改進 */
.option-list-improved {
  list-style: none;
  padding: 0;
  margin: 0;
}

.option-item-improved {
  display: flex;
  align-items: center;
  padding: 24px 30px;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  color: var(--text-light);
  border-left: 4px solid transparent;
  margin-bottom: 4px;
}

.option-item-improved::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, rgba(255,255,255,0.1) 0%, transparent 100%);
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.option-item-improved:hover::before {
  width: 100%;
}

.option-item-improved:hover {
  color: white;
  transform: translateX(8px);
}

.option-item-improved.active {
  background: rgba(255, 255, 255, 0.15);
  color: white;
  border-left-color: var(--secondary-blue);
  transform: translateX(8px);
  box-shadow: inset 0 0 20px rgba(255, 255, 255, 0.1);
}

.option-item-improved.active::before {
  width: 100%;
}

.option-icon {
  font-size: 24px;
  margin-right: 18px;
  width: 40px;
  text-align: center;
  transition: transform 0.3s ease;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

.option-item-improved:hover .option-icon,
.option-item-improved.active .option-icon {
  transform: scale(1.15);
}

.option-text {
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.3px;
  flex: 1;
}

.option-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: transparent;
  transition: var(--transition);
  margin-left: 12px;
}

.option-item-improved.active .option-indicator {
  background: var(--secondary-blue);
  box-shadow: 0 0 12px rgba(52, 152, 219, 0.6);
}

/* 內容區域改進 */
.content-area-improved {
  flex: 1;
  padding: 40px;
  background: var(--background-light);
  position: relative;
  overflow: hidden;
}

.content-item-improved {
  display: none;
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.content-item-improved.active {
  display: flex;
  flex-direction: column;
  opacity: 1;
  transform: translateY(0);
  animation: fadeInUp 0.8s ease-out;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(40px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 圖表區域 - 重點改進 */
.chart-section {
  background: var(--background-card);
  padding: 25px;
  margin-top: 30px;
  box-shadow: var(--shadow-medium);
  border: 1px solid rgba(52, 101, 223, 0.1);
  position: relative;
  overflow: hidden;
  order: 2;
}

.chart-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary-blue), var(--secondary-blue), var(--light-blue));
}

.chart-container {
  position: relative;
  height: 280px;
  margin-bottom: 20px;
}

.chart-container canvas {
  width: 100% !important;
  height: 100% !important;
}

/* 圖表洞察數據 */
.chart-insights {
  display: flex;
  justify-content: space-around;
  gap: 20px;
  padding-top: 20px;
  border-top: 1px solid rgba(52, 101, 223, 0.1);
}

.insight-item {
  text-align: center;
  flex: 1;
  padding: 15px;
  border-radius: var(--border-radius-small);
  background: linear-gradient(135deg, rgba(52, 101, 223, 0.05) 0%, rgba(52, 152, 219, 0.05) 100%);
  transition: var(--transition);
}

.insight-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-light);
}

.insight-number {
  font-size: 28px;
  font-weight: 700;
  color: #3465df;
  display: block;
  margin-bottom: 8px;
  background: linear-gradient(135deg, #3465df, var(--secondary-blue));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.insight-label {
  font-size: 14px;
  color: var(--text-medium);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* 內容詳情區域 */
.content-details {
  background: var(--background-card);
  padding: 30px;
  box-shadow: var(--shadow-light);
  border: 1px solid rgba(52, 101, 223, 0.08);
  order: 1;
}

.content-title {
  font-size: 28px;
  color: var(--text-dark);
  margin-bottom: 20px;
  font-weight: 700;
  position: relative;
  display: inline-block;
  line-height: 1.3;
}

.content-title::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 0;
  width: 80px;
  height: 4px;
  background: linear-gradient(90deg, var(--primary-blue), var(--secondary-blue));
  border-radius: 2px;
}

.content-description {
  font-size: 16px;
  line-height: 1.7;
  color: var(--text-medium);
  margin: 20px 0 0;
  font-weight: 400;
}

.content-description p {
  margin-bottom: 20px;
  line-height: 1.8;
}

.content-description ul {
  margin-top: 20px;
  padding-left: 0;
  list-style: none;
}

.content-description ul li {
  margin-bottom: 12px;
  line-height: 1.7;
  position: relative;
  padding-left: 30px;
  transition: var(--transition);
}

.content-description ul li::before {
  content: '✓';
  color: var(--secondary-blue);
  position: absolute;
  left: 0;
  top: 0;
  font-weight: bold;
  font-size: 16px;
  width: 20px;
  height: 20px;
  background: rgba(52, 152, 219, 0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}

.content-description ul li:hover {
  color: var(--text-dark);
  transform: translateX(5px);
}

/* 響應式設計改進 */
@media (max-width: 1200px) {
  .employee-container-improved {
    margin: 0 20px;
  }
  
  .content-area-improved {
    padding: 40px 30px;
  }
  
  .chart-container {
    height: 300px;
  }
}

@media (max-width: 768px) {
  .employee-section-improved {
    padding: 60px 0;
  }
  
  .employee-container-improved {
    flex-direction: column;
    margin: 10px;
    border-radius: 12px;
    min-height: auto;
  }
  
  .sidebar-improved {
    width: 100%;
    padding: 25px 0;
  }
  
  .sidebar-improved .title {
    margin-bottom: 25px;
    font-size: 22px;
  }
  
  .option-list-improved {
    display: flex;
    overflow-x: auto;
    padding: 0 15px;
    gap: 10px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
  }
  
  .option-item-improved {
    flex-shrink: 0;
    padding: 18px 25px;
    border-radius: 25px;
    border-left: none;
    background: rgba(255, 255, 255, 0.1);
    margin-bottom: 0;
    white-space: nowrap;
  }
  
  .option-item-improved.active {
    background: rgba(255, 255, 255, 0.2);
    transform: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  }
  
  .option-item-improved:hover {
    transform: none;
  }
  
  .option-text {
    font-size: 14px;
  }
  
  .option-icon {
    font-size: 20px;
    margin-right: 12px;
  }
  
  .option-indicator {
    display: none;
  }
  
  .content-area-improved {
    padding: 25px 20px;
  }
  
  .chart-section {
    padding: 20px 15px;
    margin-top: 25px;
  }
  
  .chart-container {
    height: 240px;
    margin-bottom: 15px;
  }
  
  .chart-insights {
    flex-direction: column;
    gap: 15px;
  }
  
  .insight-item {
    padding: 12px;
  }
  
  .insight-number {
    font-size: 24px;
  }
  
  .content-details {
    padding: 20px 15px;
  }
  
  .content-title {
    font-size: 24px;
    margin-bottom: 15px;
  }
  
  .content-description {
    font-size: 15px;
  }
}

@media (max-width: 480px) {
  .content-title {
    font-size: 22px;
  }
  
  .content-description {
    font-size: 15px;
    line-height: 1.7;
  }
  
  .option-icon {
    font-size: 18px;
    margin-right: 10px;
  }
  
  .chart-container {
    height: 250px;
  }
  
  .insight-number {
    font-size: 20px;
  }
  
  .insight-label {
    font-size: 12px;
  }
}

/* 載入動畫改進 */
.employee-container-improved {
  animation: slideInUp 1s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(60px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 滾動條樣式改進 */
.option-list-improved::-webkit-scrollbar {
  height: 6px;
}

.option-list-improved::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}

.option-list-improved::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 3px;
  transition: var(--transition);
}

.option-list-improved::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.5);
}

/* 微交互效果 */
.chart-section:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-heavy);
}

.content-details:hover {
  box-shadow: var(--shadow-medium);
}

/* 圖表加載動畫 */
.chart-container {
  position: relative;
}

.chart-container::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 40px;
  height: 40px;
  margin: -20px 0 0 -20px;
  border: 3px solid rgba(52, 101, 223, 0.1);
  border-top: 3px solid var(--primary-blue);
  border-radius: 50%;
  animation: chartLoading 1s linear infinite;
  z-index: 1;
}

.chart-container canvas {
  opacity: 0;
  animation: chartFadeIn 0.8s ease-out 0.5s forwards;
}

@keyframes chartLoading {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes chartFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* 當圖表加載完成後隱藏加載動畫 */
.chart-container.loaded::before {
  display: none;
}
 .intro-text {
            max-width: 600px;
            margin: 0 auto 40px auto;
            text-align: center;
            color: #555;
            font-size: 1rem;
        }

        /* 横向时间线容器，固定宽度，居中 */
        .timeline-horizontal {
            position: relative;
            max-width: 1200px;
            margin: 0 auto;
            padding: 20px 0;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .line-horizontal {
            position: absolute;
            top: 50%;
            left: 15px;
            height: 4px;
            background: #3465df; /* 橙红色时间线 */
            border-radius: 2px;
            z-index: 0;
            width: 0;
            transform: translateY(-50%);
            animation: lineGrow 900ms forwards ease-out;
        }

        @keyframes lineGrow {
            0% {
                width: 0;
            }
            25% {
                width: 286px;
            }
            50% {
                width: 599px;
            }
            75% {
                width: 885px;
            }
            100% {
                width: 1100px;
            }
        }

        /* 节点 */
        .timeline-item-horizontal {
            position: relative;
            width: 260px;
            background: #fff;
            padding: 15px 20px;
            border-radius: 8px;
            box-shadow: 0 3px 10px rgba(203, 219, 246, 0.85); /* 红色阴影，提升紧迫感 */
            opacity: 0;
            transform: translateY(50px);
            box-sizing: border-box;
            word-wrap: break-word;

            /* 预定义动画状态，不自动动画 */
            transition: box-shadow 0.3s ease;
            text-align: center; /* 图标和文本居中 */
        }

        .timeline-item-horizontal.visible {
            animation: fadeInUp 0.6s forwards ease-out;
        }

        .timeline-item-horizontal::before {
            content: '';
            position: absolute;
            top: 50%;
            left: -28px;
            width: 16px;
            height: 16px;
            background: #3465df; /* 鲜艳红色圆点 */
            border-radius: 50%;
            box-shadow: 0 0 0 3px #FAFAFA;
            transform: translateY(-50%);
            z-index: 2;
        }

        .timeline-item-horizontal h3 {
            margin-top: 0;
            font-weight: 600;
            font-size: 1.3rem;
            color: #24201f;
            margin-bottom: 8px;
            line-height: 1.2;
        }

        .timeline-item-horizontal p {
            font-size: 0.9em;
            font-weight: 400;
            color: #555;
            margin: 0;
            line-height: 1.3;
        }

        /* 悬停时阴影加强，增加交互感 */
        .timeline-item-horizontal:hover {
            box-shadow: 0 6px 20px rgb(52, 101, 223);
            cursor: pointer;
        }

        .icon-wrapper {
            width: 50px;
            height: 50px;
            margin: 0 auto 15px; /* 底部间距 */
        }

        .icon-wrapper img {
            width: 100%;
            height: 100%;
            object-fit: contain;
            display: block;
            margin: 0 auto;
        }


        /* 动画关键帧 */
        @keyframes fadeInUp {
            0% {
                opacity: 0;
                transform: translateY(50px);
            }

            100% {
                opacity: 1;
                transform: translateY(0);
            }
        }

        /* 移动端适配，堆叠 */
        @media (max-width: 768px) {
            .timeline-horizontal {
                flex-direction: column;
                max-width: 100%;
                padding: 0;
            }

            .timeline-item-horizontal {
                width: 90%;
                margin: 20px auto;
                opacity: 0;
                transform: translateY(50px);
                transition: none;
                box-shadow: 0 3px 10px rgba(230, 57, 70, 0.2);
            }

            .timeline-item-horizontal.visible {
                animation: fadeInUp 0.6s forwards ease-out;
            }

            .timeline-item-horizontal::before {
                left: 10px;
                top: -28px;
                transform: none;
                box-shadow: none;
            }

            .line-horizontal {
                display: none;
            }
        }
