* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: #333333;
  font-family: "Helvetica Neue", Helvetica, Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.42857143;
  background: #f5f5f5;
}

a {
  color: #337ab7;
  text-decoration: none;
}

a:hover {
  color: #23527c;
  text-decoration: underline;
}

.site-header {
  background: #f8f8f8;
  border-bottom: 1px solid #d7d7d7;
}

.navbar {
  max-width: 1320px;
  margin: 0 auto;
  min-height: 50px;
  padding: 0 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.navbar-brand a {
  color: #333333;
  font-size: 18px;
  line-height: 20px;
  font-weight: 500;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.navbar-brand a:hover {
  text-decoration: none;
}

.navbar-warning {
  color: #c9302c;
  font-size: 13px;
  line-height: 1.4;
}

.navbar-body {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-left: auto;
}

.navbar-nav {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 0;
  padding: 0;
}

.navbar-nav a {
  display: block;
  padding: 15px 12px;
  color: #555555;
}

.navbar-nav a:hover {
  color: #333333;
  background: #eeeeee;
  text-decoration: none;
}

.navbar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #555555;
}

.link-button {
  border: none;
  background: none;
  color: #337ab7;
  padding: 0;
  cursor: pointer;
}

.link-button:hover {
  color: #23527c;
  text-decoration: underline;
}

.site-main {
  padding: 18px 0 28px;
}

.container-fluid {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 15px;
}

.row {
  margin-bottom: 12px;
}

.page-title,
.page-header h1 {
  margin: 0 0 18px;
  font-size: 30px;
  font-weight: 500;
  line-height: 1.1;
}

.page-header {
  padding-bottom: 9px;
  margin: 0 0 18px;
  border-bottom: 1px solid #eeeeee;
}

.alert {
  padding: 10px 15px;
  border: 1px solid transparent;
  border-radius: 4px;
}

.alert-danger {
  color: #a94442;
  background-color: #f2dede;
  border-color: #ebccd1;
}

.panel {
  margin-bottom: 20px;
  background-color: #ffffff;
  border: 1px solid transparent;
  border-radius: 4px;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);
}

.panel-default {
  border-color: #dddddd;
}

.panel-primary {
  border-color: #337ab7;
}

.panel-heading {
  padding: 10px 15px;
  border-bottom: 1px solid transparent;
  border-top-left-radius: 3px;
  border-top-right-radius: 3px;
}

.panel-default > .panel-heading {
  color: #333333;
  background-color: #f5f5f5;
  border-color: #dddddd;
}

.panel-primary > .panel-heading {
  color: #ffffff;
  background-color: #337ab7;
  border-color: #337ab7;
}

.panel-title {
  margin: 0;
  font-size: 16px;
}

.panel-heading h4 {
  margin: 0;
  font-size: 16px;
  font-weight: 500;
}

.panel-body {
  padding: 15px;
}

.table {
  width: 100%;
  max-width: 100%;
  border-spacing: 0;
  border-collapse: collapse;
}

.table > thead > tr > th,
.table > tbody > tr > td {
  padding: 8px;
  line-height: 1.42857143;
  vertical-align: top;
  border-top: 1px solid #dddddd;
}

.table > thead > tr > th {
  vertical-align: bottom;
  border-bottom: 2px solid #dddddd;
  border-top: none;
  text-align: left;
}

.table-hover > tbody > tr:hover {
  background-color: #f5f5f5;
}

.table-condensed > thead > tr > th,
.table-condensed > tbody > tr > td {
  padding: 5px;
}

.week-cell {
  white-space: nowrap;
}

.cell-number,
.cell-zero {
  display: inline-block;
  min-width: 18px;
  margin-right: 6px;
}

.empty-text {
  color: #777777;
}

.toolbar {
  margin-bottom: 14px;
}

.filter-form {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.form-control {
  display: block;
  width: 100%;
  height: 34px;
  padding: 6px 12px;
  font-size: 14px;
  line-height: 1.42857143;
  color: #555555;
  background-color: #ffffff;
  background-image: none;
  border: 1px solid #cccccc;
  border-radius: 4px;
  box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
}

.login-note {
  margin-top: 16px;
  color: #c9302c;
  font-size: 18px;
  line-height: 1.5;
  text-align: center;
}

.form-control:focus {
  border-color: #66afe9;
  outline: 0;
  box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(102, 175, 233, 0.6);
}

.form-control-sm {
  width: auto;
  min-width: 140px;
}

.teacher-input {
  min-width: 180px;
}

.teacher-link {
  position: relative;
  display: inline-block;
}

.teacher-link::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: calc(100% + 4px);
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: rgba(51, 51, 51, 0.95);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s ease;
}

.teacher-link::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 13px);
  transform: translateX(-50%);
  padding: 6px 8px;
  border-radius: 4px;
  background: rgba(51, 51, 51, 0.95);
  color: #ffffff;
  font-size: 12px;
  line-height: 1.4;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s ease;
  z-index: 20;
}

.teacher-link:hover::before,
.teacher-link:hover::after,
.teacher-link:focus::before,
.teacher-link:focus::after {
  opacity: 1;
}

.teacher-separator {
  color: #666666;
}

.form-group {
  margin-bottom: 15px;
}

.form-group label {
  display: inline-block;
  margin-bottom: 5px;
  font-weight: 700;
}

.btn {
  display: inline-block;
  margin-bottom: 0;
  font-weight: 400;
  text-align: center;
  vertical-align: middle;
  touch-action: manipulation;
  cursor: pointer;
  background-image: none;
  border: 1px solid transparent;
  white-space: nowrap;
  padding: 6px 12px;
  font-size: 14px;
  line-height: 1.42857143;
  border-radius: 4px;
}

.btn-sm {
  padding: 5px 10px;
  font-size: 12px;
  line-height: 1.5;
  border-radius: 3px;
}

.btn-block {
  display: block;
  width: 100%;
}

.btn-default {
  color: #333333;
  background-color: #ffffff;
  border-color: #cccccc;
}

.btn-default:hover {
  color: #333333;
  background-color: #e6e6e6;
  border-color: #adadad;
  text-decoration: none;
}

.btn-primary {
  color: #ffffff;
  background-color: #337ab7;
  border-color: #2e6da4;
}

.btn-primary:hover {
  color: #ffffff;
  background-color: #286090;
  border-color: #204d74;
  text-decoration: none;
}

.btn-info {
  color: #ffffff;
  background-color: #5bc0de;
  border-color: #46b8da;
}

.btn-info:hover {
  color: #ffffff;
  background-color: #31b0d5;
  border-color: #269abc;
  text-decoration: none;
}

.table-status {
  display: inline-block;
}

.table-status.available {
  color: #31708f;
}

.table-status.full {
  color: #777777;
}

.result-summary {
  color: #555555;
  text-align: center;
  margin-top: 8px;
}

.login-body {
  background: #f5f5f5;
}

.login-wrap {
  max-width: 420px;
  margin: 50px auto 0;
}

.login-box {
  margin-bottom: 0;
}

.login-form {
  margin: 0;
}

.rating-stars {
  color: #f0ad4e;
  letter-spacing: 1px;
  white-space: nowrap;
}

.rating-overview {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  align-items: center;
}

.rating-overview-label {
  display: inline-block;
  margin-right: 8px;
  color: #666666;
}

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

.review-card {
  padding: 12px 14px;
  border: 1px solid #dddddd;
  border-radius: 4px;
  background: #fafafa;
}

.review-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  color: #666666;
  margin-bottom: 8px;
}

.review-content {
  color: #333333;
  line-height: 1.7;
  word-break: break-word;
}

.review-form {
  margin: 0;
}

.score-picker {
  padding-top: 6px;
}

.score-stars {
  display: flex;
  align-items: center;
  gap: 6px;
}

.star-button {
  border: none;
  background: none;
  padding: 0;
  font-size: 26px;
  line-height: 1;
  color: #cccccc;
  cursor: pointer;
}

.star-button.active {
  color: #f0ad4e;
}

.star-button:hover {
  color: #ec971f;
}

.score-picker-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-top: 8px;
  color: #666666;
}

.score-value {
  min-width: 72px;
}

.score-clear {
  font-size: 13px;
}

.review-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.review-textarea {
  min-height: 120px;
  resize: vertical;
}

.review-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

@media (max-width: 768px) {
  .navbar {
    flex-direction: column;
    align-items: stretch;
    padding-top: 8px;
    padding-bottom: 8px;
  }

  .navbar-body {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .navbar-nav {
    justify-content: flex-start;
  }

  .filter-form {
    align-items: stretch;
  }

  .form-control-sm,
  .teacher-input {
    width: 100%;
    min-width: 0;
  }

  .rating-overview {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

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