        * {
            font-family: 'Inter', system-ui, sans-serif;
            box-sizing: border-box;
        }

        body {
            background: #F1F5F9;
            margin: 0;
        }

        .zh {
            font-size: 1.1em;
            font-weight: 700;
            color: #1D3557;
        }

        .en {
            font-size: 0.75em;
            color: #6C757D;
        }

        /* Header — Glassmorphism sticky */
        .main-header {
            position: sticky;
            top: 0;
            z-index: 9999;
            background: rgba(255, 255, 255, 0.92);
            backdrop-filter: blur(12px);
            -webkit-backdrop-filter: blur(12px);
            border-bottom: 1px solid rgba(226, 232, 240, 0.8);
            box-shadow: 0 1px 3px rgba(0,0,0,0.05);
            transition: all 0.3s ease;
        }

        .header-container {
            width: 100%;
            max-width: 1300px;
            margin: 0 auto;
            padding: 0.8rem 2rem;
            display: flex;
            justify-content: space-between;
            align-items: center;
            box-sizing: border-box;
        }

        .logo-link {
            display: flex;
            align-items: center;
            text-decoration: none;
        }

        .logo-link img {
            height: 52px;
            width: auto;
            object-fit: contain;
        }

        .nav-links {
            display: flex;
            gap: 2rem;
            align-items: center;
        }

        .nav-links .nav-link {
            position: relative;
            display: inline-flex;
            align-items: center;
            gap: 0.4rem;
            text-decoration: none;
            padding: 0.5rem 0;
            border-radius: 8px;
            font-size: 0.85rem;
            font-weight: 700;
            color: #1D3557;
            transition: all 0.3s ease;
        }

        .nav-links .nav-link .en {
            margin-top: 2px;
        }

        .nav-links .nav-link:hover {
            background: #F1F5F9;
            transform: translateY(-1px);
        }

        .header-title {
            display: flex;
            align-items: center;
            gap: 0.75rem;
        }

        .header-title h1 {
            font-size: 1.2rem;
            color: #1e293b;
            margin: 0;
        }

        @media (max-width: 768px) {
            .header-container {
                padding: 0.65rem 1rem;
            }

            .logo-link img {
                height: 36px;
            }

            .nav-links {
                gap: 0.75rem;
            }

            .nav-links .nav-link .en {
                display: none;
            }

            .header-title h1 {
                font-size: 1rem;
            }
        }

        /* Tab nav */
        .tab-nav {
            padding: 1.5rem 2rem 0;
            display: flex;
            gap: 0.5rem;
            flex-wrap: wrap;
        }

        .tab-btn {
            padding: 0.6rem 1.2rem;
            border-radius: 10px;
            border: none;
            cursor: pointer;
            font-weight: 600;
            font-size: 0.85rem;
            background: #E2E8F0;
            color: #64748B;
            transition: all 0.2s;
        }

        .tab-btn.active {
            background: #1D3557;
            color: white;
            box-shadow: 0 2px 8px rgba(29, 53, 87, 0.3);
        }

        /* Toolbar */
        .toolbar {
            padding: 1rem 2rem;
            display: flex;
            align-items: center;
            justify-content: space-between;
            flex-wrap: wrap;
            gap: 0.5rem;
        }

        .toolbar-left {
            font-size: 0.85rem;
            color: #64748B;
        }

        .toolbar-left strong {
            color: #1e293b;
        }

        .toolbar-right {
            display: flex;
            gap: 0.5rem;
            flex-wrap: wrap;
        }

        .btn {
            padding: 0.5rem 1rem;
            border-radius: 8px;
            border: none;
            cursor: pointer;
            font-weight: 600;
            font-size: 0.8rem;
            transition: all 0.2s;
        }

        .btn-primary {
            background: #2A9D8F;
            color: white;
        }

        .btn-primary:hover {
            background: #238B7E;
        }

        .btn-amber {
            background: #F59E0B;
            color: white;
        }

        .btn-amber:hover {
            background: #D97706;
        }

        .btn-slate {
            background: #475569;
            color: white;
        }

        .btn-slate:hover {
            background: #334155;
        }

        .btn-danger {
            background: #DC2626;
            color: white;
        }

        .btn-danger:hover {
            background: #B91C1C;
        }

        .btn-sm {
            padding: 0.3rem 0.7rem;
            font-size: 0.75rem;
        }

        /* Table */
        .table-wrap {
            max-width: 1280px;
            margin: 0 auto 3rem;
            background: white;
            border-radius: 16px;
            overflow: hidden;
            box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
        }

        table {
            width: 100%;
            border-collapse: collapse;
            font-size: 0.85rem;
        }

        thead th {
            background: #F8FAFC;
            padding: 0.75rem 1rem;
            text-align: left;
            font-size: 0.7rem;
            font-weight: 700;
            color: #64748B;
            text-transform: uppercase;
            letter-spacing: 0.05em;
            border-bottom: 1px solid #E2E8F0;
        }

        tbody tr {
            border-bottom: 1px solid #F1F5F9;
            transition: background 0.15s;
        }

        tbody tr:hover {
            background: #F8FAFC;
        }

        td {
            padding: 0.7rem 1rem;
            vertical-align: middle;
        }

        .week-badge {
            display: inline-block;
            background: #1D3557;
            color: white;
            padding: 3px 10px;
            border-radius: 6px;
            font-size: 0.78rem;
            font-weight: 700;
            white-space: nowrap;
        }

        /* Unit badge */
        .unit-badge {
            display: inline-flex;
            align-items: center;
            gap: 5px;
            padding: 4px 12px;
            border-radius: 8px;
            font-size: 0.8rem;
            font-weight: 600;
            white-space: nowrap;
            cursor: pointer;
            transition: opacity 0.2s;
        }

        .unit-badge:hover {
            opacity: 0.8;
        }

        /* Color swatch in table */
        .color-swatch {
            display: inline-block;
            width: 14px;
            height: 14px;
            border-radius: 50%;
            border: 2px solid rgba(0, 0, 0, 0.15);
            vertical-align: middle;
            margin-right: 4px;
        }

        /* Subunit preview */
        .subunit-preview {
            color: #475569;
            font-size: 0.82rem;
            max-width: 500px;
            line-height: 1.5;
        }

        .subunit-preview .line {
            margin-bottom: 2px;
        }

        .subunit-preview .title {
            font-weight: 600;
            color: #1D3557;
        }

        .subunit-preview .desc {
            color: #94A3B8;
            margin-left: 6px;
        }

        .subunit-preview .newline {
            display: block;
            height: 6px;
        }

        /* Holiday/Semester rows */
        .row-holiday td {
            background: rgba(245, 158, 11, 0.08);
            color: #92400E;
            text-align: center;
            font-style: italic;
            padding: 0.8rem;
            font-size: 0.85rem;
        }

        .row-semester td {
            background: rgba(29, 53, 87, 0.06);
            color: #1D3557;
            text-align: center;
            font-weight: 700;
            font-size: 0.85rem;
            padding: 0.8rem;
        }

        /* Modal */
        .modal-overlay {
            position: fixed;
            inset: 0;
            background: rgba(0, 0, 0, 0.5);
            display: flex;
            align-items: center;
            justify-content: center;
            z-index: 1000;
            padding: 1rem;
        }

        .modal-overlay.hidden {
            display: none;
        }

        .modal {
            background: white;
            border-radius: 16px;
            overflow: hidden;
            width: 100%;
            max-width: 580px;
            box-shadow: 0 25px 50px rgba(0, 0, 0, 0.2);
        }

        .modal-header {
            padding: 1.2rem 1.5rem;
            display: flex;
            align-items: center;
            justify-content: space-between;
        }

        .modal-header.edit {
            background: #1D3557;
            color: white;
        }

        .modal-header.add {
            background: #2A9D8F;
            color: white;
        }

        .modal-header.holiday {
            background: #F59E0B;
            color: white;
        }

        .modal-header.semester {
            background: #475569;
            color: white;
        }

        .modal-header h3 {
            margin: 0;
            font-size: 1rem;
        }

        .modal-close {
            background: none;
            border: none;
            color: rgba(255, 255, 255, 0.7);
            font-size: 1.5rem;
            cursor: pointer;
            line-height: 1;
        }

        .modal-close:hover {
            color: white;
        }

        .modal-body {
            padding: 1.5rem;
            max-height: 70vh;
            overflow-y: auto;
            display: flex;
            flex-direction: column;
            gap: 1rem;
        }

        /* Form fields */
        .field {
            display: flex;
            flex-direction: column;
            gap: 0.3rem;
        }

        .field label {
            font-size: 0.72rem;
            font-weight: 700;
            color: #64748B;
            text-transform: uppercase;
            letter-spacing: 0.05em;
        }

        .field label .hint {
            font-weight: 400;
            text-transform: none;
            letter-spacing: 0;
            color: #94A3B8;
        }

        .field input,
        .field select,
        .field textarea {
            width: 100%;
            padding: 0.6rem 0.8rem;
            border: 1px solid #E2E8F0;
            border-radius: 8px;
            font-size: 0.85rem;
            font-family: inherit;
            transition: border-color 0.2s;
            background: white;
        }

        .field input:focus,
        .field select:focus,
        .field textarea:focus {
            outline: none;
            border-color: #1D3557;
            box-shadow: 0 0 0 3px rgba(29, 53, 87, 0.08);
        }

        .field textarea {
            resize: vertical;
            min-height: 120px;
            line-height: 1.6;
        }

        .field-row {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 1rem;
        }

        /* Color picker section */
        .color-section {
            background: #F8FAFC;
            border-radius: 10px;
            padding: 1rem;
            border: 1px solid #E2E8F0;
        }

        .color-section-title {
            font-size: 0.75rem;
            font-weight: 700;
            color: #475569;
            margin-bottom: 0.75rem;
            text-transform: uppercase;
            letter-spacing: 0.05em;
        }

        .color-row {
            display: flex;
            gap: 1.5rem;
        }

        .color-field {
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }

        .color-field label {
            font-size: 0.75rem;
            color: #64748B;
            font-weight: 600;
            white-space: nowrap;
        }

        .color-field input[type="color"] {
            width: 44px;
            height: 36px;
            border: 1px solid #E2E8F0;
            border-radius: 8px;
            padding: 2px;
            cursor: pointer;
            background: white;
        }

        .color-field input[type="text"] {
            width: 90px;
            padding: 0.4rem 0.6rem;
            border: 1px solid #E2E8F0;
            border-radius: 6px;
            font-size: 0.8rem;
            font-family: monospace;
        }

        /* Row type toggle */
        .row-type-section {
            background: #F8FAFC;
            border-radius: 10px;
            padding: 1rem;
            border: 1px solid #E2E8F0;
        }

        .row-type-section>label {
            display: block;
            font-size: 0.72rem;
            font-weight: 700;
            color: #64748B;
            text-transform: uppercase;
            letter-spacing: 0.05em;
            margin-bottom: 0.5rem;
        }

        .radio-group {
            display: flex;
            gap: 1rem;
            flex-wrap: wrap;
        }

        .radio-group label {
            display: flex;
            align-items: center;
            gap: 0.4rem;
            cursor: pointer;
            font-size: 0.85rem;
            color: #475569;
            font-weight: 500;
        }

        .radio-group input {
            accent-color: #1D3557;
        }

        /* Modal footer */
        .modal-footer {
            padding: 1rem 1.5rem;
            display: flex;
            gap: 0.75rem;
            border-top: 1px solid #F1F5F9;
        }

        .modal-footer button {
            flex: 1;
            padding: 0.7rem;
            border-radius: 8px;
            border: none;
            font-weight: 700;
            font-size: 0.85rem;
            cursor: pointer;
            transition: all 0.2s;
        }

        .btn-cancel {
            background: #F1F5F9;
            color: #64748B;
        }

        .btn-cancel:hover {
            background: #E2E8F0;
        }

        .btn-save {
            background: #1D3557;
            color: white;
        }

        .btn-save:hover {
            background: #152943;
        }

        /* Preview box */
        .preview-box {
            background: #F8FAFC;
            border-radius: 8px;
            padding: 0.75rem;
            border: 1px solid #E2E8F0;
            min-height: 60px;
        }

        .preview-label {
            font-size: 0.7rem;
            color: #94A3B8;
            margin-bottom: 0.4rem;
            text-transform: uppercase;
            letter-spacing: 0.05em;
        }

        .preview-tag {
            display: inline-block;
            padding: 4px 12px;
            border-radius: 8px;
            font-size: 0.82rem;
            font-weight: 600;
            margin-bottom: 6px;
        }

        /* Toast */
        #toast {
            position: fixed;
            bottom: 2rem;
            right: 2rem;
            padding: 0.8rem 1.4rem;
            border-radius: 10px;
            color: white;
            font-weight: 600;
            font-size: 0.85rem;
            opacity: 0;
            transition: opacity 0.3s;
            z-index: 9999;
            pointer-events: none;
        }

        #toast.show {
            opacity: 1;
        }

        #toast.success {
            background: #2A9D8F;
        }

        #toast.error {
            background: #DC2626;
        }

        /* Delete modal */
        .delete-modal {
            background: white;
            border-radius: 16px;
            overflow: hidden;
            width: 100%;
            max-width: 400px;
            box-shadow: 0 25px 50px rgba(0, 0, 0, 0.2);
        }

        .delete-modal .modal-header {
            background: #FEF2F2;
            border-bottom: 1px solid #FECACA;
        }

        .delete-modal .modal-header h3 {
            color: #991B1B;
        }

        .delete-modal .modal-body {
            padding: 1.5rem;
        }

        .delete-modal .modal-body p {
            color: #64748B;
            font-size: 0.9rem;
            margin: 0 0 1rem;
        }

        .delete-modal .modal-footer {
            border-top: none;
            padding-top: 0;
        }

        /* Hidden sections */
        .hidden {
            display: none !important;
        }

        /* Scrollbar styling */
        .modal-body::-webkit-scrollbar {
            width: 6px;
        }

        .modal-body::-webkit-scrollbar-track {
            background: #F1F5F9;
        }

        .modal-body::-webkit-scrollbar-thumb {
            background: #CBD5E1;
            border-radius: 3px;
        }

        /* ─── Admin Login Overlay ─── */
        #adminLoginOverlay {
            position: fixed;
            inset: 0;
            z-index: 999999;
            background: rgba(241, 245, 249, 0.85);
            backdrop-filter: blur(25px);
            -webkit-backdrop-filter: blur(25px);
            display: flex;
            align-items: center;
            justify-content: center;
            transition: opacity 0.5s ease;
        }

        #adminLoginOverlay.hidden {
            opacity: 0;
            pointer-events: none;
        }

        .login-card {
            background: white;
            border-radius: 20px;
            padding: 2.5rem 2rem;
            width: 90%;
            max-width: 380px;
            box-shadow: 0 20px 60px rgba(29, 53, 87, 0.15);
            text-align: center;
        }

        .login-card .lock-icon {
            font-size: 3rem;
            margin-bottom: 0.5rem;
        }

        .login-card h2 {
            color: #1D3557;
            font-size: 1.3rem;
            margin: 0 0 0.25rem;
        }

        .login-card p {
            color: #64748B;
            font-size: 0.82rem;
            margin: 0 0 1.5rem;
        }

        .login-card input[type="password"] {
            width: 100%;
            padding: 0.8rem 1rem;
            border: 2px solid #E2E8F0;
            border-radius: 10px;
            font-size: 1rem;
            text-align: center;
            letter-spacing: 0.15em;
            box-sizing: border-box;
            margin-bottom: 1rem;
            transition: border-color 0.2s;
        }

        .login-card input[type="password"]:focus {
            outline: none;
            border-color: #1D3557;
        }

        .login-card .unlock-btn {
            width: 100%;
            padding: 0.8rem;
            background: #1D3557;
            color: white;
            border: none;
            border-radius: 10px;
            font-size: 0.9rem;
            font-weight: 700;
            cursor: pointer;
            transition: background 0.2s;
        }

        .login-card .unlock-btn:hover {
            background: #152943;
        }

        .login-error {
            color: #DC2626;
            font-size: 0.8rem;
            margin-top: 0.75rem;
            display: none;
        }

        /* ─── Security Settings Panel ─── */
        .security-panel {
            max-width: 480px;
            margin: 0 auto 3rem;
            background: white;
            border-radius: 16px;
            overflow: hidden;
            box-shadow: 0 1px 3px rgba(0,0,0,0.05);
            padding: 2rem;
        }

        .security-panel h3 {
            margin: 0 0 0.25rem;
            font-size: 1.1rem;
            color: #1D3557;
        }

        .security-panel .subtitle {
            font-size: 0.8rem;
            color: #64748B;
            margin: 0 0 1.5rem;
        }

        .security-panel .field {
            margin-bottom: 1rem;
        }

        .security-panel .field label {
            display: block;
            font-size: 0.75rem;
            font-weight: 700;
            color: #64748B;
            text-transform: uppercase;
            letter-spacing: 0.05em;
            margin-bottom: 0.4rem;
        }

        .security-panel .field input {
            width: 100%;
            padding: 0.65rem 0.85rem;
            border: 1px solid #E2E8F0;
            border-radius: 8px;
            font-size: 0.85rem;
            box-sizing: border-box;
            font-family: inherit;
        }

        .security-panel .field input:focus {
            outline: none;
            border-color: #1D3557;
            box-shadow: 0 0 0 3px rgba(29, 53, 87, 0.08);
        }

        .security-panel .btn-change {
            width: 100%;
            padding: 0.75rem;
            background: #1D3557;
            color: white;
            border: none;
            border-radius: 10px;
            font-size: 0.9rem;
            font-weight: 700;
            cursor: pointer;
            margin-top: 0.5rem;
            transition: background 0.2s;
        }

        .security-panel .btn-change:hover {
            background: #152943;
        }

        .security-panel .btn-change:disabled {
            background: #94A3B8;
            cursor: not-allowed;
        }

        .security-note {
            font-size: 0.72rem;
            color: #94A3B8;
            margin-top: 0.75rem;
            text-align: center;
        }
