:root {
  --primary-color: #ff434f;
  --secondary-color: #e3e3e3;
  --text-color-lightest: #e7e9ec;
  --text-color-darker: #2e2e2e;
  --text-color-dark: #494949;
  --text-color-gray: #8b8b8b;
  --text-color-dark-gray: #727272;
  --section-bg: #f9fbfb;
  --card-shadow: 0 0 18px rgba(0, 0, 0, 0.06);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: Helvetica, "PingFang SC", "Microsoft Yahei", sans-serif;
  font-size: 14px;
  color: var(--text-color-dark);
  background: var(--section-bg);
  min-height: 100vh;
}
.hidden { display: none !important; }
.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: linear-gradient(rgba(42,42,42,.72), rgba(24,24,24,.88)),
              linear-gradient(135deg, #1a2a3a, #2c3e50 50%, #121820);
}
.login-card {
  width: min(400px, 100%);
  background: #fff;
  border-radius: 4px;
  padding: 36px 32px;
  box-shadow: 0 18px 48px rgba(0,0,0,.28);
}
.login-card h1 { font-size: 28px; color: var(--text-color-darker); }
.login-card h1::after {
  content: ""; display: block; width: 64px; height: 4px;
  background: var(--primary-color); margin-top: 12px;
}
.login-card .sub { color: var(--text-color-dark-gray); margin: 14px 0 8px; }
.login-card label { display:block; font-size: 13px; color: var(--text-color-gray); margin: 12px 0 6px; }
.login-home {
  display: block; text-align: center; margin-top: 16px;
  color: var(--text-color-gray); font-size: 13px; text-decoration: none;
}
.login-home:hover { color: var(--primary-color); }
input, select, textarea {
  width: 100%; border: 1px solid #e5e8ea; background: #f4f6f7;
  color: var(--text-color-darker); border-radius: 4px; padding: 10px 12px; outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--primary-color); background: #fff; }
button, .btn {
  border: 0; border-radius: 4px; padding: 11px 16px; background: var(--primary-color);
  color: #e7e9ec; font-weight: 600; cursor: pointer;
}
.login-tabs {
  display: flex;
  margin: 20px 0 0;
  border-bottom: 1px solid #e8ebed;
}
.login-tab {
  flex: 1;
  margin: 0 !important;
  padding: 12px 4px !important;
  background: transparent !important;
  color: var(--text-color-gray) !important;
  font-weight: 500 !important;
  font-size: 13px !important;
  border: 0 !important;
  border-radius: 0 !important;
  border-bottom: 2px solid transparent !important;
  box-shadow: none !important;
  white-space: nowrap;
}
.login-tab.on {
  color: var(--primary-color) !important;
  font-weight: 700 !important;
  border-bottom-color: var(--primary-color) !important;
}
.login-tab:hover { color: var(--text-color-darker) !important; }
.login-pane { padding-top: 8px; }
.login-pane #loginBtn,
.login-pane .wx-login-btn { width: 100%; margin-top: 18px; }
.login-hint {
  margin-top: 12px;
  font-size: 12px;
  color: var(--text-color-gray);
  line-height: 1.5;
}
.wx-login-btn {
  background: #07c160 !important;
  color: #fff !important;
}
.wx-login-box {
  margin-top: 8px;
  padding: 16px 12px;
  border: 1px solid #eef1f3;
  border-radius: 8px;
  background: #fafbfc;
  text-align: center;
}
.wx-tip { color: var(--text-color-gray); font-size: 13px; margin-bottom: 10px; line-height: 1.5; }
.wx-qr { width: 200px; height: 200px; margin: 8px auto; display: block; }
.wx-open-frame-wrap {
  width: 300px;
  height: 400px;
  margin: 8px auto 0;
  overflow: hidden;
  border-radius: 8px;
  background: #fff;
}
.wx-open-frame {
  width: 300px;
  height: 400px;
  border: 0;
  display: block;
  background: #fff;
}
.wx-auth-link {
  display: inline-block; margin: 8px 0; color: #07c160; font-size: 13px;
}
.wx-bind-form { text-align: left; margin-top: 8px; }
.wx-bind-form button { margin-top: 14px; width: 100%; }
.wx-cancel {
  margin-top: 12px !important;
  width: 100%;
  background: var(--secondary-color) !important;
  color: var(--text-color-dark-gray) !important;
}
.btn.secondary { background: var(--secondary-color); color: var(--text-color-dark-gray); }
.error { color: var(--primary-color); min-height: 20px; font-size: 13px; margin-top: 10px; }

#mainView { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
.sider {
  background: #181818; color: #e7e9ec; padding: 24px 16px;
  display: flex; flex-direction: column; gap: 8px;
  overflow: hidden;
  max-height: 100vh;
  position: sticky;
  top: 0;
}
.brand { font-size: 18px; font-weight: 600; color: #fff; padding: 4px 10px 8px; display: flex; align-items: center; gap: 10px; }
.brand-logo { width: 32px; height: 32px; border-radius: 8px; object-fit: contain; background: transparent; flex-shrink: 0; }
.brand-text { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.brand-name { line-height: 1.2; }
.portal-badge {
  display: inline-block; align-self: flex-start; font-size: 11px; font-weight: 700;
  letter-spacing: 0.04em; padding: 3px 8px; border-radius: 4px; line-height: 1.3;
}
.portal-badge.portal-customer { color: #2a1a00; background: #f5a623; }
.portal-chip {
  display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 10px;
  border-radius: 999px; margin-bottom: 6px;
}
.portal-chip.portal-customer { color: #2a1a00; background: #f5a623; }
.top-title { display: flex; flex-direction: column; align-items: flex-start; }
.brand-sub { font-size: 12px; color: #c6c6c6; padding: 0 10px 18px; }
.sider-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-right: 2px;
}
.sider-nav .nav-item,
.sider-nav .nav-group-title,
.logout,
.home-link {
  text-align: left;
  border: 0;
  background: transparent;
  color: #c6c6c6;
  padding: 10px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  width: 100%;
  display: block;
  box-sizing: border-box;
  text-decoration: none;
}
.sider-nav .nav-item:hover,
.sider-nav .nav-group-title:hover {
  background: rgba(255,255,255,.06);
  color: #fff;
}
.sider-nav .nav-item.active {
  background: rgba(255,67,79,.15);
  color: #fff;
  border-left: 3px solid var(--primary-color);
  padding-left: 9px;
}
.nav-group {
  margin-top: 6px;
  padding-top: 4px;
  border-top: 1px solid rgba(255,255,255,.06);
}
.nav-group:first-of-type { border-top: 0; margin-top: 4px; }
.nav-group-title {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: #9aa0a6 !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  letter-spacing: 0.04em;
  padding: 8px 12px !important;
}
.nav-group-title:hover { color: #e7e9ec !important; }
.nav-caret {
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid #7a8086;
  transition: transform .18s ease;
  flex-shrink: 0;
}
.nav-group.open .nav-caret { transform: rotate(180deg); border-top-color: #c6c6c6; }
.nav-group-body {
  display: none;
  flex-direction: column;
  gap: 1px;
  padding: 0 0 4px;
}
.nav-group.open .nav-group-body { display: flex; }
.nav-group-body .nav-item {
  padding: 9px 12px 9px 22px;
  font-size: 13px;
  color: #b8bcc0;
}
.nav-group-body .nav-item.active {
  padding-left: 19px;
  color: #fff;
}
.nav-group.has-active .nav-group-title { color: #e7e9ec !important; }
.sider-foot {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(255,255,255,.08);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.home-link:hover { color: #fff; background: rgba(255,255,255,.06); }
.logout { color: var(--primary-color); }
.logout:hover { background: rgba(255,67,79,.12); }
.content { padding: 28px 32px 48px; }
.site-footer {
  margin-top: 24px;
  padding-top: 14px;
  border-top: 1px solid #e8e8e8;
  color: #8b8b8b;
  font-size: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  justify-content: space-between;
  align-items: center;
}
.site-footer a {
  color: #8b8b8b;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.site-footer img { width: 14px; height: 14px; object-fit: contain; }
.site-footer .sf-beian { display: flex; flex-wrap: wrap; gap: 10px 14px; }
.top { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 24px; }
.top h2,
.top-title h2 { font-size: 28px; color: var(--text-color-darker); }
.top h2::after,
.top-title h2::after {
  content: ""; display: block; width: 56px; height: 4px;
  background: var(--primary-color); margin-top: 10px;
}
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px; }
.card {
  background: #fff; border-radius: 4px; padding: 20px 18px; box-shadow: var(--card-shadow);
}
.card .n { font-size: 28px; font-weight: 600; color: var(--primary-color); }
.card .l { color: var(--text-color-gray); margin-top: 8px; font-size: 13px; }
.panel {
  background: #fff; border-radius: 4px; padding: 20px; box-shadow: var(--card-shadow); margin-top: 16px;
}
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.toolbar .btn { width: auto; margin: 0; }
.form-grid { display: grid; gap: 10px; max-width: 520px; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 12px; border-bottom: 1px solid #f0f2f3; text-align: left; font-size: 13px; }
th { background: #f4f6f7; color: var(--text-color-dark-gray); }
.muted { color: var(--text-color-gray); font-size: 12px; }
.lookup-wrap { position: relative; }
.lookup-box {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  z-index: 20;
  background: #fff;
  border: 1px solid #e8ebef;
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(20, 28, 38, 0.12);
  max-height: 240px;
  overflow: auto;
}
.lookup-box.hidden { display: none; }
.lookup-status { padding: 10px 12px; font-size: 12px; color: #8b8b8b; }
.lookup-item { padding: 10px 12px; border-top: 1px solid #f0f2f3; cursor: pointer; }
.lookup-item:first-child { border-top: 0; }
.lookup-item:hover { background: rgba(255, 67, 79, 0.06); }
.lookup-name { font-size: 13px; font-weight: 600; color: #2e2e2e; }
.lookup-code { margin-top: 4px; font-size: 12px; color: #8b8b8b; word-break: break-all; }
.modal-mask {
  position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 1000;
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.modal {
  background: #fff;
  width: min(520px, 100%);
  max-height: 90vh;
  overflow: auto;
  border-radius: 8px;
  padding: 22px 24px;
  box-shadow: 0 18px 48px rgba(0,0,0,.25);
}
.modal h3 { margin: 0 0 14px; color: #2e2e2e; }
.modal .form-grid { box-shadow: none; max-width: none; padding: 0; }
.modal .form-grid label { font-size: 13px; color: var(--text-color-gray); }
.modal-actions { display: flex; gap: 10px; margin-top: 16px; }
.modal-actions .btn { width: auto; margin: 0; }

.modal.modal-wide { width: min(720px, 100%); }
.extra-row { display: flex; gap: 8px; margin: 6px 0; align-items: center; }
.extra-row input { flex: 1; }
.field-drop { font-size: 12px; color: #8b8b8b; cursor: pointer; border: 0; background: none; }
/* 工单时间线样式见 /shared/modal.css */
.actions-inline { display: flex; flex-wrap: wrap; gap: 6px; }
.actions-inline .btn { width: auto; margin: 0; padding: 4px 10px; height: auto; font-size: 12px; }
.tag { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 12px; }
.tag.ok, .tag.on { background: rgba(57,181,74,.12); color: #2d8a3a; }
.tag.warn { background: rgba(245,166,35,.15); color: #c47d00; }
.tag.off { background: #f0f0f0; color: #8b8b8b; }
.panel-head-row {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap;
}
.cell-title { font-weight: 600; color: #2e2e2e; }
.contact-card {
  border: 1px solid #eef0f2; border-radius: 8px; padding: 10px 12px; margin: 8px 0; background: #fafbfc;
}
.contact-card-title { font-size: 13px; font-weight: 600; color: #2e2e2e; margin-bottom: 6px; }
.contact-card-row {
  font-size: 12px; color: #494949; margin-top: 3px; display: flex; gap: 8px; flex-wrap: wrap;
}
.contact-card-row em {
  font-style: normal; color: #8b8b8b; min-width: 3em;
}
/* 资料中心 · 对齐服务商后台 ss-* 布局 */
.ss-page {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 960px;
}
.ss-page-desc {
  margin: 0;
  font-size: 13px;
  color: var(--text-color-gray);
  line-height: 1.55;
}
.ss-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.ss-tab {
  width: auto;
  margin: 0;
  padding: 8px 16px;
  background: #fff;
  color: var(--text-color-dark-gray);
  border: 1px solid #e5e8ea;
  font-weight: 600;
}
.ss-tab.on {
  background: var(--primary-color);
  color: #fff;
  border-color: var(--primary-color);
}
.ss-pane {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.ss-section {
  background: #fff;
  border-radius: 4px;
  box-shadow: var(--card-shadow);
  overflow: hidden;
}
.ss-sec-head {
  padding: 14px 18px 12px;
  border-bottom: 1px solid #f0f2f3;
  background: #fafbfc;
}
.ss-sec-head h3 {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-color-darker);
}
.ss-sec-head .muted {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
}
.ss-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 16px;
  padding: 16px 18px 18px;
}
.ss-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.ss-field > span {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-color-dark-gray);
}
.ss-field .ss-opt {
  font-style: normal;
  font-weight: 400;
  color: var(--text-color-gray);
  margin-left: 6px;
}
.ss-field-span2 { grid-column: 1 / -1; }
.ss-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 0 18px 16px;
}
.ss-actions .btn {
  width: auto;
  margin: 0;
  min-width: 112px;
  height: 38px;
  padding: 0 18px;
}
.ss-link-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
}
.ss-link-meta { flex: 1; min-width: 0; }
.ss-link-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-color-darker);
  margin-bottom: 4px;
}
.ss-link-meta .muted { margin: 0; font-size: 12px; line-height: 1.55; }
.ss-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
}
.ss-status.ok { color: #2d8a3a; }
.ss-status.warn { color: #c47d00; }
.ss-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 0 18px 16px;
}
.ss-toolbar .btn { width: auto; margin: 0; }
.ss-inline-note {
  padding: 0 18px 12px;
  margin: 0;
}
.ss-wx-panel {
  margin: 0 18px 16px;
  padding: 16px;
  border: 1px solid #eef1f3;
  border-radius: 8px;
  background: #fafbfc;
  text-align: center;
}
.ss-wx-panel .wx-qr {
  width: 200px;
  height: 200px;
  margin: 8px auto 0;
  display: block;
}
.ss-wx-panel .wx-auth-link {
  display: inline-block;
  margin-top: 10px;
  color: #07c160;
  text-decoration: none;
  font-size: 13px;
}
.ss-wx-panel .wx-open-frame {
  width: min(300px, 100%);
  height: 400px;
  margin: 8px auto 0;
  border: 0;
  background: transparent;
}
.btn.ss-danger,
.ss-danger {
  background: #c62828 !important;
  color: #fff !important;
  width: auto;
  margin: 0;
}
.btn.ss-danger:hover { background: #a61d1d !important; }
@media (max-width: 720px) {
  .ss-fields { grid-template-columns: 1fr; }
  .ss-field-span2 { grid-column: auto; }
  .ss-actions { justify-content: stretch; }
  .ss-actions .btn { flex: 1; }
  .ss-link-row { flex-direction: column; align-items: stretch; }
}

@media (max-width: 960px) {
  #mainView { grid-template-columns: 1fr; }
  .sider { flex-direction: column; max-height: none; overflow: visible; }
  .sider-nav {
    flex-direction: row;
    flex-wrap: wrap;
    overflow: visible;
    gap: 4px;
  }
  .nav-group {
    flex: 1 1 140px;
    border-top: 0;
    margin-top: 0;
    background: rgba(255,255,255,.04);
    border-radius: 6px;
    padding: 4px;
  }
  .nav-group-body { display: flex !important; }
  .nav-caret { display: none; }
  .nav-group-body .nav-item { padding-left: 12px; }
  .sider-foot { flex-direction: row; align-items: center; }
}
