site.css 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497
  1. :root {
  2. /* Botanical academic palette: 优雅复古 + 清新自然 */
  3. --bg: #f6f3ee;
  4. --panel: #fbf9f6;
  5. --panel-soft: #f1ece5;
  6. --text: #2f312d;
  7. --muted: #6f7168;
  8. /* 主强调色:植物绿 */
  9. --accent: #426b57;
  10. --accent-hover: #355746;
  11. --accent-soft: #dce8df;
  12. /* 次级色:雾灰绿 */
  13. --accent-2: #8ca395;
  14. /* 复古暖调 */
  15. --warm: #a07c64;
  16. --warm-soft: #efe5da;
  17. --border: rgba(47, 49, 45, 0.08);
  18. --shadow: 0 6px 20px rgba(47, 49, 45, 0.05);
  19. /* 替换原来的 rose / blue 系 */
  20. --hero-bg: #ece4da;
  21. --hero-tint: #f3ede5;
  22. --list-highlight: #e5efe8;
  23. --tag-bg: #eef4ef;
  24. --tag-border: #d4e2d7;
  25. }
  26. /* 复古纸张纹理 + 植物底纹 */
  27. body {
  28. margin: 0;
  29. background-color: var(--bg);
  30. background-image:
  31. /* 角落晕影 */
  32. radial-gradient(circle at 0% 0%, rgba(160, 124, 100, 0.03) 0%, transparent 40%),
  33. radial-gradient(circle at 100% 0%, rgba(160, 124, 100, 0.03) 0%, transparent 40%),
  34. radial-gradient(circle at 0% 100%, rgba(160, 124, 100, 0.03) 0%, transparent 40%),
  35. radial-gradient(circle at 100% 100%, rgba(160, 124, 100, 0.03) 0%, transparent 40%),
  36. /* 纸张纹理 */
  37. repeating-linear-gradient(90deg, transparent 0, transparent 2px, rgba(160, 124, 100, 0.02) 2px, rgba(160, 124, 100, 0.02) 4px),
  38. /* 植物底纹 - 叶片形状 */
  39. url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='800' height='800'%3E%3Cg fill='%23426b57' fill-opacity='0.04'%3E%3Cpath d='M400 200c-50-50-100-50-150 0s-50 100 0 150 100 50 150 0 50-100 0-150z'/%3E%3Cpath d='M200 600c-50-50-100-50-150 0s-50 100 0 150 100 50 150 0 50-100 0-150z'/%3E%3Cpath d='M600 600c-50-50-100-50-150 0s-50 100 0 150 100 50 150 0 50-100 0-150z'/%3E%3Cg%3E%3Cpath d='M600 200c-50-50-100-50-150 0s-50 100 0 150 100 50 150 0 50-100 0-150z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  40. background-blend-mode: multiply;
  41. background-size: 400px 400px;
  42. background-position: center;
  43. background-attachment: fixed;
  44. }
  45. * { box-sizing: border-box; }
  46. body {
  47. background: var(--bg);
  48. color: var(--text);
  49. font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, sans-serif;
  50. line-height: 1.8;
  51. font-size: 16px;
  52. letter-spacing: 0.01em;
  53. }
  54. a {
  55. color: var(--accent);
  56. text-decoration: none;
  57. transition: color 0.2s ease;
  58. }
  59. a:hover {
  60. color: var(--accent-hover);
  61. text-decoration: underline;
  62. }
  63. .wrap {
  64. width: min(960px, calc(100% - 32px));
  65. margin: 0 auto;
  66. }
  67. .site-header {
  68. position: sticky;
  69. top: 0;
  70. backdrop-filter: blur(10px);
  71. background: rgba(246, 243, 238, 0.88);
  72. border-bottom: 1px solid var(--border);
  73. z-index: 10;
  74. }
  75. .header-inner {
  76. display: flex;
  77. justify-content: space-between;
  78. gap: 24px;
  79. padding: 18px 0;
  80. align-items: center;
  81. }
  82. .site-title {
  83. display: flex;
  84. align-items: center;
  85. gap: 12px;
  86. font-family: "Noto Serif SC", "Source Han Serif CN", "Songti SC", "SimSun", serif;
  87. font-size: 1.8rem;
  88. font-weight: 700;
  89. color: var(--text);
  90. letter-spacing: -0.02em;
  91. text-shadow: 1px 1px 0 rgba(160, 124, 100, 0.08);
  92. }
  93. .site-title a {
  94. display: flex;
  95. align-items: center;
  96. gap: 12px;
  97. text-decoration: none;
  98. color: inherit;
  99. }
  100. .site-title a:hover {
  101. color: var(--accent);
  102. text-shadow: 1px 2px 6px rgba(66, 107, 87, 0.12);
  103. }
  104. .site-logo {
  105. width: 64px;
  106. height: 64px;
  107. border-radius: 50%;
  108. object-fit: cover;
  109. box-shadow: 0 2px 10px rgba(66, 107, 87, 0.08);
  110. }
  111. .site-tagline {
  112. margin: 6px 0 0;
  113. color: var(--muted);
  114. font-size: 0.95rem;
  115. }
  116. .site-nav {
  117. display: flex;
  118. gap: 16px;
  119. flex-wrap: wrap;
  120. }
  121. /* Hamburger 菜单按钮 */
  122. .menu-toggle {
  123. display: none;
  124. background: none;
  125. border: none;
  126. cursor: pointer;
  127. padding: 8px;
  128. flex-direction: column;
  129. gap: 5px;
  130. z-index: 100;
  131. margin-left: auto;
  132. }
  133. .menu-toggle span {
  134. display: block;
  135. width: 24px;
  136. height: 2px;
  137. background: var(--text);
  138. transition: all 0.3s ease;
  139. border-radius: 2px;
  140. }
  141. .menu-toggle:hover span {
  142. background: var(--accent);
  143. }
  144. .menu-toggle.active span:nth-child(1) {
  145. transform: rotate(45deg) translate(5px, 5px);
  146. }
  147. .menu-toggle.active span:nth-child(2) {
  148. opacity: 0;
  149. }
  150. .menu-toggle.active span:nth-child(3) {
  151. transform: rotate(-45deg) translate(5px, -5px);
  152. }
  153. .site-nav a {
  154. color: var(--text);
  155. font-weight: 500;
  156. padding: 4px 2px;
  157. position: relative;
  158. }
  159. .site-nav a:hover {
  160. color: var(--accent);
  161. text-decoration: none;
  162. }
  163. .site-nav a::after {
  164. content: "";
  165. position: absolute;
  166. left: 0;
  167. bottom: -3px;
  168. width: 0;
  169. height: 2px;
  170. background: var(--accent);
  171. transition: width 0.22s ease;
  172. }
  173. .site-nav a:hover::after {
  174. width: 100%;
  175. }
  176. /* 移动端导航菜单 */
  177. .mobile-nav {
  178. display: none;
  179. position: absolute;
  180. top: 100%;
  181. left: 0;
  182. right: 0;
  183. background: rgba(251, 249, 246, 0.98);
  184. border-bottom: 1px solid var(--border);
  185. padding: 16px 24px;
  186. backdrop-filter: blur(10px);
  187. box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  188. }
  189. .mobile-nav a {
  190. display: block;
  191. padding: 12px 0;
  192. color: var(--text);
  193. font-weight: 500;
  194. font-size: 1rem;
  195. border-bottom: 1px solid rgba(47, 49, 45, 0.06);
  196. }
  197. .mobile-nav a:last-child {
  198. border-bottom: none;
  199. }
  200. .mobile-nav a:hover {
  201. color: var(--accent);
  202. }
  203. main.wrap {
  204. padding: 32px 0 48px;
  205. }
  206. .card {
  207. background: var(--panel);
  208. border: 1px solid var(--border);
  209. border-radius: 18px;
  210. padding: 24px;
  211. box-shadow: var(--shadow);
  212. }
  213. .hero {
  214. padding: 28px 24px;
  215. margin-bottom: 24px;
  216. background: linear-gradient(180deg, var(--hero-bg) 0%, var(--hero-tint) 100%);
  217. border: 1px solid rgba(160, 124, 100, 0.12);
  218. border-radius: 18px;
  219. }
  220. .hero h1 {
  221. font-family: "Noto Serif SC", "Source Han Serif CN", "Songti SC", "SimSun", serif;
  222. font-size: 1.8rem;
  223. font-weight: 700;
  224. margin: 0 0 8px;
  225. color: var(--text);
  226. }
  227. .eyebrow {
  228. display: inline-block;
  229. margin-bottom: 8px;
  230. color: var(--warm);
  231. font-size: 0.8rem;
  232. text-transform: uppercase;
  233. letter-spacing: 0.08em;
  234. font-weight: 700;
  235. }
  236. .grid {
  237. display: grid;
  238. gap: 16px;
  239. margin-bottom: 24px;
  240. }
  241. .three-up {
  242. grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  243. }
  244. .section-card {
  245. transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  246. }
  247. .section-card:hover {
  248. transform: translateY(-2px);
  249. box-shadow: 0 10px 24px rgba(47, 49, 45, 0.06);
  250. border-color: rgba(66, 107, 87, 0.14);
  251. }
  252. .section-card h2,
  253. .post-item h2,
  254. .post-item h3 {
  255. margin-top: 0;
  256. color: var(--text);
  257. font-family: "Noto Serif SC", "Source Han Serif CN", "Songti SC", "SimSun", serif;
  258. font-weight: 600;
  259. }
  260. .section-card h2 { font-size: 1.2rem; }
  261. .post-item h2 { font-size: 1.15rem; }
  262. .post-item h3 { font-size: 1.05rem; }
  263. .section-head {
  264. display: flex;
  265. align-items: center;
  266. justify-content: space-between;
  267. gap: 16px;
  268. margin-bottom: 16px;
  269. }
  270. .section-head h2 {
  271. font-family: "Noto Serif SC", "Source Han Serif CN", "Songti SC", "SimSun", serif;
  272. font-size: 1.2rem;
  273. font-weight: 600;
  274. margin: 0;
  275. }
  276. .post-list {
  277. display: grid;
  278. gap: 16px;
  279. }
  280. /* section-card 与 post-list 之间留间距 */
  281. .post-list {
  282. margin-top: 12px;
  283. }
  284. .post-item {
  285. background: var(--panel);
  286. border: 1px solid var(--border);
  287. border-radius: 18px;
  288. padding: 20px;
  289. transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
  290. }
  291. .post-item:hover {
  292. transform: translateY(-1px);
  293. border-color: rgba(66, 107, 87, 0.14);
  294. }
  295. /* 只高亮第一个 */
  296. .post-item:first-child {
  297. background: var(--list-highlight);
  298. border-color: rgba(66, 107, 87, 0.14);
  299. }
  300. .meta {
  301. color: var(--muted);
  302. font-size: 0.9rem;
  303. }
  304. .article h1 {
  305. margin-bottom: 12px;
  306. font-family: "Noto Serif SC", "Source Han Serif CN", "Songti SC", "SimSun", serif;
  307. font-size: 1.8rem;
  308. letter-spacing: -0.03em;
  309. font-weight: 700;
  310. }
  311. .article h2,
  312. .article h3,
  313. .article h4,
  314. .article h5,
  315. .article h6 {
  316. font-family: "Noto Serif SC", "Source Han Serif CN", "Songti SC", "SimSun", serif;
  317. font-weight: 600;
  318. margin-top: 1.5em;
  319. }
  320. .article h2 { font-size: 1.4rem; }
  321. .article h3 { font-size: 1.2rem; }
  322. .prose :first-child {
  323. margin-top: 0;
  324. }
  325. .prose img {
  326. max-width: 100%;
  327. height: auto;
  328. border-radius: 8px;
  329. }
  330. .prose blockquote {
  331. margin: 1.2rem 0;
  332. padding: 1rem 1.2rem;
  333. background: var(--panel-soft);
  334. border-left: 3px solid var(--accent);
  335. border-radius: 8px;
  336. color: var(--text);
  337. }
  338. .prose code {
  339. background: var(--panel-soft);
  340. padding: 0.2rem 0.4rem;
  341. border-radius: 4px;
  342. font-size: 0.9em;
  343. }
  344. .prose pre {
  345. background: var(--panel-soft);
  346. padding: 16px;
  347. border-radius: 10px;
  348. overflow-x: auto;
  349. border: 1px solid var(--border);
  350. }
  351. .tags {
  352. display: flex;
  353. flex-wrap: wrap;
  354. gap: 8px;
  355. margin-top: 12px;
  356. }
  357. .tag {
  358. display: inline-flex;
  359. padding: 5px 11px;
  360. border-radius: 999px;
  361. background: var(--tag-bg);
  362. color: var(--accent);
  363. font-size: 0.85rem;
  364. border: 1px solid var(--tag-border);
  365. font-weight: 500;
  366. }
  367. .tag:first-child {
  368. background: var(--warm-soft);
  369. border-color: rgba(160, 124, 100, 0.18);
  370. color: var(--warm);
  371. }
  372. .site-footer {
  373. padding: 0 0 48px;
  374. color: var(--muted);
  375. font-size: 0.9rem;
  376. }
  377. @media (max-width: 720px) {
  378. .header-inner,
  379. .section-head {
  380. flex-direction: column;
  381. align-items: flex-start;
  382. }
  383. .menu-toggle {
  384. display: flex;
  385. }
  386. .site-nav {
  387. display: none;
  388. width: 100%;
  389. flex-direction: column;
  390. margin-top: 12px;
  391. gap: 0;
  392. }
  393. .site-nav.active {
  394. display: flex;
  395. }
  396. .site-nav a {
  397. font-size: 0.9rem;
  398. padding: 12px 0;
  399. border-bottom: 1px solid rgba(47, 49, 45, 0.06);
  400. width: 100%;
  401. }
  402. .site-nav a::after {
  403. display: none;
  404. }
  405. .site-nav a:hover {
  406. background: var(--panel-soft);
  407. }
  408. .card,
  409. .hero {
  410. padding: 20px;
  411. }
  412. .article h1 {
  413. font-size: 1.5rem;
  414. }
  415. .site-title {
  416. font-size: 1.4rem;
  417. }
  418. .site-logo {
  419. width: 40px;
  420. height: 40px;
  421. }
  422. }