/* ====================================================
   德邦快递价格计算器 · 亚克力风格
   ==================================================== */

:root {
  /* 主色 - 德邦蓝 */
  --primary: #1e6cff;
  --primary-deep: #0050d4;
  --primary-light: #5b9bff;

  /* 强调色 */
  --accent-purple: #8b5cf6;
  --accent-pink: #ec4899;
  --accent-cyan: #06b6d4;
  --accent-orange: #f97316;
  --accent-green: #10b981;
  --accent-red: #ef4444;

  /* 背景渐变 */
  --bg-1: #f0f4ff;
  --bg-2: #e0e7ff;
  --bg-3: #fef3f8;

  /* 玻璃面板色 */
  --glass-bg: rgba(255, 255, 255, 0.55);
  --glass-bg-strong: rgba(255, 255, 255, 0.75);
  --glass-border: rgba(255, 255, 255, 0.85);
  --glass-shadow:
    0 8px 32px rgba(31, 70, 165, 0.12),
    0 2px 8px rgba(31, 70, 165, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);

  /* 文字 */
  --text-1: #0f1b3d;
  --text-2: #4a5878;
  --text-3: #8a96b4;

  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 10px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei",
    "Helvetica Neue", Arial, sans-serif;
  color: var(--text-1);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  -webkit-font-smoothing: antialiased;
}

/* 背景基底：固定层，视口多大就铺多大，
   页面再长也不会产生渐变平铺的拼缝 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(135deg, var(--bg-1) 0%, var(--bg-2) 50%, var(--bg-3) 100%);
  background-attachment: fixed;
}

/* ====================================================
   背景动态光斑
   ==================================================== */
.bg-orbs {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.55;
  animation: float 18s ease-in-out infinite;
}

.orb-1 {
  width: 480px; height: 480px;
  background: radial-gradient(circle, #6ea8ff 0%, transparent 70%);
  top: -120px; left: -120px;
}

.orb-2 {
  width: 420px; height: 420px;
  background: radial-gradient(circle, #c084fc 0%, transparent 70%);
  top: 30%; right: -100px;
  animation-delay: -4s;
}

.orb-3 {
  width: 380px; height: 380px;
  background: radial-gradient(circle, #f0abfc 0%, transparent 70%);
  bottom: -120px; left: 30%;
  animation-delay: -8s;
}

.orb-4 {
  width: 320px; height: 320px;
  background: radial-gradient(circle, #5eead4 0%, transparent 70%);
  top: 60%; left: 10%;
  animation-delay: -12s;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%      { transform: translate(40px, -30px) scale(1.08); }
  66%      { transform: translate(-30px, 40px) scale(0.95); }
}

/* ====================================================
   主容器
   ==================================================== */
.app {
  position: relative;
  z-index: 1;
  max-width: 1180px;
  margin: 0 auto;
  padding: 36px 28px 48px;
}

/* ====================================================
   亚克力通用类
   ==================================================== */
.acrylic {
  background: var(--glass-bg);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--glass-shadow);
  position: relative;
  overflow: hidden;
}

.acrylic::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg,
    rgba(255, 255, 255, 0.55) 0%,
    rgba(255, 255, 255, 0.12) 50%,
    rgba(255, 255, 255, 0) 100%);
  pointer-events: none;
  border-radius: inherit;
}

/* ====================================================
   Header
   ==================================================== */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 28px;
  margin-bottom: 26px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 16px;
}

.logo-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent-purple) 100%);
  box-shadow:
    0 8px 20px rgba(30, 108, 255, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.logo-icon svg {
  width: 28px;
  height: 28px;
}

.logo-text h1 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, var(--text-1), var(--primary));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.logo-text p {
  font-size: 13px;
  color: var(--text-2);
  margin-top: 2px;
}

/* ====================================================
   布局
   ==================================================== */
.layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  margin-bottom: 22px;
}

@media (max-width: 880px) {
  .layout { grid-template-columns: 1fr; }
  .header { flex-direction: column; gap: 14px; align-items: flex-start; }
}

/* ====================================================
   面板通用
   ==================================================== */
.panel {
  padding: 26px 26px 28px;
}

.panel-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 22px;
}

.panel-icon {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, rgba(30, 108, 255, 0.12), rgba(139, 92, 246, 0.12));
  color: var(--primary);
  border: 1px solid rgba(255, 255, 255, 0.9);
}

.panel-icon svg { width: 18px; height: 18px; }

.panel-title h2 {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-1);
  letter-spacing: -0.3px;
}

.table-meta {
  margin-left: auto;
  font-size: 12px;
  color: var(--text-3);
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.8);
}

/* ====================================================
   表单
   ==================================================== */
.field {
  margin-bottom: 20px;
}

.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 10px;
  letter-spacing: 0.2px;
}

.field-hint {
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-3);
}

/* select */
.select-wrap {
  position: relative;
}

select {
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  padding: 14px 44px 14px 16px;
  border-radius: var(--radius-sm);
  border: 1.5px solid rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.7);
  font-size: 15px;
  font-weight: 500;
  color: var(--text-1);
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(31, 70, 165, 0.06);
  transition: all 0.2s ease;
}

select:focus {
  outline: none;
  border-color: var(--primary);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 0 0 4px rgba(30, 108, 255, 0.12);
}

.select-arrow {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--text-2);
  pointer-events: none;
}

/* 长宽高三栏 */
.dim-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
}

.dim-input,
.weight-input {
  position: relative;
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.7);
  border: 1.5px solid rgba(255, 255, 255, 0.9);
  border-radius: var(--radius-sm);
  padding: 4px 12px;
  box-shadow: 0 2px 6px rgba(31, 70, 165, 0.06);
  transition: all 0.2s ease;
}

.dim-input:focus-within,
.weight-input:focus-within {
  border-color: var(--primary);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 0 0 4px rgba(30, 108, 255, 0.12);
}

.dim-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-3);
  margin-right: 8px;
}

.dim-input input,
.weight-input input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  padding: 12px 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-1);
  font-family: inherit;
  width: 100%;
  min-width: 0;
}

.dim-input input::-webkit-outer-spin-button,
.dim-input input::-webkit-inner-spin-button,
.weight-input input::-webkit-outer-spin-button,
.weight-input input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.dim-unit,
.weight-unit {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-3);
  margin-left: 6px;
}

/* 按钮 */
.actions {
  display: flex;
  gap: 10px;
  margin-top: 26px;
}

.btn {
  flex: 1;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  border: none;
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s ease;
  letter-spacing: 0.5px;
}

.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent-purple) 100%);
  box-shadow:
    0 8px 20px rgba(30, 108, 255, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow:
    0 12px 26px rgba(30, 108, 255, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.btn-primary:active { transform: translateY(0); }

.btn-ghost {
  background: rgba(255, 255, 255, 0.7);
  color: var(--text-2);
  border: 1.5px solid rgba(255, 255, 255, 0.9);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.95);
  color: var(--text-1);
}

/* ====================================================
   结果面板
   ==================================================== */
.result-panel {
  display: flex;
  flex-direction: column;
}

.price-hero {
  text-align: center;
  padding: 24px 20px;
  border-radius: var(--radius-md);
  background:
    linear-gradient(135deg, rgba(30, 108, 255, 0.95) 0%, rgba(139, 92, 246, 0.95) 100%);
  color: #fff;
  box-shadow:
    0 12px 28px rgba(30, 108, 255, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  margin-bottom: 22px;
  position: relative;
  overflow: hidden;
}

.price-hero::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background:
    radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.3) 0%, transparent 40%),
    radial-gradient(circle at 70% 70%, rgba(255, 255, 255, 0.18) 0%, transparent 50%);
  pointer-events: none;
}

.price-hero-label {
  font-size: 13px;
  opacity: 0.85;
  letter-spacing: 2px;
  font-weight: 500;
  position: relative;
}

.price-hero-value {
  font-size: 54px;
  font-weight: 800;
  margin-top: 8px;
  letter-spacing: -2px;
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 6px;
  position: relative;
  transition: transform 0.3s ease;
}

.price-hero.flash .price-hero-value {
  animation: priceFlash 0.5s ease;
}

@keyframes priceFlash {
  0%   { transform: scale(0.92); }
  60%  { transform: scale(1.06); }
  100% { transform: scale(1); }
}

.price-hero-value .currency {
  font-size: 24px;
  font-weight: 600;
  opacity: 0.85;
}

.price-hero-meta {
  margin-top: 8px;
  font-size: 13px;
  opacity: 0.8;
  position: relative;
}

/* 明细 */
.breakdown { display: flex; flex-direction: column; gap: 4px; }

.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 4px;
  border-radius: 10px;
}

.row + .row { border-top: 1px dashed rgba(140, 160, 220, 0.18); }

.row-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  flex-wrap: wrap;
}

.row-sub {
  font-size: 11px;
  font-weight: 400;
  color: var(--text-3);
  background: rgba(255, 255, 255, 0.5);
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.7);
}

.row-value {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-1);
  display: inline-flex;
  align-items: baseline;
  gap: 3px;
  font-variant-numeric: tabular-nums;
}

.row-unit {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-3);
  margin-left: 4px;
}

/* 标签旁的单位小标签 */
.field-tip {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 8px;
  font-size: 11px;
  font-weight: 600;
  color: var(--primary);
  background: rgba(30, 108, 255, 0.1);
  border-radius: 999px;
  vertical-align: middle;
}

.currency-mini {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-3);
  margin-right: 2px;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.dot-blue   { background: linear-gradient(135deg, #5b9bff, #1e6cff); }
.dot-purple { background: linear-gradient(135deg, #c084fc, #8b5cf6); }
.dot-orange { background: linear-gradient(135deg, #fb923c, #f97316); }
.dot-green  { background: linear-gradient(135deg, #34d399, #10b981); }

.divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(140, 160, 220, 0.35), transparent);
  margin: 10px 0;
}

/* 公式 */
.formula {
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.55);
  border: 1px dashed rgba(140, 160, 220, 0.35);
}

.formula-label {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  color: var(--primary);
  background: rgba(30, 108, 255, 0.1);
  padding: 3px 10px;
  border-radius: 999px;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.formula-text {
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.6;
  font-variant-numeric: tabular-nums;
}

/* ====================================================
   价目表
   ==================================================== */
.price-table-panel {
  margin-bottom: 22px;
  padding-bottom: 20px;
}

/* 让表格直接坐在亚克力背景上，不制造内嵌白框 */
.table-wrap {
  border-radius: 0;
  background: transparent;
  border: none;
  overflow: hidden;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

thead {
  background: linear-gradient(135deg,
    rgba(30, 108, 255, 0.16),
    rgba(139, 92, 246, 0.16));
  border-top: 1px solid rgba(255, 255, 255, 0.7);
  border-bottom: 1px solid rgba(255, 255, 255, 0.55);
}

th {
  text-align: left;
  padding: 12px 16px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-2);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

th:not(:first-child),
td:not(:first-child) { text-align: right; }

tbody tr {
  border-top: 1px solid rgba(140, 160, 220, 0.15);
  transition: background 0.15s ease;
}

tbody tr:hover { background: rgba(30, 108, 255, 0.05); }

td {
  padding: 11px 16px;
  color: var(--text-1);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

tbody tr.match-row {
  background: linear-gradient(90deg, rgba(30, 108, 255, 0.12), rgba(139, 92, 246, 0.06));
  position: relative;
}

tbody tr.match-row td:first-child::before {
  content: "●";
  color: var(--primary);
  margin-right: 6px;
  font-size: 10px;
}

tbody tr.match-row td {
  font-weight: 700;
}
