/* header */
body {
    margin: 0;
    font-family: Arial;
    background: #f5f5f5;
}

.top-header {
    background: #222;
    color: white;
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
}

.nav-bar {
    background: #333;
    display: flex;
}

.nav-bar a {
    color: #ddd;
    padding: 12px 18px;
    text-decoration: none;
}

.nav-bar a.active,
.nav-bar a:hover {
    background: #ffd700;
    color: black;
}

.content {
    padding: 20px;
}

/* ----------------------------------------------------------------------------------------- */

/* home page */
/* ===== Page Layout ===== */
.center-container {
    min-height: calc(100vh - 60px);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ===== Home Card ===== */
.home-card {
    background: #fff;
    width: 420px;
    padding: 40px;
    border-radius: 14px;
    box-shadow: 0 12px 30px rgba(0,0,0,0.08);
    text-align: center;
}

.home-card h2 {
    margin-bottom: 6px;
}

.subtitle {
    color: #777;
    margin-bottom: 25px;
}

/* ===== Buttons ===== */
.btn {
    display: block;
    padding: 14px;
    border-radius: 8px;
    font-weight: bold;
    text-decoration: none;
    margin-top: 15px;
    transition: 0.2s ease;
}

.btn.primary {
    background: #AB44C5;
    color: #fff;
}

.btn.secondary {
    background: #2ecc71;
    color: #fff;
}

.btn.outline {
    border: 2px solid #AB44C5;
    color: #AB44C5;
    background: transparent;
}

.btn:hover {
    transform: translateY(-2px);
    opacity: 0.95;
}

/* ----------------------------------------------------------------------------------------- */

/* dashboard */
.page-title {
    margin-bottom: 20px;
}

.card {
    background: #fff;
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,.08);
    margin-bottom: 20px;
}

.filter-bar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.filter-bar input,
.filter-bar select {
    padding: 8px;
    border-radius: 6px;
    border: 1px solid #ccc;
}
.stat-wrapper {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,.1);
    margin-bottom: 20px;
    overflow: hidden;
}

.stat-toggle {
    padding: 12px 15px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f7f7f7;
    user-select: none;
}

.stats-content {
    display: none;
    padding: 15px;
}

.stat-wrapper.open .stats-content {
    display: block;
}

.stat-wrapper .arrow {
    transition: transform .2s;
}

.stat-wrapper.open .arrow {
    transform: rotate(180deg);
}

.stats-row {
    display: flex;
    gap: 20px;
}

.stat-card {
    flex: 1;
    background: #fff;
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,.1);
}

.two-column {
    column-count: 2;        /* 分成 2 列 */
    column-gap: 30px;      /* 两列之间的间距 */
}

.two-column div {
    break-inside: avoid;  /* 避免一条被拆成两列 */
    margin-bottom: 6px;
}

#eventStat {
    column-count: 2;
    column-gap: 30px;
}

#eventStat div {
    break-inside: avoid;
}



.table-card {
    max-height: 600px;      /* 表格区域高度，可自己调 */
    overflow-y: auto;      /* 开启纵向滚动 */
    padding: 0;            /* 避免 sticky 偏移 */
}

/* 冻结表头 */
#dataTable thead th {
    position: sticky;
    top: 0;
    background: #f7f7f7;   /* 必须有背景色 */
    z-index: 2;
    border-bottom: 1px solid #ddd;
}

#dataTable {
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
}

/* 冻结第一列,冻结第一列 IC */
#dataTable th:nth-child(2),
#dataTable td:nth-child(2) {
    position: sticky;
    left: 0;
    background: #fff;
    z-index: 1;
}

/* 左上角层级更高 */
#dataTable thead th:nth-child(2) {
    z-index: 3;
}


table {
    width: 100%;
}

th,td {
    padding: 8px;
    border-bottom: 1px solid #ddd;
}

th {
    background: #f5f5f5;
}

.btn {
    padding: 6px 12px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
}

.btn.primary { background:#AB44C5; color:#fff; }
.btn.success { background:#2ecc71; color:#fff; }
.btn.small { padding:4px 8px; }

/* 每出现一个新的 ic，就分配一个颜色 class */
.row-group-1 { background: #d7d7ff; }
.row-group-2 { background: #dbfee4; }
.row-group-3 { background: #fff2d8; }
.row-group-4 { background: #fadbdb; }
.row-group-5 { background: #d3eafa; }


.popup {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.popup-content {
    background: #fff;
    padding: 20px;
    border-radius: 10px;
    max-width: 600px;
    max-height: 80%;
    overflow: auto;
}
