/* ================================================================
   全局基础 + 布局框架
   ================================================================ */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 20px; }

body {
    font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
    background: #eef2f7;
    padding: 16px 20px;
    height: 100vh;
    overflow: hidden;
    user-select: none;
    font-size: 0.85rem;
}

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #e8ecf2; border-radius: 6px; }
::-webkit-scrollbar-thumb { background: #b8c8d8; border-radius: 6px; }

/* ---------- 主容器 ---------- */
.app-container {
    display: flex;
    gap: 16px;
    height: calc(100vh - 68px);
    margin-top: 10px;
}
.board-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
}

/* ---------- 顶部标题 ---------- */
.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
    flex-shrink: 0;
}
.top-header .title-area {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: nowrap;
    flex: 1;
    min-width: 0;
    overflow: hidden;
}
.top-header .title-area h1 {
    font-size: 1.2rem;
    color: #1a2a3a;
    border-left: 5px solid #2a7de1;
    padding-left: 14px;
    font-weight: 700;
    white-space: nowrap;
    flex-shrink: 0;
}
.top-header .action-btns {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    flex-shrink: 0;
}

/* ---------- 全局颜色统计条 ---------- */
.global-stats-inline {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 4px 6px;
    background: #f5f8fc;
    padding: 2px 10px;
    border-radius: 30px;
    border: 1px solid #e8ecf2;
    max-height: 36px;
    overflow: hidden;
    flex: 0 1 auto;
    min-width: 30px;
}
.global-stats-inline .gsi-title {
    font-size: 0.55rem;
    color: #8899aa;
    font-weight: 600;
    flex-shrink: 0;
}
.global-stats-inline .gsi-item {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    font-size: 0.5rem;
    font-weight: 500;
    color: #445566;
    background: white;
    padding: 1px 6px 1px 3px;
    border-radius: 14px;
    line-height: 18px;
    transition: 0.15s;
    border: 2px solid transparent;
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
    flex-shrink: 0;
}
.global-stats-inline .gsi-item:hover {
    border-color: #2a7de1;
    background: #eaf4ff;
}
.global-stats-inline .gsi-item.active-filter {
    border-color: #2a7de1;
    background: #d4e4ff;
    box-shadow: 0 0 0 2px rgba(42, 125, 225, 0.2);
}
.global-stats-inline .gsi-item .color-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, 0.08);
    flex-shrink: 0;
    display: inline-block;
}
.global-stats-inline .gsi-item .gsi-label {
    font-weight: 600;
    color: #1a2a3a;
    white-space: nowrap;
}
.global-stats-inline .gsi-item .gsi-count {
    font-weight: 700;
    color: #2a7de1;
    background: #f0f4fa;
    padding: 0 4px;
    border-radius: 10px;
    font-size: 0.45rem;
    line-height: 14px;
}
.global-stats-inline .gsi-empty {
    font-size: 0.5rem;
    color: #99aabb;
    padding: 0 4px;
    flex-shrink: 0;
}
.global-stats-inline.compact .gsi-item .gsi-label,
.global-stats-inline.compact .gsi-item .gsi-count { display: none; }
.global-stats-inline.compact .gsi-item { padding: 1px 3px; }

/* ---------- 工具栏 ---------- */
.board-toolbar {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    background: white;
    padding: 10px 18px;
    border-radius: 14px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
    flex-shrink: 0;
    align-items: center;
    font-size: 0.7rem;
}
.board-toolbar input,
.board-toolbar select {
    padding: 7px 14px;
    border: 1px solid #d0d7e2;
    border-radius: 10px;
    font-size: 0.7rem;
    outline: none;
    background: #fafcff;
}
.board-toolbar input:focus,
.board-toolbar select:focus {
    border-color: #2a7de1;
    box-shadow: 0 0 0 3px rgba(42, 125, 225, 0.12);
}
.board-toolbar .search-box { flex: 1; min-width: 120px; }
.board-toolbar .stats {
    margin-left: auto;
    font-size: 0.7rem;
    color: #556678;
    display: flex;
    gap: 18px;
    background: #f5f8fc;
    padding: 4px 16px;
    border-radius: 30px;
    flex-shrink: 0;
}
.board-toolbar .stats span { font-weight: 700; color: #1a2a3a; }
.board-toolbar .action-btns { display: flex; gap: 6px; flex-shrink: 0; }

.color-filter-hint {
    font-size: 0.55rem;
    color: #8899aa;
    background: #eef2f7;
    padding: 1px 10px;
    border-radius: 30px;
    line-height: 20px;
    white-space: nowrap;
    display: none;
    flex-shrink: 0;
}
.color-filter-hint .clear-filter {
    cursor: pointer;
    color: #e74c3c;
    font-weight: 700;
    margin-left: 4px;
}
.color-filter-hint .clear-filter:hover { text-decoration: underline; }

/* ---------- 班组滚动区 ---------- */
.groups-scroll {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 12px 4px 12px 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
    width: 100%;
    min-width: 0;
    scrollbar-gutter: stable;
}

/* ---------- 底部 IO ---------- */
.bottom-io {
    display: flex;
    gap: 6px;
    justify-content: flex-end;
    padding: 2px 8px;
    opacity: 0.2;
    transition: 0.4s;
    flex-shrink: 0;
    margin-top: 2px;
}
.bottom-io:hover { opacity: 1; }
.bottom-io .btn {
    font-size: 0.45rem;
    padding: 2px 12px;
    color: #99aabb;
    background: transparent;
    border: 1px solid #dce5ef;
    box-shadow: none;
    border-radius: 6px;
}
.bottom-io .btn:hover {
    color: #2a7de1;
    border-color: #2a7de1;
    background: #f0f7ff;
    transform: none;
}
.bottom-io .reset-subtle {
    font-size: 0.38rem !important;
    padding: 1px 7px !important;
    color: #b9c2cc !important;
    border-color: #edf1f5 !important;
    opacity: 0.55;
}
.bottom-io .reset-subtle:hover {
    color: #c95b50 !important;
    border-color: #e7c4c0 !important;
    background: #fff8f7 !important;
    opacity: 1;
}

/* ---------- 设置齿轮 ---------- */
#settingsGearWrap {
    position: relative;
    display: inline-flex;
    align-items: center;
}