* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Helvetica Neue', sans-serif;
  background: #f5f7fa;
  color: #0f172a;
  min-height: 100%;
  -webkit-tap-highlight-color: transparent;
}

.hidden { display: none !important; }

.view {
  min-height: 100vh;
  padding-bottom: env(safe-area-inset-bottom);
}

.view.has-tabbar {
  padding-bottom: calc(64px + env(safe-area-inset-bottom));
}

.page-header {
  padding: 28px 20px 16px;
  background: #fff;
}

.page-header.dark {
  background: #0a1628;
  color: #fff;
}

.page-header.dark .sub {
  color: rgba(255, 255, 255, 0.55);
}

.page-header h1 {
  font-size: 22px;
  font-weight: 800;
}

.sub {
  margin-top: 6px;
  font-size: 13px;
  color: #64748b;
  line-height: 1.5;
}

.logo {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: #1e6ff1;
  color: #fff;
  font-size: 24px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}
.logo.has-img {
  background: #fff;
  padding: 4px;
}
.logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 12px;
}

.boot-box {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.card {
  margin: 12px 16px;
  padding: 18px;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.06);
}

.card.center { text-align: center; margin-top: 40px; }

.card-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 12px;
}

.field-label {
  display: block;
  font-size: 13px;
  color: #64748b;
  margin: 12px 0 6px;
}

.field-input {
  width: 100%;
  height: 46px;
  border: none;
  border-radius: 10px;
  background: #f3f4f6;
  padding: 0 14px;
  font-size: 16px;
}

.row { display: flex; gap: 10px; align-items: center; }
.flex1 { flex: 1; }

.btn-primary {
  background: #1e6ff1;
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 12px 18px;
  font-size: 16px;
  font-weight: 600;
}

.btn-primary:disabled {
  opacity: 0.45;
}

.btn-secondary {
  background: #eff6ff;
  color: #1e6ff1;
  border: none;
  border-radius: 10px;
  padding: 0 14px;
  height: 46px;
  font-size: 13px;
  white-space: nowrap;
}

.btn-secondary:disabled {
  opacity: 0.5;
}

.btn-outline {
  background: #fff;
  color: #ef4444;
  border: 1px solid #fecaca;
  border-radius: 10px;
  padding: 12px 18px;
  font-size: 15px;
}

.block { width: 100%; margin-top: 16px; }

.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.tab {
  flex: 1;
  padding: 10px;
  border: none;
  border-radius: 8px;
  background: #f1f5f9;
  color: #64748b;
  font-size: 14px;
}

.tab.active {
  background: #eff6ff;
  color: #1e6ff1;
  font-weight: 600;
}

.link-line {
  text-align: center;
  margin-top: 16px;
  font-size: 14px;
}

.link-line a { color: #1e6ff1; text-decoration: none; }

.banner {
  margin: 12px 16px;
  padding: 14px 16px;
  background: #fff7ed;
  border-radius: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #c2410c;
  font-size: 14px;
}

.banner-action { color: #1e6ff1; }

.banner.signed {
  background: #ecfdf5;
  color: #047857;
  justify-content: center;
}

.contract-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid #f1f5f9;
}

.contract-item:last-child { border-bottom: none; }

.contract-title {
  font-size: 14px;
  font-weight: 600;
  color: #0f172a;
}

.contract-meta {
  margin-top: 4px;
  font-size: 12px;
  color: #94a3b8;
}

.btn-contract {
  padding: 6px 12px;
  font-size: 12px;
  color: #1e6ff1;
  background: #eff6ff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}

.info-row {
  display: flex;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid #f1f5f9;
  font-size: 14px;
}

.info-row:last-child { border-bottom: none; }
.info-row span:first-child { color: #64748b; }

.record-item {
  padding: 12px 0;
  border-bottom: 1px solid #f1f5f9;
}

.record-item:last-child { border-bottom: none; }

.record-name { font-weight: 600; font-size: 14px; }
.record-meta { font-size: 12px; color: #94a3b8; margin-top: 4px; }

.tag-green {
  display: inline-block;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 6px;
  background: #dcfce7;
  color: #16a34a;
}

.pending-item {
  padding: 12px;
  margin-bottom: 10px;
  border-radius: 10px;
  background: #f8fafc;
  border: 2px solid transparent;
  cursor: pointer;
}

.pending-item.active {
  border-color: #1e6ff1;
  background: #eff6ff;
}

.agreement-scroll {
  max-height: 50vh;
  min-height: 200px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  font-size: 14px;
  line-height: 1.75;
  color: #334155;
  white-space: pre-wrap;
  padding: 4px 0;
}

.scroll-hint {
  display: block;
  text-align: center;
  color: #1e6ff1;
  font-size: 13px;
  margin-top: 10px;
}

.sign-footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(56px + env(safe-area-inset-bottom));
  padding: 12px 16px;
  background: linear-gradient(180deg, rgba(245, 247, 250, 0), #f5f7fa 30%);
}

.sign-cancel-wrap {
  margin: 10px 0 0;
  text-align: center;
}

.sign-cancel-link {
  border: none;
  background: none;
  color: #94a3b8;
  font-size: 13px;
  text-decoration: underline;
  padding: 4px 8px;
  cursor: pointer;
}

.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: calc(56px + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: #fff;
  border-top: 1px solid #e2e8f0;
  display: flex;
  z-index: 100;
}

.tabbar-item {
  flex: 1;
  border: none;
  background: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: #94a3b8;
  gap: 2px;
}

.tabbar-item span { font-size: 20px; line-height: 1; }
.tabbar-item em { font-style: normal; }

.tabbar-item.active { color: #1e6ff1; font-weight: 600; }

.toast {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  max-width: 90%;
  padding: 10px 16px;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.88);
  color: #fff;
  font-size: 14px;
}

.toast.err { background: rgba(185, 28, 28, 0.92); }

.empty-tip {
  color: #94a3b8;
  font-size: 14px;
  line-height: 1.6;
  padding: 8px 0;
}
