update at 2026-10-12 15:14:13

This commit is contained in:
douboer
2026-10-12 15:14:13 +08:00
parent 7a225ff2b1
commit db63516781
12 changed files with 1012 additions and 43 deletions

116
web/js/style.css Normal file
View File

@@ -0,0 +1,116 @@
/* 光纤延时等效采样教学实验 · 展示网站样式 */
:root {
--primary: #1A5276;
--accent: #2D5F8A;
--warm: #C25B2A;
--bg: #f4f6f8;
--card: #ffffff;
--text: #243342;
--muted: #5d6b7a;
--line: #dde4ea;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
background: var(--bg);
color: var(--text);
line-height: 1.7;
}
.wrap { max-width: 960px; margin: 0 auto; padding: 0 20px; }
/* header */
.site-header {
background: linear-gradient(135deg, #16394f, #2D5F8A);
color: #fff;
padding: 26px 0;
}
.brand { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.brand h1 { font-size: 22px; font-weight: 600; letter-spacing: 0.5px; }
.badge {
background: rgba(255,255,255,.16);
border: 1px solid rgba(255,255,255,.4);
border-radius: 999px;
font-size: 12px; padding: 3px 12px;
}
.site-header nav { margin-left: auto; display: flex; gap: 18px; }
.site-header nav a { color: #cfe0ee; text-decoration: none; font-size: 14px; }
.site-header nav a:hover { color: #fff; }
/* sections */
section { padding: 26px 0 6px; }
.card {
background: var(--card);
border: 1px solid var(--line);
border-radius: 12px;
padding: 26px 28px;
box-shadow: 0 1px 3px rgba(36,51,66,.05);
}
.card h2 { font-size: 18px; color: var(--primary); margin-bottom: 12px; }
.card p { margin-bottom: 10px; }
.hint { color: var(--muted); font-size: 14px; }
/* stats */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin-top: 16px; }
.stat {
background: #f2f6fa; border: 1px solid #dbe6f0; border-radius: 10px;
padding: 14px 16px; text-align: center;
}
.stat .num { font-size: 20px; font-weight: 700; color: var(--accent); white-space: nowrap; }
.stat .lbl { font-size: 12px; color: var(--muted); margin-top: 4px; }
/* controls */
.controls { display: flex; flex-wrap: wrap; gap: 18px 26px; align-items: end; margin: 14px 0 18px; }
.controls label { font-size: 13.5px; display: flex; flex-direction: column; gap: 4px; }
.controls .val { color: var(--warm); font-weight: 600; }
.controls input[type=range] { width: 170px; accent-color: var(--accent); }
.controls select { padding: 5px 8px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.controls .chk { flex-direction: row; align-items: center; gap: 6px; }
.btn {
background: var(--primary); color: #fff; border: none; border-radius: 8px;
padding: 9px 18px; font-size: 14px; cursor: pointer;
}
.btn:hover { background: var(--accent); }
.btn:disabled { background: #9aa9b8; cursor: not-allowed; }
/* chart */
.chart { width: 100%; height: 420px; }
/* results */
.results { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-top: 16px; }
.res-item {
background: #f2f6fa; border: 1px solid #dbe6f0; border-radius: 10px;
padding: 12px; text-align: center;
}
.res-num { font-size: 22px; font-weight: 700; color: var(--primary); }
.res-lbl { font-size: 12px; color: var(--muted); }
/* footer */
footer { margin-top: 30px; padding: 22px 0 34px; border-top: 1px solid var(--line); }
footer p { font-size: 12.5px; color: var(--muted); margin-bottom: 6px; }
/* loading */
.loading-overlay {
position: fixed; inset: 0; z-index: 99;
background: rgba(244,246,248,.96);
display: flex; align-items: center; justify-content: center;
transition: opacity .4s;
}
.loading-overlay.hidden { opacity: 0; pointer-events: none; }
.loading-box { text-align: center; max-width: 460px; padding: 20px; }
.spinner {
width: 42px; height: 42px; margin: 0 auto 18px;
border: 4px solid #d5e0ea; border-top-color: var(--accent);
border-radius: 50%; animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-sub { font-size: 12px; color: var(--muted); margin-top: 8px; }
/* mobile */
@media (max-width: 640px) {
.chart { height: 320px; }
.brand h1 { font-size: 18px; }
}