* { box-sizing: border-box; }
body {
  margin: 0;
  background: #f5f6f4;
  color: #13201f;
  font-family: "Helvetica Neue", Helvetica, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
.admin-header {
  height: 64px;
  background: #0b3f3f;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 34px;
}
.admin-logo {
  color: #fff;
  text-decoration: none;
  font-family: Arial, Helvetica, sans-serif;
  font-weight: 700;
  font-size: 34px;
  letter-spacing: -4px;
  line-height: 1;
}
.admin-logo span {
  font-family: inherit;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: .08em;
  margin-left: 16px;
  opacity: .85;
}
.admin-header-actions { display: flex; gap: 10px; }
.btn {
  border: 1px solid #0b3f3f;
  background: #0b3f3f;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  padding: 11px 18px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: opacity .15s, background .15s, color .15s;
}
.btn:hover { opacity: .82; }
.btn.ghost { background: transparent; border-color: rgba(255,255,255,.45); color: #fff; }
.btn.ghost:hover { background: rgba(255,255,255,.12); }
.btn.danger { border-color: rgba(255,180,180,.6); color: #ffd6d6; }
.btn.primary { background: #0b3f3f; color: #fff; border-color: #0b3f3f; }
.btn.small { padding: 7px 12px; font-size: 11px; }
.admin-wrap { max-width: 1200px; margin: 0 auto; padding: 26px 24px 80px; }
.notice {
  background: #fff8e8;
  border: 1px solid #eadab4;
  color: #6a5424;
  font-size: 12px;
  line-height: 1.7;
  padding: 12px 16px;
  margin-bottom: 22px;
}
.tabs { display: flex; gap: 4px; border-bottom: 1px solid #d9dedb; margin-bottom: 26px; }
.tab {
  border: 0;
  background: none;
  padding: 13px 22px;
  font-size: 13px;
  font-weight: 700;
  color: #66716e;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.tab.active { color: #0b3f3f; border-bottom-color: #0b3f3f; }
.panel { display: none; }
.panel.active { display: block; }
.panel-head { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 22px; }
.panel-head h1 { font-size: 24px; margin: 0 0 6px; letter-spacing: .01em; }
.panel-head p { margin: 0; font-size: 13px; color: #6b7572; }
.count { font-size: 12px; color: #6b7572; }

.product-form {
  background: #fff;
  border: 1px solid #e3e7e4;
  padding: 24px;
  margin-bottom: 36px;
}
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 22px; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 12px; font-weight: 700; }
.field input[type="text"], .field input[type="number"], .field textarea {
  border: 1px solid #d6dcd8;
  padding: 10px 12px;
  font-size: 13px;
  font-family: inherit;
  outline: none;
  background: #fff;
}
.field input:focus, .field textarea:focus { border-color: #0b3f3f; }
.field textarea { resize: vertical; }
.checkbox-field { justify-content: flex-end; }
.checkbox-field label { font-weight: 400; font-size: 12px; display: flex; align-items: center; gap: 8px; }
.upload-row { display: flex; gap: 18px; align-items: flex-start; }
.upload-preview {
  width: 120px; height: 150px;
  border: 1px dashed #cbd3ce;
  background: #fafbfa;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  flex: 0 0 auto;
  color: #97a19d;
  font-size: 11px;
}
.upload-preview img { width: 100%; height: 100%; object-fit: cover; }
.pack-preview { flex-direction: column; gap: 6px; padding: 8px; text-align: center; word-break: break-all; }
.pack-preview .pack-icon { font-size: 30px; line-height: 1; }
.pack-preview .pack-name { font-size: 11px; color: #45504d; max-height: 42px; overflow: hidden; }
.pack-preview .pack-size { font-size: 10px; color: #97a19d; }
.upload-controls { flex: 1; }
.upload-controls input[type="file"] { font-size: 12px; max-width: 100%; }
.hint { font-size: 11px; color: #7c8682; margin: 8px 0 10px; line-height: 1.6; }
.form-actions { margin-top: 22px; display: flex; gap: 10px; }
.section-title { font-size: 15px; margin: 0 0 14px; }

.product-list { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.product-card { background: #fff; border: 1px solid #e3e7e4; overflow: hidden; }
.product-card img { width: 100%; height: 200px; object-fit: cover; }
.product-card-body { padding: 13px; }
.product-card h3 { font-size: 13px; margin: 0 0 5px; }
.product-card .meta { font-size: 11px; color: #6b7572; margin-bottom: 10px; }
.product-card .desc { font-size: 11px; color: #818b87; line-height: 1.5; min-height: 32px; }
.product-card-actions { display: flex; gap: 8px; margin-top: 12px; }
.product-card-actions .btn { flex: 1; padding: 8px; font-size: 11px; }
.badge { display: inline-block; background: #e7f0ed; color: #0b3f3f; font-size: 10px; padding: 2px 6px; margin-left: 6px; }
.pack-badge { background: #e7f0f7; color: #0b6b8f; }
.manual-badge { background: #f2eee7; color: #8a6d32; }

.asset-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.asset-card { background: #fff; border: 1px solid #e3e7e4; padding: 14px; }
.asset-card h3 { font-size: 12px; margin: 0 0 10px; }
.asset-card img { width: 100%; height: 150px; object-fit: cover; background: #f1f3f1; margin-bottom: 10px; }
.asset-card input[type="file"] { font-size: 11px; width: 100%; }
.asset-card .asset-actions { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.asset-card .changed { font-size: 10px; color: #b26b00; }

.login-overlay {
  position: fixed; inset: 0;
  background: rgba(11, 34, 33, .86);
  display: none;
  align-items: center; justify-content: center;
  z-index: 200;
  padding: 20px;
}
.login-overlay.show { display: flex; }
.login-box {
  background: #fff;
  width: 100%; max-width: 380px;
  padding: 34px;
  text-align: center;
  box-shadow: 0 24px 60px rgba(0,0,0,.25);
}
.login-logo {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 44px; font-weight: 700; letter-spacing: -5px;
  color: #0b3f3f; margin-bottom: 18px;
}
.login-box h2 { font-size: 18px; margin: 0 0 8px; }
.login-box p { font-size: 12px; color: #6b7572; margin: 0 0 20px; line-height: 1.6; }
.login-box input {
  width: 100%;
  border: 1px solid #d6dcd8;
  padding: 12px;
  font-size: 14px;
  outline: none;
  margin-bottom: 14px;
}
.login-box input:focus { border-color: #0b3f3f; }
.login-box .btn { width: 100%; }
.login-error { color: #b42318; font-size: 12px; min-height: 18px; margin-top: 10px; }
.login-note { font-size: 10px; color: #9aa39f; line-height: 1.6; margin-top: 14px; }

.toast {
  position: fixed;
  right: 26px; bottom: 26px;
  background: #0b3f3f;
  color: #fff;
  padding: 13px 20px;
  font-size: 12px;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity .2s, transform .2s;
  z-index: 99;
}
.toast.show { opacity: 1; transform: translateY(0); }

@media (max-width: 900px) {
  .form-grid { grid-template-columns: 1fr; }
  .product-list { grid-template-columns: repeat(2, 1fr); }
  .asset-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .admin-header { padding: 0 16px; }
  .admin-logo span { display: none; }
  .admin-wrap { padding: 18px 14px 60px; }
  .product-list, .asset-grid { grid-template-columns: 1fr; }
  .panel-head { flex-direction: column; align-items: flex-start; gap: 10px; }
  .upload-row { flex-direction: column; }
}
