/* ==============================================
 * 美店轻管家 admin · Layout Shell
 * L1(94) + L2(140) + Topbar(50) + Main
 * ============================================== */

.app-shell {
  display: flex;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  background: #F8F8F8;
}

/* ============= Sidebar L1 ============= */
.sidebar-l1 {
  width: var(--sidebar-l1-width);
  min-width: var(--sidebar-l1-width);
  background: var(--bg-sider);
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-l1 .brand-logo {
  width: 100%;
  height: 64px;
  min-height: 64px;
  flex: 0 0 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-sider);
  user-select: none;
  cursor: pointer;
}

.sidebar-l1 .brand-logo .brand-logo-img {
  display: block;
  width: 76px;
  height: 34px;
  object-fit: contain;
}

.sidebar-l1 .l1-list {
  width: 100%;
  display: flex;
  flex-direction: column;
  padding: 0;
}

.sidebar-l1 .l1-item {
  width: 78px;
  height: var(--l1-item-height);
  margin: 0 8px 5px;
  padding: 0 0 0 12px;
  display: flex;
  flex-direction: row;
  align-items: center;
  border-radius: 2px;
  color: var(--text-l1);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  font-size: 14px;
  font-weight: 400;
  position: relative;
  user-select: none;
}

.sidebar-l1 .l1-item:hover {
  background: var(--brand-primary-bg);
  color: var(--brand-primary);
}

.sidebar-l1 .l1-item.active {
  background: var(--brand-primary);
  color: #fff;
}

.sidebar-l1 .l1-item .icon {
  font-size: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-right: 5px;
}

.sidebar-l1 .l1-item .icon svg {
  width: 16px;
  height: 16px;
}

.sidebar-l1 .l1-item .label {
  font-size: 14px;
  line-height: 1;
}

/* ============= Sidebar L2 ============= */
.sidebar-l2 {
  width: var(--sidebar-l2-width);
  min-width: var(--sidebar-l2-width);
  background: #FFFFFF;
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow-y: auto;
  border-right: 1px solid var(--border-lighter);
}

.sidebar-l2 .l2-body {
  padding: 0;
}

.sidebar-l2 .l2-group-title {
  margin: 14px 0 6px 0;
  padding: 10px 16px 0;
  font-size: 12px;
  color: #B0B3BC;
  user-select: none;
  font-weight: 400;
  letter-spacing: 0.2px;
  border-top: 1px solid var(--border-lighter);
}

.sidebar-l2 .l2-body > .l2-group-title:first-child {
  border-top: none;
  margin-top: 12px;
  padding-top: 0;
}

.sidebar-l2 .l2-item {
  display: flex;
  align-items: center;
  width: 100%;
  height: var(--l2-item-height);
  margin: 0;
  padding: 0 12px 0 28px;
  border-radius: 0;
  color: var(--text-l2);
  font-size: 13px;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
  position: relative;
}

.sidebar-l2 .l2-item:hover {
  color: var(--brand-primary);
  background: rgba(251, 123, 16, 0.06);
}

.sidebar-l2 .l2-item.active {
  color: var(--brand-primary);
  background: var(--brand-primary-bg);
  font-weight: 600;
}

/* ============= Main + Topbar ============= */
.main-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

.topbar {
  height: var(--topbar-height);
  min-height: var(--topbar-height);
  background: transparent;
  display: flex;
  align-items: center;
  padding: 0 0 0 16px;
  gap: 14px;
}

.topbar .tb-left {
  display: flex;
  align-items: center;
  gap: 12px;
  pointer-events: none;
}

.topbar .tb-hamburger {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-regular);
  border-radius: 2px;
  pointer-events: auto;
}

.topbar .tb-hamburger:hover { color: var(--brand-primary); }

.topbar .tb-back {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-regular);
  border: 1px solid var(--border-base);
  border-radius: 50%;
  background: #fff;
  pointer-events: auto;
}

.topbar .tb-back:hover { color: var(--brand-primary); border-color: var(--brand-primary); }

.topbar .tb-title {
  font-size: 15px;
  font-weight: 400;
  color: #333333;
  margin-left: 4px;
  pointer-events: none;
}

.topbar .tb-spacer { flex: 0 0 14px; }

.topbar .tb-tools {
  display: flex;
  align-items: center;
  gap: 14px;
  height: 40px;
  padding: 0 14px;
  background: #FFFFFF;
  border-radius: 2px;
  font-size: 13px;
  color: var(--text-primary);
  flex: 1;
  margin-right: 14px;
  justify-content: flex-end;
  white-space: nowrap;
  overflow: hidden;
  position: relative;
  z-index: 1;
}

.topbar .tb-tool {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 2px;
  position: relative;
  line-height: 1;
  user-select: none;
  font-size: 13px;
  color: var(--text-primary);
  white-space: nowrap;
  flex-shrink: 0;
}

.topbar button.tb-tool {
  border: 0;
  background: transparent;
  font-family: inherit;
}

.topbar .tb-tool:hover { color: var(--brand-primary); }

.topbar .tb-tool .ic {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid var(--border-base);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: var(--text-regular);
  background: #fff;
}

.topbar .tb-tool:hover .ic { border-color: var(--brand-primary); color: var(--brand-primary); }

.topbar .tb-tool .ic.ic-red {
  border-color: var(--color-danger);
  color: var(--color-danger);
}

.topbar .tb-tool .dot {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 6px;
  height: 6px;
  background: #F56C6C;
  border-radius: 50%;
  animation: pulse 1.6s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(1.3); }
}

@media (max-width: 1360px) {
  .topbar .tb-tools {
    gap: 9px;
    padding: 0 10px;
  }

  .topbar .tb-tool .tx {
    display: none;
  }
}

.topbar .tb-store {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 10px;
  border: 1px solid var(--border-base);
  border-radius: 2px;
  font-size: 12px;
  color: var(--text-primary);
  cursor: pointer;
  background: #fff;
}

.topbar .tb-store:hover { border-color: var(--brand-primary); color: var(--brand-primary); }

.topbar .tb-user {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 2px;
  margin-left: 4px;
  font-size: 13px;
  color: var(--text-primary);
}

.topbar .tb-user:hover { color: var(--brand-primary); }

.topbar .tb-user .avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 38%, #F4D2A8 0 22%, transparent 22%),
    radial-gradient(ellipse at 50% 90%, #C7884B 0 40%, transparent 40%),
    linear-gradient(135deg, #DEA770, #B07A45);
  border: 1px solid var(--border-light);
}

.topbar .tb-divider {
  width: 1px;
  height: 30px;
  background: #DEDEDE;
  align-self: center;
}

/* ============= Content ============= */
.content-area {
  flex: 1;
  overflow: auto;
  padding: 10px 14px 14px;
  background: var(--bg-page);
}

.page-card {
  background: #fff;
  border: 1px solid var(--border-lighter);
  border-radius: var(--radius-md);
  min-height: calc(100vh - var(--topbar-height) - 24px);
}

.page-header {
  height: var(--page-title-height);
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-lighter);
}

.page-header .title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.title-bar::before,
.page-header .title-bar::before {
  content: '';
  display: inline-block;
  width: 3px;
  height: 14px;
  background: var(--brand-primary-light);
  margin-right: 6px;
  vertical-align: -2px;
}

.page-header .actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.page-body {
  padding: 16px;
}

/* ============= Login page ============= */
.login-shell {
  width: 100vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #FFF3E6 0%, #FFE2C2 100%);
}

.login-card {
  width: 920px;
  height: 560px;
  background: #fff;
  border-radius: 4px;
  box-shadow: var(--shadow-modal);
  display: flex;
  overflow: hidden;
}

.login-left {
  flex: 1.1;
  background: linear-gradient(135deg, var(--brand-primary) 0%, #E56E0D 100%);
  color: #fff;
  padding: 48px;
  display: flex;
  flex-direction: column;
}

.login-hero-brand {
  width: 188px;
  height: 64px;
  padding: 12px 16px;
  margin-bottom: 24px;
  background: rgba(255, 255, 255, 0.94);
  border-radius: 4px;
  box-shadow: 0 10px 26px rgba(79, 35, 0, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-hero-logo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.login-left h1 { font-size: 28px; margin: 0 0 12px; }
.login-left p { opacity: 0.9; font-size: 14px; line-height: 1.7; }

.login-left .industry-grid {
  margin-top: auto;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.login-left .industry-cell {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 2px;
  padding: 14px;
  font-size: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.login-left .industry-cell .ic { font-size: 22px; }
.login-left .industry-cell b { font-size: 14px; font-weight: 600; }

.login-right {
  flex: 1;
  padding: 60px 48px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.login-right h2 {
  font-size: 22px;
  color: var(--text-primary);
  margin: 0 0 8px;
}

.login-right .sub { color: var(--text-secondary); font-size: 13px; margin-bottom: 24px; }

.login-right .tips {
  margin-top: 20px;
  padding: 10px 12px;
  background: var(--brand-primary-bg);
  border-radius: 2px;
  font-size: 12px;
  color: var(--brand-primary);
  line-height: 1.6;
}
