/* =============================================================
   客户自助查询门户  样式（浅色主题）
   ============================================================= */

:root {
  --p-bg: #f2f6fc;
  --p-surface: #ffffff;
  --p-border: #e2e8f4;
  --p-text: #16202f;
  --p-text-2: #556073;
  --p-muted: #8b99ad;
  --p-brand: #2563eb;
  --p-brand-dark: #1d4ed8;
  --p-brand-weak: #eef4ff;
  --p-ok: #10b981;
  --p-warn: #f59e0b;
  --p-danger: #ef4444;
}

* { box-sizing: border-box; }

body.portal {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC",
               "Hiragino Sans GB", "Helvetica Neue", Arial, sans-serif;
  font-size: 14.5px;
  line-height: 1.7;
  color: var(--p-text);
  background: var(--p-bg);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.portal a { color: var(--p-brand); text-decoration: none; }
.portal a:hover { color: var(--p-brand-dark); }
.portal h1, .portal h2, .portal h3 { margin: 0; font-weight: 650; letter-spacing: -.01em; }

/* ---------------- 顶栏 ---------------- */
.p-header {
  background: var(--p-surface);
  border-bottom: 1px solid var(--p-border);
  position: sticky; top: 0; z-index: 40;
}
.p-header-in {
  max-width: 1080px; margin: 0 auto; padding: 13px 20px;
  display: flex; align-items: center; gap: 12px;
}
.p-logo {
  width: 40px; height: 40px; border-radius: 12px; flex: 0 0 40px;
  background: linear-gradient(135deg, #60a5fa, #2563eb);
  color: #fff; display: grid; place-items: center;
  font-weight: 700; font-size: 17px;
  box-shadow: 0 5px 14px rgba(37, 99, 235, .28);
}
.p-brand-txt { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.p-brand-txt b { font-size: 16px; }
.p-brand-txt small { color: var(--p-muted); font-size: 12.5px; }
.p-header-right { margin-left: auto; display: flex; align-items: center; gap: 14px; text-align: right; }
.p-header-right .tel { font-size: 12.5px; color: var(--p-muted); display: block; }
.p-header-right .tel b { display: block; font-size: 15px; color: var(--p-text); letter-spacing: .3px; }

/* ---------------- 主体 ---------------- */
.p-main { flex: 1 1 auto; width: 100%; max-width: 1080px; margin: 0 auto; padding: 26px 20px 50px; }

.p-hero {
  background: linear-gradient(135deg, #1e40af 0%, #2563eb 45%, #3b82f6 100%);
  border-radius: 20px; padding: 34px 32px; color: #fff; position: relative; overflow: hidden;
  box-shadow: 0 14px 38px rgba(37, 99, 235, .28);
}
.p-hero::after {
  content: ''; position: absolute; right: -60px; top: -70px;
  width: 260px; height: 260px; border-radius: 50%;
  background: rgba(255, 255, 255, .1);
}
.p-hero::before {
  content: ''; position: absolute; right: 60px; bottom: -90px;
  width: 180px; height: 180px; border-radius: 50%;
  background: rgba(255, 255, 255, .07);
}
.p-hero h1 { font-size: 25px; margin-bottom: 8px; position: relative; z-index: 1; }
.p-hero p { margin: 0; color: rgba(255, 255, 255, .88); font-size: 14.5px; position: relative; z-index: 1; max-width: 640px; }
.p-hero .p-hero-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; position: relative; z-index: 1; }
.p-hero .p-hero-tags span {
  background: rgba(255, 255, 255, .16); border: 1px solid rgba(255, 255, 255, .24);
  padding: 4px 12px; border-radius: 20px; font-size: 12.5px;
}

.p-notice {
  margin-top: 18px; background: #fff8e6; border: 1px solid #f7e0ab;
  color: #8a5a06; border-radius: 12px; padding: 12px 16px; font-size: 13.5px;
}

.p-card {
  background: var(--p-surface); border: 1px solid var(--p-border);
  border-radius: 16px; box-shadow: 0 2px 12px rgba(16, 32, 47, .05);
  margin-top: 20px; overflow: hidden;
}
.p-card-hd {
  padding: 15px 20px; border-bottom: 1px solid var(--p-border);
  display: flex; align-items: center; gap: 10px; background: #fbfcfe;
}
.p-card-hd h3 { font-size: 15px; }
.p-card-hd .sub { font-size: 12.5px; color: var(--p-muted); }
.p-card-hd .right { margin-left: auto; }
.p-card-bd { padding: 20px; }

/* ---------------- 查询表单 ---------------- */
.p-query { display: grid; gap: 16px; grid-template-columns: 1.6fr 1fr auto; align-items: end; }
@media (max-width: 720px) { .p-query { grid-template-columns: 1fr; } }

.p-field { display: flex; flex-direction: column; gap: 6px; }
.p-field label { font-size: 13px; font-weight: 600; color: #475569; }
.p-field input {
  width: 100%; padding: 11px 13px; font-size: 14.5px; font-family: inherit;
  border: 1px solid #cbd6e6; border-radius: 10px; outline: none; color: var(--p-text);
  transition: border-color .15s, box-shadow .15s; background: #fff;
}
.p-field input:focus { border-color: var(--p-brand); box-shadow: 0 0 0 3px rgba(37, 99, 235, .13); }
.p-field .tip { font-size: 12px; color: var(--p-muted); }

.p-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 11px 24px; font-size: 15px; font-weight: 600; font-family: inherit;
  border: 0; border-radius: 10px; cursor: pointer; white-space: nowrap;
  background: var(--p-brand); color: #fff;
  box-shadow: 0 4px 14px rgba(37, 99, 235, .3);
  transition: background .15s, transform .08s;
}
.p-btn:hover { background: var(--p-brand-dark); color: #fff; }
.p-btn:active { transform: translateY(1px); }
.p-btn.ghost {
  background: #fff; color: #475569; border: 1px solid #cbd6e6; box-shadow: none; font-weight: 500;
  padding: 8px 16px; font-size: 13.5px;
}
.p-btn.ghost:hover { background: #f8fafc; color: var(--p-text); }
.p-btn.sm { padding: 7px 14px; font-size: 13px; }

/* ---------------- 客户信息卡 ---------------- */
.p-cust-head {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 20px; background: linear-gradient(135deg, #f0f7ff, #f7fbff);
  border-bottom: 1px solid var(--p-border);
}
.p-cust-avatar {
  width: 50px; height: 50px; border-radius: 14px; flex: 0 0 50px;
  background: linear-gradient(135deg, #60a5fa, #2563eb);
  color: #fff; display: grid; place-items: center; font-size: 20px; font-weight: 700;
}
.p-cust-name { font-size: 17px; font-weight: 650; }
.p-cust-meta { font-size: 12.5px; color: var(--p-muted); }
.p-cust-actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

.p-stats { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); padding: 20px; }
.p-stat {
  background: #f8fafd; border: 1px solid var(--p-border); border-radius: 12px;
  padding: 13px 15px;
}
.p-stat .k { font-size: 12.5px; color: var(--p-muted); }
.p-stat .v { font-size: 21px; font-weight: 700; margin-top: 3px; letter-spacing: -.02em; }
.p-stat .v small { font-size: 12.5px; font-weight: 500; color: var(--p-muted); margin-left: 2px; }
.p-stat.ok .v { color: #047857; }
.p-stat.warn .v { color: #b45309; }
.p-stat.info .v { color: #0369a1; }

/* ---------------- 记录卡片 ---------------- */
.p-rec {
  border: 1px solid var(--p-border); border-radius: 14px;
  padding: 16px 18px; margin-bottom: 12px; background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
.p-rec:hover { border-color: #bcd3f6; box-shadow: 0 4px 16px rgba(37, 99, 235, .08); }
.p-rec-top { display: flex; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.p-rec-title { font-size: 15px; font-weight: 620; flex: 1 1 260px; }
.p-rec-no { font-family: Consolas, monospace; font-size: 12.5px; color: var(--p-muted); }
.p-rec-body { margin-top: 10px; display: grid; gap: 8px 20px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.p-rec-item { font-size: 13px; color: #475569; }
.p-rec-item b { color: var(--p-muted); font-weight: 500; margin-right: 5px; }
.p-rec-desc {
  margin-top: 12px; padding: 11px 13px; background: #f8fafd;
  border-radius: 10px; font-size: 13.5px; color: #334155; line-height: 1.8;
}
.p-rec-foot { margin-top: 12px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.p-tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2.5px 10px; border-radius: 20px;
  font-size: 12px; font-weight: 600; white-space: nowrap;
  background: #eef2f7; color: #526077;
}
.p-tag.pending { background: #fef5e4; color: #b45309; }
.p-tag.processing { background: #e7f6fe; color: #0369a1; }
.p-tag.resolved { background: #e8f8f1; color: #047857; }
.p-tag.closed { background: #eef2f7; color: #64748b; }
.p-tag.cat { background: #eef4ff; color: #1d4ed8; }
.p-tag.urgent { background: #fdeced; color: #b91c1c; }

/* ---------------- 时间线 ---------------- */
.p-tl { list-style: none; margin: 0; padding: 0; }
.p-tl li { position: relative; padding: 0 0 16px 22px; border-left: 2px solid #e4e9f2; }
.p-tl li:last-child { border-left-color: transparent; padding-bottom: 0; }
.p-tl li::before {
  content: ''; position: absolute; left: -7px; top: 6px;
  width: 12px; height: 12px; border-radius: 50%;
  background: #fff; border: 2.5px solid #cbd5e1;
}
.p-tl li.done::before { border-color: var(--p-ok); background: var(--p-ok); }
.p-tl li.now::before { border-color: var(--p-brand); background: var(--p-brand); box-shadow: 0 0 0 4px var(--p-brand-weak); }
.p-tl .t { font-weight: 600; font-size: 13.5px; }
.p-tl .d { font-size: 12.5px; color: var(--p-muted); }

/* ---------------- 空态 / 提示 ---------------- */
.p-empty { padding: 46px 20px; text-align: center; color: var(--p-muted); }
.p-empty .big { font-size: 34px; margin-bottom: 8px; }
.p-empty b { display: block; color: #475569; font-size: 15px; margin-bottom: 4px; }

.p-alert {
  padding: 12px 16px; border-radius: 12px; font-size: 13.5px; margin-bottom: 16px;
  border: 1px solid transparent;
}
.p-alert.err { background: #fdeced; border-color: #f8cdd0; color: #a11f22; }
.p-alert.ok { background: #e8f8f1; border-color: #b6e8d3; color: #046c4e; }
.p-alert.warn { background: #fef5e4; border-color: #f6dfb0; color: #8a5a06; }
.p-alert.info { background: #e7f6fe; border-color: #b9e4f9; color: #075985; }

/* ---------------- 附件 ---------------- */
.p-att { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.p-att a {
  display: flex; align-items: center; gap: 9px; padding: 10px 12px;
  border: 1px solid var(--p-border); border-radius: 10px; background: #fbfcfe;
  font-size: 13px; color: #475569;
}
.p-att a:hover { border-color: var(--p-brand); color: var(--p-brand); background: var(--p-brand-weak); }
.p-att .ico { width: 28px; height: 28px; border-radius: 8px; background: #e8eefb; flex: 0 0 28px;
  display: grid; place-items: center; font-size: 10px; font-weight: 700; color: #3b6fd4; }
.p-att .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------------- 页脚 ---------------- */
.p-footer {
  margin-top: auto; background: #fff; border-top: 1px solid var(--p-border);
  padding: 22px 20px; color: var(--p-muted); font-size: 12.5px;
}
.p-footer-in { max-width: 1080px; margin: 0 auto; display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.p-footer-in .right { margin-left: auto; }

/* 备案信息 */
.p-footer .beian-row {
  max-width: 1080px; margin: 12px auto 0; justify-content: flex-start;
  gap: 6px 14px; font-size: 12.5px; color: var(--p-muted);
}
.p-footer .beian-row a.beian-item:hover { color: #2563eb; text-decoration: underline; }

/* ---------------- 登录/验证页 ---------------- */
.p-verify-wrap { max-width: 560px; margin: 34px auto 0; }

@media (max-width: 620px) {
  .p-hero { padding: 26px 20px; border-radius: 16px; }
  .p-hero h1 { font-size: 21px; }
  .p-main { padding: 18px 14px 40px; }
  .p-card-bd { padding: 15px; }
  .p-cust-head { padding: 15px; }
  .p-cust-actions { margin-left: 0; width: 100%; }
  .p-header-right .tel { display: none; }
}
