*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #eef2f8;
  background: #0a0f16;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* 背景图 + 渐变遮罩 */
.bg-layer {
  position: fixed;
  inset: 0;
  background-image: url("bg.jpg");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  z-index: -2;
}

.bg-layer::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
      180deg,
      rgba(8, 12, 20, 0.55) 0%,
      rgba(8, 12, 20, 0.35) 40%,
      rgba(8, 12, 20, 0.78) 100%
    ),
    radial-gradient(ellipse at center, rgba(8, 12, 20, 0) 30%, rgba(8, 12, 20, 0.55) 100%);
}

.wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1.5rem 2rem;
  gap: 2.75rem;
}

/* 头部 */
.hero {
  text-align: center;
  animation: fadeUp 0.7s ease both;
}

.title {
  margin: 0;
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.45);
}

.subtitle {
  margin: 0.5rem 0 0;
  font-size: clamp(1rem, 2.2vw, 1.35rem);
  font-weight: 300;
  letter-spacing: 0.5em;
  text-indent: 0.5em;
  color: #c8d4e4;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.4);
}

.desc {
  margin: 1rem 0 0;
  font-size: 0.85rem;
  letter-spacing: 0.15em;
  color: #8b98a8;
}

/* 用户行 */
.user-line {
  margin: 0.8rem 0 0;
  font-size: 0.85rem;
  color: #c8d4e4;
  letter-spacing: 0.04em;
}

.user-line strong {
  color: #f1f5fb;
  font-weight: 600;
}

.link-btn {
  margin-left: 0.5rem;
  padding: 0.15rem 0.6rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  color: #c8d4e4;
  font-size: 0.78rem;
  cursor: pointer;
  transition: background 0.18s, color 0.18s;
}

.link-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #f1f5fb;
}

/* 登录面板 */
.login-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
  padding: 2rem 2rem 2.2rem;
  width: 100%;
  max-width: 22rem;
  background: rgba(18, 24, 34, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  animation: fadeUp 0.6s ease 0.1s both;
}

.login-input {
  width: 100%;
  padding: 0.7rem 0.85rem;
  background: rgba(8, 12, 20, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  color: #f1f5fb;
  font-size: 1rem;
  text-align: center;
  letter-spacing: 0.1em;
  outline: none;
  transition: border-color 0.18s, background 0.18s;
}

.login-input::placeholder {
  color: #6c7a8a;
  letter-spacing: 0.05em;
}

.login-input:focus {
  border-color: #3b82f6;
  background: rgba(8, 12, 20, 0.75);
}

.login-btn {
  width: 100%;
  padding: 0.7rem 1rem;
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  border: none;
  border-radius: 10px;
  color: #fff;
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.18s, opacity 0.18s;
}

.login-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(59, 130, 246, 0.35);
}

.login-btn:active:not(:disabled) { transform: translateY(0); }
.login-btn:disabled { opacity: 0.6; cursor: not-allowed; }

.login-err {
  margin: 0;
  padding: 0.55rem 0.8rem;
  width: 100%;
  background: rgba(248, 81, 73, 0.12);
  border: 1px solid rgba(248, 81, 73, 0.4);
  border-radius: 8px;
  color: #ffa198;
  font-size: 0.82rem;
  text-align: center;
}

/* 空权限提示 */
.empty-hint {
  width: 100%;
  max-width: 30rem;
  padding: 2rem;
  text-align: center;
  background: rgba(18, 24, 34, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  backdrop-filter: blur(10px);
  animation: fadeUp 0.6s ease 0.15s both;
}

.empty-hint p {
  margin: 0;
  color: #93a4b8;
  font-size: 0.88rem;
  line-height: 1.6;
}

/* 卡片区 */
.cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 22rem));
  gap: 1.5rem;
  width: 100%;
  max-width: 60rem;
  animation: fadeUp 0.7s ease 0.15s both;
}

.card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 1.1rem;
  padding: 1.5rem 1.5rem;
  min-height: 7.5rem;
  text-decoration: none;
  color: inherit;
  background: rgba(18, 24, 34, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: transform 0.22s ease, border-color 0.22s ease, background 0.22s ease, box-shadow 0.22s ease;
  overflow: hidden;
}

.card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, #3b82f6, #38bdf8);
  opacity: 0;
  transition: opacity 0.22s ease;
}

.card:hover,
.card:focus-visible {
  transform: translateY(-4px);
  background: rgba(24, 32, 46, 0.72);
  border-color: rgba(59, 130, 246, 0.55);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.4);
  outline: none;
}

.card:hover::before,
.card:focus-visible::before {
  opacity: 1;
}

.card-icon {
  flex: 0 0 auto;
  width: 3.4rem;
  height: 3.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.25), rgba(56, 189, 248, 0.18));
  color: #93c5fd;
  border: 1px solid rgba(147, 197, 253, 0.25);
}

.card-body {
  flex: 1;
  min-width: 0;
}

.card-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 600;
  color: #f1f5fb;
}

.card-sub {
  margin: 0.2rem 0 0;
  font-size: 0.8rem;
  color: #7fb0ec;
  letter-spacing: 0.08em;
}

.card-desc {
  margin: 0.4rem 0 0;
  font-size: 0.8rem;
  color: #93a4b8;
  line-height: 1.4;
}

.card-arrow {
  flex: 0 0 auto;
  font-size: 1.3rem;
  color: #5c6b7d;
  transition: transform 0.22s ease, color 0.22s ease;
}

.card:hover .card-arrow,
.card:focus-visible .card-arrow {
  color: #93c5fd;
  transform: translateX(4px);
}

/* 页脚 */
.footer {
  padding: 1.5rem 1rem 2rem;
  text-align: center;
  font-size: 0.78rem;
  color: rgba(180, 192, 208, 0.6);
}

.footer a {
  color: rgba(180, 192, 208, 0.6);
  text-decoration: none;
}

.footer a:hover {
  color: rgba(220, 230, 242, 0.9);
  text-decoration: underline;
}

/* 响应式 */
@media (max-width: 640px) {
  .cards {
    grid-template-columns: 1fr;
    max-width: 22rem;
  }
  .wrap {
    gap: 2rem;
    padding-top: 2.5rem;
  }
  .subtitle {
    letter-spacing: 0.3em;
  }
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
