:root {
  --bg: #f1f5f9; --card: #fff; --text: #0f172a; --muted: #64748b; --border: #e2e8f0;
  --accent: #2563eb; --accent-dk: #1d4ed8; --accent-bg: #eff6ff;
  --green: #059669; --green-bg: #d1fae5; --orange: #b45309; --orange-bg: #fef3c7;
  --red: #dc2626; --red-bg: #fee2e2; --input: #fff;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1220; --card: #111a2e; --text: #e2e8f0; --muted: #94a3b8; --border: #1e293b;
    --accent: #3b82f6; --accent-dk: #2563eb; --accent-bg: #172554;
    --green: #34d399; --green-bg: #064e3b; --orange: #fbbf24; --orange-bg: #422006;
    --red: #f87171; --red-bg: #450a0a; --input: #0b1220;
  }
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; font-family: 'Inter', system-ui, sans-serif; background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.5; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.5rem; font-weight: 800; margin: 0 0 6px; letter-spacing: -.01em; }
h2 { font-size: 1.1rem; font-weight: 800; margin: 0 0 12px; }
img { max-width: 100%; }
.wrap { max-width: 1160px; margin: 0 auto; padding: 0 16px; }
main.wrap { padding-top: 20px; padding-bottom: 40px; min-height: 60vh; }
.muted { color: var(--muted); }
.small { font-size: .8rem; }
.center { text-align: center; }

/* header / footer */
.top { background: var(--card); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10; }
.top-in { display: flex; align-items: center; gap: 12px; height: 60px; }
.brand { display: flex; align-items: center; gap: 9px; color: var(--text); font-size: 1.05rem; font-weight: 600; }
.brand:hover { text-decoration: none; }
.brand img { height: 32px; width: auto; }
.brand b { color: var(--accent); font-weight: 800; }
.top-nav { margin-left: auto; display: flex; align-items: center; gap: 14px; font-weight: 600; font-size: .9rem; }
.top-nav > a:not(.btn) { color: var(--text); }
.foot { border-top: 1px solid var(--border); padding: 22px 0 30px; font-size: .8rem; color: var(--muted); }
.foot-links { margin-top: 6px; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 16px; border-radius: 9px; border: 1px solid transparent;
  font: inherit; font-size: .88rem; font-weight: 700; cursor: pointer; white-space: nowrap; transition: background .15s; }
.btn:hover { text-decoration: none; }
.btn:disabled { opacity: .6; cursor: wait; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dk); }
.btn-ghost { background: var(--card); border-color: var(--border); color: var(--text); }
.btn-ghost:hover { background: var(--bg); }
.btn-danger-text { color: var(--red); }
.btn-sm { padding: 6px 11px; font-size: .8rem; }
.btn-lg { padding: 12px 20px; font-size: .95rem; }
.btn-block { display: flex; width: 100%; }

/* browse */
.hero { text-align: center; padding: 26px 0 18px; }
.hero h1 { font-size: 1.9rem; }
.hero p { color: var(--muted); margin: 0 auto 18px; max-width: 560px; }
.search { position: relative; display: flex; gap: 8px; max-width: 560px; margin: 0 auto; }
.search i { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search input { flex: 1; min-width: 0; padding: 11px 12px 11px 38px; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 16px; scrollbar-width: none; }
.chip { flex-shrink: 0; padding: 7px 14px; border-radius: 99px; border: 1px solid var(--border); background: var(--card); color: var(--text); font-size: .84rem; font-weight: 600; }
.chip:hover { text-decoration: none; border-color: var(--accent); }
.chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
@media (max-width: 480px) { .grid { grid-template-columns: repeat(2, 1fr); gap: 10px; } }
.card { background: var(--card); border: 1px solid var(--border); border-radius: 14px; }
.pad { padding: 20px; margin-bottom: 18px; }
.item { overflow: hidden; color: var(--text); display: flex; flex-direction: column; transition: border-color .15s, transform .15s; }
.item:hover { text-decoration: none; border-color: var(--accent); transform: translateY(-1px); }
.item-cover { position: relative; aspect-ratio: 1; background: var(--bg); display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 2.2rem; }
.item-cover img { width: 100%; height: 100%; object-fit: cover; }
.item-vid { position: absolute; left: 8px; bottom: 8px; background: rgba(15,23,42,.75); color: #fff; font-size: .7rem; font-weight: 700; padding: 2px 8px; border-radius: 6px; }
.item-body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 3px; }
.item-title { font-weight: 700; font-size: .9rem; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.item-price { font-weight: 800; color: var(--accent); }
.item-seller { font-size: .75rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item-seller i, .verified { color: var(--accent); }
.tag { align-self: flex-start; font-size: .66rem; font-weight: 800; text-transform: uppercase; letter-spacing: .03em; padding: 2px 7px; border-radius: 5px; background: var(--accent-bg); color: var(--accent); }
.tag-pisotab { background: var(--green-bg); color: var(--green); }
.tag-board { background: var(--orange-bg); color: var(--orange); }
.tag-wallpaper, .tag-video { background: #f3e8ff; color: #7e22ce; }
@media (prefers-color-scheme: dark) { .tag-wallpaper, .tag-video { background: #3b0764; color: #d8b4fe; } }
.empty { text-align: center; padding: 50px 16px; color: var(--muted); }
.empty i { font-size: 2.6rem; display: block; margin-bottom: 6px; }
.pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 22px; color: var(--muted); font-size: .85rem; }

/* item page */
.back { display: inline-flex; align-items: center; gap: 6px; font-size: .85rem; font-weight: 600; margin-bottom: 14px; }
.detail { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 26px; align-items: start; }
@media (max-width: 820px) { .detail { grid-template-columns: 1fr; } }
.g-main { width: 100%; aspect-ratio: 1; object-fit: contain; background: #000; border-radius: 14px; display: block; }
img.g-main { background: var(--card); border: 1px solid var(--border); }
.g-none { display: flex; align-items: center; justify-content: center; font-size: 3rem; color: var(--muted); background: var(--card); border: 1px solid var(--border); }
.g-thumbs { display: flex; gap: 8px; margin-top: 10px; overflow-x: auto; }
.g-thumbs img { width: 70px; height: 70px; object-fit: cover; border-radius: 9px; border: 1px solid var(--border); display: block; }
.info h1 { margin-top: 8px; font-size: 1.45rem; }
.price { font-size: 1.6rem; font-weight: 800; color: var(--accent); margin-bottom: 14px; }
.hint { font-size: .78rem; color: var(--muted); margin: 6px 0 18px; text-align: center; }
.seller-card { padding: 14px; margin-bottom: 20px; display: flex; flex-direction: column; gap: 12px; }
.seller-row { display: flex; gap: 12px; align-items: center; }
.seller-name { font-weight: 800; color: var(--text); }
.avatar { width: 42px; height: 42px; border-radius: 11px; background: var(--accent-bg); color: var(--accent); display: flex; align-items: center; justify-content: center; font-weight: 800; flex-shrink: 0; }
.avatar-lg { width: 60px; height: 60px; font-size: 1.5rem; border-radius: 14px; }
.desc { white-space: normal; overflow-wrap: anywhere; margin-bottom: 14px; }
.seller-head { display: flex; align-items: center; gap: 16px; padding: 18px; margin-bottom: 20px; flex-wrap: wrap; }
.seller-head-info { flex: 1; min-width: 200px; }
.seller-head h1 { margin: 0; }

/* forms */
.form { display: flex; flex-direction: column; gap: 14px; }
.form label { display: flex; flex-direction: column; gap: 5px; font-size: .84rem; font-weight: 700; }
.form label .muted { font-weight: 400; }
.field-label { font-size: .84rem; font-weight: 700; margin-bottom: -6px; }
.field-label .muted { font-weight: 400; }
input, select, textarea { font: inherit; font-size: .95rem; padding: 10px 12px; border: 1px solid var(--border); border-radius: 9px; background: var(--input); color: var(--text); outline: none; width: 100%; }
input[type=checkbox], input[type=radio] { width: auto; }
input[type=file] { padding: 8px; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37,99,235,.15); }
textarea { resize: vertical; }
.form label.check { flex-direction: row; align-items: flex-start; gap: 9px; font-weight: 400; font-size: .85rem; }
.check input { margin-top: 3px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 560px) { .row2 { grid-template-columns: 1fr; } }
.auth { max-width: 420px; margin: 30px auto; padding: 26px; }
.auth .form { margin: 16px 0; }
.notice { padding: 11px 14px; border-radius: 10px; font-size: .88rem; margin-bottom: 14px; display: flex; gap: 8px; align-items: flex-start; }
.notice-err { background: var(--red-bg); color: var(--red); }
.notice-ok { background: var(--green-bg); color: var(--green); }
.notice-warn { background: var(--orange-bg); color: var(--orange); }
.pics { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.pics:empty { display: none; }
.pic { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--bg); }
.pic img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.form .pic-opt { flex-direction: row; align-items: center; gap: 6px; font-weight: 500; font-size: .78rem; padding: 4px 8px; }
.vid-prev { width: 100%; max-height: 320px; background: #000; border-radius: 10px; }
.progress { position: relative; height: 26px; border-radius: 8px; background: var(--bg); border: 1px solid var(--border); overflow: hidden; }
.progress div { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--accent-bg); transition: width .2s; }
.progress span { position: relative; display: block; text-align: center; font-size: .78rem; font-weight: 700; line-height: 24px; }

/* account */
.acct-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.status { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 12px; margin-bottom: 18px; font-size: .9rem; }
.status > i { font-size: 1.3rem; line-height: 1.2; }
.status-pending { background: var(--orange-bg); color: var(--orange); }
.status-approved { background: var(--green-bg); color: var(--green); }
.status-rejected, .status-suspended { background: var(--red-bg); color: var(--red); }
.status a { color: inherit; text-decoration: underline; }
.dl { display: grid; grid-template-columns: 150px 1fr; gap: 6px 14px; margin: 0 0 10px; font-size: .9rem; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 560px) { .dl { grid-template-columns: 1fr; } .dl dd { margin-bottom: 8px; } }
.sec-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 8px 0 12px; }
.sec-head h2 { margin: 0; }
.mylist { display: flex; flex-direction: column; gap: 8px; }
.my-row { display: flex; align-items: center; gap: 12px; padding: 10px; flex-wrap: wrap; }
.my-thumb { width: 64px; height: 64px; border-radius: 9px; overflow: hidden; background: var(--bg); display: flex; align-items: center; justify-content: center; color: var(--muted); flex-shrink: 0; }
.my-thumb img { width: 100%; height: 100%; object-fit: cover; }
.my-info { flex: 1; min-width: 160px; }
.my-title { font-weight: 700; color: var(--text); }
.my-actions { display: flex; gap: 6px; }
.badge-warn { display: inline-block; margin-top: 4px; font-size: .75rem; font-weight: 600; color: var(--orange); background: var(--orange-bg); padding: 2px 8px; border-radius: 6px; }
