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

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

        /* 頂部導航列 */
        .navbar {
            background: linear-gradient(135deg, #9B7653 0%, #8B6F47 100%);
            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 8px rgba(139, 111, 71, 0.3);
        }

        .navbar-brand {
            font-size: 18px;
            font-weight: 600;
            color: white;
            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);
            padding: 6px 12px;
            border-radius: 4px;
            color: white;
            cursor: pointer;
            transition: background 0.3s;
        }

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

        /* 主選單列 */
        .menu-bar {
            background: #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;
            transition: all 0.3s;
            white-space: nowrap;
        }

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

        .menu-item.active {
            background: #F9F4ED;
            color: #B8926A;
        }

        /* 內容區域 */
        .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;
            padding: 24px;
            background: linear-gradient(135deg, #C4956C 0%, #D4B896 100%);
            border-radius: 12px;
            box-shadow: 0 4px 16px rgba(184, 146, 106, 0.3);
        }

        .page-title {
            font-size: 32px;
            font-weight: 700;
            color: white;
            margin-bottom: 8px;
            text-shadow: 0 2px 4px rgba(0,0,0,0.1);
        }

        .page-subtitle {
            font-size: 16px;
            color: rgba(255, 255, 255, 0.9);
        }

        /* 快速加入班級區 */
        .quick-join {
            background: #B8926A;
            color: white;
            padding: 24px;
            border-radius: 8px;
            margin-bottom: 24px;
            display: flex;
            align-items: center;
            justify-content: space-between;
            flex-wrap: wrap;
            gap: 16px;
        }

        .quick-join-text {
            flex: 1;
        }

        .quick-join-text h3 {
            font-size: 20px;
            margin-bottom: 8px;
        }

        .quick-join-form {
            display: flex;
            gap: 12px;
            align-items: center;
        }

        .quick-join-input {
            padding: 10px;
            border: none;
            border-radius: 4px;
            font-size: 16px;
            width: 150px;
            text-align: center;
            letter-spacing: 2px;
        }

        .quick-join-input::placeholder {
            letter-spacing: normal;
        }

        .btn-join {
            background: white;
            color: #B8926A;
            border: none;
            padding: 10px 24px;
            border-radius: 4px;
            font-size: 14px;
            font-weight: 600;
            cursor: pointer;
            transition: transform 0.3s;
        }

        .btn-join:hover {
            transform: scale(1.05);
        }

        /* 統計卡片 */
        .stat-cards {
            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 #B8926A;
            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: #B8926A;
            margin-bottom: 8px;
        }

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

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

        /* 區塊容器 */
        .section {
            background: #FFFFFF;
            border-radius: 12px;
            padding: 28px;
            margin-bottom: 28px;
            box-shadow: 0 2px 12px rgba(0,0,0,0.08);
            border: 2px solid #f1f3f5;
            transition: all 0.3s;
        }

        .section:hover {
            box-shadow: 0 4px 20px rgba(0,0,0,0.12);
        }

        .section-title {
            font-size: 20px;
            font-weight: 700;
            color: #2c3e50;
            margin-bottom: 24px;
            padding-bottom: 16px;
            border-bottom: 3px solid #ecf0f1;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        /* 搜尋列 */
        .search-bar {
            display: flex;
            gap: 12px;
            margin-bottom: 20px;
            flex-wrap: wrap;
        }

        .search-input {
            flex: 1;
            min-width: 200px;
            padding: 10px;
            border: 1px solid #ced4da;
            border-radius: 4px;
            font-size: 14px;
        }

        .search-input:focus {
            outline: none;
            border-color: #B8926A;
        }

        .filter-select {
            padding: 10px;
            border: 1px solid #ced4da;
            border-radius: 4px;
            font-size: 14px;
        }

        /* 搜尋框優化 */
        .search-box {
            display: flex;
            gap: 12px;
            margin-bottom: 24px;
            flex-wrap: wrap;
            background: white;
            padding: 20px;
            border-radius: 12px;
            box-shadow: 0 2px 12px rgba(0,0,0,0.08);
        }

        .search-box input[type="text"] {
            flex: 1;
            min-width: 250px;
            padding: 14px 20px;
            border: 2px solid #e9ecef;
            border-radius: 10px;
            font-size: 15px;
            transition: all 0.3s;
            background: #f8f9fa;
        }

        .search-box input[type="text"]:focus {
            outline: none;
            border-color: #B8926A;
            background: white;
            box-shadow: 0 0 0 4px rgba(184, 146, 106, 0.1);
        }

        .search-box select {
            padding: 14px 16px;
            border: 2px solid #e9ecef;
            border-radius: 10px;
            font-size: 14px;
            font-weight: 500;
            background: #f8f9fa;
            color: #495057;
            cursor: pointer;
            transition: all 0.3s;
            min-width: 140px;
        }

        .search-box select:hover {
            border-color: #B8926A;
            background: white;
        }

        .search-box select:focus {
            outline: none;
            border-color: #B8926A;
            box-shadow: 0 0 0 4px rgba(184, 146, 106, 0.1);
        }

        /* 資源卡片格線 */
        .resource-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
            gap: 24px;
            margin-bottom: 20px;
        }

        .resource-card {
            background: white;
            border-radius: 12px;
            padding: 0;
            border: 2px solid #f1f3f5;
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            cursor: pointer;
            overflow: hidden;
            position: relative;
        }

        .resource-card::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            height: 4px;
            background: linear-gradient(90deg, #B8926A, #D4B896);
            opacity: 0;
            transition: opacity 0.3s;
        }

        .resource-card:hover {
            transform: translateY(-4px);
            box-shadow: 0 8px 24px rgba(0,0,0,0.12);
            border-color: #B8926A;
        }

        .resource-card:hover::before {
            opacity: 1;
        }

        .resource-header {
            display: flex;
            justify-content: space-between;
            align-items: start;
            padding: 20px 20px 12px;
            background: linear-gradient(135deg, #C4956C15 0%, #D4B89615 100%);
        }

        .resource-title {
            font-size: 17px;
            font-weight: 700;
            color: #2c3e50;
            margin-bottom: 8px;
            line-height: 1.4;
            display: -webkit-box;
            -webkit-line-clamp: 2;
            -webkit-box-orient: vertical;
            overflow: hidden;
        }

        .resource-category {
            display: inline-block;
            padding: 6px 12px;
            border-radius: 8px;
            font-size: 12px;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            background: #F9F4ED;
            color: #B8926A;
            border: 2px solid #B8926A;
        }

        .category-scratch {
            background: #ffe8e0;
            color: #ff6900;
            border-color: #ff6900;
        }

        .category-iot {
            background: #F9F4ED;
            color: #A67C52;
            border-color: #A67C52;
        }

        .category-app {
            background: #e8f5e9;
            color: #4caf50;
            border-color: #4caf50;
        }

        .resource-teacher {
            padding: 0 20px;
            font-size: 14px;
            color: #495057;
            font-weight: 600;
            margin-bottom: 8px;
        }

        .resource-meta {
            padding: 0 20px;
            font-size: 13px;
            color: #6c757d;
            margin-bottom: 8px;
            line-height: 1.6;
        }

        .resource-info {
            padding: 0 20px;
            font-size: 13px;
            color: #6c757d;
            margin-bottom: 16px;
            line-height: 1.6;
        }

        .resource-actions {
            display: flex;
            gap: 8px;
            padding: 16px 20px;
            background: #f8f9fa;
            border-top: 1px solid #e9ecef;
        }

        .btn-download {
            background: linear-gradient(135deg, #B8926A 0%, #A67C52 100%);
            color: white;
            border: none;
            padding: 10px 20px;
            border-radius: 8px;
            font-size: 14px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s;
            box-shadow: 0 2px 8px rgba(184, 146, 106, 0.3);
            flex: 1;
        }

        .btn-download:hover {
            transform: translateY(-2px);
            box-shadow: 0 4px 12px rgba(184, 146, 106, 0.4);
        }

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

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

        .class-card {
            background: white;
            border-radius: 10px;
            padding: 0;
            border: 1px solid #e0e0e0;
            overflow: hidden;
            transition: all 0.3s ease;
            box-shadow: 0 1px 3px rgba(0,0,0,0.06);
        }

        .class-card:hover {
            box-shadow: 0 6px 16px rgba(0,0,0,0.1);
            transform: translateY(-3px);
            border-color: #B8926A;
        }

        .class-card-top {
            display: flex;
            justify-content: space-between;
            align-items: flex-start;
            padding: 20px 20px 12px;
            gap: 12px;
        }

        .class-title {
            font-size: 18px;
            font-weight: 700;
            color: #2c3e50;
            margin: 0;
            line-height: 1.4;
            flex: 1;
        }

        .class-badge {
            background: #f1f3f5;
            color: #495057;
            padding: 4px 10px;
            border-radius: 12px;
            font-size: 11px;
            font-weight: 600;
            white-space: nowrap;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

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

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

        .class-teacher {
            font-size: 15px;
            color: #2c3e50;
            font-weight: 500;
            padding: 0 20px;
            margin-bottom: 6px;
        }

        .class-semester {
            font-size: 14px;
            color: #6c757d;
            padding: 0 20px;
            margin-bottom: 12px;
        }

        .class-duration {
            font-size: 13px;
            color: #95a5a6;
            padding: 0 20px;
            margin-bottom: 16px;
            font-weight: 500;
        }

        .class-numbers {
            display: flex;
            justify-content: space-around;
            background: #f8f9fa;
            padding: 16px 20px;
            margin: 0;
            border-top: 1px solid #e9ecef;
            border-bottom: 1px solid #e9ecef;
        }

        .number-item {
            text-align: center;
            flex: 1;
        }

        .number-value {
            font-size: 24px;
            font-weight: 700;
            color: #B8926A;
            line-height: 1;
            margin-bottom: 4px;
        }

        .number-label {
            font-size: 12px;
            color: #6c757d;
            font-weight: 500;
        }

        .class-footer {
            display: flex;
            gap: 10px;
            padding: 16px 20px;
        }

        .btn-enter {
            background: #B8926A;
            color: white;
            border: none;
            padding: 10px 20px;
            border-radius: 6px;
            font-size: 14px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s;
            flex: 1;
        }

        .btn-enter:hover {
            background: #A67C52;
            box-shadow: 0 2px 8px rgba(184, 146, 106, 0.3);
        }

        .btn-leave {
            background: white;
            color: #6c757d;
            border: 1px solid #dee2e6;
            padding: 10px 20px;
            border-radius: 6px;
            font-size: 14px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s;
        }

        .btn-leave:hover {
            background: #f8f9fa;
            border-color: #e74c3c;
            color: #e74c3c;
        }

        .btn-ended {
            background: #f1f3f5;
            color: #95a5a6;
            border: 1px solid #dee2e6;
            padding: 8px 16px;
            border-radius: 4px;
            font-size: 14px;
            cursor: not-allowed;
            flex: 1;
        }

        /* 作業區 */
        .assignment-list {
            display: flex;
            flex-direction: column;
            gap: 16px;
        }

        .assignment-card {
            background: #f8f9fa;
            border-radius: 8px;
            padding: 20px;
            border: 1px solid #e9ecef;
            display: flex;
            justify-content: space-between;
            align-items: center;
            flex-wrap: wrap;
            gap: 16px;
        }

        .assignment-info {
            flex: 1;
        }

        .assignment-title {
            font-size: 16px;
            font-weight: 600;
            color: #2c3e50;
            margin-bottom: 8px;
        }

        .assignment-description {
            font-size: 14px;
            color: #6c757d;
            margin-bottom: 8px;
        }

        .assignment-due {
            display: flex;
            align-items: center;
            gap: 8px;
            font-size: 13px;
        }

        .due-normal {
            color: #6c757d;
        }

        .due-warning {
            color: #f39c12;
            font-weight: 600;
        }

        .due-danger {
            color: #e74c3c;
            font-weight: 600;
        }

        .assignment-status {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 8px;
        }

        .status-badge {
            padding: 6px 12px;
            border-radius: 12px;
            font-size: 12px;
            font-weight: 600;
            text-transform: uppercase;
        }

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

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

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

        .btn-submit {
            background: #27ae60;
            color: white;
            border: none;
            padding: 8px 16px;
            border-radius: 4px;
            font-size: 14px;
            cursor: pointer;
            transition: background 0.3s;
        }

        .btn-submit:hover {
            background: #229954;
        }

        .btn-view {
            background: white;
            color: #B8926A;
            border: 1px solid #B8926A;
            padding: 8px 16px;
            border-radius: 4px;
            font-size: 14px;
            cursor: pointer;
            transition: all 0.3s;
        }

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

        /* 模態框 */
        .modal {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: 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;
            overflow-y: auto;
            position: relative;
        }

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

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

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

        .modal-body {
            padding: 24px;
        }

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

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

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

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

        .form-input,
        .form-select,
        .form-textarea {
            width: 100%;
            padding: 10px;
            border: 1px solid #ced4da;
            border-radius: 4px;
            font-size: 14px;
        }

        .form-input:focus,
        .form-select:focus,
        .form-textarea:focus {
            outline: none;
            border-color: #B8926A;
        }

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

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

        .upload-area:hover {
            border-color: #B8926A;
            background: #f8f9fa;
        }

        .upload-area.dragover {
            border-color: #B8926A;
            background: #F9F4ED;
        }

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

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

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

        .file-info {
            background: #f8f9fa;
            padding: 12px;
            border-radius: 4px;
            margin-top: 16px;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .file-name {
            font-size: 14px;
            color: #495057;
        }

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

        /* 空狀態 */
        .empty-state {
            text-align: center;
            padding: 80px 40px;
            background: white;
            border-radius: 12px;
            border: 2px dashed #dee2e6;
        }

        .empty-icon {
            font-size: 80px;
            color: #dee2e6;
            margin-bottom: 20px;
            animation: float 3s ease-in-out infinite;
        }

        @keyframes float {
            0%, 100% { transform: translateY(0); }
            50% { transform: translateY(-10px); }
        }

        .empty-title {
            font-size: 20px;
            font-weight: 700;
            color: #495057;
            margin-bottom: 12px;
        }

        .empty-text {
            font-size: 15px;
            color: #6c757d;
            line-height: 1.6;
        }

        /* 載入狀態 */
        .loading {
            text-align: center;
            padding: 60px 40px;
            background: white;
            border-radius: 12px;
        }

        .spinner {
            border: 4px solid #f3f3f3;
            border-top: 4px solid #B8926A;
            border-radius: 50%;
            width: 50px;
            height: 50px;
            animation: spin 0.8s linear infinite;
            margin: 0 auto 20px;
        }

        @keyframes spin {
            0% { transform: rotate(0deg); }
            100% { transform: rotate(360deg); }
        }

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

            .page-header {
                padding: 20px;
                margin-bottom: 24px;
            }

            .page-title {
                font-size: 24px;
            }

            .page-subtitle {
                font-size: 14px;
            }

            .stat-cards {
                grid-template-columns: 1fr;
            }

            .resource-grid {
                grid-template-columns: 1fr;
                gap: 16px;
            }

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

            .quick-join {
                flex-direction: column;
            }

            .quick-join-form {
                width: 100%;
                flex-direction: column;
            }

            .quick-join-input {
                width: 100%;
            }

            .assignment-card {
                flex-direction: column;
            }

            .assignment-status {
                width: 100%;
                flex-direction: row;
                justify-content: space-between;
            }

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

            .search-box {
                padding: 16px;
                gap: 10px;
            }

            .search-box input[type="text"] {
                min-width: 100%;
            }

            .search-box select {
                width: 100%;
            }

            .section {
                padding: 20px;
                margin-bottom: 20px;
            }

            .section-title {
                font-size: 18px;
            }

            .tag-filter-section {
                padding: 16px;
            }

            .pagination {
                gap: 6px;
            }

            .pagination-btn {
                padding: 10px 16px;
                font-size: 13px;
            }

            .pagination-page {
                min-width: 36px;
                height: 36px;
                font-size: 13px;
            }

            .empty-state {
                padding: 60px 20px;
            }
        }

        /* 倒數計時器樣式 */
        .countdown-timer {
            padding: 16px;
            border-radius: 8px;
            background: #f8f9fa;
            border: 2px solid #e9ecef;
            transition: all 0.3s ease;
        }

        .countdown-value {
            font-size: 24px;
            font-weight: 700;
            margin-bottom: 8px;
            font-family: 'Courier New', monospace;
            letter-spacing: 1px;
        }

        .countdown-hint {
            font-size: 13px;
            color: #6c757d;
            margin-top: 4px;
        }

        /* 倒數計時器狀態樣式 */
        .countdown-timer.countdown-safe {
            background: #e8f8f5;
            border-color: #27ae60;
        }

        .countdown-timer.countdown-warning {
            background: #fef5e7;
            border-color: #f39c12;
        }

        .countdown-timer.countdown-danger {
            background: #fadbd8;
            border-color: #e74c3c;
        }

        /* 倒數計時器閃爍效果 */
        .countdown-timer.countdown-blink .countdown-value {
            animation: blink 1s infinite;
        }

        @keyframes blink {
            0%, 49% {
                opacity: 1;
            }
            50%, 100% {
                opacity: 0.4;
            }
        }

        /* 提交記錄樣式 */
        .submission-stats {
            margin-bottom: 12px;
            font-size: 14px;
            color: #6c757d;
            font-weight: 500;
        }

        .submission-list {
            max-height: 300px;
            overflow-y: auto;
            border: 1px solid #e9ecef;
            border-radius: 6px;
            background: #f8f9fa;
        }

        .submission-item {
            padding: 12px;
            border-bottom: 1px solid #e9ecef;
            background: white;
            transition: background 0.2s;
        }

        .submission-item:last-child {
            border-bottom: none;
        }

        .submission-item:hover {
            background: #f8f9fa;
        }

        .submission-item.submission-current {
            background: #F9F4ED;
            border-left: 3px solid #B8926A;
        }

        .submission-header {
            display: flex;
            align-items: center;
            gap: 8px;
            margin-bottom: 8px;
        }

        .submission-number {
            font-weight: 600;
            color: #495057;
            font-size: 13px;
        }

        .badge-current {
            background: #B8926A;
            color: white;
            padding: 2px 8px;
            border-radius: 4px;
            font-size: 11px;
            font-weight: 600;
        }

        .submission-date {
            margin-left: auto;
            font-size: 12px;
            color: #6c757d;
        }

        .submission-info {
            display: flex;
            justify-content: space-between;
            align-items: center;
            font-size: 13px;
            color: #495057;
        }

        .submission-file {
            flex: 1;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .submission-size {
            margin-left: 12px;
            color: #6c757d;
            font-size: 12px;
        }

        .submission-score {
            margin-top: 8px;
            padding-top: 8px;
            border-top: 1px solid #e9ecef;
            font-size: 13px;
            color: #495057;
        }

        .score-value {
            font-weight: 700;
            color: #27ae60;
            font-size: 16px;
        }

        /* 資源預覽樣式 */
        .modal-large .modal-content {
            max-width: 900px;
        }

        .preview-container {
            min-height: 400px;
            max-height: 500px;
            border: 1px solid #e9ecef;
            border-radius: 8px;
            background: #f8f9fa;
            display: flex;
            align-items: center;
            justify-content: center;
            overflow: hidden;
            position: relative;
        }

        .preview-image {
            max-width: 100%;
            max-height: 500px;
            height: auto;
            object-fit: contain;
        }

        .preview-video {
            width: 100%;
            max-height: 500px;
            background: #000;
        }

        .preview-pdf {
            width: 100%;
            height: 500px;
            border: none;
        }

        .preview-hint {
            margin-top: 8px;
            font-size: 13px;
            color: #6c757d;
            text-align: center;
        }

        .preview-placeholder {
            text-align: center;
            padding: 60px 40px;
        }

        .placeholder-icon {
            font-size: 80px;
            margin-bottom: 16px;
            opacity: 0.5;
        }

        .placeholder-text {
            font-size: 18px;
            font-weight: 600;
            color: #495057;
            margin-bottom: 8px;
        }

        .placeholder-hint {
            font-size: 14px;
            color: #6c757d;
        }

        .preview-fallback {
            text-align: center;
            padding: 60px 40px;
        }

        .fallback-icon {
            font-size: 80px;
            margin-bottom: 16px;
            opacity: 0.3;
        }

        .fallback-text {
            font-size: 16px;
            color: #6c757d;
        }

        /* 標籤篩選樣式 */
        .tag-filter-section {
            margin: 24px 0;
            padding: 24px;
            background: white;
            border-radius: 12px;
            border: 2px solid #f1f3f5;
            box-shadow: 0 2px 12px rgba(0,0,0,0.06);
        }

        .tag-filter-header {
            display: flex;
            align-items: center;
            gap: 12px;
            margin-bottom: 16px;
        }

        .tag-filter-label {
            font-size: 16px;
            font-weight: 700;
            color: #2c3e50;
        }

        .btn-add-tag {
            padding: 10px 18px;
            background: linear-gradient(135deg, #B8926A 0%, #A67C52 100%);
            color: white;
            border: none;
            border-radius: 8px;
            font-size: 14px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s;
            display: flex;
            align-items: center;
            gap: 6px;
            box-shadow: 0 2px 8px rgba(184, 146, 106, 0.3);
        }

        .btn-add-tag:hover {
            transform: translateY(-2px);
            box-shadow: 0 4px 12px rgba(184, 146, 106, 0.4);
        }

        .btn-add-tag span {
            font-size: 18px;
            font-weight: 700;
        }

        .btn-clear-tags {
            padding: 10px 18px;
            background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
            color: white;
            border: none;
            border-radius: 8px;
            font-size: 14px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s;
            margin-left: auto;
            box-shadow: 0 2px 8px rgba(231, 76, 60, 0.3);
        }

        .btn-clear-tags:hover {
            transform: translateY(-2px);
            box-shadow: 0 4px 12px rgba(231, 76, 60, 0.4);
        }

        /* 已選標籤區域 */
        .selected-tags {
            min-height: 50px;
            display: flex;
            flex-wrap: wrap;
            gap: 10px;
            align-items: center;
            padding: 4px;
        }

        .tag-hint {
            color: #95a5a6;
            font-size: 14px;
            font-style: italic;
        }

        .tag-pill {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            padding: 10px 16px;
            border-radius: 24px;
            border: 2px solid;
            font-size: 14px;
            font-weight: 600;
            transition: all 0.3s;
            box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
        }

        .tag-pill:hover {
            transform: translateY(-2px);
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
        }

        .tag-remove {
            background: none;
            border: none;
            color: inherit;
            font-size: 20px;
            line-height: 1;
            cursor: pointer;
            padding: 0;
            width: 20px;
            height: 20px;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 50%;
            transition: all 0.2s;
        }

        .tag-remove:hover {
            background: rgba(0, 0, 0, 0.15);
            transform: rotate(90deg);
        }

        /* 標籤選擇器 */
        .tag-selector {
            margin-top: 20px;
            padding: 20px;
            background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
            border-radius: 12px;
            border: 2px solid #dee2e6;
            animation: slideDown 0.3s ease;
            box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
        }

        @keyframes slideDown {
            from {
                opacity: 0;
                transform: translateY(-10px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        .tag-selector-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 16px;
            font-weight: 700;
            font-size: 15px;
            color: #2c3e50;
        }

        .btn-close-selector {
            background: white;
            border: 2px solid #dee2e6;
            font-size: 24px;
            color: #6c757d;
            cursor: pointer;
            padding: 0;
            width: 32px;
            height: 32px;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 8px;
            transition: all 0.2s;
        }

        .btn-close-selector:hover {
            background: #e74c3c;
            color: white;
            border-color: #e74c3c;
            transform: rotate(90deg);
        }

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

        .tag-option {
            padding: 12px 18px;
            background: white;
            border: 2px solid;
            border-radius: 24px;
            font-size: 14px;
            font-weight: 600;
            cursor: pointer;
            display: flex;
            align-items: center;
            gap: 8px;
            transition: all 0.3s;
            color: #495057;
            box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
        }

        .tag-option:hover {
            transform: translateY(-3px);
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
        }

        .tag-option.tag-selected {
            background: currentColor;
            color: white !important;
            box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
        }

        .tag-option.tag-selected .tag-count {
            background: rgba(255, 255, 255, 0.35);
            color: white;
        }

        .tag-name {
            font-weight: 600;
        }

        .tag-count {
            background: #e9ecef;
            padding: 4px 8px;
            border-radius: 12px;
            font-size: 12px;
            font-weight: 700;
        }

        /* 分頁控制樣式 */
        .pagination {
            display: flex;
            justify-content: center;
            align-items: center;
            gap: 10px;
            margin: 32px 0 16px;
        }

        .pagination-btn {
            padding: 12px 20px;
            background: white;
            border: 2px solid #dee2e6;
            border-radius: 10px;
            color: #495057;
            font-size: 14px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s;
            box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
        }

        .pagination-btn:hover:not(.disabled) {
            background: #B8926A;
            color: white;
            border-color: #B8926A;
            transform: translateY(-2px);
            box-shadow: 0 4px 12px rgba(184, 146, 106, 0.3);
        }

        .pagination-btn.disabled {
            opacity: 0.4;
            cursor: not-allowed;
        }

        .pagination-pages {
            display: flex;
            gap: 6px;
        }

        .pagination-page {
            min-width: 42px;
            height: 42px;
            padding: 0 10px;
            background: white;
            border: 2px solid #dee2e6;
            border-radius: 10px;
            color: #495057;
            font-size: 14px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s;
            display: flex;
            align-items: center;
            justify-content: center;
            box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
        }

        .pagination-page:hover {
            background: #e9ecef;
            border-color: #adb5bd;
            transform: translateY(-2px);
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
        }

        .pagination-page.active {
            background: linear-gradient(135deg, #B8926A 0%, #A67C52 100%);
            border-color: #B8926A;
            color: white;
            box-shadow: 0 4px 12px rgba(184, 146, 106, 0.4);
        }

        .pagination-ellipsis {
            min-width: 42px;
            height: 42px;
            display: flex;
            align-items: center;
            justify-content: center;
            color: #6c757d;
            font-size: 18px;
            font-weight: 700;
        }

        .pagination-info {
            text-align: center;
            font-size: 14px;
            color: #6c757d;
            font-weight: 500;
            margin-bottom: 24px;
        }

        /* 6 位數獨立輸入框樣式 */
        .code-input-group {
            display: flex;
            gap: 8px;
            justify-content: center;
            align-items: center;
        }

        .code-input {
            width: 40px;
            height: 48px;
            text-align: center;
            font-size: 24px;
            font-weight: 700;
            font-family: 'Courier New', monospace;
            border: 2px solid #B8926A;
            border-radius: 8px;
            background: #F9F4ED;
            color: #6B4423;
            transition: all 0.2s;
            text-transform: uppercase;
        }

        .code-input:focus {
            outline: none;
            border-color: #9B7653;
            background: #F5EBD9;
            box-shadow: 0 0 0 3px rgba(184, 146, 106, 0.2);
        }

        .code-input:not(:placeholder-shown) {
            border-color: #8B6F47;
            background: #EDE0CC;
        }

        .code-input::selection {
            background: #B8926A;
            color: white;
        }

        /* 快速加入班級區塊調整 */
        .quick-join-form {
            display: flex;
            flex-direction: column;
            gap: 16px;
            align-items: center;
        }

        @media (max-width: 767px) {
            .code-input {
                width: 36px;
                height: 44px;
                font-size: 20px;
            }

            .code-input-group {
                gap: 6px;
            }
        }

        /* 班級詳情頁籤樣式 */
        .class-tabs {
            display: flex;
            gap: 8px;
            margin: 24px 0 20px;
            border-bottom: 2px solid #e9ecef;
            overflow-x: auto;
        }

        .class-tab {
            padding: 12px 20px;
            font-size: 15px;
            font-weight: 500;
            color: #6c757d;
            cursor: pointer;
            border-bottom: 3px solid transparent;
            transition: all 0.3s;
            white-space: nowrap;
            position: relative;
            top: 2px;
        }

        .class-tab:hover {
            color: #B8926A;
            background: #f8f9fa;
            border-radius: 8px 8px 0 0;
        }

        .class-tab.active {
            color: #B8926A;
            border-bottom-color: #B8926A;
            font-weight: 600;
        }

        .class-tab-content {
            animation: fadeIn 0.3s ease;
        }

        @keyframes fadeIn {
            from {
                opacity: 0;
                transform: translateY(10px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        /* 班級資訊面板 */
        .class-info-panel {
            background: white;
            border-radius: 8px;
            padding: 24px;
            border: 1px solid #e9ecef;
        }

        .info-row {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 16px 0;
            border-bottom: 1px solid #f1f3f5;
        }

        .info-row:last-child {
            border-bottom: none;
        }

        .info-label {
            font-weight: 600;
            color: #495057;
            font-size: 14px;
            min-width: 120px;
        }

        .info-value {
            font-size: 14px;
            color: #6c757d;
            text-align: right;
            flex: 1;
        }

        .code-badge {
            background: #F9F4ED;
            color: #B8926A;
            padding: 6px 12px;
            border-radius: 6px;
            font-weight: 700;
            font-family: 'Courier New', monospace;
            font-size: 16px;
            letter-spacing: 2px;
        }

        /* 同學列表樣式 */
        .student-count {
            font-size: 14px;
            color: #6c757d;
            margin-bottom: 16px;
            font-weight: 500;
        }

        .student-list {
            display: grid;
            gap: 12px;
        }

        .student-item {
            display: flex;
            align-items: center;
            gap: 16px;
            padding: 16px;
            background: white;
            border-radius: 8px;
            border: 1px solid #e9ecef;
            transition: all 0.2s;
        }

        .student-item:hover {
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
            border-color: #B8926A;
        }

        .student-avatar {
            width: 48px;
            height: 48px;
            border-radius: 50%;
            background: linear-gradient(135deg, #C4956C 0%, #D4B896 100%);
            color: white;
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: 700;
            font-size: 18px;
        }

        .student-info {
            flex: 1;
        }

        .student-name {
            font-size: 15px;
            font-weight: 600;
            color: #2c3e50;
            margin-bottom: 4px;
        }

        .student-id {
            font-size: 13px;
            color: #6c757d;
        }

        .student-join-date {
            font-size: 12px;
            color: #adb5bd;
        }

        /* 搜尋建議樣式 */
        .search-suggestions {
            position: absolute;
            top: 100%;
            left: 0;
            right: 0;
            margin-top: 4px;
            background: white;
            border: 1px solid #dee2e6;
            border-radius: 8px;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
            max-height: 400px;
            overflow-y: auto;
            z-index: 1000;
            animation: slideDown 0.2s ease;
        }

        @keyframes slideDown {
            from {
                opacity: 0;
                transform: translateY(-10px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        .suggestion-item {
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 12px 16px;
            cursor: pointer;
            transition: all 0.2s;
            border-bottom: 1px solid #f1f3f5;
        }

        .suggestion-item:last-child {
            border-bottom: none;
        }

        .suggestion-item:hover,
        .suggestion-item.suggestion-selected {
            background: #f8f9fa;
        }

        .suggestion-icon {
            font-size: 24px;
            flex-shrink: 0;
        }

        .suggestion-content {
            flex: 1;
            min-width: 0;
        }

        .suggestion-title {
            font-size: 14px;
            font-weight: 500;
            color: #2c3e50;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .suggestion-meta {
            font-size: 12px;
            color: #6c757d;
            margin-top: 4px;
        }

        .search-highlight {
            background: #fff3cd;
            color: #856404;
            padding: 2px 4px;
            border-radius: 3px;
            font-weight: 600;
        }

        @media (max-width: 767px) {
            .search-suggestions {
                max-height: 300px;
            }

            .suggestion-item {
                padding: 10px 12px;
            }

            .suggestion-title {
                font-size: 13px;
            }

            .suggestion-meta {
                font-size: 11px;
            }
        }

        /* 上傳進度條樣式 */
        .upload-progress-container {
            margin-top: 16px;
            padding: 16px;
            background: #f8f9fa;
            border-radius: 8px;
            border: 1px solid #e9ecef;
        }

        .upload-progress-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 12px;
        }

        .upload-progress-label {
            font-size: 14px;
            font-weight: 600;
            color: #495057;
        }

        .upload-progress-percentage {
            font-size: 16px;
            font-weight: 700;
            color: #B8926A;
        }

        .upload-progress-bar {
            width: 100%;
            height: 24px;
            background: #e9ecef;
            border-radius: 12px;
            overflow: hidden;
            position: relative;
        }

        .upload-progress-fill {
            height: 100%;
            background: linear-gradient(90deg, #B8926A 0%, #2ecc71 100%);
            border-radius: 12px;
            transition: width 0.3s ease;
            position: relative;
            animation: progressShine 2s infinite;
        }

        @keyframes progressShine {
            0% {
                background-position: 0% 50%;
            }
            50% {
                background-position: 100% 50%;
            }
            100% {
                background-position: 0% 50%;
            }
        }

        .upload-progress-info {
            margin-top: 8px;
            font-size: 12px;
            color: #6c757d;
            text-align: center;
        }

        /* 公告樣式 */
        .announcement-section {
            background: #fff3cd;
            border: 2px solid #ffc107;
            border-radius: 8px;
            padding: 20px;
            margin: 24px 0;
        }

        .announcement-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-bottom: 16px;
        }

        .announcement-title {
            font-size: 16px;
            font-weight: 600;
            color: #856404;
        }

        .announcement-list {
            display: flex;
            flex-direction: column;
            gap: 12px;
        }

        .announcement-item {
            background: white;
            border: 1px solid #ffeaa7;
            border-radius: 6px;
            padding: 16px;
            transition: all 0.3s;
        }

        .announcement-item:hover {
            box-shadow: 0 2px 8px rgba(255, 193, 7, 0.2);
            transform: translateY(-1px);
        }

        .announcement-item.announcement-important {
            border-left: 4px solid #dc3545;
            background: #fff5f5;
        }

        .announcement-item-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-bottom: 8px;
            gap: 12px;
        }

        .announcement-item-title {
            font-size: 15px;
            font-weight: 600;
            color: #2c3e50;
            flex: 1;
        }

        .announcement-date {
            font-size: 12px;
            color: #6c757d;
            white-space: nowrap;
        }

        .announcement-content {
            font-size: 14px;
            line-height: 1.6;
            color: #495057;
        }

        @media (max-width: 767px) {
            .announcement-section {
                padding: 16px;
                margin: 16px 0;
            }

            .announcement-item {
                padding: 12px;
            }

            .announcement-item-header {
                flex-direction: column;
                align-items: flex-start;
                gap: 4px;
            }

            .announcement-date {
                font-size: 11px;
            }

            .announcement-content {
                font-size: 13px;
            }
        }

        @media (max-width: 767px) {
            .class-tabs {
                margin: 16px 0;
            }

            .class-tab {
                padding: 10px 16px;
                font-size: 14px;
            }

            .info-row {
                flex-direction: column;
                align-items: flex-start;
                gap: 8px;
            }

            .info-label {
                min-width: unset;
            }

            .info-value {
                text-align: left;
            }

            .student-item {
                flex-wrap: wrap;
            }

            .student-join-date {
                width: 100%;
                text-align: left;
                margin-left: 64px;
            }
        }

        /* 學習儀表板樣式 */
        .dashboard-container {
            display: flex;
            gap: 24px;
            margin-top: 16px;
        }

        .learning-chart-card {
            background: white;
            border-radius: 12px;
            padding: 24px;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
            flex: 1;
        }

        .learning-chart-card h3 {
            font-size: 18px;
            font-weight: 600;
            color: #1f2937;
            margin-bottom: 24px;
            text-align: center;
        }

        .chart-wrapper {
            display: flex;
            justify-content: center;
            align-items: center;
            margin-bottom: 24px;
        }

        .chart-wrapper canvas {
            max-width: 100%;
            height: auto;
        }

        .chart-legend {
            display: flex;
            flex-direction: column;
            gap: 12px;
            padding: 16px;
            background: #f9fafb;
            border-radius: 8px;
        }

        .legend-item {
            display: flex;
            align-items: center;
            gap: 12px;
            font-size: 14px;
        }

        .legend-color {
            width: 16px;
            height: 16px;
            border-radius: 4px;
            flex-shrink: 0;
        }

        .legend-label {
            flex: 1;
            color: #6b7280;
        }

        .legend-value {
            font-weight: 600;
            color: #1f2937;
            min-width: 30px;
            text-align: right;
        }

        /* 成就徽章樣式 */
        .badges-container {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
            gap: 16px;
            margin-top: 16px;
        }

        .badge-card {
            background: white;
            border-radius: 12px;
            padding: 20px;
            text-align: center;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
            transition: all 0.3s ease;
            cursor: pointer;
            position: relative;
        }

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

        .badge-card.locked {
            opacity: 0.5;
            filter: grayscale(80%);
        }

        .badge-card.locked::after {
            content: '🔒';
            position: absolute;
            top: 12px;
            right: 12px;
            font-size: 16px;
        }

        .badge-icon {
            font-size: 48px;
            margin-bottom: 12px;
        }

        .badge-name {
            font-size: 16px;
            font-weight: 600;
            color: #1f2937;
            margin-bottom: 8px;
        }

        .badge-desc {
            font-size: 13px;
            color: #6b7280;
            line-height: 1.5;
        }

        /* 響應式設計 */
        @media (max-width: 1023px) {
            .dashboard-container {
                flex-direction: column;
            }

            .badges-container {
                grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
            }
        }

        @media (max-width: 767px) {
            .learning-chart-card {
                padding: 16px;
            }

            .learning-chart-card h3 {
                font-size: 16px;
                margin-bottom: 16px;
            }

            .chart-wrapper canvas {
                width: 250px !important;
                height: 250px !important;
            }

            .badges-container {
                grid-template-columns: repeat(2, 1fr);
                gap: 12px;
            }

            .badge-card {
                padding: 16px;
            }

            .badge-icon {
                font-size: 40px;
                margin-bottom: 8px;
            }

            .badge-name {
                font-size: 14px;
            }

            .badge-desc {
                font-size: 12px;
            }
        }

        /* 表格樣式 */
        table {
            width: 100%;
            border-collapse: collapse;
            background: white;
            border-radius: 8px;
            overflow: hidden;
            box-shadow: 0 2px 8px rgba(0,0,0,0.08);
        }

        thead {
            background: linear-gradient(135deg, #C4956C 0%, #D4B896 100%);
        }

        th {
            padding: 16px 12px;
            text-align: left;
            font-size: 14px;
            font-weight: 600;
            color: white;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

        tbody tr {
            border-bottom: 1px solid #e9ecef;
            transition: all 0.2s;
        }

        tbody tr:last-child {
            border-bottom: none;
        }

        tbody tr:hover {
            background: #F9F4ED;
        }

        td {
            padding: 16px 12px;
            font-size: 14px;
            color: #495057;
        }

        /* Badge 樣式 */
        .badge {
            display: inline-block;
            padding: 6px 12px;
            border-radius: 8px;
            font-size: 12px;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

        .badge-scratch {
            background: #ffe8e0;
            color: #ff6900;
            border: 2px solid #ff6900;
        }

        .badge-iot {
            background: #F9F4ED;
            color: #A67C52;
            border: 2px solid #A67C52;
        }

        .badge-app {
            background: #e8f5e9;
            color: #4caf50;
            border: 2px solid #4caf50;
        }

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

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

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

        /* 按鈕圖示樣式 */
        .btn-icon {
            background: none;
            border: none;
            font-size: 20px;
            cursor: pointer;
            padding: 8px;
            transition: all 0.2s;
            border-radius: 4px;
        }

        .btn-icon:hover {
            background: #F9F4ED;
            transform: scale(1.2);
        }

        .btn-icon:active {
            transform: scale(1.0);
        }

        @media (max-width: 768px) {
            table {
                font-size: 13px;
            }

            th, td {
                padding: 12px 8px;
            }

            .btn-icon {
                font-size: 18px;
                padding: 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;
        }
