返回 DeepSeek-Reasonix
community.css
根目录 / site / src / styles / community.css
1 /* Reasonix Community — self-hosted fonts + the reasonix.io token values, so the
2 forum shares the site's visual language without depending on its marketing CSS. */
3 @import "@fontsource-variable/inter";
4 @import "@fontsource-variable/jetbrains-mono";
5
6 :root {
7 color-scheme: light;
8 --accent: oklch(0.55 0.17 257);
9 --accent-deep: oklch(0.48 0.17 257);
10 --accent-soft: color-mix(in oklch, var(--accent) 8%, var(--bg));
11 --accent-line: color-mix(in oklch, var(--accent) 26%, transparent);
12 --bg: #ffffff;
13 --bg-soft: oklch(0.977 0.0025 247);
14 --card: #ffffff;
15 --ink: oklch(0.21 0.006 260);
16 --ink-2: oklch(0.45 0.008 260);
17 --ink-3: oklch(0.6 0.008 260);
18 --line: oklch(0.905 0.004 247);
19 --ok: oklch(0.6 0.14 155);
20 --ok-soft: color-mix(in oklch, var(--ok) 12%, var(--bg));
21 --err: oklch(0.5 0.19 25);
22 --warm: oklch(0.72 0.13 66);
23 --violet: oklch(0.58 0.17 300);
24 --rose: oklch(0.62 0.19 15);
25 --radius: 13px;
26 --radius-sm: 9px;
27 --shadow-1: 0 1px 2px oklch(0.4 0.02 260 / 0.08);
28 --shadow-2: 0 1px 2px oklch(0.4 0.02 260 / 0.06), 0 12px 32px -16px oklch(0.4 0.02 260 / 0.24);
29 --font-sans: "Inter Variable", "Inter", "Helvetica Neue", "PingFang SC", "Microsoft YaHei", sans-serif;
30 --font-mono: "JetBrains Mono Variable", "SF Mono", Menlo, monospace;
31 --ease: cubic-bezier(0.22, 1, 0.36, 1);
32 }
33
34 :root[data-theme="dark"] {
35 color-scheme: dark;
36 --accent: oklch(0.66 0.16 257);
37 --accent-deep: oklch(0.73 0.14 257);
38 --accent-soft: color-mix(in oklch, var(--accent) 16%, var(--bg));
39 --bg: oklch(0.19 0.006 260);
40 --bg-soft: oklch(0.225 0.008 260);
41 --card: oklch(0.222 0.008 260);
42 --ink: oklch(0.93 0.004 260);
43 --ink-2: oklch(0.78 0.008 260);
44 --ink-3: oklch(0.63 0.008 260);
45 --line: oklch(0.31 0.008 260);
46 --ok-soft: color-mix(in oklch, var(--ok) 18%, var(--bg));
47 --shadow-1: 0 1px 2px oklch(0 0 0 / 0.3);
48 --shadow-2: 0 1px 2px oklch(0 0 0 / 0.28), 0 12px 32px -16px oklch(0 0 0 / 0.6);
49 }
50
51 * { margin: 0; padding: 0; box-sizing: border-box; }
52 html { scroll-behavior: smooth; }
53 body { font-family: var(--font-sans); background: var(--bg); color: var(--ink); -webkit-font-smoothing: antialiased; line-height: 1.5; }
54 a { color: inherit; text-decoration: none; }
55 ::selection { background: oklch(0.88 0.05 257); }
56 .wrap { max-width: 1180px; margin: 0 auto; padding: 0 32px; }
57 [hidden] { display: none !important; }
58
59 /* bilingual toggle — mirrors the main site (shared reasonix-lang choice) */
60 body[data-lang="en"] .l-zh { display: none !important; }
61 body[data-lang="zh"] .l-en { display: none !important; }
62 .lang-switch, .theme-switch { display: inline-flex; gap: 2px; padding: 3px; background: var(--bg-soft); border-radius: 9px; }
63 .lang-switch button, .theme-switch button { font-family: var(--font-sans); font-size: 12.5px; font-weight: 500; color: var(--ink-2); background: transparent; border: none; cursor: pointer; padding: 6px 12px; border-radius: 6px; transition: background 0.2s, color 0.2s, box-shadow 0.2s; }
64 .lang-switch button:hover, .theme-switch button:hover { color: var(--ink); }
65 .lang-switch button.active, .theme-switch button.active { background: var(--card); color: var(--accent); box-shadow: var(--shadow-1); }
66 .theme-switch button { display: inline-flex; align-items: center; justify-content: center; }
67 .theme-switch svg { display: block; }
68
69 .nav { position: sticky; top: 0; z-index: 50; background: color-mix(in oklch, var(--bg) 86%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-bottom: 1px solid var(--line); }
70 .nav-inner { display: flex; align-items: center; gap: 20px; height: 64px; max-width: 1180px; margin: 0 auto; padding: 0 32px; }
71 .brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 17px; letter-spacing: -0.01em; }
72 .brand .mark { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: linear-gradient(140deg, var(--accent), var(--violet)); color: #fff; font-weight: 700; font-size: 15px; }
73 .brand .ctag { font-size: 12px; font-weight: 600; color: var(--accent); background: var(--accent-soft); padding: 3px 9px; border-radius: 999px; }
74 .nav-links { display: flex; gap: 4px; margin-left: 12px; }
75 .nav-links a { color: var(--ink-2); font-size: 14.5px; font-weight: 500; padding: 8px 14px; border-radius: 7px; transition: color 0.2s, background 0.2s; }
76 .nav-links a:hover { color: var(--ink); background: var(--bg-soft); }
77 .nav-links a.here { color: var(--accent); background: var(--accent-soft); }
78 .nav-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
79 .nav-search { display: flex; align-items: center; gap: 8px; background: var(--bg-soft); border: 1px solid transparent; border-radius: 9px; padding: 8px 14px; width: 220px; transition: border-color 0.2s, background 0.2s, box-shadow 0.2s; }
80 .nav-search:focus-within { background: var(--card); border-color: var(--accent-line); box-shadow: 0 0 0 4px var(--accent-soft); }
81 .nav-search input { border: none; outline: none; background: none; font-family: var(--font-sans); font-size: 14px; color: var(--ink); width: 100%; }
82 .nav-search .ico { color: var(--ink-3); }
83
84 .btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-family: var(--font-sans); font-size: 14.5px; font-weight: 600; white-space: nowrap; padding: 10px 20px; border-radius: 9px; border: none; cursor: pointer; transition: background 0.2s, box-shadow 0.25s, color 0.2s, border-color 0.2s, transform 0.15s var(--ease); }
85 .btn:active { transform: translateY(1px); }
86 .btn-primary { background: var(--accent); color: #fff; }
87 .btn-primary:hover { background: var(--accent-deep); box-shadow: var(--shadow-1); }
88 .btn-ghost { background: transparent; color: var(--accent); border: 1px solid var(--line); }
89 .btn-ghost:hover { background: var(--accent-soft); border-color: transparent; }
90 .btn.sm { padding: 7px 14px; font-size: 13px; }
91 .btn[disabled] { opacity: 0.55; pointer-events: none; }
92 .btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
93
94 .av { flex: none; display: grid; place-items: center; border-radius: 50%; width: 40px; height: 40px; font-size: 14px; font-weight: 600; color: #fff; border: 2px solid var(--bg); box-shadow: var(--shadow-1); overflow: hidden; }
95 .av.sm { width: 28px; height: 28px; font-size: 11px; border-width: 1.5px; }
96 .av.lg { width: 52px; height: 52px; font-size: 18px; }
97
98 .badge { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600; padding: 3px 9px; border-radius: 999px; }
99 .badge.solved { color: var(--ok); background: var(--ok-soft); }
100 .badge.pinned { color: var(--accent); background: var(--accent-soft); }
101 .badge.role { color: var(--ink-3); background: var(--bg-soft); box-shadow: inset 0 0 0 1px var(--line); }
102 .badge.role.staff, .badge.role.admin, .badge.role.moderator { color: var(--accent); background: var(--accent-soft); box-shadow: none; }
103 .tag { font-size: 12px; font-weight: 500; color: var(--ink-2); background: var(--bg-soft); padding: 4px 11px; border-radius: 999px; transition: color 0.2s, background 0.2s; }
104 a.tag:hover { color: var(--accent); background: var(--accent-soft); }
105 .cat-tag { font-size: 11.5px; font-weight: 600; padding: 2px 9px; border-radius: 999px; color: var(--accent); background: var(--accent-soft); }
106
107 .head { padding: 40px 0 28px; border-bottom: 1px solid var(--line); background: linear-gradient(180deg, var(--accent-soft), var(--bg) 76%); }
108 .head .row { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
109 .head .eyebrow { font-size: 13px; font-weight: 600; color: var(--accent); }
110 .head h1 { font-size: clamp(30px, 4vw, 42px); font-weight: 600; letter-spacing: -0.02em; margin-top: 8px; }
111 .head p { margin-top: 10px; font-size: 16px; color: var(--ink-2); max-width: 46ch; }
112
113 .layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 32px; padding: 32px 0 80px; align-items: start; }
114 .side { position: sticky; top: 88px; display: flex; flex-direction: column; gap: 18px; }
115 .sec-title { display: flex; align-items: center; justify-content: space-between; margin: 4px 2px 14px; }
116 .sec-title h2 { font-size: 15px; font-weight: 600; }
117 .tabs { display: inline-flex; gap: 2px; padding: 3px; background: var(--bg-soft); border-radius: 9px; }
118 .tabs button { font-family: var(--font-sans); font-size: 13.5px; font-weight: 500; color: var(--ink-2); background: none; border: none; cursor: pointer; padding: 7px 15px; border-radius: 6px; transition: background 0.2s, color 0.2s, box-shadow 0.2s; }
119 .tabs button.on { background: var(--card); color: var(--accent); box-shadow: var(--shadow-1); }
120 .tabs button:hover:not(.on) { color: var(--ink); }
121
122 .cats { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 34px; }
123 .cat { display: flex; gap: 14px; align-items: flex-start; background: var(--bg-soft); border-radius: var(--radius-sm); padding: 18px; transition: box-shadow 0.3s, transform 0.3s var(--ease), background 0.3s; }
124 .cat:hover { background: var(--card); box-shadow: var(--shadow-2); transform: translateY(-2px); }
125 .cat .ico { width: 42px; height: 42px; border-radius: 12px; flex: none; display: grid; place-items: center; font-size: 20px; background: var(--accent-soft); }
126 .cat h3 { font-size: 15.5px; font-weight: 600; }
127 .cat p { font-size: 13px; color: var(--ink-2); margin-top: 3px; }
128 .cat .meta { font-size: 12px; color: var(--ink-3); font-family: var(--font-mono); margin-top: 9px; }
129
130 .topics { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--card); }
131 .topic { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 16px; padding: 16px 20px; border-bottom: 1px solid var(--line); transition: background 0.18s; }
132 .topic:last-child { border-bottom: none; }
133 .topic:hover { background: var(--bg-soft); }
134 .topic .main { min-width: 0; }
135 .topic .title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
136 .topic .title a { font-size: 15.5px; font-weight: 600; color: var(--ink); }
137 .topic:hover .title a { color: var(--accent); }
138 .topic .sub { display: flex; align-items: center; gap: 8px; margin-top: 6px; font-size: 12.5px; color: var(--ink-3); flex-wrap: wrap; }
139 .topic .sub .who { color: var(--ink-2); font-weight: 500; }
140 .topic .stat { text-align: center; min-width: 52px; }
141 .topic .stat .n { font-size: 15px; font-weight: 600; font-family: var(--font-mono); }
142 .topic .stat .l { font-size: 11px; color: var(--ink-3); }
143 .topic .last { min-width: 96px; text-align: right; font-size: 12px; color: var(--ink-3); }
144
145 .card { background: var(--bg-soft); border-radius: var(--radius-sm); padding: 20px; }
146 .card.cta { background: linear-gradient(160deg, var(--accent-soft), var(--bg) 82%); border: 1px solid var(--accent-line); }
147 .card h4 { font-size: 14.5px; font-weight: 600; margin-bottom: 6px; }
148 .card .lead { font-size: 13px; color: var(--ink-2); line-height: 1.55; margin-bottom: 14px; }
149 .card .btn { width: 100%; }
150 .stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
151 .stat-box .n { font-size: 22px; font-weight: 700; font-family: var(--font-mono); letter-spacing: -0.02em; }
152 .stat-box .n .dot { color: var(--ok); }
153 .stat-box .l { font-size: 12px; color: var(--ink-3); }
154 .tagcloud { display: flex; flex-wrap: wrap; gap: 8px; }
155
156 .empty { padding: 40px 20px; text-align: center; color: var(--ink-3); font-size: 14px; }
157 .skeleton { padding: 16px 20px; border-bottom: 1px solid var(--line); }
158 .skeleton .bar { height: 12px; border-radius: 6px; background: linear-gradient(90deg, var(--bg-soft), var(--line), var(--bg-soft)); background-size: 200% 100%; animation: sk 1.3s linear infinite; }
159 .skeleton .bar.short { width: 40%; margin-top: 8px; }
160 @keyframes sk { to { background-position: -200% 0; } }
161 .msg { margin: 16px 0; font-size: 13.5px; border-radius: var(--radius-sm); padding: 11px 14px; }
162 .msg.error { color: var(--err); background: color-mix(in oklch, var(--err) 9%, var(--bg)); }
163 .msg.ok { color: var(--ok); background: var(--ok-soft); }
164
165 /* thread */
166 .crumb { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-3); margin-bottom: 14px; }
167 .crumb a:hover { color: var(--accent); }
168 .crumb .sep { opacity: 0.5; }
169 .thread-head h1 { font-size: clamp(24px, 3vw, 32px); font-weight: 600; letter-spacing: -0.02em; line-height: 1.2; }
170 .thread-head .meta { display: flex; align-items: center; gap: 10px; margin-top: 14px; flex-wrap: wrap; font-size: 13px; color: var(--ink-3); }
171 .thread-layout { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 32px; padding: 24px 0 80px; align-items: start; }
172 .post { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 16px; padding: 24px 0; border-top: 1px solid var(--line); }
173 .post:first-child { border-top: none; }
174 .post.op { background: linear-gradient(180deg, var(--accent-soft), transparent 40%); border-radius: var(--radius); padding: 24px; margin: 0 -24px 4px; }
175 .post.answer { background: var(--ok-soft); border: 1px solid color-mix(in oklch, var(--ok) 28%, transparent); border-radius: var(--radius); padding: 22px 24px; margin: 8px -24px; }
176 .post .who { display: flex; align-items: center; gap: 9px; margin-bottom: 8px; }
177 .post .who .name { font-size: 14.5px; font-weight: 600; }
178 .post .who .when { font-size: 12px; color: var(--ink-3); }
179 .post .answer-flag { display: flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 600; color: var(--ok); margin-bottom: 10px; }
180 .post .body { font-size: 15px; color: var(--ink); line-height: 1.7; overflow-wrap: anywhere; }
181 .post .body p { margin: 0 0 12px; }
182 .post .body p:last-child { margin-bottom: 0; }
183 .post .body code { font-family: var(--font-mono); font-size: 13px; background: var(--bg-soft); padding: 2px 7px; border-radius: 6px; }
184 .post .body pre { background: oklch(0.25 0.006 260); color: oklch(0.9 0.004 260); border-radius: var(--radius-sm); padding: 16px 18px; overflow-x: auto; font-family: var(--font-mono); font-size: 13px; line-height: 1.7; margin: 4px 0 12px; }
185 .post .actions { display: flex; align-items: center; gap: 6px; margin-top: 16px; }
186 .react { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-sans); font-size: 13px; font-weight: 500; color: var(--ink-2); background: var(--bg-soft); border: 1px solid transparent; border-radius: 7px; padding: 6px 13px; cursor: pointer; transition: background 0.2s, border-color 0.2s, color 0.2s; }
187 .react:hover { border-color: var(--accent-line); color: var(--accent); }
188 .react.on { background: var(--accent-soft); color: var(--accent); }
189 .link-act { font-size: 13px; font-weight: 500; color: var(--ink-3); padding: 6px 10px; border-radius: 7px; cursor: pointer; background: none; border: none; font-family: var(--font-sans); }
190 .link-act:hover { color: var(--accent); background: var(--accent-soft); }
191
192 .composer { border: 1px solid var(--line); border-radius: var(--radius); padding: 8px; margin-top: 24px; background: var(--card); transition: border-color 0.2s, box-shadow 0.2s; }
193 .composer:focus-within { border-color: var(--accent-line); box-shadow: 0 0 0 4px var(--accent-soft); }
194 .composer input.title { width: 100%; border: none; outline: none; padding: 12px 14px 4px; font-family: var(--font-sans); font-size: 18px; font-weight: 600; color: var(--ink); background: none; }
195 .composer textarea { width: 100%; border: none; outline: none; resize: vertical; min-height: 96px; padding: 12px 14px; font-family: var(--font-sans); font-size: 15px; color: var(--ink); background: none; line-height: 1.6; }
196 .composer .foot { display: flex; align-items: center; justify-content: space-between; padding: 8px 10px 6px; gap: 12px; flex-wrap: wrap; }
197 .composer .foot .hint { font-size: 12px; color: var(--ink-3); }
198 .composer select { font-family: var(--font-sans); font-size: 13px; color: var(--ink-2); background: var(--bg-soft); border: none; border-radius: 7px; padding: 8px 12px; cursor: pointer; }
199 .gate { text-align: center; padding: 22px; }
200 .gate p { font-size: 14px; color: var(--ink-2); margin-bottom: 14px; }
201
202 .side-card { background: var(--bg-soft); border-radius: var(--radius-sm); padding: 18px 20px; }
203 .side-card h4 { font-size: 13px; font-weight: 600; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 12px; }
204 .parti { display: flex; }
205 .parti .av { margin-left: -8px; }
206 .parti .av:first-child { margin-left: 0; }
207
208 .foot { border-top: 1px solid var(--line); }
209 .foot-inner { max-width: 1180px; margin: 0 auto; padding: 28px 32px; display: flex; align-items: center; gap: 20px; flex-wrap: wrap; font-size: 13.5px; color: var(--ink-3); }
210 .foot-inner .links { display: flex; gap: 4px; margin-left: auto; flex-wrap: wrap; }
211 .foot-inner .links a { padding: 6px 12px; border-radius: 7px; color: var(--ink-2); font-weight: 500; transition: background 0.2s, color 0.2s; }
212 .foot-inner .links a:hover { background: var(--bg-soft); color: var(--ink); }
213
214 @media (max-width: 940px) {
215 .layout, .thread-layout { grid-template-columns: 1fr; }
216 .side { position: static; }
217 .cats { grid-template-columns: 1fr; }
218 .nav-links, .nav-search { display: none; }
219 .topic { grid-template-columns: auto minmax(0, 1fr); }
220 .topic .stat, .topic .last { display: none; }
221 .wrap { padding: 0 20px; }
222 }
223
224 @media (max-width: 640px) {
225 /* drop the Community tag and tighten the shared controls */
226 .nav-inner { padding: 0 16px; gap: 10px; }
227 .brand .ctag { display: none; }
228 .theme-switch button { padding: 6px 9px; }
229 }
230
231 @media (max-width: 440px) {
232 /* Include the async account control in the narrow-header budget. */
233 .nav-inner { padding: 0 12px; gap: 8px; }
234 .nav .brand { gap: 0; }
235 .nav .brand-name { display: none; }
236 .nav-right { gap: 8px; }
237 .lang-switch button { padding: 6px 8px; }
238 .theme-switch button { padding: 6px 7px; }
239 #nav-account .btn { padding: 7px 10px; }
240 }
241
241 lines CSS