/* ============================================================
   买家账号：登录页 + 我的商务室
   ------------------------------------------------------------
   新文件（不改 css/base.css、css/components.css —— 那两个文件
   属于另一路改动，同时改会冲突）。

   依赖 base.css 里已有的设计令牌（--brand / --ink-* / --line /
   --radius / --shadow-sm）与组件类（.panel / .btn / .alert-error /
   .data-table / .empty-state / .benefit-list），
   这里只补它们没有的东西。
   ============================================================ */

/* ---------- 通用：本文件需要的补充提示条 ----------
   base.css 只有 .alert-error；成功与信息态在这里补。
   放在 account.css 而不是 base.css，是因为目前只有账号页用它们。 */
.alert-success { background: var(--success-bg); border: 1px solid #BBF0D0; color: #0B7A3C; }
.alert-info { background: var(--info-bg); border: 1px solid #CFE0FD; color: #1D4ED8; }

/* ============================================================
   一、登录页
   ------------------------------------------------------------
   版式是「独立页」：不继承全站页头页脚（见 templates/base_auth.html），
   页面上只有 Logo，没有工具条 / 搜索框 / 主导航，也没有面包屑。
   一张居中卡片、左右分栏：左侧品牌 + 实时数据，右侧登录表单。
   ============================================================ */

/* ---------- 页面外框：品牌底色 + Logo 条 ----------
   背景三层叠出来（从下往上）：
     1) 品牌纹样图（AI 出图，取自 logo 的青 #12B0BF / 橙 #EA9A11 / 蓝 #189AED，
        极淡，中央已被处理成接近白纸，避免和卡片打架）；
     2) 三团品牌色柔光，保证任何视口比例下都"有颜色"；
     3) 顶部 Logo 条压在最上面。
   变量由 base_auth.html 的 staticv_url 注入（带 mtime 版本号，换图能穿透缓存）。 */
.authpage {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--brand-50);
  background-image:
    radial-gradient(760px 460px at 4% 4%, rgba(18, 176, 191, .20) 0%, rgba(18, 176, 191, 0) 62%),
    radial-gradient(720px 440px at 97% 92%, rgba(24, 154, 237, .18) 0%, rgba(24, 154, 237, 0) 64%),
    radial-gradient(420px 300px at 92% 6%, rgba(234, 154, 17, .12) 0%, rgba(234, 154, 17, 0) 66%),
    var(--page-brand-bg, none);
  background-size: auto, auto, auto, cover;
  background-position: center, center, center, center;
  background-repeat: no-repeat;
}

/* 顶部：只放品牌本身。
   之前这里是「白底 + 下边框」的一条横条 —— 加上白底的方形 logo，
   整块看起来跟站内导航条一模一样，用户会以为上面还留着导航。
   现在去掉底色与分隔线，只留 logo 和「返回首页」，让它读起来是
   "这个页面自己的页眉"，而不是站内导航。
   注意 .authpage 是 flex 列布局：这里必须显式 align-items: flex-start，
   否则 flex 项会被横向拉伸成整宽，白底又会回来。 */
.auth-head {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 20px;
}
.auth-head__inner {
  width: 100%;
  max-width: 980px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.auth-logo { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.auth-logo:hover { text-decoration: none; }
/* logo 是一张**白底方图**（实测 62% 的像素是不透明白），直接放上去就是一块白方块。
   multiply 让白色变成透明，青/橙的品牌笔画保留 —— 比抠图干净，也不引入新素材。
   一旦拿到透明底 logo，把这条删掉即可。 */
.auth-logo img {
  display: block;
  height: 34px;
  width: auto;
  mix-blend-mode: multiply;
}
.auth-logo__text { display: flex; flex-direction: column; line-height: 1.25; }
.auth-logo__mark { font-size: 18px; font-weight: 700; color: var(--brand-800); letter-spacing: .4px; }
.auth-logo__sub { font-size: 12px; color: var(--ink-500); letter-spacing: 1.2px; }
.auth-head__back { font-size: 13px; color: var(--ink-500); }
.auth-head__back:hover { color: var(--brand-700); text-decoration: none; }

.auth-main { flex: 1 0 auto; display: flex; align-items: center; padding: 44px 16px 60px; }

/* ---------- 卡片 ---------- */
.auth-hero { width: 100%; }
.auth-shell { max-width: 980px; margin: 0 auto; }
.auth-card2 {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 408px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

/* ---------- 左：品牌区（底图 + 罩层） ----------
   min-height 从 462 收到 400：卡片的实际高度是「左右两栏里更高的那个」，
   左栏底图不该无谓地把整张卡片顶高 —— 笔记本（1366×768、1280×700）上
   625px 的卡片 + 页头 + 主区内边距就超过视口了，页面平白多出一条滚动条。 */
.auth-card2__brand { position: relative; min-height: 400px; }
.acb-bg {
  position: absolute;
  inset: 0;
  background-image: var(--card-brand-bg, none);
  background-size: cover;
  background-position: center right;
  background-repeat: no-repeat;
}
/* 罩层：底图主体在右，这里压一层由左至右的浅色渐变，
   保证任何底图上左侧文字都有足够对比度（深色文字 + 亮罩）。
   不透明度从 .97 收到 .93 起：原来是"整片白雾"，把底图的质感全压掉了，
   现在左侧仍然足够亮（实测对比度 6.8:1 以上），但照片看得出来。 */
.acb-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg,
    rgba(255, 255, 255, .93) 0%,
    rgba(255, 255, 255, .86) 42%,
    rgba(255, 255, 255, .66) 68%,
    rgba(255, 255, 255, .38) 100%);
}
.acb-body {
  position: relative;
  z-index: 1;
  padding: 34px 32px 30px;
  display: flex;
  flex-direction: column;
  height: 100%;
}
.acb-eyebrow {
  margin: 0 0 12px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .6px;
  color: var(--brand-700);
  background: rgba(255, 255, 255, .8);
  border: 1px solid rgba(var(--brand-rgb), .22);
  border-radius: 999px;
  padding: 4px 12px;
  align-self: flex-start;
}
.acb-title {
  margin: 0 0 10px;
  font-size: 25px;
  line-height: 1.34;
  font-weight: 700;
  color: var(--brand-800, #0B5C8A);
  letter-spacing: .3px;
}
.acb-desc {
  margin: 0 0 18px;
  font-size: 13.5px;
  line-height: 1.8;
  color: var(--ink-600);
  max-width: 28em;
}
.acb-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 26px;
  margin: 0 0 18px;
  padding: 0;
  list-style: none;
}
.acb-stats li { text-align: left; }
.acb-num {
  display: block;
  font-size: 27px;
  font-weight: 700;
  /* 用 --brand-700 而不是 --brand：品牌蓝 #189AED 压在浅色底图上只有 3.0:1，
     27px 粗体虽够 3:1 的大字门槛，但窄屏字号降到 22px 后就不够了。
     深一档是 4.5:1 以上，全尺寸都稳。 */
  color: var(--brand-700);
  line-height: 1.2;
  font-variant-numeric: tabular-nums;   /* 滚动时数字不抖动 */
}
.acb-stats span { font-size: 12.5px; color: var(--ink-500); }
.acb-points {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.acb-points li {
  font-size: 12.5px;
  color: var(--brand-700);
  background: rgba(255, 255, 255, .82);
  border: 1px solid rgba(var(--brand-rgb), .22);
  border-radius: 999px;
  padding: 4px 12px;
}

/* 左栏下半部分的补充说明。
   margin-top: auto 把它压到卡片底边，这样左栏的纵向空隙被"用掉"，
   不会在表单旁边空出一大块（实测空 314px → 现在由这块内容承担）。 */
.acb-note {
  margin: auto 0 0;
  padding-top: 20px;
  border-top: 1px solid rgba(var(--brand-rgb), .16);
}
.acb-note__title {
  margin: 0 0 8px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-700);
}
.acb-note ul { margin: 0; padding: 0; list-style: none; }
.acb-note li {
  position: relative;
  padding-left: 16px;
  margin-bottom: 6px;
  font-size: 12.5px;
  line-height: 1.75;
  color: var(--ink-600);
}
.acb-note li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 8px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(var(--brand-rgb), .55);
}
.acb-note li:last-child { margin-bottom: 0; }

/* ---------- 右：表单区 ---------- */
.auth-card2__form { padding: 28px 30px 22px; border-left: 1px solid var(--line); }
.acf-title { margin: 0 0 5px; font-size: 20px; font-weight: 700; color: var(--ink-900); }
.acf-sub { margin: 0 0 14px; font-size: 12.5px; line-height: 1.7; color: var(--ink-500); }
.auth-form { margin-top: 2px; }
.auth-form .form-field { margin-bottom: 12px; }
.acf-submit { width: 100%; justify-content: center; }
.acf-tip {
  margin: 12px 0 0;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--ink-500);
  background: var(--brand-50);
  border: 1px solid var(--brand-100);
  border-radius: var(--radius);
  padding: 7px 11px;
}
.acf-foot { margin: 0; line-height: 1.75; }
.acf-links {
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  font-size: 12.5px;
}
.acf-links a { color: var(--brand-700); }

/* 「我的商务室」等页面仍在用的登录表单辅助样式 */
.auth-form .form-field:last-child { margin-bottom: 0; }
.auth-alert-note { margin: 6px 0 0; font-size: 12.5px; line-height: 1.7; }

/* ============================================================
   二、我的商务室
   ============================================================ */
.account-layout {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  padding-bottom: 26px;
}
.account-main { min-width: 0; }
.account-main .panel { padding: 16px 18px 18px; }
.account-main .panel-title { margin-bottom: 12px; }
.account-foot-note { margin: 10px 0 0; }

/* ---------- 左栏：身份卡 ---------- */
.account-me { padding: 18px 15px 15px; text-align: center; }
.am-avatar {
  width: 52px; height: 52px; margin: 0 auto 9px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-700) 0%, var(--brand) 100%);
  color: #fff; font-size: 22px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
}
.am-name { font-size: 15px; font-weight: 600; color: var(--ink-900); margin-bottom: 4px; }
.am-meta { margin-top: 2px; word-break: break-all; }

/* ---------- 左栏：菜单 ---------- */
.account-menu { padding: 6px 0; }
.account-menu-item {
  display: flex; align-items: center; gap: 8px;
  padding: 11px 16px;
  font-size: 13.5px; color: var(--ink-700);
  border-left: 3px solid transparent;
  transition: background-color .14s, color .14s, border-color .14s;
}
.account-menu-item:hover {
  background: var(--brand-50); color: var(--brand-700); text-decoration: none;
}
.account-menu-item.active {
  background: var(--brand-50); color: var(--brand-700);
  font-weight: 600; border-left-color: var(--brand);
}
/* 退出登录是个 <button>（必须是 POST），外观要跟旁边的 <a> 完全一致 */
.account-menu-item.as-button {
  width: 100%; border: none; background: none; text-align: left;
  font-family: inherit; cursor: pointer;
}
.amc {
  margin-left: auto;
  font-size: 11.5px; color: var(--ink-400);
  background: var(--bg); border-radius: 9px; padding: 1px 7px;
}
.account-menu-item.active .amc { background: #fff; color: var(--brand-700); }
.account-logout-form { margin: 0; border-top: 1px solid var(--line); }

/* ---------- 收藏 / 关注 列表 ---------- */
.fav-list, .hist-list { list-style: none; margin: 0; padding: 0; }
.fav-item, .hist-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid #F0F4F7;
}
.fav-item:last-child, .hist-item:last-child { border-bottom: none; }
.fav-main { min-width: 0; flex: 1; }
.fav-name {
  display: inline-block;
  font-size: 14.5px; font-weight: 500; color: var(--brand-700);
  word-break: break-all;
}
.fav-name:hover { color: var(--price); }
.fav-meta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.fav-kind {
  display: inline-block;
  font-size: 11px; line-height: 1.7; padding: 0 6px;
  border-radius: 3px;
  background: var(--brand-100); color: var(--brand-800);
  border: 1px solid var(--brand-200);
}
.fav-kind-offer { background: var(--accent-100); color: var(--accent-700); border-color: #F5DFAE; }
.fav-kind-merchant { background: var(--success-bg); color: var(--success); border-color: #BBF0D0; }
.fav-price { color: var(--price); font-weight: 600; }
.fav-side {
  flex: 0 0 auto;
  display: flex; flex-direction: column; align-items: flex-end; gap: 6px;
}

/* ---------- 足迹列表 ---------- */
.hist-name { font-size: 14px; color: var(--ink-900); flex: 0 0 auto; max-width: 46%; }
.hist-name:hover { color: var(--brand-700); }
.hist-meta { display: flex; flex-wrap: wrap; gap: 10px; flex: 1; min-width: 0; }
.hist-time { flex: 0 0 auto; }

/* ---------- 询价状态徽标 ----------
   .st-xxx 的取值来自 InquiryStatus（new/processing/quoted/closed/invalid）。
   后台加一个新状态而这里没样式时，徽标是中性灰 —— 不会变成裸文字。 */
.st {
  display: inline-block;
  font-size: 11.5px; line-height: 1.75; padding: 0 7px;
  border-radius: 3px;
  background: var(--bg); color: var(--ink-500); border: 1px solid var(--line);
  white-space: nowrap;
}
.st-new { background: var(--danger-bg); color: var(--danger); border-color: #FBD5D5; }
.st-processing { background: var(--info-bg); color: var(--info); border-color: #CFE0FD; }
.st-quoted { background: var(--success-bg); color: var(--success); border-color: #BBF0D0; }
.st-closed { background: var(--bg); color: var(--ink-400); border-color: var(--line); }
.st-invalid { background: var(--bg); color: var(--ink-400); border-color: var(--line-strong); }

/* ---------- 空态里的按钮间距 ---------- */
.empty-state p { margin: 10px 0 0; }
.empty-state .btn { margin: 0 4px; }

/* ---------- 「浏览足迹怎么来的」说明块 ---------- */
.account-hint { margin-top: 14px; }
.account-hint .auth-alert-note { margin-top: 4px; }

/* ============================================================
   三、窄屏
   ============================================================ */
@media (max-width: 900px) {
  .account-layout { grid-template-columns: minmax(0, 1fr); }
  .account-me { display: flex; align-items: center; gap: 10px; text-align: left; }
  .am-avatar { margin: 0; width: 42px; height: 42px; font-size: 18px; }
  .account-menu { display: flex; flex-wrap: wrap; padding: 4px; }
  .account-menu-item { border-left: none; border-bottom: 2px solid transparent; padding: 9px 12px; }
  .account-menu-item.active { border-left: none; border-bottom-color: var(--brand); }
  .account-logout-form { border-top: none; }
  .fav-item { flex-wrap: wrap; }
  .fav-side { flex-direction: row; align-items: center; width: 100%; justify-content: space-between; }
}

/* ------------------------------------------------------------
   图形验证码（登录/注册表单）
   ------------------------------------------------------------
   模板里早就用了这两个类，但一直没有对应样式 —— 图片和输入框是硬挤在一起的。
   ------------------------------------------------------------ */
.auth-captcha-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.auth-captcha-row input { flex: 1; min-width: 0; }
.auth-captcha-img {
  flex: 0 0 auto;
  display: block;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  cursor: pointer;          /* 提示可点击换一张 */
}
.auth-captcha-img:hover { border-color: var(--brand); }

/* ============================================================
   登录页窄屏：卡片改为上品牌 + 下表单的单列
   ------------------------------------------------------------
   窄屏时品牌区从"左半张卡片"变成顶部横幅，高度收短 ——
   它在这里的作用是品牌识别，不是主内容，不该把表单挤到折叠线以下。
   ============================================================ */
@media (max-width: 860px) {
  .auth-card2 { grid-template-columns: minmax(0, 1fr); }
  .auth-card2__brand { min-height: 0; }
  .acb-bg { background-position: center 30%; }
  .acb-bg::after {
    background: linear-gradient(180deg,
      rgba(255, 255, 255, .9) 0%,
      rgba(255, 255, 255, .95) 100%);
  }
  /* 窄屏要把品牌区压短：它在这里是品牌识别，不是主内容 ——
     700px 的品牌区会把登录表单整个推到折叠线以下，
     用户打开页面第一眼看不到输入框，那才是真的失败。
     做法：品牌介绍收起、数据横排变矮、说明块折进两行以内。 */
  .acb-body { padding: 20px 20px 18px; }
  .acb-title { font-size: 20px; margin-bottom: 8px; }
  .acb-desc { display: none; }
  .acb-stats { gap: 20px; margin-bottom: 12px; }
  .acb-num { font-size: 21px; }
  .acb-stats span { font-size: 12px; }
  .acb-points { gap: 6px; }
  .acb-points li { font-size: 12px; padding: 3px 10px; }
  .acb-note { padding-top: 12px; margin-top: 12px; }
  .acb-note__title { margin-bottom: 6px; }
  .acb-note li { font-size: 12px; margin-bottom: 2px; line-height: 1.65; }
  .auth-card2__form {
    padding: 22px 20px 20px;
    border-left: none;
    border-top: 1px solid var(--line);
  }
  .auth-main { padding: 16px 12px 26px; align-items: flex-start; }
}
@media (max-width: 420px) {
  /* 验证码图 170px + 输入框：窄机上让图片整行放下，避免输入框被压到 60px */
  .auth-captcha-row { flex-wrap: wrap; }
  .auth-captcha-row input { flex: 1 1 100%; }
  .auth-logo__sub { display: none; }
}

/* ============================================================
   登录页矮屏：按**视口高度**再收一档
   ------------------------------------------------------------
   问题的实质：卡片高度由内容决定（左栏那段说明 + 右侧表单），
   而浏览器窗口不一定有 900px 高。1366×768、1280×700 这类笔记本上
   页面就会平白多出一条滚动条 —— 明明内容一次放得下。
   所以这里用 max-height 媒体查询分档收紧，让它尽量一屏放下；
   真正的下限（比如窗口只有 500px 高）仍然允许滚动，不硬压。
   ============================================================ */
@media (max-height: 820px) {
  .auth-main { padding: 26px 16px 34px; }
  .auth-head { padding-top: 16px; }
  .acb-body { padding: 26px 28px 24px; }
  .acb-title { font-size: 23px; }
  .acb-desc { margin-bottom: 14px; }
  .acb-stats { margin-bottom: 14px; }
  .acb-points li { padding: 3px 10px; }
  .acb-note { padding-top: 14px; }
  .acb-note li { margin-bottom: 4px; line-height: 1.7; }
  .auth-card2__form { padding: 24px 28px 18px; }
  .acf-sub { margin-bottom: 12px; }
  .acf-tip { margin-top: 10px; padding: 6px 10px; }
  .acf-links { margin-top: 8px; }
}

/* 再矮一档（约 1366×720 以下）：把左栏那段说明撤掉。
   它是补充说明，不该把表单挤出屏幕外。 */
@media (max-height: 760px) {
  .auth-main { padding: 18px 16px 26px; }
  .auth-head { padding-top: 12px; }
  .acb-body { padding: 22px 26px 20px; }
  .acb-desc { display: none; }
  .acb-note { display: none; }
  .acf-sub { margin-bottom: 10px; }
  .acf-tip { margin-top: 8px; padding: 5px 9px; }
  .acf-foot { font-size: 11.5px; line-height: 1.65; }
  .auth-card2__form { padding: 20px 26px 16px; }
}

/* 更矮（<700px）：表单间距也收一档，尽量再挤进一屏 */
@media (max-height: 700px) {
  .auth-main { padding: 12px 16px 18px; }
  .auth-head { padding-top: 8px; }
  .auth-card2__form { padding: 16px 24px 14px; }
  .auth-form .form-field { margin-bottom: 9px; }
  .acf-tip { margin-top: 6px; padding: 4px 8px; }
  .acf-links { margin-top: 6px; }
}
