123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173 |
- <!DOCTYPE html>
- <html lang="zh-CN">
- <head>
- <meta charset="UTF-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <title>{{ title }}</title>
- <style>
- body {
- font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
- background: linear-gradient(135deg, #f6f9fc, #e2e8f0);
- margin: 0;
- padding: 0;
- display: flex;
- justify-content: center;
- align-items: center;
- min-height: 100vh;
- color: #1a202c;
- }
- .error-container {
- display: flex;
- flex-direction: column;
- align-items: center;
- max-width: 800px;
- width: 80%;
- padding: 40px;
- border-radius: 16px;
- box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
- background-color: #ffffff;
- position: relative;
- overflow: hidden;
- min-height: 300px; /* 确保最小高度 */
- max-height: 80vh; /* 避免内容过多时超出视口 */
- flex-grow: 1;
- }
- @media (max-width: 768px) {
- .error-container {
- width: 90%;
- padding: 20px;
- min-height: auto; /* 移除最小高度限制 */
- }
- }
- .error-container::before {
- content: '';
- position: absolute;
- top: -50%;
- left: -50%;
- width: 200%;
- height: 200%;
- background: linear-gradient(
- to bottom right,
- rgba(255, 255, 255, 0.3),
- rgba(255, 255, 255, 0)
- );
- transform: rotate(30deg);
- z-index: -1;
- animation: shine 3s infinite;
- }
- h1 {
- font-size: 6rem;
- margin: 0;
- color: #2563eb;
- text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.05);
- font-weight: 900;
- }
- @media (max-width: 768px) {
- h1 {
- font-size: 4rem; /* 减小标题字体大小 */
- }
- }
- h2 {
- font-size: 2rem;
- margin-top: 20px;
- color: #4a5568;
- }
- @media (max-width: 768px) {
- h2 {
- font-size: 1.5rem; /* 减小副标题字体大小 */
- }
- }
- p {
- font-size: 1.2rem;
- line-height: 1.8;
- margin: 20px 0;
- color: #718096;
- }
- @media (max-width: 768px) {
- p {
- font-size: 1rem; /* 减小段落字体大小 */
- }
- }
- .error-code {
- background-color: #e2e8f0;
- padding: 8px 20px;
- border-radius: 24px;
- display: inline-block;
- font-family: 'Courier New', Courier, monospace;
- margin: 10px 0;
- color: #2d3748;
- }
- .home-link {
- display: inline-block;
- margin-top: 30px;
- padding: 14px 36px;
- background-color: #2563eb;
- color: white;
- text-decoration: none;
- border-radius: 24px;
- font-weight: bold;
- transition: all 0.3s ease;
- box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
- font-size: 1.1rem;
- }
- @media (max-width: 768px) {
- .home-link {
- padding: 10px 24px;
- font-size: 1rem; /* 减小按钮字体大小 */
- }
- }
- .home-link:hover {
- background-color: #1d4ed8;
- transform: translateY(-2px);
- box-shadow: 0 6px 8px rgba(0, 0, 0, 0.15);
- }
- @keyframes shine {
- 0% { transform: rotate(30deg) translate(-10%, -10%); }
- 100% { transform: rotate(30deg) translate(10%, 10%); }
- }
- .error-icon {
- font-size: 5rem;
- margin-bottom: 20px;
- animation: pulse 2s infinite;
- color: #ff4d4d;
- }
- @media (max-width: 768px) {
- .error-icon {
- font-size: 3rem; /* 减小图标大小 */
- }
- }
- @keyframes pulse {
- 0% { transform: scale(1); }
- 50% { transform: scale(1.1); }
- 100% { transform: scale(1); }
- }
- </style>
- </head>
- <body>
- <div class="error-container">
- <div class="error-icon">⚠️</div>
- <h1>{{ status_code }}</h1>
- <h2>{{ message }}</h2>
- <div class="error-code">错误代码: {{ error_code }}</div>
- <p>{{ description }}</p>
- <a href="{{ home_url }}" class="home-link">返回主页</a>
- </div>
- </body>
- </html>
|