#pragma once

#include <QString>

/**
 * @brief 集中管理所有 QSS 样式 — 深色工业风格
 */
class StyleHelper {
public:
  /// 全局应用样式
  static QString getGlobalStyle() {
    return R"(
      * {
        font-family: "Segoe UI", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
      }
      QMainWindow {
        background: qlineargradient(x1:0, y1:0, x2:0, y2:1,
          stop:0 #0f0f1a, stop:1 #1a1a2e);
      }
      QLabel {
        color: #e0e0e0;
      }
    )";
  }

  /// 下拉框样式
  static QString getComboBoxStyle() {
    return R"(
      QComboBox {
        background: #1e1e3a;
        color: #00d4ff;
        border: 2px solid #2a2a4a;
        border-radius: 8px;
        padding: 12px 18px;
        font-size: 18px;
        font-weight: bold;
        min-width: 200px;
      }
      QComboBox:hover {
        border-color: #00d4ff;
        background: #252550;
      }
      QComboBox:focus {
        border-color: #00d4ff;
        background: #252550;
      }
      QComboBox::drop-down {
        subcontrol-origin: padding;
        subcontrol-position: top right;
        width: 36px;
        border-left: 2px solid #2a2a4a;
        border-top-right-radius: 8px;
        border-bottom-right-radius: 8px;
        background: #1e1e3a;
      }
      QComboBox::down-arrow {
        width: 12px;
        height: 12px;
      }
      QComboBox QAbstractItemView {
        background: #1e1e3a;
        color: #00d4ff;
        border: 2px solid #2a2a4a;
        selection-background-color: #00d4ff;
        selection-color: #0f0f1a;
        font-size: 18px;
        padding: 4px;
      }
    )";
  }

  /// 输入框样式
  static QString getInputStyle() {
    return R"(
      QLineEdit {
        background: #1e1e3a;
        color: #00ff88;
        border: 2px solid #2a2a4a;
        border-radius: 8px;
        padding: 12px 18px;
        font-size: 22px;
        font-weight: bold;
        font-family: "Consolas", "Courier New", monospace;
      }
      QLineEdit:hover {
        border-color: #00ff88;
      }
      QLineEdit:focus {
        border-color: #00ff88;
        background: #252550;
      }
      QLineEdit::placeholder {
        color: #555588;
      }
    )";
  }

  /// 命令预览样式
  static QString getPreviewStyle() {
    return R"(
      background: #12122a;
      color: #ffd700;
      border: 2px solid #2a2a4a;
      border-radius: 8px;
      padding: 14px 20px;
      font-size: 20px;
      font-weight: bold;
      font-family: "Consolas", "Courier New", monospace;
    )";
  }

  /// 执行按钮样式（正常）
  static QString getExecuteButtonStyle() {
    return R"(
      QPushButton {
        background: qlineargradient(x1:0, y1:0, x2:1, y2:0,
          stop:0 #00c853, stop:1 #00e676);
        color: #0a0a1e;
        border: none;
        border-radius: 10px;
        padding: 16px 40px;
        font-size: 20px;
        font-weight: bold;
        min-width: 180px;
      }
      QPushButton:hover {
        background: qlineargradient(x1:0, y1:0, x2:1, y2:0,
          stop:0 #00e676, stop:1 #69f0ae);
      }
      QPushButton:pressed {
        background: #00a844;
      }
      QPushButton:disabled {
        background: #333355;
        color: #666688;
      }
    )";
  }

  /// 停止按钮样式
  static QString getStopButtonStyle() {
    return R"(
      QPushButton {
        background: qlineargradient(x1:0, y1:0, x2:1, y2:0,
          stop:0 #d32f2f, stop:1 #f44336);
        color: #ffffff;
        border: none;
        border-radius: 10px;
        padding: 16px 40px;
        font-size: 20px;
        font-weight: bold;
        min-width: 180px;
      }
      QPushButton:hover {
        background: qlineargradient(x1:0, y1:0, x2:1, y2:0,
          stop:0 #f44336, stop:1 #ef5350);
      }
      QPushButton:pressed {
        background: #b71c1c;
      }
    )";
  }

  /// 输出区域样式
  static QString getOutputStyle() {
    return R"(
      QTextEdit {
        background: #0a0a18;
        color: #00ff88;
        border: 2px solid #2a2a4a;
        border-radius: 8px;
        padding: 12px;
        font-size: 14px;
        font-family: "Consolas", "Courier New", monospace;
        line-height: 1.4;
      }
    )";
  }

  /// 状态标签 — 就绪
  static QString getStatusReadyStyle() {
    return "font-size: 14px; font-weight: bold; color: #00d4ff; padding: 4px;";
  }

  /// 状态标签 — 运行中
  static QString getStatusRunningStyle() {
    return "font-size: 14px; font-weight: bold; color: #ffd700; padding: 4px;";
  }

  /// 状态标签 — 完成
  static QString getStatusDoneStyle() {
    return "font-size: 14px; font-weight: bold; color: #00ff88; padding: 4px;";
  }

  /// 状态标签 — 错误
  static QString getStatusErrorStyle() {
    return "font-size: 14px; font-weight: bold; color: #f44336; padding: 4px;";
  }

  /// 区域标题样式
  static QString getSectionTitleStyle() {
    return "font-size: 15px; font-weight: bold; color: #9CA3AF; padding: 2px "
           "0;";
  }
};
