.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; }
.login form { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 28px; width: 100%; max-width: 360px; }
.login h1 { margin: 0 0 4px; font-size: 22px; }
.login p { color: var(--muted); margin: 0 0 20px; }

.shell { display: grid; grid-template-columns: 270px 1fr; min-height: 100vh; }
.side { border-right: 1px solid var(--line); background: var(--panel); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.side .brand { padding: 18px 16px; font-weight: 800; font-size: 16px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }
.side .brand small { font-weight: 500; color: var(--muted); display: block; font-size: 12px; }
.clist { flex: 1; overflow: auto; padding: 8px; }
.citem { display: flex; gap: 10px; align-items: center; padding: 8px; border-radius: 8px; cursor: pointer; }
.citem:hover { background: var(--soft); }
.citem.on { background: var(--accent-soft); }
.citem .avatar { width: 38px; height: 38px; }
.citem div { flex: 1; min-width: 0; }
.citem b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.citem small { color: var(--muted); }
.pill { background: var(--warn); color: #fff; border-radius: 99px; font-size: 11px; font-weight: 800; padding: 1px 7px; }
.side .foot { padding: 12px; border-top: 1px solid var(--line); display: flex; gap: 8px; }

.main { padding: 24px 28px 80px; min-width: 0; }
.chead { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; margin-bottom: 18px; }
.chead .avatar { width: 64px; height: 64px; }
.chead h1 { margin: 0; font-size: 22px; }
.chead .acts { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 20px; overflow-x: auto; }
.tabs button { background: none; border: 0; padding: 10px 14px; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; cursor: pointer; white-space: nowrap; }
.tabs button.on { color: var(--ink); border-bottom-color: var(--accent); }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 18px; margin-bottom: 16px; }
.panel h3 { margin: 0 0 12px; }

.ptable { width: 100%; border-collapse: collapse; }
.ptable td, .ptable th { padding: 10px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.ptable th { font-size: 12px; color: var(--muted); text-transform: uppercase; font-weight: 600; }
.ptable tr.click { cursor: pointer; } .ptable tr.click:hover { background: var(--soft); }
.ptable .th { width: 48px; height: 60px; border-radius: 6px; overflow: hidden; background: var(--soft); }
.ptable .th img, .ptable .th video, .ptable .th .noimg { width: 100%; height: 100%; object-fit: cover; }
.ptable .cap { max-width: 340px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--muted); }
.new { background: var(--danger); color: #fff; font-size: 10px; font-weight: 800; padding: 1px 6px; border-radius: 4px; margin-left: 6px; }

.editor { display: grid; grid-template-columns: 340px 1fr; gap: 0; }
.editor .left { background: var(--soft); padding: 18px; border-right: 1px solid var(--line); }
.editor .right { padding: 18px 22px; }
.mlist { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 10px; }
.mitem { position: relative; aspect-ratio: 4/5; background: #000; border-radius: 6px; overflow: hidden; cursor: grab; }
.mitem img, .mitem video { width: 100%; height: 100%; object-fit: cover; }
.mitem button { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: rgba(0,0,0,.7); color: #fff; cursor: pointer; line-height: 1; }
.mitem .n { position: absolute; left: 4px; bottom: 4px; background: rgba(0,0,0,.7); color: #fff; font-size: 10px; padding: 0 5px; border-radius: 3px; }
.drop { border: 2px dashed var(--line); border-radius: 10px; padding: 18px; text-align: center; color: var(--muted); cursor: pointer; background: var(--panel); }
.drop.over { border-color: var(--accent); background: var(--accent-soft); }
.prodrow { display: grid; grid-template-columns: 44px 1fr 110px 1fr 32px; gap: 6px; align-items: center; margin-bottom: 6px; }
.prodrow .pimg { width: 44px; height: 44px; border-radius: 6px; background: var(--soft); border: 1px dashed var(--line); cursor: pointer; overflow: hidden; display: flex; align-items: center; justify-content: center; color: var(--muted); }
.prodrow .pimg img { width: 100%; height: 100%; object-fit: cover; }
.counter { text-align: right; font-size: 12px; color: var(--muted); }
.stickybar { position: sticky; bottom: 0; background: var(--panel); border-top: 1px solid var(--line); padding: 12px 22px; display: flex; gap: 8px; justify-content: flex-end; margin: 0 -22px -18px; }

.extra { border: 1px solid var(--line); border-radius: 10px; padding: 14px; margin-bottom: 12px; }
.pf-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; }
.pf-grid .tile { cursor: default; }
.pf-grid .tile button { position: absolute; top: 4px; right: 4px; border: 0; border-radius: 50%; width: 22px; height: 22px; background: rgba(0,0,0,.7); color: #fff; cursor: pointer; }
.linkbox { display: flex; gap: 8px; }
.linkbox input { font-family: ui-monospace, monospace; font-size: 12px; }

.mobile-top { display: none; }
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; inset: 0 30% 0 0; z-index: 50; transform: translateX(-105%); transition: transform .2s; box-shadow: var(--shadow); }
  .side.open { transform: none; }
  .mobile-top { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--line); background: var(--panel); position: sticky; top: 0; z-index: 40; }
  .main { padding: 16px 16px 80px; }
  .editor { grid-template-columns: 1fr; }
  .editor .left { border-right: 0; border-bottom: 1px solid var(--line); }
  .prodrow { grid-template-columns: 44px 1fr 32px; }
  .prodrow .pp, .prodrow .pl { grid-column: 2 / 3; }
  .ptable .cap, .ptable .hide-m { display: none; }
  .pf-grid { grid-template-columns: repeat(3, 1fr); }
}
