/* ============================================================
   portal.css - 前台"接口驱动区块"专用样式
   说明：这些区块由 components/portal.js 从后端接口取数后渲染。
        样式自成一体（pc- 前缀），不依赖各页面已加载的旧 CMS 样式，
        因此在任何页面上外观都保持一致。
   ============================================================ */

/* ===== 通用状态 ===== */
.pc-loading,
.pc-empty {
  padding: 40px 20px;
  text-align: center;
  color: #7a8a96;
  font-size: 14px;
}

.pc-loading::before {
  content: "";
  display: inline-block;
  width: 16px;
  height: 16px;
  margin-right: 8px;
  vertical-align: -3px;
  border: 2px solid rgba(10, 143, 90, .25);
  border-top-color: #0a8f5a;
  border-radius: 50%;
  animation: pc-spin .8s linear infinite;
}

@keyframes pc-spin {
  to { transform: rotate(360deg); }
}

/* ===== 卡片栅格 ===== */
.pc-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.pc-grid.pc-grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

/* ===== 通用卡片 ===== */
.pc-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(10, 30, 50, .06);
  transition: transform .35s ease, box-shadow .35s ease;
  text-decoration: none;
  color: inherit;
}

.pc-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 28px rgba(10, 30, 50, .12);
}

.pc-card-img {
  position: relative;
  height: 200px;
  background: linear-gradient(135deg, #0a8f5a, #0d6e48);
  overflow: hidden;
}

.pc-card-img img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .5s ease;
}

.pc-card:hover .pc-card-img img {
  transform: scale(1.06);
}

.pc-card-badge {
  position: absolute;
  left: 14px;
  top: 14px;
  z-index: 2;
  padding: 4px 12px;
  border-radius: 20px;
  background: #0a8f5a;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
}

.pc-card-body {
  padding: 22px 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.pc-card-cat {
  font-size: 12px;
  letter-spacing: .5px;
  color: #0a8f5a;
  font-weight: 600;
  margin-bottom: 8px;
}

.pc-card-title {
  font-size: 18px;
  font-weight: 700;
  color: #1f2d3d;
  line-height: 1.5;
  margin: 0 0 10px;
}

.pc-card-desc {
  flex: 1;
  margin: 0 0 16px;
  font-size: 14px;
  line-height: 1.75;
  color: #666;
}

.pc-card-spec {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.pc-card-spec span {
  padding: 3px 10px;
  border-radius: 4px;
  background: rgba(10, 143, 90, .08);
  color: #0a8f5a;
  font-size: 12px;
}

.pc-card-link {
  display: inline-block;
  color: #0a8f5a;
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
}

.pc-card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 14px;
  border-top: 1px solid #f0f3f5;
  font-size: 12px;
  color: #8a97a3;
}

/* ===== 新闻卡片：日期角标 ===== */
.pc-date {
  position: absolute;
  left: 16px;
  top: 16px;
  z-index: 2;
  padding: 8px 14px;
  border-radius: 8px;
  background: rgba(255, 255, 255, .95);
  color: #0a8f5a;
  text-align: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .15);
}

.pc-date strong {
  display: block;
  font-size: 20px;
  font-weight: 800;
  line-height: 1;
}

.pc-date span {
  display: block;
  margin-top: 2px;
  font-size: 11px;
}

/* ===== 职位列表 ===== */
.pc-job-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.pc-job-item {
  background: #fff;
  border-radius: 12px;
  border: 1px solid #eef2f4;
  box-shadow: 0 2px 12px rgba(10, 30, 50, .05);
  transition: box-shadow .3s ease, border-color .3s ease;
}

.pc-job-item:hover {
  border-color: rgba(10, 143, 90, .35);
  box-shadow: 0 8px 24px rgba(10, 30, 50, .1);
}

.pc-job-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px;
  cursor: pointer;
}

.pc-job-name {
  font-size: 18px;
  font-weight: 700;
  color: #1f2d3d;
}

.pc-job-salary {
  color: #e8703a;
  font-weight: 700;
  font-size: 16px;
}

.pc-job-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  padding: 0 24px 20px;
  font-size: 13px;
  color: #6b7884;
}

.pc-job-meta b {
  color: #1f2d3d;
  font-weight: 600;
}

.pc-job-body {
  display: none;
  padding: 0 24px 24px;
  border-top: 1px dashed #e8eef1;
}

.pc-job-item.pc-open .pc-job-body {
  display: block;
}

.pc-job-body h5 {
  margin: 18px 0 8px;
  font-size: 15px;
  color: #0a8f5a;
}

.pc-job-body p {
  margin: 0 0 8px;
  font-size: 14px;
  line-height: 1.9;
  color: #555;
}

.pc-job-toggle {
  padding: 0 24px 18px;
  color: #0a8f5a;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

/* ===== 详情页 ===== */
.pc-detail {
  max-width: 1000px;
  margin: 0 auto;
  padding: 40px 20px 60px;
}

.pc-detail-head {
  text-align: center;
  margin-bottom: 32px;
}

.pc-detail-title {
  font-size: 28px;
  font-weight: 800;
  color: #1f2d3d;
  margin: 0 0 14px;
  line-height: 1.45;
}

.pc-detail-sub {
  font-size: 13px;
  color: #8a97a3;
}

.pc-detail-sub span {
  margin: 0 8px;
}

.pc-detail-body {
  font-size: 15px;
  line-height: 2;
  color: #444;
}

.pc-detail-body img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 20px auto;
  border-radius: 8px;
}

.pc-detail-cover {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
  border-radius: 12px;
  margin-bottom: 28px;
}

/* 产品技术指标表 */
.pc-spec-table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  font-size: 14px;
}

.pc-spec-table th,
.pc-spec-table td {
  border: 1px solid #e8eef1;
  padding: 12px 16px;
  text-align: left;
}

.pc-spec-table th {
  width: 45%;
  background: #f7fafb;
  color: #1f2d3d;
  font-weight: 600;
}

.pc-detail-back {
  display: inline-block;
  margin-top: 30px;
  color: #0a8f5a;
  font-weight: 600;
  text-decoration: none;
}

/* ===== 表单状态提示 ===== */
.pc-form-tip {
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 14px;
}

.pc-form-tip.pc-ok {
  background: rgba(10, 143, 90, .1);
  color: #0a8f5a;
}

.pc-form-tip.pc-err {
  background: rgba(232, 112, 58, .1);
  color: #d3542a;
}

/* ===== 响应式 ===== */
@media (max-width: 1100px) {
  .pc-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 820px) {
  .pc-grid,
  .pc-grid.pc-grid-3 { grid-template-columns: repeat(2, 1fr); }

  .pc-card-img { height: 160px; }
  .pc-card-body { padding: 18px 16px; }
  .pc-card-title { font-size: 16px; }
  .pc-detail-title { font-size: 22px; }
  .pc-job-head { padding: 16px 18px; flex-wrap: wrap; }
  .pc-job-meta { padding: 0 18px 16px; gap: 12px; }
  .pc-job-body { padding: 0 18px 18px; }
}

@media (max-width: 560px) {
  .pc-grid,
  .pc-grid.pc-grid-3 { grid-template-columns: 1fr; }
}
