style(dnfs): 打磨首页 index 视觉细节,保持朴素风格

This commit is contained in:
qing committed 2026-08-05 09:25:43 +08:00
1 parent 897e76fd8f
commit d1e4b5b01a
2 files changed
+70 -33

No files matched your search

+66 -32
View File
@@ -61,7 +61,11 @@ body {
} }
.header h1 { .header h1 {
display: flex;
align-items: center;
font-size: 1.15rem; font-size: 1.15rem;
font-weight: 700;
letter-spacing: 0.01em;
cursor: pointer; cursor: pointer;
user-select: none; user-select: none;
transition: color 0.15s; transition: color 0.15s;
@@ -95,7 +99,7 @@ body {
.hero { .hero {
position: relative; position: relative;
text-align: center; text-align: center;
padding: 4rem 1rem 3rem; padding: 5.5rem 1rem 4.5rem;
} }
.hero::before { .hero::before {
content: ""; content: "";
@@ -106,96 +110,126 @@ body {
} }
.hero > * { position: relative; } .hero > * { position: relative; }
.hero-title { .hero-title {
font-size: clamp(1.8rem, 5vw, 2.6rem); font-size: clamp(2rem, 6vw, 3rem);
font-weight: 800; font-weight: 800;
line-height: 1.35; line-height: 1.28;
letter-spacing: 0.02em; letter-spacing: 0.02em;
margin-bottom: 0.75rem; margin-bottom: 1rem;
}
.accent-text {
background: linear-gradient(120deg, var(--accent) 20%, var(--accent-dark) 80%);
-webkit-background-clip: text;
background-clip: text;
color: transparent;
} }
.accent-text { color: var(--accent); }
.hero-sub { .hero-sub {
font-size: 1.05rem; font-size: 1.08rem;
color: var(--fg-secondary); color: var(--fg-secondary);
max-width: 30rem;
margin: 0 auto;
line-height: 1.7;
} }
.hero-actions { .hero-actions {
display: flex; display: flex;
justify-content: center; justify-content: center;
flex-wrap: wrap; flex-wrap: wrap;
gap: 0.75rem; gap: 0.85rem;
margin-top: 1.75rem; margin-top: 2.1rem;
} }
/* ===== 特性卡片 ===== */ /* ===== 特性卡片 ===== */
.section-title { .section-title {
text-align: center; text-align: center;
margin-top: 3rem; margin-top: 4rem;
font-size: 1.5rem;
font-weight: 700;
letter-spacing: 0.01em;
}
.section-title::after {
content: "";
display: block;
width: 44px;
height: 3px;
margin: 0.6rem auto 0;
border-radius: 2px;
background: var(--accent);
opacity: 0.85;
} }
.features { .features {
display: grid; display: grid;
grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
gap: 0.9rem; gap: 1.1rem;
width: 100%; width: 100%;
max-width: 960px; max-width: 960px;
margin: 0 auto; margin: 1.75rem auto 0;
} }
.feature-card { .feature-card {
background: var(--card); background: var(--card);
border: 1px solid var(--border-light); border: 1px solid var(--border-light);
border-radius: var(--radius-md); border-radius: var(--radius-md);
padding: 1.4rem 1.25rem; padding: 1.6rem 1.35rem;
box-shadow: var(--shadow-sm); box-shadow: var(--shadow-sm);
transition: transform 0.18s, box-shadow 0.2s, border-color 0.2s; transition: transform 0.18s, box-shadow 0.2s, border-color 0.2s;
} }
.feature-card:hover { .feature-card:hover {
transform: translateY(-3px); transform: translateY(-4px);
border-color: var(--border); border-color: var(--accent);
box-shadow: var(--shadow-md); box-shadow: var(--shadow-md);
} }
.feature-icon { .feature-icon {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
width: 38px; width: 42px;
height: 38px; height: 42px;
margin-bottom: 0.75rem; margin-bottom: 0.85rem;
border-radius: var(--radius-sm); border-radius: var(--radius-sm);
background: var(--accent-soft); background: var(--accent-soft);
color: var(--accent-dark); color: var(--accent-dark);
} }
.feature-icon svg { width: 20px; height: 20px; } .feature-icon svg { width: 22px; height: 22px; }
.feature-card h3 { margin-bottom: 0.35rem; } .feature-card h3 { margin-bottom: 0.4rem; font-size: 1.05rem; }
.feature-card p { .feature-card p {
font-size: 0.86rem; font-size: 0.88rem;
line-height: 1.65; line-height: 1.7;
color: var(--fg-secondary); color: var(--fg-secondary);
} }
/* ===== 关于本站 ===== */ /* ===== 关于本站 ===== */
.about { .about {
text-align: center; text-align: center;
padding-bottom: 2rem; padding: 1rem 1rem 3rem;
max-width: 760px;
margin: 0 auto;
}
.about .site-intro {
background: var(--card);
border: 1px solid var(--border-light);
border-radius: var(--radius-md);
box-shadow: var(--shadow-sm);
padding: 1.75rem 1.9rem;
} }
.site-intro { .site-intro {
max-width: 640px; font-size: 0.96rem;
margin: 0 auto; line-height: 1.95;
font-size: 0.95rem;
line-height: 1.9;
color: var(--fg-secondary); color: var(--fg-secondary);
} }
.quick-links { .quick-links {
display: flex; display: flex;
justify-content: center; justify-content: center;
flex-wrap: wrap; flex-wrap: wrap;
gap: 1.25rem; gap: 1.5rem;
margin-top: 1.5rem; margin-top: 1.75rem;
} }
.quick-links a { .quick-links a {
font-size: 0.85rem; font-size: 0.86rem;
color: var(--muted); color: var(--muted);
text-decoration: none; text-decoration: none;
transition: color 0.15s; padding-bottom: 1px;
border-bottom: 1px solid transparent;
transition: color 0.15s, border-color 0.15s;
} }
.quick-links a:hover { color: var(--accent); } .quick-links a:hover { color: var(--accent); border-bottom-color: var(--accent); }
/* ===== 入场动画 ===== */ /* ===== 入场动画 ===== */
@keyframes fade-up { @keyframes fade-up {
+4 -1
View File
@@ -13,7 +13,10 @@
</head> </head>
<body> <body>
<header class="header"> <header class="header">
<h1 id="logo">DNFS 树状笔记</h1> <h1 id="logo">
<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" style="vertical-align:-2px;margin-right:6px;color:var(--accent)"><circle cx="18" cy="5" r="3"/><circle cx="6" cy="12" r="3"/><circle cx="18" cy="19" r="3"/><line x1="8.59" y1="10.51" x2="15.42" y2="6.51"/><line x1="8.59" y1="13.49" x2="15.42" y2="17.49"/></svg>
DNFS 树状笔记
</h1>
<nav class="right-group" aria-label="用户操作"> <nav class="right-group" aria-label="用户操作">
<img src="favicon.ico" alt="用户头像" id="avatar" style="display:none"> <img src="favicon.ico" alt="用户头像" id="avatar" style="display:none">
<b id="name" style="display:none"></b> <b id="name" style="display:none"></b>