Files
2026-11-16 01:39:59 +07:00

322 lines
5.4 KiB
Plaintext

/* app.css — สไตล์ของ shell + คอมโพเนนต์ใหม่
เขียนแบบ mobile-first: base = จอเล็ก, ขยายด้วย min-width เท่านั้น
(สไตล์ธีมเดิมยังมาจาก css/creative.css, css/legacy.css, coding/css/*.css)
*/
/* ---------- shell ---------- */
:root {
--ink: #24313a;
--muted: #5c6b75;
--line: #d8e2e8;
--brand: #f05f40;
--brand-dark: #c9472c;
--water: hsl(199, 48%, 46%);
--ok: #1f8a4c;
--warn: #b26a00;
--danger: #b3261e;
}
body {
color: var(--ink);
}
.view-root {
padding-top: 70px;
min-height: 60vh;
}
.view-loading {
padding: 3rem 1rem;
text-align: center;
color: var(--muted);
}
.skip-link {
position: absolute;
left: -9999px;
top: 0;
z-index: 4000;
background: #fff;
color: var(--brand-dark);
padding: .5rem .75rem;
border: 2px solid var(--brand);
}
.skip-link:focus {
left: .5rem;
top: .5rem;
}
#mainNav .nav-link.active {
font-weight: 700;
text-decoration: underline;
text-underline-offset: .35em;
}
/* ปุ่มเปิดเมนูบนมือถือต้องกดง่าย ≥44px */
#mainNav .navbar-toggler {
min-height: 44px;
min-width: 44px;
}
/* hero เดิมมี padding-top 10rem เผื่อ navbar แบบ static — ใน SPA ลดลง */
#view header.masthead {
padding-top: 5rem;
padding-bottom: 5rem;
}
/* ---------- ป้ายสถานะใน footer ---------- */
.badge-net {
display: inline-block;
padding: .1rem .5rem;
border-radius: .6rem;
background: rgba(31, 138, 76, .18);
color: #b8f0cd;
font-size: .78rem;
}
.badge-net--off {
background: rgba(179, 38, 30, .2);
color: #ffc9c4;
}
.build-badge {
font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
font-size: .78rem;
opacity: .8;
}
/* ---------- ปุ่มติดตั้งแอป ---------- */
#install-wrap {
position: fixed;
left: .75rem;
right: .75rem;
bottom: .75rem;
z-index: 1500;
}
#install-wrap[hidden] {
display: none;
}
#install-btn {
width: 100%;
min-height: 48px;
border: none;
border-radius: 8px;
background: var(--brand);
color: #fff;
font-weight: 600;
box-shadow: 0 2px 6px rgba(0, 0, 0, .2);
}
#install-btn[disabled] {
background: #7a8790;
font-size: .82rem;
}
/* ---------- หน้าเนื้อหา ---------- */
.page {
padding: 1.5rem 0 2.5rem;
}
.page-title {
font-size: 1.5rem;
margin-bottom: .25rem;
}
.page-lead {
color: var(--muted);
margin-bottom: 1.25rem;
}
.card-grid {
display: grid;
grid-template-columns: 1fr;
gap: 1rem;
}
/* ---------- ฟอร์มคำนวณ ---------- */
.calc {
display: grid;
grid-template-columns: 1fr;
gap: 1rem;
margin-bottom: 1.5rem;
}
.field label {
display: block;
font-weight: 600;
font-size: .92rem;
margin-bottom: .25rem;
}
.field input,
.field select {
width: 100%;
min-height: 44px;
padding: .5rem .6rem;
border: 1px solid var(--line);
border-radius: 6px;
background: #fff;
color: var(--ink);
font-size: 1rem;
}
.field input:focus,
.field select:focus {
outline: 2px solid var(--brand);
outline-offset: 1px;
}
.field .hint {
display: block;
color: var(--muted);
font-size: .8rem;
margin-top: .25rem;
}
.calc-actions {
display: flex;
gap: .5rem;
flex-wrap: wrap;
}
.calc-actions button {
min-height: 46px;
padding: .5rem 1.1rem;
border-radius: 6px;
border: 1px solid var(--brand);
background: var(--brand);
color: #fff;
font-weight: 600;
}
.calc-actions button.ghost {
background: #fff;
color: var(--brand-dark);
}
/* ---------- ผลลัพธ์ ---------- */
.result {
border: 1px solid var(--line);
border-left: 6px solid var(--water);
border-radius: 8px;
padding: 1rem;
background: #f7fbfd;
}
.result[hidden] {
display: none;
}
.result-value {
font-size: 1.75rem;
font-weight: 700;
line-height: 1.2;
}
.result-unit {
font-size: .95rem;
color: var(--muted);
margin-left: .35rem;
}
.result-grid {
display: grid;
grid-template-columns: 1fr;
gap: .5rem;
margin-top: .75rem;
}
.result-item {
border-top: 1px dashed var(--line);
padding-top: .4rem;
font-size: .92rem;
}
.result-item b {
display: block;
font-size: 1.05rem;
}
.steps {
margin-top: 1rem;
width: 100%;
border-collapse: collapse;
font-size: .88rem;
}
.steps th,
.steps td {
border-bottom: 1px solid var(--line);
padding: .35rem .2rem;
text-align: left;
}
.steps td:last-child,
.steps th:last-child {
text-align: right;
white-space: nowrap;
}
.warn-list {
margin: .75rem 0 0;
padding-left: 1.1rem;
color: var(--warn);
font-size: .9rem;
}
.note {
font-size: .85rem;
color: var(--muted);
margin-top: 1rem;
}
/* ---------- ตารางเทียบ ---------- */
.table-wrap {
overflow-x: auto;
}
/* ---------- จอใหญ่ขึ้น ---------- */
@media (min-width: 640px) {
.calc {
grid-template-columns: 1fr 1fr;
}
.calc .calc-actions,
.calc .field--wide {
grid-column: 1 / -1;
}
.result-grid {
grid-template-columns: repeat(3, 1fr);
}
#install-wrap {
left: auto;
right: 1rem;
width: 15rem;
}
}
@media (min-width: 768px) {
.card-grid {
grid-template-columns: repeat(2, 1fr);
}
.page-title {
font-size: 1.9rem;
}
}
@media (min-width: 1024px) {
.view-root {
padding-top: 76px;
}
.card-grid {
grid-template-columns: repeat(3, 1fr);
}
}