/* ============================================================
   超超云端 - 共享样式 (common.css)
   对标 618mz.shop 参考站 UI
   ============================================================ */

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

:root {
  --primary-blue: #2196F3;
  --primary-blue-dark: #1976D2;
  --primary-orange: #FF8C42;
  --primary-orange-dark: #E67A35;
  --bg-gray: #F5F6FA;
  --text-dark: #333333;
  --text-gray: #666666;
  --text-light: #999999;
  --pink: #FF6B9D;
  --green: #52C41A;
  --card-radius: 12px;
  --card-radius-lg: 16px;
  --header-h: 56px;
  --bottom-nav-h: 56px;
  --sidebar-w: 240px;
  --topbar-h: 60px;
  --shadow-sm: 0 2px 8px rgba(0,0,0,.06);
  --shadow-md: 0 4px 16px rgba(0,0,0,.08);
  --shadow-lg: 0 8px 32px rgba(0,0,0,.10);
}

html { -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Microsoft YaHei", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg-gray);
  color: var(--text-dark);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
ul, ol { list-style: none; }
input, button, textarea, select { font-family: inherit; font-size: inherit; outline: none; border: none; }

/* ===== 移动端头部 ===== */
.mobile-header {
  position: sticky; top: 0; z-index: 100;
  height: var(--header-h);
  background: linear-gradient(135deg, var(--primary-blue), var(--primary-blue-dark));
  color: #fff;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 14px;
  box-shadow: 0 2px 12px rgba(33,150,243,.25);
}
.mobile-header .mh-logo {
  display: flex; align-items: center; gap: 8px; font-size: 18px; font-weight: 700;
}
.mobile-header .mh-logo .logo-icon {
  width: 32px; height: 32px; border-radius: 8px;
  background: rgba(255,255,255,.2);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
}
.mobile-header .mh-right { display: flex; align-items: center; gap: 10px; }
.mobile-user-avatar-btn {
  width: 36px; height: 36px; border-radius: 50%; overflow: hidden;
  border: 2px solid rgba(255,255,255,.3); cursor: pointer;
  position: relative; transition: .2s;
}
.mobile-user-avatar-btn img { width: 100%; height: 100%; object-fit: cover; }
.mobile-user-avatar-btn .avatar-fallback {
  width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.2); color: #fff; font-size: 16px;
}
.mobile-user-avatar-btn.active { border-color: #fff; box-shadow: 0 0 0 3px rgba(255,255,255,.3); }

/* 用户下拉面板 */
.mobile-user-panel {
  position: fixed; top: var(--header-h); right: 0; z-index: 99;
  width: 220px; background: #fff; border-radius: 0 0 0 16px;
  box-shadow: var(--shadow-lg); padding: 10px 0;
  display: none; animation: slideDown .2s ease;
}
.mobile-user-panel.show { display: block; }
@keyframes slideDown { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }
.mobile-user-panel .mup-header {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px;
  border-bottom: 1px solid #f0f0f0; margin-bottom: 6px;
}
.mobile-user-panel .mup-avatar {
  width: 44px; height: 44px; border-radius: 50%; overflow: hidden; border: 2px solid #e8e8e8;
}
.mobile-user-panel .mup-avatar img { width: 100%; height: 100%; object-fit: cover; }
.mobile-user-panel .mup-info { flex: 1; min-width: 0; }
.mobile-user-panel .mup-info .mup-name { font-size: 14px; font-weight: 600; color: var(--text-dark); }
.mobile-user-panel .mup-info .mup-vip { font-size: 12px; }
.mobile-user-panel .mup-menu a {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px;
  font-size: 14px; color: var(--text-gray); transition: .2s;
}
.mobile-user-panel .mup-menu a:hover { background: var(--bg-gray); color: var(--primary-blue); }
.mobile-user-panel .mup-menu a i { width: 18px; text-align: center; font-size: 16px; }

/* ===== 移动端底部导航 ===== */
.mobile-bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
  height: var(--bottom-nav-h);
  background: #fff;
  display: flex; align-items: center;
  box-shadow: 0 -2px 12px rgba(0,0,0,.06);
  border-top: 1px solid #f0f0f0;
}
.mobile-bottom-nav .nav-item {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; color: var(--text-light); font-size: 11px; transition: .2s; padding: 4px 0;
}
.mobile-bottom-nav .nav-item i { font-size: 20px; }
.mobile-bottom-nav .nav-item.active { color: var(--primary-blue); }
.mobile-bottom-nav .nav-item:active { transform: scale(.92); }

/* ===== 移动端页面容器 ===== */
.mobile-container { padding: 12px 12px calc(var(--bottom-nav-h) + 16px); min-height: calc(100vh - var(--header-h)); }

/* ===== 通用卡片 ===== */
.my-card {
  background: #fff; border-radius: var(--card-radius); overflow: hidden;
  box-shadow: var(--shadow-sm); margin-bottom: 12px;
}
.my-card-title {
  padding: 12px 14px; font-size: 15px; font-weight: 600; color: var(--text-dark);
  border-bottom: 1px solid #f5f5f5; display: flex; align-items: center; justify-content: space-between;
}
.my-card-title .more { font-size: 12px; color: var(--text-light); font-weight: 400; }
.my-card-title .more i { margin-left: 2px; }
.my-card-body { padding: 12px 14px; }

/* ===== 快捷链接网格 ===== */
.quick-links {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 12px;
}
.quick-link {
  background: #fff; border-radius: var(--card-radius); padding: 14px 6px;
  text-align: center; box-shadow: var(--shadow-sm); transition: .2s; cursor: pointer;
}
.quick-link:active { transform: scale(.95); }
.quick-link .ql-icon {
  width: 42px; height: 42px; border-radius: 50%; margin: 0 auto 6px;
  display: flex; align-items: center; justify-content: center; font-size: 20px; color: #fff;
}
.quick-link .ql-icon.icon-blue { background: linear-gradient(135deg, #2196F3, #1976D2); }
.quick-link .ql-icon.icon-orange { background: linear-gradient(135deg, #FF8C42, #E67A35); }
.quick-link .ql-icon.icon-green { background: linear-gradient(135deg, #52C41A, #389E0D); }
.quick-link .ql-icon.icon-purple { background: linear-gradient(135deg, #9C27B0, #7B1FA2); }
.quick-link .ql-icon.icon-pink { background: linear-gradient(135deg, #FF6B9D, #E91E63); }
.quick-link .ql-icon.icon-cyan { background: linear-gradient(135deg, #00BCD4, #0097A7); }
.quick-link .ql-name { font-size: 12px; color: var(--text-gray); }

/* ===== CTA 大按钮 ===== */
.mobile-main-btn {
  display: block; width: 100%; height: 48px; line-height: 48px; text-align: center;
  background: linear-gradient(135deg, var(--primary-orange), var(--primary-orange-dark));
  color: #fff; font-size: 16px; font-weight: 600; border-radius: var(--card-radius);
  box-shadow: 0 4px 16px rgba(255,140,66,.3); margin-bottom: 12px;
  transition: .2s; cursor: pointer; border: none;
}
.mobile-main-btn:active { transform: scale(.97); }

/* ===== 公告条/列表 ===== */
.notice-bar {
  display: flex; align-items: center; gap: 8px; padding: 10px 14px;
  background: rgba(255,248,235,.8); border-radius: var(--card-radius); margin-bottom: 12px;
  border: 1px solid rgba(255,193,7,.2);
}
.notice-bar .notice-icon { color: #FF9800; font-size: 16px; flex-shrink: 0; }
.notice-bar .notice-text { flex: 1; font-size: 13px; color: #8D6E63; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notice-list .notice-item {
  display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid #f5f5f5; cursor: pointer;
}
.notice-list .notice-item:last-child { border-bottom: none; }
.notice-list .notice-item .ni-icon { width: 32px; flex-shrink: 0; text-align: center; font-size: 16px; color: var(--primary-blue); }
.notice-list .notice-item .ni-body { flex: 1; min-width: 0; }
.notice-list .notice-item .ni-title { font-size: 14px; color: var(--text-dark); font-weight: 500; }
.notice-list .notice-item .ni-desc { font-size: 12px; color: var(--text-light); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notice-list .notice-item .ni-date { font-size: 11px; color: var(--text-light); margin-top: 4px; }

/* ===== 账号列表项 ===== */
.account-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid #f5f5f5;
}
.account-item:last-child { border-bottom: none; }
.account-item .ai-avatar { width: 40px; height: 40px; border-radius: 50%; overflow: hidden; flex-shrink: 0; border: 2px solid #e8e8e8; }
.account-item .ai-avatar img { width: 100%; height: 100%; object-fit: cover; }
.account-item .ai-body { flex: 1; min-width: 0; }
.account-item .ai-qq { font-size: 14px; font-weight: 600; color: var(--text-dark); }
.account-item .ai-status { font-size: 12px; margin-top: 2px; }
.account-item .ai-status .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 4px; }
.account-item .ai-status .dot.on { background: var(--green); }
.account-item .ai-status .dot.off { background: var(--text-light); }
.account-item .ai-actions { display: flex; gap: 6px; }
.account-item .ai-actions .ai-btn {
  width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center;
  font-size: 14px; cursor: pointer; transition: .2s;
}
.account-item .ai-actions .ai-btn:active { transform: scale(.9); }

/* ===== 统计数据网格 ===== */
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat-grid .stat-item { text-align: center; padding: 10px 4px; }
.stat-grid .stat-item .stat-num { font-size: 22px; font-weight: 700; color: var(--primary-blue); }
.stat-grid .stat-item .stat-label { font-size: 12px; color: var(--text-light); margin-top: 2px; }

/* ===== 侧边浮动按钮 (可拖动/可收起) ===== */
.side-join-btn {
  position: fixed; right: 12px; top: 50%; transform: translateY(-50%);
  width: 36px; height: 72px; border-radius: 18px;
  background: linear-gradient(135deg, #1a5fb4, #1864b8);
  color: #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  font-size: 12px; line-height: 1.2; font-weight: 500;
  box-shadow: 0 4px 16px rgba(26,95,180,.45); cursor: grab;
  transition: width .25s, height .25s, border-radius .25s, opacity .25s;
  touch-action: none; user-select: none; -webkit-user-select: none;
  z-index: 60;
}
.side-join-btn.dragging { cursor: grabbing; transition: none; }
.side-join-btn:active { transform: scale(.95); }
.side-join-btn .sjb-icon { width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; }
.side-join-btn .sjb-icon svg { width: 100%; height: 100%; fill: #fff; }
.side-join-btn .sjb-text { writing-mode: vertical-rl; letter-spacing: 1px; }
/* 收起状态: 只露一个小角 */
.side-join-btn.collapsed {
  width: 14px; height: 48px; border-radius: 7px 0 0 7px;
  opacity: .6; box-shadow: 0 2px 8px rgba(26,95,180,.3);
}
.side-join-btn.collapsed.right-edge { border-radius: 0 7px 7px 0; }
.side-join-btn.collapsed .sjb-icon,
.side-join-btn.collapsed .sjb-text { display: none; }
/* 桌面端 */
@media(min-width:1024px){
  .side-join-btn { width: 40px; height: 80px; border-radius: 20px; right: 20px; }
  .side-join-btn.collapsed { width: 16px; height: 56px; border-radius: 8px 0 0 8px; opacity: .7; }
}

/* ===== 桌面端布局 (≥1024px) ===== */
.desktop-topbar {
  display: none; position: fixed; top: 0; left: 0; right: 0; z-index: 200;
  height: var(--topbar-h); background: linear-gradient(135deg, var(--primary-blue), var(--primary-blue-dark));
  color: #fff; align-items: center; justify-content: space-between; padding: 0 24px;
  box-shadow: 0 2px 8px rgba(0,0,0,.1);
}
.desktop-topbar .dt-logo { display: flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 700; }
.desktop-topbar .dt-logo .logo-icon { width: 36px; height: 36px; border-radius: 8px; background: rgba(255,255,255,.2); display: flex; align-items: center; justify-content: center; font-size: 18px; }
.desktop-topbar .dt-nav { display: flex; gap: 4px; }
.desktop-topbar .dt-nav a { padding: 8px 16px; border-radius: 8px; font-size: 14px; transition: .2s; }
.desktop-topbar .dt-nav a:hover { background: rgba(255,255,255,.15); }
.desktop-topbar .dt-nav a.active { background: rgba(255,255,255,.25); font-weight: 600; }
.desktop-topbar .dt-right { display: flex; align-items: center; gap: 12px; }
.desktop-topbar .dt-right .dt-balance { background: rgba(255,255,255,.15); padding: 6px 14px; border-radius: 20px; font-size: 13px; }
.desktop-topbar .dt-right .dt-avatar { width: 36px; height: 36px; border-radius: 50%; overflow: hidden; border: 2px solid rgba(255,255,255,.3); cursor: pointer; }
.desktop-topbar .dt-right .dt-avatar img { width: 100%; height: 100%; object-fit: cover; }

.desktop-sidebar {
  display: none; position: fixed; top: var(--topbar-h); left: 0; bottom: 0; width: var(--sidebar-w); z-index: 150;
  background: #fff; border-right: 1px solid #e8e8e8; padding: 12px 0; overflow-y: auto;
}
.desktop-sidebar .ds-item {
  display: flex; align-items: center; gap: 12px; padding: 12px 20px; font-size: 14px; color: var(--text-gray);
  transition: .2s; border-left: 3px solid transparent;
}
.desktop-sidebar .ds-item i { width: 20px; text-align: center; font-size: 18px; }
.desktop-sidebar .ds-item:hover { background: var(--bg-gray); color: var(--primary-blue); }
.desktop-sidebar .ds-item.active { color: var(--primary-blue); border-left-color: var(--primary-blue); background: rgba(33,150,243,.06); font-weight: 600; }

.desktop-main { display: none; margin-left: var(--sidebar-w); margin-top: var(--topbar-h); padding: 20px 24px; min-height: calc(100vh - var(--topbar-h)); }
.desktop-main .d-card { background: #fff; border-radius: var(--card-radius-lg); box-shadow: var(--shadow-sm); margin-bottom: 16px; overflow: hidden; }
.desktop-main .d-card-title { padding: 14px 18px; font-size: 16px; font-weight: 600; border-bottom: 1px solid #f0f0f0; }
.desktop-main .d-card-body { padding: 18px; }

@media (min-width: 1024px) {
  .mobile-header, .mobile-bottom-nav, .mobile-container { display: none !important; }
  .desktop-topbar { display: flex; }
  .desktop-sidebar { display: block; }
  .desktop-main { display: block; }
  .side-join-btn { bottom: 24px; }
}

/* ===== 通用工具类 ===== */
.text-blue { color: var(--primary-blue); }
.text-orange { color: var(--primary-orange); }
.text-green { color: var(--green); }
.text-gray { color: var(--text-gray); }
.text-red { color: #f5222d; }
.text-center { text-align: center; }
.mb-0 { margin-bottom: 0; }
.mb-2 { margin-bottom: 8px; }
.mt-2 { margin-top: 8px; }
.fw-bold { font-weight: 700; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 500; }
.badge-blue { background: rgba(33,150,243,.12); color: var(--primary-blue); }
.badge-orange { background: rgba(255,140,66,.12); color: var(--primary-orange); }
.badge-green { background: rgba(82,196,26,.12); color: var(--green); }
.badge-gray { background: rgba(153,153,153,.12); color: var(--text-light); }
.badge-pink { background: rgba(255,107,157,.12); color: var(--pink); }

/* 空状态 */
.empty-state { text-align: center; padding: 40px 20px; }
.empty-state .empty-icon { width: 64px; height: 64px; margin: 0 auto 12px; border-radius: 50%; background: var(--bg-gray); display: flex; align-items: center; justify-content: center; font-size: 28px; color: var(--text-light); }
.empty-state .empty-text { font-size: 14px; color: var(--text-gray); }
.empty-state .empty-desc { font-size: 12px; color: var(--text-light); margin-top: 4px; }

/* 加载动画 */
.loading { text-align: center; padding: 30px; color: var(--text-light); }
.loading .spinner { width: 32px; height: 32px; border: 3px solid #e8e8e8; border-top-color: var(--primary-blue); border-radius: 50%; margin: 0 auto 8px; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Toast 提示 */
.toast-msg {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); z-index: 9999;
  background: rgba(0,0,0,.8); color: #fff; padding: 12px 24px; border-radius: 8px;
  font-size: 14px; max-width: 80%; text-align: center;
  animation: fadeIn .2s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ===== layer弹窗圆角 + X关闭按钮 ===== */
.layui-layer { border-radius: 16px !important; overflow: hidden; }
.layui-layer-title { position: relative !important; padding-right: 50px !important; border-radius: 16px 16px 0 0 !important; }
.layui-layer-content { border-radius: 0 0 16px 16px; }
.layui-layer-btn { border-radius: 0 0 16px 16px; }
.cc-close-btn { opacity: .6; transition: .2s; }
.cc-close-btn:hover { opacity: 1; color: #f5222d !important; }
.layui-layer-msg { border-radius: 12px !important; }

/* ===== 滑入通知 ===== */
.cc-slide-notify {
  font-family: -apple-system, BlinkMacSystemFont, "Microsoft YaHei", sans-serif;
}

/* ===== 邮件通知开关 ===== */
.switch-toggle { position: relative; display: inline-block; width: 44px; height: 24px; }
.switch-toggle input { opacity: 0; width: 0; height: 0; }
.switch-toggle .slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background: #ccc; border-radius: 24px; transition: .3s; }
.switch-toggle .slider:before { position: absolute; content: ""; height: 18px; width: 18px; left: 3px; bottom: 3px; background: #fff; border-radius: 50%; transition: .3s; }
.switch-toggle input:checked + .slider { background: var(--primary-blue); }
.switch-toggle input:checked + .slider:before { transform: translateX(20px); }

/* ===== 设置页输入框 ===== */
.settings-input { width: 100%; height: 42px; padding: 0 14px; border: 1.5px solid #e8e8e8; border-radius: 10px; font-size: 14px; background: #fff; transition: .2s; }
.settings-input:focus { border-color: var(--primary-blue); }
.settings-textarea { width: 100%; padding: 10px 14px; border: 1.5px solid #e8e8e8; border-radius: 10px; font-size: 14px; background: #fff; resize: vertical; min-height: 80px; }
