a {
    text-decoration: none;
    color: inherit
}

* {
    box-sizing: border-box
}

body {
    margin: 0;
    font-family: Segoe UI, Arial;
    background: #0b1321;
    color: #e8edf7;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden
}

.navbar {
    padding: 12px;
    background: #111b2f;
    border-bottom: 1px solid #1f2a44;
    flex-shrink: 0
}

.main-content {
    display: grid;
    grid-template-columns: 255px 1fr 255px;
    grid-template-rows: minmax(0, 1fr);
    gap: 12px;
    padding: 12px;
    width: 100%;
    flex: 1;
    overflow: hidden;
    margin: 0
}

.middle-section {
    display: flex;
    flex-direction: column;
    gap: 12px
}

.middle-section .card {
    flex: 1;
    min-height: 0
}

.middle-section .mini-card {
    flex: 0 0 auto;
    min-height: auto
}

.middle-section .mini-card .content {
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 5px
}

.middle-section .mini-card .list {
    padding-right: 12px
}

.middle-section .mini-card .person {
    flex-shrink: 0;
    margin-bottom: 0
}

.card {
    background: #111b2f;
    border: 1px solid #1f2a44;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    min-height: 0
}

.card h3 {
    margin: 0;
    padding: 12px 14px;
    border-bottom: 1px solid #1f2a44;
    font-size: 16px
}

.card .content {
    padding: 12px;
    overflow-y: auto;
    flex: 1
}

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

.toolbar-left {
    display: flex;
    gap: 8px;
    flex-wrap: wrap
}

.toolbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-left: auto;
    min-width: 0;
    flex: 1
}

.btn {
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid #2a3b60;
    background: #162342;
    color: #cfe1ff;
    cursor: pointer
}

.btn:hover {
    background: #1b2a50
}

.notice-wrapper {
    display: flex;
    align-items: center;
    max-width: none;
    flex: 1;
    overflow: hidden;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    white-space: nowrap
}

.notice-label {
    margin-right: 6px;
    color: #ffd666;
    flex-shrink: 0
}

.notice-bar {
    position: relative;
    overflow: hidden;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px 10px;
    background: rgba(59, 77, 117, 0.65);
    border-radius: 999px
}

.notice-content {
    display: inline-block;
    white-space: nowrap;
    text-align: center
}

.notice-item {
    display: inline-block;
    margin: 0 10px;
    padding: 2px 12px;
    border-radius: 999px;
    background: rgba(11, 19, 33, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.16)
}

.notice-content.scroll {
    animation: notice-marquee 15s linear infinite
}

@keyframes notice-marquee {
    0% {
        transform: translateX(100%)
    }

    100% {
        transform: translateX(-100%)
    }
}

#realtimeClock {
    font-size: 16px;
    color: #fff;
    white-space: nowrap;
    font-family: Consolas, monospace;
    font-weight: 600;
    flex-shrink: 0
}

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

.person {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 12px;
    background: #162342;
    border-radius: 8px;
    min-width: 100px;
    width: 100px;
    margin: 6px
}

.person .avatar {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: #243657;
    object-fit: cover;
    margin-bottom: 5px
}

.avatar.top120 {
    width: 160px;
    height: 160px;
    object-fit: cover;
    clip-path: circle(60px at 50% 60px);
    -webkit-mask-image: radial-gradient(circle 60px at 50% 60px, #000 99%, transparent 100%);
    mask-image: radial-gradient(circle 60px at 50% 60px, #000 99%, transparent 100%);
}

.person.long8 {
    background: #7a1f1f
}

.person.long12 {
    background: #b30000
}

.name {
    font-weight: 600;
    font-size: 12px;
    margin: 3px 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    width: 100%
}

.sub {
    font-size: 11px;
    color: #9fb2d9;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap
}

.rank-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px
}

.rank-item .avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: #243657;
    object-fit: cover
}

.value {
    margin-left: auto;
    color: #7bd389
}

.work-item {
    padding: 10px;
    border: 1px solid #1f2a44;
    border-radius: 8px;
    margin-bottom: 10px
}

.work-line {
    display: flex;
    gap: 8px;
    align-items: center
}

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

.dialog {
    width: 520px;
    max-width: 92vw;
    background: #0f1729;
    border: 1px solid #1f2a44;
    border-radius: 10px
}

.dialog h4 {
    margin: 0;
    padding: 12px 14px;
    border-bottom: 1px solid #1f2a44
}

.dialog .body {
    padding: 12px
}

.field {
    margin-bottom: 10px
}

.field label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    color: #9fb2d9
}

.field input,
.field select,
.field textarea {
    width: 100%;
    padding: 8px;
    border-radius: 6px;
    border: 1px solid #2a3b60;
    background: #0b1321;
    color: #e8edf7
}

.row {
    display: flex;
    gap: 10px
}

.hidden {
    display: none
}

.pill {
    padding: 2px 8px;
    border-radius: 999px;
    background: #223354;
    color: #cfe1ff;
    font-size: 12px
}

/* 表格样式 */
.person-table {
    width: 100%;
    border-collapse: collapse
}

.person-table th,
.person-table td {
    padding: 8px;
    text-align: left;
    border-bottom: 1px solid #1f2a44
}

.person-table th {
    background: #162342;
    font-weight: 600
}

.person-table img {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    margin-right: 5px;
    vertical-align: middle
}

/* 让日期选择器在模态内显示并覆盖 */
.flatpickr-calendar {
    z-index: 10000
}

.rolldate-container {
    z-index: 10001 !important
}

.tempus-dominus-widget {
    z-index: 10001 !important
}

.work-item.status-ongoing,
.manage-item.status-ongoing {
    background: #1f6f3f
}

.work-item.status-ongoing.status-long,
.manage-item.status-ongoing.status-long {
    background: #7a1f1f
}

.work-item.status-completed,
.manage-item.status-completed {
    background: #14321d
}

.work-item.status-planned,
.manage-item.status-planned {
    background: #2a3b60
}

/* New Layout for Work Section */
.work-row {
    display: flex;
    gap: 12px;
    flex: 1;
    min-height: 0;
    /* Fix flex overflow */
}

.work-card-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Work Card Styles */
.work-card {
    background: #162342;
    border: 1px solid #2a3b60;
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.2s;
    height: 90px;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
}

.work-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    border-color: #3b4d75;
}

.work-card-title {
    font-size: 14px;
    font-weight: 600;
    color: #e8edf7;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.work-card-time {
    font-size: 12px;
    color: #9fb2d9;
}

.work-card-status {
    font-size: 12px;
    padding: 2px 6px;
    border-radius: 4px;
    width: fit-content;
}

.status-badge-ongoing {
    color: #7bd389;
    background: rgba(31, 111, 63, 0.3);
}

.status-badge-completed {
    color: #9fb2d9;
    background: rgba(20, 50, 29, 0.3);
}

.status-badge-planned {
    color: #cfe1ff;
    background: rgba(42, 59, 96, 0.3);
}

/* Status colors for cards */
.work-card.status-ongoing {
    border-left: 4px solid #1f6f3f;
}

.work-card.status-completed {
    border-left: 4px solid #14321d;
    opacity: 0.8;
}

.work-card.status-planned {
    border-left: 4px solid #3b4d75;
}

.work-card.status-long {
    border-left: 4px solid #7a1f1f;
}

/* Grid List for Today's Work Cards */
.grid-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
}

/* 移动端响应式布局 */
@media (max-width: 768px) {
    body {
        height: auto;
        overflow-y: auto;
    }

    .main-content {
        display: flex;
        flex-direction: column;
        gap: 12px;
        padding: 12px;
        overflow: visible;
        height: auto;
    }

    .toolbar {
        flex-wrap: wrap;
    }

    .toolbar-right {
        margin-left: 0;
        width: 100%;
        margin-top: 8px;
    }

    .middle-section {
        order: 1
    }

    .left-panel {
        order: 4
    }

    .right-panel {
        order: 5
    }

    .card {
        width: 100%
    }

    .work-row {
        flex-direction: column;
    }
}

/* Tags Input Styles */
.tags-input-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px;
    background: #0b1321;
    border: 1px solid #2a3b60;
    border-radius: 6px;
    min-height: 42px;
    margin-bottom: 8px;
}

.tag-item {
    display: flex;
    align-items: center;
    background: #223354;
    color: #cfe1ff;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 13px;
}

.tag-remove {
    margin-left: 6px;
    cursor: pointer;
    color: #9fb2d9;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
}

.tag-remove:hover {
    background: #334466;
    color: #fff;
}

.participant-select-input {
    margin-top: 5px;
}
