site.css 9.5 KB

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