style.scss 13 KB

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