/* 文件描述：私有云方案规划页样式 */
/* 前缀 calc- */

body.calc-page {
  padding-top: var(--nav-height);
  background: var(--slate-50);
  --calc-card-overlap: clamp(48px, calc(100vw * 72 / 1440), 72px);
  --calc-r6: 6px;
}

body.calc-page .nav:not(.is-scrolled) {
  background: #fff;
  border-bottom-color: transparent;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.calc-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Hero */
.calc-hero {
  position: relative;
  overflow: hidden;
  background: var(--slate-100);
}

.calc-hero-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.calc-hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center right;
}

.calc-hero-bg .top-icon {
  position: absolute;
  width: 520px;
  height: 300px;
  top: 50%;
  transform: translateY(-50%);
  right: calc((100vw - 1440px) / 2 + 120px);
  background: url("/static/skin/images/service/top-icon.png") no-repeat center / contain;
}

@media (max-width: 1440px) {
  .calc-hero-bg .top-icon {
    width: calc(520 / 1440 * 100vw);
    height: calc(370 / 1440 * 100vw);
    right: calc(120 / 1440 * 100vw);
  }
}

.calc-hero-inner {
  position: relative;
  z-index: 1;
  padding: clamp(40px, calc(100vw * 56 / 1440), 56px) 0
    calc(var(--calc-card-overlap) + clamp(24px, calc(100vw * 32 / 1440), 32px));
}

.calc-hero-title {
  font-size: var(--fs-block-head);
  font-weight: 700;
  color: var(--primary);
  margin: 0 0 12px;
}

.calc-hero-desc {
  font-size: var(--fs-16);
  color: var(--on-surface-variant);
  margin: 0;
}

/* Main */
.calc-main {
  margin-top: calc(var(--calc-card-overlap) * -0.5);
  padding-bottom: clamp(56px, calc(100vw * 80 / 1440), 80px);
  position: relative;
  z-index: 2;
}

.calc-workbench {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  gap: clamp(20px, calc(100vw * 28 / 1440), 28px);
  background: #fff;
  border-radius: var(--r8);
  padding: clamp(20px, calc(100vw * 28 / 1440), 28px);
  box-shadow: 0 4px 24px rgba(15, 35, 65, 0.06);
}

.calc-section-title {
  font-size: var(--fs-18);
  font-weight: 600;
  color: var(--on-surface);
  margin: 0 0 16px;
}

.calc-subtitle {
  font-size: var(--fs-16);
  font-weight: 600;
  margin: 0 0 12px;
  color: var(--on-surface);
}

/* Form */
.calc-fields {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.calc-field-row label {
  display: block;
  font-size: var(--fs-14);
  font-weight: 500;
  color: var(--on-surface);
  margin-bottom: 8px;
}

.calc-field-desc {
  margin: 6px 0 0;
  font-size: var(--fs-12);
  line-height: 1.5;
  color: #8a94a6;
}

.calc-input-wrap {
  display: flex;
  align-items: center;
  border: 1px solid #dce3ec;
  border-radius: var(--calc-r6);
  background: #fff;
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.calc-input-wrap:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 87, 156, 0.12);
}

.calc-input,
.calc-select {
  width: 100%;
  height: 40px;
  border: 1px solid #dce3ec;
  border-radius: var(--calc-r6);
  padding: 0 12px;
  font-size: var(--fs-14);
  color: var(--on-surface);
  background: #fff;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.calc-input-wrap .calc-input {
  flex: 1;
  min-width: 0;
  height: 40px;
  border: none;
  border-radius: 0;
  box-shadow: none;
  padding-right: 4px;
}

.calc-input-wrap .calc-input:focus {
  outline: none;
  border-color: transparent;
  box-shadow: none;
}

.calc-input:focus,
.calc-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 87, 156, 0.12);
}

.calc-input-wrap .calc-unit {
  flex-shrink: 0;
  padding: 0 12px;
  font-size: var(--fs-14);
  color: #8a94a6;
  white-space: nowrap;
  user-select: none;
}

.calc-form-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

.calc-form-actions .calc-btn {
  flex: 1;
}

.calc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  padding: 0 20px;
  border-radius: var(--calc-r6);
  font-size: var(--fs-14);
  font-weight: 500;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.calc-btn--primary {
  background: var(--primary);
  color: #fff;
}

.calc-btn--primary:hover {
  background: #004a85;
}

.calc-btn--ghost {
  background: #eef4fb;
  border-color: #c3d4e5;
  color: var(--primary);
}

.calc-btn--ghost:hover {
  background: #e3edf8;
  border-color: #a8bfd4;
}

.calc-btn--outline {
  background: #fff;
  border-color: var(--primary);
  color: var(--primary);
  border-radius: var(--calc-r6);
}

.calc-btn--block {
  width: 100%;
}

.calc-link-btn {
  background: none;
  border: none;
  color: var(--primary);
  font-size: var(--fs-14);
  cursor: pointer;
  padding: 0;
}

/* Result */
.calc-result {
  min-width: 0;
}

.calc-result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  position: sticky;
  top: var(--nav-height);
  z-index: 30;
  background: #fff;
  padding: 12px 0;
  margin-bottom: 16px;
  border-bottom: 1px solid #eef2f6;
}

.calc-result-head .calc-section-title {
  margin: 0;
}

.calc-result-actions {
  display: flex;
  gap: 10px;
}

.calc-result-panel {
  position: relative;
  min-height: 420px;
  border: 1px solid #eef2f6;
  border-radius: var(--r8);
  background: #fafbfc;
  overflow: hidden;
}

.calc-loading {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.85);
}

.calc-result-panel.is-loading .calc-loading {
  display: flex;
}

.calc-loading-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(30, 91, 181, 0.15);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: calc-spin 0.8s linear infinite;
}

@keyframes calc-spin {
  to { transform: rotate(360deg); }
}

.calc-empty {
  padding: 64px 24px;
  text-align: center;
}

.calc-empty-title {
  font-size: var(--fs-16);
  font-weight: 600;
  margin: 0 0 8px;
  color: var(--on-surface);
}

.calc-empty-desc {
  font-size: var(--fs-14);
  color: var(--on-surface-variant);
  margin: 0;
  max-width: 420px;
  margin-inline: auto;
}

.calc-result-body {
  padding: 20px;
}

.calc-summary {
  background: #fff;
  border-radius: var(--r8);
  padding: 16px 18px;
  margin-bottom: 20px;
  border: 1px solid #eef2f6;
}

.calc-summary-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.calc-summary-title {
  font-size: var(--fs-15);
  font-weight: 600;
  margin: 0;
}

.calc-summary-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px 16px;
  margin: 0;
}

.calc-summary-list dt {
  font-size: var(--fs-13);
  color: var(--on-surface-variant);
  margin: 0;
}

.calc-summary-list dd {
  font-size: var(--fs-14);
  font-weight: 600;
  color: var(--on-surface);
  margin: 2px 0 0;
}

.calc-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.calc-tab {
  height: 36px;
  padding: 0 14px;
  border: 1px solid #dce3ec;
  border-radius: var(--calc-r6);
  background: #fff;
  font-size: var(--fs-13);
  color: var(--on-surface-variant);
  cursor: pointer;
}

.calc-tab.is-active {
  border-color: var(--primary);
  color: var(--primary);
  background: #e8f1ff;
  font-weight: 600;
}

.calc-scheme-detail {
  background: #fff;
  border: 1px solid #eef2f6;
  border-radius: var(--r8);
  padding: 18px;
}

.calc-intro-list {
  margin: 0 0 16px;
  padding-left: 18px;
  color: var(--on-surface-variant);
  font-size: var(--fs-14);
  line-height: 1.65;
}

.calc-diagram {
  margin: 0 0 18px;
  text-align: center;
}

.calc-diagram img {
  max-width: 100%;
  height: auto;
  border-radius: var(--calc-r6);
}

.calc-hw-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-14);
}

.calc-hw-table th,
.calc-hw-table td {
  padding: 12px 10px;
  text-align: left;
  border-bottom: 1px solid #eef2f6;
  vertical-align: top;
}

.calc-hw-table th {
  font-weight: 600;
  color: var(--on-surface);
  background: rgba(195, 212, 229, 0.15);
}

.calc-hw-select {
  width: 100%;
  min-width: 180px;
  height: 36px;
  border: 1px solid #dce3ec;
  border-radius: var(--calc-r6);
  padding: 0 10px;
}

.calc-bom-table td:nth-child(3),
.calc-resource-table td:nth-child(2),
.calc-resource-table td:nth-child(3) {
  white-space: nowrap;
}

.calc-bom-meta td {
  background: rgba(195, 212, 229, 0.08);
  font-weight: 500;
}

.calc-save-row {
  margin-top: 14px;
  text-align: right;
}

.is-hidden {
  display: none !important;
}

/* Modal */
.calc-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.calc-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
}

.calc-modal-box {
  position: relative;
  z-index: 1;
  width: min(480px, 100%);
  max-height: 90vh;
  overflow-y: auto;
  background: #fff;
  border-radius: var(--r8);
  padding: 20px 22px 24px;
  box-shadow: 0 20px 50px rgba(15, 35, 65, 0.2);
}

.calc-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.calc-modal-title {
  font-size: var(--fs-18);
  font-weight: 600;
  margin: 0;
}

.calc-modal-close {
  background: none;
  border: none;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  color: #8a94a6;
}

.calc-consult-form .calc-field {
  margin-bottom: 14px;
}

.calc-label {
  display: block;
  font-size: var(--fs-14);
  margin-bottom: 6px;
  color: var(--on-surface);
}

.calc-req {
  color: var(--primary);
  margin-left: 2px;
}

.calc-captcha-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.calc-captcha-row .calc-input {
  flex: 1;
}

.calc-captcha-img {
  border: 1px solid #dce3ec;
  border-radius: var(--calc-r6);
  cursor: pointer;
}

.calc-field--check .calc-check {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  font-size: var(--fs-13);
  color: var(--on-surface-variant);
  line-height: 1.5;
}

.calc-form-error {
  color: #e64340;
  font-size: var(--fs-13);
  min-height: 18px;
  margin: 0 0 8px;
}

@media (max-width: 960px) {
  .calc-workbench {
    grid-template-columns: 1fr;
  }

  .calc-result-actions {
    width: 100%;
    justify-content: flex-end;
  }
}

@media (max-width: 640px) {
  .calc-form-actions {
    flex-direction: column;
  }

  .calc-btn {
    width: 100%;
  }
}
