* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  color: #1d2129; background: #fff; display: flex; min-height: 100vh;
}
[hidden] { display: none !important; }

/* 左侧品牌区 */
.brand {
  flex: 0 0 46%; position: relative; overflow: hidden; color: #fff;
  background: radial-gradient(ellipse at 45% 30%, #1c4f86 0%, #0f2a4d 45%, #0a1628 100%);
  padding: 56px 52px; display: flex; flex-direction: column;
}
.logo {
  width: 56px; height: 56px; border-radius: 14px;
  background: linear-gradient(145deg, #ffb340, #ff7a00);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 18px; letter-spacing: .5px; box-shadow: 0 6px 18px rgba(255,122,0,.35);
}
.brand h1 { font-size: 32px; font-weight: 700; margin-top: 18px; letter-spacing: 1px; }
.brand .sub { color: #8ea3bf; font-size: 15px; margin-top: 2px; }
.slogan { margin-top: 80px; }
.slogan b { font-size: 20px; font-weight: 600; letter-spacing: 1px; }
.slogan p { color: #8ea3bf; font-size: 13px; margin-top: 6px; }
.shield-wrap { flex: 1; display: flex; align-items: flex-end; justify-content: center; padding-bottom: 40px; }
.rings { position: relative; width: 220px; height: 220px; }
.rings span {
  position: absolute; border-radius: 50%; border: 1px solid rgba(80,200,230,.25);
  left: 50%; top: 50%; transform: translate(-50%,-50%);
}
.rings span:nth-child(1) { width: 220px; height: 220px; animation: pulse 4s ease-out infinite; }
.rings span:nth-child(2) { width: 150px; height: 150px; border-color: rgba(80,200,230,.4); }
.rings svg { position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%); }
@keyframes pulse { 0% { opacity: .9; } 100% { opacity: .2; } }
.badges { display: flex; justify-content: space-between; color: #7d8fa8; font-size: 12px; }
.badges i { font-style: normal; margin-right: 4px; }

/* 右侧内容区 */
.panel { flex: 1; display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.card { width: 100%; max-width: 430px; }
.eyebrow { font-size: 11px; letter-spacing: 2.5px; color: #86909c; font-weight: 600; }
.card h2 { font-size: 30px; font-weight: 700; margin-top: 8px; }
.hint { color: #4e5969; font-size: 14px; margin-top: 4px; }
.hint.gap { margin-top: 12px; }
.hint.muted { margin-top: 8px; color: #86909c; }
form { margin-top: 32px; }
form.tight { margin-top: 24px; }
.field { margin-bottom: 20px; }
.field label { display: block; font-size: 14px; color: #1d2129; margin-bottom: 8px; }
.field label::before { content: "*"; color: #f53f3f; margin-right: 4px; }
.input {
  display: flex; align-items: center; background: #f2f3f5; border: 1px solid transparent;
  border-radius: 4px; height: 40px; padding: 0 12px; transition: border-color .15s, background .15s;
}
.input:focus-within { background: #fff; border-color: #165dff; }
.input svg { flex: none; color: #86909c; }
.input input { flex: 1; border: 0; background: transparent; outline: none; font-size: 14px; padding: 0 10px; color: #1d2129; }
.input button { border: 0; background: none; cursor: pointer; color: #86909c; display: flex; }
.input button.text { font-size: 13px; color: #165dff; white-space: nowrap; }
.input button.text:disabled { color: #86909c; cursor: not-allowed; }
.captcha-img { flex: none; width: 96px; height: 32px; border-radius: 3px; cursor: pointer; background: #e8f3ff; }
.row { display: flex; justify-content: space-between; align-items: center; font-size: 14px; margin: 4px 0 22px; }
.row label { display: flex; align-items: center; gap: 8px; cursor: pointer; color: #1d2129; }
.row input { width: 15px; height: 15px; accent-color: #165dff; }
a { color: #165dff; text-decoration: none; cursor: pointer; }
.btn {
  width: 100%; height: 44px; border: 0; border-radius: 4px; font-size: 15px; cursor: pointer;
  background: #165dff; color: #fff; box-shadow: 0 6px 16px rgba(22,93,255,.25); transition: background .15s;
}
.btn:hover { background: #4080ff; }
.btn:disabled { background: #94bfff; cursor: not-allowed; box-shadow: none; }
.btn.spaced { margin-top: 28px; }
a.btn { display: flex; align-items: center; justify-content: center; }
.divider { display: flex; align-items: center; color: #86909c; font-size: 12px; margin: 22px 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: #e5e6eb; }
.divider span { padding: 0 14px; }
.idps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.idp {
  height: 42px; border: 1px solid #e5e6eb; background: #f7f8fa; border-radius: 4px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 13px; color: #1d2129;
  transition: border-color .15s, background .15s;
}
.idp:hover { border-color: #165dff; background: #fff; }
.dot { width: 18px; height: 18px; border-radius: 5px; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 11px; font-weight: 700; }
.dot-wecom { background: #2b7cf6; }
.dot-feishu { background: #00b8a9; }
.dot-oidc { background: #4e5969; }
.alert { display: none; background: #ffece8; color: #cb2634; border-radius: 4px; padding: 9px 12px; font-size: 13px; margin-bottom: 18px; }
.alert.show { display: block; }
.alert.info { background: #e8f3ff; color: #165dff; }
.ok-tag { background: #e8ffea; color: #00b42a; border-radius: 4px; padding: 10px 12px; font-size: 13px; margin-bottom: 18px; }
.back { display: inline-block; margin-top: 18px; font-size: 13px; }

/* 应用目录（门户）：顶部横幅 + 浮层面板，卡片 / 列表两种视图 */
body.portal { display: block; background: #f2f4f7; }
.hero { background: radial-gradient(ellipse at 30% 0%, #1c4f86 0%, #0f2a4d 50%, #0a1628 100%); color: #fff; padding: 22px 40px 96px; }
.hero-row { display: flex; align-items: center; gap: 12px; max-width: 1100px; margin: 0 auto; }
.hero .logo { width: 34px; height: 34px; border-radius: 9px; font-size: 12px; box-shadow: none; }
.hero .sub { color: #8ea3bf; font-size: 12px; }
.spacer { flex: 1; }
.hero h1 { max-width: 1100px; margin: 40px auto 0; font-size: 28px; font-weight: 600; }
.hero h1 small { display: block; font-size: 13px; color: #8ea3bf; font-weight: 400; margin-top: 8px; }
.btn.danger { width: auto; height: 32px; padding: 0 16px; font-size: 13px; background: #cb2634; box-shadow: 0 4px 12px rgba(203,38,52,.35); }
.btn.danger:hover { background: #b42129; }
.btn.danger:disabled { background: #fbaca3; box-shadow: none; }
.sheet { width: calc(100% - 48px); max-width: 1100px; margin: -64px auto 40px; background: #fff; border-radius: 12px; box-shadow: 0 8px 30px rgba(15,42,77,.12); padding: 24px 28px 28px; }
.sheet-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.sheet-head > span { font-size: 15px; font-weight: 600; }
.sheet-head em { font-style: normal; color: #6b7785; font-weight: 400; margin-left: 6px; }
.seg { display: inline-flex; background: #f2f3f5; border-radius: 6px; padding: 3px; }
.seg button { border: 0; background: none; height: 28px; padding: 0 12px; border-radius: 4px; font-size: 13px; color: #4e5969; cursor: pointer; display: flex; align-items: center; gap: 6px; font-family: inherit; }
.seg button.on { background: #fff; color: #165dff; box-shadow: 0 1px 3px rgba(0,0,0,.08); font-weight: 600; }
.app { display: flex; align-items: center; color: #1d2129; transition: background .15s; }
.app-icon { flex: none; color: #fff; font-weight: 700; display: flex; align-items: center; justify-content: center; transition: transform .15s, box-shadow .15s; }
.app-name { word-break: break-all; }
.app-host { color: #5c6773; font-size: 12px; word-break: break-all; }
.app-arrow { color: #c9cdd4; font-size: 18px; }
.c0 { background: linear-gradient(145deg,#4080ff,#165dff); } .c1 { background: linear-gradient(145deg,#2fc7b5,#0fa59a); }
.c2 { background: linear-gradient(145deg,#ffb340,#ff7a00); } .c3 { background: linear-gradient(145deg,#a07aff,#722ed1); }
.c4 { background: linear-gradient(145deg,#4fc3f7,#0e8ad6); } .c5 { background: linear-gradient(145deg,#ff7d9c,#e8336d); }
/* 卡片：图标直接放在面板上，不加卡片框 */
.apps.view-card { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 24px 12px; }
.apps.view-card .app { flex-direction: column; gap: 10px; padding: 12px 4px; border-radius: 12px; }
.apps.view-card .app:hover { background: #f7f8fa; }
.apps.view-card .app:hover .app-icon { transform: translateY(-2px); box-shadow: 0 10px 20px rgba(22,93,255,.18); }
.apps.view-card .app-icon { width: 60px; height: 60px; border-radius: 18px; font-size: 24px; box-shadow: 0 6px 16px rgba(0,0,0,.1); }
.apps.view-card .app-name { font-size: 13px; text-align: center; line-height: 1.4; }
.apps.view-card .app-host, .apps.view-card .app-arrow { display: none; }
/* 列表 */
.apps.view-list .app { gap: 14px; padding: 12px 8px; border-bottom: 1px solid #f2f3f5; }
.apps.view-list .app:last-child { border-bottom: 0; }
.apps.view-list .app:hover { background: #f7f9ff; }
.apps.view-list .app-icon { width: 34px; height: 34px; border-radius: 10px; font-size: 14px; }
.apps.view-list .app-name { flex: 1; font-size: 14px; font-weight: 500; }
.apps.view-list .app-host { max-width: 40%; text-align: right; }
.empty { color: #86909c; font-size: 14px; padding: 32px 0; text-align: center; }

@media (max-width: 820px) {
  body { flex-direction: column; }
  .brand { flex: none; padding: 20px 24px; flex-direction: row; align-items: center; gap: 12px; }
  .brand h1 { font-size: 20px; margin: 0; }
  .brand .sub, .slogan, .shield-wrap, .badges { display: none; }
  .logo { width: 40px; height: 40px; font-size: 14px; border-radius: 10px; }
  .panel { align-items: flex-start; padding-top: 32px; }
  .hero { padding: 16px 16px 76px; }
  .hero h1 { margin-top: 24px; font-size: 22px; }
  .sheet { width: calc(100% - 24px); margin: -56px auto 24px; padding: 18px 16px; }
  /* 窄屏列表：域名放到名称下方 */
  .apps.view-list .app { display: grid; grid-template-columns: 34px 1fr auto; column-gap: 12px; row-gap: 2px; }
  .apps.view-list .app-icon { grid-row: 1 / span 2; }
  .apps.view-list .app-name { grid-column: 2; }
  .apps.view-list .app-host { grid-column: 2; max-width: none; text-align: left; }
  .apps.view-list .app-arrow { grid-column: 3; grid-row: 1 / span 2; align-self: center; }
}
