/* 登录页专用样式 - 轻量级，无依赖 */
/* 全局 reset 与 global.scss 完全一致，避免 JS 加载后样式跳变（闪烁根因） */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
html, body, #app {
  width: 100%;
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: #f5f7fa;
  color: #303133;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  font-size: 14px;
}
a { text-decoration: none; color: inherit; }
ul, ol { list-style: none; }
img { max-width: 100%; display: block; }

/* 首页外壳：全局左右边距 60px，纵向弹性布局（版权贴底） */
.home-shell {
  min-height: 100vh;
  background: #f5f7fa;
  padding: 0 60px;
  display: flex;
  flex-direction: column;
}

/* LOGO：正常流，顶部 38px */
.brand-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 38px;
}

.brand-logo img { width: 36px !important; height: 36px !important; max-width: 36px !important; max-height: 36px !important; border-radius: 8px; object-fit: cover; }
.brand-logo span { font-size: 34px; font-weight: 700; color: #303133; letter-spacing: 2px; }

/* 表格布局：LOGO 下方 30px，去边框，左列卡片 + 右列登录窗口 */
.home-table {
  display: flex;
  margin-top: 30px;
  gap: 20px;
  align-items: flex-start;
}

/* 左列：自由收缩、可换行，靠左向上对齐 */
.home-left {
  flex: 1;
  min-width: 0;
}

/* 右列：固定 350px，窗口小时始终显示，不溢出表格外 */
.home-right {
  width: 350px;
  flex-shrink: 0;
}

/* 版权：贴底，底部边距 28px */
.copyright {
  margin-top: auto;
  padding: 0 0 28px;
}

.copyright p { text-align: center; font-size: 14px; color: #666; }

/* 登录卡片：固定 300×360（不可变），靠左向上位于右列 */
.login-page { background: transparent; position: relative; }

.login-card {
  position: relative;
  width: 300px;
  height: 360px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  box-sizing: border-box;
  overflow: hidden;
}

.tab-switcher { position: absolute; top: 0; right: 0; z-index: 10; }

.tab-btn {
  display: block;
  background: #ecf5ff;
  color: #409eff;
  border: none;
  font-size: 14px;
  padding: 8px 16px;
  cursor: pointer;
  border-radius: 0 8px 0 8px;
  font-weight: 500;
  font-family: inherit;
  transition: background 0.2s;
}

.tab-btn:hover { background: #d9ecff; }

.content-area {
  padding: 50px 30px 0;
  height: 290px;
  box-sizing: border-box;
  position: relative;
}

.mode-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.panel-title {
  font-size: 22px;
  font-weight: 500;
  color: #303133;
  margin: 0 0 33px 0;
  text-align: center;
  width: 100%;
  flex-shrink: 0;
}

.account-mode .input-group {
  width: 220px;
  margin-bottom: 20px;
  flex-shrink: 0;
}

.underline-input {
  width: 100%;
  border: none;
  border-bottom: 1px solid #dcdfe6;
  padding: 12px 0;
  font-size: 14px;
  color: #303133;
  outline: none;
  background: transparent;
  margin-bottom: 20px;
  font-family: inherit;
  transition: border-color 0.2s, border-width 0.2s;
}

.underline-input::placeholder { color: #c0c4cc; }

.underline-input:focus {
  border-bottom-color: #409eff;
  border-bottom-width: 2px;
  padding-bottom: 11px;
  margin-bottom: 19px;
}

.confirm-btn {
  width: 220px;
  height: 48px;
  background: #409eff;
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.2s;
  flex-shrink: 0;
}

.confirm-btn:hover:not(:disabled) { background: #66b1ff; }
.confirm-btn:disabled { opacity: 0.7; cursor: not-allowed; }

.qr-mode .qr-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  width: 100%;
  padding-bottom: 5px;
}

.qr-placeholder {
  width: 180px;
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f5f7fa;
  border-radius: 8px;
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid #e4e7ed;
  border-top-color: #409eff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.qr-image {
  width: 180px !important;
  height: 180px !important;
  max-width: 180px !important;
  max-height: 180px !important;
  border-radius: 8px;
  display: block;
}

/* 成功提示 */
.success-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
}

.success-content { text-align: center; }

.success-icon {
  width: 64px;
  height: 64px;
  background: #67c23a;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  color: #fff;
  font-weight: bold;
  margin: 0 auto 12px;
}

.success-text { color: #303133; font-size: 16px; font-weight: 500; }

/* ===== 最近上架商品卡片区域（左列） ===== */
/* 容器：flex 换行，靠左向上对齐 */
.latest-products {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-items: flex-start;
  justify-content: flex-start;
}

/* 商品小卡片：220 × 360，间距 20px */
.product-card {
  width: 220px;
  height: 360px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
}

.product-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

/* 封面图区域：上下左右 20px 内边距，图片 180×200 */
.product-card .card-cover {
  width: 100%;
  padding: 20px 20px 0 20px;
  box-sizing: border-box;
  overflow: hidden;
  flex-shrink: 0;
}

.product-card .card-cover img {
  width: 180px;
  height: 200px;
  object-fit: cover;
  display: block;
  border: none;
  border-radius: 8px;
}

/* 文字信息区域：左右 20px 内边距，上下 10px 保持原值 */
.product-card .card-info {
  padding: 10px 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

/* 标题：仅一行显示，超出截断（前缀 .product-card 提高特异性，覆盖全局 h3） */
.product-card .card-title {
  font-size: 15px;
  font-weight: 600;
  color: #303133;
  margin: 0 0 4px 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 描述：仅显示一行，超出截断 */
.product-card .card-desc {
  font-size: 13px;
  color: #999;
  margin: 0 0 16px 0;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.4;
}

/* 底部一行：商户头像+用户名靠左，价格靠右
   前缀 .product-card 提升特异性至 0,2,0，覆盖 admin.scss 全局 .card-footer 的
   border-top(横线)/padding(错位)/background(灰底)。仅局部调整，全局样式不动。
   去掉 margin-top:auto，让本行紧跟描述自然上移，底部留空。 */
.product-card .card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0;
  border: none;
  background: transparent;
}

/* 商户头像+用户名：同一行，靠左对齐 */
.product-card .card-merchant {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  min-width: 0;
  flex: 1;
}

.product-card .card-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: none;
  display: block;
}

.product-card .card-merchant-name {
  font-size: 12px;
  color: #666;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

/* 价格：靠右，红色，¥符号加粗向上对齐（同商品页） */
.product-card .card-price {
  display: flex;
  align-items: flex-start;
  flex-shrink: 0;
}

.product-card .card-symbol {
  font-size: 14px;
  font-weight: 700;
  color: #ff4d4f;
  padding-top: 2px;
}

.product-card .card-value {
  font-size: 20px;
  font-weight: 700;
  color: #ff4d4f;
}
