body {
    font-family: Arial, sans-serif;
    background: linear-gradient(120deg, #f6f9fc, #e9eff5);
    margin: 0;
    padding: 0;
}

.container {
    width: 90%;
    max-width: 1100px;
    margin: auto;
    background: white;
    padding: 20px 30px;
    margin-top: 40px;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

h1, h2, h3, h4 {
    color: #333;
    margin-top: 0.5rem;
}

a {
    color: #0077cc;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

button {
    background: #0077cc;
    color: white;
    border: none;
    padding: 8px 14px;
    border-radius: 6px;
    cursor: pointer;
}

button:hover {
    background: #005fa3;
}

button.danger {
    background: #cc0000;
}
button.danger:hover {
    background: #a30000;
}

input, select {
    padding: 6px;
    width: 260px;
}

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

th {
    background: #0077cc;
    color: white;
}

td, th {
    border: 1px solid #ddd;
    text-align: left;
    vertical-align: top;
    padding: 8px;
}

.course-box {
    border: 1px solid #ddd;
    padding: 8px;
    margin-top: 6px;
    border-radius: 10px;
    background: #f9f9f9;
}

.full {
    color: red;
    font-weight: bold;
}

.morning {
    background: #e6f2ff;
    border-left: 6px solid #4a90e2;
}

.afternoon {
    background: #fff0e6;
    border-left: 6px solid #f5a623;
}

.topbar {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
}

.badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 12px;
    background: #eef2f7;
    margin-right: 8px;
}

hr {
    border: none;
    border-top: 1px solid #eee;
    margin: 16px 0;
}

.small {
    font-size: 12px;
    color: #666;
}
/* 月曆內的「報名」連結強制粗體 */
.course-box a {
  font-weight: 700 !important;
}
/* 月份選擇框放大（手機也會變大） */
.month-form .month-input {
  font-size: 18px;
  padding: 10px 12px;
  height: 44px;
  border: 1px solid #ccc;
  border-radius: 10px;
}

/* 月曆表格下方的連結（拉上來貼近月曆） */
.calendar-actions {
  margin-top: 12px;
  font-size: 16px;
}

.calendar-actions a {
  font-weight: 600;
  text-decoration: none;
}

.calendar-actions .sep {
  margin: 0 8px;
  color: #666;
}
/* topbar 左右排版：左標題、右月份框+連結 */
.calendar-topbar{
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.title-block{
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.right-block{
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

/* 月份選擇框放大 */
.month-form .month-input{
  font-size: 18px;
  padding: 10px 12px;
  height: 44px;
  border: 1px solid #ccc;
  border-radius: 10px;
}

/* 右側連結（月份框下面） */
.right-actions{
  font-size: 16px;
  white-space: nowrap;
}

.right-actions a{
  font-weight: 600;
  text-decoration: none;
}

.right-actions .sep{
  margin: 0 8px;
  color: #666;
}
.course-intro-wrap{
  margin-top: 8px;
  margin-bottom: 8px;
}

.course-intro-link{
  display: inline-block;     /* ✅ 框貼合文字寬度 */
  padding: 4px 8px;          /* ✅ 很小的內距，不會留太多白 */
  border: 2px solid #000;    /* ✅ 黑色外框 */
  border-radius: 6px;
  color: #000;
  font-weight: 800;
  text-decoration: none;
  background: #fff;
}

.course-intro-link:hover{
  background: #f2f2f2;
}
.course-intro-wrap{
  margin-top: 8px;
  margin-bottom: 8px;
}

.course-intro-link{
  display: inline-block;     /* ✅ 框貼合文字寬度 */
  padding: 4px 8px;          /* ✅ 很小的內距，不會留太多白 */
  border: 2px solid #000;    /* ✅ 黑色外框 */
  border-radius: 6px;
  color: #000;
  font-weight: 800;
  text-decoration: none;
  background: #fff;
}

.course-intro-link:hover{
  background: #f2f2f2;
}
.course-intro-wrap{
  margin: 10px 0 0 0;
}

.course-intro-wrap{
  margin: 10px 0 0 0;
}
.course-intro-btn{
  display: inline-block;
  background: #000;
  color: #fff;
  font-weight: 800;
  padding: 6px 10px;
  border-radius: 8px;
  text-decoration: none;
  line-height: 1.2;
}
.course-intro-btn:hover{
  opacity: 0.85;
}
/* ====== Calendar header layout (照你圖的排版) ====== */
.calendar-topbar{
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
}

.left-block{
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.site-title{
  margin: 0;
  font-size: 32px;
  color: #000;
}

.month-title{
  margin: 0;
}

/* 黑底白字粗體：框貼字，不要太大 */
.intro-btn{
  display: inline-block;
  width: fit-content;
  padding: 10px 14px;
  background: #000;
  color: #fff;
  font-weight: 800;
  border-radius: 10px;
  text-decoration: none;
  line-height: 1;
}

/* 右邊：月份框 + 連結 + badge 都靠右 */
.right-block{
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

.month-form .month-input{
  font-size: 18px;
  padding: 12px 14px;
  height: 52px;
  border: 1px solid #ccc;
  border-radius: 12px;
}

.right-actions{
  font-size: 16px;
  white-space: nowrap;
}

.right-actions .sep{
  margin: 0 10px;
  color: #666;
}

/* badge 也移到右邊並排 */
.badge-row{
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  white-space: nowrap;
}

/* 報名變粗體 */
.register-link{
  font-weight: 800;
}
/* 管理後台：搜尋工具列 */
.admin-tools{
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 12px 0 14px 0;
}

.admin-search{
  width: min(520px, 100%);
  padding: 10px 12px;
  border: 1px solid #ccc;
  border-radius: 10px;
  box-sizing: border-box;
}

.admin-search-clear{
  padding: 8px 12px;
}

/* 每堂課可收合 */
.course-panel{
  border: 1px solid #ddd;
  border-radius: 12px;
  padding: 8px 10px;
  margin: 10px 0;
}

.course-summary{
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  font-weight: 700;
  list-style: none;
}

.course-summary::-webkit-details-marker{
  display: none;
}

.course-sum-title{
  flex: 1;
}

.course-sum-cap{
  white-space: nowrap;
  font-weight: 600;
  color: #555;
}

.course-body{
  margin-top: 10px;
}

.reg-list{
  padding-left: 18px;
}

.reg-item{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 6px 0;
}

.inline-form{
  display: inline;
}