* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: #f5f6fa;
  color: #2f3640;
}

.page {
  max-width: 1200px;
  margin: 20px auto 40px;
  padding: 0 16px;
}

.page-title {
  text-align: center;
  font-size: 28px;
  margin-bottom: 0;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.lang-switch {
  margin-left: auto;
}

.section {
  margin-bottom: 16px;
}

/* 标签 / pill */

.pill-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
}

.pill-title small {
  font-weight: normal;
  color: #888;
  margin-left: 6px;
}

.coin-tabs,
.pill-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* 货币选择区可以直接用 pill-group 的样式，这里只加一点间距（可选） */
#currencyTabs {
  margin-top: 4px;
}

.coin-pill,
.pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid #dcdde1;
  background: #ffffff;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.15s ease-in-out;
}

.coin-pill.active,
.pill.active {
  border-color: #ff9f43;
  background: #fff4e6;
  color: #e67e22;
}

.coin-pill-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  margin-right: 6px;
  font-size: 12px;
  color: #fff;
}

.coin-pill-img {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  margin-right: 6px;
  object-fit: contain;
  background: #ffffff;
}

.coin-pill-label {
  font-weight: 500;
}

/* 布局 */

.layout {
  display: flex;
  gap: 16px;
  margin-top: 16px;
}

.card {
  flex: 1;
  background: #ffffff;
  border-radius: 10px;
  padding: 16px 20px 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.card-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-title small {
  font-size: 12px;
  color: #888;
}

/* 子区块 */

.sub-section {
  border-top: 1px solid #f1f2f6;
  padding-top: 10px;
  margin-top: 10px;
}

.sub-section:first-of-type {
  border-top: none;
  padding-top: 0;
  margin-top: 0;
}

.sub-title {
  font-size: 14px;
  font-weight: 600;
  color: #ff9f43;
  margin-bottom: 6px;
}

/* 表单行 */

.form-row {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
  font-size: 14px;
}

.form-row label {
  width: 80px;
  flex-shrink: 0;
}

.label-with-tip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.top-wrap {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.top-card {
  flex: 1;
  min-width: 440px;
  max-width: 520px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 12px 14px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.02);
}

.coin-section {
  flex: 1;
  min-width: 320px;
}

.miner-picker-box {
  max-width: 420px;
  width: 100%;
  margin: 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid #e5e7eb;
  box-shadow: 0 4px 12px rgba(0,0,0,0.02);
}

.info-tip {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #eef1f6;
  color: #555;
  font-size: 12px;
  cursor: help;
  border: 1px solid #dcdde1;
  position: relative;
}

.form-row .label-with-tip {
  width: auto;
  min-width: 120px;
}

.info-tip::after {
  content: attr(data-tip);
  position: absolute;
  top: 120%;
  left: 50%;
  transform: translateX(-50%);
  background: #333;
  color: #fff;
  padding: 6px 8px;
  border-radius: 4px;
  font-size: 12px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
  z-index: 10;
}

.info-tip::before {
  content: "";
  position: absolute;
  top: 110%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-bottom-color: #333;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.info-tip:hover::after,
.info-tip:hover::before {
  opacity: 1;
}

.form-row input[type="number"],
.form-row input[type="text"] {
  flex: 1;
  padding: 6px 8px;
  border-radius: 4px;
  border: 1px solid #dcdde1;
  font-size: 14px;
}

.form-row .unit {
  margin-left: 8px;
  color: #888;
  flex-shrink: 0;
}

.form-row select#hashUnit {
  margin-left: 6px;
  padding: 6px 8px;
  border-radius: 4px;
  border: 1px solid #dcdde1;
  font-size: 14px;
}

/* 按钮 */

.btn-row {
  margin-top: 12px;
  text-align: right;
}

#calcBtn {
  padding: 8px 20px;
  border-radius: 6px;
  border: none;
  background: #ff9f43;
  color: #fff;
  font-size: 14px;
  cursor: pointer;
}

#calcBtn:hover {
  background: #ff7f00;
}

/* 结果表 */

.result-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  margin-top: 4px;
}

.result-table th,
.result-table td {
  border: 1px solid #f1f2f6;
  padding: 6px 8px;
  text-align: right;
}

.result-table th:first-child,
.result-table td:first-child {
  text-align: left;
}

.summary-box {
  background: linear-gradient(180deg, #eaf3ff 0%, #f7fbff 50%, #f7fbff 100%);
  border: 1px solid #e1e6ef;
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 12px;
  font-size: 14px;
  color: #1f2d3d;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.summary-label {
  color: #4a5568;
  font-weight: 600;
}

.summary-value {
  color: #0f172a;
  font-weight: 700;
  font-size: 15px;
}

.summary-label.subtle {
  font-weight: 400;
  font-size: 12.5px;
  color: #6b7280;
}

.summary-row.subtle-row .summary-value {
  font-weight: 400;
  font-size: 13px;
  color: #374151;
}

.roi-box {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 14px 14px 16px;
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  color: #1f2937;
}

.roi-top {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
}

.roi-meta {
  text-align: center;
}

.roi-meta .roi-label {
  font-size: 14px;
  color: #111827;
  font-weight: 600;
}

.roi-meta .roi-value {
  font-size: 22px;
  font-weight: 700;
  color: #111827;
}

.roi-legend {
  margin-top: 6px;
  text-align: center;
  font-size: 12px;
  color: #374151;
  display: flex;
  justify-content: center;
  gap: 12px;
}

.roi-legend .dot {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.roi-legend .dot::before {
  content: "";
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.dot-power::before {
  background: #60a5fa;
}

.dot-profit::before {
  background: #fbbf24;
}

.roi-payback {
  text-align: center;
}

.roi-payback .roi-label {
  font-size: 14px;
  color: #111827;
  font-weight: 600;
}

.roi-payback-val {
  font-size: 22px;
  font-weight: 700;
  color: #111827;
}

#powerPie {
  width: 100%;
  max-width: 360px;
  align-self: center;
}

.mode-hash .mode-miner-only {
  display: none !important;
}

.mode-hash #powerPie {
  display: none;
}

.profit-positive {
  color: #e74c3c;
}

.profit-negative {
  color: #27ae60;
}

/* 说明文字 */

.small-text {
  font-size: 12px;
  color: #999;
  margin-top: 8px;
}

/* 响应式 */

@media (max-width: 900px) {
  .layout {
    flex-direction: column;
  }

  .top-wrap {
    flex-direction: column;
    gap: 10px;
  }

  .top-card {
    min-width: 0;
    max-width: 100%;
    width: 100%;
  }

  .miner-picker-box {
    min-width: 0;
    max-width: 100%;
    width: 100%;
  }
}
