
/* ===== 移动端右侧悬浮计算器按钮 ===== */
.rc-mobile-fab {
  position: fixed;
  right: 14px;
  bottom: 88px;
  z-index: 9989;
  width: 68px;
  height: 68px;
  border-radius: 14px;
  border: none;
  background: #fff;
  color: #2d2d2d;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  box-shadow: 0 4px 16px rgba(0,0,0,.18);
  cursor: pointer;
  transition: transform .2s;
}
.rc-mobile-fab:active { transform: scale(0.92); }
@media (max-width: 768px) {
  .rc-mobile-fab { display: flex; }
}

/* ===== 面板 ===== */
.rc-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.42);
  z-index: 9991;
  opacity: 0; visibility: hidden;
  transition: opacity .25s, visibility .25s;
}
.rc-overlay.active { opacity: 1; visibility: visible; }

.rc-panel {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: 480px; max-width: 100%;
  background: #f5f6f8;
  z-index: 9992;
  display: flex; flex-direction: column;
  transform: translateX(100%);
  transition: transform .28s cubic-bezier(.4,0,.2,1);
  box-shadow: -8px 0 30px rgba(0,0,0,.12);
}
.rc-panel.active { transform: translateX(0); }

/* 头部 */
.rc-header {
  flex-shrink: 0;
  padding: 10px 16px;
  background: linear-gradient(135deg, #FF8C42, #FF6B1A);
  color: #fff;
  display: flex; align-items: center; justify-content: space-between;
}
.rc-header h3 { font-size: 15px; font-weight: 700; margin: 0; }
.rc-close {
  background: rgba(255,255,255,.22); border: none; color: #fff;
  width: 28px; height: 28px; border-radius: 50%;
  font-size: 18px; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}

/* 主体 */
.rc-body {
  flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: 10px 14px 12px;
}

/* ===== 表单 ===== */
.rc-form-card {
  background: #fff; border-radius: 10px; padding: 2px 14px;
}
.rc-form-row {
  display: flex; align-items: center;
  padding: 7px 0;
  border-bottom: 1px solid #f0f0f0;
  gap: 0; flex-wrap: nowrap;
}
.rc-form-row:last-child { border-bottom: none; }
.rc-form-row .rc-label {
  flex-shrink: 0; width: 80px;
  font-size: 15px; color: #333; font-weight: 700;
}
.rc-form-row .rc-input-wrap {
  flex: 0 0 220px; display: flex; align-items: center; justify-content: center;
  background: #f2f3f5; border-radius: 8px; padding: 0 12px; min-height: 36px;
  margin-left: 6px;
}
.rc-form-row .rc-input-wrap input[type="number"] {
  width: 100%; border: none !important; outline: none !important; background: transparent !important;
  font-size: 16px; color: #1a1f2e; text-align: center !important; font-weight: 700;
  -webkit-appearance: none !important; appearance: none !important;
  padding: 8px 0 !important; margin: 0 !important;
}
.rc-form-row .rc-input-wrap input::placeholder { color: #bbb; font-weight: 400; font-size: 14px; }
.rc-form-row .rc-unit {
  flex-shrink: 0; font-size: 14px; color: #999; width: 80px; text-align: right !important; white-space: nowrap; padding-left: 8px;
}
.rc-unit-select-wrap {
  flex-shrink: 0; position: relative; width: 80px; text-align: right !important; white-space: nowrap;
}
.rc-unit-select-wrap::before {
  content: '▼';
  position: absolute; left: 2px; top: 50%; transform: translateY(-50%);
  font-size: 12px; color: #888; line-height: 1; pointer-events: none;
}
.rc-unit-select {
  width: 100%; text-align: right !important;
  border: none !important; outline: none !important; background: transparent !important;
  font-size: 14px; color: #999; font-weight: 600;
  -webkit-appearance: none !important; appearance: none !important;
  padding: 0 4px 0 18px !important; margin: 0 !important;
}

/* ===== 按钮组 ===== */
.rc-btn-row {
  display: flex; gap: 10px; margin-top: 10px;
}
.rc-btn {
  flex: 1; padding: 10px 0; border: none; border-radius: 8px;
  font-size: 15px; font-weight: 700; cursor: pointer;
}
.rc-btn:active { transform: scale(0.97); }
.rc-btn-primary {
  background: linear-gradient(135deg, #FF8C42, #FF6B1A);
  color: #fff; box-shadow: 0 2px 8px rgba(255,107,26,.3);
}
.rc-btn-default {
  background: #fff; color: #999; border: 1px solid #e5e5e5;
}

/* ===== 结果区 ===== */
.rc-results { margin-top: 10px; }
.rc-result-card {
  background: #fff; border-radius: 10px;
  padding: 12px 18px; text-align: center;
}
.rc-result-line {
  display: flex; justify-content: space-between;
  padding: 5px 0; font-size: 14px;
}
.rc-result-line .rc-r-label { color: #333 !important; font-weight: 600; }
.rc-result-line .rc-r-value { color: #1a1f2e !important; font-weight: 700; font-variant-numeric: tabular-nums; }
/* 仅数字橙色 */
.rc-result-line.rc-val-orange .rc-r-value { color: #FF6B1A !important; font-size: 15px; }
/* 数字和文字都绿色 */
.rc-result-line.rc-green .rc-r-label { color: #00b85c !important; }
.rc-result-line.rc-green .rc-r-value { color: #00b85c !important; }
/* 文字绿色 + 数字橙色 */
.rc-result-line.rc-green.rc-val-orange .rc-r-label { color: #00b85c !important; }
.rc-result-line.rc-green.rc-val-orange .rc-r-value { color: #FF6B1A !important; font-size: 15px; }

/* 一键复制 */
.rc-copy-btn {
  display: block !important; width: 55%; margin: 12px auto 0 !important;
  padding: 10px 0 !important; background: #1a1f2e !important; color: #fff !important;
  border: none !important; border-radius: 8px !important; font-size: 14px !important; font-weight: 600 !important; cursor: pointer;
  -webkit-text-fill-color: #fff !important; -webkit-appearance: none !important; appearance: none !important;
}
.rc-copy-btn:active { transform: scale(0.97); }
.rc-copy-btn.copied { background: #00b85c; }

/* 底部导航（计算器 / 历史记录） */
.rc-tab-bar {
  flex-shrink: 0;
  display: flex; gap: 8px; margin: 10px 14px 14px;
}
.rc-tab-btn {
  flex: 1; padding: 9px 0; border: none; border-radius: 8px;
  font-size: 13px; font-weight: 600; cursor: pointer;
  background: #fff; color: #888; border: 1px solid #eee;
}
.rc-tab-btn.rc-tab-active {
  background: linear-gradient(135deg, #FF8C42, #FF6B1A);
  color: #fff; border-color: transparent;
}

/* ===== 历史记录视图 ===== */
.rc-history-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 16px; background: #fff; border-radius: 10px; margin-bottom: 12px;
}
.rc-history-header .rc-h-count { font-size: 14px; color: #666; }
.rc-history-header .rc-h-actions { display: flex; gap: 6px; }
.rc-history-header button {
  padding: 6px 12px; border: none; border-radius: 6px;
  font-size: 13px; font-weight: 600; cursor: pointer;
}
.rc-h-copy-all { background: #FF6B1A; color: #fff; }
.rc-h-clear { background: #f5f5f5; color: #999; }

.rc-history-list { display: flex; flex-direction: column; gap: 12px; }
.rc-h-item {
  background: #fff; border-radius: 10px; padding: 12px 16px;
}
.rc-h-item-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 8px;
}
.rc-h-item-time { font-size: 13px; color: #999; }
.rc-h-item-ops { display: flex; gap: 8px; }
.rc-h-item-ops button {
  padding: 4px 12px; border: 1px solid #eee; border-radius: 6px;
  font-size: 12px; font-weight: 600; cursor: pointer; background: #fff; color: #666;
}
.rc-h-item-ops .rc-h-del { color: #e74c3c; border-color: #fadbd8; }
.rc-h-input-chips {
  display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px;
}
.rc-h-chip {
  padding: 3px 10px; background: #f2f3f5; border-radius: 12px;
  font-size: 12px; color: #666;
}
.rc-h-results { padding-top: 6px; border-top: 1px dashed #eee; }
.rc-h-line {
  display: flex; justify-content: space-between;
  padding: 5px 0; font-size: 14px;
}
.rc-h-line .rc-h-lbl { color: #555 !important; }
.rc-h-line .rc-h-val { color: #1a1f2e !important; font-weight: 700; font-variant-numeric: tabular-nums; }
.rc-h-line.rc-val-orange .rc-h-val { color: #FF6B1A !important; }
.rc-h-line.rc-green .rc-h-lbl { color: #00b85c !important; }
.rc-h-line.rc-green .rc-h-val { color: #00b85c !important; }
.rc-h-line.rc-green.rc-val-orange .rc-h-lbl { color: #00b85c !important; }
.rc-h-line.rc-green.rc-val-orange .rc-h-val { color: #FF6B1A !important; }

.rc-history-empty {
  text-align: center; padding: 40px 0; color: #bbb; font-size: 14px;
}

/* 复制 toast */
.rc-toast {
  position: fixed; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0,0,0,.78); color: #fff;
  padding: 10px 22px; border-radius: 8px; font-size: 14px;
  z-index: 99999; opacity: 0; transition: opacity .25s; pointer-events: none;
}
.rc-toast.show { opacity: 1; }

/* 移动端 */
@media (max-width: 480px) {
  .rc-panel { width: 100%; }
  .rc-body { padding: 12px 12px 16px; }
  .rc-form-row .rc-label { width: 72px; font-size: 14px; }
  .rc-form-row .rc-unit { font-size: 13px; min-width: 48px; }
  .rc-result-card { padding: 16px 18px; }
  .rc-result-line { font-size: 14px; padding: 7px 0; }
  .rc-copy-btn { width: 70%; }
}
