:root {
  color-scheme: light;
  --primary: #fe2c55;
  --secondary: #1aa3ff;
  --bg: #eef8ff;
  --card-bg: rgba(255, 255, 255, 0.76);
  --text: #263241;
  --text-gray: #68778a;
  --input-bg: rgba(255, 255, 255, 0.64);
  --border: rgba(128, 163, 190, 0.24);
  --shadow: 0 24px 70px rgba(71, 112, 148, 0.18);
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, "Noto Sans SC", sans-serif;
  background:
    linear-gradient(140deg, rgba(229, 246, 255, 0.96), rgba(246, 252, 255, 0.82) 42%, rgba(220, 240, 255, 0.9)),
    repeating-linear-gradient(135deg, rgba(94, 151, 194, 0.06) 0 1px, transparent 1px 18px),
    var(--bg);
}

button,
input,
select {
  font: inherit;
}

.pk-shell {
  width: 100%;
  max-width: 560px;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 12px;
  margin-bottom: 12px;
  border: 1px solid rgba(128, 163, 190, 0.22);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.5);
  color: #527591;
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.pk-panel {
  position: relative;
  overflow: hidden;
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 26px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.88), rgba(255, 255, 255, 0.62)),
    var(--card-bg);
  box-shadow: var(--shadow);
  padding: 30px;
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
}

.pk-panel::before {
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: linear-gradient(90deg, rgba(254, 44, 85, 0.76), rgba(26, 163, 255, 0.54) 24%, rgba(143, 124, 232, 0.46) 50%, rgba(26, 163, 255, 0.54) 76%, rgba(254, 44, 85, 0.76));
  content: "";
}

.panel-topbar {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.panel-topbar .panel-back-link {
  justify-self: start;
  margin: 0;
}

.panel-topbar .eyebrow {
  grid-column: 2;
  justify-self: center;
  margin: 0;
}

.pk-header {
  text-align: center;
  margin-bottom: 24px;
}

.panel-back-link {
  position: relative;
  z-index: 1;
  margin: 0 0 18px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid rgba(128, 163, 190, 0.24);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.56);
  color: #527591;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  white-space: nowrap;
}

h1 {
  margin: 0;
  color: #222b38;
  font-size: 22px;
  line-height: 1.3;
  letter-spacing: 0;
  font-weight: 850;
}

.pk-header p {
  margin: 8px auto 0;
  max-width: 420px;
  color: var(--text-gray);
  font-size: 13px;
  line-height: 1.7;
}

.tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 24px;
  padding: 5px;
  border: 1px solid rgba(128, 163, 190, 0.18);
  border-radius: 18px;
  background: rgba(224, 240, 249, 0.62);
}

.tab-btn {
  flex: 1;
  min-height: 42px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: var(--text-gray);
  cursor: pointer;
  font-weight: 720;
  transition: color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.tab-btn.active {
  background: rgba(255, 255, 255, 0.88);
  color: var(--primary);
  box-shadow: 0 8px 22px rgba(78, 111, 145, 0.12);
}

.input-grid {
  display: grid;
  gap: 18px;
}

.field,
.range-grid {
  min-width: 0;
}

.range-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

label,
.field > span,
.field > label {
  display: block;
  margin-bottom: 8px;
  color: #425064;
  font-size: 14px;
  font-weight: 720;
}

input,
select {
  width: 100%;
  height: 48px;
  border: 1px solid rgba(128, 163, 190, 0.22);
  border-radius: 16px;
  background: var(--input-bg);
  color: var(--text);
  font-size: 16px;
  outline: none;
  padding: 0 14px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

input:focus,
select:focus {
  border-color: rgba(254, 44, 85, 0.36);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 0 0 4px rgba(254, 44, 85, 0.1);
}

small,
#mode-desc {
  display: block;
  min-height: 20px;
  margin-top: 6px;
  color: #8490a1;
  font-size: 12px;
  line-height: 1.6;
}

.result-card {
  margin-top: 26px;
  border: 1px solid rgba(128, 163, 190, 0.2);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.58);
  padding: 20px;
}

.result-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px dashed rgba(128, 163, 190, 0.22);
}

.result-row:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: 0;
}

.highlight-row {
  margin: 0 -20px 12px;
  padding: 12px 20px;
  border-bottom: 0;
  background: rgba(254, 44, 85, 0.05);
}

.result-label {
  color: var(--text-gray);
  font-size: 14px;
}

.result-value {
  color: #263241;
  font-size: 18px;
  font-weight: 800;
  text-align: right;
}

.highlight-dou {
  color: var(--primary);
  font-size: 20px;
}

.highlight-rmb {
  color: #f08b3e;
  font-size: 24px;
}

.breakdown-box {
  margin-bottom: 14px;
  border: 1px solid rgba(26, 163, 255, 0.18);
  border-radius: 16px;
  background: rgba(232, 247, 255, 0.72);
  padding: 12px;
  color: var(--secondary);
  font-size: 13px;
  line-height: 1.6;
  text-align: center;
}

.breakdown-title {
  display: block;
  margin-bottom: 6px;
  font-size: 15px;
  font-weight: 800;
  text-align: left;
}

#res-breakdown-text {
  display: block;
  color: var(--secondary);
  font-size: 15px;
  font-weight: 800;
  word-break: break-word;
}

.hidden {
  display: none;
}

@media (max-width: 560px) {
  body {
    padding: 14px;
  }

  .pk-panel {
    border-radius: 24px;
    padding: 22px;
  }

  .panel-topbar {
    grid-template-columns: 1fr;
    justify-items: start;
    gap: 10px;
  }

  .panel-topbar .eyebrow {
    grid-column: auto;
    justify-self: center;
    width: 100%;
  }

  .range-grid {
    grid-template-columns: 1fr;
  }

  .result-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

  .result-value {
    text-align: left;
  }
}
