site.css 9.6 KB

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