/* ==========================================================
   O鲸鲸 官网 · base.css
   变量 / 重置 / 导航 / 页脚 / 登录弹窗 / 轻提示 / 通用卡片
   ========================================================== */

:root {
  --c-bg: #0a1228;
  --c-bg-2: #0d1a33;
  --c-card: rgba(255, 255, 255, .06);
  --c-card-line: rgba(255, 255, 255, .10);
  --c-primary: #4a90e2;
  --c-primary-2: #357abd;
  --c-text: #ffffff;
  --c-dim: rgba(255, 255, 255, .62);
  --c-dim-2: rgba(255, 255, 255, .42);
  --glass-bg: rgba(255, 255, 255, .08);
  --glass-line: rgba(255, 255, 255, .16);
  --radius: 16px;
  --radius-s: 10px;
  --nav-h: 56px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "HarmonyOS Sans SC", "MiSans", "Microsoft YaHei", "Segoe UI", sans-serif;
  background: var(--c-bg);
  color: var(--c-text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
img { border: 0; display: block; }
button { font-family: inherit; cursor: pointer; }

::selection { background: rgba(74, 144, 226, .45); }

/* 滚动条（桌面） */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,.14); border-radius: 4px; }
::-webkit-scrollbar-track { background: transparent; }

/* ==========================================================
   顶部导航（毛玻璃）
   ========================================================== */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  height: var(--nav-h);
  display: flex; align-items: center; gap: 14px;
  padding: 0 16px;
  background: rgba(10, 18, 40, .55);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  backdrop-filter: blur(18px) saturate(150%);
  border-bottom: 1px solid rgba(255, 255, 255, .06);
  transition: background .3s;
}
.nav.scrolled { background: rgba(10, 18, 40, .82); }

.nav-brand {
  display: flex; align-items: center; gap: 9px;
  font-weight: 600; font-size: 16.5px; letter-spacing: .5px;
  flex-shrink: 0;
}
.nav-logo {
  width: 30px; height: 30px; border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(255,255,255,.22), 0 2px 8px rgba(30, 110, 220, .35);
}
.nav-name { background: linear-gradient(90deg, #fff, #bcd7ff); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }

.nav-links {
  display: none; /* 移动端隐藏，桌面端显示 */
  align-items: center; gap: 4px;
  margin-left: 18px;
  flex: 1;
}
.nav-links a {
  font-size: 14px; font-weight: 500; color: var(--c-dim);
  padding: 6px 12px; border-radius: 999px;
  transition: .2s;
}
.nav-links a:hover { color: #fff; background: rgba(255,255,255,.08); }
.nav-links a.on { color: #fff; background: rgba(74,144,226,.22); }

.nav-login {
  margin-left: auto;
  padding: 7px 18px;
  font-size: 13.5px; color: #fff;
  background: linear-gradient(135deg, rgba(90,157,245,.9), rgba(70,125,220,.9));
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 999px;
  box-shadow: 0 2px 10px rgba(40, 100, 200, .35);
  transition: .2s;
}
.nav-login:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(40, 100, 200, .5); }
.nav-login.logged { background: rgba(255,255,255,.10); border-color: rgba(255,255,255,.2); box-shadow: none; }

@media (min-width: 720px) {
  .nav { padding: 0 26px; }
  .nav-links { display: flex; }
  .nav-login { margin-left: 0; }
}
@media (max-width: 719px) {
  .nav-links { display: none !important; }
}

/* ==========================================================
   通用：区块 / 卡片列表
   ========================================================== */
.main { position: relative; background: linear-gradient(180deg, var(--c-bg) 0%, var(--c-bg-2) 100%); }

.section { max-width: 760px; margin: 0 auto; padding: 30px 18px 0; }
.section:last-of-type { padding-bottom: 34px; }

.sec-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
}
.sec-head h2 { font-size: 17px; font-weight: 600; letter-spacing: .5px; }
.sec-head h2::before {
  content: ''; display: inline-block; width: 4px; height: 15px;
  background: linear-gradient(180deg, #6fb1ff, #357abd);
  border-radius: 2px; margin-right: 9px; vertical-align: -2px;
}
.sec-more { font-size: 12.5px; color: var(--c-dim); transition: .2s; }
.sec-more:hover { color: #9cc6ff; }

.card-list { display: flex; flex-direction: column; gap: 10px; }

.loading {
  padding: 22px 0; text-align: center;
  font-size: 12.5px; color: var(--c-dim-2);
}

/* 新闻卡片 */
.news-card {
  display: flex; gap: 12px; align-items: center;
  background: var(--c-card);
  border: 1px solid var(--c-card-line);
  border-radius: var(--radius-s);
  padding: 10px;
  transition: .2s;
  cursor: pointer;
}
.news-card:hover { background: rgba(255,255,255,.10); transform: translateY(-1px); }
.news-thumb {
  width: 96px; height: 64px; flex-shrink: 0;
  border-radius: 8px; object-fit: cover;
  background: rgba(255,255,255,.06);
}
.news-info { min-width: 0; flex: 1; }
.news-title {
  font-size: 14.5px; font-weight: 500; line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.news-meta { margin-top: 6px; font-size: 11.5px; color: var(--c-dim-2); }

/* 资源卡片 */
.res-card {
  display: flex; gap: 12px; align-items: center;
  background: var(--c-card);
  border: 1px solid var(--c-card-line);
  border-radius: var(--radius-s);
  padding: 12px;
  transition: .2s;
  cursor: pointer;
}
.res-card:hover { background: rgba(255,255,255,.10); }
.res-icon {
  width: 52px; height: 52px; flex-shrink: 0;
  border-radius: 12px; object-fit: cover;
  background: rgba(255,255,255,.06);
}
.res-info { min-width: 0; flex: 1; }
.res-name { font-size: 14.5px; font-weight: 500; }
.res-desc {
  margin-top: 2px; font-size: 12px; color: var(--c-dim);
  display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden;
}
.res-meta { margin-top: 4px; font-size: 11.5px; color: var(--c-dim-2); }
.res-btn {
  flex-shrink: 0;
  padding: 7px 15px; font-size: 12.5px; color: #fff;
  background: rgba(74,144,226,.25);
  border: 1px solid rgba(110,170,255,.4);
  border-radius: 999px;
  transition: .2s;
}
.res-btn:hover { background: rgba(74,144,226,.45); }

/* ==========================================================
   页脚
   ========================================================== */
.footer {
  padding: 30px 18px 40px;
  text-align: center;
  background: var(--c-bg-2);
  border-top: 1px solid rgba(255,255,255,.05);
}
.footer-brand {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 15px; font-weight: 600;
}
.footer-brand img { width: 26px; height: 26px; border-radius: 50%; }
.footer-links {
  display: flex; align-items: center; justify-content: center; gap: 22px;
  margin-top: 14px; font-size: 13px;
}
.footer-links a { color: var(--c-dim); transition: .2s; }
.footer-links a:hover { color: #9cc6ff; }
.footer-copy { margin-top: 16px; font-size: 11.5px; color: var(--c-dim-2); }

/* ==========================================================
   登录弹窗（毛玻璃）
   ========================================================== */
.modal { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal[hidden] { display: none; }

.modal-mask {
  position: absolute; inset: 0;
  background: rgba(4, 8, 20, .55);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  animation: maskIn .25s ease-out;
}
@keyframes maskIn { from { opacity: 0; } to { opacity: 1; } }

.login-card {
  position: relative; width: 100%; max-width: 350px;
  padding: 26px 24px 22px;
  border-radius: 22px;
  background: rgba(22, 34, 62, .55);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  backdrop-filter: blur(24px) saturate(160%);
  border: 1px solid rgba(255,255,255,.18);
  box-shadow: 0 24px 60px rgba(0, 10, 30, .6), inset 0 1px 0 rgba(255,255,255,.14);
  animation: cardIn .32s cubic-bezier(.2, .9, .3, 1.2);
  text-align: center;
}
@keyframes cardIn { from { opacity: 0; transform: scale(.94) translateY(10px); } to { opacity: 1; transform: scale(1) translateY(0); } }

.modal-close {
  position: absolute; top: 10px; right: 12px;
  width: 30px; height: 30px; border-radius: 50%;
  background: transparent; border: 0;
  color: rgba(255,255,255,.6); font-size: 20px; line-height: 1;
  transition: .2s;
}
.modal-close:hover { color: #fff; background: rgba(255,255,255,.10); }

.login-logo img {
  width: 58px; height: 58px; border-radius: 50%; margin: 0 auto 12px;
  box-shadow: 0 0 0 1px rgba(255,255,255,.25), 0 0 22px rgba(80, 150, 255, .35);
}
.login-title { font-size: 19px; font-weight: 600; }
.login-sub { font-size: 12px; color: var(--c-dim); margin: 4px 0 16px; }

.inp {
  width: 100%; padding: 11px 13px; margin-bottom: 10px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 11px;
  color: #fff; font-size: 14px; outline: none;
  transition: .2s;
}
.inp::placeholder { color: rgba(255,255,255,.42); }
.inp:focus {
  border-color: rgba(110,170,255,.65);
  box-shadow: 0 0 0 3px rgba(74,144,226,.18);
  background: rgba(255,255,255,.09);
}

.btn-primary {
  width: 100%; padding: 11px; margin-top: 6px;
  background: linear-gradient(135deg, #5a9df5, #4179d6);
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 11px;
  color: #fff; font-size: 15px; font-weight: 600; letter-spacing: 2px;
  transition: .2s;
  box-shadow: 0 6px 18px rgba(40, 100, 200, .35);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 8px 22px rgba(40, 100, 200, .5); }
.btn-primary:active { transform: translateY(0); }

.login-toggle { margin-top: 14px; font-size: 12.5px; color: var(--c-dim); }
.login-toggle a { color: #7db4ff; cursor: pointer; font-weight: 500; }
.login-toggle a:hover { text-decoration: underline; }

/* ==========================================================
   图形验证码
   ========================================================== */
.cap-row {
  display: flex; align-items: stretch; gap: 9px;
  margin-bottom: 10px;
}
.cap-inp {
  flex: 1; min-width: 0;
  margin-bottom: 0;                 /* 行内间距由 .cap-row 控制 */
  letter-spacing: 3px; text-transform: uppercase;
}
.cap-img {
  width: 116px; height: 44px; flex-shrink: 0;
  border-radius: 10px;
  background: rgba(255, 255, 255, .10);
  border: 1px solid rgba(255, 255, 255, .16);
  object-fit: cover;
  cursor: pointer;
  transition: .2s;
}
.cap-img:hover { border-color: rgba(110, 170, 255, .55); }
.cap-img.loading { opacity: .4; }

/* 登录 / 注册的错误与提示 */
.auth-msg {
  margin: 2px 0 8px;
  padding: 8px 11px;
  border-radius: 10px;
  font-size: 12.5px; line-height: 1.5; text-align: left;
  background: rgba(255, 96, 120, .12);
  border: 1px solid rgba(255, 96, 120, .3);
  color: #ff9db0;
}
.auth-msg.warn {
  background: rgba(255, 196, 84, .12);
  border-color: rgba(255, 196, 84, .3);
  color: #ffcf7a;
}
.auth-msg[hidden] { display: none; }

/* ==========================================================
   轻提示 Toast
   ========================================================== */
.toast {
  position: fixed; left: 50%; bottom: 64px; z-index: 200;
  transform: translateX(-50%);
  max-width: 82vw;
  padding: 10px 18px;
  background: rgba(18, 28, 52, .92);
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 999px;
  font-size: 13px; color: #fff;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .45);
  animation: toastIn .28s ease-out;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.toast[hidden] { display: none; }
.toast.out { animation: toastOut .3s ease-in forwards; }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 12px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes toastOut { from { opacity: 1; } to { opacity: 0; transform: translate(-50%, 10px); } }