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

        /* 基礎樣式 */
        body {
            font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft JhengHei", "微軟正黑體", sans-serif;
            background-color: #f5f7fa;
            min-height: 100vh;
            font-size: 14px;
            color: #495057;
        }

        /* 頂部導航列 */
        .navbar {
            background-color: #4a5f4f;
            height: 60px;
            padding: 0 24px;
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            z-index: 1000;
            display: flex;
            align-items: center;
            justify-content: space-between;
            box-shadow: 0 2px 4px rgba(0,0,0,0.1);
        }

        .navbar-brand {
            color: white;
            font-size: 18px;
            font-weight: 600;
            display: flex;
            align-items: center;
        }

        .navbar-user {
            display: flex;
            align-items: center;
            gap: 16px;
            color: white;
            font-size: 14px;
        }

        .btn-logout {
            background: rgba(255,255,255,0.1);
            border: 1px solid rgba(255,255,255,0.2);
            color: white;
            padding: 6px 12px;
            border-radius: 4px;
            cursor: pointer;
            font-size: 14px;
            transition: background 0.3s;
        }

        .btn-logout:hover {
            background: rgba(255,255,255,0.2);
        }

        /* 主選單列 */
        .menu-bar {
            background-color: #FFFFFF;
            height: 50px;
            padding: 0 24px;
            position: fixed;
            top: 60px;
            left: 0;
            right: 0;
            z-index: 999;
            box-shadow: 0 1px 3px rgba(0,0,0,0.08);
            display: flex;
            align-items: center;
            gap: 8px;
            overflow-x: auto;
        }

        .menu-item {
            padding: 8px 16px;
            color: #5a6c7d;
            font-size: 14px;
            font-weight: 500;
            border-radius: 4px;
            cursor: pointer;
            white-space: nowrap;
            transition: all 0.3s;
            border: none;
            background: none;
        }

        .menu-item:hover {
            background-color: #f0f2f5;
            color: #7fa87f;
        }

        .menu-item.active {
            background-color: #f0f4e8;
            color: #7fa87f;
        }

        /* 內容區域 */
        .main-content {
            padding-top: 110px;
            padding-left: 24px;
            padding-right: 24px;
            padding-bottom: 40px;
            max-width: 1400px;
            margin: 0 auto;
            min-height: 100vh;
        }

        /* 頁面標題 */
        .page-header {
            margin-bottom: 32px;
        }

        .page-title {
            font-size: 28px;
            font-weight: 600;
            color: #4a5f4f;
            margin-bottom: 8px;
        }

        .page-subtitle {
            font-size: 14px;
            color: #7f8c8d;
        }

        /* 統計卡片 */
        .stats-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
            gap: 20px;
            margin-bottom: 24px;
        }

        .stat-card {
            background: #FFFFFF;
            padding: 24px;
            border-radius: 8px;
            box-shadow: 0 2px 8px rgba(0,0,0,0.08);
            border-left: 4px solid #7fa87f;
            cursor: pointer;
            transition: all 0.3s;
        }

        .stat-card:hover {
            transform: translateY(-2px);
            box-shadow: 0 4px 12px rgba(0,0,0,0.12);
        }

        .stat-value {
            font-size: 36px;
            font-weight: 700;
            color: #7fa87f;
            margin-bottom: 8px;
        }

        .stat-label {
            font-size: 16px;
            font-weight: 500;
            color: #4a5f4f;
        }

        .stat-sublabel {
            font-size: 13px;
            color: #95a5a6;
            margin-top: 4px;
        }

        /* 區塊容器 */
        .section {
            background: #FFFFFF;
            border-radius: 8px;
            padding: 24px;
            margin-bottom: 24px;
            box-shadow: 0 2px 8px rgba(0,0,0,0.08);
        }

        .section-title {
            font-size: 18px;
            font-weight: 600;
            color: #4a5f4f;
            margin-bottom: 20px;
            padding-bottom: 12px;
            border-bottom: 2px solid #ecf0f1;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        /* 按鈕樣式 */
        .btn {
            padding: 10px 20px;
            border-radius: 4px;
            font-size: 14px;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.3s;
            border: none;
            display: inline-flex;
            align-items: center;
            gap: 8px;
        }

        .btn-primary {
            background-color: #7fa87f;
            color: white;
        }

        .btn-primary:hover {
            background-color: #6b8e6b;
            transform: scale(1.02);
        }

        .btn-secondary {
            background: white;
            border: 1px solid #7fa87f;
            color: #7fa87f;
        }

        .btn-secondary:hover {
            background-color: #f0f4e8;
        }

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

        .btn-danger:hover {
            background-color: #c0392b;
        }

        .btn-success {
            background-color: #6b9b6b;
            color: white;
        }

        .btn-success:hover {
            background-color: #5a8a5a;
        }

        .btn-warning {
            background-color: #f39c12;
            color: white;
        }

        .btn-warning:hover {
            background-color: #e67e22;
        }

        .btn-icon {
            width: 32px;
            height: 32px;
            padding: 0;
            display: flex;
            align-items: center;
            justify-content: center;
            background: #f1f3f5;
            border-radius: 4px;
            transition: all 0.3s;
        }

        .btn-icon:hover {
            background-color: #7fa87f;
            color: white;
        }

        /* 表格樣式 */
        .table-container {
            overflow-x: auto;
        }

        table {
            width: 100%;
            border-collapse: collapse;
        }

        th {
            background-color: #f8f9fa;
            padding: 12px;
            text-align: left;
            font-weight: 600;
            color: #5a6c7d;
            font-size: 13px;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            border-bottom: 2px solid #e9ecef;
        }

        td {
            padding: 16px 12px;
            border-bottom: 1px solid #f1f3f5;
            font-size: 14px;
            color: #495057;
        }

        /* 操作按鈕橫向排列 */
        td:has(.btn-icon) {
            display: flex;
            gap: 8px;
            align-items: center;
        }

        tr:hover {
            background-color: #f8f9fa;
            transition: background 0.2s;
        }

        /* 徽章樣式 */
        .badge {
            display: inline-block;
            padding: 4px 8px;
            border-radius: 4px;
            font-size: 12px;
            font-weight: 600;
            text-transform: uppercase;
        }

        .badge-scratch {
            background-color: #ff6900;
            color: white;
        }

        .badge-app-inventor,
        .badge-app {
            background-color: #4caf50;
            color: white;
        }

        .badge-iot {
            background-color: #2196f3;
            color: white;
        }

        .badge-ai {
            background-color: #9c27b0;
            color: white;
        }

        .badge-python {
            background-color: #3776ab;
            color: white;
        }

        .badge-general,
        .badge-other {
            background-color: #95a5a6;
            color: white;
        }

        .badge-public {
            background-color: #d4edda;
            color: #155724;
        }

        .badge-private {
            background-color: #f8d7da;
            color: #721c24;
        }

        .badge-school {
            background-color: #ffe4b5;
            color: #856404;
        }

        .badge-pending {
            background-color: #fff3cd;
            color: #856404;
        }

        .badge-active {
            background-color: #d4edda;
            color: #155724;
        }

        .badge-ended {
            background-color: #f8d7da;
            color: #721c24;
        }

        /* 進度條 */
        .progress {
            width: 100%;
            height: 20px;
            background-color: #e9ecef;
            border-radius: 10px;
            overflow: hidden;
            margin-top: 8px;
        }

        .progress-bar {
            height: 100%;
            background: linear-gradient(90deg, #7fa87f, #6b8e6b);
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
            font-size: 11px;
            font-weight: 600;
            transition: width 0.3s;
        }

        .progress-bar.warning {
            background: linear-gradient(90deg, #f39c12, #e67e22);
        }

        .progress-bar.danger {
            background: linear-gradient(90deg, #e74c3c, #c0392b);
        }

        /* 模態框 */
        .modal {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background-color: rgba(0,0,0,0.5);
            z-index: 2000;
            align-items: center;
            justify-content: center;
        }

        .modal.active {
            display: flex;
        }

        .modal-content {
            background: #FFFFFF;
            border-radius: 8px;
            width: 90%;
            max-width: 600px;
            max-height: 90vh;
            position: relative;
            display: flex;
            flex-direction: column;
        }

        .modal-header {
            padding: 24px;
            border-bottom: 1px solid #e9ecef;
            display: flex;
            justify-content: space-between;
            align-items: center;
            flex-shrink: 0;
        }

        .modal-title {
            font-size: 20px;
            color: #4a5f4f;
            margin: 0;
        }

        .modal-close {
            background: none;
            border: none;
            font-size: 24px;
            color: #6c757d;
            cursor: pointer;
        }

        .modal-close:hover {
            color: #4a5f4f;
        }

        .modal-body {
            padding: 24px;
            overflow-y: auto;
            flex: 1;
            min-height: 0;
        }

        .modal-footer {
            padding: 16px 24px;
            border-top: 1px solid #e9ecef;
            display: flex;
            justify-content: flex-end;
            gap: 12px;
            flex-shrink: 0;
        }

        /* 表單樣式 */
        .form-group {
            margin-bottom: 16px;
        }

        .form-label {
            display: block;
            margin-bottom: 8px;
            font-size: 14px;
            color: #495057;
            font-weight: 500;
        }

        .form-label .required {
            color: #e74c3c;
        }

        .form-control {
            width: 100%;
            padding: 10px;
            border: 1px solid #ced4da;
            border-radius: 4px;
            font-size: 14px;
            transition: border-color 0.3s;
        }

        .form-control:focus {
            outline: none;
            border-color: #7fa87f;
            box-shadow: 0 0 0 3px rgba(127, 168, 127, 0.1);
        }

        .form-control.error {
            border-color: #e74c3c;
        }

        .form-error {
            color: #e74c3c;
            font-size: 12px;
            margin-top: 4px;
            display: none;
        }

        .form-error.show {
            display: block;
        }

        textarea.form-control {
            min-height: 100px;
            resize: vertical;
        }

        select.form-control {
            cursor: pointer;
        }

        /* 檔案上傳區域 */
        .file-upload-area {
            border: 2px dashed #ced4da;
            border-radius: 4px;
            padding: 40px;
            text-align: center;
            cursor: pointer;
            transition: all 0.3s;
        }

        .file-upload-area:hover {
            border-color: #7fa87f;
            background-color: #f8f9fa;
        }

        .file-upload-area.dragover {
            border-color: #7fa87f;
            background-color: #f0f4e8;
        }

        .file-upload-icon {
            font-size: 48px;
            color: #6c757d;
            margin-bottom: 16px;
        }

        .file-upload-text {
            font-size: 16px;
            color: #495057;
            margin-bottom: 8px;
        }

        .file-upload-hint {
            font-size: 12px;
            color: #6c757d;
        }

        /* 班級卡片 */
        .class-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
            gap: 20px;
        }

        .class-card {
            background: #FFFFFF;
            border-radius: 8px;
            overflow: hidden;
            box-shadow: 0 2px 8px rgba(0,0,0,0.08);
            transition: all 0.3s;
            cursor: pointer;
        }

        .class-card:hover {
            transform: translateY(-2px);
            box-shadow: 0 4px 12px rgba(0,0,0,0.12);
        }

        .class-card-header {
            background: linear-gradient(135deg, #5a7a5f 0%, #6b8e70 100%);
            padding: 20px;
            color: white;
        }

        .class-card-title {
            font-size: 18px;
            font-weight: 600;
            margin-bottom: 8px;
        }

        .class-card-info {
            font-size: 14px;
            opacity: 0.9;
        }

        .class-card-body {
            padding: 20px;
        }

        .class-code {
            background-color: #f8f9fa;
            padding: 12px;
            border-radius: 4px;
            text-align: center;
            margin-bottom: 16px;
        }

        .class-code-label {
            font-size: 12px;
            color: #6c757d;
            margin-bottom: 4px;
        }

        .class-code-value {
            font-size: 24px;
            font-weight: 700;
            color: #7fa87f;
            letter-spacing: 2px;
        }

        .class-stats {
            display: flex;
            justify-content: space-between;
            padding-top: 16px;
            border-top: 1px solid #e9ecef;
        }

        .class-stat {
            text-align: center;
        }

        .class-stat-value {
            font-size: 20px;
            font-weight: 600;
            color: #4a5f4f;
        }

        .class-stat-label {
            font-size: 12px;
            color: #6c757d;
            margin-top: 4px;
        }


        .submission-status {
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .submission-count {
            font-size: 14px;
            color: #495057;
        }

        .submission-progress {
            width: 120px;
            height: 8px;
            background-color: #e9ecef;
            border-radius: 4px;
            overflow: hidden;
        }

        .submission-progress-bar {
            height: 100%;
            background-color: #6b9b6b;
            transition: width 0.3s;
        }

        /* 浮動操作按鈕 */
        .fab {
            position: fixed;
            bottom: 32px;
            right: 32px;
            width: 56px;
            height: 56px;
            border-radius: 50%;
            background-color: #7fa87f;
            color: white;
            border: none;
            font-size: 24px;
            box-shadow: 0 4px 12px rgba(127, 168, 127, 0.3);
            cursor: pointer;
            z-index: 900;
            transition: all 0.3s;
        }

        .fab:hover {
            transform: scale(1.1);
            box-shadow: 0 6px 20px rgba(127, 168, 127, 0.4);
        }

        /* 空狀態 */
        .empty-state {
            text-align: center;
            padding: 60px 20px;
        }

        .empty-icon {
            font-size: 64px;
            color: #d1d5db;
            margin-bottom: 16px;
        }

        .empty-title {
            font-size: 18px;
            font-weight: 600;
            color: #6c757d;
            margin-bottom: 8px;
        }

        .empty-text {
            font-size: 14px;
            color: #95a5a6;
            margin-bottom: 20px;
        }

        /* 載入動畫 */
        .loading {
            display: inline-block;
            width: 20px;
            height: 20px;
            border: 3px solid rgba(127, 168, 127, 0.3);
            border-radius: 50%;
            border-top-color: #7fa87f;
            animation: spin 1s ease-in-out infinite;
        }

        @keyframes spin {
            to { transform: rotate(360deg); }
        }

        /* 響應式設計 */
        @media (max-width: 768px) {
            .main-content {
                padding-left: 16px;
                padding-right: 16px;
            }

            .stats-grid {
                grid-template-columns: 1fr;
            }

            .class-grid {
                grid-template-columns: 1fr;
            }

            .modal-content {
                width: 95%;
            }

            table {
                font-size: 12px;
            }

            td, th {
                padding: 8px;
            }

            .menu-bar {
                overflow-x: auto;
            }
        }

        /* 隱藏區塊 */
        .hidden {
            display: none !important;
        }

        /* 標籤選擇器樣式 */
        .tag-selector {
            margin-top: 8px;
        }

        .tag-input-container {
            position: relative;
        }

        .tag-suggestions {
            position: absolute;
            top: 100%;
            left: 0;
            right: 0;
            background: white;
            border: 1px solid #ced4da;
            border-top: none;
            border-radius: 0 0 4px 4px;
            max-height: 200px;
            overflow-y: auto;
            z-index: 1000;
            box-shadow: 0 4px 6px rgba(0,0,0,0.1);
        }

        .tag-suggestion-item {
            padding: 8px 12px;
            cursor: pointer;
            transition: background 0.2s;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .tag-suggestion-item:hover {
            background-color: #f8f9fa;
        }

        .tag-suggestion-item.create-new {
            background-color: #f0f4e8;
            color: #7fa87f;
            font-weight: 500;
        }

        .tag-suggestion-name {
            flex: 1;
        }

        .tag-suggestion-count {
            font-size: 12px;
            color: #6c757d;
        }

        .selected-tags {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
            margin-top: 12px;
            min-height: 32px;
        }

        .tag-item {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            padding: 6px 12px;
            background-color: #f0f4e8;
            color: #7fa87f;
            border-radius: 16px;
            font-size: 13px;
            font-weight: 500;
            transition: all 0.2s;
        }

        .tag-item:hover {
            background-color: #d4e9f7;
        }

        .tag-item-remove {
            cursor: pointer;
            font-size: 16px;
            line-height: 1;
            opacity: 0.7;
            transition: opacity 0.2s;
        }

        .tag-item-remove:hover {
            opacity: 1;
            color: #e74c3c;
        }

        .popular-tags {
            margin-top: 12px;
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
            align-items: center;
        }

        .popular-tag {
            padding: 4px 10px;
            background-color: #f8f9fa;
            color: #495057;
            border: 1px solid #dee2e6;
            border-radius: 12px;
            font-size: 12px;
            cursor: pointer;
            transition: all 0.2s;
        }

        .popular-tag:hover {
            background-color: #f0f4e8;
            color: #7fa87f;
            border-color: #7fa87f;
        }

        .popular-tag.selected {
            background-color: #f0f4e8;
            color: #7fa87f;
            border-color: #7fa87f;
        }

        /* 班級詳情頁面 */
        .class-detail-header {
            background: linear-gradient(135deg, #4A7C59 0%, #5D8C6B 100%);
            border-radius: 8px;
            padding: 24px;
            color: white;
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 24px;
        }

        .class-detail-info {
            flex: 1;
        }

        .class-detail-row {
            display: flex;
            align-items: center;
            margin-bottom: 12px;
            font-size: 14px;
        }

        .class-detail-row:last-child {
            margin-bottom: 0;
        }

        .info-label {
            font-weight: 500;
            opacity: 0.9;
            min-width: 100px;
        }

        .info-value {
            font-weight: 600;
            font-size: 16px;
        }

        .class-detail-stats {
            display: flex;
            gap: 32px;
        }

        .stat-item {
            text-align: center;
            padding: 12px 24px;
            background: rgba(255, 255, 255, 0.1);
            border-radius: 8px;
            min-width: 100px;
        }

        .stat-number {
            font-size: 32px;
            font-weight: 700;
            margin-bottom: 4px;
        }

        .stat-text {
            font-size: 12px;
            opacity: 0.9;
        }

        .btn-sm {
            padding: 6px 12px;
            font-size: 13px;
        }

        /* 分享資源模態框樣式 */
        .modal-content {
            max-width: 800px;
        }

        .modal-content table {
            margin: 0;
        }

        .modal-content thead {
            position: sticky;
            top: 0;
            background: white;
            z-index: 1;
        }

        /* 表格內 checkbox 樣式 */
        table input[type="checkbox"] {
            width: 18px;
            height: 18px;
            cursor: pointer;
        }

        /* 進度條細節 */
        .progress-container {
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .progress-bar-wrapper {
            flex: 1;
            background: #e9ecef;
            border-radius: 4px;
            height: 8px;
            overflow: hidden;
        }

        .progress-bar-fill {
            height: 100%;
            background: #28a745;
            border-radius: 4px;
            transition: width 0.3s;
        }

        .progress-text {
            font-size: 12px;
            color: #6c757d;
            min-width: 40px;
            text-align: right;
        }

        /* 資源分享檔案大小顯示 */
        .file-size {
            color: #6c757d;
            font-size: 13px;
        }

        /* 操作按鈕組 */
        .action-buttons {
            display: flex;
            gap: 8px;
            align-items: center;
        }

        @media (max-width: 768px) {
            .class-detail-header {
                flex-direction: column;
                align-items: flex-start;
                gap: 16px;
            }

            .class-detail-stats {
                width: 100%;
                justify-content: space-between;
                gap: 12px;
            }

            .stat-item {
                flex: 1;
                min-width: auto;
                padding: 12px;
            }

            .stat-number {
                font-size: 24px;
            }
        }

        /* 分頁導航樣式 */
        .pagination {
            display: flex;
            gap: 4px;
            align-items: center;
        }

        .pagination .btn-sm {
            min-width: 36px;
            height: 36px;
            padding: 8px 12px;
        }

        .pagination .btn-sm.active {
            background-color: #7fa87f;
            color: white;
            border-color: #7fa87f;
        }

        /* 截止日期狀態顏色 */
        .due-safe {
            background-color: #d4edda;
            color: #6b9b6b;
        }

        .due-warning {
            background-color: #fff3cd;
            color: #f39c12;
        }

        .due-danger {
            background-color: #f8d7da;
            color: #e74c3c;
        }

        .due-expired {
            background-color: #e9ecef;
            color: #6c757d;
        }

        /* 班級狀態標記 */
        .class-status-active {
            background-color: #6b9b6b !important;
            color: white !important;
        }

        .class-status-ending {
            background-color: #f39c12 !important;
            color: white !important;
        }

        .class-status-ended {
            background-color: #95a5a6 !important;
            color: white !important;
        }

        /* 提交狀態圖示樣式 */
        .status-icon {
            font-size: 18px;
            font-weight: 600;
            margin-right: 4px;
        }

        .status-submitted {
            color: #6b9b6b;
        }

        .status-not-submitted {
            color: #e74c3c;
        }

        .status-late {
            color: #f39c12;
        }

        /* 批次刪除按鈕顯示控制 */
        #batchDeleteBtn {
            transition: opacity 0.3s;
        }

        #batchDeleteBtn:disabled {
            opacity: 0.5;
            cursor: not-allowed;
        }

        /* 儲存空間進度條顏色變化 */
        .storage-safe {
            background: linear-gradient(90deg, #6b9b6b, #5a8a5a);
        }

        .storage-warning {
            background: linear-gradient(90deg, #f39c12, #e67e22);
        }

        .storage-danger {
            background: linear-gradient(90deg, #e74c3c, #c0392b);
        }

        /* 刪除班級按鈕 - 放在班級詳情區域內 */
        .floating-delete-btn {
            padding: 12px 24px;
            background-color: #e74c3c;
            color: white;
            border: none;
            border-radius: 6px;
            font-size: 15px;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.3s ease;
            margin-top: 24px;
            float: right;
        }

        .floating-delete-btn:hover {
            background-color: #c0392b;
            transform: translateY(-1px);
            box-shadow: 0 4px 8px rgba(231, 76, 60, 0.3);
        }

        .floating-delete-btn:active {
            transform: translateY(0);
        }

        /* 公開資源詳情模態框按鈕樣式 */
        .btn-view {
            padding: 10px 20px;
            background: white;
            border: 1px solid #7fa87f;
            color: #7fa87f;
            border-radius: 4px;
            font-size: 14px;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.3s;
        }

        .btn-view:hover {
            background-color: #f0f4e8;
        }

        .btn-download {
            padding: 10px 20px;
            background-color: #7fa87f;
            color: white;
            border: none;
            border-radius: 4px;
            font-size: 14px;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.3s;
        }

        .btn-download:hover {
            background-color: #6b8e6b;
            transform: scale(1.02);
        }

        /* 模態框大尺寸 */
        .modal-large {
            max-width: 700px;
        }

        /* 標籤藥丸樣式 */
        .tag-pill {
            display: inline-block;
            padding: 4px 12px;
            background-color: #f0f4e8;
            color: #7fa87f;
            border-radius: 12px;
            font-size: 12px;
            font-weight: 500;
            margin-right: 6px;
            margin-bottom: 6px;
        }

        /* 檔案名稱顯示樣式 */
        .file-name-display {
            background-color: #f8f9fa;
            padding: 10px 12px;
            border-radius: 4px;
            font-size: 13px;
            color: #495057;
            font-family: monospace;
            word-break: break-all;
            margin-bottom: 8px;
        }
