/* 合作协议管理系统 · 公开查看端样式（移动端优先，桌面端居中） */

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica,
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "微软雅黑", Arial, sans-serif;
  background: linear-gradient(160deg, #eef2f7 0%, #f7f9fc 60%, #eef2f7 100%);
  color: #303133;
  -webkit-font-smoothing: antialiased;
}

[v-cloak] {
  display: none;
}

/* 内容容器：移动优先，桌面端最大 560px 居中 */
.page {
  max-width: 560px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 20px 16px calc(24px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
}

.page-footer {
  margin-top: auto;
  padding-top: 32px;
  text-align: center;
  font-size: 12px;
  color: #c0c4cc;
}

/* ---------- 视图 1：密钥输入 ---------- */
.key-view {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-bottom: 48px;
}

.brand {
  text-align: center;
  margin-bottom: 24px;
}

.brand-logo {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  border-radius: 16px;
  background: linear-gradient(135deg, #1f3a5f 0%, #3563a9 100%);
  color: #fff;
  font-size: 30px;
  font-weight: 700;
  line-height: 64px;
  box-shadow: 0 8px 20px rgba(31, 58, 95, 0.25);
}

.brand-title {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
  color: #1f3a5f;
}

.brand-sub {
  margin: 8px 0 0;
  font-size: 14px;
  color: #909399;
}

.key-card {
  border-radius: 12px;
}

.key-card .el-input__wrapper {
  padding: 6px 15px;
}

.key-btn {
  width: 100%;
  margin-top: 16px;
  height: 46px;
  font-size: 16px;
  letter-spacing: 2px;
}

.key-tip {
  margin: 16px 0 0;
  text-align: center;
  font-size: 12px;
  color: #c0c4cc;
}

/* ---------- 顶栏 ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 4px 2px 16px;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.topbar-title {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: #1f3a5f;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-sub {
  margin: 4px 0 0;
  font-size: 12px;
  color: #909399;
}

.back-btn {
  padding-left: 0;
  font-size: 15px;
  flex-shrink: 0;
}

/* ---------- 卡片列表 ---------- */
.card-list {
  min-height: 200px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.touch-card {
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 2px 8px rgba(31, 58, 95, 0.06);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
  user-select: none;
}

.touch-card:active {
  transform: scale(0.985);
  box-shadow: 0 1px 4px rgba(31, 58, 95, 0.1);
}

/* 门店卡片 */
.store-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.store-info {
  min-width: 0;
}

.store-name {
  font-size: 16px;
  font-weight: 600;
  color: #303133;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.store-addr {
  margin-top: 6px;
  font-size: 13px;
  color: #909399;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.store-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.store-count {
  text-align: right;
}

.count-num {
  font-size: 18px;
  font-weight: 700;
  color: #3563a9;
}

.count-label {
  margin-left: 2px;
  font-size: 12px;
  color: #909399;
}

.arrow {
  font-size: 20px;
  color: #c0c4cc;
  line-height: 1;
}

/* 商户卡片 */
.merchant-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.merchant-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.merchant-signer {
  font-size: 16px;
  font-weight: 600;
  color: #303133;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.merchant-sub {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #909399;
}

.merchant-sub .dot {
  color: #dcdfe6;
}

.merchant-sub .arrow {
  margin-left: auto;
}

/* ---------- 商户详情 ---------- */
.detail-wrap {
  min-height: 200px;
}

.detail-card {
  border-radius: 12px;
}

.detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 16px;
  border-bottom: 1px solid #ebeef5;
}

.detail-signer {
  font-size: 20px;
  font-weight: 700;
  color: #1f3a5f;
  overflow: hidden;
  text-overflow: ellipsis;
}

.detail-list {
  list-style: none;
  margin: 0;
  padding: 8px 0 16px;
}

.detail-list li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px dashed #ebeef5;
}

.detail-list li:last-child {
  border-bottom: none;
}

.detail-list .label {
  flex-shrink: 0;
  font-size: 14px;
  color: #909399;
}

.detail-list .value {
  font-size: 15px;
  color: #303133;
  text-align: right;
  word-break: break-all;
}

.detail-list .value.strong {
  font-size: 17px;
  font-weight: 700;
  color: #3563a9;
}

.contract-btn {
  width: 100%;
  height: 46px;
  font-size: 16px;
  margin-top: 4px;
}

.no-contract {
  margin-top: 8px;
  padding: 14px 0 4px;
  text-align: center;
  font-size: 13px;
  color: #c0c4cc;
}

/* ---------- 桌面端微调 ---------- */
@media (min-width: 600px) {
  .page {
    padding-top: 40px;
  }

  .touch-card:hover {
    box-shadow: 0 6px 16px rgba(31, 58, 95, 0.12);
  }
}

/* V8：门店列表统计行 */
.store-stats { color: #409eff; }

/* V8：合作协议 PDF 页内全屏查看（移动端优先） */
.pdf-overlay {
  position: fixed; inset: 0; z-index: 2000;
  background: #fff; display: flex; flex-direction: column;
}
.pdf-topbar {
  display: flex; align-items: center; gap: 12px;
  height: 48px; padding: 0 12px; flex: none;
  background: #1f3a5f; color: #fff;
}
.pdf-title { font-size: 15px; font-weight: 600; flex: 1; }
.pdf-external { color: #9ec5ff; font-size: 13px; text-decoration: underline; }
.pdf-close {
  border: 0; background: rgba(255, 255, 255, 0.18); color: #fff;
  font-size: 14px; padding: 6px 14px; border-radius: 6px; cursor: pointer;
}
.pdf-body { flex: 1; position: relative; background: #525659; }
.pdf-loading {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 14px;
}
.pdf-frame { width: 100%; height: 100%; border: 0; display: block; }
