/* ========== 全局 & 背景 ========== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    min-height: 100vh;
    font-family: 'Segoe UI', Roboto, system-ui, -apple-system, 'PingFang SC', 'Microsoft YaHei', sans-serif;
    padding: 28px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #1f3a5b;
    background-color: #16305a; /* 图片加载失败时的兜底色 */
    background-image: linear-gradient(rgba(11, 28, 52, 0.52), rgba(11, 28, 52, 0.42)), url('1.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
}

/* ========== 玻璃卡片容器 ========== */
.container {
    max-width: 1300px;
    width: 100%;
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(18px) saturate(160%);
    -webkit-backdrop-filter: blur(18px) saturate(160%);
    border: 1px solid rgba(255, 255, 255, 0.55);
    border-radius: 28px;
    box-shadow: 0 24px 70px -24px rgba(0, 10, 30, 0.55);
    padding: 28px 24px 30px;
}

/* ========== 头部 ========== */
.header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}
h1 {
    font-size: 1.9rem;
    font-weight: 700;
    color: #0b2b4f;
    letter-spacing: -0.3px;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 10px;
}
.subhead {
    font-size: 0.85rem;
    font-weight: 500;
    color: #2c5c8a;
    background: rgba(29, 61, 107, 0.10);
    border: 1px solid rgba(29, 61, 107, 0.12);
    padding: 5px 16px;
    border-radius: 60px;
    display: inline-block;
}

/* ========== 工具栏 ========== */
.toolbar {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
    margin: 18px 0 16px 0;
    gap: 10px;
}
.toolbar-right {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}
.week-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: #1f3a5b;
}
.week-select {
    border: 1px solid rgba(29, 61, 107, 0.22);
    border-radius: 60px;
    padding: 9px 16px;
    font-size: 0.9rem;
    color: #0b2b4f;
    background: rgba(255, 255, 255, 0.92);
    cursor: pointer;
    box-shadow: 0 4px 14px -8px rgba(20, 60, 120, 0.5);
    transition: border-color 0.2s, box-shadow 0.2s;
}
.week-select:hover {
    border-color: #1d3d6b;
}
.week-select:focus {
    outline: none;
    border-color: #1d3d6b;
    box-shadow: 0 0 0 3px rgba(29, 61, 107, 0.18);
}

/* ========== 表格 ========== */
.table-wrapper {
    overflow-x: auto;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.65);
    background: rgba(255, 255, 255, 0.55);
}
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.84rem;
    min-width: 760px;
    table-layout: fixed;
}
th,
td {
    border: 1px solid rgba(214, 225, 239, 0.95);
    padding: 10px 6px;
    vertical-align: middle;
    text-align: center;
    word-break: break-word;
}
th {
    background: linear-gradient(180deg, #1d3d6b, #16305a);
    color: #ffffff;
    font-weight: 600;
    font-size: 0.88rem;
    letter-spacing: 0.6px;
    padding: 14px 6px;
}
th:first-child {
    position: sticky;
    left: 0;
    z-index: 2;
}
.time-col {
    background: #eef3f9;
    color: #1d3d6b;
    width: 88px;
    min-width: 80px;
    position: sticky;
    left: 0;
    z-index: 1;
}
.time-col .period-no {
    font-weight: 700;
    font-size: 0.95rem;
}
.time-col .period-time {
    font-size: 0.72rem;
    font-weight: 500;
    color: #5b7699;
    margin-top: 4px;
    white-space: nowrap;
}
.editable-cell {
    background: rgba(255, 255, 255, 0.88);
    transition: background 0.12s ease;
    cursor: default;
    min-height: 48px;
}
tbody tr:nth-child(even) .editable-cell {
    background: rgba(240, 245, 251, 0.88);
}
.editable-cell:hover {
    background: #eef4fb;
}
.empty-hint {
    color: #b6c3d4;
    font-weight: 300;
    font-size: 0.7rem;
    display: inline-block;
    pointer-events: none;
}
.cell-content {
    white-space: pre-wrap;
    line-height: 1.45;
    font-size: 0.8rem;
    color: #1f3a5b;
}

/* ========== 底部 ========== */
.note {
    background: rgba(255, 255, 255, 0.68);
    border-radius: 60px;
    padding: 12px 20px;
    margin: 18px 0 0 0;
    font-size: 0.85rem;
    color: #1b3d5e;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    border: 1px solid rgba(255, 255, 255, 0.6);
}
.footer-print {
    color: rgba(27, 61, 94, 0.62);
    font-size: 0.75rem;
    margin-top: 16px;
    text-align: right;
    border-top: 1px dashed rgba(210, 224, 239, 0.9);
    padding-top: 12px;
}

/* ========== 响应式 ========== */
/* 大屏：桌面更宽松 */
@media (min-width: 1500px) {
    .container {
        max-width: 1400px;
    }
    table {
        font-size: 0.88rem;
    }
    .cell-content {
        font-size: 0.84rem;
    }
}

/* 平板 / 小屏桌面 */
@media (max-width: 900px) {
    .container {
        padding: 22px 16px 26px;
    }
    h1 {
        font-size: 1.6rem;
    }
    table {
        font-size: 0.8rem;
        min-width: 700px;
    }
    th {
        font-size: 0.84rem;
    }
}

/* 手机 */
@media (max-width: 600px) {
    body {
        padding: 10px 8px;
        background-attachment: scroll; /* iOS 对 fixed 背景支持不佳，改为随内容滚动 */
    }
    .container {
        padding: 16px 10px 20px;
        border-radius: 18px;
        backdrop-filter: blur(12px) saturate(150%);
        -webkit-backdrop-filter: blur(12px) saturate(150%);
    }
    h1 {
        font-size: 1.3rem;
        letter-spacing: -0.2px;
    }
    .toolbar {
        justify-content: flex-start;
        margin: 12px 0 10px;
    }
    .week-label {
        font-size: 0.82rem;
    }
    .week-select {
        padding: 8px 12px;
        font-size: 0.85rem;
        flex: 1 1 auto;
    }
    .table-wrapper {
        border-radius: 12px;
        -webkit-overflow-scrolling: touch;
    }
    table {
        font-size: 0.74rem;
        min-width: 640px;
    }
    th {
        font-size: 0.78rem;
        padding: 10px 4px;
        letter-spacing: 0.2px;
    }
    th,
    td {
        padding: 6px 4px;
    }
    .time-col {
        width: 68px;
        min-width: 60px;
    }
    .time-col .period-no {
        font-size: 0.85rem;
    }
    .time-col .period-time {
        font-size: 0.66rem;
    }
    .cell-content {
        font-size: 0.72rem;
        line-height: 1.35;
    }
    .footer-print {
        font-size: 0.7rem;
        text-align: center;
        margin-top: 12px;
    }
}
