:root { --ps-blue: #1f6fd1; --ps-navy: #16324f; }
html, body { font-family: system-ui, -apple-system, "Segoe UI", "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif; background: #f6f8fb; }
a { color: var(--ps-blue); }
.ps-navbar { background: var(--ps-navy); }
.ps-navbar .nav-link.active { color: #ffd166 !important; }
.ps-hero { background: linear-gradient(135deg, #16324f, #1f6fd1); color: #fff; }
.ps-card { transition: transform .12s, box-shadow .12s; overflow: hidden; }
.ps-card:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0,0,0,.12); }
.ps-card .card-img-top { aspect-ratio: 16/10; object-fit: cover; background: #eef3f8; }
.ps-thumb-placeholder { display: flex; align-items: center; justify-content: center; font-size: 2.5rem; }
.ps-viewer { position: relative; height: 480px; border-radius: .5rem; overflow: hidden; border: 1px solid #dde5ee; background: #eef3f8; }
.ps-viewer-host { position: absolute; inset: 0; }
.ps-viewer-tools { position: absolute; right: .5rem; top: .5rem; }
.ps-md p:last-child { margin-bottom: 0; }
.ps-modal { background: rgba(0,0,0,.45); }
.ps-dims { display: flex; align-items: center; justify-content: space-between; gap: .25rem; text-align: center; margin-bottom: .25rem; }
.ps-dim-v { font-size: 1.6rem; font-weight: 700; color: var(--ps-navy); line-height: 1.1; }
.ps-dim-l { font-size: .7rem; color: #6c7a89; }

/* ---------- editor ---------- */
.ed-root { position: fixed; inset: 0; display: grid; grid-template-columns: 210px 1fr 320px; grid-template-rows: 50px 1fr; background: #eef3f8; }
.ed-top { grid-column: 1 / 4; display: flex; align-items: center; gap: .6rem; padding: 0 .75rem; background: var(--ps-navy); color: #fff; }
.ed-brand { color: #fff; font-weight: 700; text-decoration: none; white-space: nowrap; }
.ed-title { max-width: 220px; opacity: .9; }
.ed-level { width: auto; }
.ed-left { overflow-y: auto; padding: .5rem; background: #fff; border-right: 1px solid #dde5ee; }
.ed-right { overflow-y: auto; background: #fff; border-left: 1px solid #dde5ee; }
.ed-cat { font-size: .75rem; font-weight: 700; color: #6c7a89; margin: .6rem 0 .2rem; text-transform: uppercase; }
.ed-part { display: flex; align-items: center; gap: .4rem; width: 100%; text-align: left; border: 1px solid transparent; background: none; border-radius: .4rem; padding: .3rem .4rem; font-size: .88rem; }
.ed-part:hover { background: #f0f5fb; }
.ed-part.active { background: #fff4d6; border-color: #f0b429; }
.ed-part-icon { width: 1.4rem; text-align: center; color: var(--ps-blue); font-weight: 700; }
.ed-part-name { flex: 1; }
.ed-unverified { color: #b0b8c2; font-size: .8rem; }
.ed-canvas { position: relative; overflow: hidden; }
.ed-canvas canvas { display: block; }
.ed-help { position: absolute; left: .75rem; top: .75rem; max-width: 520px; z-index: 5; background: rgba(255,255,255,.95); border-radius: .5rem; padding: .75rem 1rem; box-shadow: 0 4px 14px rgba(0,0,0,.12); }
.ed-status { position: absolute; left: .75rem; bottom: .6rem; z-index: 4; background: rgba(22,50,79,.85); color: #fff; border-radius: .4rem; padding: .25rem .6rem; pointer-events: none; }
.ed-toast { position: absolute; left: 50%; top: 1rem; transform: translateX(-50%); background: #c0392b; color: #fff; padding: .4rem .9rem; border-radius: .4rem; opacity: 0; transition: opacity .2s; z-index: 6; pointer-events: none; }
.ed-toast.show { opacity: 1; }
@media (max-width: 900px) {
  .ed-root { grid-template-columns: 150px 1fr; grid-template-rows: 50px 1fr 260px; }
  .ed-right { grid-column: 1 / 3; }
  .ed-top { overflow-x: auto; }
}

#blazor-error-ui { background: lightyellow; bottom: 0; box-shadow: 0 -1px 2px rgba(0,0,0,.2); display: none; left: 0; padding: .6rem 1.25rem .7rem 1.25rem; position: fixed; width: 100%; z-index: 1000; }
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: .75rem; top: .5rem; }
.blazor-error-boundary { background: #b32121; padding: 1rem; color: white; }
.blazor-error-boundary::after { content: "發生錯誤。"; }
.validation-message { color: #e50000; }
