/* 內頁共享 */

.page-banner {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  color: white;
  padding: 40px 0 30px;
  position: relative;
  overflow: hidden;
}
.page-banner.banner-blue   { background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%); }
.page-banner.banner-purple { background: linear-gradient(135deg, #7c3aed 0%, #5b21b6 100%); }
.page-banner.banner-indigo { background: linear-gradient(135deg, #4f46e5 0%, #3730a3 100%); }
.page-banner.banner-orange { background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%); }
.page-banner::before {
  content: '';
  position: absolute;
  top: -60px; right: -60px;
  width: 260px; height: 260px;
  background: rgba(255,255,255,0.07);
  border-radius: 50%;
  pointer-events: none;
}
.page-banner::after {
  content: '';
  position: absolute;
  bottom: -80px; left: 80px;
  width: 200px; height: 200px;
  background: rgba(255,255,255,0.05);
  border-radius: 50%;
  pointer-events: none;
}
.page-banner-title {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 10px;
  position: relative;
  z-index: 2;
}
.breadcrumb {
  font-size: 0.95rem;
  color: rgba(255,255,255,0.8);
  position: relative;
  z-index: 2;
}
.breadcrumb a {
  color: rgba(255,255,255,0.8);
  text-decoration: none;
}
.breadcrumb a:hover { color: white; text-decoration: underline; }
.breadcrumb .sep { margin: 0 8px; }

.page-content { padding: 40px 0 60px; }

.filter-bar {
  background: white;
  border-radius: 10px;
  padding: 18px 20px;
  margin-bottom: 24px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  border: 1px solid #e5e7eb;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: flex-end;
}
.filter-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.filter-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: #4b5563;
}
.filter-select, .filter-input {
  padding: 8px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 0.95rem;
  color: #1f2937;
  background: white;
  min-width: 150px;
  font-family: inherit;
}
.filter-select:focus, .filter-input:focus {
  outline: none;
  border-color: #059669;
  box-shadow: 0 0 0 3px rgba(5,150,105,0.1);
}
.filter-btn {
  padding: 9px 20px;
  background: #059669;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.2s;
}
.filter-btn:hover { background: #047857; }
/* 橘紅按鈕 */
.filter-btn.filter-btn-orange { background: #ef4444; }
.filter-btn.filter-btn-orange:hover { background: #dc2626; }

/* 高度表樣式 */
.height-table { min-width: 900px; }
.height-table thead th { padding: 10px 6px; font-size: 0.85rem; }
.height-table td { padding: 8px 6px; font-size: 0.88rem; }
.height-table td:first-child { padding-left: 14px; }
.height-table td:nth-child(2) { padding-left: 10px; }
/* 醒目列 */
.ht-highlight { background: #e0f2fe !important; }
.ht-highlight:hover { background: #bae6fd !important; }

/* 隊職員卡片 */
.roster-list { display: flex; flex-direction: column; gap: 14px; }
.roster-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 0;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
/* 學校標題 */
.roster-school-title {
    display: inline-block;
    background: #16a34a;
    color: #fff;
    font-size: 0.95rem;
    font-weight: 700;
    padding: 5px 18px;
    border-radius: 20px;
    margin: 12px 14px 8px;
}
/* 職稱行 */
.roster-info {
    padding: 4px 14px 4px;
    font-size: 0.9rem;
    color: #374151;
    display: flex;
    flex-wrap: wrap;
    gap: 6px 24px;
}
/* 隊員名單 */
.roster-members {
    padding: 2px 14px 10px;
    font-size: 0.88rem;
    color: #4b5563;
    line-height: 1.7;
}

/* 分項名單卡片 */
.entry-list { display: flex; flex-direction: column; gap: 10px; }
.entry-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 0 0 10px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
/* 項目標籤 */
.entry-event-title {
    display: inline-block;
    background: #ef4444;
    color: #fff;
    font-size: 0.92rem;
    font-weight: 700;
    padding: 4px 16px;
    border-radius: 16px;
    margin: 10px 14px 6px;
}
/* 資訊行 */
.entry-meta {
    padding: 2px 14px 4px;
    font-size: 0.88rem;
    color: #374151;
}
/* 分組標籤 */
.entry-group-label {
    padding: 2px 14px 0;
    font-size: 0.85rem;
    font-weight: 700;
    color: #1d4ed8;
}
/* 參賽者名單 */
.entry-members {
    padding: 2px 14px 4px;
    font-size: 0.87rem;
    color: #4b5563;
    line-height: 1.8;
}

/* 統計表線條 */
/* 表頭垂直線 */
.stats-events-table thead th {
    border-right: 1px solid rgba(255,255,255,0.4);
    text-align: center !important;
}
/* 表頭水平線 */
.stats-events-table thead tr:first-child th {
    border-bottom: 1px solid rgba(255,255,255,0.5);
}
/* 表頭分組線 */
.stats-events-table thead tr:first-child th:nth-child(n+3) {
    border-left: 2px solid rgba(255,255,255,0.65);
}
/* 表頭子項目線 */
.stats-events-table thead tr:last-child th:nth-child(1),
.stats-events-table thead tr:last-child th:nth-child(4),
.stats-events-table thead tr:last-child th:nth-child(7) {
    border-left: 2px solid rgba(255,255,255,0.65);
}
/* 表身對齊 */
.stats-events-table tbody td {
    border-right: 1px solid #e5e7eb;
    text-align: center !important;
}
/* 表身分組線 */
.stats-events-table tbody td:nth-child(3),
.stats-events-table tbody td:nth-child(6),
.stats-events-table tbody td:nth-child(9) {
    border-left: 2px solid #d1d5db;
}
/* 表身分界線 */
.stats-events-table tbody td:nth-child(1),
.stats-events-table tbody td:nth-child(2) {
    border-right: 2px solid #d1d5db;
}

.table-wrapper {
  background: white;
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  border: 1px solid #e5e7eb;
  overflow: hidden;
  overflow-x: auto;
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.97rem;
  min-width: 600px;
}
.data-table thead {
  background: #1f2937;
  color: white;
}
.data-table thead th {
  padding: 13px 16px;
  text-align: left;
  font-weight: 600;
  white-space: nowrap;
  font-size: 0.9rem;
  letter-spacing: 0.3px;
}
.data-table thead th.text-center { text-align: center; }
.data-table tbody tr {
  border-bottom: 1px solid #e5e7eb;
  transition: background 0.15s;
}
.data-table tbody tr:last-child { border-bottom: none; }
.data-table tbody tr:hover { background-color: #f9fafb; }
.data-table tbody tr:nth-child(even) { background-color: #fafafa; }
.data-table tbody tr:nth-child(even):hover { background-color: #f3f4f6; }
.data-table td {
  padding: 11px 16px;
  vertical-align: middle;
}
.data-table td.text-center { text-align: center; }

.rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px; height: 28px;
  border-radius: 50%;
  font-size: 0.88rem;
  font-weight: 800;
}
.rank-1 { background: #ffd700; color: #78350f; }
.rank-2 { background: #e5e7eb; color: #374151; }
.rank-3 { background: #fbbf24; color: #7c2d12; }
.rank-other { background: #f3f4f6; color: #6b7280; }

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
}
.badge-success  { background: #d1fae5; color: #065f46; }
.badge-info     { background: #dbeafe; color: #1e40af; }
.badge-warning  { background: #fef3c7; color: #92400e; }
.badge-danger   { background: #fee2e2; color: #991b1b; }
.badge-purple   { background: #ede9fe; color: #5b21b6; }
.badge-gray     { background: #f3f4f6; color: #374151; }

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 18px;
  flex-wrap: wrap;
  gap: 10px;
}
.pagination-info { font-size: 0.88rem; color: #6b7280; }
.pagination-pages { display: flex; gap: 5px; }
.page-btn {
  width: 34px; height: 34px;
  border-radius: 6px;
  border: 1px solid #d1d5db;
  background: white;
  color: #374151;
  cursor: pointer;
  font-size: 0.88rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  font-family: inherit;
}
.page-btn:hover { background: #f3f4f6; }
.page-btn.active { background: #059669; color: white; border-color: #059669; }
.page-btn.disabled { opacity: 0.4; cursor: not-allowed; }

.stats-highlight {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.stat-highlight-box {
  flex: 1;
  min-width: 120px;
  background: white;
  border-radius: 10px;
  padding: 18px 14px;
  text-align: center;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  border: 1px solid #e5e7eb;
  border-top: 3px solid #059669;
}
.stat-highlight-box:nth-child(2) { border-top-color: #f59e0b; }
.stat-highlight-box:nth-child(3) { border-top-color: #ef4444; }
.stat-highlight-box:nth-child(4) { border-top-color: #8b5cf6; }
.stat-highlight-num {
  font-size: 2rem;
  font-weight: 800;
  color: #059669;
  display: block;
}
.stat-highlight-box:nth-child(2) .stat-highlight-num { color: #d97706; }
.stat-highlight-box:nth-child(3) .stat-highlight-num { color: #ef4444; }
.stat-highlight-box:nth-child(4) .stat-highlight-num { color: #7c3aed; }
.stat-highlight-label { font-size: 0.82rem; color: #6b7280; margin-top: 4px; }

.page-section-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: #1f2937;
  margin-bottom: 14px;
  padding-left: 12px;
  border-left: 4px solid #059669;
}

.tab-nav {
  display: flex;
  gap: 2px;
  margin-bottom: 20px;
  border-bottom: 2px solid #e5e7eb;
  flex-wrap: wrap;
}
.tab-btn {
  padding: 10px 20px;
  font-size: 0.97rem;
  font-weight: 600;
  border: none;
  background: none;
  cursor: pointer;
  color: #6b7280;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.2s;
  font-family: inherit;
}
.tab-btn:hover { color: #059669; }
.tab-btn.active { color: #059669; border-bottom-color: #059669; }

.info-card {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  padding: 14px 18px;
  margin-bottom: 20px;
  font-size: 0.95rem;
}
.info-card.warning { background: #fffbeb; border-color: #fde68a; }
.info-card.danger  { background: #fff1f2; border-color: #fecdd3; }
.info-card-title {
  font-weight: 700;
  margin-bottom: 6px;
  color: #1e40af;
}
.info-card.warning .info-card-title { color: #92400e; }
.info-card.danger  .info-card-title { color: #9f1239; }

.download-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 28px; }
.download-item {
  display: flex;
  align-items: center;
  background: white;
  border-radius: 8px;
  padding: 14px 18px;
  border: 1px solid #e5e7eb;
  transition: all 0.2s;
  gap: 14px;
}
.download-item:hover {
  border-color: #059669;
  box-shadow: 0 2px 8px rgba(5,150,105,0.1);
  transform: translateX(4px);
}
.download-icon {
  width: 42px; height: 42px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-weight: 800; font-size: 0.7rem; color: white;
  text-transform: uppercase; letter-spacing: 0.5px;
}
.icon-pdf { background: #ef4444; }
.icon-doc { background: #2563eb; }
.icon-xls { background: #059669; }
.icon-zip { background: #f59e0b; }
.download-info { flex: 1; }
.download-name { font-weight: 600; font-size: 0.97rem; color: #1f2937; margin-bottom: 3px; }
.download-meta { font-size: 0.82rem; color: #6b7280; }
.download-btn {
  padding: 7px 16px;
  border-radius: 6px;
  background: #f3f4f6;
  color: #374151;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid #e5e7eb;
  transition: all 0.2s;
  white-space: nowrap;
  font-family: inherit;
}
.download-btn:hover { background: #059669; color: white; border-color: #059669; }

.reg-form-section {
  background: white;
  border-radius: 12px;
  padding: 30px 35px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  border: 1px solid #e5e7eb;
  margin-bottom: 28px;
}
.form-section-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #1f2937;
  padding-bottom: 14px;
  margin-bottom: 22px;
  border-bottom: 2px solid #e5e7eb;
  position: relative;
}
.form-section-title::after {
  content: '';
  position: absolute;
  left: 0; bottom: -2px;
  width: 60px; height: 2px;
  background: #059669;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 18px;
}
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group.full-width { grid-column: 1 / -1; }
.form-label { font-size: 0.88rem; font-weight: 600; color: #374151; }
.form-label .required { color: #ef4444; margin-left: 3px; }
.form-input, .form-select, .form-textarea {
  padding: 9px 13px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 0.97rem;
  font-family: inherit;
  transition: border-color 0.2s;
  color: #1f2937;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: #059669;
  box-shadow: 0 0 0 3px rgba(5,150,105,0.1);
}
.form-textarea { resize: vertical; min-height: 90px; }
.form-submit-row { display: flex; gap: 12px; justify-content: flex-end; margin-top: 8px; }

.bar-chart-row { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.bar-label { min-width: 80px; font-size: 0.88rem; color: #4b5563; text-align: right; }
.bar-track { flex: 1; background: #f3f4f6; border-radius: 4px; height: 22px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 4px; display: flex; align-items: center; padding-left: 8px; font-size: 0.8rem; font-weight: 700; color: white; }
.bar-fill.bar-green  { background: #059669; }
.bar-fill.bar-blue   { background: #2563eb; }
.bar-fill.bar-orange { background: #f59e0b; }
.bar-fill.bar-red    { background: #ef4444; }
.bar-value { min-width: 50px; font-size: 0.88rem; font-weight: 700; color: #374151; }

.icon-inline { display: inline-block; vertical-align: middle; margin-right: 6px; }

.medal-gold   { color: #d97706; font-weight: 800; }
.medal-silver { color: #6b7280; font-weight: 800; }
.medal-bronze { color: #b45309; font-weight: 800; }

@media (max-width: 768px) {
  .page-banner-title { font-size: 1.5rem; }
  .filter-bar { flex-direction: column; }
  .filter-select, .filter-input { min-width: 100%; }
  .stats-highlight { gap: 10px; }
  .stat-highlight-box { min-width: calc(50% - 5px); }
  .reg-form-section { padding: 20px; }
  .form-grid { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .stat-highlight-box { min-width: 100%; }
}
