/* 乐瞳学习生活 · 门户样式（登录 + 双通道） */
:root {
  --ink: #3a4240;
  --ink-soft: #6b7570;
  --primary: #5f8f7c;
  --primary-dark: #3f6b5a;
  --accent: #e9b86d;
  --accent-light: #fdf3df;
  --panel: rgba(255,255,255,.92);
  --shadow: 0 20px 60px rgba(30,50,45,.35);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: "PingFang SC","Microsoft YaHei","Segoe UI",system-ui,sans-serif;
  color: var(--ink); overflow: hidden; position: relative;
}

/* 全屏模糊背景 */
.portal-bg {
  position: fixed; inset: 0; z-index: -2;
  background-image: url('/static/img/login-bg.jpg');
  background-size: cover; background-position: center;
  filter: blur(8px) saturate(1.05);
  transform: scale(1.06);
}
.portal-bg::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(160deg, rgba(60,90,80,.35), rgba(40,60,100,.45));
}

.portal-wrap {
  height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 30px 24px; overflow-y: auto;
}

.portal-card {
  width: min(440px, 100%); background: var(--panel); backdrop-filter: blur(6px);
  border-radius: 26px; box-shadow: var(--shadow); padding: 30px 28px;
  text-align: center; margin: auto;                       /* margin:auto：内容超高时顶部不会被裁 */
  animation: pop .4s cubic-bezier(.2,1.2,.4,1);
  transition: width .25s ease;
}
/* 登录后展示多个功能卡片时，外层卡片自动加宽（三张卡片并排也不挤） */
.portal-card.wide { width: min(820px, 100%); }
@keyframes pop { from { transform: translateY(14px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.portal-logo {
  width: 64px; height: 64px; border-radius: 18px; margin: 0 auto 14px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: grid; place-items: center; font-size: 34px; color: #fff;
  box-shadow: 0 8px 20px rgba(95,143,124,.35);
}
.portal-title { font-size: 28px; font-weight: 800; color: var(--primary-dark); letter-spacing: 1px; }
.portal-sub { font-size: 14px; color: var(--ink-soft); margin-top: 6px; margin-bottom: 22px; }

.field { text-align: left; margin-bottom: 16px; }
.field label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 6px; color: var(--ink); }
.field input {
  width: 100%; padding: 13px 15px; border: 1.5px solid #dfe5e0; border-radius: 12px;
  font-size: 15px; font-family: inherit; background: #fbfdfb; color: var(--ink);
  transition: border-color .2s, background .2s;
}
.field input:focus { outline: none; border-color: var(--primary); background: #fff; }

.portal-error { color: #e0876b; font-size: 13px; min-height: 18px; margin: 4px 0 8px; }

.portal-btn {
  width: 100%; padding: 14px; border: none; border-radius: 14px; cursor: pointer;
  font-size: 16px; font-weight: 800; color: #fff; font-family: inherit;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  box-shadow: 0 10px 22px rgba(95,143,124,.4);
  transition: transform .15s, box-shadow .2s;
}
.portal-btn:hover { transform: translateY(-2px); }
.portal-btn:active { transform: scale(.97); }
.portal-btn.ghost {
  margin-top: 14px; background: transparent; color: var(--ink-soft);
  border: 1.5px solid #dfe5e0; box-shadow: none; font-size: 14px; font-weight: 600;
}
.portal-btn.ghost:hover { background: #f2f6f2; }

/* 已登录：用户信息 + 功能卡片（等宽并排，按可用宽度自动 1/2/3 列） */
.portal-user {
  font-size: 15px; font-weight: 700; color: var(--primary-dark);
  background: var(--accent-light); border-radius: 12px; padding: 11px 14px; margin-bottom: 16px;
}
.channels {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(168px, 1fr));
  align-items: stretch;
}
.channel-card {
  cursor: pointer; border: 1.5px solid #e5e9e4; border-radius: 18px; padding: 20px 14px 18px;
  background: #fff; transition: transform .16s, box-shadow .2s, border-color .2s;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
  height: 100%; text-align: center;
}
.channel-card:hover { transform: translateY(-4px); box-shadow: 0 14px 28px rgba(80,110,95,.18); border-color: var(--primary); }
.ch-icon { font-size: 40px; line-height: 1.1; }
.ch-title { font-size: 17px; font-weight: 800; color: var(--primary-dark); margin-top: 10px; }
.ch-desc { font-size: 12px; color: var(--ink-soft); margin-top: 6px; line-height: 1.5; }

/* 矮屏（笔记本半屏 / 手机横屏）：整体收紧，避免卡片顶到屏幕上下边缘 */
@media (max-height: 700px) {
  .portal-wrap { padding: 20px 18px; }
  .portal-card { padding: 22px 22px; border-radius: 22px; }
  .portal-logo { width: 52px; height: 52px; font-size: 27px; border-radius: 15px; margin-bottom: 10px; }
  .portal-title { font-size: 23px; }
  .portal-sub { margin-bottom: 16px; }
  .portal-user { padding: 9px 12px; margin-bottom: 12px; }
  .channel-card { padding: 15px 12px 14px; }
  .ch-icon { font-size: 32px; }
  .ch-title { font-size: 16px; margin-top: 7px; }
  .ch-desc { font-size: 11.5px; margin-top: 4px; }
  .portal-btn.ghost { margin-top: 11px; padding: 11px; }
}

@media (max-width: 560px) {
  .portal-wrap { padding: 22px 16px; }
  .portal-card { padding: 24px 18px; }
  .portal-title { font-size: 24px; }
  .channels { grid-template-columns: 1fr; }
  /* 手机端：图标在左占两行，标题与描述在右侧上下排列，标题不折行 */
  .channel-card {
    display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto;
    column-gap: 14px; row-gap: 3px; align-items: center; text-align: left;
    padding: 14px 16px;
  }
  .channel-card .ch-icon { grid-row: 1 / span 2; font-size: 30px; }
  .channel-card .ch-title { grid-column: 2; margin-top: 0; font-size: 16px; white-space: nowrap; }
  .channel-card .ch-desc { grid-column: 2; margin-top: 0; }
}
