* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: "BIZ UDPGothic", sans-serif; font-size: 16px; line-height: 1.7; color: #222; background: #f4f5f8; min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; }
button, input, select, textarea, table { font-family: inherit; font-size: inherit; }
h1 { font-size: 1.6rem; margin: 0 0 1rem; }
h2 { font-size: 1.2rem; margin: 1.6rem 0 .6rem; border-left: 5px solid #8a1c2b; padding-left: .5rem; }
a { color: #8a1c2b; }
.top { display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; justify-content: space-between; align-items: center; padding: .6rem 1.2rem; background: #8a1c2b; color: #fff; }
.top a { color: #fff; text-decoration: none; }
.brand { font-weight: 700; font-size: 1.4rem; }
.top nav { display: flex; flex-wrap: wrap; gap: .3rem 1rem; align-items: center; }
.top nav.main { flex: 1; font-size: .95rem; }
.top nav a.on { border-bottom: 2px solid #fff; }
nav.sub { background: #fff; border-bottom: 1px solid #ccc; padding: .4rem 1.2rem; display: flex; flex-wrap: wrap; gap: .3rem 1.2rem; }
nav.sub.admin { background: #2b2f3a; }
nav.sub.admin a { color: #fff; }
nav.sub a { text-decoration: none; padding: .1rem 0; }
nav.sub a.on { font-weight: 700; border-bottom: 2px solid #8a1c2b; }
main { margin: 1.5rem auto; padding: 0 1rem; width: 100%; max-width: 960px; }
main.narrow { max-width: 460px; }
main.wide { max-width: none; }
.card { background: #fff; padding: 1.2rem 1.5rem; border-radius: 8px; box-shadow: 0 1px 4px rgba(0,0,0,.12); margin-bottom: 1rem; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; }
.stat .k { font-size: .8rem; color: #555; } .stat .v { font-size: 1.5rem; font-weight: 700; }
.badge { display: inline-block; padding: 0 .6rem; border-radius: 10px; font-size: .8rem; background: #ddd; }
.badge.ok { background: #d8f0dc; color: #145a22; } .badge.ng { background: #fde2e2; color: #8a1c1c; } .badge.draft { background: #eee; color: #555; }
label { display: block; margin-top: .9rem; font-weight: 700; font-size: .9rem; }
input[type=text], input[type=password], input[type=email], input[type=date], input[type=datetime-local], input[type=number], select, textarea {
  width: 100%; padding: .5rem; border: 1px solid #aaa; border-radius: 4px; background: #fff; }
select { width: auto; }
.fieldrow label { display: inline-block; margin-right: 1rem; font-weight: 400; }
button.primary, .btn { display: inline-block; margin-top: 1rem; padding: .55rem 1.2rem; font-weight: 700; color: #fff; background: #8a1c2b; border: 0; border-radius: 4px; cursor: pointer; text-decoration: none; }
button.primary:hover, .btn:hover { background: #6e1521; }
.narrow button.primary { width: 100%; }
button.sec, .btn.sec { background: #666; } button.danger { background: #b00020; }
button.link { background: none; border: 0; color: #fff; cursor: pointer; text-decoration: underline; padding: 0; }
form.inline { display: inline; margin: 0; }
.msg { padding: .6rem .8rem; background: #fff3cd; border: 1px solid #e0c36a; border-radius: 4px; }
.err { padding: .6rem .8rem; background: #fde2e2; border: 1px solid #d99; border-radius: 4px; }
.hint { font-size: .85rem; color: #555; margin: .3rem 0 0; }
.sub-link, .sub { text-align: left; }
.card .sub-link { text-align: center; margin-top: 1rem; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { padding: .7rem 0; border-bottom: 1px solid #e3e3e3; }
.list li:last-child { border: 0; }
.meta { font-size: .85rem; color: #555; }
.post-body { font-size: 1.02rem; }
.tablewrap { overflow-x: auto; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.12); margin-bottom: 1rem; }
table.t { border-collapse: collapse; width: 100%; font-size: .95rem; }
table.t th, table.t td { border-bottom: 1px solid #ddd; padding: .4rem .6rem; text-align: left; vertical-align: top; }
table.t th { background: #eceef3; white-space: nowrap; }
table.t.nowrap td { white-space: nowrap; }
dl.prof { display: grid; grid-template-columns: minmax(6em, 11em) minmax(0, 1fr); gap: .4rem 1rem; margin: 0; }
dl.prof dt { font-weight: 700; color: #444; } dl.prof dd { margin: 0; overflow-wrap: anywhere; }
.pager { display: flex; gap: 1rem; justify-content: center; margin: 1rem 0; }
.toolbar { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-bottom: 1rem; }
.toolbar input[type=text] { width: 18em; }
.toolbar button { margin: 0; padding: .45rem 1rem; }
.hp { position: absolute; left: -9999px; }
.foot { text-align: center; padding: 1rem; color: #666; font-size: .85rem; }
.hero { background: #fff; padding: 2rem; border-radius: 8px; border-left: 8px solid #8a1c2b; margin-bottom: 1rem; }
.two { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1rem; }

.card { overflow-wrap: anywhere; }
.post-img { max-width: 100%; height: auto; display: block; margin: .8rem 0; border-radius: 4px; }
.thumbs { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: .6rem; }
.thumb { width: 120px; font-size: .75rem; text-align: center; }
.thumb img { width: 120px; height: 90px; object-fit: cover; border-radius: 4px; display: block; }
.thumb button { margin: .2rem 0 0; padding: .15rem .5rem; font-size: .75rem; }

a.zoom { cursor: zoom-in; }
.lightbox { position: fixed; inset: 0; z-index: 1000; background: rgba(0,0,0,.88); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .8rem; cursor: zoom-out; }
.lightbox img { max-width: 96vw; max-height: 86vh; object-fit: contain; }
.lightbox a { color: #fff; font-size: .9rem; cursor: pointer; }
.lightbox button { position: absolute; top: .5rem; right: 1rem; background: none; border: 0; color: #fff; font-size: 2.2rem; line-height: 1; cursor: pointer; }

.form2 { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 0 1.5rem; }
.form2 .full { grid-column: 1 / -1; }
@media (max-width: 700px) { .form2 { grid-template-columns: 1fr; } }
