/* ============================================================
   勞校小學首頁 · UI 預覽樣式（僅覆蓋外觀，不改動任何內容/連結）
   設計方向：清爽校园编辑风 / Clean Editorial Campus
   ============================================================ */
:root {
  --ink: #173743;
  --ink-soft: #405760;
  --muted: #8b9aa2;
  --line: #e4ebef;
  --canvas: #f4f7f9;
  --paper: #ffffff;
  --accent: #2e86ab;
  --accent-deep: #1f6d8c;
  --sidebar: #173743;
}

html, body { background: var(--canvas); }
body, input, select, textarea {
  font-family: "Noto Sans TC", "Microsoft JhengHei", "PingFang TC", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink-soft);
  line-height: 1.7;
}
a { border-bottom: 0; transition: color .2s ease, opacity .2s ease; }

/* ---- 版面 ---- */
#wrapper { align-items: stretch; }
#main > .inner { max-width: 1200px; padding: 0 4em 1.5em; }
#main > .inner > section { padding: 3.5em 0 2em; border-top: 1px solid var(--line); }
#main > .inner > section:first-of-type { border-top: 0; }

/* ---- 頁首 Logo ---- */
#header { border-bottom: 0; padding: 3.15em 0 1.75em; }
#header:after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px;
  background: linear-gradient(90deg, var(--accent) 0, var(--accent) 84px, var(--line) 84px, var(--line) 100%);
}
#header .logo { text-align: center; }
#header .logo img {
  width: 84%; max-width: 620px; height: auto; border: 0;
}

/* ---- 區塊標題 ---- */
#main .major { margin: 0 0 1.6em; }
#main .major h2 {
  color: var(--ink); font-size: 2.05rem; font-weight: 700; letter-spacing: .01em;
  padding-left: 1rem; position: relative; line-height: 1.35;
}
#main .major h2:before {
  content: ""; position: absolute; left: 0; top: .2em; bottom: .2em;
  width: 5px; border-radius: 3px; background: var(--accent);
}

/* ---- 新聞輪播 ---- */
.lh-carousel {
  border: 0; border-radius: 18px; background: var(--paper);
  box-shadow: 0 18px 44px rgba(23, 55, 67, .12);
  margin: 0 0 2em; overflow: hidden;
}
.lh-carousel .lh-carousel-viewport { border-radius: 18px 18px 0 0; }
.lh-carousel .lh-slide-img { height: 420px; }
.lh-carousel .lh-slide-caption {
  background: linear-gradient(0deg, rgba(13, 39, 52, .94) 0%, rgba(13, 39, 52, .72) 55%, rgba(13, 39, 52, 0) 100%);
  padding: 4.5em 2em 1.5em; text-align: left; font-size: 1.28rem;
  font-weight: 600; letter-spacing: .015em; text-shadow: 0 1px 8px rgba(0,0,0,.25);
}
.lh-carousel .lh-slide-caption:before {
  content: ""; display: block; width: 36px; height: 3px; border-radius: 2px;
  background: #7fd0ea; margin-bottom: .55em;
}
.lh-carousel .lh-btn {
  width: 48px; height: 48px; border-radius: 50%;
  background: rgba(255,255,255,.92); color: var(--ink);
  box-shadow: 0 6px 18px rgba(0,0,0,.18); font-size: 1.35rem;
  transition: background .2s ease, transform .2s ease;
}
.lh-carousel .lh-btn:hover { background: #fff; transform: translateY(-50%) scale(1.06); }
.lh-carousel .lh-btn.lh-prev { left: 18px; }
.lh-carousel .lh-btn.lh-next { right: 18px; }
.lh-carousel .lh-dots { gap: 7px; padding: 14px 0; background: #fff; }
.lh-carousel .lh-dots button {
  width: 26px; height: 5px; border-radius: 99px; border: 0; background: #d8e2e7;
  transition: width .25s ease, background .25s ease;
}
.lh-carousel .lh-dots button.lh-active { width: 46px; background: var(--accent); border-color: var(--accent); }

/* ---- 校園新聞 ---- */
.lh-news {
  border: 0; border-radius: 18px; background: var(--paper);
  box-shadow: 0 12px 32px rgba(23, 55, 67, .09);
}
.lh-news .lh-news-head {
  background: var(--paper); color: var(--ink);
  padding: 1.25em 1.6em; border-bottom: 1px solid var(--line); gap: .6em;
}
.lh-news .lh-news-head h3 { color: var(--ink); font-size: 1.35rem; letter-spacing: .01em; }
.lh-news .lh-news-head h3:before {
  content: ""; display: inline-block; width: 9px; height: 9px; border-radius: 50%;
  background: var(--accent); margin-right: .55em; vertical-align: .12em;
}
.lh-news .lh-news-head .lh-filters { gap: .4em; }
.lh-news .lh-news-head .lh-filters .lh-filter {
  background: #f3f7f9; border: 1px solid var(--line); color: #637780 !important;
  padding: .32em 1em; font-size: .88rem; border-radius: 999px;
  transition: all .2s ease;
}
.lh-news .lh-news-head .lh-filters .lh-filter:hover {
  background: #e8f2f6; color: var(--accent-deep) !important; border-color: #bcdae5;
}
.lh-news .lh-news-head .lh-filters .lh-filter.active {
  background: var(--accent); color: #fff !important; border-color: var(--accent);
  box-shadow: 0 5px 14px rgba(46,134,171,.25);
}
.lh-news .lh-news-head a {
  color: var(--accent); font-size: .9rem; font-weight: 600;
  border-bottom: 0; white-space: nowrap;
}
.lh-news .lh-news-head a:hover { color: var(--accent-deep); }
.lh-news .lh-status {
  background: #f9fbfc; color: #93a1a9; padding: .5em 1.6em;
  font-size: .82rem; border-bottom: 1px solid var(--line);
}
.lh-news .lh-news-cols > ul { flex: 1 1 300px; }
.lh-news .lh-news-cols li {
  padding: .85em 1.6em; border-bottom: 1px solid #f0f4f6;
  transition: background .2s ease;
}
.lh-news .lh-news-cols li:hover { background: #f8fbfc; }
.lh-news .lh-news-cols a.lh-t {
  color: #2b404a; font-size: 1rem; line-height: 1.5; border-bottom: 0;
  white-space: normal; display: block;
}
.lh-news .lh-news-cols a.lh-t:before {
  content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent); margin-right: .6em; vertical-align: .25em;
}
.lh-news .lh-news-cols a.lh-t:hover { color: var(--accent); }
.lh-news .lh-news-cols .lh-meta { margin-top: .2em; padding-left: 1.1em; font-size: .8rem; color: #9aa8af; }
.lh-news .lh-news-cols .lh-meta .lh-v { color: #b0bcc2; }

/* ---- 側邊欄 ---- */
#sidebar {
  background: var(--sidebar); font-size: .9em;
  box-shadow: inset -1px 0 0 rgba(255,255,255,.06);
}
#sidebar > .inner { padding: 2.6em 2em 2em; }
#sidebar > .inner > * {
  border-bottom: 1px solid rgba(255,255,255,.1);
  margin: 0 0 2.6em; padding: 0 0 2.6em;
}
#sidebar > .inner > .alt {
  background: rgba(255,255,255,.05);
  margin: 0 0 2.6em; padding: 1.35em;
  width: auto; border: 1px solid rgba(255,255,255,.09);
  border-radius: 14px;
}
#sidebar header.major h6 {
  color: #8fd3e8; font-size: .78rem; font-weight: 700;
  letter-spacing: .2em; text-transform: uppercase; margin: 0 0 1.1em;
}
#sidebar p { color: #9db2bd; }

/* 搜尋：白底輸入條 + 同排按鈕，低對比更舒服 */
#search form {
  position: relative; display: flex; align-items: center; gap: 0;
  background: #fff; border: 1px solid rgba(255,255,255,.18);
  border-radius: 12px; padding: .28em;
  box-shadow: 0 8px 20px rgba(0,0,0,.18);
  transition: box-shadow .2s ease;
}
#search form:focus-within { box-shadow: 0 0 0 3px rgba(143,211,232,.32), 0 8px 20px rgba(0,0,0,.2); }
#search form:before { display: none; }
#search input[type="test"] {
  flex: 1 1 auto; min-width: 0; background: transparent; border: 0; border-radius: 8px;
  color: #173743; padding: .55em .6em .55em 2.15em;
  font-family: inherit; font-size: .88rem; outline: none; box-shadow: none;
}
#search input[type="test"]::placeholder { color: #5d6f78; opacity: 1; }
#search .fa-search {
  position: absolute; left: .95em; top: 50%; transform: translateY(-50%);
  color: #7f9aa8; font-size: 1rem; pointer-events: none;
}
#search input[type="submit"] {
  flex: 0 0 auto; margin-left: .25em;
  background: #1f6d8c; color: #ffffff; border: 0; border-radius: 9px;
  padding: .5em .95em; font-family: inherit; font-size: .82rem; font-weight: 700;
  cursor: pointer; transition: background .2s ease, transform .2s ease;
}
#search input[type="submit"]:hover { background: #175773; transform: translateY(-1px); }

/* 選單 */
#menu ul { font-family: inherit; text-transform: none; letter-spacing: 0; }
#menu ul a, #menu ul span {
  color: #d8e5eb; font-size: .98rem; padding: .4em 0;
  font-family: inherit; letter-spacing: 0; text-transform: none;
}
#menu ul a:hover, #menu ul span:hover {
  color: #fff; font-size: .98rem; font-weight: 400;
  font-family: inherit; letter-spacing: 0;
}
#menu ul h5 { font-size: 1rem; margin: 0; line-height: 1.6; font-weight: 600; }
#menu ul h2 { font-size: .88rem; margin: 0; line-height: 1.6; font-weight: 400; }
#menu > ul > li { border-top: 1px solid rgba(255,255,255,.1); margin: .15em 0 0; padding: .5em 0; }
#menu > ul > li > ul { margin: .2em 0 .9em; padding-left: .9em; border-left: 2px solid rgba(143,211,232,.35); }
#menu > ul > li > ul a, #menu > ul > li > ul span { font-size: .88rem; color: #a9bec8; }
#menu > ul > li > ul a:hover, #menu > ul > li > ul span:hover { color: #8fd3e8; font-size: .88rem; }
#menu ul span.opener:before { color: #7fabbc; }
#menu ul span.opener.active:before { color: #8fd3e8; }

/* 實用網站：迷你海報卡（紋理 + 光暈 + 標題疊層）；標題文字與連結完全不變 */
#sidebar .mini-posts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.1em .7em; }
#sidebar .mini-posts article {
  position: relative; border-top: 0; margin: 0; padding: 0;
  --bg1: rgba(143,211,232,.22); --bg2: rgba(46,134,171,.10);
  --icon: #9fd9ec; --halo: rgba(143,211,232,.16); --edge: rgba(143,211,232,.55);
  --dot: rgba(255,255,255,.14);
}
#sidebar .mini-posts article .image {
  position: relative; display: flex; align-items: flex-start; justify-content: flex-start;
  margin: 0; border: 1px solid rgba(255,255,255,.14); border-radius: 12px;
  aspect-ratio: 1.35 / 1; overflow: hidden; padding: .7em .75em;
  background-image: radial-gradient(var(--dot) 1px, transparent 1.4px), linear-gradient(135deg, var(--bg1), var(--bg2));
  background-size: 11px 11px, cover;
  box-shadow: inset 0 -3px 0 var(--edge);
  transition: transform .25s ease, border-color .25s ease;
}
#sidebar .mini-posts article:nth-child(3n) .image {
  background-image: repeating-linear-gradient(45deg, rgba(255,255,255,.07) 0 5px, transparent 5px 11px), linear-gradient(135deg, var(--bg1), var(--bg2));
  background-size: auto, cover;
}
#sidebar .mini-posts article:nth-child(4n) .image {
  background-image: repeating-linear-gradient(90deg, rgba(255,255,255,.06) 0 2px, transparent 2px 9px), linear-gradient(135deg, var(--bg1), var(--bg2));
  background-size: auto, cover;
}
#sidebar .mini-posts article .image:before {
  content: ""; position: absolute; right: -20px; top: -26px;
  width: 86px; height: 86px; border-radius: 50%;
  background: var(--halo); border: 1px solid var(--edge);
  transition: transform .3s ease;
}
#sidebar .mini-posts article .image img { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
#sidebar .mini-posts article .image:after {
  position: relative; z-index: 1; margin-top: .1em;
  font-family: FontAwesome; font-style: normal; font-weight: normal;
  font-size: 2rem; line-height: 1; color: var(--icon);
  text-shadow: 0 2px 10px rgba(0,0,0,.18);
  transition: transform .25s ease, color .25s ease;
}
/* 依原順序：AI工具 / 繪本 / 科技交流 / 直播 / 影片庫 / 授權書 / 打字 / 學習平台 / 英文電子書 / 工聯 / 校園姿采 / 優秀作品 */
#sidebar .mini-posts article:nth-child(1)  { --bg1: rgba(143,211,232,.22); --bg2: rgba(46,134,171,.10); --icon: #9fd9ec; --halo: rgba(143,211,232,.16); --edge: rgba(143,211,232,.55); }
#sidebar .mini-posts article:nth-child(2)  { --bg1: rgba(127,216,200,.22); --bg2: rgba(45,150,140,.10); --icon: #8ee0d2; --halo: rgba(127,216,200,.16); --edge: rgba(127,216,200,.55); }
#sidebar .mini-posts article:nth-child(3)  { --bg1: rgba(240,194,122,.24); --bg2: rgba(200,140,60,.10); --icon: #f2c981; --halo: rgba(240,194,122,.18); --edge: rgba(240,194,122,.6); }
#sidebar .mini-posts article:nth-child(4)  { --bg1: rgba(242,164,143,.22); --bg2: rgba(210,110,85,.10); --icon: #f4ad99; --halo: rgba(242,164,143,.16); --edge: rgba(242,164,143,.55); }
#sidebar .mini-posts article:nth-child(5)  { --bg1: rgba(169,189,240,.22); --bg2: rgba(90,115,190,.10); --icon: #b3c6f5; --halo: rgba(169,189,240,.16); --edge: rgba(169,189,240,.55); }
#sidebar .mini-posts article:nth-child(6)  { --bg1: rgba(183,201,214,.20); --bg2: rgba(110,135,150,.10); --icon: #c2d3de; --halo: rgba(183,201,214,.14); --edge: rgba(183,201,214,.5); }
#sidebar .mini-posts article:nth-child(7)  { --bg1: rgba(143,211,232,.22); --bg2: rgba(46,134,171,.10); --icon: #9fd9ec; --halo: rgba(143,211,232,.16); --edge: rgba(143,211,232,.55); }
#sidebar .mini-posts article:nth-child(8)  { --bg1: rgba(169,189,240,.22); --bg2: rgba(90,115,190,.10); --icon: #b3c6f5; --halo: rgba(169,189,240,.16); --edge: rgba(169,189,240,.55); }
#sidebar .mini-posts article:nth-child(9)  { --bg1: rgba(168,217,160,.22); --bg2: rgba(80,150,100,.10); --icon: #b3e0aa; --halo: rgba(168,217,160,.16); --edge: rgba(168,217,160,.55); }
#sidebar .mini-posts article:nth-child(10) { --bg1: rgba(183,201,214,.20); --bg2: rgba(110,135,150,.10); --icon: #c2d3de; --halo: rgba(183,201,214,.14); --edge: rgba(183,201,214,.5); }
#sidebar .mini-posts article:nth-child(11) { --bg1: rgba(127,216,200,.22); --bg2: rgba(45,150,140,.10); --icon: #8ee0d2; --halo: rgba(127,216,200,.16); --edge: rgba(127,216,200,.55); }
#sidebar .mini-posts article:nth-child(12) { --bg1: rgba(240,194,122,.24); --bg2: rgba(200,140,60,.10); --icon: #f2c981; --halo: rgba(240,194,122,.18); --edge: rgba(240,194,122,.6); }
#sidebar .mini-posts article:nth-child(1) .image:after  { content: "\f0d0"; }
#sidebar .mini-posts article:nth-child(2) .image:after  { content: "\f02d"; }
#sidebar .mini-posts article:nth-child(3) .image:after  { content: "\f091"; }
#sidebar .mini-posts article:nth-child(4) .image:after  { content: "\f03d"; }
#sidebar .mini-posts article:nth-child(5) .image:after  { content: "\f144"; }
#sidebar .mini-posts article:nth-child(6) .image:after  { content: "\f0c6"; }
#sidebar .mini-posts article:nth-child(7) .image:after  { content: "\f11c"; }
#sidebar .mini-posts article:nth-child(8) .image:after  { content: "\f109"; }
#sidebar .mini-posts article:nth-child(9) .image:after  { content: "\f0ac"; }
#sidebar .mini-posts article:nth-child(10) .image:after { content: "\f1ad"; }
#sidebar .mini-posts article:nth-child(11) .image:after { content: "\f1ea"; }
#sidebar .mini-posts article:nth-child(12) .image:after { content: "\f005"; }
#sidebar .mini-posts article:nth-child(3n) .image:after { font-size: 2.3rem; }
#sidebar .mini-posts article:nth-child(4n) .image:after { font-size: 1.95rem; }
#sidebar .mini-posts article:hover .image {
  transform: translateY(-3px); border-color: var(--edge);
  box-shadow: inset 0 -3px 0 var(--edge), 0 10px 22px rgba(0,0,0,.22);
}
#sidebar .mini-posts article:hover .image:before { transform: scale(1.14) rotate(12deg); }
#sidebar .mini-posts article:hover .image:after { color: #fff; transform: scale(1.1) translateY(-2px); }
#sidebar .mini-posts article p {
  position: absolute; z-index: 2; left: 0; right: 0; bottom: 0;
  margin: 0; padding: 2.1em .75em .6em;
  background: linear-gradient(0deg, rgba(9,28,38,.95) 0%, rgba(9,28,38,.78) 52%, rgba(9,28,38,0) 100%);
  color: #fff; font-size: .76rem; font-weight: 600; line-height: 1.4;
  text-align: left; pointer-events: none;
}
#sidebar .mini-posts article:hover p { color: #9fd9ec; }

/* 聯絡 */
#sidebar ul.contact li {
  border-top: 1px solid rgba(255,255,255,.1);
  margin: .9em 0 0; padding: .85em 0 .85em 2.8em;
}
#sidebar ul.contact li:before { color: #6cb6d2; top: .78em; font-size: 1.35em; }
#sidebar ul.contact li:first-child { border-top: 0; margin-top: 0; padding-top: 0; }
#sidebar ul.contact li:first-child:before { top: -.05em; }
#sidebar ul.contact h4 { font-size: 1rem; line-height: 1.55; margin: 0; }
#sidebar ul.contact p { font-size: .78rem; margin: 0; color: #8fa5b8; }
#sidebar ul.contact a { color: #d8e5eb; border-bottom: 0; }

/* 頁尾 */
#footer { border-top: 1px solid var(--line); padding: 1.75em 0 .5em; }
#footer p, #footer .copyright { color: #98a6ad; font-size: .8rem; margin: 0; }

/* ---- 動效 ---- */
.lh-carousel, .lh-news { animation: ui-rise .55s cubic-bezier(.16,1,.3,1) both; }
.lh-news { animation-delay: .08s; }
@keyframes ui-rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .lh-carousel, .lh-news { animation: none; }
  * { scroll-behavior: auto !important; }
}

/* ---- 響應式 ---- */
@media screen and (max-width: 1280px) {
  #main > .inner { padding: 0 2.75em 1.5em; }
  .lh-carousel .lh-slide-img { height: 360px; }
}
@media screen and (max-width: 736px) {
  #main > .inner { padding: 0 1.35em 1.5em; }
  #main > .inner > section { padding: 2.5em 0 1.5em; }
  #header { padding: 1.75em 0 1.25em; }
  #header .logo img { width: 92%; }
  #main .major h2 { font-size: 1.65rem; }
  .lh-carousel { border-radius: 14px; }
  .lh-carousel .lh-slide-img { height: auto; }
  .lh-carousel .lh-slide-caption {
    font-size: 1rem; padding: 1.1em 1.2em; text-align: center;
    background: rgba(13,39,52,.92);
  }
  .lh-carousel .lh-slide-caption:before { display: none; }
  .lh-carousel .lh-btn { width: 38px; height: 38px; font-size: 1.1rem; }
  .lh-carousel .lh-btn.lh-prev { left: 8px; }
  .lh-carousel .lh-btn.lh-next { right: 8px; }
  .lh-news .lh-news-head { padding: 1.1em; }
  .lh-news .lh-news-head h3 { font-size: 1.15rem; width: 100%; }
  .lh-news .lh-news-head a { width: 100%; }
  .lh-news .lh-status { padding: .5em 1.1em; }
  .lh-news .lh-news-cols > ul { flex: 1 1 100%; }
  .lh-news .lh-news-cols li { padding: .75em 1.1em; }
  #sidebar .mini-posts { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1em .7em; }
}
