/* =================== 云版扩展样式:登录页 + 顶部用户条 =================== */

.cw-login {
  position: fixed; inset: 0;
  background: linear-gradient(135deg, #0a0e1a 0%, #1a1f2e 50%, #0a0e1a 100%);
  display: flex; align-items: center; justify-content: center;
  z-index: 9999;
  padding: 24px;
  overflow: auto;
}
.cw-login-card {
  width: 100%; max-width: 820px;
  background: rgba(20, 24, 36, 0.92);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  padding: 32px 36px 28px;
  color: #e8eaf0;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  backdrop-filter: blur(12px);
}
.cw-login-head { display: flex; align-items: center; gap: 16px; margin-bottom: 22px; }
.cw-login-brand {
  width: 44px; height: 44px; border-radius: 10px;
  background: linear-gradient(135deg, #06b6d4, #1f6feb);
  position: relative;
}
.cw-login-brand::after {
  content: ''; position: absolute; right: 6px; bottom: 6px;
  width: 8px; height: 8px; border-radius: 50%; background: #fff;
}
.cw-login-head h1 { font-size: 22px; margin: 0 0 4px; font-weight: 600; }
.cw-login-head p  { margin: 0; font-size: 13px; color: #8a92a6; }

/* —— 每日激励 slogan(鎏金匾额风) —— */
.cw-slogan-hero {
  position: relative;
  margin: -32px -36px 28px;
  padding: 56px 28px 38px;
  text-align: center;
  overflow: hidden;
  background:
    radial-gradient(ellipse 70% 50% at center 40%, rgba(255,215,150,0.10) 0%, transparent 70%),
    radial-gradient(ellipse 80% 60% at center 60%, rgba(20,40,75,0.6) 0%, rgba(10,18,38,0.9) 70%),
    linear-gradient(180deg, #0d1a35 0%, #0a1428 100%);
  border-top: 1px solid rgba(255,215,150,0.28);
  border-bottom: 1px solid rgba(255,215,150,0.28);
}

/* 主标题 — 鎏金 */
.cw-slogan-text {
  font-family: 'Noto Serif SC', 'Songti SC', 'SimSun', Georgia, serif;
  font-size: 56px;
  font-weight: 900;
  line-height: 1.25;
  letter-spacing: 0.08em;
  background: linear-gradient(180deg,
    #fff5d0 0%,
    #f4d989 22%,
    #d4a64a 45%,
    #b8862e 60%,
    #d4a64a 78%,
    #fff5d0 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 0 rgba(0,0,0,0.55))
          drop-shadow(0 6px 18px rgba(212,166,74,0.4));
  text-shadow: 0 0 1px rgba(255,235,180,0.4);
}

/* 英文副标 — 衬线斜体 */
.cw-slogan-en {
  margin-top: 22px;
  font-family: 'EB Garamond', Georgia, 'Times New Roman', serif;
  font-style: italic;
  font-size: 22px;
  line-height: 1.55;
  color: rgba(244,217,137,0.9);
  letter-spacing: 0.02em;
}
.cw-slogan-en em { font-style: italic; }

/* 分隔横线带菱形 */
.cw-slogan-rule {
  margin: 22px auto 12px;
  width: 60%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(212,166,74,0.55) 30%, rgba(212,166,74,0.55) 70%, transparent);
  position: relative;
}
.cw-slogan-rule::before {
  content: '◆';
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  font-size: 8px;
  color: #d4a64a;
  background: #0a1428;
  padding: 0 8px;
  line-height: 1;
}

/* 出处行 — 全大写 + 大字距 */
.cw-slogan-attr {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 12px;
  letter-spacing: 0.4em;
  color: rgba(244,217,137,0.78);
  text-indent: 0.4em;
  margin-bottom: 8px;
}

/* 引用原话 */
.cw-slogan-quote {
  font-family: Georgia, 'Times New Roman', serif;
  font-style: italic;
  font-size: 14px;
  color: rgba(244,217,137,0.55);
  letter-spacing: 0.01em;
}

@media (max-width: 720px) {
  .cw-slogan-hero { margin: -28px -20px 22px; padding: 44px 16px 32px; }
  .cw-slogan-text { font-size: 36px; letter-spacing: 0.05em; }
  .cw-slogan-en   { font-size: 16px; margin-top: 16px; }
  .cw-slogan-attr { font-size: 10.5px; letter-spacing: 0.3em; }
  .cw-slogan-quote{ font-size: 12px; }
}
@media (max-width: 420px) {
  .cw-slogan-text { font-size: 28px; }
  .cw-slogan-en   { font-size: 14px; }
}

.cw-login-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 10px;
  margin-bottom: 22px;
}
.cw-pick {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 12px 6px;
  background: rgba(255,255,255,0.03);
  border: 1.5px solid rgba(255,255,255,0.06);
  border-radius: 10px;
  color: #d8dce5;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}
.cw-pick:hover { background: rgba(6,182,212,0.08); border-color: rgba(6,182,212,0.3); }
.cw-pick.on   { background: rgba(6,182,212,0.16); border-color: #06b6d4; box-shadow: 0 0 0 2px rgba(6,182,212,0.2); }
.cw-pick-av {
  width: 40px; height: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600; color: #fff;
  font-family: 'JetBrains Mono', monospace;
}
.cw-pick-name { font-size: 13px; }

.cw-login-form { display: flex; gap: 10px; }
.cw-pwd {
  flex: 1;
  padding: 12px 14px;
  background: rgba(255,255,255,0.04);
  border: 1.5px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  color: #e8eaf0;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s;
}
.cw-pwd:focus { border-color: #06b6d4; }
.cw-pwd::placeholder { color: #5a6275; }
.cw-submit {
  padding: 12px 24px;
  background: #06b6d4;
  border: none;
  border-radius: 8px;
  color: #0a0e1a;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
  font-family: inherit;
}
.cw-submit:hover:not(:disabled) { background: #22c4dc; }
.cw-submit:disabled { opacity: 0.5; cursor: not-allowed; }

.cw-err {
  margin-top: 14px;
  padding: 10px 14px;
  background: rgba(220,60,60,0.12);
  border: 1px solid rgba(220,60,60,0.3);
  border-radius: 6px;
  color: #ff8a8a;
  font-size: 13px;
}
.cw-foot {
  margin-top: 14px;
  font-size: 12px; color: #6c7488;
  text-align: center;
}
.cw-foot b { color: #c8d0e0; }
.cw-clear { cursor: pointer; color: #06b6d4; }
.cw-clear:hover { text-decoration: underline; }

/* ---- 加载页 ---- */
.cw-loading {
  position: fixed; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 16px;
  background: #0a0e1a; color: #8a92a6;
  z-index: 9999;
  font-size: 14px;
}
.cw-spin {
  width: 32px; height: 32px;
  border: 3px solid rgba(6,182,212,0.15);
  border-top-color: #06b6d4;
  border-radius: 50%;
  animation: cw-spin 0.8s linear infinite;
}
@keyframes cw-spin { to { transform: rotate(360deg); } }

/* ---- 错误页 ---- */
.cw-err-screen {
  position: fixed; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px;
  background: #0a0e1a; color: #e8eaf0;
  z-index: 9999;
  padding: 24px;
  text-align: center;
}
.cw-err-screen pre {
  max-width: 600px; padding: 12px 16px;
  background: rgba(220,60,60,0.12);
  border: 1px solid rgba(220,60,60,0.3);
  border-radius: 6px;
  color: #ff8a8a;
  font-size: 12px;
  white-space: pre-wrap;
}
.cw-err-screen button {
  padding: 8px 18px; margin: 0 4px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 6px;
  color: #e8eaf0;
  cursor: pointer;
  font-family: inherit;
}

/* ---- 顶部用户条 ---- */
.cw-userbar {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 20px;
  background: rgba(6,182,212,0.06);
  border-bottom: 1px solid rgba(6,182,212,0.15);
  font-size: 12px;
  color: #6c7488;
}
[data-theme="dark"] .cw-userbar { background: rgba(6,182,212,0.08); border-bottom-color: rgba(6,182,212,0.2); color: #8a92a6; }
.cw-userbar b { color: var(--text, #1a1f2e); }
[data-theme="dark"] .cw-userbar b { color: #e8eaf0; }
.cw-userbar-dot { width: 6px; height: 6px; border-radius: 50%; background: #06b6d4; }
.cw-userbar-sp  { color: #c0c4d0; }

/* @提及 未读徽章 + 悬浮预览 */
.cw-mention-badge {
  position: relative;
  padding: 3px 10px;
  background: rgba(245,158,11,0.18);
  color: #b8741b;
  border: 1px solid rgba(245,158,11,0.35);
  border-radius: 12px;
  cursor: pointer;
  font-size: 12px;
  font-family: inherit;
  font-weight: 500;
  animation: cwMentionPulse 2s ease-in-out infinite;
}
[data-theme="dark"] .cw-mention-badge { background: rgba(245,158,11,0.18); color: #f5b942; border-color: rgba(245,158,11,0.4); }
.cw-mention-badge:hover { background: rgba(245,158,11,0.30); animation: none; }
@keyframes cwMentionPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(245,158,11,0.4); }
  50%      { box-shadow: 0 0 0 6px rgba(245,158,11,0); }
}
.cw-mention-tip {
  display: none;
  position: absolute;
  top: 100%; left: 0;
  margin-top: 6px;
  min-width: 360px; max-width: 460px;
  padding: 10px 12px;
  background: var(--bg, #fff);
  border: 1px solid var(--border, #e0e3e8);
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  color: var(--text, #1a1f2e);
  font-size: 12px; font-weight: 400; text-align: left;
  z-index: 10000;
  flex-direction: column; gap: 4px;
}
[data-theme="dark"] .cw-mention-tip {
  background: #1a1f2e;
  border-color: rgba(255,255,255,0.12);
  color: #e8eaf0;
  box-shadow: 0 8px 24px rgba(0,0,0,0.6);
}
.cw-mention-badge:hover .cw-mention-tip { display: flex; }
.cw-mention-tip-row { padding: 4px 0; border-bottom: 1px dashed rgba(0,0,0,0.06); line-height: 1.5; }
.cw-mention-tip-row:last-of-type { border-bottom: none; }
.cw-mention-tip-row b { color: var(--text, #1a1f2e); }
[data-theme="dark"] .cw-mention-tip-row b { color: #fff; }
.cw-mention-tip-more { font-size: 11px; color: var(--text-mute, #9094a0); padding-top: 4px; }
.cw-mention-tip-foot { font-size: 10.5px; color: #b8741b; padding-top: 4px; border-top: 1px solid rgba(0,0,0,0.04); }
[data-theme="dark"] .cw-mention-tip-foot { color: #f5b942; border-top-color: rgba(255,255,255,0.06); }

/* =============================================================
   云版手机端优化
   ============================================================= */
@media (max-width: 720px) {
  /* 用户条 */
  .cw-userbar { padding: 6px 10px; gap: 8px; font-size: 11.5px; flex-wrap: wrap; }
  .cw-mention-badge { font-size: 11.5px; padding: 3px 8px; }
  .cw-mention-tip {
    left: auto; right: 0;
    min-width: 280px;
    max-width: calc(100vw - 24px);
  }
  .cw-logout { font-size: 11.5px; padding: 3px 8px; }
}

@media (max-width: 480px) {
  /* 登录页紧凑 */
  .cw-login { padding: 12px; }
  .cw-login-card { padding: 22px 14px; border-radius: 16px; }
  .cw-login-head h1 { font-size: 18px; }
  .cw-login-head p  { font-size: 11.5px; }
  .cw-login-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 6px; margin-bottom: 16px;
  }
  .cw-pick { padding: 8px 4px; gap: 5px; }
  .cw-pick-av { width: 34px; height: 34px; font-size: 11px; }
  .cw-pick-name { font-size: 11.5px; }
  .cw-login-form { flex-direction: column; gap: 8px; }
  .cw-pwd, .cw-submit { width: 100%; padding: 11px 14px; font-size: 14px; }

  /* 新建任务浮动按钮:窄屏只剩 + 号 */
  .cw-fab { right: 14px; bottom: 14px; padding: 10px 14px; }
  .cw-fab-lbl { display: none; }
  .cw-fab > span:first-child { font-size: 24px; }

  /* 新建任务弹窗:满屏抽屉 */
  .cw-new-modal { max-width: 100%; }
  .cw-new-row { flex-direction: column; gap: 12px; }
  .cw-half { flex: none; width: 100%; }
}
.cw-logout {
  margin-left: auto;
  padding: 4px 10px;
  background: transparent;
  border: 1px solid rgba(6,182,212,0.4);
  color: #06b6d4;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  font-family: inherit;
}
.cw-logout:hover { background: rgba(6,182,212,0.1); }
