Files
gushi/static/css/style.css
2025-12-21 00:33:04 +08:00

709 lines
13 KiB
CSS

/* 基础样式 */
:root {
--primary-color: #8b4513;
--secondary-color: #d2691e;
--accent-color: #a0522d;
--light-color: #f5f5dc;
--dark-color: #2c1810;
--text-color: #333;
--text-light: #666;
--bg-color: #fffaf0;
--card-bg: #fff;
--shadow: 0 4px 12px rgba(139, 69, 19, 0.1);
--border-radius: 12px;
--transition: all 0.3s ease;
}
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: 'Noto Serif SC', serif;
line-height: 1.6;
color: var(--text-color);
background-color: var(--bg-color);
background-image: url('../images/pattern.png');
background-size: 300px;
background-blend-mode: overlay;
background-color: rgba(255, 250, 240, 0.9);
}
.container {
max-width: 1200px;
margin: 0 auto;
padding: 0 20px;
}
/* 导航栏 */
.navbar {
background-color: var(--primary-color);
color: white;
padding: 1rem 0;
position: sticky;
top: 0;
z-index: 1000;
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}
.navbar .container {
display: flex;
justify-content: space-between;
align-items: center;
}
.logo {
display: flex;
align-items: center;
gap: 10px;
}
.logo i {
font-size: 2rem;
color: var(--light-color);
}
.logo h1 {
font-family: 'Ma Shan Zheng', cursive;
font-size: 1.8rem;
font-weight: normal;
}
.nav-links {
display: flex;
gap: 2rem;
}
.nav-links a {
color: white;
text-decoration: none;
display: flex;
align-items: center;
gap: 5px;
padding: 0.5rem 1rem;
border-radius: var(--border-radius);
transition: var(--transition);
}
.nav-links a:hover,
.nav-links a.active {
background-color: var(--secondary-color);
transform: translateY(-2px);
}
.menu-toggle {
display: none;
background: none;
border: none;
color: white;
font-size: 1.5rem;
cursor: pointer;
}
/* 首页横幅 */
.hero {
background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
color: white;
padding: 4rem 0;
text-align: center;
border-radius: 0 0 var(--border-radius) var(--border-radius);
margin-bottom: 3rem;
position: relative;
overflow: hidden;
}
.hero::before {
content: '';
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: url('../images/hero-pattern.png');
opacity: 0.1;
}
.hero-content {
position: relative;
z-index: 1;
}
.hero h2 {
font-family: 'Ma Shan Zheng', cursive;
font-size: 3rem;
margin-bottom: 1rem;
}
.hero p {
font-size: 1.2rem;
margin-bottom: 2rem;
opacity: 0.9;
}
.search-box {
max-width: 600px;
margin: 0 auto 2rem;
display: flex;
gap: 10px;
}
.search-box input {
flex: 1;
padding: 1rem;
border: none;
border-radius: var(--border-radius);
font-size: 1rem;
font-family: 'Noto Serif SC', serif;
}
.search-box button {
padding: 1rem 2rem;
background-color: var(--secondary-color);
color: white;
border: none;
border-radius: var(--border-radius);
cursor: pointer;
font-size: 1rem;
display: flex;
align-items: center;
gap: 8px;
transition: var(--transition);
}
.search-box button:hover {
background-color: var(--accent-color);
transform: translateY(-2px);
}
.quick-filters {
display: flex;
justify-content: center;
align-items: center;
gap: 1rem;
flex-wrap: wrap;
}
.quick-filters span {
font-size: 1rem;
}
.filter-btn {
padding: 0.5rem 1.5rem;
background-color: rgba(255, 255, 255, 0.2);
color: white;
border: 1px solid rgba(255, 255, 255, 0.3);
border-radius: 20px;
cursor: pointer;
transition: var(--transition);
}
.filter-btn:hover {
background-color: rgba(255, 255, 255, 0.3);
transform: translateY(-2px);
}
/* 内容区块 */
.section {
margin-bottom: 4rem;
padding: 2rem;
background-color: var(--card-bg);
border-radius: var(--border-radius);
box-shadow: var(--shadow);
}
.section h2 {
color: var(--primary-color);
margin-bottom: 2rem;
padding-bottom: 1rem;
border-bottom: 2px solid var(--light-color);
display: flex;
align-items: center;
gap: 10px;
}
/* 搜索面板 */
.search-panel {
background-color: var(--light-color);
padding: 2rem;
border-radius: var(--border-radius);
}
.search-form {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
gap: 1.5rem;
}
.form-group {
display: flex;
flex-direction: column;
gap: 0.5rem;
}
.form-group label {
color: var(--primary-color);
font-weight: bold;
display: flex;
align-items: center;
gap: 5px;
}
.form-group input,
.form-group select {
padding: 0.8rem;
border: 1px solid #ddd;
border-radius: var(--border-radius);
font-family: 'Noto Serif SC', serif;
font-size: 1rem;
transition: var(--transition);
}
.form-group input:focus,
.form-group select:focus {
outline: none;
border-color: var(--primary-color);
box-shadow: 0 0 0 2px rgba(139, 69, 19, 0.2);
}
/* 按钮样式 */
.btn-primary,
.btn-secondary {
padding: 1rem 2rem;
border: none;
border-radius: var(--border-radius);
cursor: pointer;
font-size: 1rem;
font-family: 'Noto Serif SC', serif;
display: inline-flex;
align-items: center;
justify-content: center;
gap: 8px;
transition: var(--transition);
}
.btn-primary {
background-color: var(--primary-color);
color: white;
}
.btn-primary:hover {
background-color: var(--secondary-color);
transform: translateY(-2px);
}
.btn-secondary {
background-color: var(--light-color);
color: var(--primary-color);
border: 1px solid var(--primary-color);
}
.btn-secondary:hover {
background-color: var(--primary-color);
color: white;
transform: translateY(-2px);
}
/* AI解析面板 */
.ai-analysis-panel {
display: grid;
grid-template-columns: 1fr 2fr;
gap: 2rem;
}
.analysis-controls {
display: flex;
flex-direction: column;
gap: 1.5rem;
}
.analysis-result {
background-color: var(--light-color);
border-radius: var(--border-radius);
padding: 2rem;
min-height: 400px;
overflow-y: auto;
}
.result-placeholder {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
height: 100%;
color: var(--text-light);
text-align: center;
}
.result-placeholder i {
font-size: 4rem;
margin-bottom: 1rem;
color: var(--primary-color);
opacity: 0.5;
}
/* 诗词网格 */
.browse-controls {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 2rem;
}
.view-toggle {
display: flex;
gap: 10px;
}
.view-btn {
padding: 0.5rem 1rem;
background-color: var(--light-color);
border: 1px solid #ddd;
border-radius: var(--border-radius);
cursor: pointer;
display: flex;
align-items: center;
gap: 5px;
}
.view-btn.active {
background-color: var(--primary-color);
color: white;
border-color: var(--primary-color);
}
.poetry-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
gap: 2rem;
}
.poetry-card {
background-color: var(--card-bg);
border-radius: var(--border-radius);
overflow: hidden;
box-shadow: var(--shadow);
transition: var(--transition);
cursor: pointer;
}
.poetry-card:hover {
transform: translateY(-5px);
box-shadow: 0 8px 20px rgba(139, 69, 19, 0.2);
}
.poetry-card-header {
background-color: var(--primary-color);
color: white;
padding: 1.5rem;
}
.poetry-card-header h3 {
font-size: 1.3rem;
margin-bottom: 0.5rem;
}
.poetry-card-header .meta {
display: flex;
justify-content: space-between;
font-size: 0.9rem;
opacity: 0.9;
}
.poetry-card-body {
padding: 1.5rem;
}
.poetry-content {
font-size: 1.1rem;
line-height: 1.8;
margin-bottom: 1rem;
font-family: 'Ma Shan Zheng', cursive;
}
.poetry-tags {
display: flex;
flex-wrap: wrap;
gap: 0.5rem;
}
.tag {
background-color: var(--light-color);
color: var(--primary-color);
padding: 0.3rem 0.8rem;
border-radius: 15px;
font-size: 0.8rem;
}
.loading {
text-align: center;
padding: 2rem;
color: var(--text-light);
}
.loading i {
margin-right: 10px;
}
/* 学习功能 */
.learning-features {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
gap: 2rem;
}
.feature-card {
background-color: var(--card-bg);
padding: 2rem;
border-radius: var(--border-radius);
text-align: center;
box-shadow: var(--shadow);
transition: var(--transition);
}
.feature-card:hover {
transform: translateY(-5px);
box-shadow: 0 8px 20px rgba(139, 69, 19, 0.2);
}
.feature-icon {
font-size: 3rem;
color: var(--primary-color);
margin-bottom: 1rem;
}
.feature-card h3 {
margin-bottom: 1rem;
color: var(--primary-color);
}
.feature-card p {
color: var(--text-light);
margin-bottom: 1.5rem;
}
/* 页脚 */
footer {
background-color: var(--dark-color);
color: white;
padding: 3rem 0 1rem;
margin-top: 4rem;
}
.footer-content {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
gap: 2rem;
margin-bottom: 2rem;
}
.footer-section h3,
.footer-section h4 {
color: var(--light-color);
margin-bottom: 1rem;
}
.footer-section a {
color: #ccc;
text-decoration: none;
display: block;
margin-bottom: 0.5rem;
transition: var(--transition);
}
.footer-section a:hover {
color: white;
transform: translateX(5px);
}
.social-links {
display: flex;
gap: 1rem;
}
.social-links a {
font-size: 1.5rem;
color: #ccc;
transition: var(--transition);
}
.social-links a:hover {
color: white;
transform: translateY(-3px);
}
.footer-bottom {
text-align: center;
padding-top: 2rem;
border-top: 1px solid rgba(255, 255, 255, 0.1);
display: flex;
justify-content: space-between;
align-items: center;
}
.pwa-badge {
background-color: var(--primary-color);
padding: 0.5rem 1rem;
border-radius: 20px;
display: inline-flex;
align-items: center;
gap: 5px;
}
/* 模态框 */
.modal {
display: none;
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: rgba(0, 0, 0, 0.5);
z-index: 2000;
align-items: center;
justify-content: center;
}
.modal.active {
display: flex;
}
.modal-content {
background-color: var(--card-bg);
border-radius: var(--border-radius);
width: 90%;
max-width: 800px;
max-height: 90vh;
overflow: hidden;
display: flex;
flex-direction: column;
}
.modal-header {
background-color: var(--primary-color);
color: white;
padding: 1.5rem;
display: flex;
justify-content: space-between;
align-items: center;
}
.close-modal {
background: none;
border: none;
color: white;
font-size: 2rem;
cursor: pointer;
line-height: 1;
}
.modal-body {
padding: 2rem;
overflow-y: auto;
flex: 1;
}
.modal-footer {
padding: 1.5rem;
background-color: var(--light-color);
display: flex;
justify-content: flex-end;
gap: 1rem;
}
/* 响应式设计 */
@media (max-width: 768px) {
.navbar .container {
flex-wrap: wrap;
}
.nav-links {
display: none;
width: 100%;
flex-direction: column;
margin-top: 1rem;
}
.nav-links.active {
display: flex;
}
.menu-toggle {
display: block;
}
.hero h2 {
font-size: 2rem;
}
.search-box {
flex-direction: column;
}
.ai-analysis-panel {
grid-template-columns: 1fr;
}
.poetry-grid {
grid-template-columns: 1fr;
}
.footer-bottom {
flex-direction: column;
gap: 1rem;
}
}
@media (max-width: 480px) {
.container {
padding: 0 10px;
}
.section {
padding: 1rem;
}
.search-form {
grid-template-columns: 1fr;
}
.learning-features {
grid-template-columns: 1fr;
}
}
/* 动画 */
@keyframes fadeIn {
from {
opacity: 0;
transform: translateY(20px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
.fade-in {
animation: fadeIn 0.5s ease forwards;
}
/* 滚动条样式 */
::-webkit-scrollbar {
width: 8px;
}
::-webkit-scrollbar-track {
background: var(--light-color);
}
::-webkit-scrollbar-thumb {
background: var(--primary-color);
border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
background: var(--secondary-color);
}