284 lines
9.1 KiB
HTML
284 lines
9.1 KiB
HTML
<!DOCTYPE html>
|
||
<html lang="zh-CN">
|
||
<head>
|
||
<meta charset="utf-8">
|
||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||
<title>页面未找到 - AwsLinker</title>
|
||
<meta name="description" content="抱歉,您访问的页面不存在或已被移除。">
|
||
<link rel="icon" href="/favicon.ico">
|
||
<style>
|
||
* {
|
||
margin: 0;
|
||
padding: 0;
|
||
box-sizing: border-box;
|
||
}
|
||
|
||
body {
|
||
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
|
||
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
||
min-height: 100vh;
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
color: #333;
|
||
}
|
||
|
||
.container {
|
||
max-width: 500px;
|
||
width: 90%;
|
||
background: white;
|
||
border-radius: 16px;
|
||
box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
|
||
padding: 3rem 2rem;
|
||
text-align: center;
|
||
}
|
||
|
||
.error-icon {
|
||
width: 80px;
|
||
height: 80px;
|
||
margin: 0 auto 2rem;
|
||
background: linear-gradient(135deg, #667eea, #764ba2);
|
||
border-radius: 50%;
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
color: white;
|
||
font-size: 2rem;
|
||
font-weight: bold;
|
||
}
|
||
|
||
.error-code {
|
||
font-size: 4rem;
|
||
font-weight: 800;
|
||
color: #667eea;
|
||
margin-bottom: 1rem;
|
||
line-height: 1;
|
||
}
|
||
|
||
.error-title {
|
||
font-size: 1.5rem;
|
||
font-weight: 600;
|
||
color: #2d3748;
|
||
margin-bottom: 1rem;
|
||
}
|
||
|
||
.error-description {
|
||
color: #718096;
|
||
margin-bottom: 2rem;
|
||
line-height: 1.6;
|
||
}
|
||
|
||
.article-notice {
|
||
background: #e6f3ff;
|
||
border: 1px solid #667eea;
|
||
border-radius: 8px;
|
||
padding: 1rem;
|
||
margin-bottom: 2rem;
|
||
color: #667eea;
|
||
font-size: 0.9rem;
|
||
}
|
||
|
||
.actions {
|
||
display: flex;
|
||
flex-direction: column;
|
||
gap: 1rem;
|
||
}
|
||
|
||
.btn {
|
||
display: inline-flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
padding: 0.75rem 1.5rem;
|
||
border-radius: 8px;
|
||
text-decoration: none;
|
||
font-weight: 500;
|
||
transition: all 0.2s;
|
||
border: none;
|
||
cursor: pointer;
|
||
}
|
||
|
||
.btn-primary {
|
||
background: linear-gradient(135deg, #667eea, #764ba2);
|
||
color: white;
|
||
}
|
||
|
||
.btn-primary:hover {
|
||
transform: translateY(-2px);
|
||
box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
|
||
}
|
||
|
||
.btn-secondary {
|
||
background: #f7fafc;
|
||
color: #4a5568;
|
||
border: 1px solid #e2e8f0;
|
||
}
|
||
|
||
.btn-secondary:hover {
|
||
background: #edf2f7;
|
||
}
|
||
|
||
.language-switcher {
|
||
margin-top: 2rem;
|
||
padding-top: 2rem;
|
||
border-top: 1px solid #e2e8f0;
|
||
}
|
||
|
||
.language-links {
|
||
display: flex;
|
||
justify-content: center;
|
||
gap: 1rem;
|
||
flex-wrap: wrap;
|
||
}
|
||
|
||
.language-link {
|
||
color: #667eea;
|
||
text-decoration: none;
|
||
font-size: 0.9rem;
|
||
padding: 0.5rem 1rem;
|
||
border-radius: 4px;
|
||
transition: background-color 0.2s;
|
||
}
|
||
|
||
.language-link:hover {
|
||
background: #f0f8ff;
|
||
}
|
||
|
||
@media (max-width: 640px) {
|
||
.container {
|
||
padding: 2rem 1.5rem;
|
||
}
|
||
|
||
.error-code {
|
||
font-size: 3rem;
|
||
}
|
||
|
||
.error-title {
|
||
font-size: 1.25rem;
|
||
}
|
||
}
|
||
</style>
|
||
<script>
|
||
// 简化的语言检测和内容更新,避免hydration问题
|
||
(function() {
|
||
'use strict';
|
||
|
||
function detectLanguage() {
|
||
const path = window.location.pathname;
|
||
if (path.includes('/en/')) return 'en';
|
||
if (path.includes('/zh-TW/')) return 'zh-TW';
|
||
return 'zh-CN';
|
||
}
|
||
|
||
function updatePageContent() {
|
||
const lang = detectLanguage();
|
||
const isArticle = window.location.pathname.includes('/news/');
|
||
|
||
const content = {
|
||
'zh-CN': {
|
||
title: '页面未找到',
|
||
description: '抱歉,您访问的页面不存在或已被移除。',
|
||
articleNotice: '该文章可能没有对应的中文版本。',
|
||
homeBtn: '返回首页',
|
||
newsBtn: '返回新闻列表',
|
||
homeLink: '/zh-CN/',
|
||
newsLink: '/zh-CN/news/'
|
||
},
|
||
'zh-TW': {
|
||
title: '頁面未找到',
|
||
description: '抱歉,您訪問的頁面不存在或已被移除。',
|
||
articleNotice: '該文章可能沒有對應的繁體中文版本。',
|
||
homeBtn: '返回首頁',
|
||
newsBtn: '返回新聞列表',
|
||
homeLink: '/zh-TW/',
|
||
newsLink: '/zh-TW/news/'
|
||
},
|
||
'en': {
|
||
title: 'Page Not Found',
|
||
description: 'Sorry, the page you are looking for does not exist or has been removed.',
|
||
articleNotice: 'This article may not be available in English.',
|
||
homeBtn: 'Go to Homepage',
|
||
newsBtn: 'Back to News',
|
||
homeLink: '/en/',
|
||
newsLink: '/en/news/'
|
||
}
|
||
};
|
||
|
||
const t = content[lang];
|
||
|
||
// 安全地更新DOM元素
|
||
function safeUpdate(selector, property, value) {
|
||
try {
|
||
const element = document.querySelector(selector);
|
||
if (element) {
|
||
element[property] = value;
|
||
}
|
||
} catch (e) {
|
||
// 忽略错误,避免破坏页面
|
||
}
|
||
}
|
||
|
||
// 更新内容
|
||
safeUpdate('.error-title', 'textContent', t.title);
|
||
safeUpdate('.error-description', 'textContent', t.description);
|
||
safeUpdate('.btn-primary', 'textContent', t.homeBtn);
|
||
safeUpdate('.btn-primary', 'href', t.homeLink);
|
||
safeUpdate('.btn-secondary', 'textContent', t.newsBtn);
|
||
safeUpdate('.btn-secondary', 'href', t.newsLink);
|
||
|
||
// 处理文章提示
|
||
const articleNotice = document.querySelector('.article-notice');
|
||
if (articleNotice) {
|
||
if (isArticle) {
|
||
articleNotice.textContent = t.articleNotice;
|
||
articleNotice.style.display = 'block';
|
||
} else {
|
||
articleNotice.style.display = 'none';
|
||
}
|
||
}
|
||
|
||
// 更新页面标题
|
||
document.title = t.title + ' - AwsLinker';
|
||
}
|
||
|
||
// 确保DOM加载完成后执行
|
||
if (document.readyState === 'loading') {
|
||
document.addEventListener('DOMContentLoaded', updatePageContent);
|
||
} else {
|
||
updatePageContent();
|
||
}
|
||
})();
|
||
</script>
|
||
</head>
|
||
<body>
|
||
<div class="container">
|
||
<div class="error-icon">
|
||
404
|
||
</div>
|
||
|
||
<div class="error-code">404</div>
|
||
|
||
<h1 class="error-title">页面未找到</h1>
|
||
|
||
<p class="error-description">
|
||
抱歉,您访问的页面不存在或已被移除。
|
||
</p>
|
||
|
||
<div class="article-notice" style="display: none;">
|
||
该文章可能没有对应的语言版本。
|
||
</div>
|
||
|
||
<div class="actions">
|
||
<a href="/zh-CN/" class="btn btn-primary">返回首页</a>
|
||
<a href="/zh-CN/news/" class="btn btn-secondary">返回新闻列表</a>
|
||
</div>
|
||
|
||
<div class="language-switcher">
|
||
<div class="language-links">
|
||
<a href="/zh-CN/" class="language-link">🇨🇳 简体中文</a>
|
||
<a href="/zh-TW/" class="language-link">🇹🇼 繁體中文</a>
|
||
<a href="/en/" class="language-link">🇺🇸 English</a>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</body>
|
||
</html> |