style.scss 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945
  1. /* 共通樣式 */
  2. :root {
  3. --main-color: #000;
  4. --sub-color: #e47140;
  5. --gray-color: #727272;
  6. }
  7. * {
  8. letter-spacing: 1px;
  9. font-weight: 400;
  10. font-family: "Noto Sans TC", sans-serif !important;
  11. }
  12. p,
  13. li {
  14. line-height: 32px;
  15. overflow-wrap: break-word;
  16. word-break: break-word;
  17. }
  18. ul {
  19. list-style: none;
  20. }
  21. img {
  22. max-width: 100%;
  23. height: auto;
  24. }
  25. html,
  26. body {
  27. height: 100%;
  28. margin: 0;
  29. }
  30. body {
  31. display: flex;
  32. flex-direction: column;
  33. overflow-y: scroll;
  34. }
  35. .btn:focus,
  36. .form-control:focus {
  37. border-color: var(--main-color) !important;
  38. box-shadow: none !important;
  39. outline: 0 none !important;
  40. }
  41. .badge {
  42. font-weight: 400 !important;
  43. }
  44. .navbar {
  45. background-color: var(--main-color) !important;
  46. .navbar-collapse {
  47. flex-grow: 0;
  48. }
  49. .navbar-brand {
  50. font-size: 50px;
  51. font-weight: 500;
  52. font-family: "Roboto Slab", serif !important;
  53. color: var(--sub-color);
  54. transition: all 0.3s;
  55. @media (max-width: 575px) {
  56. padding-left: 1rem;
  57. font-size: 35px;
  58. }
  59. &:hover {
  60. opacity: 0.9;
  61. color: var(--sub-color);
  62. }
  63. }
  64. }
  65. .blog-post-tags {
  66. .badge {
  67. background-color: var(--main-color);
  68. &:hover {
  69. color: var(--main-color);
  70. background-color: #fff;
  71. border: 1px solid var(--main-color);
  72. }
  73. }
  74. }
  75. .blog-post-title {
  76. margin: 10px 0 20px;
  77. a {
  78. font-size: 40px;
  79. font-weight: 500;
  80. @media (max-width: 575px) {
  81. font-size: 35px;
  82. }
  83. }
  84. }
  85. .pagination {
  86. justify-content: center;
  87. .page-link {
  88. color: var(--main-color);
  89. }
  90. .page-item.active .page-link {
  91. z-index: 3;
  92. color: #fff;
  93. background-color: var(--main-color);
  94. border-color: var(--main-color);
  95. }
  96. }
  97. .post-title {
  98. a {
  99. color: #000;
  100. text-decoration: none;
  101. font-size: 22px;
  102. font-weight: 500;
  103. }
  104. }
  105. .post-block-title {
  106. margin-bottom: 25px;
  107. position: relative;
  108. font-size: 20px;
  109. &::after {
  110. position: absolute;
  111. z-index: -10;
  112. top: 30px;
  113. left: 0;
  114. width: 100%;
  115. height: 0px;
  116. content: "";
  117. border-bottom: 1px solid var(--sub-color);
  118. bottom: 5px;
  119. }
  120. span {
  121. padding: 5px 20px;
  122. // font-weight: 500;
  123. color: #fff;
  124. font-weight: 300;
  125. background: var(--sub-color);
  126. }
  127. }
  128. .news-info {
  129. margin-top: 10px;
  130. line-height: 20px;
  131. a {
  132. padding: 0.1rem .3rem .2rem;
  133. font-size: 12px !important;
  134. font-weight: 500;
  135. color: #fff;
  136. text-decoration: none;
  137. transition: all 0.3s;
  138. background-color: #7a7a7a;
  139. border-radius: 5px;
  140. &:hover {
  141. opacity: 0.8;
  142. }
  143. }
  144. small {
  145. color: var(--gray-color);
  146. }
  147. }
  148. .news-thumbnail {
  149. height: 100%;
  150. object-fit: cover;
  151. }
  152. // 文字省略
  153. .line-clamp {
  154. max-width: 150px;
  155. display: -webkit-box;
  156. -webkit-line-clamp: 2;
  157. -webkit-box-orient: vertical;
  158. overflow: hidden;
  159. text-overflow: ellipsis;
  160. }
  161. .post-depiction {
  162. // max-width: 350px;
  163. margin: 10px 0;
  164. display: -webkit-box;
  165. -webkit-line-clamp: 2;
  166. -webkit-box-orient: vertical;
  167. overflow: hidden;
  168. text-overflow: ellipsis;
  169. line-height: 26px;
  170. a {
  171. color: #7a7a7a;
  172. text-decoration: none;
  173. }
  174. }
  175. .top-btn {
  176. position: fixed;
  177. bottom: 15px;
  178. right: 15px;
  179. z-index: 10;
  180. opacity: 0; // scrollTop = 0
  181. transition: all 0.5s;
  182. button {
  183. border: none;
  184. background: var(--sub-color);
  185. border-radius: 100px;
  186. width: 55px;
  187. height: 55px;
  188. }
  189. }
  190. .show {
  191. opacity: 1; // scrollTop > 100
  192. }
  193. .blog-header {
  194. .nav-item {
  195. padding: 0 0.3rem;
  196. @media (max-width: 575px) {
  197. padding: 0 1rem;
  198. }
  199. }
  200. }
  201. /* sidebar.html Start */
  202. .news-sidebar {
  203. position: sticky;
  204. top: 15px;
  205. .news-featured {
  206. position: unset;
  207. }
  208. }
  209. .search-btn {
  210. border: 1px solid var(--main-color) !important;
  211. svg {
  212. color: var(--main-color);
  213. }
  214. &:hover {
  215. background-color: var(--main-color) !important;
  216. svg {
  217. color: #fff;
  218. }
  219. }
  220. }
  221. .tags {
  222. margin: 0 5px 5px 0;
  223. padding: 7px 10px !important;
  224. font-size: 14px !important;
  225. font-weight: 400 !important;
  226. color: var(--main-color) !important;
  227. border: 1px solid var(--main-color) !important;
  228. &:hover {
  229. color: #fff !important;
  230. background-color: var(--main-color);
  231. }
  232. }
  233. /* sidebar.html End */
  234. /* single.html Start */
  235. .blog-post.content {
  236. .content {
  237. padding-bottom: 3rem;
  238. img {
  239. max-height: 500px;
  240. object-fit: contain;
  241. }
  242. }
  243. .toc-container {
  244. padding: 1.5rem;
  245. margin: 3rem 0;
  246. background: #f9f9f9;
  247. border: 1px solid #aaa;
  248. border-radius: 5px;
  249. ul {
  250. margin-bottom: 0;
  251. list-style: disc;
  252. a {
  253. color: var(--sub-color);
  254. text-decoration: none;
  255. }
  256. }
  257. .title {
  258. display: block;
  259. margin-left: 1rem;
  260. margin-bottom: 0.5rem !important;
  261. font-size: 1.25rem;
  262. color: #000;
  263. }
  264. }
  265. h2 {
  266. padding-left: 1rem;
  267. margin: 5rem 0 1.5rem;
  268. border-left: 7px solid var(--sub-color);
  269. }
  270. h4 {
  271. margin-top: 3rem;
  272. font-size: 1.25rem;
  273. font-weight: 500;
  274. line-height: 32px;
  275. a {
  276. padding: 5px 8px;
  277. margin-right: 3px;
  278. border: 1px solid #000;
  279. border-radius: 5px;
  280. font-size: 14px;
  281. &:hover {
  282. color: #fff !important;
  283. }
  284. }
  285. }
  286. }
  287. .back-link {
  288. color: #000;
  289. display: block;
  290. text-align: center;
  291. text-decoration: none;
  292. transition: all 0.3s;
  293. &:hover {
  294. opacity: 0.7;
  295. }
  296. }
  297. /* single.html End */
  298. /* content.html Start */
  299. .news-main {
  300. height: 100%;
  301. overflow: hidden;
  302. a {
  303. text-decoration: none;
  304. }
  305. .title-info {
  306. position: absolute;
  307. bottom: 0;
  308. left: 0;
  309. right: 0;
  310. z-index: 10;
  311. padding: 1rem;
  312. background: linear-gradient(to top,
  313. rgba(0, 0, 0, 0.95) 0%,
  314. rgba(0, 0, 0, 0.7) 50%,
  315. rgba(0, 0, 0, 0.3) 80%,
  316. transparent 100%);
  317. a,
  318. h2,
  319. small {
  320. color: #fff;
  321. letter-spacing: 1px;
  322. }
  323. h2 {
  324. line-height: 1.5;
  325. a {
  326. font-weight: 500;
  327. font-size: 1.25rem;
  328. display: -webkit-box;
  329. -webkit-box-orient: vertical;
  330. -webkit-line-clamp: 2; // 顯示兩行
  331. overflow: hidden;
  332. text-overflow: ellipsis;
  333. word-break: break-word;
  334. @media (max-width: 991px) {
  335. font-size: 1.25rem;
  336. }
  337. }
  338. }
  339. .badge-link {
  340. display: inline-block;
  341. padding: 1px 20px;
  342. margin-bottom: 10px;
  343. background-color: var(--sub-color);
  344. font-weight: 500;
  345. }
  346. }
  347. .post-title {
  348. a {
  349. font-size: 34px;
  350. }
  351. }
  352. img {
  353. height: 100%;
  354. object-fit: cover;
  355. }
  356. // .main-img {
  357. // @media (max-width: 991px) {
  358. // height: 50vw;
  359. // }
  360. // }
  361. .news-info {
  362. a {
  363. font-size: 16px;
  364. }
  365. }
  366. }
  367. // .news-main {
  368. // height: 100%;
  369. // overflow: hidden;
  370. // .post-title {
  371. // a {
  372. // font-size: 34px;
  373. // @media (max-width: 991px) {
  374. // font-size: 22px;
  375. // }
  376. // }
  377. // }
  378. // img {
  379. // height: 100%;
  380. // object-fit: cover;
  381. // }
  382. // .news-info {
  383. // a {
  384. // font-size: 16px;
  385. // }
  386. // }
  387. // }
  388. /* content.html End */
  389. /* focus.html Start */
  390. .focus-content {
  391. position: sticky;
  392. top: 20px;
  393. }
  394. .focus-content,
  395. .news-featured {
  396. img {
  397. width: 100%;
  398. height: 5vw;
  399. object-fit: cover;
  400. @media (max-width: 991px) {
  401. height: 15vw;
  402. }
  403. }
  404. .post-title {
  405. // 超過則省略
  406. overflow: hidden;
  407. text-overflow: ellipsis;
  408. display: -webkit-box;
  409. -webkit-line-clamp: 2;
  410. -webkit-box-orient: vertical;
  411. line-break: after-white-space;
  412. font-size: 1.125rem;
  413. }
  414. }
  415. /* focus.html End */
  416. /* recent.html Start */
  417. .recent-content {
  418. .news-list {
  419. margin: 0;
  420. li {
  421. margin: 15px 0;
  422. img {
  423. width: 140px;
  424. height: 105px;
  425. object-fit: cover;
  426. }
  427. small {
  428. display: block;
  429. }
  430. .news-info {
  431. margin-top: 0px;
  432. }
  433. }
  434. li:last-child {
  435. margin: 0;
  436. }
  437. }
  438. }
  439. /* recent.html End */
  440. /* news-tab.html Start */
  441. .tab-category {
  442. .nav-link {
  443. color: var(--main-color);
  444. font-weight: 500;
  445. }
  446. .nav-pills .nav-link.active,
  447. .nav-pills .show>.nav-link {
  448. color: var(--sub-color);
  449. background-color: var(--main-color);
  450. }
  451. }
  452. .tab-content {
  453. .bg-img {
  454. position: relative;
  455. height: 370px;
  456. // 設置背景混和模式為相乘模式
  457. background-blend-mode: multiply;
  458. background-size: cover;
  459. background-position: center center;
  460. cursor: pointer;
  461. @media (max-width: 991px) {
  462. height: 50vw;
  463. }
  464. section {
  465. padding: 10px 25px;
  466. position: absolute;
  467. bottom: 0;
  468. color: #fff;
  469. a {
  470. color: #fff;
  471. text-decoration: none;
  472. }
  473. small {
  474. font-size: 12px;
  475. }
  476. }
  477. }
  478. .post-title {
  479. line-height: 1;
  480. }
  481. .col-5 {
  482. img {
  483. width: 100%;
  484. height: 150px;
  485. }
  486. }
  487. }
  488. /* news-tab.html End */
  489. /* news-all.html Start */
  490. .news-all {
  491. .post-title {
  492. margin: 5px auto;
  493. a {
  494. font-size: 1.25rem;
  495. display: -webkit-box;
  496. -webkit-box-orient: vertical;
  497. -webkit-line-clamp: 2; // 顯示兩行
  498. overflow: hidden;
  499. text-overflow: ellipsis;
  500. word-break: break-word;
  501. }
  502. }
  503. .news-info {
  504. a {
  505. font-size: 14px;
  506. }
  507. }
  508. hr {
  509. margin: 1.5rem 0;
  510. }
  511. img {
  512. width: 100%;
  513. height: 12vw;
  514. object-fit: cover;
  515. @media (max-width: 991px) {
  516. height: 20vw;
  517. }
  518. @media (max-width: 575px) {
  519. height: 50vw;
  520. }
  521. }
  522. .line {
  523. padding: 0 12px;
  524. }
  525. // .first-img {
  526. // height: 50vh;
  527. // object-fit: cover;
  528. // }
  529. }
  530. /* news-all.html End */
  531. /* news-featured.html Start */
  532. .news-featured {
  533. position: sticky;
  534. top: 20px;
  535. .post-title {
  536. a {
  537. font-size: 18px;
  538. }
  539. }
  540. }
  541. /* news-featured.html End */
  542. /* news-video.html Start */
  543. .news-video,
  544. .local-video {
  545. .post-block-title {
  546. span {
  547. display: block;
  548. width: 100%;
  549. text-align: center;
  550. }
  551. }
  552. .post-title {
  553. a {
  554. font-size: 18px;
  555. display: -webkit-box;
  556. -webkit-line-clamp: 2;
  557. -webkit-box-orient: vertical;
  558. overflow: hidden;
  559. text-overflow: ellipsis;
  560. }
  561. }
  562. .news-info {
  563. a {
  564. font-size: 14px;
  565. }
  566. }
  567. }
  568. /* news-video.html End */
  569. .local-video {
  570. img {
  571. width: 100%;
  572. height: 140px;
  573. }
  574. }
  575. .news-main {
  576. .left-content {
  577. height: 30vh;
  578. }
  579. .right-content {
  580. height: 56.6vh;
  581. }
  582. .bottom-content {
  583. height: 35vh;
  584. }
  585. .left-content,
  586. .right-content,
  587. .bottom-content {
  588. @media (max-width: 991px) {
  589. height: 50vw;
  590. }
  591. }
  592. // /* 限制輪播高度 */
  593. // .video-swiper {
  594. // height: 650px;
  595. // /* 固定高度,讓 vertical 不會跑版 */
  596. // overflow: hidden;
  597. // /* 確保 slide 高度自適應 */
  598. // .swiper-slide {
  599. // height: auto !important;
  600. // .cover-img {
  601. // height: auto;
  602. // }
  603. // }
  604. // }
  605. }
  606. .tags-list {
  607. .cover-img {
  608. width: 100%;
  609. height: 230px;
  610. object-fit: cover;
  611. object-position: 0 25%;
  612. }
  613. }
  614. .feature-article {
  615. .float-right {
  616. float: right;
  617. max-width: 60%;
  618. margin: 1rem 0 1rem 1rem;
  619. border-radius: 12px;
  620. box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  621. }
  622. .float-left {
  623. float: left;
  624. max-width: 60%;
  625. margin: 1rem 1.5rem 0 0;
  626. border-radius: 12px;
  627. box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  628. }
  629. .float-right,
  630. .float-left {
  631. @media (max-width: 768px) {
  632. float: none;
  633. display: block;
  634. max-width: 100%;
  635. margin: 1rem auto;
  636. /* 圖片置中 */
  637. }
  638. }
  639. figure {
  640. margin: 2rem 0;
  641. text-align: center;
  642. }
  643. figure img {
  644. width: 100%;
  645. height: auto;
  646. box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
  647. }
  648. h1 {
  649. font-size: 3rem;
  650. margin: 3rem auto;
  651. padding-top: 1.5rem;
  652. border-top: 12px solid var(--sub-color);
  653. }
  654. h2 {
  655. padding: 1.5rem 0;
  656. margin: 2.5rem auto;
  657. border-top: 1px solid var(--sub-color);
  658. border-bottom: 1px solid var(--sub-color);
  659. text-align: center;
  660. color: var(--sub-color);
  661. font-size: 2.5rem;
  662. font-weight: 500;
  663. // position: relative;
  664. // display: inline-block;
  665. // line-height: 1.2;
  666. // isolation: isolate;
  667. // &::after {
  668. // content: "";
  669. // position: absolute;
  670. // left: -10px;
  671. // right: -2px;
  672. // bottom: -4px;
  673. // height: 20px;
  674. // background: rgba(255, 234, 0, 0.4);
  675. // transform: skewX(-30deg);
  676. // transform-origin: left bottom;
  677. // z-index: -1;
  678. // pointer-events: none;
  679. // }
  680. }
  681. h3,
  682. h4 {
  683. margin-bottom: 1rem;
  684. color: var(--sub-color);
  685. line-height: 1.5;
  686. }
  687. h3 {
  688. font-size: 1.625rem;
  689. }
  690. h4 {
  691. font-size: 1.5rem;
  692. }
  693. hr {
  694. margin: 3rem 0;
  695. }
  696. .feature-body {
  697. div,
  698. p {
  699. margin: 1.5rem 0 0;
  700. line-height: 2;
  701. font-size: 1.05rem;
  702. color: #222;
  703. }
  704. }
  705. .lead {
  706. display: inline-block;
  707. padding: 0.5rem 1.5rem;
  708. margin-bottom: 1.5rem;
  709. background-color: #f8f8f8;
  710. border-left: 5px solid var(--sub-color);
  711. border: 2px dotted #ccc;
  712. }
  713. ul {
  714. list-style: disc;
  715. li {
  716. margin-top: .5rem;
  717. }
  718. }
  719. ol {
  720. list-style: auto;
  721. }
  722. b,
  723. strong {
  724. font-weight: 700;
  725. }
  726. .toc {
  727. margin: 3rem 0;
  728. background: #f9f9f9;
  729. padding: 1rem 1.5rem;
  730. border-left: 4px solid var(--sub-color);
  731. font-size: 0.95rem;
  732. .toc-title {
  733. font-size: 1.25rem;
  734. font-weight: bold;
  735. margin: 1rem 0;
  736. }
  737. ul {
  738. list-style: none;
  739. padding-left: 0;
  740. li {
  741. margin: 0.15rem 0;
  742. font-size: 1rem;
  743. a {
  744. text-decoration: none;
  745. color: var(--sub-color);
  746. &:hover {
  747. text-decoration: underline;
  748. }
  749. }
  750. // 解決空 li 造成的空白
  751. &:empty {
  752. display: none;
  753. }
  754. }
  755. }
  756. }
  757. .quote-accent {
  758. display: flex;
  759. align-items: flex-start;
  760. gap: 0.5rem;
  761. padding: 1rem 0;
  762. font-size: 2rem;
  763. font-weight: 600;
  764. border-top: 4px solid var(--sub-color);
  765. &::before {
  766. content: "“";
  767. flex: 0 0 auto;
  768. font-family: Georgia, "Times New Roman", serif;
  769. font-size: 2.8em;
  770. line-height: 0.6;
  771. color: var(--sub-color);
  772. margin-top: 0.1em;
  773. }
  774. &>p {
  775. margin: 0;
  776. }
  777. }
  778. }