/* ViewOptics-V1.8 浅色主题
   © 四川森普力科技有限公司 | 姚工 | 159-2808-9752 */

/* ── 全局 ─────────────────────────────── */
QMainWindow, QWidget {
    background-color: #F5F5F5;
    font-family: "宋体", SimSun, "Microsoft YaHei", sans-serif;
    font-size: 13px;
    color: #222222;
}

/* ── 按钮 ─────────────────────────────── */
QPushButton {
    background-color: #E8E8E8;
    border: 1px solid #C0C0C0;
    border-radius: 3px;
    padding: 3px 8px;
    min-height: 24px;
}
QPushButton:hover {
    background-color: #D8E8F4;
    border-color: #4A90D9;
}
QPushButton:pressed {
    background-color: #C0D8EE;
}
QPushButton:checked {
    background-color: #4A90D9;
    color: #FFFFFF;
    border-color: #2A70B9;
    font-weight: bold;
}
QPushButton:disabled {
    background-color: #F0F0F0;
    color: #AAAAAA;
    border-color: #DDDDDD;
}

/* ── GroupBox ─────────────────────────── */
QGroupBox {
    border: 1px solid #CCCCCC;
    border-radius: 4px;
    margin-top: 10px;
    padding-top: 2px;
    font-weight: bold;
    color: #444444;
}
QGroupBox::title {
    subcontrol-origin: margin;
    subcontrol-position: top left;
    padding: 0 5px;
    background-color: #F5F5F5;
}

/* ── 输入控件 ─────────────────────────── */
QSpinBox, QDoubleSpinBox, QComboBox, QLineEdit {
    background-color: #FFFFFF;
    border: 1px solid #C0C0C0;
    border-radius: 3px;
    padding: 2px 4px;
    min-height: 22px;
}
QSpinBox:focus, QDoubleSpinBox:focus,
QComboBox:focus, QLineEdit:focus {
    border-color: #4A90D9;
}
QComboBox::drop-down {
    border: none;
}

/* ── 复选框 ─────────────────────────── */
QCheckBox {
    spacing: 6px;
}
QCheckBox::indicator {
    width: 14px;
    height: 14px;
    border: 1px solid #AAAAAA;
    border-radius: 2px;
    background: #FFFFFF;
}
QCheckBox::indicator:checked {
    background-color: #4A90D9;
    border-color: #2A70B9;
}

/* ── 列表 ─────────────────────────────── */
QListWidget {
    background-color: #FFFFFF;
    border: 1px solid #C0C0C0;
    border-radius: 3px;
    outline: none;
}
QListWidget::item {
    padding: 3px 4px;
    border-bottom: 1px solid #F0F0F0;
}
QListWidget::item:selected {
    background-color: #4A90D9;
    color: #FFFFFF;
}
QListWidget::item:hover {
    background-color: #E8F0FA;
}

/* ── 滚动区 ─────────────────────────── */
QScrollArea {
    border: none;
    background: transparent;
}
QScrollBar:vertical {
    width: 8px;
    background: #F0F0F0;
}
QScrollBar::handle:vertical {
    background: #C0C0C0;
    border-radius: 4px;
    min-height: 20px;
}
QScrollBar::handle:vertical:hover {
    background: #999999;
}
QScrollBar::add-line:vertical, QScrollBar::sub-line:vertical {
    height: 0;
}

/* ── 分割器 ─────────────────────────── */
QSplitter::handle {
    background-color: #DDDDDD;
    width: 4px;
}
QSplitter::handle:hover {
    background-color: #4A90D9;
}

/* ── 状态栏 ─────────────────────────── */
QStatusBar {
    background-color: #E8E8E8;
    border-top: 1px solid #CCCCCC;
    color: #444444;
    font-size: 12px;
}

/* ── 菜单 ────────────────────────────── */
QMenuBar {
    background-color: #EEEEEE;
    border-bottom: 1px solid #CCCCCC;
}
QMenuBar::item:selected {
    background-color: #4A90D9;
    color: #FFFFFF;
}
QMenu {
    background-color: #FFFFFF;
    border: 1px solid #CCCCCC;
}
QMenu::item:selected {
    background-color: #4A90D9;
    color: #FFFFFF;
}
QMenu::separator {
    height: 1px;
    background: #EEEEEE;
    margin: 2px 8px;
}

/* ── 工具栏区域背景 ─────────────────── */
#toolbar_widget {
    background-color: #EEEEEE;
    border-bottom: 1px solid #CCCCCC;
    border-radius: 0;
}

/* ── 设备连接状态（连接绿 #3CB371） ── */
#lbl_connect_status[connected="true"] {
    color: #3CB371;
    font-weight: bold;
}
#lbl_connect_status[connected="false"] {
    color: #CC3333;
}
