:root {
  --ink: #151518;
  --muted: #666972;
  --line: #dedfe5;
  --soft: #f6f7f9;
  --accent: #0f766e;
  --danger: #a12828;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: Inter, "Microsoft YaHei", Arial, sans-serif; color: var(--ink); background: #f4f5f7; }
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; }
.topbar { position: sticky; top: 0; z-index: 10; height: 70px; display: flex; align-items: center; justify-content: space-between; padding: 0 36px; border-bottom: 1px solid rgba(0,0,0,.06); background: rgba(255,255,255,.88); backdrop-filter: blur(18px); }
.brand { display: inline-flex; align-items: center; gap: 12px; font-size: 17px; }
.brand span { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; background: #111; color: #fff; font-weight: 800; }
.topbar nav { display: flex; align-items: center; gap: 16px; color: var(--muted); font-size: 14px; }
.topbar nav a:hover { color: #111; }
.ghost, .dark, .search-box button { min-height: 38px; padding: 0 15px; border-radius: 10px; border: 1px solid var(--line); background: #fff; color: #222; cursor: pointer; }
.dark, .search-box button { border-color: #111; background: #111; color: #fff; }
.ghost:hover { background: #f1f2f5; }
.hidden { display: none !important; }
main { display: grid; gap: 22px; padding: 28px clamp(16px, 4vw, 44px) 52px; }
.catalog-band, .detail-band, .admin-band { max-width: 1320px; width: 100%; margin: 0 auto; }
.catalog-head { display: grid; grid-template-columns: minmax(0,1fr) minmax(280px, 420px); align-items: end; gap: 22px; margin-bottom: 20px; }
.eyebrow { margin: 0 0 8px; color: var(--accent); font-size: 12px; font-weight: 800; letter-spacing: 0; text-transform: uppercase; }
h1, h2, h3 { margin: 0; letter-spacing: 0; }
h1 { font-size: clamp(32px, 5vw, 58px); line-height: 1.02; }
h2 { font-size: 24px; }
h3 { font-size: 17px; }
.catalog-head p:not(.eyebrow) { max-width: 720px; margin: 14px 0 0; color: var(--muted); line-height: 1.7; }
.search-box { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 8px; padding: 8px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.search-box input { min-width: 0; border: 0; outline: 0; padding: 0 10px; background: transparent; }
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.product-card { display: grid; gap: 12px; min-width: 0; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; cursor: pointer; transition: border-color .16s ease, box-shadow .16s ease; }
.product-card:hover { border-color: #bfc1c8; box-shadow: 0 12px 34px rgba(0,0,0,.07); }
.product-card img, .product-placeholder { width: 100%; aspect-ratio: 4 / 3; border-radius: 6px; object-fit: cover; background: #eceef2; }
.product-placeholder { display: grid; place-items: center; color: #8a8d96; font-weight: 800; }
.product-card-body { display: grid; gap: 6px; }
.product-title { min-height: 42px; color: #111; font-weight: 800; line-height: 1.35; overflow-wrap: anywhere; }
.product-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 13px; }
.price { color: #a12828; font-weight: 800; }
.category { max-width: 58%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.empty-state { padding: 36px; border: 1px dashed #c8cbd3; border-radius: 8px; color: var(--muted); text-align: center; background: #fff; }
.detail-card { display: grid; gap: 20px; padding: 20px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.detail-head { display: grid; grid-template-columns: minmax(280px, 420px) minmax(0,1fr); gap: 22px; align-items: start; }
.detail-cover { width: 100%; aspect-ratio: 4 / 3; border-radius: 6px; object-fit: contain; background: #f0f1f4; cursor: zoom-in; }
.detail-info { display: grid; gap: 10px; }
.detail-info p { margin: 0; color: var(--muted); line-height: 1.7; white-space: pre-wrap; }
.detail-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.file-section { display: grid; gap: 10px; }
.file-section h3 { display: flex; justify-content: space-between; align-items: center; padding-top: 8px; border-top: 1px solid var(--line); }
.file-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.file-tile { display: grid; gap: 8px; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: #fafbfc; min-width: 0; }
.file-tile img { width: 100%; aspect-ratio: 4 / 3; object-fit: contain; border-radius: 6px; background: #fff; cursor: zoom-in; }
.file-tile video { width: 100%; aspect-ratio: 16 / 9; border-radius: 6px; background: #111; }
.file-name { color: #25262b; font-size: 13px; overflow-wrap: anywhere; }
.file-size { color: var(--muted); font-size: 12px; }
.file-link { display: inline-flex; justify-content: center; align-items: center; min-height: 34px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: #111; font-size: 13px; }
.admin-workspace { display: grid; gap: 16px; }
.admin-layout { display: grid; grid-template-columns: minmax(260px, 340px) minmax(0, 1fr); gap: 16px; align-items: start; }
.admin-side, .admin-main, .admin-login, .admin-upload, .admin-editor { padding: 18px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.admin-main { display: grid; gap: 16px; padding: 0; border: 0; background: transparent; }
.admin-login, .upload-grid { display: grid; gap: 12px; }
.admin-title { display: flex; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.admin-title span { color: var(--muted); font-size: 13px; }
.side-title { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; }
.admin-product-list { display: grid; gap: 8px; }
.batch-download { display: grid; gap: 8px; margin-bottom: 12px; padding: 10px; border: 1px solid #d7eee9; border-radius: 8px; background: #eef8f6; }
.batch-download span { color: var(--muted); font-size: 13px; }
.batch-download button:disabled { cursor: not-allowed; opacity: .45; }
.admin-product-select-row { display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 8px; align-items: center; }
.product-select { width: 18px; height: 18px; margin: 0; }
.admin-product-item { display: grid; gap: 4px; width: 100%; min-height: 58px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); text-align: left; cursor: pointer; }
.admin-product-item:hover, .admin-product-item.active { border-color: #93c9c1; background: #eef8f6; }
.admin-product-item span { font-weight: 800; overflow-wrap: anywhere; }
.admin-product-item small { color: var(--muted); }
label { display: grid; gap: 7px; color: #4f535c; font-size: 13px; }
input, textarea { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; background: #fff; color: var(--ink); outline: none; }
textarea { min-height: 108px; resize: vertical; }
.upload-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
.upload-grid .wide { grid-column: 1 / -1; }
.folder-picker { min-height: 120px; place-items: center; text-align: center; border: 1px dashed #bfc3cc; border-radius: 8px; background: #f7f8fa; cursor: pointer; }
.folder-picker strong { color: #111; font-size: 16px; }
.folder-picker span { color: var(--muted); line-height: 1.55; }
.upload-actions { display: flex; gap: 12px; align-items: center; margin-top: 14px; flex-wrap: wrap; }
.upload-actions span, .message { color: var(--muted); font-size: 13px; }
.admin-edit { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; padding: 14px; border: 1px solid #d7eee9; border-radius: 8px; background: #eef8f6; }
.admin-edit .wide { grid-column: 1 / -1; }
.append-panel { margin-top: 16px; }
.append-grid { display: grid; grid-template-columns: minmax(220px, 1fr) auto; gap: 10px; align-items: end; margin-top: 12px; }
.append-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.admin-files { margin-top: 16px; }
.file-row { display: grid; grid-template-columns: 54px minmax(0, 1fr) auto; gap: 10px; align-items: center; min-height: 64px; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: #fafbfc; }
.file-row + .file-row { margin-top: 8px; }
.file-row-preview { display: grid; place-items: center; width: 54px; height: 44px; border-radius: 6px; background: #eceef2; color: var(--muted); font-size: 12px; font-weight: 800; }
.file-row-preview img { width: 100%; height: 100%; object-fit: contain; border-radius: 6px; cursor: zoom-in; }
.file-row b { display: block; font-size: 13px; overflow-wrap: anywhere; }
.file-row small { color: var(--muted); }
.compact { padding: 16px; }
.danger { min-height: 38px; padding: 0 15px; border: 1px solid #ead8d8; border-radius: 10px; background: #f7f1f1; color: var(--danger); cursor: pointer; }
.image-viewer { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 24px; background: rgba(12,12,15,.88); }
.image-viewer img { max-width: min(1600px, calc(100vw - 60px)); max-height: calc(100vh - 60px); object-fit: contain; background: #111; }
.image-viewer button { position: fixed; top: 18px; right: 18px; width: 38px; height: 38px; border: 1px solid rgba(255,255,255,.3); border-radius: 999px; background: rgba(255,255,255,.12); color: #fff; font-size: 24px; cursor: pointer; }
@media (max-width: 860px) {
  .topbar { height: auto; padding: 14px 18px; align-items: flex-start; gap: 12px; flex-direction: column; }
  .catalog-head, .detail-head, .admin-layout, .append-grid { grid-template-columns: 1fr; }
  .upload-grid { grid-template-columns: 1fr; }
  .file-row { grid-template-columns: 48px minmax(0, 1fr); }
  .file-row .danger { grid-column: 1 / -1; }
  h1 { font-size: 34px; }
}
