:root {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft YaHei', sans-serif;
  color: #263544;
  background: #f3f6f8;
  --blue: #245f85;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
header {
  background: #173b54;
  color: white;
  padding: 25px max(28px, calc((100vw - 1200px) / 2));
  display: flex;
  align-items: center;
  gap: 25px;
}
header div:first-child {
  flex: 1;
}
h1 {
  font-size: 25px;
  margin: 8px 0 0;
}
h2 {
  font-size: 21px;
  margin: 0 0 20px;
}
.eyebrow {
  font-size: 12px;
  letter-spacing: 2px;
  color: #bdd1df;
}
main {
  max-width: 1200px;
  margin: 30px auto;
  padding: 0 24px;
}
.panel {
  background: #fff;
  border: 1px solid #e0e7ec;
  border-radius: 14px;
  padding: 24px;
}
.login {
  max-width: 420px;
  margin: 70px auto;
}
button,
input,
select,
textarea {
  font: inherit;
}
button {
  border: 1px solid #cfdae3;
  border-radius: 7px;
  background: #fff;
  color: #245f85;
  cursor: pointer;
  padding: 10px 16px;
  min-height: 42px;
}
button:hover {
  background: #edf4f9;
}
button:disabled {
  opacity: 0.5;
  cursor: wait;
}
button.primary {
  background: #245f85;
  color: white;
  border-color: #245f85;
}
button.danger {
  color: #b33333;
}
label {
  display: block;
  font-size: 14px;
  margin: 16px 0;
  color: #405b71;
}
input:not([type='checkbox']),
select,
textarea {
  width: 100%;
  border: 1px solid #cfdae3;
  border-radius: 6px;
  padding: 11px;
  margin-top: 7px;
  background: white;
  color: #263544;
}
textarea {
  resize: vertical;
  line-height: 1.6;
}
input:focus,
textarea:focus {
  outline: 2px solid #245f8580;
}
input[type='file'] {
  font-size: 13px;
}
.muted {
  font-size: 13px;
  color: #71808e;
  line-height: 1.8;
}
.notice {
  background: #fff5da;
  color: #7e5d1a;
  border: 1px solid #eadcb7;
  padding: 13px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.8;
}
nav {
  display: flex;
  gap: 12px;
  margin: 25px 0;
}
.filters {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}
.filters input {
  max-width: 340px;
  margin: 0;
}
.filters select {
  max-width: 150px;
  margin: 0;
}
.table-wrap {
  overflow: auto;
}
table {
  border-collapse: collapse;
  width: 100%;
  font-size: 14px;
}
th {
  text-align: left;
  background: #f6f8fa;
  font-weight: 500;
  color: #637787;
}
td,
th {
  padding: 15px;
  border-bottom: 1px solid #e9edf2;
}
td .muted {
  margin-top: 5px;
}
td button {
  padding: 5px 10px;
  min-height: 34px;
  margin: 3px;
  font-size: 13px;
}
.badge {
  font-size: 12px;
  padding: 4px 9px;
  border-radius: 20px;
  background: #e7f4ee;
  color: #297752;
}
.badge.off {
  background: #edf0f3;
  color: #71808e;
}
.pagination {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 15px;
  margin-top: 20px;
  font-size: 13px;
}
#message {
  color: #a33429;
  min-height: 25px;
  white-space: pre-wrap;
  line-height: 1.6;
}
dialog {
  width: 760px;
  max-width: calc(100vw - 30px);
  max-height: 90vh;
  border: 0;
  border-radius: 14px;
  padding: 28px;
  color: #263544;
  overflow: auto;
  box-shadow: 0 20px 100px #173b5440;
}
dialog::backdrop {
  background: #0d243970;
}
.dialog-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
}
.dialog-heading h2 {
  margin: 0;
}
.dialog-heading button {
  border: 0;
}
.dialog-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 25px;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 22px;
}
.wide {
  grid-column: 1/-1;
}
.check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  line-height: 1.8;
}
.check input {
  margin-top: 6px;
}
.avatar-thumb {
  width: 75px;
  height: 100px;
  object-fit: cover;
  border-radius: 7px;
  margin-right: 20px;
}
#preview-dialog {
  width: 530px;
}
#entry-code {
  display: block;
  width: 260px;
  max-width: 100%;
  margin: 25px auto;
}
.preview-phone {
  max-width: 390px;
  height: 700px;
  max-height: 70vh;
  background: #fff;
  border: 1px solid #dfe6ec;
  border-radius: 15px;
  margin: 25px auto 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.phone-nav {
  height: 44px;
  padding: 12px;
  text-align: center;
  border-bottom: 1px solid #edf0f3;
  font-size: 14px;
}
.phone-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
}
.phone-greeting {
  padding: 25px 16px 18px;
  font-size: 14px;
  color: #657583;
}
.phone-card {
  margin: 0 16px;
  border: 1px solid #dfe7ee;
  border-radius: 16px;
  overflow: hidden;
}
.phone-blue {
  background: #173b54;
  padding: 20px 22px;
  color: white;
}
.phone-identity {
  display: flex;
  align-items: center;
  gap: 21px;
}
.phone-photo {
  width: 88px;
  height: 117px;
  object-fit: cover;
  border: 2px solid #ffffffd9;
  border-radius: 8px;
  flex-shrink: 0;
}
.phone-details {
  min-width: 0;
  word-break: break-all;
}
.phone-name {
  font-size: 27px;
  font-weight: 650;
}
.phone-english {
  font-size: 10px;
  letter-spacing: 1.4px;
  margin-top: 6px;
  color: #b8cedd;
}
.phone-position {
  font-size: 13px;
  line-height: 1.7;
  color: #dce7ef;
  margin-top: 14px;
}
.phone-company {
  font-size: 12px;
  line-height: 1.8;
  color: #c8d7e1;
  margin-top: 18px;
}
.phone-titles {
  border-top: 1px solid #ffffff29;
  margin-top: 20px;
  padding-top: 16px;
  color: #e0eaf1;
  font-size: 12px;
  line-height: 1.85;
}
.phone-titles p {
  margin: 7px 0;
  display: flex;
  gap: 9px;
}
.phone-titles span {
  font-size: 10px;
  color: #b4c9d8;
}
.phone-contacts {
  padding: 0 20px 7px;
}
.phone-row {
  padding: 11px 0;
  border-bottom: 1px solid #edf1f4;
  word-break: break-all;
  font-size: 13px;
  line-height: 1.65;
}
.phone-row small {
  display: block;
  color: #657787;
  font-size: 11px;
}
.phone-row strong {
  font-size: 16px;
}
.phone-home {
  padding: 30px 16px;
  font-size: 13px;
  color: #8593a3;
  line-height: 1.8;
}
.phone-home b {
  display: block;
  font-size: 16px;
  color: #182838;
  margin-bottom: 12px;
}
.phone-home img {
  width: 100%;
  height: 54px;
  object-fit: cover;
}
.phone-actions {
  flex-shrink: 0;
  border-top: 1px solid #e9edf2;
  padding: 10px 12px 16px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}
.phone-actions div {
  min-width: 0;
  min-height: 44px;
  border: 1px solid #c5d7e3;
  color: #245f85;
  text-align: center;
  padding: 12px 4px;
  border-radius: 10px;
  font-size: 13px;
  white-space: nowrap;
  display: flex;
  align-items: center;
  justify-content: center;
}
.phone-actions div:first-child {
  background: #245f85;
  color: white;
}
.phone-actions div:last-child {
  background: #edf4f9;
}
.import-result {
  max-height: 350px;
  overflow: auto;
  margin: 20px 0;
  font-size: 13px;
  line-height: 1.7;
}
.import-result table {
  min-width: 600px;
}
.error {
  color: #b33333;
}
.warning {
  color: #946117;
}
[hidden] {
  display: none !important;
}
@media (max-width: 650px) {
  header {
    padding: 20px;
  }
  .form-grid {
    display: block;
  }
  .filters {
    flex-wrap: wrap;
  }
  .filters input {
    max-width: 100%;
  }
  dialog {
    padding: 20px;
  }
  td,
  th {
    padding: 10px;
  }
  nav {
    flex-wrap: wrap;
  }
}
