style.scss 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896
  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(
  301. to top,
  302. rgba(0, 0, 0, 0.95) 0%,
  303. rgba(0, 0, 0, 0.7) 50%,
  304. rgba(0, 0, 0, 0.3) 80%,
  305. transparent 100%
  306. );
  307. a,
  308. h2,
  309. small {
  310. color: #fff;
  311. letter-spacing: 1px;
  312. }
  313. h2 {
  314. line-height: 1.5;
  315. a {
  316. font-weight: 500;
  317. font-size: 1.5rem;
  318. display: -webkit-box;
  319. -webkit-box-orient: vertical;
  320. -webkit-line-clamp: 2; // 顯示兩行
  321. overflow: hidden;
  322. text-overflow: ellipsis;
  323. word-break: break-word;
  324. @media (max-width: 991px) {
  325. font-size: 1.25rem;
  326. }
  327. }
  328. }
  329. .badge-link {
  330. display: inline-block;
  331. padding: 1px 20px;
  332. margin-bottom: 10px;
  333. background-color: var(--sub-color);
  334. font-weight: 500;
  335. }
  336. }
  337. .post-title {
  338. a {
  339. font-size: 34px;
  340. }
  341. }
  342. img {
  343. height: 100%;
  344. object-fit: cover;
  345. }
  346. // .main-img {
  347. // @media (max-width: 991px) {
  348. // height: 50vw;
  349. // }
  350. // }
  351. .news-info {
  352. a {
  353. font-size: 16px;
  354. }
  355. }
  356. }
  357. // .news-main {
  358. // height: 100%;
  359. // overflow: hidden;
  360. // .post-title {
  361. // a {
  362. // font-size: 34px;
  363. // @media (max-width: 991px) {
  364. // font-size: 22px;
  365. // }
  366. // }
  367. // }
  368. // img {
  369. // height: 100%;
  370. // object-fit: cover;
  371. // }
  372. // .news-info {
  373. // a {
  374. // font-size: 16px;
  375. // }
  376. // }
  377. // }
  378. /* content.html End */
  379. /* focus.html Start */
  380. .focus-content {
  381. position: sticky;
  382. top: 20px;
  383. }
  384. .focus-content,
  385. .news-featured {
  386. img {
  387. height: 5vw;
  388. object-fit: cover;
  389. @media (max-width: 991px) {
  390. height: 15vw;
  391. }
  392. }
  393. .post-title {
  394. // 超過則省略
  395. overflow: hidden;
  396. text-overflow: ellipsis;
  397. display: -webkit-box;
  398. -webkit-line-clamp: 2;
  399. -webkit-box-orient: vertical;
  400. line-break: after-white-space;
  401. font-size: 1.125rem;
  402. }
  403. }
  404. /* focus.html End */
  405. /* recent.html Start */
  406. .recent-content {
  407. .news-list {
  408. margin: 0;
  409. li {
  410. margin: 15px 0;
  411. img {
  412. width: 140px;
  413. height: 105px;
  414. object-fit: cover;
  415. }
  416. small {
  417. display: block;
  418. }
  419. .news-info {
  420. margin-top: 0px;
  421. }
  422. }
  423. li:last-child {
  424. margin: 0;
  425. }
  426. }
  427. }
  428. /* recent.html End */
  429. /* news-tab.html Start */
  430. .tab-category {
  431. .nav-link {
  432. color: var(--main-color);
  433. font-weight: 500;
  434. }
  435. .nav-pills .nav-link.active,
  436. .nav-pills .show > .nav-link {
  437. color: var(--sub-color);
  438. background-color: var(--main-color);
  439. }
  440. }
  441. .tab-content {
  442. .bg-img {
  443. position: relative;
  444. height: 370px;
  445. // 設置背景混和模式為相乘模式
  446. background-blend-mode: multiply;
  447. background-size: cover;
  448. background-position: center center;
  449. cursor: pointer;
  450. @media (max-width: 991px) {
  451. height: 50vw;
  452. }
  453. section {
  454. padding: 10px 25px;
  455. position: absolute;
  456. bottom: 0;
  457. color: #fff;
  458. a {
  459. color: #fff;
  460. text-decoration: none;
  461. }
  462. small {
  463. font-size: 12px;
  464. }
  465. }
  466. }
  467. .col-5 {
  468. img {
  469. height: 150px;
  470. }
  471. }
  472. }
  473. /* news-tab.html End */
  474. /* news-all.html Start */
  475. .news-all {
  476. .post-title {
  477. margin: 5px auto;
  478. a {
  479. font-size: 1.5rem;
  480. display: -webkit-box;
  481. -webkit-box-orient: vertical;
  482. -webkit-line-clamp: 2; // 顯示兩行
  483. overflow: hidden;
  484. text-overflow: ellipsis;
  485. word-break: break-word;
  486. }
  487. }
  488. .news-info {
  489. a {
  490. font-size: 18px;
  491. }
  492. }
  493. hr {
  494. margin: 1.5rem 0;
  495. }
  496. img {
  497. height: 12vw;
  498. object-fit: cover;
  499. @media (max-width: 991px) {
  500. height: 20vw;
  501. }
  502. @media (max-width: 575px) {
  503. height: 50vw;
  504. }
  505. }
  506. .line {
  507. padding: 0 12px;
  508. }
  509. // .first-img {
  510. // height: 50vh;
  511. // object-fit: cover;
  512. // }
  513. }
  514. /* news-all.html End */
  515. /* news-featured.html Start */
  516. .news-featured {
  517. position: sticky;
  518. top: 20px;
  519. }
  520. /* news-featured.html End */
  521. /* news-video.html Start */
  522. .news-video {
  523. .post-block-title {
  524. span {
  525. display: block;
  526. width: 100%;
  527. text-align: center;
  528. }
  529. }
  530. .post-title {
  531. a {
  532. font-size: 18px;
  533. display: -webkit-box;
  534. -webkit-line-clamp: 2;
  535. -webkit-box-orient: vertical;
  536. overflow: hidden;
  537. text-overflow: ellipsis;
  538. }
  539. }
  540. .news-info {
  541. a {
  542. font-size: 14px;
  543. }
  544. }
  545. }
  546. /* news-video.html End */
  547. .news-main {
  548. .left-content {
  549. height: 45vh;
  550. }
  551. .right-content {
  552. height: 55vh;
  553. }
  554. .bottom-content {
  555. height: 35vh;
  556. }
  557. .left-content,
  558. .right-content,
  559. .bottom-content {
  560. @media (max-width: 991px) {
  561. height: 50vw;
  562. }
  563. }
  564. // /* 限制輪播高度 */
  565. // .video-swiper {
  566. // height: 650px;
  567. // /* 固定高度,讓 vertical 不會跑版 */
  568. // overflow: hidden;
  569. // /* 確保 slide 高度自適應 */
  570. // .swiper-slide {
  571. // height: auto !important;
  572. // .cover-img {
  573. // height: auto;
  574. // }
  575. // }
  576. // }
  577. }
  578. .tags-list {
  579. .cover-img {
  580. height: 230px;
  581. object-fit: cover;
  582. }
  583. }
  584. .feature-article {
  585. .float-right {
  586. float: right;
  587. max-width: 60%;
  588. margin: 1rem 0 0 1rem;
  589. border-radius: 12px;
  590. box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  591. }
  592. .float-left {
  593. float: left;
  594. max-width: 60%;
  595. margin: 1rem 1.5rem 0 0;
  596. border-radius: 12px;
  597. box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  598. }
  599. .float-right,
  600. .float-left {
  601. @media (max-width: 768px) {
  602. float: none;
  603. display: block;
  604. max-width: 100%;
  605. margin: 1rem auto;
  606. /* 圖片置中 */
  607. }
  608. }
  609. figure {
  610. margin: 2rem 0;
  611. text-align: center;
  612. }
  613. figure img {
  614. width: 100%;
  615. height: auto;
  616. box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
  617. }
  618. h1 {
  619. font-size: 3.5rem;
  620. margin: 3rem auto;
  621. padding-top: 1.5rem;
  622. border-top: 12px solid var(--sub-color);
  623. }
  624. h2 {
  625. padding: 1.5rem 0;
  626. margin: 2.5rem auto;
  627. border-top: 1px solid var(--sub-color);
  628. border-bottom: 1px solid var(--sub-color);
  629. text-align: center;
  630. color: var(--sub-color);
  631. font-size: 2.5rem;
  632. font-weight: 500;
  633. // position: relative;
  634. // display: inline-block;
  635. // line-height: 1.2;
  636. // isolation: isolate;
  637. // &::after {
  638. // content: "";
  639. // position: absolute;
  640. // left: -10px;
  641. // right: -2px;
  642. // bottom: -4px;
  643. // height: 20px;
  644. // background: rgba(255, 234, 0, 0.4);
  645. // transform: skewX(-30deg);
  646. // transform-origin: left bottom;
  647. // z-index: -1;
  648. // pointer-events: none;
  649. // }
  650. }
  651. h3,
  652. h4 {
  653. margin-bottom: 1rem;
  654. color: var(--sub-color);
  655. }
  656. hr {
  657. margin: 3rem 0;
  658. }
  659. .feature-body {
  660. div,
  661. p {
  662. margin: 1.5rem 0 0;
  663. line-height: 1.8;
  664. font-size: 1.05rem;
  665. color: #222;
  666. }
  667. }
  668. .lead {
  669. display: inline-block;
  670. padding: 0.5rem 1.5rem;
  671. margin-bottom: 1.5rem;
  672. background-color: #f8f8f8;
  673. border-left: 5px solid var(--sub-color);
  674. border: 2px dotted #ccc;
  675. }
  676. ul {
  677. list-style: disc;
  678. }
  679. ol {
  680. list-style: auto;
  681. }
  682. b,
  683. strong {
  684. font-weight: 700;
  685. }
  686. .toc {
  687. margin: 3rem 0;
  688. background: #f9f9f9;
  689. padding: 1rem 1.5rem;
  690. border-left: 4px solid var(--sub-color);
  691. font-size: 0.95rem;
  692. .toc-title {
  693. font-size: 1.25rem;
  694. font-weight: bold;
  695. margin: 1rem 0;
  696. }
  697. ul {
  698. list-style: none;
  699. padding-left: 0;
  700. li {
  701. margin: 0.15rem 0;
  702. font-size: 1rem;
  703. a {
  704. text-decoration: none;
  705. color: var(--sub-color);
  706. &:hover {
  707. text-decoration: underline;
  708. }
  709. }
  710. // 解決空 li 造成的空白
  711. &:empty {
  712. display: none;
  713. }
  714. }
  715. }
  716. }
  717. .quote-accent {
  718. display: flex;
  719. align-items: flex-start;
  720. gap: 0.5rem;
  721. padding: 1rem 0;
  722. font-size: 2rem;
  723. font-weight: 600;
  724. border-top: 4px solid var(--sub-color);
  725. &::before {
  726. content: "“";
  727. flex: 0 0 auto;
  728. font-family: Georgia, "Times New Roman", serif;
  729. font-size: 2.8em;
  730. line-height: 0.6;
  731. color: var(--sub-color);
  732. margin-top: 0.1em;
  733. }
  734. & > p {
  735. margin: 0;
  736. }
  737. }
  738. }