/* =====================================================
   桃園市地方輔導群 教師社群審查系統
   設計：簡潔大字、易讀、現代政府風
   ===================================================== */

@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+TC:wght@400;500;600;700&display=swap');

/* ── 變數 ── */
:root {
  --blue:      #1a4f8a;
  --blue-dk:   #0d3360;
  --blue-lt:   #e8f0fb;
  --blue-mid:  #4a7fc1;
  --orange:    #d9541e;
  --orange-lt: #fff0e8;
  --green:     #1a7a4a;
  --green-lt:  #e6f5ee;
  --yellow:    #b87700;
  --yellow-lt: #fff9e6;
  --red:       #c0392b;
  --red-lt:    #fef0ee;
  --gray-0:    #f5f6f8;
  --gray-1:    #eef0f4;
  --gray-2:    #d8dce6;
  --gray-4:    #8a94a6;
  --gray-7:    #3d4455;
  --gray-9:    #1a1f2e;
  --white:     #ffffff;
  --radius:    10px;
  --radius-sm: 6px;
  --shadow:    0 2px 8px rgba(0,0,0,.08);
  --shadow-md: 0 4px 16px rgba(0,0,0,.12);

  /* 字體 - 放大為基礎 */
  --font:      'Noto Sans TC', 'Microsoft JhengHei', sans-serif;
  --fs-base:   16px;    /* 基礎字體 */
  --fs-sm:     14px;
  --fs-lg:     18px;
  --fs-xl:     22px;
  --fs-2xl:    28px;
  --fs-hint:   13px;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: var(--fs-base); scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--gray-0);
  color: var(--gray-9);
  line-height: 1.75;
  min-height: 100vh;
}
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; color: var(--blue-dk); }
img { max-width: 100%; }

/* ── 頂欄 ── */
.topbar {
  background: var(--blue);
  color: #fff;
  height: 60px;
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 200;
  box-shadow: 0 2px 8px rgba(0,0,0,.2);
}
.topbar-logo { font-size: 26px; }
.topbar-title { font-size: var(--fs-lg); font-weight: 700; letter-spacing: .02em; }
.topbar-sub   { font-size: var(--fs-sm); opacity: .75; margin-left: 4px; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.topbar-year  {
  background: var(--orange);
  border-radius: var(--radius-sm);
  padding: 3px 12px;
  font-size: var(--fs-sm);
  font-weight: 700;
  letter-spacing: .05em;
}
.topbar-user  {
  background: rgba(255,255,255,.15);
  border-radius: 20px;
  padding: 4px 14px;
  font-size: var(--fs-sm);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ── 版面 ── */
.layout { display: flex; min-height: calc(100vh - 60px); }

/* ── 側欄 ── */
.sidebar {
  width: 220px;
  min-width: 220px;
  background: var(--blue-dk);
  color: #fff;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 60px;
  height: calc(100vh - 60px);
  overflow-y: auto;
}
.sidebar-user {
  padding: 18px 16px 14px;
  border-bottom: 1px solid rgba(255,255,255,.1);
}
.sidebar-role {
  display: inline-block;
  background: var(--orange);
  border-radius: 4px;
  padding: 1px 10px;
  font-size: var(--fs-hint);
  font-weight: 700;
  letter-spacing: .08em;
  margin-bottom: 6px;
}
.sidebar-name   { font-size: var(--fs-base); font-weight: 600; }
.sidebar-school { font-size: var(--fs-hint); opacity: .6; margin-top: 2px; }

.sidebar-nav { flex: 1; padding: 10px 0; }
.nav-group-label {
  font-size: var(--fs-hint);
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(255,255,255,.38);
  padding: 14px 16px 5px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  font-size: var(--fs-base);
  color: rgba(255,255,255,.78);
  cursor: pointer;
  transition: background .15s;
  border-left: 3px solid transparent;
  text-decoration: none;
}
.nav-item:hover { background: rgba(255,255,255,.08); color: #fff; text-decoration: none; }
.nav-item.active { background: rgba(255,255,255,.13); color: #fff; border-left-color: var(--orange); }
.nav-icon { width: 22px; text-align: center; font-size: 18px; flex-shrink: 0; }

.sidebar-footer {
  padding: 14px 16px;
  border-top: 1px solid rgba(255,255,255,.1);
}
.btn-logout {
  display: flex; align-items: center; gap: 8px;
  background: none; border: none; color: rgba(255,255,255,.55);
  font-size: var(--fs-base); font-family: var(--font);
  cursor: pointer; width: 100%; padding: 6px 0;
  transition: color .15s;
}
.btn-logout:hover { color: #fff; }

/* ── 主內容 ── */
.main {
  flex: 1;
  padding: 28px 32px;
  overflow: hidden;
}

/* ── 頁面標題 ── */
.page-title {
  font-size: var(--fs-xl);
  font-weight: 700;
  color: var(--blue-dk);
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}
.page-title::before {
  content: '';
  display: block;
  width: 5px;
  height: 1.2em;
  background: var(--orange);
  border-radius: 3px;
}
.page-sub {
  font-size: var(--fs-base);
  color: var(--gray-4);
  margin-bottom: 20px;
}
.breadcrumb {
  font-size: var(--fs-sm);
  color: var(--gray-4);
  margin-bottom: 8px;
  display: flex; gap: 6px; align-items: center;
}
.breadcrumb a { color: var(--gray-4); }
.breadcrumb a:hover { color: var(--blue); }

/* ── 卡片 ── */
.card {
  background: var(--white);
  border: 1px solid var(--gray-2);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-bottom: 20px;
}
.card-head {
  padding: 16px 20px;
  border-bottom: 1px solid var(--gray-1);
  display: flex; align-items: center; justify-content: space-between;
}
.card-head-title {
  font-size: var(--fs-lg);
  font-weight: 600;
  color: var(--gray-9);
  display: flex; align-items: center; gap: 8px;
}
.card-body { padding: 20px; }
.card-foot {
  padding: 12px 20px;
  border-top: 1px solid var(--gray-1);
  background: var(--gray-0);
  font-size: var(--fs-sm);
  color: var(--gray-4);
}

/* ── 統計卡 ── */
.stat-row { display: grid; grid-template-columns: repeat(auto-fit,minmax(170px,1fr)); gap: 14px; margin-bottom: 20px; }
.stat-card {
  background: var(--white);
  border: 1px solid var(--gray-2);
  border-radius: var(--radius);
  padding: 18px 18px 16px;
  display: flex; align-items: flex-start; gap: 14px;
  box-shadow: var(--shadow);
  transition: box-shadow .15s, transform .15s;
  text-decoration: none; color: inherit;
}
.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); text-decoration: none; color: inherit; }
.stat-icon {
  width: 48px; height: 48px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; flex-shrink: 0;
}
.si-blue   { background: var(--blue-lt);   color: var(--blue); }
.si-orange { background: var(--orange-lt); color: var(--orange); }
.si-green  { background: var(--green-lt);  color: var(--green); }
.si-yellow { background: var(--yellow-lt); color: var(--yellow); }
.si-red    { background: var(--red-lt);    color: var(--red); }
.stat-num  { font-size: 28px; font-weight: 700; line-height: 1; }
.stat-lbl  { font-size: var(--fs-sm); color: var(--gray-4); margin-top: 4px; }

/* ── 表格 ── */
.tbl-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--gray-2); box-shadow: var(--shadow); }
table.tbl { width: 100%; border-collapse: collapse; background: var(--white); font-size: var(--fs-base); }
.tbl thead tr { background: var(--blue); color: #fff; }
.tbl thead th { padding: 12px 14px; font-weight: 600; font-size: var(--fs-sm); white-space: nowrap; text-align: left; }
.tbl tbody tr { border-bottom: 1px solid var(--gray-1); transition: background .12s; }
.tbl tbody tr:hover { background: var(--blue-lt); }
.tbl tbody tr:last-child { border-bottom: none; }
.tbl td { padding: 12px 14px; vertical-align: middle; }
.tbl td.c { text-align: center; }
.tbl tfoot tr { background: var(--blue-lt); }
.tbl tfoot td { padding: 10px 14px; font-weight: 700; }

/* ── 按鈕 ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: var(--fs-base);
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  border: 2px solid transparent;
  transition: all .15s;
  text-decoration: none;
  white-space: nowrap;
  line-height: 1;
}
.btn:hover { text-decoration: none; }

.btn-primary { background: var(--blue);   color: #fff; border-color: var(--blue); }
.btn-primary:hover { background: var(--blue-dk); border-color: var(--blue-dk); color: #fff; }

.btn-orange  { background: var(--orange); color: #fff; border-color: var(--orange); }
.btn-orange:hover { background: #b84218; border-color: #b84218; color: #fff; }

.btn-success { background: var(--green);  color: #fff; border-color: var(--green); }
.btn-success:hover { background: #135e38; border-color: #135e38; color: #fff; }

.btn-danger  { background: var(--red);    color: #fff; border-color: var(--red); }
.btn-danger:hover { background: #9e2f24; border-color: #9e2f24; color: #fff; }

.btn-warn    { background: var(--yellow); color: #fff; border-color: var(--yellow); }
.btn-warn:hover { background: #9a6500; border-color: #9a6500; color: #fff; }

.btn-outline {
  background: transparent; color: var(--blue); border-color: var(--blue);
}
.btn-outline:hover { background: var(--blue-lt); color: var(--blue-dk); }

.btn-ghost {
  background: transparent; color: var(--gray-7); border-color: var(--gray-2);
}
.btn-ghost:hover { background: var(--gray-1); }

.btn-sm { padding: 7px 14px; font-size: var(--fs-sm); }
.btn-lg { padding: 13px 26px; font-size: var(--fs-lg); }
.btn-full { width: 100%; }

.btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.btn-row-right { justify-content: flex-end; }

/* ── Tag / Badge ── */
.tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 12px; border-radius: 20px;
  font-size: var(--fs-sm); font-weight: 600; white-space: nowrap;
}
.tag-pass  { background: var(--green-lt);  color: var(--green); }
.tag-fail  { background: var(--red-lt);    color: var(--red); }
.tag-warn  { background: var(--yellow-lt); color: var(--yellow); }
.tag-info  { background: var(--blue-lt);   color: var(--blue); }
.tag-gray  { background: var(--gray-1);    color: var(--gray-4); }
.tag-orange{ background: var(--orange-lt); color: var(--orange); }

/* 社群類型 */
.type-0 { background: #e0f0e8; color: #1a5c35; border-radius: var(--radius-sm); padding: 3px 10px; font-size: var(--fs-sm); font-weight: 700; }
.type-1 { background: #e8edf8; color: #2a3f7e; border-radius: var(--radius-sm); padding: 3px 10px; font-size: var(--fs-sm); font-weight: 700; }
.type-2 { background: #f8e8e0; color: #7e2a2a; border-radius: var(--radius-sm); padding: 3px 10px; font-size: var(--fs-sm); font-weight: 700; }

/* ── 表單 ── */
.form-section {
  background: var(--white);
  border: 1px solid var(--gray-2);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}
.form-section-title {
  font-size: var(--fs-lg);
  font-weight: 700;
  color: var(--blue-dk);
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--blue-lt);
  display: flex; align-items: center; gap: 10px;
}
.step-num {
  background: var(--blue); color: #fff;
  width: 28px; height: 28px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: var(--fs-sm); font-weight: 700;
}

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 24px; }
.form-grid-3 { grid-template-columns: 1fr 1fr 1fr; }
.form-grid-1 { grid-template-columns: 1fr; }
.span-2 { grid-column: 1 / -1; }

.fgroup { display: flex; flex-direction: column; gap: 6px; }
.flabel {
  font-size: var(--fs-base);
  font-weight: 600;
  color: var(--gray-7);
  display: flex; align-items: center; gap: 4px;
}
.req { color: var(--red); }
.fhint { font-size: var(--fs-hint); color: var(--gray-4); }
.ferr  { font-size: var(--fs-hint); color: var(--red); }

input[type=text], input[type=email], input[type=tel],
input[type=number], input[type=url], select, textarea {
  width: 100%;
  padding: 10px 13px;
  border: 2px solid var(--gray-2);
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: var(--fs-base);
  color: var(--gray-9);
  background: var(--white);
  transition: border-color .15s, box-shadow .15s;
  outline: none;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(26,79,138,.12);
}
input:disabled, select:disabled, textarea:disabled {
  background: var(--gray-0); color: var(--gray-4); cursor: not-allowed;
}
textarea { resize: vertical; min-height: 100px; }

.radio-row, .check-row { display: flex; flex-wrap: wrap; gap: 10px 22px; align-items: center; padding: 8px 0; }
.rlabel, .clabel {
  display: flex; align-items: center; gap: 8px;
  font-size: var(--fs-base); cursor: pointer; color: var(--gray-9);
}
input[type=radio], input[type=checkbox] {
  width: auto; padding: 0;
  accent-color: var(--blue);
  cursor: pointer;
  width: 18px; height: 18px;
}

.form-actions {
  display: flex; gap: 10px; justify-content: flex-end;
  margin-top: 24px; padding-top: 18px;
  border-top: 1px solid var(--gray-2);
}

/* ── 提示框 ── */
.alert {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 16px 18px;
  border-radius: var(--radius-sm);
  font-size: var(--fs-base);
  margin-bottom: 16px;
  border-left: 5px solid;
}
.alert-icon { font-size: 20px; flex-shrink: 0; margin-top: 1px; }
.a-info   { background: var(--blue-lt);   color: var(--blue-dk);  border-color: var(--blue); }
.a-success{ background: var(--green-lt);  color: #0a3d22;         border-color: var(--green); }
.a-warn   { background: var(--yellow-lt); color: #5a3c00;         border-color: var(--yellow); }
.a-danger { background: var(--red-lt);    color: var(--red);      border-color: var(--red); }
.alert ul { margin: 6px 0 0 18px; }
.alert li { margin-bottom: 3px; }

/* ── 進度條 ── */
.progress-bar { height: 8px; background: var(--gray-1); border-radius: 4px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 4px; transition: width .3s; }

/* ── 步驟導覽 ── */
.step-nav { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-bottom: 24px; }
.step-btn {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 16px; border-radius: var(--radius-sm);
  font-size: var(--fs-base); border: none;
  background: var(--gray-1); color: var(--gray-4);
  cursor: default; font-family: var(--font); font-weight: 500;
  white-space: nowrap;
}
.step-btn.done { background: var(--green-lt); color: var(--green); cursor: pointer; }
.step-btn.active { background: var(--blue); color: #fff; box-shadow: var(--shadow); }
.step-arrow { color: var(--gray-2); font-size: 14px; }

/* ── 登入頁 ── */
.login-page {
  min-height: 100vh;
  background: linear-gradient(135deg, var(--blue-dk) 0%, var(--blue) 60%, #2a5da8 100%);
  display: flex; align-items: stretch;
}
.login-left {
  flex: 1;
  display: flex; flex-direction: column;
  justify-content: center; align-items: flex-start;
  padding: 60px 80px;
  color: #fff;
}
.login-left-icon { font-size: 64px; margin-bottom: 16px; }
.login-left-title { font-size: 32px; font-weight: 700; line-height: 1.3; margin-bottom: 10px; }
.login-left-sub   { font-size: 18px; opacity: .8; margin-bottom: 32px; }
.login-news { background: rgba(255,255,255,.1); border-radius: var(--radius); padding: 20px; max-width: 500px; }
.login-news-title { font-size: var(--fs-base); font-weight: 700; margin-bottom: 12px; opacity: .9; }
.login-news-item  { display: flex; gap: 10px; align-items: baseline; padding: 7px 0; border-bottom: 1px solid rgba(255,255,255,.1); font-size: var(--fs-sm); }
.login-news-item:last-child { border-bottom: none; }
.login-news-tag   { background: rgba(255,255,255,.2); border-radius: 4px; padding: 1px 8px; font-size: var(--fs-hint); white-space: nowrap; }
.login-news-text  { flex: 1; opacity: .9; }
.login-news-date  { opacity: .6; white-space: nowrap; font-size: var(--fs-hint); }

.login-right {
  width: 420px;
  background: #fff;
  display: flex; align-items: center; justify-content: center;
  padding: 40px 40px;
}
.login-box { width: 100%; }
.login-box-title { font-size: var(--fs-xl); font-weight: 700; color: var(--blue-dk); margin-bottom: 6px; }
.login-box-sub   { font-size: var(--fs-sm); color: var(--gray-4); margin-bottom: 28px; }
.login-box .fgroup { margin-bottom: 16px; }
.login-box input  { padding: 12px 14px; font-size: var(--fs-lg); }

/* 公開查詢快捷區 */
.public-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(150px,1fr)); gap: 10px; margin-top: 16px; }
.public-btn {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 16px 12px;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: var(--radius);
  color: #fff; cursor: pointer; text-decoration: none;
  font-size: var(--fs-sm); text-align: center;
  transition: background .15s;
}
.public-btn:hover { background: rgba(255,255,255,.22); color: #fff; text-decoration: none; }
.public-btn-icon { font-size: 26px; }

/* ── Footer ── */
.footer {
  background: var(--gray-9);
  color: rgba(255,255,255,.45);
  text-align: center;
  padding: 14px;
  font-size: var(--fs-sm);
}

/* ── 工具類 ── */
.flex        { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap-2  { gap: 8px; }
.gap-3  { gap: 12px; }
.mt-1   { margin-top: 6px; }
.mt-2   { margin-top: 10px; }
.mt-3   { margin-top: 16px; }
.mt-4   { margin-top: 24px; }
.mb-2   { margin-bottom: 10px; }
.mb-3   { margin-bottom: 16px; }
.mb-4   { margin-bottom: 24px; }
.w-full { width: 100%; }
.hidden { display: none; }
.bold   { font-weight: 700; }
.muted  { color: var(--gray-4); }
.small  { font-size: var(--fs-sm); }
.hint   { font-size: var(--fs-hint); }
.center { text-align: center; }
.text-red    { color: var(--red); }
.text-green  { color: var(--green); }
.text-blue   { color: var(--blue); }
.text-orange { color: var(--orange); }
.divider { border: none; border-top: 1px dashed var(--gray-2); margin: 20px 0; }

/* ── 列印 ── */
@media print {
  .topbar, .sidebar, .btn, .form-actions, .no-print { display: none !important; }
  .main { padding: 0; }
  .card { box-shadow: none; border: 1px solid #ccc; }
}

/* ── RWD ── */
@media (max-width: 900px) {
  .login-left { display: none; }
  .login-right { width: 100%; }
  .sidebar { display: none; }
  .main { padding: 16px; }
  .form-grid { grid-template-columns: 1fr; }
  .stat-row { grid-template-columns: 1fr 1fr; }
}
