/* ========== 用户中心页面样式 — WorkBuddy 风格 ========== */
*{margin:0;padding:0;box-sizing:border-box;}
html,body{height:100%;}
body{
  font-family:-apple-system,BlinkMacSystemFont,'PingFang SC','Hiragino Sans GB','Microsoft YaHei',sans-serif;
  background:#f8f9fa;color:#1f2937;font-size:14px;
  -webkit-font-smoothing:antialiased;
}

/* ========== 布局 ========== */
.user-layout{display:flex;height:100vh;overflow:hidden;}

/* 左侧边栏 — WorkBuddy 白色风格 */
.user-sidebar{
  width:260px;background:#fff;border-right:1px solid #e5e7eb;
  display:flex;flex-direction:column;position:fixed;top:0;left:0;bottom:0;z-index:10;
}
.sidebar-header{
  padding:24px 20px 16px;
  display:flex;align-items:center;gap:12px;
}
.sidebar-header a{
  display:flex;align-items:center;gap:12px;
  text-decoration:none;color:inherit;
}
.sidebar-logo{width:48px;height:48px;border-radius:10px;object-fit:cover;flex-shrink:0;}
.sidebar-title{font-size:18px;font-weight:800;color:#111827;letter-spacing:0.5px;}
.sidebar-sub{display:none;}
.sidebar-nav{flex:1;padding:8px 0;overflow-y:auto;}
.sidebar-nav-item{
  display:flex;align-items:center;gap:14px;
  padding:11px 20px;margin:2px 12px;font-size:14px;color:#4b5563;
  text-decoration:none;transition:all .15s;cursor:pointer;border-radius:8px;
}
.sidebar-nav-item:hover{background:#f3f4f6;color:#111827;}
.sidebar-nav-item.active{
  background:#f0fdfa;color:#009999;font-weight:600;
  position:relative;
}
.sidebar-nav-item.active::before{
  content:'';position:absolute;left:0;top:50%;transform:translateY(-50%);
  width:3px;height:20px;background:#009999;border-radius:0 3px 3px 0;
}
.sidebar-nav-item svg{width:20px;height:20px;flex-shrink:0;}
.sidebar-nav-badge{
  margin-left:auto;background:#ef4444;color:#fff;
  font-size:10px;font-weight:700;padding:2px 8px;border-radius:10px;
}
.sidebar-footer{
  padding:14px 20px;border-top:1px solid #f0f0f0;
  display:flex;align-items:center;gap:10px;
}
.sidebar-avatar{
  width:36px;height:36px;border-radius:50%;object-fit:cover;
  background:#e5e7eb;flex-shrink:0;
}
.sidebar-user-info{flex:1;min-width:0;}
.sidebar-user-name{font-size:13px;font-weight:600;color:#111827;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.sidebar-user-id{font-size:11px;color:#9ca3af;}
.sidebar-logout{
  background:none;border:none;color:#9ca3af;cursor:pointer;
  font-size:20px;padding:4px;border-radius:4px;transition:all .15s;
}
.sidebar-logout:hover{color:#ef4444;}

/* 右侧内容区 — 可滚动 */
.user-content{
  flex:1;margin-left:260px;padding:32px 40px;
  height:100vh;overflow-y:auto;overflow-x:hidden;
  background:#f8f9fa;
}
.user-content::-webkit-scrollbar{width:6px;}
.user-content::-webkit-scrollbar-track{background:transparent;}
.user-content::-webkit-scrollbar-thumb{background:#d1d5db;border-radius:3px;}
.user-content::-webkit-scrollbar-thumb:hover{background:#9ca3af;}
.user-content-header{
  margin-bottom:28px;
}
.user-content-title{font-size:24px;font-weight:700;color:#111827;}
.user-content-sub{font-size:14px;color:#6b7280;margin-top:4px;}

/* ========== 卡片 ========== */
.card{
  background:#fff;border-radius:12px;padding:24px;
  margin-bottom:20px;
  border:1px solid #e5e7eb;
}
.card-title{font-size:16px;font-weight:700;color:#111827;margin-bottom:20px;}

/* ========== 统计卡片 ========== */
.stats-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:16px;margin-bottom:24px;}
.stat-card{
  background:#fff;border-radius:12px;padding:20px;
  border:1px solid #e5e7eb;display:flex;align-items:center;gap:14px;
}
.stat-icon{
  width:48px;height:48px;border-radius:12px;
  display:flex;align-items:center;justify-content:center;
  font-size:22px;flex-shrink:0;
}
.stat-icon.bg-blue{background:#eff6ff;color:#2563eb;}
.stat-icon.bg-green{background:#f0fdf4;color:#16a34a;}
.stat-icon.bg-purple{background:#faf5ff;color:#9333ea;}
.stat-icon.bg-orange{background:#fff7ed;color:#ea580c;}
.stat-icon.bg-teal{background:#f0fdfa;color:#009999;}
.stat-icon.bg-pink{background:#fdf2f8;color:#db2777;}
.stat-info{flex:1;}
.stat-label{font-size:13px;color:#6b7280;margin-bottom:4px;}
.stat-value{font-size:24px;font-weight:700;color:#111827;}

/* ========== 头像 ========== */
.avatar-large{
  width:88px;height:88px;border-radius:50%;object-fit:cover;
  background:#e5e7eb;border:3px solid #fff;box-shadow:0 2px 8px rgba(0,0,0,.08);
}
.avatar-medium{width:40px;height:40px;border-radius:50%;object-fit:cover;background:#e5e7eb;}
.avatar-small{width:32px;height:32px;border-radius:50%;object-fit:cover;background:#e5e7eb;}
.avatar-upload-area{
  width:88px;height:88px;border-radius:50%;
  border:2px dashed #d1d5db;display:flex;
  align-items:center;justify-content:center;
  cursor:pointer;position:relative;overflow:hidden;
  transition:border-color .15s;
}
.avatar-upload-area:hover{border-color:#009999;}
.avatar-upload-area img{width:100%;height:100%;object-fit:cover;border-radius:50%;}
.avatar-upload-overlay{
  position:absolute;inset:0;background:rgba(0,0,0,.45);
  display:flex;align-items:center;justify-content:center;
  color:#fff;font-size:12px;font-weight:500;opacity:0;transition:opacity .15s;
}
.avatar-upload-area:hover .avatar-upload-overlay{opacity:1;}

/* ========== 表单 ========== */
.form-group{margin-bottom:20px;}
.form-label{font-size:13px;color:#374151;margin-bottom:8px;display:block;font-weight:600;}
.form-input{
  width:100%;height:40px;padding:0 14px;
  border:1px solid #d1d5db;border-radius:8px;
  font-size:14px;outline:none;transition:border-color .15s,box-shadow .15s;
  background:#fff;
}
.form-input:focus{border-color:#009999;box-shadow:0 0 0 3px rgba(0,153,153,.08);}
.form-textarea{
  width:100%;padding:12px 14px;min-height:100px;
  border:1px solid #d1d5db;border-radius:8px;
  font-size:14px;outline:none;resize:vertical;font-family:inherit;
  transition:border-color .15s,box-shadow .15s;
}
.form-textarea:focus{border-color:#009999;box-shadow:0 0 0 3px rgba(0,153,153,.08);}

/* ========== 按钮 ========== */
.btn{
  height:40px;padding:0 20px;border:none;border-radius:8px;
  font-size:14px;font-weight:600;cursor:pointer;transition:all .15s;
  display:inline-flex;align-items:center;gap:6px;
}
.btn-primary{background:#009999;color:#fff;}
.btn-primary:hover{background:#007a7a;}
.btn-ghost{background:#fff;color:#4b5563;border:1px solid #d1d5db;}
.btn-ghost:hover{background:#f9fafb;border-color:#9ca3af;}
.btn-danger{background:#ef4444;color:#fff;}
.btn-danger:hover{background:#dc2626;}
.btn-sm{height:32px;padding:0 14px;font-size:13px;}
.btn-lg{height:48px;padding:0 28px;font-size:15px;}

/* ========== 表格 ========== */
.data-table{width:100%;border-collapse:collapse;}
.data-table th{
  text-align:left;padding:12px 16px;font-size:11px;font-weight:600;
  color:#6b7280;border-bottom:1px solid #e5e7eb;white-space:nowrap;
  text-transform:uppercase;letter-spacing:0.5px;
}
.data-table td{
  padding:14px 16px;font-size:13px;color:#374151;
  border-bottom:1px solid #f3f4f6;
}
.data-table tr:hover td{background:#f9fafb;}
.data-table tr:last-child td{border-bottom:none;}
.data-table .tag{
  display:inline-block;padding:3px 10px;border-radius:6px;
  font-size:11px;font-weight:600;
}
.tag-green{background:#dcfce7;color:#16a34a;}
.tag-red{background:#fee2e2;color:#dc2626;}
.tag-gray{background:#f3f4f6;color:#6b7280;}
.tag-blue{background:#dbeafe;color:#2563eb;}
.tag-orange{background:#ffedd5;color:#ea580c;}
.tag-purple{background:#f3e8ff;color:#9333ea;}
.tag-pink{background:#fce7f3;color:#db2777;}

/* ========== 通知 ========== */
.notification-item{
  display:flex;gap:12px;padding:16px 0;border-bottom:1px solid #f3f4f6;
}
.notification-dot{
  width:8px;height:8px;border-radius:50%;background:#ef4444;
  flex-shrink:0;margin-top:6px;
}
.notification-dot.read{background:transparent;border:1px solid #d1d5db;}
.notification-content{flex:1;}
.notification-title{font-size:14px;font-weight:600;color:#374151;margin-bottom:4px;}
.notification-text{font-size:13px;color:#6b7280;line-height:1.5;}
.notification-time{font-size:11px;color:#9ca3af;margin-top:4px;}

/* ========== 积分 ========== */
.points-display{
  display:flex;align-items:baseline;gap:8px;margin-bottom:16px;
}
.points-number{font-size:40px;font-weight:800;color:#009999;}
.points-label{font-size:14px;color:#6b7280;}

.recharge-card{
  background:#fff;border:2px solid #e5e7eb;border-radius:12px;
  padding:24px;text-align:center;cursor:pointer;transition:all .15s;
}
.recharge-card:hover{border-color:#009999;}
.recharge-card.selected{border-color:#009999;background:#f0fdfa;}
.recharge-amount{font-size:28px;font-weight:800;color:#111827;margin-bottom:4px;}
.recharge-points{font-size:15px;color:#009999;font-weight:600;}
.recharge-bonus{font-size:12px;color:#ea580c;margin-top:6px;}

/* 余额卡片 */
.balance-card{
  background:linear-gradient(135deg,#009999 0%,#00b3b3 100%);
  color:#fff;border-radius:12px;padding:28px 32px;
  margin-bottom:20px;display:flex;align-items:center;
  justify-content:space-between;gap:16px;flex-wrap:wrap;
}
.balance-card .balance-label{font-size:14px;opacity:.9;margin-bottom:8px;}
.balance-card .balance-number{font-size:44px;font-weight:800;line-height:1;}
.balance-card .balance-unit{font-size:14px;margin-left:6px;opacity:.9;}
.balance-card .balance-total{font-size:13px;opacity:.85;margin-top:12px;}
.balance-card .balance-icon{font-size:56px;opacity:.4;}

/* ========== 邀请 ========== */
.invite-link-box{
  display:flex;align-items:center;gap:10px;
  padding:14px 18px;background:#f9fafb;border-radius:10px;
  margin-bottom:16px;border:1px solid #e5e7eb;
}
.invite-link-text{
  flex:1;font-size:13px;color:#4b5563;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
  font-family:monospace;
}

/* ========== 空状态 ========== */
.empty-state{
  text-align:center;padding:60px 20px;color:#9ca3af;
}
.empty-state-icon{font-size:48px;margin-bottom:16px;}
.empty-state-text{font-size:15px;color:#6b7280;}
.empty-state-sub{font-size:13px;color:#9ca3af;margin-top:8px;}
.empty-state-btn{
  margin-top:20px;height:36px;padding:0 20px;
  border:1px solid #d1d5db;border-radius:8px;
  background:#fff;color:#374151;font-size:14px;cursor:pointer;
}
.empty-state-btn:hover{background:#f9fafb;}

/* ========== 分页 ========== */
.pagination{display:flex;align-items:center;justify-content:center;gap:6px;margin-top:20px;}
.page-btn{
  height:36px;min-width:36px;padding:0 10px;
  border:1px solid #e5e7eb;background:#fff;border-radius:8px;
  font-size:13px;cursor:pointer;color:#4b5563;transition:all .15s;
}
.page-btn:hover:not(.disabled){background:#f9fafb;border-color:#d1d5db;}
.page-btn.active{background:#009999;color:#fff;border-color:#009999;}
.page-btn.disabled{opacity:.4;cursor:not-allowed;}

/* ========== Toast ========== */
.toast{
  position:fixed;top:20px;left:50%;transform:translateX(-50%);
  background:#111827;color:#fff;padding:12px 24px;border-radius:10px;
  font-size:14px;font-weight:600;opacity:0;pointer-events:none;
  transition:opacity .25s;z-index:9999;box-shadow:0 8px 24px rgba(0,0,0,.2);
}
.toast.show{opacity:1;}

/* ========== 搜索栏 ========== */
.search-bar{
  display:flex;align-items:center;gap:10px;margin-bottom:20px;
}
.search-input{
  height:40px;padding:0 14px;border:1px solid #d1d5db;border-radius:8px;
  font-size:14px;outline:none;flex:1;max-width:300px;
  transition:border-color .15s,box-shadow .15s;
}
.search-input:focus{border-color:#009999;box-shadow:0 0 0 3px rgba(0,153,153,.08);}

/* ========== 居中统计卡片（无图标） ========== */
.stats-grid-center{
  display:grid;grid-template-columns:repeat(auto-fit,minmax(160px,1fr));
  gap:16px;margin-bottom:8px;
}
.stat-card-center{
  background:#fff;border-radius:12px;padding:24px 16px;
  border:1px solid #e5e7eb;text-align:center;
  display:flex;flex-direction:column;align-items:center;justify-content:center;
}
.stat-value-large{
  font-size:36px;font-weight:800;color:#009999;line-height:1.2;
  margin-bottom:8px;
}
.stat-label-center{
  font-size:13px;color:#6b7280;text-align:center;
}

/* ========== 卡片标题行（带右侧齿轮） ========== */
.card-title-row{
  display:flex;align-items:center;justify-content:space-between;
  margin-bottom:20px;
}
.card-title-row .card-title{margin-bottom:0;}

/* ========== 管理员小齿轮按钮 ========== */
.admin-gear-btn{
  background:none;border:none;cursor:pointer;
  width:32px;height:32px;border-radius:6px;
  display:flex;align-items:center;justify-content:center;
  color:#9ca3af;transition:all .15s;
}
.admin-gear-btn:hover{
  background:#f3f4f6;color:#009999;
}

/* ========== 管理员编辑弹窗 ========== */
.admin-edit-modal-overlay{
  position:fixed;inset:0;background:rgba(0,0,0,.5);
  display:flex;align-items:center;justify-content:center;
  z-index:10000;padding:20px;
}
.admin-edit-modal{
  background:#fff;border-radius:12px;width:600px;max-width:100%;
  max-height:90vh;display:flex;flex-direction:column;
  box-shadow:0 20px 60px rgba(0,0,0,.3);
}
.admin-edit-modal-header{
  display:flex;align-items:center;justify-content:space-between;
  padding:20px 24px;border-bottom:1px solid #f0f0f0;
}
.admin-edit-modal-title{
  font-size:18px;font-weight:700;color:#111827;
}
.admin-edit-modal-close{
  background:none;border:none;font-size:24px;
  color:#9ca3af;cursor:pointer;padding:4px;border-radius:4px;
  line-height:1;transition:all .15s;
}
.admin-edit-modal-close:hover{background:#f3f4f6;color:#ef4444;}
.admin-edit-modal-body{
  padding:24px;overflow-y:auto;flex:1;
}
.admin-edit-modal-footer{
  display:flex;gap:12px;justify-content:flex-end;
  padding:16px 24px;border-top:1px solid #f0f0f0;
}

/* ========== 富文本编辑器 ========== */
.rt-toolbar{
  display:flex;flex-wrap:wrap;gap:4px;
  padding:8px 12px;border-bottom:1px solid #e5e7eb;
  background:#f9fafb;border-radius:8px 8px 0 0;
}
.rt-btn{
  min-width:32px;height:32px;padding:0 8px;
  display:flex;align-items:center;justify-content:center;
  background:#fff;border:1px solid #d1d5db;border-radius:6px;
  font-size:13px;font-weight:600;color:#374151;
  cursor:pointer;transition:all .15s;
}
.rt-btn:hover{background:#f3f4f6;border-color:#9ca3af;color:#111827;}
.rt-btn:active{background:#e5e7eb;}
.rt-editor{
  min-height:300px;max-height:500px;overflow-y:auto;
  padding:16px;border:1px solid #e5e7eb;border-radius:0 0 8px 8px;
  font-size:14px;line-height:1.8;color:#374151;outline:none;
}
.rt-editor:focus{border-color:#009999;box-shadow:0 0 0 3px rgba(0,153,153,.08);}
.rt-editor h2{font-size:18px;font-weight:700;margin:16px 0 8px;color:#111827;}
.rt-editor h3{font-size:16px;font-weight:600;margin:12px 0 6px;color:#111827;}
.rt-editor p{margin:8px 0;}
.rt-editor ul,.rt-editor ol{margin:8px 0;padding-left:24px;}
.rt-editor li{margin:4px 0;}
.rt-editor a{color:#009999;text-decoration:underline;}
.rt-editor img{max-width:100%;border-radius:8px;}
.rt-qrcode-section{
  margin-top:16px;padding:16px;border:1px solid #e5e7eb;border-radius:8px;background:#fafafa;
}
/* 富文本内容显示样式 */
.rt-content h2{font-size:18px;font-weight:700;margin:16px 0 8px;color:#111827;}
.rt-content h3{font-size:16px;font-weight:600;margin:12px 0 6px;color:#111827;}
.rt-content p{margin:8px 0;}
.rt-content ul,.rt-content ol{margin:8px 0;padding-left:24px;}
.rt-content li{margin:4px 0;}
.rt-content a{color:#009999;text-decoration:underline;}

/* ========== 管理后台 Tab ========== */
.admin-tabs{
  display:flex;gap:4px;margin-bottom:24px;
  border-bottom:1px solid #e5e7eb;
}
.admin-tab{
  padding:12px 24px;background:none;border:none;
  font-size:14px;font-weight:600;color:#6b7280;
  cursor:pointer;transition:all .15s;
  border-bottom:2px solid transparent;margin-bottom:-1px;
}
.admin-tab:hover{color:#111827;}
.admin-tab.active{
  color:#009999;border-bottom-color:#009999;
}
.admin-tab-content{display:none;}
.admin-tab-content.active{display:block;}

/* ========== Skill 管理 v40 三栏布局 ========== */
.skill-list-item:hover{background:#e2e8f0 !important;}
.file-tree-item:hover{background:#e2e8f0;}
.skill-list-item .type-template{color:#2563eb;}
.skill-list-item .type-crawler{color:#7c3aed;}
.skill-list-item .type-aitext{color:#ea580c;}
.skill-list-item .type-aiimg{color:#db2777;}
.skill-list-item .type-hot{color:#dc2626;}

/* ========== 积分方案配置 ========== */
.points-config-table{
  border:1px solid #e5e7eb;border-radius:10px;overflow:hidden;
}
.points-config-row{
  display:flex;align-items:center;padding:16px 20px;
  border-bottom:1px solid #f3f4f6;gap:16px;
}
.points-config-row:last-child{border-bottom:none;}
.points-config-header{
  background:#f9fafb;font-size:13px;font-weight:600;color:#6b7280;
  padding:12px 20px;
}
.points-config-header .pc-col-expire{flex:1.2;}
.pc-col-type{flex:2;display:flex;flex-direction:column;gap:2px;}
.pc-col-points{flex:1;display:flex;}
.pc-col-expire{flex:1.2;display:flex;}
.pc-col-action{flex:0.6;display:flex;justify-content:flex-end;}
.pc-type-label{font-size:14px;font-weight:600;color:#111827;}
.pc-type-desc{font-size:12px;color:#9ca3af;}
.pc-points-input{max-width:120px;}
.pc-expire-input{max-width:180px;}
@media(max-width:768px){
  .points-config-row{flex-wrap:wrap;}
  .pc-col-type{flex:100%;}
  .pc-col-points,.pc-col-expire{flex:1;}
  .pc-col-action{flex:100%;justify-content:flex-start;}
}

/* ========== 响应式 ========== */
@media(max-width:768px){
  .user-sidebar{width:64px;}
  .sidebar-title,.sidebar-sub,.sidebar-nav-item span:not(.sidebar-nav-badge),.sidebar-user-info,.sidebar-logout{display:none;}
  .sidebar-nav-item{justify-content:center;padding:12px 8px;margin:2px 6px;}
  .user-content{margin-left:64px;padding:16px;}
  .stats-grid{grid-template-columns:1fr 1fr;}
  .stats-grid-center{grid-template-columns:1fr 1fr !important;}
  .balance-card{padding:24px;}
  .balance-card .balance-number{font-size:36px;}
  .admin-tabs{flex-wrap:wrap;}
  .admin-edit-modal{width:95% !important;margin:20px auto;}
}

/* ========== 富文本编辑器 ========== */
.richtext-toolbar{
  display:flex;align-items:center;gap:4px;flex-wrap:wrap;
  padding:8px 12px;background:#f9fafb;border:1px solid #e5e7eb;border-radius:8px 8px 0 0;
  border-bottom:none;
}
.rt-btn{
  height:32px;padding:0 10px;border:1px solid #d1d5db;border-radius:4px;
  background:#fff;font-size:13px;color:#374151;cursor:pointer;transition:all .15s;
  display:inline-flex;align-items:center;gap:4px;
}
.rt-btn:hover{background:#f0fdfa;border-color:#009999;color:#009999;}
.rt-btn:active{background:#e0f2f1;}
.rt-divider{width:1px;height:20px;background:#e5e7eb;margin:0 4px;}
.richtext-editor{
  padding:16px;border:1px solid #e5e7eb;border-radius:0 0 8px 8px;
  font-size:14px;line-height:1.7;color:#374151;outline:none;
  background:#fff;min-height:200px;
}
.richtext-editor:focus{border-color:#009999;}
.richtext-editor p{margin-bottom:12px;}
.richtext-editor h2{font-size:20px;font-weight:700;color:#111827;margin:16px 0 8px;}
.richtext-editor h3{font-size:16px;font-weight:600;color:#1f2937;margin:12px 0 6px;}
.richtext-editor ul,.richtext-editor ol{padding-left:24px;margin-bottom:12px;}
.richtext-editor img{max-width:100%;border-radius:6px;}
.richtext-editor blockquote{border-left:3px solid #009999;padding-left:12px;color:#6b7280;background:#f9fafb;margin:8px 0;padding:8px 12px;border-radius:0 6px 6px 0;}
.richtext-editor a{color:#009999;}

/* ========== 管理后台弹窗 ========== */
.admin-modal-overlay{
  position:fixed;top:0;left:0;right:0;bottom:0;
  background:rgba(0,0,0,0.4);z-index:100;
  display:flex;align-items:center;justify-content:center;
  padding:20px;
}
.admin-modal{
  background:#fff;border-radius:12px;box-shadow:0 20px 60px rgba(0,0,0,0.15);
  width:100%;max-width:520px;max-height:90vh;display:flex;flex-direction:column;
}
.admin-modal-header{
  display:flex;align-items:center;justify-content:space-between;
  padding:16px 20px;border-bottom:1px solid #f0f0f0;flex-shrink:0;
}
.admin-modal-title{font-size:16px;font-weight:700;color:#111827;}
.admin-modal-close{
  width:32px;height:32px;border:none;background:transparent;
  font-size:22px;color:#9ca3af;cursor:pointer;border-radius:6px;
  display:flex;align-items:center;justify-content:center;
}
.admin-modal-close:hover{background:#f3f4f6;color:#374151;}
.admin-modal-body{padding:20px;overflow-y:auto;}
.admin-modal-footer{
  display:flex;align-items:center;justify-content:flex-end;gap:10px;
  padding:12px 20px;border-top:1px solid #f0f0f0;flex-shrink:0;
}
