* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Microsoft YaHei", sans-serif;
    background: #f0f2f5;
    color: #333;
    min-height: 100vh;
}

.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: #1a73e8;
    color: #fff;
    padding: 16px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.phase-selector {
    position: relative;
}

.phase-btn {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 8px 16px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 140px;
    transition: background 0.2s;
}

.phase-btn:hover {
    background: rgba(255, 255, 255, 0.25);
}

.phase-btn .arrow {
    font-size: 10px;
    margin-left: auto;
}

.phase-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    min-width: 200px;
    z-index: 1000;
    overflow: hidden;
    border: 1px solid #e8e8e8;
}

.phase-dropdown.show {
    display: block;
}

.phase-item {
    padding: 10px 16px;
    font-size: 14px;
    color: #333;
    cursor: pointer;
    transition: background 0.15s;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.phase-name-text {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.phase-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.phase-edit-btn {
    padding: 2px 6px;
    font-size: 12px;
    color: #999;
    border-radius: 4px;
    transition: all 0.15s;
}

.phase-edit-btn:hover {
    background: #1a73e8;
    color: #fff;
}

.phase-delete-btn {
    padding: 2px 6px;
    font-size: 12px;
    color: #999;
    border-radius: 4px;
    transition: all 0.15s;
}

.phase-delete-btn:hover {
    background: #ff4d4f;
    color: #fff;
}

.phase-item:hover {
    background: #f0f5ff;
}

.phase-item.active {
    background: #e8f0fe;
    color: #1a73e8;
    font-weight: 600;
}

.phase-item.new-phase {
    color: #1a73e8;
    font-weight: 600;
    border-bottom: 1px solid #e8e8e8;
}

.phase-item.new-phase:hover {
    background: #e8f0fe;
}

.phase-item.dragging {
    opacity: 0.4;
}

.phase-item.drag-over {
    border-top: 2px solid #1a73e8;
}

.phase-rename-input {
    width: 100%;
    border: 1px solid #1a73e8;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 14px;
    outline: none;
    font-family: inherit;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-header {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 10px 14px 10px 12px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: inherit;
}

.btn-header:hover {
    background: rgba(255, 255, 255, 0.25);
}

.btn-header::before {
    content: '';
    display: inline-block;
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.btn-icon-plus {
    background: #fff !important;
    color: #1a73e8 !important;
    border: none !important;
}

.btn-icon-plus:hover {
    background: #e8f0fe !important;
}

.btn-icon-down::before {
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 8px solid #fff;
    width: 0;
    height: 0;
}

.btn-icon-up::before {
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-bottom: 8px solid #fff;
    width: 0;
    height: 0;
}

.btn-icon-excel::before {
    background:
        linear-gradient(#fff 20%, transparent 20%, transparent 40%, #fff 40%, #fff 60%, transparent 60%, transparent 80%, #fff 80%),
        linear-gradient(90deg, #fff 33%, transparent 33%, transparent 67%, #fff 67%);
}

.btn-icon-image::before {
    border: 2px solid #fff;
    border-radius: 2px;
    background: none;
}

.btn-icon-chart::before {
    background:
        linear-gradient(to top, #fff 0%, #fff 40%, transparent 40%, transparent 60%, transparent 60%, transparent 60%, transparent 60%),
        linear-gradient(to top, #fff 0%, #fff 60%, transparent 60%, transparent 60%, transparent 60%, transparent 60%, transparent 60%),
        linear-gradient(to top, #fff 0%, #fff 80%, transparent 80%, transparent 80%, transparent 80%, transparent 80%, transparent 80%);
    background-size: 4px 100%, 4px 100%, 4px 100%;
    background-position: 0 100%, 5px 100%, 10px 100%;
    background-repeat: no-repeat;
}

.btn-icon-person::before {
    border: 2px solid #fff;
    border-radius: 50%;
    background: none;
    position: relative;
}

.btn-icon-cloud::before {
    background: #fff;
    border-radius: 50% 50% 45% 45% / 65% 65% 35% 35%;
}

.btn-icon-plus::before {
    background: linear-gradient(#fff, #fff) center no-repeat, linear-gradient(#fff, #fff) center no-repeat;
    background-size: 2px 12px, 12px 2px;
}

.btn-icon-plus.btn-icon-plus::before {
    background: linear-gradient(#1a73e8, #1a73e8) center no-repeat, linear-gradient(#1a73e8, #1a73e8) center no-repeat;
    background-size: 2px 12px, 12px 2px;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    z-index: 1999;
}

.sidebar-overlay.show {
    display: block;
}

.sidebar {
    position: fixed;
    top: 0;
    right: -560px;
    width: 560px;
    height: 100%;
    background: #fff;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.1);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    transition: right 0.3s ease;
}

.sidebar.show {
    right: 0;
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: #1a73e8;
    color: #fff;
}

.sidebar-header h3 {
    font-size: 18px;
    font-weight: 600;
}

.sidebar-close-btn {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.sidebar-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.sidebar-toolbar {
    padding: 16px 20px;
    border-bottom: 1px solid #e8e8e8;
}

.btn-add-personnel {
    width: 100%;
    background: #1a73e8;
    color: #fff;
    border: none;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-add-personnel:hover {
    background: #1557b0;
}

.sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
}

.personnel-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px;
    margin-bottom: 8px;
    background: #fafbfc;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    transition: border-color 0.2s;
}

.personnel-row:hover {
    border-color: #1a73e8;
}

.personnel-row .personnel-name-input {
    flex: 1;
    min-width: 0;
    padding: 8px 10px;
    font-size: 14px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    outline: none;
    font-family: inherit;
    transition: border-color 0.2s;
}

.personnel-row .personnel-name-input:focus {
    border-color: #1a73e8;
}

.personnel-row .date-input {
    width: 120px;
    padding: 8px 8px;
    font-size: 13px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    outline: none;
    font-family: inherit;
    transition: border-color 0.2s;
}

.personnel-row .date-input:focus {
    border-color: #1a73e8;
}

.personnel-row .date-separator {
    font-size: 13px;
    color: #999;
    flex-shrink: 0;
}

.personnel-row .btn-delete-personnel {
    background: #fff;
    color: #ff4d4f;
    border: 1px solid #ff4d4f;
    width: 28px;
    height: 28px;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s;
}

.personnel-row .btn-delete-personnel:hover {
    background: #ff4d4f;
    color: #fff;
}

.personnel-empty {
    text-align: center;
    padding: 40px 20px;
    color: #999;
    font-size: 14px;
}

.stats-card {
    background: #fafbfc;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    padding: 14px 16px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.stats-card .stats-name {
    font-size: 16px;
    font-weight: 700;
    color: #1a73e8;
    flex-shrink: 0;
}

.stats-card .stats-roles {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.stats-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
    color: #fff;
}

.stats-badge-guanzhiyuan {
    background: #1a73e8;
}

.stats-badge-jiaoyuan {
    background: #34a853;
}

.stats-badge-jizhang {
    background: #f9ab00;
    color: #333;
}

.stats-empty {
    text-align: center;
    padding: 60px 20px;
    color: #999;
    font-size: 17px;
}

.container {
    margin: 24px auto;
    padding: 80px 4px 40px;
}

.schedule-card {
    background: transparent;
    border-radius: 5px;
    margin-bottom: 0;
    margin-top: 90px;
    position: relative;
}

.schedule-card:first-child {
    margin-top: 50px;
        font-family: sans-serif;
}

.schedule-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 4px;
    background: transparent;
    border-top: 6px double #1C5E62;
    border-bottom: 1px solid #e8e8e8;
}

.schedule-card-header .title-input {
    font-size: 38px;
    font-weight: 800;
    border: 1px solid transparent;
    background: transparent;
    padding: 0 0;
    border-radius: 4px;
    outline: none;
    color: #DC143C;
    width: 280px;
    letter-spacing: 1px;
    font-family: sans-serif;
}

.schedule-card-header .title-input:hover {
    border-color: #d9d9d9;
}

.schedule-card-header .title-input:focus {
    border-color: #1a73e8;
    background: #fff;
}

.persons-tag {
    display: flex;
    gap: 2px;
    flex-wrap: wrap;
    align-items: center;
    flex: 1;
    margin-left: 2px;
}

.person-name-tag {
    display: inline-block;
    padding: 2px 8px;
    font-size: 18px;
    font-weight: 500;
    color: #fff;
    background: #2F4F4F;
    border-radius: 5px;
    white-space: nowrap;
}

.person-name-tag-conflict {
    background: #ff4d4f;
}

.time-badge {
    display: inline-block;
    margin-left: 3px;
    padding: 0 2px;
    font-size: 17px;
    font-weight: 600;
    line-height: 1.4;
    background: #fff;
    color: #2F4F4F;
    border-radius: 8px;
    vertical-align: baseline;
}

.person-name-tag-conflict .time-badge {
    color: #ff4d4f;
}

.btn-card-close {
    position: absolute;
    top: -38px;
    right: 10px;
    background: rgba(0, 0, 0, 0.06);
    color: #999;
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    z-index: 10;
}

.btn-card-close:hover {
    background: #ff4d4f;
    color: #fff;
}

.group-btn-wrap {
    position: absolute;
    top: -38px;
    right: 45px;
    display: flex;
    gap: 4px;
    z-index: 10;
}

.btn-group-action {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-group-add {
    background: rgba(26, 115, 232, 0.1);
    color: #1a73e8;
}

.btn-group-add:hover {
    background: #1a73e8;
    color: #fff;
}

.btn-group-remove {
    background: rgba(255, 77, 79, 0.1);
    color: #ff4d4f;
}

.btn-group-remove:hover {
    background: #ff4d4f;
    color: #fff;
}

.schedule-card-body {
    padding: 0 4px 4px 4px;
}

.schedule-card-body.has-scroll {
    overflow: visible;
}

.schedule-card .jexcel_container {
    border: none !important;
    overflow: visible !important;
}

.schedule-card.multi-group .jexcel_container {
    display: inline-block !important;
    min-width: 100% !important;
    width: auto !important;
}

.schedule-card .jexcel_overflow {
    overflow: visible !important;
}

.schedule-card .jexcel > colgroup > col:first-child,
.schedule-card .jexcel > thead > tr > td:first-child,
.schedule-card .jexcel > tbody > tr > td:first-child,
.schedule-card .jexcel > tfoot > tr > td:first-child {
    display: none !important;
}

.schedule-card .jexcel_container table {
    width: 100% !important;
}

.schedule-card.multi-group .jexcel_container table {
    width: auto !important;
    min-width: 100% !important;
}

.schedule-card .jexcel_container .jexcel_content {
    overflow: visible !important;
    padding-bottom: 0 !important;
}

.schedule-card.multi-group .jexcel_container .jexcel_content {
    width: auto !important;
    max-width: none !important;
    overflow: visible !important;
}

.schedule-card .jexcel {
    border-collapse: separate !important;
    border: none !important;
    box-shadow: none !important;
}

.schedule-card .jexcel_container,
.schedule-card .jexcel_container *,
.schedule-card .jexcel_content {
    box-shadow: none !important;
}

.schedule-card .jexcel > thead > tr > td {
    color: #FFF !important;
    font-size: 20px !important;
    text-align: center !important;
    padding: 8px 4px !important;
}

/* 表头：序号/时间/练习号列 */
.schedule-card .jexcel > thead > tr > td:nth-child(-n+3) {
    background-color: #008080 !important;
}
/* 表头：第一组（列4-8）蓝色 */
.schedule-card .jexcel > thead > tr > td:nth-child(n+4):nth-child(-n+8) {
    background-color: #1A6D8A !important;
}
/* 表头：第二组（列9-13）绿色 */
.schedule-card .jexcel > thead > tr > td:nth-child(n+9):nth-child(-n+13) {
    background-color: #006400 !important;
}
/* 表头：第三组（列14-18）蓝色 */
.schedule-card .jexcel > thead > tr > td:nth-child(n+14):nth-child(-n+18) {
    background-color: #1A6D8A !important;
}
/* 表头：第四组（列19-23）绿色 */
.schedule-card .jexcel > thead > tr > td:nth-child(n+19):nth-child(-n+23) {
    background-color: #006400 !important;
}
/* 表头：第五组（列24-28）蓝色 */
.schedule-card .jexcel > thead > tr > td:nth-child(n+24):nth-child(-n+28) {
    background-color: #1A6D8A !important;
}
/* 表头：第六组（列29-33）绿色 */
.schedule-card .jexcel > thead > tr > td:nth-child(n+29):nth-child(-n+33) {
    background-color: #006400 !important;
}

.schedule-card .jexcel > tbody td {
    white-space: nowrap !important;
    color: #024457 !important;
    padding: 8px 4px !important;
    font-size: 20px !important;
}

/* 行条纹和组颜色由下方的 nth-child 列范围规则统一控制 */

/* 时间列和练习号列保持默认行条纹色 */
.schedule-card .jexcel > tbody tr:nth-child(odd) td:nth-child(-n+3) {
    background-color: #EBF9F9 !important;
}
.schedule-card .jexcel > tbody tr:nth-child(even) td:nth-child(-n+3) {
    background-color: #FFFFFF !important;
}

/* 第一组（列4-8）：蓝色系 */
.schedule-card .jexcel > tbody tr:nth-child(odd) td:nth-child(n+4):nth-child(-n+8) {
    background-color: #D6EAF8 !important;
}
.schedule-card .jexcel > tbody tr:nth-child(even) td:nth-child(n+4):nth-child(-n+8) {
    background-color: #EBF5FB !important;
}
/* 第二组（列9-13）：绿色系 */
.schedule-card .jexcel > tbody tr:nth-child(odd) td:nth-child(n+9):nth-child(-n+13) {
    background-color: #E8F5E9 !important;
}
.schedule-card .jexcel > tbody tr:nth-child(even) td:nth-child(n+9):nth-child(-n+13) {
    background-color: #F5FBF5 !important;
}
/* 第三组（列14-18）：蓝色系 */
.schedule-card .jexcel > tbody tr:nth-child(odd) td:nth-child(n+14):nth-child(-n+18) {
    background-color: #D6EAF8 !important;
}
.schedule-card .jexcel > tbody tr:nth-child(even) td:nth-child(n+14):nth-child(-n+18) {
    background-color: #EBF5FB !important;
}
/* 第四组（列19-23）：绿色系 */
.schedule-card .jexcel > tbody tr:nth-child(odd) td:nth-child(n+19):nth-child(-n+23) {
    background-color: #E8F5E9 !important;
}
.schedule-card .jexcel > tbody tr:nth-child(even) td:nth-child(n+19):nth-child(-n+23) {
    background-color: #F5FBF5 !important;
}
/* 第五组（列24-28）：蓝色系 */
.schedule-card .jexcel > tbody tr:nth-child(odd) td:nth-child(n+24):nth-child(-n+28) {
    background-color: #D6EAF8 !important;
}
.schedule-card .jexcel > tbody tr:nth-child(even) td:nth-child(n+24):nth-child(-n+28) {
    background-color: #EBF5FB !important;
}
/* 第六组（列29-33）：绿色系 */
.schedule-card .jexcel > tbody tr:nth-child(odd) td:nth-child(n+29):nth-child(-n+33) {
    background-color: #E8F5E9 !important;
}
.schedule-card .jexcel > tbody tr:nth-child(even) td:nth-child(n+29):nth-child(-n+33) {
    background-color: #F5FBF5 !important;
}

.schedule-card .jexcel > tbody td.highlight,
.schedule-card .jexcel > tbody tr:nth-child(odd) td.highlight,
.schedule-card .jexcel > tbody tr:nth-child(even) td.highlight {
    background-color: rgba(22, 127, 146, 0.1) !important;
}

.schedule-card .jexcel > tbody td.highlight-top {
    border-top-color: #000 !important;
}

.schedule-card .jexcel > tbody td.highlight-bottom {
    border-bottom-color: #000 !important;
}

.schedule-card .jexcel > tbody td.highlight-left {
    border-left-color: #000 !important;
}

.schedule-card .jexcel > tbody td.highlight-right {
    border-right-color: #000 !important;
}

.schedule-card .jexcel > tbody td.selection,
.schedule-card .jexcel > tbody tr:nth-child(odd) td.selection,
.schedule-card .jexcel > tbody tr:nth-child(even) td.selection {
    background-color: rgba(22, 127, 146, 0.1) !important;
}

.schedule-card .jexcel > tbody td.selection-top {
    border-top-color: #000 !important;
}

.schedule-card .jexcel > tbody td.selection-bottom {
    border-bottom-color: #000 !important;
}

.schedule-card .jexcel > tbody td.selection-left {
    border-left-color: #000 !important;
}

.schedule-card .jexcel > tbody td.selection-right {
    border-right-color: #000 !important;
}

.schedule-card .jexcel > thead > tr > td.selected {
    background-color: #0e5f6d !important;
    color: #fff !important;
}

.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: #999;
}

.empty-state p {
    font-size: 18px;
    margin-top: 12px;
}

.empty-state .icon {
    font-size: 48px;
}

.schedule-card .jexcel > tbody td.cell-conflict {
    color: #ff0000 !important;
    font-weight: 700 !important;
    cursor: pointer;
}

.schedule-card .jexcel > tbody tr:nth-child(odd) td.cell-conflict {
    color: #ff0000 !important;
    font-weight: 700 !important;
}

.schedule-card .jexcel > tbody tr:nth-child(even) td.cell-conflict {
    color: #ff0000 !important;
    font-weight: 700 !important;
}

.jtooltip {
    animation: none !important;
}

.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    z-index: 2999;
}

.modal-overlay.show {
    display: block;
}

.modal {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 460px;
    max-height: 70vh;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    z-index: 3000;
    flex-direction: column;
}

.modal.show {
    display: flex;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: #1a73e8;
    color: #fff;
    border-radius: 12px 12px 0 0;
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 600;
}

.modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
}

.modal-desc {
    font-size: 13px;
    color: #888;
    margin-bottom: 12px;
}

.export-checklist {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.export-checklist label {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: #fafbfc;
    border: 1px solid #e8e8e8;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    color: #333;
    transition: border-color 0.2s;
}

.export-checklist label:hover {
    border-color: #1a73e8;
}

.export-checklist input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #1a73e8;
    cursor: pointer;
    flex-shrink: 0;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 20px;
    border-top: 1px solid #e8e8e8;
}

.btn-modal-cancel {
    background: #f0f0f0;
    color: #666;
    border: none;
    padding: 8px 20px;
    font-size: 14px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-modal-cancel:hover {
    background: #e0e0e0;
}

.btn-modal-confirm {
    background: #1a73e8;
    color: #fff;
    border: none;
    padding: 8px 24px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-modal-confirm:hover {
    background: #1557b0;
}

.btn-modal-confirm:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.export-empty {
    text-align: center;
    padding: 20px;
    color: #999;
    font-size: 13px;
}

.modal-global-stats {
    max-width: 1100px;
    width: 90vw;
    max-height: 90vh;
}

.modal-global-stats .modal-body {
    overflow-y: auto;
    max-height: calc(90vh - 60px);
    padding: 20px;
}

.global-stats-phase-selector {
    position: relative;
    margin-left: auto;
    margin-right: 12px;
}

.global-stats-phase-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    min-width: 240px;
    z-index: 100;
    padding: 8px 0;
    max-height: 300px;
    overflow-y: auto;
}

.global-stats-phase-dropdown.show {
    display: block;
}

.global-stats-phase-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    cursor: pointer;
    transition: background 0.15s;
    color: #333;
    font-size: 15px;
}

.global-stats-phase-item:hover {
    background: #f0f5ff;
}

.global-stats-phase-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #1a73e8;
    flex-shrink: 0;
}

.global-stats-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 16px;
    border: 1px solid #167F92;
    border-radius: 10px;
    overflow: hidden;
}

.global-stats-table th {
    background: #167F92;
    color: #fff;
    padding: 14px 16px;
    text-align: center;
    font-weight: 600;
    font-size: 16px;
    position: sticky;
    top: 0;
    z-index: 1;
}

.global-stats-table td {
    padding: 12px 16px;
    text-align: center;
    border-bottom: 1px solid #e8e8e8;
    color: #024457;
    font-size: 16px;
}

.global-stats-table tr:nth-child(even) td {
    background-color: #f0f7fa;
}

.global-stats-table tr:hover td {
    background-color: #e0f0fa;
}

.global-stats-table td:first-child {
    text-align: left;
    font-weight: 700;
    color: #167F92;
    font-size: 16px;
    padding-left: 20px;
}

.global-stats-table td.stat-num {
    font-weight: 700;
    font-size: 18px;
    color: #024457;
}

.global-stats-table td.stat-zero {
    color: #ccc;
    font-weight: 400;
}

.global-stats-table td.stat-total {
    font-weight: 800;
    font-size: 18px;
    color: #167F92;
}

.global-stats-table tr.stats-footer td {
    background: #e8f4f8;
    font-weight: 800;
    font-size: 17px;
    color: #024457;
    border-top: 2px solid #167F92;
}

.global-stats-table tr.stats-footer td:first-child {
    color: #167F92;
}

.global-stats-empty {
    text-align: center;
    padding: 60px 20px;
    color: #999;
    font-size: 17px;
}

.drag-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(26, 115, 232, 0.85);
    z-index: 9999;
    justify-content: center;
    align-items: center;
}

.drag-overlay.active {
    display: flex;
}

.drag-overlay-content {
    text-align: center;
    color: #fff;
}

.drag-icon {
    font-size: 64px;
    margin-bottom: 16px;
}

.drag-text {
    font-size: 24px;
    font-weight: 600;
}

/* ==================== 移动端适配（桌面端不受影响） ==================== */

.mobile-menu-btn {
    display: none;
}

.mobile-menu {
    display: none;
}

@media (max-width: 768px) {
    html,
    body {
        overflow-x: hidden;
    }

    button {
        touch-action: manipulation;
    }

    /* ---------- 顶栏：阶段选择 + 新建 + 汉堡菜单 ---------- */
    .header {
        padding: 10px 12px;
    }

    .header-left {
        flex: 1;
        min-width: 0;
        gap: 8px;
    }

    .header-left .btn-header {
        display: none; /* 全量统计收进汉堡菜单 */
    }

    .phase-btn {
        flex: 1;
        min-width: 0;
        padding: 8px 10px;
        font-size: 14px;
        overflow: hidden;
    }

    #phaseBtnText {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .header-right {
        gap: 8px;
    }

    .header-right .btn-header {
        display: none; /* 其余按钮收进汉堡菜单 */
    }

    .header-right .btn-icon-plus {
        display: inline-flex; /* 新建班表保留在顶栏 */
        padding: 10px;
    }

    .header-right .mobile-menu-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 38px;
        height: 38px;
        padding: 0;
        font-size: 18px;
        flex-shrink: 0;
    }

    .header-right .mobile-menu-btn::before {
        display: none;
    }

    .mobile-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: #fff;
        border-radius: 0 0 12px 12px;
        box-shadow: 0 10px 28px rgba(0, 0, 0, 0.2);
        padding: 8px 0 12px;
        max-height: calc(100vh - 80px);
        overflow-y: auto;
        z-index: 1500;
    }

    .mobile-menu.show {
        display: block;
    }

    .mobile-menu-item {
        margin: 0 12px 8px;
        padding: 13px 14px;
        font-size: 15px;
        font-weight: 600;
        color: #333;
        background: #f5f8fc;
        border: 1px solid #e8e8e8;
        border-radius: 8px;
        cursor: pointer;
    }

    .mobile-menu-item:active {
        background: #e8f0fe;
        border-color: #1a73e8;
        color: #1a73e8;
    }

    .phase-dropdown {
        min-width: 180px;
        max-height: 55vh;
        overflow-y: auto;
    }

    /* ---------- 内容区与班表卡片 ---------- */
    .container {
        margin: 0 auto;
        padding: 0 8px 24px;
    }

    .empty-state {
        margin-top: 70px;
        padding: 50px 16px;
    }

    .empty-state p {
        font-size: 15px;
    }

    .schedule-card {
        margin-top: 56px;
    }

    .schedule-card:first-child {
        margin-top: 106px; /* 为顶栏下方悬浮的删除/分组按钮留出空间 */
        font-family: sans-serif;
    }

    .schedule-card-header {
        flex-wrap: wrap;
        padding: 10px 2px;
    }

    .schedule-card-header .title-input {
        width: 100%;
        font-size: 24px;
    }

    .person-name-tag {
        font-size: 14px;
        padding: 2px 6px;
    }

    .time-badge {
        font-size: 13px;
    }

    /* 班表表格：保持可读列宽，卡片内横向滑动 */
    .schedule-card .jexcel_container {
        max-width: 100%;
    }

    .schedule-card .jexcel_container .jexcel_content,
    .schedule-card.multi-group .jexcel_container .jexcel_content,
    .schedule-card .jexcel_overflow {
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        -webkit-overflow-scrolling: touch;
    }

    .schedule-card .jexcel > thead > tr > td {
        font-size: 15px !important;
        padding: 6px 4px !important;
    }

    .schedule-card .jexcel > tbody td {
        font-size: 15px !important;
        padding: 6px 4px !important;
    }

    /* ---------- 侧栏（外出设置 / 排班统计） ---------- */
    .sidebar {
        right: -100%;
        width: 100%;
    }

    .sidebar-header {
        padding: 14px 16px;
    }

    .sidebar-toolbar {
        padding: 12px 16px;
    }

    .sidebar-content {
        padding: 12px 16px;
    }

    .personnel-row {
        flex-wrap: wrap;
    }

    .personnel-row .personnel-name-input,
    .personnel-row .date-input,
    .phase-rename-input {
        font-size: 16px; /* 避免 iOS 聚焦时自动放大 */
    }

    .personnel-row .personnel-name-input {
        flex: 1 1 100%;
    }

    .personnel-row .date-input {
        flex: 1;
        width: auto;
        min-width: 0;
    }

    .stats-card {
        gap: 8px;
        padding: 12px;
    }

    .stats-card .stats-name {
        font-size: 15px;
    }

    .stats-badge {
        font-size: 12px;
        padding: 2px 8px;
    }

    /* ---------- 弹窗 ---------- */
    .modal {
        width: calc(100vw - 24px);
        max-height: 82vh;
    }

    .modal-header {
        padding: 14px 16px;
    }

    .modal-body {
        padding: 14px 16px;
    }

    .modal-footer {
        padding: 12px 16px;
    }

    .btn-modal-cancel,
    .btn-modal-confirm {
        padding: 10px 18px;
    }

    .modal-global-stats {
        width: calc(100vw - 16px);
        max-width: none;
        max-height: 88vh;
    }

    .modal-global-stats .modal-header {
        flex-wrap: wrap;
        gap: 8px;
    }

    .global-stats-phase-selector {
        margin-right: 0;
        width: 100%;
        display: flex;
        gap: 8px;
    }

    .global-stats-phase-selector .btn-header {
        padding: 8px 12px;
        font-size: 14px;
    }

    .global-stats-phase-dropdown {
        min-width: 200px;
        max-height: 260px;
    }

    .modal-global-stats .modal-body {
        overflow-x: auto;
        padding: 12px;
    }

    .global-stats-table {
        font-size: 13px;
        min-width: 560px;
    }

    .global-stats-table th {
        padding: 9px 10px;
        font-size: 13px;
    }

    .global-stats-table td {
        padding: 8px 10px;
        font-size: 13px;
    }

    .global-stats-table td:first-child {
        padding-left: 12px;
    }

    .global-stats-table td.stat-num,
    .global-stats-table td.stat-total {
        font-size: 14px;
    }

    .drag-text {
        font-size: 18px;
    }
}
