1
0

main.css 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452
  1. :root {
  2. --bg: #333;
  3. --bg-secondary: #3c3c3c;
  4. --bg-code: #2a2a2a;
  5. --text: #ccc;
  6. --text-bright: white;
  7. --text-muted: #999;
  8. --text-code: #b0b0b0;
  9. --text-inline-code: plum;
  10. --border: #555;
  11. --border-code: #3a3a3a;
  12. --link: palegoldenrod;
  13. --heading: lightskyblue;
  14. --heading-link: #f0c090;
  15. --header-nav-link: pink;
  16. --emphasis: pink;
  17. --nav-section: #bbb;
  18. --nav-section-active: #ddd;
  19. --content-width: 900px;
  20. --sidebar-width: 280px;
  21. --header-height: 48px;
  22. --line-height: 1.6;
  23. }
  24. * {
  25. margin: 0;
  26. padding: 0;
  27. box-sizing: border-box;
  28. }
  29. body {
  30. background-color: var(--bg);
  31. color: var(--text);
  32. font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  33. line-height: var(--line-height);
  34. }
  35. a {
  36. color: var(--link);
  37. text-decoration: none;
  38. }
  39. a:hover {
  40. text-decoration: underline;
  41. }
  42. /* Header */
  43. .header {
  44. position: fixed;
  45. top: 0;
  46. left: 0;
  47. right: 0;
  48. height: var(--header-height);
  49. background-color: var(--bg-secondary);
  50. border-bottom: 1px solid var(--border);
  51. z-index: 100;
  52. }
  53. .header-inner {
  54. height: 100%;
  55. display: flex;
  56. align-items: center;
  57. padding: 0 16px;
  58. gap: 24px;
  59. }
  60. .header-title {
  61. color: var(--text);
  62. font-weight: bold;
  63. font-size: 1.1rem;
  64. white-space: nowrap;
  65. }
  66. .header-title:hover {
  67. text-decoration: none;
  68. color: var(--text-bright);
  69. }
  70. .header-spacer {
  71. flex: 1;
  72. }
  73. .header-nav {
  74. display: flex;
  75. gap: 16px;
  76. }
  77. .header-nav a {
  78. display: flex;
  79. align-items: center;
  80. gap: 4px;
  81. color: var(--header-nav-link);
  82. font-size: 0.9rem;
  83. }
  84. .header-nav a svg {
  85. flex-shrink: 0;
  86. opacity: 0.85;
  87. }
  88. .header-tools {
  89. display: flex;
  90. align-items: center;
  91. gap: 2px;
  92. }
  93. .lang-selector {
  94. position: relative;
  95. }
  96. .lang-btn {
  97. display: flex;
  98. align-items: center;
  99. gap: 5px;
  100. background: none;
  101. border: none;
  102. color: var(--text);
  103. padding: 4px 6px;
  104. border-radius: 4px;
  105. cursor: pointer;
  106. font-size: 0.85rem;
  107. opacity: 0.8;
  108. }
  109. .lang-btn:hover {
  110. opacity: 1;
  111. }
  112. .lang-popup {
  113. display: none;
  114. position: absolute;
  115. right: 0;
  116. top: 100%;
  117. margin-top: 4px;
  118. background: var(--bg-secondary);
  119. border: 1px solid var(--border);
  120. border-radius: 4px;
  121. list-style: none;
  122. min-width: 60px;
  123. z-index: 200;
  124. }
  125. .lang-popup.open {
  126. display: block;
  127. }
  128. .lang-popup li a {
  129. display: block;
  130. padding: 6px 12px;
  131. color: var(--text);
  132. font-size: 0.85rem;
  133. }
  134. .lang-popup li a:hover {
  135. background: var(--bg);
  136. text-decoration: none;
  137. }
  138. .sidebar-toggle {
  139. display: none;
  140. background: none;
  141. border: none;
  142. color: var(--text);
  143. font-size: 1.2rem;
  144. cursor: pointer;
  145. padding: 4px 8px;
  146. }
  147. /* Draft banner */
  148. .draft-banner {
  149. position: fixed;
  150. top: var(--header-height);
  151. right: 0;
  152. background: #c44;
  153. color: white;
  154. padding: 4px 16px;
  155. font-size: 0.75rem;
  156. font-weight: bold;
  157. letter-spacing: 0.1em;
  158. z-index: 99;
  159. }
  160. /* Layout */
  161. .layout {
  162. margin-top: var(--header-height);
  163. display: grid;
  164. grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  165. min-height: calc(100vh - var(--header-height));
  166. }
  167. .layout.no-sidebar {
  168. grid-template-columns: 1fr;
  169. }
  170. /* Sidebar */
  171. .sidebar {
  172. width: var(--sidebar-width);
  173. flex-shrink: 0;
  174. padding: 24px 16px;
  175. border-right: 1px solid var(--bg-secondary);
  176. position: sticky;
  177. top: var(--header-height);
  178. height: calc(100vh - var(--header-height));
  179. overflow-y: auto;
  180. }
  181. .nav-section {
  182. margin-bottom: 16px;
  183. }
  184. .nav-section-title {
  185. color: var(--nav-section);
  186. font-weight: bold;
  187. font-size: 1.0rem;
  188. display: block;
  189. margin-bottom: 8px;
  190. }
  191. .nav-section-title.active {
  192. color: var(--nav-section-active);
  193. }
  194. .nav-list {
  195. list-style: none;
  196. padding-left: 8px;
  197. }
  198. .nav-list li {
  199. margin-bottom: 4px;
  200. }
  201. .nav-list li a {
  202. color: var(--text-muted);
  203. font-size: 0.85rem;
  204. }
  205. .nav-list li a:hover {
  206. color: var(--text);
  207. }
  208. .nav-list li a.active {
  209. color: var(--emphasis);
  210. font-weight: bold;
  211. }
  212. /* Content */
  213. .content {
  214. min-width: 0;
  215. max-width: var(--content-width);
  216. padding: 32px 24px;
  217. overflow-wrap: break-word;
  218. }
  219. .content.portal {
  220. max-width: var(--content-width);
  221. padding: 48px 24px;
  222. margin: 0 auto;
  223. }
  224. .content article h1 {
  225. font-size: 1.8rem;
  226. margin-bottom: 24px;
  227. color: var(--heading);
  228. }
  229. .content article h2 {
  230. font-size: 1.4rem;
  231. margin-top: 32px;
  232. margin-bottom: 16px;
  233. color: var(--heading-link);
  234. }
  235. .content article h3 {
  236. font-size: 1.1rem;
  237. margin-top: 24px;
  238. margin-bottom: 12px;
  239. color: var(--text);
  240. }
  241. .content article p {
  242. margin-bottom: 12px;
  243. }
  244. .content article ul,
  245. .content article ol {
  246. margin-bottom: 12px;
  247. padding-left: 24px;
  248. }
  249. .content article li {
  250. margin-bottom: 4px;
  251. }
  252. .content article strong {
  253. color: var(--emphasis);
  254. }
  255. .content article code {
  256. background: var(--bg-code);
  257. color: var(--text-inline-code);
  258. padding: 2px 6px;
  259. border-radius: 3px;
  260. font-size: 0.9em;
  261. }
  262. .content article pre {
  263. background: var(--bg-code) !important;
  264. color: var(--text-code);
  265. padding: 16px;
  266. border-radius: 4px;
  267. overflow-x: auto;
  268. margin-bottom: 16px;
  269. border: 1px solid var(--border-code);
  270. }
  271. .content article pre code {
  272. background: none;
  273. padding: 0;
  274. }
  275. .content article table {
  276. width: 100%;
  277. border-collapse: collapse;
  278. margin-bottom: 16px;
  279. }
  280. .content article th,
  281. .content article td {
  282. border: 1px solid var(--bg-secondary);
  283. padding: 8px 12px;
  284. text-align: left;
  285. }
  286. .content article th {
  287. background: var(--bg-secondary);
  288. }
  289. .content article blockquote {
  290. border-left: 3px solid var(--text-muted);
  291. padding-left: 16px;
  292. margin-bottom: 12px;
  293. color: var(--text-muted);
  294. }
  295. /* Footer */
  296. .footer {
  297. padding: 12px 16px;
  298. text-align: center;
  299. color: var(--text-muted);
  300. font-size: 0.8rem;
  301. border-top: 1px solid var(--bg-secondary);
  302. }
  303. /* Responsive */
  304. @media (max-width: 768px) {
  305. .layout {
  306. grid-template-columns: minmax(0, 1fr);
  307. }
  308. .sidebar {
  309. position: fixed;
  310. left: calc(-1 * var(--sidebar-width));
  311. width: var(--sidebar-width);
  312. top: var(--header-height);
  313. height: calc(100vh - var(--header-height));
  314. background: var(--bg);
  315. z-index: 50;
  316. transition: left 0.2s ease;
  317. border-right: 1px solid var(--border);
  318. }
  319. .sidebar.open {
  320. left: 0;
  321. }
  322. .sidebar-toggle {
  323. display: block;
  324. }
  325. .content {
  326. padding: 24px 16px;
  327. }
  328. }
  329. @media (max-width: 480px) {
  330. :root {
  331. --header-height: 44px;
  332. }
  333. .header-inner {
  334. padding: 0 12px;
  335. gap: 12px;
  336. }
  337. .header-nav a {
  338. font-size: 0.8rem;
  339. }
  340. .content article h1 {
  341. font-size: 1.4rem;
  342. }
  343. .content article h2 {
  344. font-size: 1.2rem;
  345. }
  346. }
  347. /* Light mode */
  348. [data-theme="light"] {
  349. --bg: #f5f5f5;
  350. --bg-secondary: #e8e8e8;
  351. --bg-code: #eee;
  352. --text: #333;
  353. --text-bright: #000;
  354. --text-muted: #666;
  355. --text-code: #333;
  356. --text-inline-code: #8b5ca0;
  357. --border: #ccc;
  358. --border-code: #ddd;
  359. --link: #b8860b;
  360. --heading: #2a6496;
  361. --heading-link: #c06020;
  362. --header-nav-link: #c04060;
  363. --emphasis: #c04060;
  364. --nav-section: #666;
  365. --nav-section-active: #333;
  366. }
  367. /* Code block theme switching */
  368. .code-light { display: none; }
  369. .code-dark { display: block; }
  370. [data-theme="light"] .code-light { display: block; }
  371. [data-theme="light"] .code-dark { display: none; }
  372. /* Theme toggle */
  373. .theme-toggle {
  374. display: flex;
  375. align-items: center;
  376. justify-content: center;
  377. background: none;
  378. border: none;
  379. color: var(--text);
  380. padding: 5px 6px;
  381. border-radius: 4px;
  382. cursor: pointer;
  383. opacity: 0.8;
  384. }
  385. .theme-toggle:hover {
  386. opacity: 1;
  387. }