site.css 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541
  1. :root {
  2. /* 植物学研究手稿风格 */
  3. /* 主背景:浅米色纸张质感 */
  4. --bg: #f9f7f1;
  5. --panel: #fcfaf5;
  6. --panel-soft: #f2efe6;
  7. /* 文字色:墨灰(不是纯黑) */
  8. --text: #3a3832;
  9. --muted: #7a7870;
  10. /* 植物绿:鼠尾草绿(低饱和) */
  11. --accent: #5c7560;
  12. --accent-hover: #4a5e4b;
  13. --accent-light: #e8ece6;
  14. /* 辅助色:暖棕(不是蓝色/紫色) */
  15. --warm: #8b7355;
  16. --warm-soft: #f0e8dc;
  17. /* 边框和阴影:极淡 */
  18. --border: rgba(58, 56, 50, 0.06);
  19. --shadow: 0 2px 8px rgba(58, 56, 50, 0.03);
  20. /* Hero 和卡片 */
  21. --hero-bg: #fcfaf5;
  22. --list-accent: #eef2ee;
  23. }
  24. /* 植物学研究手稿风格背景 - 响应式适配 */
  25. body {
  26. margin: 0;
  27. background-color: var(--bg);
  28. /* 桌面端:完整背景图 */
  29. background-image: url("../background.png"),
  30. /* 纸张纹理 */
  31. repeating-radial-gradient(circle at 50% 50%, transparent 0, transparent 2px, rgba(58, 56, 50, 0.01) 2px, rgba(58, 56, 50, 0.01) 4px);
  32. background-size: cover, 4px 4px;
  33. background-position: center, center;
  34. background-repeat: no-repeat;
  35. background-attachment: fixed, local;
  36. }
  37. /* 移动端优化:避免画面断层 */
  38. @media (max-width: 720px) {
  39. body {
  40. /* 移动端使用纯色背景 + SVG 角落装饰 */
  41. background-image:
  42. /* 角落淡色晕影 */
  43. radial-gradient(circle at 0% 0%, rgba(139, 115, 85, 0.03) 0%, transparent 40%),
  44. radial-gradient(circle at 100% 0%, rgba(139, 115, 85, 0.03) 0%, transparent 40%),
  45. radial-gradient(circle at 0% 100%, rgba(139, 115, 85, 0.03) 0%, transparent 40%),
  46. radial-gradient(circle at 100% 100%, rgba(139, 115, 85, 0.03) 0%, transparent 40%),
  47. /* SVG 角落植物装饰 */
  48. url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='600'%3E%3Cdefs%3E%3Cfilter id='blur'%3E%3CfeGaussianBlur in='SourceGraphic' stdDeviation='2'/%3E%3C/filter%3E%3C/defs%3E%3Cg opacity='0.06'%3E%3Cpath fill='%235c7560' d='M10 100 Q30 80 50 100 T80 140 Q60 160 40 140 T10 100'/%3E%3Cpath fill='%235c7560' d='M350 100 Q330 80 310 100 T280 140 Q300 160 320 140 T350 100'/%3E%3Cpath fill='%235c7560' d='M10 550 Q30 530 50 550 T80 590 Q60 610 40 590 T10 550'/%3E%3Cpath fill='%235c7560' d='M350 550 Q330 530 310 550 T280 590 Q300 610 320 590 T350 550'/%3E%3C/g%3E%3C/svg%3E");
  49. background-size: auto, 4px 4px, 400px 600px;
  50. background-position: center, center, center;
  51. background-attachment: scroll, local, fixed;
  52. }
  53. }
  54. * { box-sizing: border-box; }
  55. body {
  56. color: var(--text);
  57. font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, sans-serif;
  58. line-height: 1.8;
  59. font-size: 16px;
  60. letter-spacing: 0.01em;
  61. }
  62. a {
  63. color: var(--accent);
  64. text-decoration: none;
  65. transition: color 0.2s ease;
  66. }
  67. a:hover {
  68. color: var(--accent-hover);
  69. text-decoration: underline;
  70. }
  71. .wrap {
  72. width: min(960px, calc(100% - 32px));
  73. margin: 0 auto;
  74. }
  75. .site-header {
  76. position: sticky;
  77. top: 0;
  78. backdrop-filter: blur(10px);
  79. background: rgba(246, 243, 238, 0.88);
  80. border-bottom: 1px solid var(--border);
  81. z-index: 10;
  82. }
  83. .header-inner {
  84. display: flex;
  85. justify-content: space-between;
  86. gap: 24px;
  87. padding: 18px 0;
  88. align-items: center;
  89. }
  90. .site-title {
  91. display: flex;
  92. align-items: center;
  93. gap: 12px;
  94. font-family: "Cormorant Garamond", "Noto Serif SC", "Source Han Serif CN", serif;
  95. font-size: 1.9rem;
  96. font-weight: 600;
  97. color: var(--text);
  98. letter-spacing: -0.01em;
  99. }
  100. .site-title a {
  101. display: flex;
  102. align-items: center;
  103. gap: 12px;
  104. text-decoration: none;
  105. color: inherit;
  106. }
  107. .site-title a:hover {
  108. color: var(--accent);
  109. }
  110. .site-tagline {
  111. margin: 6px 0 0;
  112. color: var(--muted);
  113. font-size: 0.9rem;
  114. font-weight: 400;
  115. }
  116. .site-logo {
  117. width: 56px;
  118. height: 56px;
  119. border-radius: 50%;
  120. object-fit: cover;
  121. border: 2px solid var(--border);
  122. }
  123. .site-tagline {
  124. margin: 6px 0 0;
  125. color: var(--muted);
  126. font-size: 0.95rem;
  127. }
  128. .site-nav {
  129. display: flex;
  130. gap: 16px;
  131. flex-wrap: wrap;
  132. }
  133. /* Hamburger 菜单按钮 */
  134. .menu-toggle {
  135. display: none;
  136. background: none;
  137. border: none;
  138. cursor: pointer;
  139. padding: 8px;
  140. flex-direction: column;
  141. gap: 5px;
  142. z-index: 100;
  143. margin-left: auto;
  144. }
  145. .menu-toggle span {
  146. display: block;
  147. width: 24px;
  148. height: 2px;
  149. background: var(--text);
  150. transition: all 0.3s ease;
  151. border-radius: 2px;
  152. }
  153. .menu-toggle:hover span {
  154. background: var(--accent);
  155. }
  156. .menu-toggle.active span:nth-child(1) {
  157. transform: rotate(45deg) translate(5px, 5px);
  158. }
  159. .menu-toggle.active span:nth-child(2) {
  160. opacity: 0;
  161. }
  162. .menu-toggle.active span:nth-child(3) {
  163. transform: rotate(-45deg) translate(5px, -5px);
  164. }
  165. .site-nav a {
  166. color: var(--text);
  167. font-weight: 500;
  168. padding: 4px 2px;
  169. position: relative;
  170. }
  171. .site-nav a:hover {
  172. color: var(--accent);
  173. text-decoration: none;
  174. }
  175. .site-nav a::after {
  176. content: "";
  177. position: absolute;
  178. left: 0;
  179. bottom: -3px;
  180. width: 0;
  181. height: 2px;
  182. background: var(--accent);
  183. transition: width 0.22s ease;
  184. }
  185. .site-nav a:hover::after {
  186. width: 100%;
  187. }
  188. /* 移动端导航菜单 */
  189. .mobile-nav {
  190. display: none;
  191. position: absolute;
  192. top: 100%;
  193. left: 0;
  194. right: 0;
  195. background: rgba(251, 249, 246, 0.98);
  196. border-bottom: 1px solid var(--border);
  197. padding: 16px 24px;
  198. backdrop-filter: blur(10px);
  199. box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  200. }
  201. .mobile-nav a {
  202. display: block;
  203. padding: 12px 0;
  204. color: var(--text);
  205. font-weight: 500;
  206. font-size: 1rem;
  207. border-bottom: 1px solid rgba(47, 49, 45, 0.06);
  208. }
  209. .mobile-nav a:last-child {
  210. border-bottom: none;
  211. }
  212. .mobile-nav a:hover {
  213. color: var(--accent);
  214. }
  215. main.wrap {
  216. padding: 32px 0 48px;
  217. }
  218. .card {
  219. background: var(--panel);
  220. border: 1px solid var(--border);
  221. border-radius: 12px;
  222. padding: 24px;
  223. box-shadow: var(--shadow);
  224. transition: border-color 0.2s ease;
  225. }
  226. .card:hover {
  227. border-color: rgba(92, 117, 96, 0.15);
  228. }
  229. .hero {
  230. padding: 32px 28px;
  231. margin-bottom: 28px;
  232. background: var(--hero-bg);
  233. border: 1px solid var(--border);
  234. border-radius: 12px;
  235. }
  236. .hero h1 {
  237. font-family: "Cormorant Garamond", "Noto Serif SC", "Source Han Serif CN", serif;
  238. font-size: 2rem;
  239. font-weight: 600;
  240. margin: 0 0 8px;
  241. color: var(--text);
  242. letter-spacing: -0.02em;
  243. }
  244. .hero p {
  245. margin: 0;
  246. color: var(--muted);
  247. font-size: 1rem;
  248. line-height: 1.6;
  249. }
  250. .hero h1 {
  251. font-family: "Noto Serif SC", "Source Han Serif CN", "Songti SC", "SimSun", serif;
  252. font-size: 1.8rem;
  253. font-weight: 700;
  254. margin: 0 0 8px;
  255. color: var(--text);
  256. }
  257. .eyebrow {
  258. display: inline-block;
  259. margin-bottom: 8px;
  260. color: var(--warm);
  261. font-size: 0.8rem;
  262. text-transform: uppercase;
  263. letter-spacing: 0.08em;
  264. font-weight: 700;
  265. }
  266. .grid {
  267. display: grid;
  268. gap: 16px;
  269. margin-bottom: 24px;
  270. }
  271. .three-up {
  272. grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  273. }
  274. .section-card {
  275. transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  276. }
  277. .section-card:hover {
  278. transform: translateY(-2px);
  279. box-shadow: 0 10px 24px rgba(47, 49, 45, 0.06);
  280. border-color: rgba(66, 107, 87, 0.14);
  281. }
  282. .section-card h2,
  283. .post-item h2,
  284. .post-item h3 {
  285. margin-top: 0;
  286. color: var(--text);
  287. font-family: "Cormorant Garamond", "Noto Serif SC", "Source Han Serif CN", serif;
  288. font-weight: 600;
  289. letter-spacing: -0.01em;
  290. }
  291. .section-card h2 { font-size: 1.25rem; }
  292. .post-item h2 { font-size: 1.15rem; }
  293. .post-item h3 { font-size: 1.1rem; }
  294. .section-head {
  295. display: flex;
  296. align-items: center;
  297. justify-content: space-between;
  298. gap: 16px;
  299. margin-bottom: 16px;
  300. padding-bottom: 12px;
  301. border-bottom: 1px solid var(--border);
  302. }
  303. .section-head h2 {
  304. font-family: "Cormorant Garamond", "Noto Serif SC", "Source Han Serif CN", serif;
  305. font-size: 1.3rem;
  306. font-weight: 600;
  307. margin: 0;
  308. color: var(--text);
  309. letter-spacing: -0.01em;
  310. }
  311. .post-list {
  312. display: grid;
  313. gap: 14px;
  314. margin-top: 16px;
  315. }
  316. .post-item {
  317. background: var(--panel);
  318. border: 1px solid var(--border);
  319. border-radius: 10px;
  320. padding: 20px;
  321. transition: all 0.2s ease;
  322. }
  323. .post-item:hover {
  324. border-color: rgba(92, 117, 96, 0.2);
  325. box-shadow: var(--shadow);
  326. }
  327. /* 第一个项目用淡色背景 */
  328. .post-item:first-child {
  329. background: var(--list-accent);
  330. }
  331. .meta {
  332. color: var(--muted);
  333. font-size: 0.9rem;
  334. }
  335. .article h1 {
  336. margin-bottom: 12px;
  337. font-family: "Cormorant Garamond", "Noto Serif SC", "Source Han Serif CN", serif;
  338. font-size: 2rem;
  339. letter-spacing: -0.02em;
  340. font-weight: 600;
  341. color: var(--text);
  342. }
  343. .article h2,
  344. .article h3,
  345. .article h4,
  346. .article h5,
  347. .article h6 {
  348. font-family: "Cormorant Garamond", "Noto Serif SC", "Source Han Serif CN", serif;
  349. font-weight: 600;
  350. margin-top: 1.8em;
  351. color: var(--text);
  352. letter-spacing: -0.01em;
  353. }
  354. .article h2 { font-size: 1.5rem; }
  355. .article h3 { font-size: 1.3rem; }
  356. .prose :first-child {
  357. margin-top: 0;
  358. }
  359. .prose img {
  360. max-width: 100%;
  361. height: auto;
  362. border-radius: 8px;
  363. }
  364. .prose blockquote {
  365. margin: 1.2rem 0;
  366. padding: 1rem 1.2rem;
  367. background: var(--panel-soft);
  368. border-left: 3px solid var(--accent);
  369. border-radius: 8px;
  370. color: var(--text);
  371. }
  372. .prose code {
  373. background: var(--panel-soft);
  374. padding: 0.2rem 0.4rem;
  375. border-radius: 4px;
  376. font-size: 0.9em;
  377. }
  378. .prose pre {
  379. background: var(--panel-soft);
  380. padding: 16px;
  381. border-radius: 10px;
  382. overflow-x: auto;
  383. border: 1px solid var(--border);
  384. }
  385. .tags {
  386. display: flex;
  387. flex-wrap: wrap;
  388. gap: 8px;
  389. margin-top: 12px;
  390. }
  391. .tag {
  392. display: inline-flex;
  393. padding: 4px 10px;
  394. border-radius: 4px;
  395. background: var(--panel-soft);
  396. color: var(--accent);
  397. font-size: 0.8rem;
  398. border: 1px solid var(--border);
  399. font-weight: 500;
  400. font-family: "PingFang SC", sans-serif;
  401. }
  402. .tag:first-child {
  403. background: var(--accent-light);
  404. border-color: rgba(92, 117, 96, 0.12);
  405. color: var(--accent);
  406. }
  407. .site-footer {
  408. padding: 0 0 48px;
  409. color: var(--muted);
  410. font-size: 0.9rem;
  411. }
  412. @media (max-width: 720px) {
  413. .header-inner,
  414. .section-head {
  415. flex-direction: column;
  416. align-items: flex-start;
  417. }
  418. .menu-toggle {
  419. display: flex;
  420. }
  421. .site-nav {
  422. display: none;
  423. width: 100%;
  424. flex-direction: column;
  425. margin-top: 12px;
  426. gap: 0;
  427. }
  428. .site-nav.active {
  429. display: flex;
  430. }
  431. .site-nav a {
  432. font-size: 0.9rem;
  433. padding: 12px 0;
  434. border-bottom: 1px solid rgba(47, 49, 45, 0.06);
  435. width: 100%;
  436. }
  437. .site-nav a::after {
  438. display: none;
  439. }
  440. .site-nav a:hover {
  441. background: var(--panel-soft);
  442. }
  443. .card,
  444. .hero {
  445. padding: 20px;
  446. }
  447. .article h1 {
  448. font-size: 1.5rem;
  449. }
  450. .site-title {
  451. font-size: 1.4rem;
  452. }
  453. .site-logo {
  454. width: 40px;
  455. height: 40px;
  456. }
  457. .site-nav a {
  458. font-size: 0.9rem;
  459. padding: 10px 0;
  460. }
  461. }