/* 操作說明頁 (guides/) 共用樣式 */

/* ===== 角色與分工流程圖：列為角色、欄為階段 ===== */
.role-flow-grid {
  display: grid;
  grid-template-columns: 8.5rem repeat(var(--phases, 3), minmax(0, 1fr));
  gap: 0.5rem;
}

.rf-phase {
  background: #374C67;
  color: #fff;
  font-weight: 600;
  text-align: center;
  padding: 0.5rem 1.25rem;
  clip-path: polygon(0 0, calc(100% - 0.75rem) 0, 100% 50%, calc(100% - 0.75rem) 100%, 0 100%, 0.75rem 50%);
}

.rf-role {
  display: flex;
  align-items: center;
  background: #e9edf2;
  border-radius: 0.25rem;
  padding: 0.5rem 0.75rem;
  font-weight: 700;
}

.rf-cell {
  background: #f8f9fa;
  border-radius: 0.25rem;
  padding: 0.5rem;
  min-height: 3rem;
}

.rf-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.rf-steps a,
.rf-steps .rf-external {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: #fff;
  border: 1px solid #374C67;
  border-radius: 0.25rem;
  padding: 0.25rem 0.5rem;
  color: #212529;
  font-size: 0.9375rem;
  text-decoration: none;
}

.rf-steps a:hover,
.rf-steps a:focus {
  background: #374C67;
  color: #fff;
}

/* 不在本頁操作步驟裡的事 (例如外部會計師的工作)，以虛線框表示 */
.rf-steps .rf-external {
  border-style: dashed;
  color: #495057;
}

.rf-no {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  min-width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  background: #374C67;
  color: #fff;
  font-size: 0.8125rem;
}

.rf-steps a:hover .rf-no,
.rf-steps a:focus .rf-no {
  background: #fff;
  color: #374C67;
}

/* 手機：改成依角色直排，每格前面標出階段 */
@media (max-width: 767.98px) {
  .role-flow-grid {
    grid-template-columns: 1fr;
  }

  .rf-corner,
  .rf-phase {
    display: none;
  }

  .rf-role {
    margin-top: 0.75rem;
  }

  .rf-cell:empty {
    display: none;
  }

  .rf-cell::before {
    content: attr(data-phase);
    display: block;
    margin-bottom: 0.25rem;
    color: #6c757d;
    font-size: 0.8125rem;
  }
}

/* ===== 操作步驟 ===== */
.guide-steps > li {
  scroll-margin-top: 5rem; /* 導覽列固定在頂端，跳到錨點時不被遮住 */
}

.rf-badge {
  background: #e9edf2;
  color: #374C67;
  font-weight: 600;
  vertical-align: middle;
}
