@use "sass:color";

// iOS风格全局变量
$primary-color: #007AFF;
$primary-dark: #0047AB;
$success-color: #34C759;
$warning-color: #FF9500;
$danger-color: #FF3B30;
$text-primary: #1C1C1E;
$text-secondary: #636366;
$text-tertiary: #8E8E93;
$border-color: #D1D1D6;
$background-primary: #F2F2F7;
$background-secondary: #FFFFFF;
$background-tertiary: #E5E5EA;
$shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
$shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
$shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
$border-radius: 12px;
$transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);

// 兼容背景变量（别名）
$bg-light: $background-secondary;
$bg-white: $background-primary;

// iOS风格卡片
.card {
  background: $background-secondary;
  border-radius: $border-radius;
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: $shadow-sm;
  transition: $transition;
  
  &:hover {
    box-shadow: $shadow-md;
  }
}

// Members & Requirements — iOS styled details and micro-interactions
.project-detail-container {
  // Members tab
  .members-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 12px 0 8px;

    h4 {
      margin: 0;
      font-size: 16px;
      font-weight: 600;
      color: $text-primary;
    }

    .actions {
      display: flex;
      gap: 8px;

      .primary-btn,
      .secondary-btn {
        height: 34px;
        padding: 0 14px;
        border-radius: 10px;
      }
    }
  }

  .members-list {
    background-color: $bg-white;
    border: 1px solid $border-color;
    border-radius: 12px;
    box-shadow: $shadow-sm;
    padding: 8px;
  }

  .member-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 10px;
    border-bottom: 1px dashed color-mix(in srgb, $border-color 70%, transparent);
    transition: $transition;

    &:last-child { border-bottom: none; }

    .role {
      flex: 0 0 120px;
      font-size: 13px;
      color: $text-secondary;
    }

    .name { flex: 1; }

    &.editable:hover { background-color: $bg-light; }
  }

  .member-input {
    width: 100%;
    background: $bg-light;
    border: 1px solid $border-color;
    border-radius: 10px;
    padding: 8px 12px;
    font-size: 14px;
    color: $text-primary;
    outline: none;
    transition: $transition;

    &::placeholder { color: $text-tertiary; }

    &:focus {
      background: $bg-white;
      border-color: $primary-color;
      box-shadow: 0 0 0 3px color-mix(in srgb, $primary-color 15%, transparent);
      transform: translateY(-1px);
    }
  }

  // Requirements tab
  .requirements-header {
    margin: 12px 0 8px;

    h4 {
      margin: 0;
      font-size: 16px;
      font-weight: 600;
      color: $text-primary;
    }
  }

  .requirements-form {
    background: $bg-white;
    border: 1px solid $border-color;
    border-radius: 12px;
    box-shadow: $shadow-sm;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;

    .form-row {
      display: flex;
      flex-direction: column;
      gap: 6px;

      label {
        font-size: 13px;
        color: $text-secondary;
      }

      .form-input,
      .form-textarea {
        background: $bg-light;
        border: 1px solid $border-color;
        border-radius: 12px;
        padding: 10px 12px;
        font-size: 14px;
        color: $text-primary;
        outline: none;
        transition: $transition;

        &::placeholder { color: $text-tertiary; }

        &:focus {
          background: $bg-white;
          border-color: $primary-color;
          box-shadow: 0 0 0 3px color-mix(in srgb, $primary-color 15%, transparent);
          transform: translateY(-1px);
        }
      }

      .form-textarea { resize: vertical; min-height: 84px; }
    }

    .form-actions {
      display: flex;
      justify-content: flex-end;
      gap: 10px;
      padding-top: 8px;
      border-top: 1px solid color-mix(in srgb, $border-color 70%, transparent);
    }
  }
}

// Responsive fine-tuning
@media (max-width: 768px) {
  .project-detail-container {
    .members-list { padding: 6px; }
    .member-row {
      padding: 10px 8px;
      .role { flex-basis: 88px; }
    }

    .requirements-form { padding: 10px; }
  }
}

// iOS风格按钮
.button {
  border-radius: $border-radius;
  padding: 12px 20px;
  font-weight: 500;
  transition: $transition;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  
  &-primary {
    background: $primary-color;
    color: white;
    
    &:active {
      background: #0E42CB;
    }
  }
  
  &-secondary {
    background: $background-tertiary;
    color: $text-primary;
    
    &:active {
      background: #D1D1D6;
    }
  }
}

// 按钮点击反馈效果
.btn-hover-effect {
  transition: $transition;
  transform: scale(1);
  position: relative;
  overflow: hidden;
}

.btn-hover-effect:active {
  transform: scale(0.95);
  transition: all 0.1s ease;
}

.btn-hover-effect::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.btn-hover-effect:active::after {
  width: 300px;
  height: 300px;
}

// 主要按钮的特定点击效果
.primary-btn.btn-hover-effect:active {
  background-color: #0E42CB;
}

// 次要按钮的特定点击效果
.secondary-btn.btn-hover-effect:active {
  background-color: #E5E6EB;
}

// 操作按钮的特定点击效果
.action-btn.btn-hover-effect:active {
  transform: scale(0.9);
  background-color: color-mix(in srgb, $primary-color 5%, transparent);
}

// 主容器
.project-detail-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

// 顶部导航/Header
.project-header-blue {
  background-color: $primary-dark;
  color: white;
  padding: 16px 24px;
  box-shadow: $shadow-md;
  z-index: 100;

  .header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
  }

  .project-info {
    flex: 1;
  }

  .project-title {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 8px;
  }

  .project-meta {
    display: flex;
    gap: 16px;
    font-size: 14px;
  }

  .project-status {
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 500;
    background-color: rgba(255, 255, 255, 0.2);
  }

  .project-stage,
  .project-date {
    opacity: 0.9;
  }

  .header-actions {
    display: flex;
    gap: 12px;
  }

  .primary-btn,
  .secondary-btn {
    color: white;
    background-color: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 8px 16px;
    border-radius: $border-radius;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: $transition;

    &:hover {
      background-color: rgba(255, 255, 255, 0.3);
    }
  }

  .primary-btn {
    background-color: $primary-color;
    border-color: $primary-color;

    &:hover {
      background-color: #0E42CB;
    }
  }
}

// 主要内容区域
.main-content-area {
  display: flex;
  flex: 1;
  overflow: hidden;
}

// 主内容区 (居中)
.project-content-main {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  background-color: $background-secondary;
}

// 右侧边栏 - 企业微信聊天集成
.wechat-sidebar {
  width: 350px;
  background-color: $background-tertiary;
  border-left: 1px solid $border-color;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.wechat-header {
  padding: 16px 20px;
  border-bottom: 1px solid $border-color;
  background-color: $background-primary;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.wechat-header h3 {
  font-size: 16px;
  font-weight: 600;
  color: $text-primary;
}

.wechat-actions {
  display: flex;
  gap: 8px;
}

.search-btn,
.settings-btn {
  background: none;
  border: none;
  padding: 6px;
  border-radius: 4px;
  cursor: pointer;
  color: $text-secondary;
  transition: $transition;

  &:hover {
    background-color: $background-tertiary;
    color: $primary-color;
  }
}

.wechat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

.wechat-message-item {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}

.message-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: $primary-color;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
  flex-shrink: 0;
}

.message-content {
  flex: 1;
}

.message-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
  font-size: 12px;
}

.message-sender {
  font-weight: 600;
  color: $text-primary;
}

.message-time {
  color: $text-tertiary;
}

.message-text {
  background-color: $background-primary;
  padding: 8px 12px;
  border-radius: $border-radius;
  color: $text-primary;
  line-height: 1.5;
}

.wechat-input-area {
  padding: 16px;
  border-top: 1px solid $border-color;
  background-color: $background-primary;
  display: flex;
  gap: 8px;
  align-items: flex-end;
}

.input-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.action-btn {
  background: none;
  border: none;
  padding: 8px;
  border-radius: 4px;
  cursor: pointer;
  color: $text-secondary;
  transition: $transition;

  &:hover {
    background-color: $background-tertiary;
    color: $primary-color;
  }
}

.wechat-input {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid $border-color;
  border-radius: $border-radius;
  outline: none;
  font-size: 14px;
  transition: $transition;

  &:focus {
    border-color: $primary-color;
  }
}

.send-btn {
  padding: 10px 16px;
  background-color: $primary-color;
  color: white;
  border: none;
  border-radius: $border-radius;
  cursor: pointer;
  font-size: 14px;
  transition: $transition;

  &:hover:not(:disabled) {
    background-color: $primary-dark;
  }

  &:disabled {
    background-color: $text-tertiary;
    cursor: not-allowed;
  }
}

// 售后处理入口 (固定在底部)
.after-sales-actions {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 350px; /* 与右侧边栏宽度一致 */
  background-color: $background-primary;
  border-top: 1px solid $border-color;
  padding: 16px 24px;
  box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.05);
  z-index: 100;
}

.actions-container {
  max-width: 1000px;
  margin: 0 auto;
  display: flex;
  justify-content: center;
  gap: 16px;
}

.action-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: $border-radius;
  border: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: $transition;
}

.action-btn.primary {
  background-color: $primary-dark;
  color: white;

  &:hover {
    background-color: #0a2340;
  }
}

.action-btn.warning {
  background-color: $warning-color;
  color: white;

  &:hover {
    background-color: #e57000;
  }
}

.action-btn.secondary {
  background-color: $background-tertiary;
  color: $text-primary;
  border: 1px solid $border-color;

  &:hover {
    background-color: $background-secondary;
  }
}

// 进度卡片
.progress-card {
  background-color: $background-primary;
  border-radius: $border-radius;
  padding: 20px;
  margin-bottom: 24px;
  box-shadow: $shadow-sm;
}

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

.progress-header h3 {
  font-size: 16px;
  font-weight: 600;
  color: $text-primary;
}

.progress-percentage {
  font-size: 24px;
  font-weight: 600;
  color: $primary-color;
}

.progress-bar {
  height: 8px;
  background-color: $background-tertiary;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 12px;
}

.progress-fill {
  height: 100%;
  background-color: $primary-color;
  transition: width 0.3s ease;
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: $text-tertiary;
}

// 进度时间轴卡片
.timeline-card {
  background-color: $background-primary;
  border-radius: $border-radius;
  padding: 20px;
  margin-bottom: 24px;
  box-shadow: $shadow-sm;
}

.card-title {
  font-size: 16px;
  font-weight: 600;
  color: $text-primary;
  margin-bottom: 20px;
}

.project-timeline {
  position: relative;
  padding-left: 30px;
}

.timeline-item {
  position: relative;
  padding-bottom: 24px;
  transition: $transition;

  &:hover {
    background-color: $background-tertiary;
    border-radius: $border-radius;
  }
}

.timeline-icon {
  position: absolute;
  left: -30px;
  top: 4px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background-color: $background-tertiary;
  border: 2px solid $border-color;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: $transition;
}

.timeline-icon.icon-completed {
  background-color: $success-color;
  border-color: $success-color;
  color: white;
}

.timeline-icon.icon-in-progress {
  background-color: $primary-color;
  border-color: $primary-color;
  color: white;
  animation: pulse 2s infinite;
}

.timeline-line {
  position: absolute;
  left: -24px;
  top: 28px;
  width: 2px;
  height: calc(100% + 4px);
  background-color: $border-color;
}

.timeline-line.line-completed {
  background-color: $success-color;
}

.timeline-content {
  padding: 8px 16px;
}

.timeline-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.stage-title {
  font-size: 14px;
  font-weight: 600;
  color: $text-primary;
}

.stage-status {
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 12px;
  background-color: $background-tertiary;
  color: $text-secondary;
}

.stage-item.stage-completed .stage-status {
  background-color: color-mix(in srgb, $success-color 10%, transparent);
  color: $success-color;
}

.stage-item.stage-in-progress .stage-status {
  background-color: color-mix(in srgb, $primary-color 10%, transparent);
  color: $primary-color;
}

.timeline-meta {
  font-size: 12px;
  color: $text-tertiary;
  margin-bottom: 8px;
}

.stage-dates {
  display: flex;
  gap: 16px;
  margin-bottom: 4px;
}

.stage-details {
  font-size: 13px;
  color: $text-secondary;
  line-height: 1.4;
}

// 标签页样式
.project-tabs {
  background-color: $background-primary;
  border-radius: $border-radius;
  box-shadow: $shadow-sm;
  overflow: hidden;
}

.tab-header {
  display: flex;
  border-bottom: 1px solid $border-color;
  background-color: $background-tertiary;
}

.tab-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 20px;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 14px;
  color: $text-secondary;
  transition: $transition;

  &:hover {
    color: $primary-color;
    background-color: color-mix(in srgb, $primary-color 5%, transparent);
  }

  &.active {
    color: $primary-color;
    background-color: $background-primary;
    border-bottom: 2px solid $primary-color;
  }
}

.tab-content {
  padding: 20px;
}

// iOS风格动画效果
@keyframes pulse {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(0.95);
    opacity: 0.8;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes sending {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(0.9);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes completing {
  0% {
    transform: translateY(0);
    opacity: 1;
  }
  100% {
    transform: translateY(-20px);
    opacity: 0;
  }
}

// 按钮发送动画
.sending {
  animation: sending 0.3s ease;
}

// 任务完成动画
.completing {
  animation: completing 0.5s ease forwards;
}

// 消息进入动画
.message-item {
  animation: fadeIn 0.3s ease;
}

// iOS风格弹性动画
.ios-bounce {
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

// 标签切换动画
.tab-content {
  animation: fadeIn 0.3s ease;
}

// 响应式设计
@media (max-width: 1200px) {
  .wechat-sidebar {
    width: 300px;
  }
  
  .after-sales-actions {
    right: 300px;
  }
}

@media (max-width: 768px) {
  .main-content-area {
    flex-direction: column;
  }
  
  .wechat-sidebar {
    width: 100%;
    height: 0;
    border-left: none;
    border-top: 1px solid $border-color;
  }
  
  .wechat-sidebar.show {
    height: 400px;
  }
  
  .after-sales-actions {
    right: 0;
    bottom: 0;
  }
  
  .actions-container {
    flex-wrap: wrap;
  }
}

// 原有样式变量兼容
$bg-light: $background-secondary;
$bg-white: $background-primary;
$box-shadow: $shadow-md;
$text-light: $text-tertiary;

// 顶部导航栏
.top-navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 24px;
  height: 64px;
  background-color: $bg-white;
  border-bottom: 1px solid $border-color;
  box-shadow: $box-shadow;

  .navbar-left {
    display: flex;
    align-items: center;
    gap: 16px;

    .menu-toggle {
      display: flex;
      align-items: center;
      justify-content: center;
      width: 40px;
      height: 40px;
      border: none;
      background: none;
      color: $text-primary;
      cursor: pointer;
      transition: $transition;

      &:hover {
        color: $primary-color;
        background-color: $bg-light;
        border-radius: 4px;
      }
    }

    .app-title {
      font-size: 18px;
      font-weight: 600;
      color: $text-primary;
      margin: 0;
    }
  }

  .navbar-right {
    display: flex;
    align-items: center;
    gap: 16px;

    .notification-btn {
      display: flex;
      align-items: center;
      justify-content: center;
      width: 40px;
      height: 40px;
      border: none;
      background: none;
      color: $text-primary;
      cursor: pointer;
      position: relative;
      transition: $transition;

      &:hover {
        color: $primary-color;
        background-color: $bg-light;
        border-radius: 4px;
      }

      .notification-badge {
        position: absolute;
        top: 8px;
        right: 8px;
        display: flex;
        align-items: center;
        justify-content: center;
        width: 16px;
        height: 16px;
        font-size: 10px;
        font-weight: 600;
        color: white;
        background-color: $danger-color;
        border-radius: 50%;
      }
    }

    .user-profile {
      display: flex;
      align-items: center;
      gap: 8px;
      padding: 8px 12px;
      border-radius: 6px;
      transition: $transition;

      &:hover {
        background-color: $bg-light;
      }

      .user-avatar {
        width: 32px;
        height: 32px;
        border-radius: 50%;
        object-fit: cover;
      }

      .user-name {
        font-size: 14px;
        font-weight: 500;
        color: $text-primary;
      }
    }
  }
}

// 主要内容区
.dashboard-content {
  display: flex;
  flex: 1;
  overflow: hidden;
}

// 左侧侧边栏
.sidebar {
  width: 240px;
  background-color: $bg-white;
  border-right: 1px solid $border-color;
  overflow-y: auto;
  flex-shrink: 0;

  .sidebar-nav {
    padding: 16px 0;

    .nav-item {
      display: flex;
      align-items: center;
      gap: 12px;
      padding: 12px 24px;
      color: $text-secondary;
      text-decoration: none;
      transition: $transition;

      &:hover {
        color: $primary-color;
        background-color: $bg-light;
      }

      &.active {
        color: $primary-color;
        background-color: #e3f2fd;
        border-left: 3px solid $primary-color;
        padding-left: 21px;
      }

      svg {
        flex-shrink: 0;
      }

      span {
        font-size: 14px;
        font-weight: 500;
      }
    }
  }
}

// 右侧主要内容
.project-content {
  flex: 1;
  overflow-y: auto;
  padding: 24px;

  // 项目头部信息
  .project-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;

    .project-title-section {
      .project-title {
        font-size: 24px;
        font-weight: 600;
        color: $text-primary;
        margin: 0 0 8px 0;
      }

      .project-meta {
        display: flex;
        align-items: center;
        gap: 16px;

        .project-status {
          padding: 4px 12px;
          border-radius: 16px;
          font-size: 12px;
          font-weight: 500;
          text-align: center;

          &.status-active {
            color: $primary-color;
            background-color: #e3f2fd;
          }

          &.status-pending {
            color: $warning-color;
            background-color: #fff3e0;
          }

          &.status-completed {
            color: $success-color;
            background-color: #e8f5e9;
          }
        }

        .project-stage {
          font-size: 14px;
          color: $text-secondary;
        }
      }
    }

    .project-actions {
      display: flex;
      gap: 12px;

      .primary-btn,
      .secondary-btn {
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 8px 16px;
        border: none;
        border-radius: 6px;
        font-size: 14px;
        font-weight: 500;
        cursor: pointer;
        transition: $transition;
      }

      .primary-btn {
        color: white;
        background-color: $primary-color;

        &:hover {
          background-color: #1565c0;
        }

        &:disabled {
          background-color: $text-tertiary;
          cursor: not-allowed;
        }
      }

      .secondary-btn {
        color: $text-primary;
        background-color: $bg-white;
        border: 1px solid $border-color;

        &:hover {
          background-color: $bg-light;
        }
      }

      .primary-btn.small {
        padding: 4px 12px;
        font-size: 12px;
      }
    }
  }

  // 项目进度卡片
  .progress-card {
    padding: 20px;
    margin-bottom: 24px;
    background-color: $bg-white;
    border-radius: 8px;
    box-shadow: $box-shadow;

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

      h3 {
        font-size: 16px;
        font-weight: 600;
        color: $text-primary;
        margin: 0;
      }

      .progress-percentage {
        font-size: 20px;
        font-weight: 700;
        color: $primary-color;
      }
    }

    .progress-bar {
      height: 8px;
      margin-bottom: 12px;
      background-color: $bg-light;
      border-radius: 4px;
      overflow: hidden;

      .progress-fill {
        height: 100%;
        background-color: $primary-color;
        border-radius: 4px;
        transition: $transition;
      }
    }

    .progress-meta {
      display: flex;
      justify-content: space-between;
      font-size: 12px;
      color: $text-tertiary;
    }
  }

  // 项目详情标签页
  .project-tabs {
    background-color: $bg-white;
    border-radius: 8px;
    box-shadow: $box-shadow;
    overflow: hidden;

    // 标签页头部
    .tab-header {
      display: flex;
      border-bottom: 1px solid $border-color;
      background-color: #f8f9fa;

      .tab-btn {
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 16px 24px;
        border: none;
        background: none;
        font-size: 14px;
        font-weight: 500;
        color: $text-secondary;
        cursor: pointer;
        transition: $transition;
        border-bottom: 2px solid transparent;

        &:hover {
          color: $primary-color;
          background-color: $bg-light;
        }

        &.active {
          color: $primary-color;
          background-color: $bg-white;
          border-bottom-color: $primary-color;
        }
      }
    }

    // 标签页内容
    .tab-content {
      padding: 24px;
      min-height: 400px;
    }
  }

  // 概览网格布局
  .overview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 24px;

    // 信息卡片
    .info-card {
      padding: 20px;
      background-color: color-mix(in srgb, $bg-light 80%, $bg-white);
      border-radius: 10px;

      .card-title {
        font-size: 16px;
        font-weight: 700;
        color: $text-primary;
        margin: 0 0 14px 0;
        padding-bottom: 10px;
        border-bottom: 1px solid color-mix(in srgb, $border-color 80%, transparent);
        letter-spacing: .2px;
      }

      // 客户信息
      .customer-info {
        .info-item {
          margin-bottom: 16px;

          label {
            display: block;
            font-size: 12px;
            font-weight: 600;
            color: $text-secondary;
            letter-spacing: .2px;
            margin-bottom: 4px;
          }

          span {
            font-size: 14px;
            font-weight: 500;
            color: $text-primary;
            font-variant-numeric: tabular-nums;
            letter-spacing: .1px;
          }

          .tag-container {
            display: flex;
            gap: 8px;
            flex-wrap: wrap;

            .tag {
              padding: 4px 10px;
              font-size: 12px;
              font-weight: 600;
              color: color.mix($primary-color, black, 85%);
              background-color: color-mix(in srgb, #e3f2fd 80%, white);
              border-radius: 14px;
              letter-spacing: .2px;
            }
          }

          .need-list {
            margin: 0;
            padding-left: 20px;

            li {
              display: flex;
              align-items: flex-start;
              gap: 8px;
              font-size: 14px;
              color: $text-primary;
              margin-bottom: 4px;

              svg {
                flex-shrink: 0;
                margin-top: 2px;
                color: $success-color;
              }
            }
          }
        }
      }

      // 团队信息
      .team-info {
        .team-member {
          display: flex;
          align-items: center;
          justify-content: space-between;
          padding: 12px 0;
          border-bottom: 1px solid $border-color;

          &:last-child {
            border-bottom: none;
          }

          .member-avatar {
            width: 48px;
            height: 48px;
            border-radius: 50%;
            object-fit: cover;
            display: flex;
            align-items: center;
            justify-content: center;
            background: linear-gradient(180deg, #f5f7fa, #e9edf3);
            color: $text-secondary;
            font-weight: 600;
            font-size: 14px;
            border: 1px solid $border-color;
            box-shadow: 0 1px 2px rgba(0,0,0,0.04);
          }

          .member-details {
            flex: 1;
            margin-left: 12px;

            .member-name {
              font-size: 15px;
              font-weight: 600;
              color: $text-primary;
              margin-bottom: 2px;
              letter-spacing: .2px;
            }

            .member-role {
              font-size: 12px;
              color: $text-secondary;
            }
          }

          .message-btn {
            display: flex;
            align-items: center;
            justify-content: center;
            width: 36px;
            height: 36px;
            border: none;
            color: $primary-color;
            background-color: #e3f2fd;
            border-radius: 50%;
            cursor: pointer;
            transition: $transition;

            &:hover {
              background-color: $primary-color;
              color: white;
              box-shadow: 0 8px 16px rgba(0,0,0,0.12);
              transform: translateY(-1px);
            }

            &:active {
              transform: translateY(0);
              box-shadow: 0 4px 10px rgba(0,0,0,0.08);
            }
          }
        }
      }

      // 反馈信息
      .feedback-list {
        .feedback-item {
          padding: 16px;
          background-color: $bg-white;
          border-radius: 6px;
          margin-bottom: 12px;

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

            .feedback-author {
              font-size: 14px;
              font-weight: 500;
              color: $text-primary;
            }

            .feedback-rating {
              display: flex;
              align-items: center;
              gap: 8px;

              .fa {
                color: $warning-color;
                margin-right: 2px;
              }

              .rating-stars {
                font-size: 12px;
                color: $warning-color;
              }

              .rating-number {
                font-size: 14px;
                font-weight: 600;
                color: $text-primary;
              }
            }
          }

          .feedback-content {
            font-size: 14px;
            color: $text-primary;
            line-height: 1.6;
            margin-bottom: 8px;
          }

          .feedback-response {
            padding: 12px;
            background-color: $bg-light;
            border-radius: 4px;
            margin-bottom: 8px;

            .response-label {
              font-size: 12px;
              font-weight: 500;
              color: $text-light;
              margin-bottom: 4px;
            }

            .response-text {
              font-size: 13px;
              color: $text-secondary;
            }
          }

          .feedback-meta {
            display: flex;
            justify-content: space-between;
            align-items: center;

            .feedback-date {
              font-size: 12px;
              color: $text-light;
            }

            .feedback-status {
              padding: 2px 8px;
              font-size: 11px;
              font-weight: 500;
              border-radius: 12px;

              &.status-processed {
                color: $success-color;
                background-color: #e8f5e9;
              }

              &.status-pending {
                color: $warning-color;
                background-color: #fff3e0;
              }
            }
          }
        }

        .view-all-btn {
          display: block;
          width: 100%;
          padding: 8px 16px;
          border: 1px solid $border-color;
          background-color: $bg-white;
          color: $text-secondary;
          font-size: 13px;
          text-align: center;
          cursor: pointer;
          border-radius: 4px;
          transition: $transition;

          &:hover {
            color: $primary-color;
            border-color: $primary-color;
          }
        }
      }
    }
  }

  // 里程碑时间线
  .milestones-timeline {
    position: relative;
    padding-left: 32px;
    margin-left: 16px;

    .milestone-item {
      position: relative;
      margin-bottom: 24px;

      .milestone-dot {
        position: absolute;
        left: -48px;
        top: 4px;
        width: 16px;
        height: 16px;
        background-color: $text-light;
        border-radius: 50%;
        border: 2px solid white;
        box-shadow: 0 0 0 2px $border-color;
        transition: $transition;

        &.completed {
          background-color: $success-color;
          box-shadow: 0 0 0 2px #e8f5e9;
        }
      }

      .milestone-line {
        position: absolute;
        left: -40px;
        top: 20px;
        bottom: -24px;
        width: 2px;
        background-color: $border-color;
        transition: $transition;

        &.completed {
          background-color: $success-color;
        }
      }

      .milestone-content {
        padding: 16px;
        background-color: $bg-white;
        border-radius: 8px;
        border-left: 3px solid $border-color;
        transition: $transition;

        &:hover {
          box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
        }
      }

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

        .milestone-title {
          font-size: 16px;
          font-weight: 600;
          color: $text-primary;
          margin: 0;
        }

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

          &.status-completed {
            color: $success-color;
            background-color: #e8f5e9;
          }

          &.status-pending {
            color: $warning-color;
            background-color: #fff3e0;
          }
        }
      }

      .milestone-description {
        font-size: 14px;
        color: $text-secondary;
        line-height: 1.5;
        margin: 0 0 12px 0;
      }

      .milestone-dates {
        display: flex;
        gap: 24px;
        margin-bottom: 12px;

        .date-item {
          display: flex;
          flex-direction: column;

          label {
            font-size: 11px;
            color: $text-light;
            margin-bottom: 2px;
          }

          span {
            font-size: 13px;
            color: $text-primary;
            font-weight: 500;
          }
        }
      }

      .milestone-actions {
        display: flex;
        gap: 8px;
      }
    }

    .milestone-item:last-child {
      margin-bottom: 0;

      .milestone-line {
        display: none;
      }
    }
  }

  // 任务过滤和搜索
  .tasks-filter,
  .files-filter {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;

    .filter-options {
      display: flex;
      gap: 8px;

      .filter-btn {
        padding: 6px 16px;
        border: 1px solid $border-color;
        background-color: $bg-white;
        color: $text-secondary;
        font-size: 13px;
        font-weight: 500;
        cursor: pointer;
        border-radius: 4px;
        transition: $transition;

        &:hover {
          color: $primary-color;
          border-color: $primary-color;
        }

        &.active {
          color: white;
          background-color: $primary-color;
          border-color: $primary-color;
        }
      }
    }

    .search-box {
      position: relative;
      width: 240px;

      svg {
        position: absolute;
        left: 12px;
        top: 50%;
        transform: translateY(-50%);
        color: $text-light;
      }

      input {
        width: 100%;
        padding: 8px 12px 8px 40px;
        border: 1px solid $border-color;
        border-radius: 4px;
        font-size: 14px;
        color: $text-primary;
        transition: $transition;

        &:focus {
          outline: none;
          border-color: $primary-color;
          box-shadow: 0 0 0 2px rgba(30, 136, 229, 0.1);
        }

        &::placeholder {
          color: $text-light;
        }
      }
    }
  }

  // 任务列表
  .tasks-list {
    .task-item {
      display: flex;
      gap: 16px;
      padding: 16px;
      margin-bottom: 12px;
      background-color: $bg-white;
      border-radius: 8px;
      border-left: 3px solid $border-color;
      transition: $transition;

      &:hover {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
      }

      .task-checkbox {
        flex-shrink: 0;

        input[type="checkbox"] {
          width: 18px;
          height: 18px;
          cursor: pointer;
        }
      }

      .task-content {
        flex: 1;

        .task-title {
          font-size: 16px;
          font-weight: 600;
          color: $text-primary;
          margin: 0 0 8px 0;
          transition: $transition;

          &.completed {
            color: $text-light;
            text-decoration: line-through;
          }
        }

        .task-description {
          font-size: 14px;
          color: $text-secondary;
          line-height: 1.5;
          margin: 0 0 12px 0;
        }

        .task-meta {
          display: flex;
          gap: 24px;

          span {
            display: flex;
            align-items: center;
            gap: 6px;
            font-size: 13px;
            color: $text-secondary;
          }

          .task-deadline {
            &.overdue {
              color: $danger-color;
            }
          }

          .task-priority {
            padding: 2px 8px;
            border-radius: 12px;
            font-size: 11px;
            font-weight: 500;

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

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

            &.priority-low {
              color: $success-color;
              background-color: #e8f5e9;
            }
          }
        }
      }
    }
  }

  // 消息容器
  .messages-container {
    display: flex;
    flex-direction: column;
    height: 500px;

    .messages-list {
      flex: 1;
      overflow-y: auto;
      padding-right: 8px;
      margin-bottom: 16px;

      .message-item {
        display: flex;
        gap: 12px;
        margin-bottom: 24px;

        .message-avatar {
          display: flex;
          align-items: center;
          justify-content: center;
          width: 36px;
          height: 36px;
          font-size: 14px;
          font-weight: 600;
          color: white;
          background-color: $primary-color;
          border-radius: 50%;
          flex-shrink: 0;
        }

        .message-content {
          max-width: 70%;

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

            .message-sender {
              font-size: 13px;
              font-weight: 600;
              color: $text-primary;
            }

            .message-time {
              font-size: 11px;
              color: $text-light;
            }
          }

          .message-text {
            font-size: 14px;
            color: $text-secondary;
            line-height: 1.5;
            padding: 12px;
            background-color: $bg-light;
            border-radius: 12px;
          }
        }
      }
    }

    .message-input-area {
      .message-actions {
        display: flex;
        justify-content: flex-end;
        gap: 12px;
        margin-top: 12px;
      }

      textarea {
        width: 100%;
        padding: 12px;
        border: 1px solid $border-color;
        border-radius: 6px;
        font-size: 14px;
        color: $text-primary;
        resize: vertical;
        transition: $transition;

        &:focus {
          outline: none;
          border-color: $primary-color;
          box-shadow: 0 0 0 2px rgba(30, 136, 229, 0.1);
        }

        &::placeholder {
          color: $text-light;
        }
      }
    }
  }

  // 文件列表
  .files-list {
    .file-item {
      display: flex;
      align-items: center;
      gap: 16px;
      padding: 16px;
      margin-bottom: 12px;
      background-color: $bg-white;
      border-radius: 8px;
      transition: $transition;

      &:hover {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
      }

      .file-icon {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 48px;
        height: 48px;
        border-radius: 8px;
        flex-shrink: 0;

        &.type-document {
          color: $primary-color;
          background-color: #e3f2fd;
        }

        &.type-image {
          color: $success-color;
          background-color: #e8f5e9;
        }

        &.type-spreadsheet {
          color: $warning-color;
          background-color: #fff3e0;
        }
      }

      .file-info {
        flex: 1;

        .file-name {
          font-size: 14px;
          font-weight: 500;
          color: $text-primary;
          margin: 0 0 8px 0;
        }

        .file-meta {
          display: flex;
          gap: 16px;

          span {
            font-size: 12px;
            color: $text-light;
          }
        }
      }

      .file-actions {
        display: flex;
        gap: 8px;

        .action-btn {
          display: flex;
          align-items: center;
          justify-content: center;
          width: 36px;
          height: 36px;
          border: 1px solid $border-color;
          background-color: $bg-white;
          color: $text-secondary;
          border-radius: 6px;
          cursor: pointer;
          transition: $transition;

          &:hover {
            color: $primary-color;
            border-color: $primary-color;
          }
        }
      }
    }
  }
}

// iOS风格按钮点击效果
.button {
  &:active {
    transform: scale(0.96);
    transition: transform 0.1s ease;
  }
  
  &-primary:active {
    background: #0E42CB;
  }
  
  &-secondary:active {
    background: #D1D1D6;
  }
}

// 卡片悬停效果
.card {
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  
  &:hover {
    transform: translateY(-2px);
    box-shadow: $shadow-md;
  }
}

// 响应式设计
@media (max-width: 1024px) {
  .overview-grid {
    grid-template-columns: 1fr;
  }

  .project-content {
    padding: 16px;
  }

  .sidebar {
    width: 200px;
  }
}

@media (max-width: 768px) {
  .top-navbar {
    padding: 0 16px;

    .navbar-right {
      gap: 8px;
    }

    .user-name {
      display: none;
    }
  }

  .sidebar {
    display: none;
  }

  .project-header {
    flex-direction: column;
    gap: 16px;
    align-items: flex-start !important;
  }

  .project-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .tab-header {
    flex-wrap: wrap;

    .tab-btn {
      flex: 1;
      min-width: 120px;
    }
  }

  .tasks-filter,
  .files-filter {
    flex-direction: column;
    gap: 16px;
    align-items: flex-start !important;

    .search-box {
      width: 100%;
    }
  }

  .task-meta,
  .file-meta {
    flex-wrap: wrap;
    gap: 12px !important;
  }

  .messages-container {
    height: 400px;
  }

  .message-content {
    max-width: 85% !important;
  }
}

// Project Detail iOS tweaks
.project-detail-container {
  // 统一卡片间距（仅作用于本页）
  .card {
    padding: 20px;
    margin-bottom: 24px;
  }

  // 标签页激活态（底部指示条 + 主色高亮）
  .project-tabs {
    .tab-header {
      position: relative;
    }
    .tab-btn {
      position: relative;
    }
    .tab-btn.active {
      color: $primary-color;
    }
    .tab-btn.active::after {
      content: '';
      position: absolute;
      left: 16px;
      right: 16px;
      bottom: -1px;
      height: 2px;
      background: $primary-color;
      border-radius: 2px;
    }
  }

  // 进度条填充质感（渐变 + 轻微内阴影）
  .progress-bar {
    .progress-fill {
      background: linear-gradient(90deg, color.adjust($primary-color, $lightness: 8%), $primary-color);
      border-radius: 4px;
      box-shadow: inset 0 0 2px rgba(0,0,0,0.08);
    }
  }

  // 输入框聚焦的环形高亮
  .wechat-input-area {
    .wechat-input:focus {
      box-shadow: 0 0 0 3px color-mix(in srgb, $primary-color 15%, transparent);
    }
  }
}

// 响应式优化：侧栏在中等屏略窄，小屏隐藏
@media (max-width: 1200px) {
  .project-detail-container {
    .wechat-sidebar { width: 300px; }
  }
}
@media (max-width: 992px) {
  .project-detail-container {
    .wechat-sidebar { display: none; }
    .project-content-main { width: 100%; }
  }
}

// Project Detail iOS segmented & refinements (ABCD)
.project-detail-container {
  // A+B: 胶囊分段标签 + 细化激活态
  .project-tabs.ios-tabs {
    background: $background-primary;
    border-radius: $border-radius;
    box-shadow: $shadow-sm;
    padding: 8px;

    .tab-header {
      background: $background-secondary;
      border: 1px solid $border-color;
      border-radius: $border-radius;
      padding: 4px;
      gap: 4px;
    }

    .tab-btn {
      position: relative;
      border-radius: $border-radius;
      padding: 10px 14px;
      font-size: 14px;
      font-weight: 500;
      color: $text-secondary;
      transition: color .18s ease, background-color .18s ease, transform .18s ease;

      &:hover { background-color: color-mix(in srgb, $primary-color 6%, transparent); }
      &:active { transform: scale(0.98); }

      &.active {
        color: $primary-color;
        font-weight: 600; // B: 激活时略增字重
      }
      &.active::before { // A: 胶囊式激活背景
        content: '';
        position: absolute;
        inset: 0;
        background: $background-primary;
        border-radius: inherit;
        box-shadow: 0 1px 2px rgba(0,0,0,0.06);
        z-index: -1;
      }
      &.active::after { // B: 极细底线增强层次
        content: '';
        position: absolute;
        left: 12px;
        right: 12px;
        bottom: 6px;
        height: 2px;
        border-radius: 2px;
        background: $primary-color;
        opacity: .7;
      }
    }
  }

  // C: 输入区细化
  .wechat-input-area {
    .wechat-input::placeholder { color: $text-tertiary; }

    .action-btn:hover {
      background-color: color-mix(in srgb, $text-primary 8%, transparent);
      color: $text-primary;
    }

    .send-btn {
      &:active:not(:disabled) { transform: scale(0.98); }
      &:disabled {
        background-color: $background-tertiary;
        color: $text-tertiary;
        border: 1px solid $border-color;
        opacity: 0.9;
        pointer-events: none;
      }
    }
  }

  // D: 侧栏与卡片阴影/圆角统一
  .wechat-sidebar { box-shadow: $shadow-sm; }
}

@media (max-width: 768px) {
  .project-detail-container {
    .wechat-sidebar { border-radius: $border-radius; }
  }
}

// Project Detail iOS buttons + history + bottom actions
.project-detail-container {
  // 顶部右侧两个按钮：导出报告（secondary）、联系客户（primary）
  .header-actions {
    .primary-btn,
    .secondary-btn {
      height: 36px;
      padding: 0 14px;
      border-radius: 10px;
      font-size: 14px;
      font-weight: 500;
      letter-spacing: .2px;
      display: inline-flex;
      align-items: center;
      gap: 8px;
      transition: background-color .18s ease, color .18s ease, transform .12s ease;

      svg { width: 16px; height: 16px; }

      &:active { transform: scale(0.98); }
    }

    .secondary-btn {
      color: $text-primary;
      background-color: $bg-white;
      border: 1px solid $border-color;

      &:hover { background-color: $bg-light; }
      &:focus-visible { box-shadow: 0 0 0 3px color-mix(in srgb, $text-primary 10%, transparent); }
    }

    .primary-btn {
      color: #fff;
      background-color: $primary-color;
      border: 1px solid $primary-color;

      &:hover { background-color: color.adjust($primary-color, $lightness: -6%); }
      &:focus-visible { box-shadow: 0 0 0 3px color-mix(in srgb, $primary-color 20%, transparent); }
      &:disabled { background: $text-tertiary; border-color: $text-tertiary; cursor: not-allowed; }
    }
  }

  // 历史服务记录板块字体与排版
  .historical-records-card {
    .record-section {
      .projects-list { display: grid; grid-template-columns: 1fr; gap: 10px; }
      .project-item { padding: 10px 12px; border-radius: 8px; background: $bg-white; border: 1px solid $border-color; }
      .project-name { font-size: 14px; font-weight: 600; color: $text-primary; margin-bottom: 4px; }
      .project-period { font-size: 12px; color: $text-tertiary; margin-bottom: 6px; }
      .project-description { font-size: 14px; color: $text-primary; line-height: 1.6; margin-bottom: 4px; }
      .project-status { font-size: 12px; color: $text-secondary; }
    }
  }

  // 底部售后操作栏（固定在底部的小界面）：现代感与极简
  .after-sales-actions.ios-actions {
    position: sticky;
    bottom: 0;
    z-index: 5;
    padding: 12px 0;

    .actions-container {
      display: flex;
      gap: 12px;
      justify-content: center;
      padding: 10px 16px;
      background: color-mix(in srgb, $bg-white 70%, transparent);
      border-top: 1px solid $border-color;
      backdrop-filter: saturate(160%) blur(10px);
      -webkit-backdrop-filter: saturate(160%) blur(10px);
      box-shadow: 0 -2px 8px rgba(0,0,0,0.04);
      border-radius: 12px;
    }

    .primary-btn,
    .secondary-btn,
    .warning-btn {
      height: 36px;
      padding: 0 14px;
      border-radius: 10px;
      font-size: 14px;
      font-weight: 500;
      letter-spacing: .2px;
      border: 1px solid transparent;
      transition: background-color .18s ease, color .18s ease, transform .12s ease;
      &:active { transform: scale(0.98); }
    }

    .primary-btn { color: #fff; background: $primary-color; border-color: $primary-color; &:hover { background: color.adjust($primary-color, $lightness: -6%); } }
    .secondary-btn { color: $text-primary; background: $bg-white; border-color: $border-color; &:hover { background: $bg-light; } }
    .warning-btn { color: #8a6100; background: #fff8e1; border-color: #ffe0a5; &:hover { background: #ffefc2; } }
  }

  // 里程碑小界面下方的动作区
  .milestone-actions {
    display: flex;
    gap: 8px;
    padding-top: 8px;
    border-top: 1px dashed $border-color;

    .primary-btn.small {
      border-radius: 10px;
      padding: 6px 12px;
      font-weight: 600;
    }
  }
}

// 移动端微调
@media (max-width: 768px) {
  .project-detail-container {
    .after-sales-actions.ios-actions .actions-container { border-radius: 10px; gap: 8px; }
    .historical-records-card .record-section .consultation-item { padding: 10px; }
  }
}

// iOS micro tuning — apply all requested adjustments
.project-detail-container {
  // Header actions buttons
  .header-actions {
    .primary-btn,
    .secondary-btn {
      height: 40px;
      padding: 0 16px;
      border-radius: 12px;
    }
    .primary-btn:hover {
      background-color: color.adjust($primary-color, $lightness: -4%);
    }
  }

  // Historical records cards — softer borders
  .historical-records-card .record-section {
    .consultation-item,
    .cooperation-item,
    .feedback-item,
    .project-item {
      border-color: color-mix(in srgb, $border-color 70%, transparent);
    }
  }

  // Bottom sticky actions — lighter frosted glass and rounded container
  .after-sales-actions.ios-actions {
    .actions-container {
      background: color-mix(in srgb, $bg-white 60%, transparent);
      backdrop-filter: saturate(160%) blur(8px);
      -webkit-backdrop-filter: saturate(160%) blur(8px);
      border-radius: 14px;
    }
    .warning-btn {
      color: #7a5200;
      background: #fff5d6;
      border-color: #ffd88a;
      &:hover { background: #ffedbd; }
    }
  }

  // Milestone small actions
  .milestone-actions .primary-btn.small {
    border-radius: 12px;
    font-size: 13px;
  }
}

@media (max-width: 768px) {
  .project-detail-container {
    .header-actions {
      .primary-btn,
      .secondary-btn { height: 38px; padding: 0 14px; }
    }
    .after-sales-actions.ios-actions .actions-container { border-radius: 12px; }
  }
}

// Override: 历史卡片改为无描边 + 极浅阴影（高优先级覆盖）
.project-detail-container {
  .historical-records-card .record-section {
    .consultation-item,
    .cooperation-item,
    .feedback-item,
    .project-item {
      border: none !important;
      box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    }
  }
}

@media (max-width: 768px) {
  .project-detail-container {
    .historical-records-card .record-section {
      .consultation-item,
      .cooperation-item,
      .feedback-item,
      .project-item {
        box-shadow: 0 1px 2px rgba(0,0,0,0.04);
      }
    }
  }
}

// Typography & layout improvements for Historical Records — 更直观的数据层级
.project-detail-container {
  .historical-records-card {
    .record-section {
      h4 { font-size: 16px; font-weight: 600; color: $text-primary; margin-bottom: 10px; }

      // 过往咨询记录：日期-内容-状态 三段式布局
      .consultation-list {
        .consultation-item {
          display: grid;
          grid-template-columns: 128px 1fr auto; // 日期 | 内容 | 状态
          gap: 8px 12px;
          align-items: center;

          .consultation-date {
            font-size: 12px;
            color: $text-tertiary;
            letter-spacing: .2px;
            font-variant-numeric: tabular-nums;
          }
          .consultation-content {
            font-size: 14px;
            color: $text-primary;
            line-height: 1.6;
          }
          .consultation-status {
            justify-self: end;
            font-size: 12px;
            font-weight: 600;
            color: $text-primary;
            background: $bg-light;
            padding: 2px 8px;
            border-radius: 10px;

            // 三色状态：成功/处理中/待处理
            &.status-processed { color: $success-color; background-color: #e8f5e9; }
            &.status-processing { color: $primary-color; background-color: #e3f2fd; }
            &.status-pending { color: $warning-color; background-color: #fff3e0; }
          }
        }
      }

      // 合作项目：名称/周期/描述/状态的网格分区，突出名称与状态
      .projects-list {
        .project-item {
          display: grid;
          grid-template-columns: 1fr auto;
          grid-template-areas:
            'name status'
            'period status'
            'desc desc';
          row-gap: 4px;
          column-gap: 12px;

          .project-name { grid-area: name; font-size: 15px; font-weight: 600; color: $text-primary; }
          .project-period { grid-area: period; font-size: 12px; color: $text-tertiary; font-variant-numeric: tabular-nums; }
          .project-description { grid-area: desc; font-size: 14px; color: $text-secondary; line-height: 1.6; }
          .project-status { grid-area: status; align-self: start; justify-self: end; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 10px; background: #f2f4f7; color: $text-secondary; }
        }
      }

      // 历史反馈：日期等数值统一用等宽数字，正文稍加对比度
      .feedback-list {
        .feedback-item {
          .feedback-date { font-variant-numeric: tabular-nums; letter-spacing: .2px; color: $text-light; }
          .feedback-content { color: $text-primary; line-height: 1.7; }
          .rating-number { font-variant-numeric: tabular-nums; }
        }
      }
    }
  }
}

// 响应式：在移动端收敛为纵向信息流
@media (max-width: 768px) {
  .project-detail-container {
    .historical-records-card {
      .record-section {
        .consultation-list .consultation-item {
          grid-template-columns: 1fr; // 纵向排列：内容 -> 状态 -> 日期
          .consultation-status { justify-self: start; margin-top: 4px; }
          .consultation-date { margin-top: 2px; }
        }
        .projects-list .project-item {
          grid-template-columns: 1fr; grid-template-areas: 'name' 'status' 'period' 'desc';
          .project-status { justify-self: start; margin: 2px 0 6px; }
        }
      }
    }
  }
}

/* 只读渲染图预览弹窗 + 缩略图样式（customer-service/project-detail） */
.project-detail-container {
  .modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    backdrop-filter: saturate(160%) blur(6px);
    -webkit-backdrop-filter: saturate(160%) blur(6px);
    z-index: 999;
  }

  .modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(920px, 92vw);
    max-height: 80vh;
    background: $bg-white;
    border: 1px solid $border-color;
    border-radius: $border-radius;
    box-shadow: 0 12px 28px rgba(0,0,0,0.15);
    display: flex;
    flex-direction: column;
    z-index: 1000;
  }

  .modal-header {
    padding: 14px 16px;
    border-bottom: 1px solid $border-color;
    display: flex;
    align-items: center;
    justify-content: space-between;

    h3 {
      margin: 0;
      font-size: 16px;
      font-weight: 600;
      color: $text-primary;
    }
  }

  .modal-body {
    padding: 16px;
    overflow: auto;
    background: $bg-white;
  }

  .modal-footer {
    padding: 12px 16px;
    border-top: 1px solid $border-color;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    background: $bg-white;
  }

  .close-button {
    background: transparent;
    border: none;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    color: $text-secondary;

    &:hover { color: $text-primary; }
  }

  /* 缩略图网格 */
  .thumb-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
  }

  .thumb-item {
    border: 1px solid $border-color;
    border-radius: $border-radius;
    overflow: hidden;
    background: $bg-white;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
  }

  .thumb-item img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    display: block;
  }

  .thumb-meta {
    padding: 8px;

    .name {
      font-size: 13px;
      color: $text-primary;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .sub {
      font-size: 12px;
      color: $text-secondary;
      margin-top: 2px;
    }
  }
}