1
0

main.css 7.1 KB

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