/* 历史上的今天 - 手机端优先的响应式设计 */ /* 重置样式 */ * { margin: 0; padding: 0; box-sizing: border-box; } body { font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); min-height: 100vh; color: #2c3e50; line-height: 1.6; overflow-x: hidden; } .container { max-width: 100%; margin: 0 auto; padding: 10px; } /* 头部样式 - 手机端优先 */ .header { text-align: center; margin-bottom: 20px; background: rgba(255, 255, 255, 0.95); border-radius: 15px; padding: 20px 15px; box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1); backdrop-filter: blur(10px); } .header h1 { font-size: 1.8rem; color: #2c3e50; margin-bottom: 8px; font-weight: 700; display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; } .header p { color: #7f8c8d; font-size: 0.9rem; line-height: 1.4; } /* 日期显示 */ .date-info { background: rgba(255, 255, 255, 0.95); border-radius: 12px; padding: 15px; margin-bottom: 15px; text-align: center; box-shadow: 0 3px 15px rgba(0, 0, 0, 0.08); } .date-info h2 { font-size: 1.3rem; color: #2c3e50; margin-bottom: 5px; } .date-info .date-text { color: #7f8c8d; font-size: 0.9rem; } /* 加载状态 */ .loading { text-align: center; padding: 30px 15px; background: rgba(255, 255, 255, 0.95); border-radius: 12px; box-shadow: 0 3px 15px rgba(0, 0, 0, 0.08); } .spinner { width: 35px; height: 35px; border: 3px solid #ecf0f1; border-top: 3px solid #667eea; border-radius: 50%; animation: spin 1s linear infinite; margin: 0 auto 15px; } @keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } } /* 历史事件容器 */ .events-container { background: rgba(255, 255, 255, 0.95); border-radius: 15px; padding: 15px; margin-bottom: 15px; box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08); backdrop-filter: blur(10px); } /* 统计信息 */ .stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 20px; } .stat-item { background: rgba(102, 126, 234, 0.1); border-radius: 10px; padding: 12px; text-align: center; } .stat-number { font-size: 1.4rem; font-weight: 700; color: #667eea; display: block; } .stat-label { color: #7f8c8d; font-size: 0.8rem; margin-top: 3px; } /* 事件列表 */ .events-list { display: flex; flex-direction: column; gap: 12px; } .event-card { background: rgba(255, 255, 255, 0.9); border-radius: 12px; padding: 15px; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05); transition: all 0.3s ease; border-left: 4px solid #667eea; position: relative; } .event-card:hover { transform: translateY(-2px); box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1); } /* 事件类型标签 */ .event-type { position: absolute; top: 10px; right: 10px; padding: 4px 8px; border-radius: 12px; font-size: 0.7rem; font-weight: 600; text-transform: uppercase; } .event-type.birth { background: #e8f5e8; color: #27ae60; } .event-type.death { background: #fdf2e9; color: #e67e22; } .event-type.event { background: #ebf3fd; color: #3498db; } /* 事件年份 */ .event-year { font-size: 1.1rem; font-weight: 700; color: #667eea; margin-bottom: 8px; display: flex; align-items: center; gap: 8px; } .event-year::before { content: "📅"; font-size: 1rem; } /* 事件标题 */ .event-title { font-size: 1rem; font-weight: 600; color: #2c3e50; margin-bottom: 8px; line-height: 1.4; } /* 事件描述 */ .event-description { color: #7f8c8d; font-size: 0.85rem; line-height: 1.5; margin-bottom: 10px; } /* 链接按钮 */ .event-link { display: inline-flex; align-items: center; gap: 5px; color: #667eea; text-decoration: none; font-size: 0.8rem; font-weight: 500; padding: 6px 12px; background: rgba(102, 126, 234, 0.1); border-radius: 15px; transition: all 0.3s ease; } .event-link:hover { background: rgba(102, 126, 234, 0.2); transform: translateX(2px); } .event-link::after { content: "🔗"; font-size: 0.7rem; } /* 错误提示 */ .error { background: #fed7d7; color: #c53030; padding: 15px; border-radius: 12px; text-align: center; border: 1px solid #feb2b2; margin: 15px 0; font-size: 0.9rem; } /* 隐藏类 */ .hidden { display: none; } /* 淡入动画 */ .fade-in { animation: fadeIn 0.6s ease-in; } @keyframes fadeIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } } /* 平板端适配 (768px+) */ @media (min-width: 768px) { .container { max-width: 750px; padding: 20px; } .header { padding: 30px 25px; } .header h1 { font-size: 2.2rem; } .header p { font-size: 1rem; } .date-info { padding: 20px; } .date-info h2 { font-size: 1.5rem; } .events-container { padding: 25px; } .stats { gap: 15px; } .event-card { padding: 20px; } .event-title { font-size: 1.1rem; } .event-description { font-size: 0.9rem; } } /* 电脑端适配 (1024px+) */ @media (min-width: 1024px) { .container { max-width: 1000px; padding: 30px; } .header { padding: 40px 35px; } .header h1 { font-size: 2.5rem; } .events-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; } .event-card { padding: 25px; } .event-title { font-size: 1.2rem; } .event-description { font-size: 0.95rem; } } /* 大屏幕优化 (1200px+) */ @media (min-width: 1200px) { .container { max-width: 1200px; padding: 40px; } .events-list { grid-template-columns: repeat(3, 1fr); gap: 25px; } } /* 滚动条样式 */ ::-webkit-scrollbar { width: 6px; } ::-webkit-scrollbar-track { background: rgba(255, 255, 255, 0.1); } ::-webkit-scrollbar-thumb { background: rgba(102, 126, 234, 0.5); border-radius: 3px; } ::-webkit-scrollbar-thumb:hover { background: rgba(102, 126, 234, 0.7); }