* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg-color: #f5f5f5;
  --header-bg: #1e293b;
  --header-color: white;
  --sidebar-bg: #334155;
  --sidebar-hover: #475569;
  --sidebar-active: #475569;
  --sidebar-border: #475569;
  --submenu-bg: #475569;
  --submenu-hover: #5f7388;
  --submenu-border: #5f7388;
  --content-bg: white;
  --text-color: #333;
  --text-light: #6b7280;
  --divider-color: #e5e7eb;
  --hover-bg: #f3f4f6;
  --box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  --input-border: #d1d5db;
  --input-focus: #3b82f6;
  --required-color: #ef4444;
  --modal-overlay: rgba(0, 0, 0, 0.5);
  --button-color: #3b82f6;
  --button-hover: #2563eb;
  --button-text: white;
  --danger-color: #ef4444;
  --danger-hover: #dc2626;
  --avatar-bg: #3b82f6;
  --avatar-text: white;
  --card-bg: white;
  --success-color: #10b981;
  --success-hover: #0da170; 
  --warning-color: #f59e0b;
  --fcbg-color:#fff;
  --fc-color:#333;
  --fc-header-bg: #f5f5f5;
  --fc-header-color: #333;
  --fc-border-color: #ddd;
  --fc-today-bg: #e0f2ff;
  --fc-event-bg: #007bff;
  --fc-event-color: #fff;
  --time-animate1:2.5s;
}

body.dark-theme {
  --bg-color: #121212;
  --header-bg: #1a1a1a;
  --header-color: #f5f5f5;
  --sidebar-bg: #262626;
  --sidebar-hover: #333333;
  --sidebar-active: #333333;
  --sidebar-border: #333333;
  --submenu-bg: #333333;
  --submenu-hover: #404040;
  --submenu-border: #404040;
  --content-bg: #1e1e1e;
  --text-color: #f5f5f5;
  --text-light: #a0a0a0;
  --divider-color: #333333;
  --hover-bg: #2c2c2c;
  --box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  --input-border: #4b5563;
  --input-focus: #60a5fa;
  --modal-overlay: rgba(0, 0, 0, 0.7);
  --button-color: #3b82f6;
  --button-hover: #2563eb;
  --button-text: white;
  --danger-color: #ef4444;
  --danger-hover: #dc2626;
  --avatar-bg: #2563eb;
  --avatar-text: white;
  --card-bg: #2a2a2a;
  --success-color: #10b981;
  --success-hover: #0da170; 
  --warning-color: #f59e0b;
  --fcbg-color:#1e1e1e;
  --fc-color:#fff;
  --fc-header-bg: #1e1e1e;
  --fc-header-color: #ccc;
  --fc-border-color: #444;
  --fc-today-bg: #333;
  --fc-event-bg: #007bff;
  --fc-event-color: #fff;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-color);
  height: 100vh;
  overflow-x: hidden;
  color: var(--text-color);
  transition: background-color 0.3s ease;
}

.header {
  display: flex;
  align-items: center;
  background-color: var(--header-bg);
  color: var(--header-color);
  padding: 1rem;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 100;
  height: 64px;
  transition: background-color 0.3s ease;
}

.site-title {
  margin-left: 1rem;
  font-size: 1.25rem;
  font-weight: 500;
}

.burger-icon {
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  width: 30px;
  height: 24px;
  cursor: pointer;
}

.burger-icon span {
  display: block;
  height: 3px;
  width: 100%;
  background-color: var(--header-color);
  border-radius: 2px;
  transition: all 0.3s ease;
}

.burger-open .burger-icon span:nth-child(1) {
  transform: translateY(10px) rotate(45deg);
}

.burger-open .burger-icon span:nth-child(2) {
  opacity: 0;
}

.burger-open .burger-icon span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

.container {
  display: flex;
  margin-top: 64px;
  height: calc(100vh - 64px);
}

.sidebar {
  width: 0;
  background-color: var(--sidebar-bg);
  color: var(--header-color);
  overflow-x: hidden;
  transition: width 0.3s ease, background-color 0.3s ease;
  height: 100%;
  overflow-y: auto;
  scrollbar-width: none;       /* Firefox */
  -ms-overflow-style: none;    /* IE 10+ */
}
.sidebar::-webkit-scrollbar {
  display: none;               /* Chrome, Safari */
}
.sidebar.open {
  width: 250px;
}

.menu {
  list-style: none;
}

.menu-item {
  padding: 1rem;
  cursor: pointer;
  transition: background-color 0.2s;
  border-bottom: 1px solid var(--sidebar-border);
  user-select: none;
}

.menu-item:hover {
  background-color: var(--sidebar-hover);
}

.menu-item.active {
  background-color: var(--sidebar-active);
  font-weight: bold;
}

.menu-item.has-submenu {
  position: relative;
}

.menu-item.has-submenu::after {
  content: '\f054';
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  position: absolute;
  right: 1rem;
  transition: transform 0.3s;
}

.menu-item.has-submenu.expanded::after {
  transform: rotate(90deg);
}

.submenu {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out;
  background-color: var(--submenu-bg);
}

.submenu.open {
  max-height: 500px;
}

.submenu-item {
  padding: 0.75rem 1rem 0.75rem 2rem;
  cursor: pointer;
  transition: background-color 0.2s;
  border-bottom: 1px solid var(--submenu-border);
}

.submenu-item:hover, .submenu-item.active {
  background-color: var(--submenu-hover);
}

.main-content {
  flex: 1;
  padding: 2rem;
  overflow-y: auto;
}

.content-area {
  background-color: var(--content-bg);
  border-radius: 8px;
  padding: 2rem;
  box-shadow: var(--box-shadow);
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.user-section {
  margin-left: auto;
  display: flex;
  align-items: center;
}

.theme-toggle {
  font-size: 1.2rem;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 50%;
  transition: background-color 0.2s;
  margin-right: 10px;
}

.theme-toggle:hover {
  background-color: rgba(255, 255, 255, 0.1);
}
#start_button {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
}

#start_img {
  border: none;
  background: none;
  display: block;
}
.user-icon {
  font-size: 1.5rem;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 50%;
  transition: background-color 0.2s;
  position: relative;
  overflow: hidden;
}

.user-icon:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.user-icon.logged-in {
  background-color: transparent;
  color: white;
}

.avatar {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background-color: var(--avatar-bg);
  color: var(--avatar-text);
  font-weight: bold;
}

.user-avatar-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.user-dropdown {
  position: absolute;
  top: 50px;
  right: 0;
  background-color: var(--content-bg);
  border-radius: 8px;
  box-shadow: var(--box-shadow);
  width: 240px;
  display: none;
  z-index: 101;
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.user-dropdown.open {
  display: block;
}

.user-dropdown-header {
  padding: 1rem;
  border-bottom: 1px solid var(--divider-color);
}

.user-name {
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.user-email {
  font-size: 0.875rem;
  color: var(--text-light);
}

.user-dropdown-menu {
  list-style: none;
}

.user-dropdown-item {
  padding: 0.75rem 1rem;
  cursor: pointer;
  transition: background-color 0.2s;
  display: flex;
  align-items: center;
}

.user-dropdown-item i {
  margin-right: 0.75rem;
  width: 20px;
  text-align: center;
  color: var(--text-light);
}

.user-dropdown-item:hover {
  background-color: var(--hover-bg);
}

.user-dropdown-divider {
  height: 1px;
  background-color: var(--divider-color);
  margin: 0.5rem 0;
}

.login-menu {
  padding: 1rem;
}

.line-login-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 0.5rem;
  background-color: #06C755;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  margin-bottom: 0.75rem;
  font-weight: 500;
}
.line-login-button :disabled {
  background-color: #435d4e;
}
.line-icon {
  width: 20px;
  height: 20px;
  margin-right: 8px;
}

.register-button {
  display: block;
  width: 100%;
  padding: 0.5rem;
  text-align: center;
  border-radius: 4px;
  cursor: pointer;
  background-color: var(--content-bg);
  color: #3b82f6;
  border: 1px solid #3b82f6;
  transition: background-color 0.3s ease;
}

.login-divider {
  display: flex;
  align-items: center;
  margin: 1rem 0;
  text-align: center;
  color: var(--text-light);
}

.login-divider::before,
.login-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background-color: var(--divider-color);
}

.login-divider span {
  padding: 0 0.5rem;
  font-size: 0.875rem;
}

.profile-form {
  max-width: 800px;
  margin: 0 auto;
}

.form-group {
  margin-bottom: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
}

.form-label {
  flex: 0 0 150px;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.form-required::after {
  content: '*';
  color: var(--required-color);
  margin-left: 4px;
}

.form-input {
  flex: 1;
  min-width: 250px;
  padding: 0.75rem;
  border: 1px solid var(--input-border);
  border-radius: 4px;
  background-color: var(--content-bg);
  color: var(--text-color);
  transition: border-color 0.2s ease;
}
.form-input2 {
  flex: 1;
  min-width: 190px;
  padding: 0.75rem;
  border: 1px solid var(--input-border);
  border-radius: 4px;
  background-color: var(--content-bg);
  color: var(--text-color);
  transition: border-color 0.2s ease;
}
.form-input3 {
  flex: 1;
  min-width: 100px;
  padding: 0.75rem;
  border: 1px solid var(--input-border);
  border-radius: 4px;
  background-color: var(--content-bg);
  color: var(--text-color);
  transition: border-color 0.2s ease;
}

.form-input:focus {
  outline: none;
  border-color: var(--input-focus);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.25);
}

.form-input[readonly] {
  background-color: var(--hover-bg);
  cursor: not-allowed;
}

.form-select {
  flex: 1;
  min-width: 250px;
  padding: 0.75rem;
  border: 1px solid var(--input-border);
  border-radius: 4px;
  background-color: var(--content-bg);
  color: var(--text-color);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%236b7280'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 1em;
}
.form-select2 {
  flex: 1;
  min-width: 190px;
  padding: 0.75rem;
  border: 1px solid var(--input-border);
  border-radius: 4px;
  background-color: var(--content-bg);
  color: var(--text-color);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%236b7280'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 1em;
}
.form-select3 {
  flex: 1;
  min-width: 100px;
  padding: 0.75rem;
  border: 1px solid var(--input-border);
  border-radius: 4px;
  background-color: var(--content-bg);
  color: var(--text-color);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%236b7280'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 1em;
}
.form-select:focus {
  outline: none;
  border-color: var(--input-focus);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.25);
}

.region-selects {
  display: flex;
  gap: 0.5rem;
  flex: 1;
  min-width: 250px;
  flex-direction: column;
}

.region-select-row {
  display: flex;
  gap: 0.5rem;
  width: 100%;
}

.region-select {
  flex: 1;
  padding: 0.75rem;
  border: 1px solid var(--input-border);
  border-radius: 4px;
  background-color: var(--content-bg);
  color: var(--text-color);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%236b7280'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 1em;
}

.region-select:focus {
  outline: none;
  border-color: var(--input-focus);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.25);
}

.form-info {
  width: 100%;
  margin-top: 0.5rem;
  margin-left: 150px;
  font-size: 0.875rem;
  color: var(--text-light);
}

.form-actions {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--divider-color);
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
}

.btn {
  padding: 0.75rem 1.5rem;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 500;
  transition: background-color 0.2s ease;
}

.btn-primary {
  background-color: var(--button-color);
  color: var(--button-text);
  border: none;
}

.btn-primary:hover {
  background-color: var(--button-hover);
}

.btn-success {
  background-color: var(--success-color);
  color: var(--button-text);
  border: none;
}

.btn-success:hover {
  background-color: var(--success-hover);
}

.btn-secondary {
  background-color: var(--hover-bg);
  color: var(--text-color);
  border: 1px solid var(--input-border);
}

.btn-secondary:hover {
  background-color: var(--divider-color);
}

.btn-danger {
  background-color: var(--danger-color);
  color: white;
  border: none;
}

.btn-danger:hover {
  background-color: var(--danger-hover);
}
.btn-warning {
  background-color: #ffc107;
  color: #212529;
  border: none;
  padding: 8px 16px;
  font-size: 1rem;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.btn-warning:hover {
  background-color: #e0a800;
}

.login-message {
  text-align: center;
  padding: 2rem;
  background-color: var(--hover-bg);
  border-radius: 8px;
  margin: 2rem 0;
}

.login-message i {
  font-size: 3rem;
  color: var(--text-light);
  margin-bottom: 1rem;
}

.login-message h3 {
  margin-bottom: 1rem;
}

.login-message p {
  color: var(--text-light);
  margin-bottom: 1.5rem;
}

.student-field {
  display: none;
}
.image-list {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-top: 20px;
}
.image-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 140px;
}

.image-item img {
  width: 100px;
  height: 100px;
  object-fit: contain;
  border: 1px solid #ccc;
}

.image-item span {
  margin-top: 5px;
  word-break: break-word;
  font-size: 12px;
  text-align: center;
}

.button-row {
  display: flex;
  gap: 6px;
  margin-top: 5px;
}

.button-row .btn {
  padding: 4px 8px;
  font-size: 12px;
  width: 48px;
}
.preview-container {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-top: 20px;
}
.preview-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 14px;
  width: 120px;
}
.preview-box img {
  width: 100px;
  height: 100px;
  border: 1px solid #ccc;
  object-fit: contain;
}
.progress-bar {
  width: 100px;
  height: 8px;
  background: #eee;
  margin-top: 5px;
  position: relative;
  border-radius: 4px;
  overflow: hidden;
}
.progress-bar-inner {
  height: 100%;
  background: #4caf50;
  width: 0%;
}
.speechtotext-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--modal-overlay);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  opacity: 0;
  transition: opacity 0.3s ease;  
}
.speechtotext-modal.open {
  display: flex;
  opacity: 1;
}
.login-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--modal-overlay);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.login-modal.open {
  display: flex;
  opacity: 1;
}

.login-panel {
  background-color: var(--content-bg);
  border-radius: 8px;
  width: 90%;
  max-width: 400px;
  box-shadow: var(--box-shadow);
  animation: modalFadeIn 0.3s;
  transition: background-color 0.3s ease;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: translateY(-50px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.login-panel-header {
  padding: 1.25rem;
  border-bottom: 1px solid var(--divider-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.login-panel-header h3 {
  margin: 0;
  font-size: 1.25rem;
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 12px; /* 控制 mic 與 close 的間距 */
}
.close-modal {
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
  transition: color 0.2s;
}

.close-modal:hover {
  color: var(--input-focus);
}

.login-panel-body {
  padding: 1.5rem;
}

.user-image-area {
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.profile-media-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2rem;
  align-items: center;
  width: 100%;
  margin-bottom: 1rem;
}

.user-image-container {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--input-border);
  position: relative;
  background-color: var(--avatar-bg);
  color: var(--avatar-text);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
  font-weight: bold;
}

.user-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s;
}

.user-image-container:hover .image-overlay {
  opacity: 1;
}

.image-actions {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
}

.image-action-btn {
  padding: 0.5rem 1rem;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 500;
  font-size: 0.875rem;
  transition: background-color 0.2s ease;
}

.upload-btn {
  background-color: var(--button-color);
  color: white;
  border: none;
  display: inline-flex;
  align-items: center;
}

.upload-btn:hover {
  background-color: var(--button-hover);
}

.delete-btn {
  background-color: var(--danger-color);
  color: white;
  border: none;
  display: inline-flex;
  align-items: center;
}

.delete-btn:hover {
  background-color: var(--danger-hover);
}

.upload-btn i, .delete-btn i {
  margin-right: 0.5rem;
}

.file-input {
  display: none;
}

.school-select-container {
  margin-top: 0.5rem;
  width: 100%;
}

.teacher-section {
  margin: 2rem 0;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 2rem;
  background-color: var(--hover-bg);
  border-radius: 8px;
  padding: 1.5rem;
}

.filter-group {
  flex: 1;
  min-width: 250px;
}
.filter-group-full {
  flex: 0 0 100%;
}
.filter-label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.filter-select {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--input-border);
  border-radius: 4px;
  background-color: var(--content-bg);
  color: var(--text-color);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%236b7280'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 1em;
}

.filter-select:focus {
  outline: none;
  border-color: var(--input-focus);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.25);
}

.filter-actions {
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
}
/*.action-bar {
  display: flex;
  align-items: flex-end;
  gap: 0.5rem; 
}*/
.action-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
  align-items: center;
}
.search-box {
  display: flex;
  flex: 1;
  min-width: 200px;
  position: relative;
}

.search-box input {
  width: 100%;
  padding: 0.75rem;
  padding-right: 40px;
  border: 1px solid var(--input-border);
  border-radius: 4px;
  background-color: var(--content-bg);
  color: var(--text-color);
}

.search-box button {
  position: absolute;
  right: 0;
  top: 0;
  height: 100%;
  width: 40px;
  border: none;
  background: none;
  color: var(--text-light);
  cursor: pointer;
}
/*.action-bar button.btn-primary,
.action-bar button.btn-secondary {
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  
}*/
.scrollable-container {
  width: 100%;
  /*max-width: 400px;*/
  max-height: calc(40px * 10); /* 每列高度40px，最多顯示10列 */
  overflow-y: auto;
  /*border: 1px solid #ccc;*/
  border-radius: 8px;
  /*font-family: sans-serif;*/
  
  border-collapse: collapse;
  margin-top: 1rem;
  background-color: var(--content-bg);
  box-shadow: var(--box-shadow);
  scrollbar-color: auto;
}

.grid-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 4fr 1fr 1fr; /* 三欄等寬 */
  padding: 8px;
  border-bottom: 1px solid var(--hover-bg);
  height: 40px;
  align-items: center;
}

.grid-cell {
  padding: 5px;
  text-align: left;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.grid-row:hover {
  /*background-color: #f5f5f5;*/
  background-color: var(--hover-bg);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
  background-color: var(--content-bg);
  box-shadow: var(--box-shadow);
  border-radius: 8px;
  overflow: hidden;
}

.data-table th, .data-table td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid var(--divider-color);
}

.data-table th {
  background-color: var(--hover-bg);
  font-weight: 600;
  color: var(--text-color);
}

.data-table tbody tr:hover {
  background-color: var(--hover-bg);
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

.card-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.card {
  background-color: var(--card-bg);
  border-radius: 8px;
  box-shadow: var(--box-shadow);
  padding: 1.5rem;
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  cursor: pointer;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.card-icon {
  font-size: 2.5rem;
  color: var(--button-color);
  margin-bottom: 1rem;
}

.card-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.card-description {
  color: var(--text-light);
  font-size: 0.875rem;
}

.status {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 500;
}

.status.active {
  background-color: rgba(16, 185, 129, 0.2);
  color: var(--success-color);
}

.status.draft {
  background-color: rgba(245, 158, 11, 0.2);
  color: var(--warning-color);
}

.status.completed {
  background-color: rgba(59, 130, 246, 0.2);
  color: var(--button-color);
}

.feature-unavailable-message {
  text-align: center;
  padding: 2rem 1rem;
}

.feature-unavailable-message i {
  font-size: 3rem;
  color: var(--warning-color);
  margin-bottom: 1rem;
}

.feature-unavailable-message p {
  font-size: 1.25rem;
  margin-bottom: 1.5rem;
}

.table-responsive {
  overflow-x: auto;
  margin-top: 1.5rem;
}

.student-profile {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.student-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--avatar-bg);
  color: var(--avatar-text);
  font-weight: bold;
}

.progress-bar-container {
  width: 100%;
  height: 8px;
  background-color: var(--hover-bg);
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background-color: var(--button-color);
}

.grades-summary {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

.grade-box {
  flex: 1;
  min-width: 120px;
  background-color: var(--card-bg);
  border-radius: 8px;
  box-shadow: var(--box-shadow);
  padding: 1rem;
  text-align: center;
}

.grade-value {
  font-size: 2rem;
  font-weight: bold;
  margin-bottom: 0.5rem;
}

.grade-label {
  font-size: 0.875rem;
  color: var(--text-light);
}

.teacher-school-container {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  min-width: 250px;
}

.teacher-class-container {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  min-width: 250px;
  margin-top: 0.5rem;
}

.add-school-btn, .add-class-btn,.add-question-btn {
  white-space: nowrap;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.add-school-btn i, .add-class-btn,.add-question-btn i {
  font-size: 0.875rem;
}

.delete-school-btn, .delete-class-btn {
  white-space: nowrap;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background-color: var(--danger-color);
  color: white;
  border: none;
  border-radius: 4px;
  padding: 0.75rem 1rem;
  cursor: pointer;
  font-weight: 500;
  transition: background-color 0.2s ease;
}

.delete-school-btn:hover, .delete-class-btn:hover {
  background-color: var(--danger-hover);
}

.delete-school-btn i, .delete-class-btn i {
  font-size: 0.875rem;
}

.modal-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.modal-form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.modal-form-label {
  font-weight: 500;
}
.paper-score,
.modal-form-input,
.modal-form-select {
  padding: 0.75rem;
  border: 1px solid var(--input-border);
  border-radius: 4px;
  background-color: var(--content-bg);
  color: var(--text-color);
}
.paper-score {
  width:100%;
  max-width: 50px;
}
.modal-form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%236b7280'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 1em;
}

.modal-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 1rem;
}

.modal-region-selects {
  display: flex;
  gap: 0.5rem;
}

.modal-region-select {
  flex: 1;
}

.confirmation-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--modal-overlay);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.confirmation-modal.open {
  display: flex;
  opacity: 1;
}

.confirmation-panel {
  background-color: var(--content-bg);
  border-radius: 8px;
  width: 90%;
  max-width: 400px;
  box-shadow: var(--box-shadow);
  animation: modalFadeIn 0.3s;
  transition: background-color 0.3s ease;
}

.confirmation-panel-header {
  padding: 1.25rem;
  border-bottom: 1px solid var(--divider-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.confirmation-panel-header h3 {
  margin: 0;
  font-size: 1.25rem;
}

.confirmation-panel-body {
  padding: 1.5rem;
}

.confirmation-message {
  margin-bottom: 1.5rem;
  text-align: center;
}

.confirmation-message i {
  font-size: 3rem;
  color: var(--warning-color);
  margin-bottom: 1rem;
  display: block;
}

.confirmation-actions {
  display: flex;
  justify-content: center;
  gap: 1rem;
}

.teacher-qrcode-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 1rem;
  border: 1px solid var(--divider-color);
  border-radius: 8px;
  background-color: var(--content-bg);
  box-shadow: var(--box-shadow);
  max-width: 200px;
}

.qrcode-title {
  font-size: 1rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

#teacher-qrcode {
  width: 150px;
  height: 150px;
  margin: 0 auto 0.5rem;
}

.qrcode-info {
  font-size: 0.75rem;
  color: var(--text-light);
  margin-top: 0.5rem;
  max-width: 150px;
}

.class-input {
  flex: 1;
  min-width: 100px;
  padding: 0.75rem;
  border: 1px solid var(--input-border);
  border-radius: 4px;
  background-color: var(--content-bg);
  color: var(--text-color);
  transition: border-color 0.2s ease;
}

.class-input:focus {
  outline: none;
  border-color: var(--input-focus);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.25);
}

.class-select {
  flex: 2;
  min-width: 200px;
  margin-left: 0.5rem;
  padding: 0.75rem;
  border: 1px solid var(--input-border);
  border-radius: 4px;
  background-color: var(--content-bg);
  color: var(--text-color);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%236b7280'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 1em;
}

.class-select:focus {
  outline: none;
  border-color: var(--input-focus);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.25);
}

.grade-select {
  min-width: 100px;
  padding: 0.75rem;
  border: 1px solid var(--input-border);
  border-radius: 4px;
  background-color: var(--content-bg);
  color: var(--text-color);
  margin-right: 0.5rem;
}

.grade-select:focus {
  outline: none;
  border-color: var(--input-focus);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.25);
}
.choice-select {
  min-width: 100px;
  padding: 0.75rem;
  border: 1px solid var(--input-border);
  border-radius: 4px;
  background-color: var(--content-bg);
  color: var(--text-color);
  margin-right: 0.5rem;
}

.choice-select:focus {
  outline: none;
  border-color: var(--input-focus);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.25);
}
.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

.teacher-field {
  display: none;
}

.teacher-subject-container {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  min-width: 250px;
}

.subject-select {
  flex: 1;
  padding: 0.75rem;
  border: 1px solid var(--input-border);
  border-radius: 4px;
  background-color: var(--content-bg);
  color: var(--text-color);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%236b7280'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 1em;
}

.subject-select:focus {
  outline: none;
  border-color: var(--input-focus);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.25);
}

.policy-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--modal-overlay);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.policy-modal.open {
  display: flex;
  opacity: 1;
}

.policy-panel {
  background-color: var(--content-bg);
  border-radius: 8px;
  width: 90%;
  max-width: 600px;
  box-shadow: var(--box-shadow);
  animation: modalFadeIn 0.3s;
  transition: background-color 0.3s ease;
}

.policy-text {
  padding: 1.5rem;
  background-color: var(--hover-bg);
  border-radius: 4px;
  margin-bottom: 1.5rem;
  max-height: 300px;
  overflow-y: auto;
  white-space: pre-wrap;
  line-height: 1.6;
}

.policy-checkbox {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.policy-checkbox input[type="checkbox"] {
  width: 20px;
  height: 20px;
  cursor: pointer;
}

.policy-checkbox label {
  cursor: pointer;
  user-select: none;
}
.cloud-image-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--modal-overlay);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1001;
  opacity: 1;
}

#cloud-image-panel {
  background-color: var(--content-bg);
  width: 80vw;
  max-width: 900px;
  max-height: 90vh;
  overflow-y: auto;
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: var(--box-shadow);
}

#cloud-image-list {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-top: 20px;
  max-height: 70vh;
  overflow-y: scroll; /* 仍然可以滾動 */
  padding-right: 10px;
  scrollbar-width: none; /* Firefox 隱藏 */
  -ms-overflow-style: none;  /* IE/Edge 隱藏 */
}

#cloud-image-list::-webkit-scrollbar {
  display: none; /* Chrome/Safari 隱藏 */
}

#cloud-image-list img {
  width: 100px;
  height: 100px;
  object-fit: contain;
  border: 1px solid #ccc;
  cursor: pointer;
}
.match-item-header-action {
  margin-bottom: 0; /* 取消下方間距 */
}

#questionMatch_data {
  margin-top: 0 !important; /* 強制取消上方間距 */
}

.no-gap {
  padding-top: 0;
}
.matchitem-scrollable-container {
  max-height: 300px;
  overflow-y: auto;
  padding: 10px;
  border: 1px solid #444;
}

.matchitem-grid-row {
  display: flex;
  border-bottom: 1px solid #333;
}

.matchitem-grid-cell {
  flex: 1;
  padding: 6px 8px;
  color: #fff;
  border-right: 1px solid #444;
}


.chapter-management {
  max-width: 800px;
  margin: 0 auto;
}
/* 包裹整列區塊 */
.chapter-management div:first-child {
  display: flex;
  
  gap: 8px;
  margin-bottom: 10px;
  font-size: 16px;
  color: #eee;
}

/* 自訂 checkbox 風格 */
#filename_check {
  width: 18px;
  height: 18px;
  accent-color: #4CAF50; /* 綠色勾選框 */
  cursor: pointer;
}

/* 文字 hover 互動感 
.chapter-management div:first-child:hover {
  color: #4CAF50;
  transition: color 0.3s;
}*/
.chapter-input-group {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  align-items: flex-start;
}

.chapter-buttons {
  display: flex;
  gap: 0.5rem;
}
#add-question-modal .modal-form-group {
  margin-bottom: 1.5rem;
}

#add-question-modal .modal-form-label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

#add-question-modal .modal-form-select {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--input-border);
  border-radius: 4px;
  background-color: var(--content-bg);
  color: var(--text-color);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%236b7280'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 1em;
}

#add-question-modal .modal-form-select:focus {
  outline: none;
  border-color: var(--input-focus);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.25);
}

.modal-form-textarea {
  width: 100%;
  min-height: 150px;
  padding: 0.75rem;
  border: 1px solid var(--input-border);
  border-radius: 4px;
  background-color: var(--content-bg);
  color: var(--text-color);
  resize: vertical;
  font-family: inherit;
  line-height: 1.5;
}
.image-match-container {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  align-items: center;
}
.image-match-container select {
   flex: 1;
  min-width: 0;
  max-width: 100%;
  width: 100%;
  /*min-width: 200px; /* 或依需要調整 */
}
.image-upload-container {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  width: 100%;
  flex-wrap: wrap;
}

.uploaded-choiceimages-select {
  flex: 1;
  min-width: 0;
  max-width: 100%;
  width: 100%;
}

#uploaded-images-select {
  flex: 1;
  min-width: 0;
  max-width: 100%;
  width: 100%;
}

.image-upload-container .btn {
  white-space: nowrap;
}

/*#question-detail-modal .login-panel {
  width: 60vw;
  max-width: 800px;
  min-width: 320px;
}*/

#question-detail-modal .modal-form-group {
  width: 100%;
}

#question-detail-modal .modal-form-input,
#question-detail-modal .modal-form-select,
#question-detail-modal .modal-form-textarea {
  width: 100%;
  max-width: 100%;
}

#question-edit-modal .modal-form-group {
  width: 100%;
}

#question-edit-modal .modal-form-input,
#question-edit-modal .modal-form-select,
#question-edit-modal .modal-form-textarea {
  width: 100%;
  max-width: 100%;
}
/*#question-detail-modal .login-panel {
  width: 90vw;
  margin: 1rem;
  max-height: 90vh;
  overflow-y: auto;
}*/
/*#question-detail-modal .login-panel {
  width: 60vw;
  max-width: 800px;
  min-width: 320px;
  overflow-y: scroll;
  scrollbar-width: none; /* Firefox */
/*  -ms-overflow-style: none;  /* Internet Explorer 10+ */
/*}

#question-detail-modal .login-panel::-webkit-scrollbar {
  display: none;
}*/
#question-detail-modal .login-panel {
  width: 60vw;
  max-width: 800px;
  min-width: 320px;
  max-height: 90vh;
  overflow-y: auto;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none;  /* Internet Explorer 10+ */
}

#question-detail-modal .login-panel::-webkit-scrollbar {
  display: none;
}

#question-edit-modal .login-panel {
  width: 60vw;
  max-width: 800px;
  min-width: 320px;
  max-height: 90vh;
  overflow-y: auto;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none;  /* Internet Explorer 10+ */
}

#modal .login-panel::-webkit-scrollbar {
  display: none;
}

.pagination, .pagination1 {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  margin-top: 2rem;
}

.pagination-btn {
  padding: 0.5rem 1rem;
  border: 1px solid var(--input-border);
  background-color: var(--content-bg);
  color: var(--text-color);
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.pagination-btn:hover:not(:disabled) {
  background-color: var(--hover-bg);
}

.pagination-btn.active {
  background-color: var(--button-color);
  color: white;
  border-color: var(--button-color);
}

.pagination-btn:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.pagination-info {
  color: var(--text-light);
  font-size: 0.875rem;
  margin: 0 1rem;
}

@media (max-width: 768px) {
  .sidebar.open {
    position: fixed;
    z-index: 99;
    height: calc(100vh - 64px);
  }
  
  .main-content {
    width: 100%;
  }
  
  .form-group {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .form-label {
    flex: 0 0 100%;
    margin-bottom: 0.5rem;
  }

  .form-input, .form-select, .region-selects {
    width: 100%;
  }
  
  .form-info {
    margin-left: 0;
  }
  
  .region-select-row {
    flex-direction: column;
  }
  
  .image-actions {
    flex-direction: column;
    width: 100%;
  }
  
  .image-action-btn {
    width: 100%;
  }
  
  .user-image-container {
    width: 120px;
    height: 120px;
  }
  
  .filter-bar {
    flex-direction: column;
  }
  
  .card-container {
    grid-template-columns: 1fr;
  }
  
  .teacher-school-container, .teacher-class-container {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .add-school-btn, .delete-school-btn, .add-class-btn, .delete-class-btn,.add-question-btn {
    margin-top: 0.5rem;
    width: 100%;
  }
  
  .modal-region-selects {
    flex-direction: column;
  }
  
  .profile-media-container {
    flex-direction: column;
    gap: 1.5rem;
  }
  
  .teacher-qrcode-container {
    margin-top: 1.5rem;
  }

  .class-input, .class-select {
    width: 100%;
    margin-left: 0;
  }

  .teacher-class-container {
    flex-direction: column;
  }

  .class-buttons {
    width: 100%;
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
  }

  .add-class-btn, .delete-class-btn,.add-question-btn {
    flex: 1;
  }
  
  .teacher-subject-container {
    flex-direction: column;
  }
  
  .subject-select {
    width: 100%;
  }
  .choice-select {
    width: 45%;
  }
  .chapter-input-group {
    flex-direction: column;
  }
  
  .chapter-buttons {
    width: 100%;
  }
  
  .chapter-buttons .btn {
    flex: 1;
  }

  /*#question-detail-modal .login-panel {
    width: 80vw;
    margin: 1rem;
    max-height: 90vh;
    overflow-y: auto;
  }*/
  #question-detail-modal .login-panel {
    width: 90vw;
    margin: 1rem;
    max-height: 90vh;
    overflow-y: auto;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none;  /* Internet Explorer 10+ */
  }
  
  #question-detail-modal .login-panel::-webkit-scrollbar {
    display: none;
  }

  #question-edit-modal .login-panel {
    width: 90vw;
    margin: 1rem;
    max-height: 90vh;
    overflow-y: auto;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none;  /* Internet Explorer 10+ */
  }
  
  #question-edit-modal .login-panel::-webkit-scrollbar {
    display: none;
  }

/*  #question-detail-modal .login-panel {
    width: 90vw;
    margin: 1rem;
    max-height: 90vh;
    overflow-y: scroll;
    scrollbar-width: none; /* Firefox */
/*    -ms-overflow-style: none;  /* Internet Explorer 10+ */
/*  }

  #question-detail-modal .login-panel::-webkit-scrollbar {
    display: none;
  }*/
  .image-upload-container {
    flex-direction: column;
    gap: 1rem;
  }

  .image-upload-container .btn,
  .image-upload-container .modal-form-select {
    width: 100%;
  }

  #uploaded-images-select {
    width: 100%;
  }

  .uploaded-choiceimages-select {
    width: 100%;
  }
}
.matchitem-wide-panel {
  width: 80vw !important;
  max-width: 600px !important;
  padding: 2rem !important;
  box-sizing: border-box !important;
  max-height: 90vh;
  overflow-y: auto;
  padding: 1.5rem;

  /* ✅ 隱藏滾動條（支援 Chrome, Safari） */
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE 10+ */
}
.matchitem-wide-panel::-webkit-scrollbar {
  display: none; /* Chrome, Safari */
}

.form-group1 {
  margin-bottom: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 8px;
  width: 100%;
}

.form-label1 {
  flex: 0 0 150px;
  font-weight: 500;
  margin-bottom: 4px;
  display: block;
}
.dropdown-select{
  flex: 1;
  border: 1px solid var(--input-border);
  background-color: var(--content-bg);
  color: var(--text-color);
    width: 100%;
    padding: 10px;
    margin: 5px 0;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
}
.form-select1 {
  flex: 1;
  min-width: 250px;
  padding: 0.75rem;
  border: 1px solid var(--input-border);
  border-radius: 4px;
  background-color: var(--content-bg);
  color: var(--text-color);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%236b7280'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 1em;
}

.form-select1:focus {
  outline: none;
  border-color: var(--input-focus);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.25);
}
.modal {
  position: fixed;
  z-index: 1050;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0,0,0,0.4);
}

.modal-dialog {
  margin: 100px auto;
  max-width: 400px;
  background: white;
  border-radius: 8px;
}

.modal-header, .modal-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.fc {
  background-color: var(--fcbg-color);
  color: var(--fc-color);
  /*background-color: #1e1e1e;
  color: #ffffff;*/
}

/* 標題 */
.fc-toolbar-title {
  color: var(--fc-header-color);
  /*color: #ffffff;*/
}

/* 表格邊框線 */
.fc-theme-standard .fc-scrollgrid {
  border-color: var(--fc-border-color);
  /*border-color: #444;*/
}

/* 每格邊框線 */
.fc-theme-standard td, 
.fc-theme-standard th {
  border-color: var(--fc-border-color);
  /*border-color: #444;*/
}

/* 事件區塊 */
.fc-event {
  background-color: var(--fc-event-bg);
  color: var(--fc-event-color);
  border: 1px solid #ccc; 
  cursor: pointer; 
  /*background-color: #007bff;
  color: var(--fc-event-color);
  color: #fff;
  border: none;*/
}

/* 今天底色 */
.fc-day-today {
  background-color: var(--fc-today-bg) !important;
  border: 1px solid #ccc;
  /*background-color: #333 !important;*/
}
/* 每日格子背景改深色 */
.fc-daygrid-day-frame {
  background-color: var(--fcbg-color);
  /*background-color: #1e1e1e;*/
}

/* 每日數字文字顏色 */
.fc-daygrid-day-number {
  color: var(--fc-color);
  /*color: #bbb;*/
}
/* 修正 top toolbar 白底 */
.fc-header-toolbar,
.fc-toolbar,
.fc-toolbar-chunk {
  background-color: var(--fc-header-bg) !important;
  border-color: var(--fc-border-color);
  /*background-color: #1e1e1e !important;
  border-color: #444;*/
}

/* 修正 today 按鈕背景色 */
.fc-button {
  background-color: var(--fc-border-color);
  color: var(--fc-color);
  border: none;
  /*background-color: #444;
  color: #fff;
  border: none;*/
}

/* 被點選的按鈕（如月、週、清單） */
.fc-button-active {
  background-color: #666;
  color: #fff;  
  /*background-color: #666;
  color: #fff;*/
}
/* 標題上方的星期欄背景（ex. 週日、週一...） */
.fc-col-header,
.fc-scrollgrid-section-header,
.fc-col-header-cell {
  background-color: var(--fc-header-bg) !important;
  color: var(--fc-header-color);
  border-color: var(--fc-border-color);  
  /*background-color: #1e1e1e !important;
  color: #ccc;
  border-color: #444;*/
}
/* FullCalendar 外層整體 */
body,
html,
.fc,
.fc * {
  /*background-color: #1e1e1e !important;
  color: #fff;*/
  background-color: var(--fcbg-color)!important;
  color: var(--fc-color);

}
.form-check-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 16px;
  color:var(--text-color);
}
.form-check-input {
  width: 18px;
  height: 18px;
}
.media-box {
  display: inline-block;
  background: #111;
  color: white;
  border: 1px solid #444;
  border-radius: 6px;
  padding: 10px;
  margin: 10px;
  width: 240px;
  text-align: center;
  vertical-align: top;
}

.media-preview {
  max-width: 100%;
  max-height: 150px;
  margin-bottom: 8px;
  object-fit: contain;
}

.media-audio {
  width: 100%;
  margin-bottom: 8px;
}

.media-icon {
  height: 150px;
  background: #333;
  color: #ccc;
  font-size: 14px;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 8px;
  border-radius: 4px;
}

.media-filename {
  font-size: 14px;
  margin-bottom: 6px;
  word-break: break-all;
}

.media-buttons {
  display: flex;
  justify-content: space-between;
  gap: 4px;
  margin-top: 8px;
  padding: 0 5%;
}

.media-buttons .btn {
  flex: 1;                      /* 平均分配寬度 */
  padding: 6px 0;               /* 上下 padding 加大，左右縮窄 */
  font-size: 14px;
  border-radius: 4px;
  min-width: 0;                 /* 防止文字溢出導致按鈕爆寬 */
  text-align: center;
}
.cheer-gif-container {
  margin-top: 1.5rem;
  display: flex;
  justify-content: center;
}

.cheer-gif {
  max-width: 300px;
  width: 80%;
  border-radius: 12px;
  box-shadow: 0 0 15px rgba(255, 255, 255, 0.3);
  animation: pop-in 0.6s ease-in-out;
}

@keyframes pop-in {
  0% {
    transform: scale(0.6);
    opacity: 0;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}
.Sub_Title {
  margin-bottom: 1rem;
}
.search-row {
  display: flex;
  align-items: center;
  flex: 1;
  max-width: 400px;
}

.search-row .form-input {
  flex: 1;
  border-radius: 4px 0 0 4px;
}

.search-row .search-btn {
  width: 40px;
  height: 100%;
  /*border: 1px solid var(--input-border);*/
  border: none;
  border-left: none;
  /*background-color: var(--btn-bg, #444);*/
  background: none;
  color: var(--text-light);
  /*border-radius: 0 4px 4px 0;*/
  cursor: pointer;
}
.class_label {
   color: var(--text-color);
}
.form-textarea {
  flex: 1;
  min-width: 250px;
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--input-border);
  border-radius: 4px;
  background-color: var(--content-bg);
  color: var(--text-color);
  resize: vertical;
  font-family: inherit;
  line-height: 1.5;
  transition: border-color 0.2s ease;
}

.form-textarea:focus {
  outline: none;
  border-color: var(--input-focus);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.25);
}
.form-shortselect {
  flex: 1;
  min-width: 80px;
  padding: 0.75rem;
  border: 1px solid var(--input-border);
  border-radius: 4px;
  background-color: var(--content-bg);
  color: var(--text-color);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%236b7280'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 1em;
}

.form-shortselect:focus {
  outline: none;
  border-color: var(--input-focus);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.25);
}
.form-shortinput {
  flex: 1;
  min-width: 80px;
  padding: 0.75rem;
  border: 1px solid var(--input-border);
  border-radius: 4px;
  background-color: var(--content-bg);
  color: var(--text-color);
  transition: border-color 0.2s ease;
}

.form-shortinput:focus {
  outline: none;
  border-color: var(--input-focus);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.25);
}
.form-groupA {
  width: 100%;
  margin-bottom: 1rem;
}

.form-inputA, 
.form-selectA {
  flex: 1;
  min-width: 150px;
  max-width: 100%;
  box-sizing: border-box;
  padding: 0.75rem;
  border: 1px solid var(--input-border);
  border-radius: 4px;
  background-color: var(--content-bg);
  color: var(--text-color);
}
.form-inputB, 
.form-selectB {
  flex: 1;
  min-width: 60px;
  max-width: 100%;
  box-sizing: border-box;
  padding: 0.75rem;
  border: 1px solid var(--input-border);
  border-radius: 4px;
  background-color: var(--content-bg);
  color: var(--text-color);
}
.input-row {
  display: flex;
  flex-wrap: wrap; /* ✅ 加入這行：讓內容換行 */
  width: 100%;
  gap: 1rem;
  margin-top: 0.5rem;
}



#add-congratulation-btn {
  white-space: nowrap;
  flex-shrink: 0;
}
.emoji_class{
  min-width: 250px;
  padding: 0.75rem;
  border: 1px solid var(--input-border);
  border-radius: 4px;
  background-color: var(--content-bg);
  color: var(--text-color);
}
  .confetti-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
  }
  .confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    background-color: #ffd700;
    opacity: 0.8;
    animation: confetti-fall 3s linear infinite;
  }
  
  @keyframes confetti-fall {
    0% {
      transform: translateY(-100%) rotate(0deg);
      opacity: 1;
    }
    100% {
      transform: translateY(1000%) rotate(720deg);
      opacity: 0;
    }
  }
.emoji-rain-happy {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: hidden;
  z-index: 2;
}
.emoji-burst {
  position: absolute;
  font-size: 2rem;
  animation: burstFly var(--time-animate2) ease-out forwards;
  user-select: none;
  opacity: 0.95;
}

@keyframes burstFly {
  0% {
    transform: scale(0.5) translate(0, 0);
    opacity: 1;
  }
  100% {
    transform: translate(var(--tx), var(--ty)) scale(1.5);
    opacity: 0;
  }
}
.confetti-shape {
  width: 40px;
  height: 40px;
  background-color: #ff69b4;
  margin: 5px;
  display: inline-block;
  /*cursor: pointer;*/
  transition: transform 0.2s;
}

/* 大小螢幕的格線排版 */
#erp_manager_add_input {
  display: grid;
  gap: 12px;
  align-items: center;
}

/* 大螢幕：四欄同列 */
@media (min-width: 769px) {
  #erp_manager_add_input {
    grid-template-columns: 1fr 44px 1fr 48px; /* 輸入撐滿、按鈕固定寬 */
  }
}

/* 小螢幕：兩欄 → 自然變兩列（先輸入+搜尋；再下拉+加號） */
@media (max-width: 768px) {
  #erp_manager_add_input {
    grid-template-columns: 1fr 44px;
  }
}

/* 搜尋框容器，讓搜尋鈕疊在輸入框右側 */
#erp_manager_add_input .manager-searchbox {
  position: relative;
}

/* 讓輸入框右側留出按鈕位置 */
#erp_manager_add_input .manager-searchbox .form-input {
  width: 100%;
  padding-right: 44px;
}

/* 搜尋按鈕樣式：沿用你的 .search-box button 規格 */
#erp_manager_add_input .manager-searchbox > button {
  position: absolute;
  right: 0;
  top: 0;
  height: 100%;
  width: 40px;
  border: none;
  background: none;
  color: var(--text-light);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* 讓下拉選單在格線中可以撐滿 */
#erp_manager_add_input .form-select {
  width: 100%;
}
/* 外層：遮罩 */
.scan-modal{
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: var(--modal-overlay, rgba(0,0,0,.45));
  opacity: 0;
  transition: opacity .3s ease;
  overscroll-behavior: contain;
}
.scan-modal.open{
  display: flex;
  opacity: 1;
}

/* 內層：面板 */
.scan-panel{
  width: min(900px, 96vw);
  max-height: calc(100dvh - 32px);
  background: var(--content-bg, #fff);           /* ✅ dark/light 都安全 */
  border-radius: 12px;
  box-shadow: var(--box-shadow, 0 10px 30px rgba(0,0,0,.2));
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* 頂部（關閉鈕保持可見） */
.scan-panel-header{
  flex: 0 0 auto;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(0,0,0,.08);
  position: sticky; top: 0; z-index: 1;
  background: inherit;                            /* 跟隨 panel 背景 */
}

/* 內容可滾動 */
.scan-panel-body{
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;                                /* ✅ 這層滾動 */
  -webkit-overflow-scrolling: touch;
  padding: 16px;
}

/* 相機/預覽限制高度，避免撐爆畫面 */
.scan-panel-body #ncs_camera,
.scan-panel-body #ncs_cameraCanvas,
.scan-panel-body #ncs_preview{
  max-width: 100%;
  max-height: 60vh;
  object-fit: contain;
}
/* 只影響掃描名片這顆 modal，避免動到全站其他 .form-label */
#name_card_scan_modal .form-group1{
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0;
}

#name_card_scan_modal .form-label{
  flex: 0 0 80px;      /* ← 想更窄改這個，比如 88px */
  max-width: 80px;
  margin: 0;           /* 移除多餘的 margin-bottom，避免上下距離太大 */
  font-weight: 500;
  color: var(--muted-foreground, #a0a0a0);
}

#name_card_scan_modal .form-input2 .form-input3{
  flex: 1 1 auto;
  min-width: 0;
  width: auto;
  box-sizing: border-box;
  padding: 8px 10px;
  border: 1px solid #444;
  border-radius: 8px;
  background: var(--content-bg, #111);
  color: var(--fg, #eee);
}

/* 小螢幕改直排（可選）*/
@media (max-width: 480px){
  #name_card_scan_modal .form-group1{ 
    flex-direction: column; 
    align-items: stretch;
  }
  #name_card_scan_modal .form-label{
    flex: 0 0 auto;
    max-width: none;
  }
}
/*.confetti-shape:hover {
  transform: scale(1.2);
  border: 2px solid #444;
}*/

/*.search-box button {
  position: absolute;
  right: 0;
  top: 0;
  height: 100%;
  width: 40px;
  border: none;
  background: none;
  color: var(--text-light);
  cursor: pointer;
}*/