/* PoW相关UI样式 */

/* 发帖按钮样式 */
#postBtn {
  background: #F7931A;
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 9999px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease;
  box-shadow: none;
}

#postBtn:hover {
  background: #e08417;
}

#postBtn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* 统一主色按钮样式（与主页发布贴子按钮一致） */
.primary-btn {
  background: #F7931A;
  color: white;
  border: none;
  border-radius: 9999px;
}

/* 主色按钮悬停与媒体切换样式，跟发帖按钮一致 */
.primary-btn:hover { background: #e08417; }
.media-toggle .toggle.primary-btn {
  padding: 4px 10px;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.2s ease;
}
.media-toggle .toggle.primary-btn.active { background: #e08417; }

/* 评论区的“发表评论”按钮优先应用主色 */
.comment-form button.primary-btn {
  background: #F7931A;
  color: white;
  border: none;
  border-radius: 9999px;
}

/* 阅读按钮统一主色（保持原有尺寸） */
.read-btn {
  background: transparent;
  color: #333;
  border: none;
  padding: 6px 12px;
  border-radius: 9999px;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.read-btn:hover,
.read-btn:focus-visible {
  background: #d9d9d9; /* darker than post #f2f2f2 */
}

/* 钱包按钮统一主色 */
.dogecoin-btn {
  background: #F7931A;
  color: white;
  border: none;
  border-radius: 9999px;
}

/* 退出按钮与取消按钮统一灰色样式 */
.logout-btn {
  background: #4D4D4D;
  color: white;
  border: none;
  border-radius: 9999px;
}
.logout-btn:hover { background: #5a6268; }

.cancel-btn {
  background: #4D4D4D;
  color: white;
  border: none;
  border-radius: 9999px;
}
.cancel-btn:hover { background: #5a6268; }

/* 表单右侧按钮组（提交/取消并排） */
.form-actions-row .form-buttons { display: flex; gap: 8px; }

/* PoW进度容器 */
.pow-progress-container {
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  padding: 16px;
  margin: 12px 0;
  animation: slideIn 0.3s ease-out;
}

.pow-progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  font-weight: 600;
  color: #495057;
}

.pow-progress-bar-container {
  background: #e9ecef;
  border-radius: 10px;
  height: 8px;
  overflow: hidden;
  margin-bottom: 12px;
}

.pow-progress-bar {
  background: linear-gradient(90deg, #28a745, #20c997);
  height: 100%;
  width: 0%;
  transition: width 0.3s ease;
  border-radius: 10px;
  position: relative;
}

.pow-progress-bar::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.pow-stats {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  color: #6c757d;
}

/* 系统状态横幅 */
.system-status-banner {
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-weight: 500;
  display: flex;
  align-items: center;
  animation: slideIn 0.3s ease-out;
}

.system-status-banner.normal {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.system-status-banner.mild {
  background: #fff3cd;
  color: #856404;
  border: 1px solid #ffeaa7;
}

.system-status-banner.heavy {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.system-status-banner.emergency {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* PoW信息面板 */
.pow-info-panel {
  background: #ffffff;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.pow-info-title {
  font-weight: 600;
  color: #495057;
  margin-bottom: 12px;
}

.pow-info-item {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 14px;
}

.pow-info-value {
  font-weight: 500;
  color: #28a745;
}

/* 设备信息显示 */
.device-info {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: #f8f9fa;
  border-radius: 6px;
  font-size: 14px;
}

.device-icon {
  font-size: 16px;
}

.device-label {
  font-weight: 500;
  color: #495057;
}

.device-hashrate {
  color: #6c757d;
  font-size: 12px;
}

/* 设备性能模块默认隐藏，计算过程中再显示 */
#device-performance {
  display: none;
}

/* 预估时间显示 */
.pow-estimated-time {
  padding: 8px 12px;
  background: #e3f2fd;
  border-radius: 6px;
  color: #1565c0;
  font-size: 14px;
  font-weight: 500;
  margin-top: 8px;
}

/* 默认隐藏：PoW信息面板与预计剩余时间，仅在发帖中显示 */
#pow-info-panel { display: none; }
#pow-estimated-time { display: none; }

/* PoW消息显示 */
.pow-message {
  margin: 12px 0;
  padding: 12px 16px;
  border-radius: 8px;
  animation: slideIn 0.3s ease-out;
}

.pow-error {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
  display: flex;
  align-items: center;
  gap: 8px;
}

.pow-error-icon {
  font-size: 16px;
}

.pow-success {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
  display: flex;
  align-items: center;
  gap: 8px;
}

.pow-success-icon {
  font-size: 16px;
}

.pow-info {
  background: #d1ecf1;
  color: #0c5460;
  border: 1px solid #bee5eb;
  display: flex;
  align-items: center;
  gap: 8px;
}

.pow-info-icon {
  font-size: 16px;
}

/* 取消按钮 */
.pow-cancel-btn {
  background: #dc3545;
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.pow-cancel-btn:hover {
  background: #c82333;
}

/* 移动端适配 */
@media (max-width: 768px) {
  .pow-progress-container {
    padding: 12px;
    margin: 8px 0;
  }

  .pow-progress-header {
    font-size: 14px;
  }

  .system-status-banner {
    padding: 10px 12px;
    font-size: 14px;
  }

  .pow-info-panel {
    padding: 12px;
    margin-bottom: 12px;
  }

  .device-info {
    font-size: 12px;
  }

  .pow-estimated-time {
    font-size: 12px;
    padding: 6px 10px;
  }

  .pow-message {
    padding: 10px 12px;
    font-size: 14px;
  }

  #postBtn {
    padding: 10px 20px;
    font-size: 14px;
  }
}

/* 暗色主题支持 */
@media (prefers-color-scheme: dark) {
  .pow-info-panel {
    background: #2d3748;
    border-color: #4a5568;
    color: #e2e8f0;
  }

  .pow-info-title {
    color: #e2e8f0;
  }

  .device-info {
    background: #4a5568;
    color: #e2e8f0;
  }

  .device-label {
    color: #e2e8f0;
  }

  .device-hashrate {
    color: #a0aec0;
  }

  .pow-estimated-time {
    background: #2b6cb0;
    color: #bee3f8;
  }

  .pow-progress-container {
    background: #2d3748;
    border-color: #4a5568;
    color: #e2e8f0;
  }

  .pow-progress-header {
    color: #e2e8f0;
  }

  .pow-stats {
    color: #a0aec0;
  }
}



/* 工具提示 */
.pow-tooltip {
  position: relative;
  cursor: help;
}

.pow-tooltip::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: #333;
  color: white;
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 12px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 1000;
}

.pow-tooltip:hover::after {
  opacity: 1;
}