html, body, main, header, footer {
  padding: 0px;
  margin: 0px;
}

/* ==================== 布局 ==================== */
#app {
  max-width: 960px;
  margin: 0 auto;
  padding: 20px 16px 0;
}

.app-title {
  text-align: center;
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 24px;
  color: #1a1a2e;
}

/* ==================== 卡片 ==================== */
.card {
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  padding: 24px;
  margin-bottom: 20px;
}

.card-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 16px;
  color: #16213e;
  border-bottom: 2px solid #e94560;
  padding-bottom: 8px;
}

/* ==================== 输入行 ==================== */
.input-row {
  display: flex;
  gap: 16px;
  align-items: flex-end;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 140px;
}

.input-group label {
  font-size: 0.85rem;
  font-weight: 500;
  color: #555;
}

.input-group input,
.input-group select {
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 1rem;
  background: #fafafa;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
  box-sizing: border-box;
}

.input-group input:focus,
.input-group select:focus {
  border-color: #e94560;
  box-shadow: 0 0 0 3px rgba(233, 69, 96, 0.12);
}

/* ==================== 预设按钮 ==================== */
.preset-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 16px;
}

.preset-label {
  font-size: 0.85rem;
  font-weight: 500;
  color: #777;
  margin-right: 4px;
}

.preset-btn {
  padding: 6px 14px;
  border: 1px solid #e0e0e0;
  border-radius: 20px;
  background: #f8f8f8;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  color: #333;
}

.preset-btn:hover {
  background: #e94560;
  color: #fff;
  border-color: #e94560;
}

.preset-btn:active {
  transform: scale(0.96);
}

/* ==================== 操作按钮 ==================== */
.action-row {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.action-btn {
  padding: 8px 20px;
  border: 1px solid #ddd;
  border-radius: 8px;
  background: #f5f5f5;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
  color: #333;
}

.action-btn:hover {
  background: #e8e8e8;
  border-color: #ccc;
}

.action-btn-primary {
  background: #e94560;
  color: #fff;
  border-color: #e94560;
}

.action-btn-primary:hover {
  background: #d63850;
  border-color: #d63850;
}

/* ==================== 换算结果网格 ==================== */
.results-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.result-item {
  background: #f8f9fc;
  border-radius: 10px;
  padding: 16px 10px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  border: 2px solid transparent;
}

.result-item:hover {
  border-color: #e94560;
  background: #fff5f6;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(233, 69, 96, 0.15);
}

.result-value {
  display: block;
  font-size: 1.15rem;
  font-weight: 700;
  color: #e94560;
  word-break: break-all;
}

.result-unit {
  display: block;
  font-size: 0.8rem;
  color: #888;
  margin-top: 4px;
}

/* ==================== 下载时间结果 ==================== */
.download-result {
  background: linear-gradient(135deg, #16213e, #0f3460);
  border-radius: 12px;
  padding: 24px;
  text-align: center;
  margin-top: 8px;
}

.dl-label {
  display: block;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 8px;
}

.dl-time {
  display: block;
  font-size: 2rem;
  font-weight: 700;
  color: #e94560;
  word-break: break-all;
}

.dl-detail {
  margin-top: 8px;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.6);
}

/* ==================== 复选框 ==================== */
.overhead-label {
  display: flex !important;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: #666;
  cursor: pointer;
  user-select: none;
  margin-top: 4px;
}

.overhead-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #e94560;
}

/* ==================== Toast ==================== */
.toast-msg {
  position: fixed;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #333;
  color: #fff;
  padding: 10px 24px;
  border-radius: 8px;
  font-size: 0.9rem;
  opacity: 0;
  transition: opacity 0.3s, transform 0.3s;
  z-index: 9999;
  pointer-events: none;
}

.toast-msg.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ==================== 响应式 ==================== */
@media (max-width: 768px) {
  .app-title {
    font-size: 1.4rem;
  }

  .card {
    padding: 16px;
  }

  .results-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .result-item {
    padding: 12px 8px;
  }

  .result-value {
    font-size: 1rem;
  }

  .dl-time {
    font-size: 1.5rem;
  }

  .input-row {
    flex-direction: column;
    gap: 10px;
  }

  .input-group {
    min-width: 100%;
  }

  .action-row {
    justify-content: center;
  }

  .preset-row {
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .results-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .preset-btn {
    padding: 5px 10px;
    font-size: 0.78rem;
  }

  .dl-time {
    font-size: 1.25rem;
  }
}

/* ==================== 桌面端双栏 ==================== */
@media (min-width: 769px) {
  #app {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
  }

  .app-title {
    grid-column: 1 / -1;
  }

  #converter,
  #download-estimator {
    margin-bottom: 0;
  }
}

/* ==================== 内容区域 ==================== */
#features,
#scenarios,
#FAQ {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 16px;
}

#features h2,
#scenarios h2,
#FAQ h2 {
  font-size: 1.2rem;
  font-weight: 600;
  color: #16213e;
  margin-bottom: 12px;
}

#features p {
  font-size: 0.95rem;
  line-height: 1.7;
  color: #555;
}

#scenarios ul {
  padding-left: 20px;
}

#scenarios li {
  font-size: 0.95rem;
  line-height: 1.7;
  color: #555;
  margin-bottom: 6px;
}

#FAQ dl {
  margin: 0;
}

#FAQ dt {
  font-weight: 600;
  font-size: 0.95rem;
  color: #333;
  margin-bottom: 4px;
  margin-top: 16px;
}

#FAQ dd {
  font-size: 0.9rem;
  line-height: 1.6;
  color: #666;
  margin-left: 0;
  margin-bottom: 8px;
}

#__fork {
  max-width: 960px;
  margin: 24px auto;
  padding: 0 16px;
  text-align: center;
}

/* ==================== Footer ==================== */
footer {
  text-align: center;
  padding: 20px 16px;
}

.page-info {
  font-size: 0.85rem;
  color: #999;
}

.page-info a {
  color: #e94560;
  text-decoration: none;
}

.page-info a:hover {
  text-decoration: underline;
}
