:root {
  /* 超级浅色 · 小红书学习间 */
  --bg-body: #fff9fb;
  --bg-gradient-top: #ffeef4;
  --bg-gradient-mid: #fff9fb;
  --bg-gradient-bottom: #ffffff;

  --bg-shell: rgba(255, 255, 255, 0.9);
  --bg-card: #ffffff;
  --bg-soft: #fff7fb;

  --border-subtle: #f3e5ef;
  --border-strong: #f0d1dd;

  --text-main: #222222;
  --text-muted: #9b9b9b;

  --accent-red: #ff4b6a;     /* 小红书红 */
  --accent-red-soft: rgba(255, 75, 106, 0.08);
  --accent-pink: #ff91b3;
  --accent-yellow: #ffd38a;

  --primary: var(--accent-red);
  --primary-soft: rgba(255, 75, 106, 0.08);
  --primary-strong: #ff2d55;

  --danger: #ff5964;

  --radius-xl: 26px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-pill: 999px;

  --shadow-soft: 0 18px 50px rgba(0, 0, 0, 0.06);
  --shadow-small: 0 10px 28px rgba(0, 0, 0, 0.04);
}

* {
  box-sizing: border-box;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui,
    sans-serif;
  background:
    radial-gradient(circle at top left, rgba(255, 182, 193, 0.16), transparent 55%),
    radial-gradient(circle at top right, rgba(255, 203, 164, 0.16), transparent 55%),
    linear-gradient(to bottom, var(--bg-gradient-top), var(--bg-gradient-mid), var(--bg-gradient-bottom));
  color: var(--text-main);
  -webkit-font-smoothing: antialiased;
}

/* 基础 */

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  border: none;
  background: none;
}

/* 外壳 */

.home-shell {
  min-height: 100vh;
  padding: 18px 0 32px;
  display: flex;
  flex-direction: column;
}

/* 顶部栏 */

.home-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 22px;
  margin-bottom: 18px;
  backdrop-filter: blur(18px);
  background: rgba(255, 255, 255, 0.95);
  border-bottom: 1px solid rgba(244, 223, 232, 0.9);
}

.home-logo {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.logo-icon {
  font-size: 18px;
}

.logo-text {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.logo-sub {
  font-size: 12px;
  color: var(--text-muted);
}

.home-header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.home-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  background: #fff9fb;
  border: 1px solid rgba(244, 208, 222, 0.9);
  box-shadow: var(--shadow-small);
  font-size: 13px;
  color: var(--text-muted);
}

.coin-badge {
  padding: 5px 10px;
  border-radius: var(--radius-pill);
  background: var(--accent-red-soft);
  font-size: 12px;
  color: var(--primary);
}

/* 顶部头像 */

.header-profile {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 9px;
  border-radius: var(--radius-pill);
  background: #ffffff;
  border: 1px solid rgba(244, 208, 222, 0.9);
  box-shadow: var(--shadow-small);
  cursor: pointer;
  transition: transform 0.08s ease, box-shadow 0.08s ease,
    border-color 0.08s ease, background 0.08s ease;
}

.header-profile:hover {
  transform: translateY(-1px);
  border-color: var(--primary);
  box-shadow: 0 14px 36px rgba(255, 91, 132, 0.25);
  background: #fff5f8;
}

.header-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 20%, #ffe4f1, #ff91b3);
  object-fit: cover;
}

.header-name {
  font-size: 13px;
}

/* 主体布局 */

.home-main {
  max-width: 1120px;
  width: 100%;
  margin: 0 auto;
  padding: 18px 18px 22px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(244, 223, 232, 0.9);
  box-shadow: var(--shadow-soft);
  display: grid;
  grid-template-columns: 260px minmax(0, 1.5fr) 280px;
  gap: 18px;
}

.home-left,
.home-center,
.home-right {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* 统一卡片样式 */

.left-card,
.center-panel,
.right-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 14px 16px 16px;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.03);
  border: 1px solid var(--border-subtle);
}

.card-title {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #333333;
  margin-bottom: 8px;
}

/* 按钮 */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  font-size: 13px;
  cursor: pointer;
  background: #f7f2f5;
  color: var(--text-main);
  transition: transform 0.08s ease, box-shadow 0.08s ease,
    background 0.08s ease, border-color 0.08s ease, opacity 0.08s ease;
}

.btn.small {
  padding: 5px 12px;
  font-size: 12px;
}

.btn.tiny {
  padding: 3px 10px;
  font-size: 11px;
}

.btn.primary {
  background: linear-gradient(135deg, #ff8fad, #ff4b6a);
  color: #ffffff;
  border-color: rgba(255, 75, 106, 0.6);
  box-shadow: 0 14px 30px rgba(255, 75, 106, 0.4);
}

.btn.ghost {
  background: #ffffff;
  border-color: rgba(244, 208, 222, 0.9);
}

.btn.full {
  width: 100%;
}

.btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.08);
  background: #fff5f8;
  border-color: rgba(255, 144, 173, 0.7);
}

.btn.primary:hover:not(:disabled) {
  box-shadow: 0 18px 36px rgba(255, 75, 106, 0.5);
}

.btn:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
}

.btn:disabled {
  opacity: 0.55;
  cursor: default;
}

/* 输入控件 */

.input,
.textarea,
select {
  width: 100%;
  padding: 7px 10px;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  font-size: 13px;
  font-family: inherit;
  outline: none;
  background: #fff9fb;
  color: var(--text-main);
}

.input::placeholder,
.textarea::placeholder {
  color: rgba(155, 155, 155, 0.9);
}

.input:focus,
.textarea:focus,
select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px rgba(255, 75, 106, 0.3);
  background: #ffffff;
}

.textarea {
  resize: vertical;
}

/* 左侧：学习计划 */

.checklist {
  list-style: none;
  margin: 0;
  padding: 0;
  min-height: 40px;
}

.check-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px dashed #f1d7e2;
}

.check-item:last-child {
  border-bottom: none;
}

.check-item label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
}

.check-text.done {
  text-decoration: line-through;
  color: var(--text-muted);
}

.check-empty {
  font-size: 12px;
  color: var(--text-muted);
  padding: 6px 0;
}

.plan-input-row {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

/* 左侧：好友 */

.friends-list {
  list-style: none;
  margin: 4px 0 0;
  padding: 0;
  max-height: 220px;
  overflow: auto;
}

.friends-list li {
  padding: 6px 0;
  border-bottom: 1px dashed #f1d7e2;
}

.friends-list li:last-child {
  border-bottom: none;
}

.friend-main {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
}

.friend-sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  border: 1px solid #ffffff;
}

.dot.online {
  background: #5bd18b;
}

.dot.offline {
  background: #d4d4d4;
}

.friend-input-row {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

/* 左侧：本周进度 */

.week-progress {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.week-progress-label {
  font-size: 13px;
}

.week-progress-bar {
  width: 100%;
  height: 7px;
  border-radius: 999px;
  background: #f5e4ee;
  overflow: hidden;
}

.week-progress-fill {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #ff8fad, #ff4b6a, #ffd38a);
  transition: width 0.2s ease;
}

.week-extra-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
}

.week-time {
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-muted);
}

/* 中间：大按钮 */

.big-btn-group {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.big-btn {
  border-radius: 18px;
  border: 1px solid #f3dde6;
  padding: 10px 10px;
  background: #fff7fb;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.04);
  transition: transform 0.08s ease, box-shadow 0.08s ease,
    border-color 0.08s ease, background 0.08s ease;
}

.big-btn.ghost {
  background: #ffffff;
}

.big-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.06);
  border-color: rgba(255, 144, 173, 0.7);
  background: #fff2f7;
}

/* 当前房间 / 房间列表 */

.center-title {
  font-size: 14px;
  font-weight: 600;
  margin: 2px 0 8px;
}

.current-room-placeholder {
  padding: 9px 11px;
  border-radius: 12px;
  background: #fff7fb;
  border: 1px dashed #f1d7e2;
  font-size: 13px;
  color: var(--text-muted);
}

.form-group {
  margin-bottom: 10px;
  font-size: 13px;
}

.form-group label {
  display: block;
  margin-bottom: 4px;
}

/* 房间列表 */

.room-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}

.room-item {
  padding: 8px 10px;
  border-radius: 14px;
  background: #fffdfd;
  border: 1px solid #f3dde6;
  cursor: pointer;
  font-size: 13px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: border-color 0.08s ease, box-shadow 0.08s ease,
    transform 0.08s ease, background 0.08s ease;
}

.room-item:hover {
  border-color: var(--primary);
  background: #fff5f8;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.06);
  transform: translateY(-1px);
}

.room-info-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.room-name {
  font-weight: 600;
}

.room-tagline {
  font-size: 11px;
  color: var(--text-muted);
}

.room-meta {
  font-size: 11px;
  color: var(--text-muted);
}

/* 右侧：个人资料 */

.right-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 13px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, #fff9fb, #ffeef5);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.04);
  border: 1px solid #f3dde6;
  cursor: pointer;
  transition: transform 0.08s ease, box-shadow 0.08s ease,
    border-color 0.08s ease;
}

.right-profile:hover {
  transform: translateY(-1px);
  border-color: var(--primary);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.06);
}

.profile-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 20%, #ffe0ef, #ff91b3);
  object-fit: cover;
}

.profile-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.profile-name {
  font-size: 15px;
  font-weight: 600;
}

.profile-sub {
  font-size: 12px;
  color: var(--text-muted);
}

.profile-mini {
  margin-top: 2px;
  font-size: 11px;
  color: var(--text-muted);
}

/* 排行榜 */

.ranking-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.ranking-tabs {
  display: inline-flex;
  padding: 3px;
  border-radius: 999px;
  background: #fff7fb;
  border: 1px solid #f3dde6;
}

.rank-tab {
  padding: 4px 10px;
  border-radius: 999px;
  background: transparent;
  font-size: 11px;
  cursor: pointer;
  color: var(--text-muted);
}

.rank-tab.active {
  background: #ffffff;
  color: var(--primary);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.05);
}

.ranking-list {
  margin: 8px 0 0;
  padding-left: 18px;
  font-size: 13px;
  color: var(--text-muted);
}

.hidden {
  display: none !important;
}

/* 登录遮罩 */

.login-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255, 245, 249, 0.8);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.login-card {
  width: 360px;
  max-width: calc(100% - 32px);
  background: #ffffff;
  border-radius: 22px;
  padding: 20px 20px 18px;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.12);
  border: 1px solid #f3dde6;
}

.login-card h2 {
  margin: 0 0 6px;
  font-size: 18px;
}

.login-tip {
  margin: 0 0 12px;
  font-size: 12px;
  color: var(--text-muted);
}

/* 响应式 */

@media (max-width: 1180px) {
  .home-main {
    border-radius: 0;
    max-width: 100%;
  }
}

@media (max-width: 1024px) {
  .home-main {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .home-header {
    padding-inline: 14px;
    padding-block: 10px;
    align-items: flex-start;
  }

  .home-main {
    padding-inline: 12px;
    padding-block: 16px 20px;
  }

  .left-card,
  .center-panel,
  .right-card {
    padding-inline: 12px;
  }

  .home-banner {
    display: none;
  }
}

/* ============ Account Drawer (Google vibe + 小红书粉) ============ */

/* overlay 基础：确保能覆盖全屏并居中/右侧都能用 */
.login-overlay{
  position: fixed;
  inset: 0;
  display: none;            /* JS 打开时改为 flex */
  align-items: center;
  justify-content: center;
  background: rgba(255, 192, 203, 0.18);
  backdrop-filter: blur(6px);
  z-index: 9999;
}

/* 抽屉容器：右侧布局 */
.account-drawer-wrap{
  position: absolute;
  inset: 0;
  display: flex;
  justify-content: flex-end;
  align-items: stretch;
  pointer-events: none; /* 让内部抽屉接管 */
}

/* 抽屉本体 */
.account-drawer{
  width: min(420px, 92vw);
  height: 100%;
  background: rgba(255,255,255,0.92);
  border-left: 1px solid rgba(255, 170, 190, 0.35);
  box-shadow: -18px 0 50px rgba(255, 120, 160, 0.18);
  padding: 18px 16px;
  pointer-events: auto;
  transform: translateX(100%);
  transition: transform .22s ease;
}

/* 打开时滑入 */
.login-overlay.drawer-open .account-drawer{
  transform: translateX(0);
}

/* 抽屉顶部 */
.drawer-top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}

.drawer-title-main{
  font-size: 16px;
  font-weight: 700;
  color: #2a2a2a;
}
.drawer-title-sub{
  margin-top: 2px;
  font-size: 12px;
  color: rgba(0,0,0,0.55);
}

/* 头像区：Google 风的圆形头像 + 轻边框 */
.drawer-user{
  display:flex;
  align-items:center;
  gap:12px;
  padding: 12px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255, 225, 235, 0.65), rgba(255,255,255,0.9));
  border: 1px solid rgba(255, 170, 190, 0.35);
  margin: 12px 0;
}

.drawer-avatar{
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #ffe3ec;
  border: 2px solid rgba(255, 120, 160, 0.28);
  box-shadow: 0 10px 22px rgba(255, 120, 160, 0.12);
  background-size: cover;
  background-position: center;
}

.drawer-hello{
  font-weight: 700;
  font-size: 14px;
}
.drawer-idline{
  font-size: 12px;
  color: rgba(0,0,0,0.6);
  margin-top: 2px;
}

/* authPanel（未登录弹窗）缩小一点更像 QQ 小窗 */
#authPanel .form-group{ margin-top: 10px; }
#authPanel .btn.full{ border-radius: 999px; }