* {
  box-sizing: border-box;
}
:root {
  --navy: #101d34;
  --teal: #007f73;
  --accent: #0da493;
  --ink: #192a42;
  --muted: #607186;
  --line: #dbe3e9;
  font-family: "Segoe UI", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: #f4f7fa;
  font-size: 16px;
}
body {
  margin: 0;
}
button,
input,
select,
textarea {
  font: inherit;
}
button {
  cursor: pointer;
  border: 0;
  background: transparent;
  color: inherit;
}
button:focus-visible,
a:focus-visible {
  outline: 3px solid #29bcae;
  outline-offset: 3px;
}
button:hover {
  filter: brightness(0.94);
}
button:disabled {
  cursor: wait;
  opacity: 0.7;
}
svg.icon {
  width: 1.12em;
  height: 1.12em;
  vertical-align: -0.17em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}
.brand {
  display: flex;
  align-items: center;
  gap: 13px;
  font-weight: 700;
}
.brand-mark {
  display: grid;
  place-items: center;
  background: #22c7af;
  width: 39px;
  height: 39px;
  border-radius: 11px;
  color: #092b35;
}
.brand-mark svg {
  width: 30px;
  height: 30px;
}
.brand strong {
  display: block;
  font-size: 21px;
  letter-spacing: 1.5px;
  line-height: 1.2;
}
.brand small {
  font-size: 12px;
  color: #afbecf;
  letter-spacing: 1.3px;
  font-weight: 450;
}
.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 219px minmax(0, 1fr);
}
aside.side {
  background: var(--navy);
  color: #dce6f1;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 28px 16px 17px;
}
.side .brand {
  padding: 0 8px 27px;
  border-bottom: 1px solid #29374b;
}
.nav-label {
  font-size: 12px;
  letter-spacing: 1px;
  color: #a5b5c9;
  margin: 29px 12px 10px;
}
.nav-item {
  width: 100%;
  display: flex;
  gap: 13px;
  align-items: center;
  text-align: left;
  border-radius: 7px;
  padding: 12px 14px;
  color: #c5d0de;
  margin-bottom: 3px;
  font-size: 15px;
}
.nav-item.active {
  background: #193e46;
  color: #80edda;
  box-shadow: inset 3px 0 #48d6b8;
}
.side-footer {
  margin-top: auto;
  border-top: 1px solid #2a374b;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 19px 4px 0;
}
.avatar {
  width: 37px;
  height: 37px;
  border-radius: 12px;
  background: #2b475d;
  color: #a4f0df;
  display: grid;
  place-items: center;
  font-weight: 700;
}
.identity {
  min-width: 0;
  flex: 1;
  font-size: 14px;
}
.identity strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}
.identity small {
  display: block;
  color: #aab9ca;
  font-size: 12px;
}
.top {
  height: 65px;
  border-bottom: 1px solid var(--line);
  background: white;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(18px, 3vw, 52px);
  font-size: 14px;
}
.crumb {
  display: flex;
  align-items: center;
  gap: 11px;
  color: #526477;
}
.crumb b {
  color: var(--ink);
}
.top time {
  color: #617386;
}
.main {
  max-width: 1700px;
  margin: auto;
  padding: 28px clamp(18px, 3vw, 52px) 50px;
}
.hero {
  background: linear-gradient(105deg, #142c47 8%, #164456 68%, #14606a);
  border-radius: 14px;
  overflow: hidden;
  min-height: 166px;
  position: relative;
  color: white;
  padding: 30px 34px;
  display: flex;
  align-items: center;
}
.hero h1,
.login-story h1 {
  margin: 0;
  letter-spacing: 1px;
  font-size: clamp(26px, 2.5vw, 38px);
}
.hero p {
  color: #c2d6df;
  margin: 12px 0 0;
  font-size: 15px;
}
.hero-copy {
  position: relative;
  z-index: 1;
}
.stack-art {
  position: absolute;
  right: 0;
  top: 0;
  height: 100%;
  width: 42%;
  min-width: 230px;
  pointer-events: none;
}
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 30px 0 17px;
}
.section-head h2 {
  font-size: 23px;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}
.count {
  background: #e5ecf0;
  color: #557083;
  font-size: 13px;
  border-radius: 7px;
  padding: 3px 8px;
}
.toolbar,
.btn,
.search-box,
.tabs,
.form-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.btn {
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 9px 14px;
  background: white;
  white-space: nowrap;
}
.primary {
  background: #007e72;
  border-color: #007e72;
  color: white;
}
.search-box {
  background: white;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 8px 11px;
  color: #77869a;
}
.search-box input {
  border: 0;
  outline: 0;
  width: 155px;
  min-width: 0;
  font-size: 14px;
}
.search-box:focus-within {
  border-color: var(--teal);
}
.tabs {
  border-bottom: 1px solid var(--line);
  gap: 5px;
  overflow-x: auto;
  margin-bottom: 19px;
}
.tab {
  border-bottom: 3px solid transparent;
  padding: 9px 11px 12px;
  font-size: 14px;
  color: #586a7c;
  white-space: nowrap;
}
.tab.active {
  border-color: var(--teal);
  color: var(--teal);
  font-weight: 650;
}
.tab.add {
  color: var(--teal);
}
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr));
  gap: 16px;
}
.card {
  position: relative;
  background: white;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 2px 5px #15374408;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.card:hover {
  border-color: #a5c7c7;
  box-shadow: 0 5px 16px #1537440e;
}
.card-detail {
  padding: 20px 20px 15px;
  text-align: left;
  display: block;
  width: 100%;
  flex: 1;
}
.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.tile-icon {
  background: var(--pale);
  color: var(--tone);
  width: 43px;
  height: 43px;
  border-radius: 11px;
  display: inline-grid;
  place-items: center;
  font-size: 23px;
}
.pill {
  background: #f1f5f8;
  border: 1px solid #e2e9ee;
  color: #566c7e;
  border-radius: 20px;
  padding: 3px 9px;
  font-size: 12px;
  max-width: 65%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.card h3 {
  font-size: 19px;
  margin: 14px 0 6px;
  line-height: 1.4;
}
.card .note {
  font-size: 14px;
  line-height: 1.6;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0;
  min-height: 2.9em;
}
.host {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #687d91;
  margin: 11px 0 0;
  overflow-wrap: anywhere;
}
.card-actions {
  display: flex;
  gap: 7px;
  margin: 0 20px;
  padding: 13px 0 15px;
  border-top: 1px solid #e7edf2;
}
.card-actions .btn {
  flex: 1;
  padding: 7px 4px;
  font-size: 13px;
}
.visit {
  background: #e8f5f1;
  color: #006b60;
  border-color: #d1eae1;
}
.icon-btn {
  padding: 6px 9px;
  display: inline-grid;
  place-items: center;
  border-radius: 7px;
  font-size: 19px;
}
.card-actions .icon-btn {
  border: 1px solid var(--line);
}
.menu {
  position: absolute;
  z-index: 2;
  right: 15px;
  bottom: 56px;
  background: white;
  border: 1px solid var(--line);
  padding: 5px;
  border-radius: 9px;
  box-shadow: 0 6px 24px #192a4220;
}
.menu button {
  display: block;
  text-align: left;
  padding: 8px 16px;
  font-size: 14px;
  width: 100%;
}
.danger {
  color: #b33a46;
}
.empty {
  padding: 40px;
  text-align: center;
  color: var(--muted);
  background: white;
  border: 1px dashed var(--line);
  border-radius: 12px;
}
dialog {
  border: 1px solid var(--line);
  border-radius: 15px;
  padding: 0;
  width: min(490px, 94vw);
  max-height: 90vh;
  color: var(--ink);
  box-shadow: 0 24px 100px #101d3433;
}
dialog::backdrop {
  background: #101d346b;
}
dialog header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 19px 23px;
  border-bottom: 1px solid var(--line);
}
dialog h2 {
  font-size: 20px;
  margin: 0;
}
#dialog-body {
  padding: 20px 24px;
}
form.fields {
  display: grid;
  gap: 15px;
}
.fields label {
  display: grid;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
}
.fields input,
.fields select,
.fields textarea,
.login-form input {
  width: 100%;
  padding: 10px 11px;
  border: 1px solid #ccd7df;
  border-radius: 7px;
  color: var(--ink);
  background: white;
}
.fields textarea {
  resize: vertical;
  min-height: 72px;
}
.form-actions {
  justify-content: flex-end;
  margin-top: 7px;
}
.facts {
  display: grid;
  grid-template-columns: 76px 1fr;
  gap: 14px;
  font-size: 15px;
}
.facts dt {
  color: var(--muted);
}
.facts dd {
  margin: 0;
  overflow-wrap: anywhere;
}
.muted,
.hint {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}
#toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  background: #172e40;
  color: white;
  padding: 10px 19px;
  border-radius: 8px;
  pointer-events: none;
  opacity: 0;
}
#toast.visible {
  opacity: 1;
}
.error {
  color: #a42a39;
  font-size: 14px;
  margin: 0;
}
.login {
  display: grid;
  grid-template-columns: 1fr minmax(350px, 46%);
  min-height: 100vh;
}
.login-story {
  position: relative;
  background: linear-gradient(135deg, #101e34, #15384c 64%, #11686b);
  color: white;
  padding: clamp(32px, 5vw, 85px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.login-story > div:nth-child(2) {
  margin: auto 0;
  position: relative;
  z-index: 1;
}
.login-story h1 {
  font-size: clamp(36px, 4.2vw, 68px);
  line-height: 1.3;
}
.login-story p {
  color: #c1d9db;
  line-height: 1.8;
}
.login-story .stack-art {
  top: auto;
  bottom: 0;
  width: 90%;
  height: 42%;
  opacity: 0.55;
}
.login-box {
  background: #fff;
  display: grid;
  place-items: center;
  padding: 30px;
}
.login-form {
  width: min(365px, 100%);
}
.login-form h2 {
  font-size: 30px;
  margin: 0 0 7px;
}
.login-form .fields {
  margin-top: 32px;
}
.login-form .primary {
  padding: 12px;
}
.login-foot {
  color: #67798a;
  font-size: 13px;
  margin-top: 24px;
}
@media (min-width: 1650px) {
  .cards {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
@media (max-width: 940px) {
  .shell {
    grid-template-columns: 175px minmax(0, 1fr);
  }
  aside.side {
    padding-left: 10px;
    padding-right: 10px;
  }
  .hero {
    padding: 24px;
  }
  .search-box input {
    width: 115px;
  }
  .main {
    padding-left: 18px;
    padding-right: 18px;
  }
}
@media (max-width: 700px) {
  .shell {
    display: block;
  }
  .side .brand {
    border: 0;
    padding: 0;
  }
  .brand small,
  .side .nav-label,
  .side .identity,
  .side .avatar {
    display: none;
  }
  aside.side {
    height: auto;
    position: static;
    flex-direction: row;
    align-items: center;
    gap: 6px;
    padding: 10px;
    overflow: auto;
  }
  .side .brand strong {
    display: none;
  }
  .nav-item {
    width: auto;
    padding: 10px 6px;
    margin: 0;
    font-size: 13px;
    gap: 4px;
    white-space: nowrap;
  }
  .side-footer {
    margin: 0 0 0 auto;
    border: 0;
    padding: 0;
  }
  .top {
    height: 46px;
  }
  .hero {
    min-height: 134px;
  }
  .hero-copy {
    max-width: 72%;
  }
  .hero .stack-art {
    opacity: 0.45;
  }
  .main {
    padding-top: 16px;
  }
  .section-head {
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 10px;
  }
  .toolbar {
    flex-wrap: wrap;
  }
  .section-head h2 {
    font-size: 21px;
  }
  .login {
    grid-template-columns: 1fr;
  }
  .login-story {
    min-height: 200px;
    gap: 26px;
  }
  .login-story p {
    margin-bottom: 0;
  }
  .login-box {
    padding: 35px 22px;
    align-items: start;
  }
  .cards {
    gap: 12px;
  }
  .tabs {
    max-width: 100%;
  }
}

/* Application directory */
.card {
  border-radius: 16px;
  transition:
    border-color 0.18s,
    box-shadow 0.18s;
}
.card-top {
  justify-content: flex-start;
}
.card-more {
  position: absolute;
  right: 14px;
  top: 18px;
  color: #607286;
  background: transparent;
}
.card-more:hover {
  background: #edf3f6;
}
.card-top .pill {
  max-width: calc(100% - 90px);
}
.card .menu {
  bottom: auto;
  top: 52px;
}
.card-detail {
  padding: 20px 20px 12px;
  border-radius: 16px 16px 0 0;
}
.service-kinds {
  overflow-wrap: anywhere;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  color: var(--tone);
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0.02em;
  margin: 0 0 7px;
}
.card-actions {
  gap: 6px;
  align-items: center;
}
.card-actions .visit {
  background: #007a6b;
  color: white;
  border-color: #007a6b;
  padding: 9px 6px;
}
.card-actions .admin-entry,
.card-actions .card-sso {
  border-color: transparent;
  background: transparent;
  color: #38556c;
  white-space: nowrap;
}
.card-actions .card-sso {
  flex: 0 1 auto;
}
.card-actions .admin-entry:hover,
.card-actions .card-sso:hover {
  background: #f0f5f6;
}
/* Expand the selected application into its service and management entries. */
dialog.service-sheet {
  width: min(590px, calc(100vw - 30px));
  max-height: min(86vh, 820px);
  max-height: min(86dvh, 820px);
  border: 0;
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 30px 95px #071a3866;
  overscroll-behavior: contain;
}
.service-sheet::backdrop {
  background: #132a3c78;
  backdrop-filter: blur(4px);
}
.service-sheet > header {
  position: absolute;
  right: 15px;
  top: 15px;
  border: 0;
  padding: 0;
  z-index: 1;
}
.service-sheet > header h2 {
  position: absolute;
  clip-path: inset(50%);
  overflow: hidden;
  width: 1px;
  height: 1px;
  white-space: nowrap;
}
.service-sheet #dialog-close {
  width: 34px;
  height: 34px;
  border-radius: 100%;
  padding: 0;
  color: white;
  background: #ffffff14;
  border: 1px solid #ffffff3d;
  line-height: 1;
  font-family: Arial, sans-serif;
  font-weight: 300;
  font-size: 24px;
}
.service-sheet #dialog-close:hover {
  background: #ffffff30;
}
.service-sheet #dialog-body {
  padding: 0;
}
.sheet-cover {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: 31px 60px 31px 27px;
  min-height: 136px;
  display: flex;
  align-items: center;
  gap: 16px;
  color: #fff;
  background: linear-gradient(112deg, #153347, #1a4c56 76%, #216773);
}
.sheet-cover::after,
.sheet-cover::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: auto -40px -84px auto;
  width: 180px;
  height: 180px;
  border: 1px solid #8ce1d344;
  border-radius: 27px;
  transform: rotate(-35deg) skew(8deg);
  box-shadow:
    0 0 0 10px #ffffff04,
    0 0 0 11px #8ce1d326,
    0 0 0 23px #ffffff04,
    0 0 0 24px #8ce1d31b;
}
.sheet-cover::before {
  right: -86px;
  bottom: -59px;
}
.sheet-tile {
  display: grid;
  place-items: center;
  flex: 0 0 56px;
  height: 56px;
  font-size: 29px;
  color: var(--tone);
  background: var(--pale);
  border-radius: 17px;
  box-shadow: 0 4px 16px #03182126;
}
.sheet-topic {
  font-size: 13px;
  color: #b8e4de;
  font-weight: 550;
}
.sheet-cover h3 {
  font-size: clamp(22px, 3.1vw, 30px);
  margin: 4px 0 0;
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.sheet-content {
  display: grid;
  gap: 22px;
  padding: 24px 27px 26px;
}
.sheet-content h4 {
  font-size: 16px;
  color: #19364a;
  margin: 0 0 11px;
}
.entry-row {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border: 1px solid #d6e7e3;
  background: #f5faf8;
  border-radius: 13px;
  padding: 14px;
}
.entry-row + .entry-row {
  margin-top: 8px;
}
.entry-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  font-size: 20px;
  border-radius: 10px;
  background: #e0eeed;
  color: #16786c;
}
.entry-icon.kind-miniapp {
  background: #def2e7;
  color: #248257;
}
.entry-icon.kind-app {
  background: #e7eaf8;
  color: #5668a3;
}
.entry-text {
  display: grid;
  gap: 3px;
  overflow-wrap: anywhere;
  min-width: 0;
}
.entry-type {
  font-size: 12px;
  color: #456e68;
}
.entry-text strong {
  font-size: 15px;
  color: #152f42;
}
.entry-url,
.admin-destination,
.sheet-note p,
.entry-missing {
  font-size: 13px;
  line-height: 1.6;
  color: #536c7a;
  overflow-wrap: anywhere;
}
.service-go {
  color: white;
  background: #007c6e;
  border-color: transparent;
  font-size: 13px;
  padding: 8px 12px;
}
.admin-block {
  border-top: 1px solid #e3ebee;
  padding-top: 18px;
}
.admin-destination {
  display: flex;
  gap: 7px;
  align-items: baseline;
  min-width: 0;
}
.admin-destination span {
  min-width: 0;
}
.sheet-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.sheet-actions .btn {
  padding: 7px 12px;
  font-size: 13px;
}
.sheet-note {
  background: #f5f7f9;
  border-radius: 12px;
  padding: 12px 15px;
}
.sheet-note h4 {
  margin: 0 0 3px;
  font-size: 13px;
  color: #496273;
}
.sheet-note p,
.entry-missing {
  margin: 0;
  white-space: pre-line;
}
.entry-missing {
  background: #f4f7f8;
  border: 1px dashed #cad9db;
  padding: 14px;
  border-radius: 10px;
}
.wechat-open {
  text-decoration: none;
}
.service-edit {
  padding: 13px;
  margin: 0;
  border: 1px solid #d5e2e5;
  border-radius: 12px;
}
.service-edit legend {
  font-size: 14px;
  font-weight: 650;
  padding: 0 5px;
}
.service-editor-row {
  display: grid;
  gap: 9px;
  padding: 11px;
  background: #f3f7f7;
  border-radius: 8px;
  margin-bottom: 10px;
}
.editor-row-top {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 10px;
}
.editor-row-top label {
  flex: 1;
}
.remove-service {
  color: #a24242;
  padding: 8px;
  font-size: 13px;
}
@media (max-width: 520px) {
  .sheet-cover {
    padding: 26px 46px 25px 18px;
    min-height: 115px;
    gap: 12px;
  }
  .sheet-tile {
    height: 46px;
    flex-basis: 46px;
    border-radius: 13px;
  }
  .sheet-content {
    padding: 18px;
    gap: 18px;
  }
  .entry-row {
    grid-template-columns: 32px minmax(0, 1fr);
    padding: 11px;
    gap: 6px 10px;
  }
  .entry-icon {
    height: 32px;
    width: 32px;
  }
  .entry-row .service-go {
    justify-self: start;
    grid-column: 2;
  }
  .card-top .pill {
    max-width: calc(100% - 95px);
  }
}
@media (prefers-reduced-motion: reduce) {
  .card {
    transition: none;
  }
}

.credential-panel {
  padding: 15px;
  border-radius: 13px;
  border: 1px solid #d9e6ec;
  background: #f6f9fb;
}
.credential-head, .credential-actions, .credential-field > div {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
}
.credential-head { justify-content: space-between; gap: 9px; }
.credential-head h4 { margin: 0; }
.credential-head .icon { margin-right: 3px; color: #4c7183; }
.credential-panel .btn { font-size: 13px; padding: 6px 9px; }
.credential-field, .credential-status, .credential-actions { margin: 12px 0 0; }
.credential-status, .credential-field label { color: #536b7c; font-size: 13px; }
.credential-field label { display: block; margin-bottom: 5px; }
.credential-field input {
  min-width: 90px;
  flex: 1 1 120px;
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #ccdbe2;
  border-radius: 7px;
  color: var(--ink);
  background: white;
}
.credential-field input[readonly] { background: #fdfefe; }
.credential-actions { justify-content: flex-end; }

.sync-source { display: flex; align-items: center; gap: 12px; padding: 13px 15px; background: #edf6f4; border: 1px solid #d7e9e3; border-radius: 10px; }
.sync-source .tile-icon { --pale: #d8ebe5; --tone: #247969; }
.sync-source strong, .sync-source div > span { display: block; }
.sync-source div > span { font-size: 13px; color: var(--muted); margin-top: 3px; }
.sync-explanation { color: #496278; font-size: 14px; line-height: 1.65; margin: 0; }
