/* Header 布局 */
.header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 11px 24px; background: linear-gradient(135deg, #1565c0, #0d47a1);color: #fff; flex-wrap: wrap; gap: 12px;box-shadow:0 2px 8px rgba(0,0,0,.2);z-index:100; position:sticky; top:0;
}
.header-content { flex: 1; min-width: 200px; }
.header h1 { margin: 0 0 4px; font-size: 20px; font-weight:600;}
.header .sub { opacity: 0.85; font-size: 13px; }
/* 登录按钮 */
#btn-login-header {
  background: rgba(255,255,255,0.2); color: #fff;
  border: 1px solid rgba(255,255,255,0.4);
  border-radius: 18px; padding: 6px 16px; font-size: 13px; cursor: pointer;min-width:95px;min-height:40px;
}
#btn-login-header:hover { background: rgba(255,255,255,0.3); }
#user-avatar {
  width: 28px; height: 28px; background: #1976d2; color: #fff;
  border-radius: 50%; display: flex; align-items: center;
  justify-content: center; font-size: 13px; font-weight: 700;
}
#ui-username { font-weight: 600; }
#ui-role {
  background: #1976d2; color: #fff; border-radius: 10px;
  font-size: 10px; padding: 1px 7px; font-weight: 600;
}
#ui-role.admin { background: #f57c00; }
#btn-logout {
  border: none; background: none; color: #999; cursor: pointer;
  font-size: 16px; padding: 0; line-height: 1;
}
#btn-logout:hover { color: #e53935; }

#db-auth-msg {
  display: none; background: #fff3e0; border: 1px solid #ffb74d;
  border-radius: 6px; padding: 8px 14px; font-size: 12px; color: #e65100;z-index:99;position:fixed; width:380px;top:200px;
}
#db-auth-msg.show { display: block; }
/* ===== 认证模态框样式 ===== */
#auth-overlay {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.7); z-index: 9999;
  display: flex; align-items: center; justify-content: center;
}
#auth-overlay.hidden { display: none; }
.auth-box {
  background: #fff; border-radius: 12px; width: 380px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.3); overflow: hidden;
}
.auth-hd {
  background: linear-gradient(135deg, #1976d2, #0d47a1);position:relative;
  color: #fff; padding: 18px 20px; text-align: center;
}
.auth-hd h2 { margin: 0 0 4px; font-size: 18px; }
.auth-hd p { margin: 0; font-size: 12px; opacity: 0.85; }
.auth-tabs {
  display: flex; border-bottom: 1px solid #e0e0e0;
}
.auth-tab {
  flex: 1; padding: 10px; text-align: center; cursor: pointer;
  font-size: 13px; color: #666; border: none; background: none;
  border-bottom: 2px solid transparent;
}
.auth-tab.on { color: #1976d2; border-bottom-color: #1976d2; font-weight: 600; }
.auth-body { padding: 20px; }
.auth-group { margin-bottom: 12px; }
.auth-group label { display: block; font-size: 12px; color: #555; margin-bottom: 4px; }
.auth-group input {
  width: 100%; box-sizing: border-box; padding: 8px 12px;
  border: 1px solid #ccc; border-radius: 6px; font-size: 14px;
  outline: none;
}
.auth-group input:focus { border-color: #1976d2; }
.auth-err {
  color: #e53935; font-size: 12px; padding: 6px 0; display: none; min-height: 20px;
}
.btn-auth {
  width: 100%; padding: 10px; background: linear-gradient(135deg, #1976d2, #0d47a1);
  color: #fff; border: none; border-radius: 6px; font-size: 14px;
  cursor: pointer; margin-top: 6px;
}
.btn-auth:disabled { opacity: 0.6; cursor: not-allowed; }
.auth-tip { font-size: 11px; color: #888; margin-top: 10px; text-align: center; }

/* 用户状态栏 */
#user-bar {
  display: none; align-items: center; gap: 8px;
  background: rgba(255,255,255,0.95); border-radius: 20px; padding: 6px 14px 6px 8px;
  font-size: 13px; color: #1976d2; margin-left: auto;
}
#user-bar.show { display: flex; }

/* 手机号字段样式 */
.phone-group {
  display: flex; gap: 8px; align-items: flex-start;
}
.phone-group input { flex: 1; }
.btn-send-code {
  padding: 8px 12px; border: 1px solid #1976d2; border-radius: 6px;
  background: #fff; color: #1976d2; font-size: 12px; cursor: pointer;
  white-space: nowrap; min-width: 90px;
}
.btn-send-code:hover { background: #e3f2fd; }
.btn-send-code:disabled { opacity: 0.5; cursor: not-allowed; }


/* 登录框关闭按钮 */
.auth-close {
  position: absolute; top: 12px; right: 12px;
  background: none; border: none; color: #fff;
  font-size: 18px; cursor: pointer; opacity: 0.7; padding: 4px;
}
.auth-close:hover { opacity: 1; }

/* 用户下拉菜单 */
#user-dropdown-wrap {
  position: relative; display: none; align-items: center; gap: 8px;
  background: rgba(255,255,255,0.95); border-radius: 20px;
  padding: 6px 10px 6px 8px;
}
#user-dropdown-wrap.show { display: flex; }
#user-avatar {
  width: 28px; height: 28px; background: #1976d2; color: #fff;
  border-radius: 50%; display: flex; align-items: center;
  justify-content: center; font-size: 13px; font-weight: 700;
}
#ui-username { font-weight: 600; color: #1976d2; }
#ui-role {
  background: #1976d2; color: #fff; border-radius: 10px;
  font-size: 10px; padding: 1px 7px; font-weight: 600;
}
#ui-role.admin { background: #f57c00; }
#btn-dropdown {
  background: none; border: none; color: #1976d2;
  cursor: pointer; padding: 4px; font-size: 12px;
}
#user-menu {
  display: none; position: absolute; top: 100%; right: 0;
  background: #fff; border-radius: 8px; box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  min-width: 120px; margin-top: 8px; z-index: 100; overflow: hidden;
}
#user-menu.show { display: block; }
.user-menu-item {
  display: block; padding: 10px 16px; color: #333;
  text-decoration: none; font-size: 13px; cursor: pointer;
  border: none; background: none; width: 100%; text-align: left;
}
.user-menu-item:hover { background: #e3f2fd; }
.user-menu-item.logout { color: #e53935; }

/* 密码眼睛切换 */
.pwd-wrap { position: relative; display: inline-block; width: 100%; }
.pwd-wrap input { width: 100%; box-sizing: border-box; padding-right: 40px; }
.pwd-eye {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer; font-size: 18px;
  color: #666; padding: 4px; line-height: 1; z-index: 10;
}
.pwd-eye:hover { color: #1976d2; }
.pwd-eye.off { opacity: 0.5; }
/* ===== 状态栏 ===== */
.status-bar {
  display: flex; gap: 16px; padding: 8px 24px;
  background: #fff; border-top: 1px solid #e0e0e0;
  font-size: 12px; color: #666;
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 50;
}

/* 更多工具下拉菜单 */
#more-tools-wrap {
  position: relative;
  display: inline-block;
  margin-left: 8px;
  min-height:40px;
}
#more-tools-btn {
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.3);
  color: #fff;
  padding: 4px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 12px;
  transition: background 0.2s;
  display:flex;
  align-items: center;
}
#more-tools-btn:hover {
  background: rgba(255,255,255,0.25);
}
#more-tools-menu {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  min-width: 160px;
  z-index: 9999;
  overflow: hidden;
}
#more-tools-menu.show { display: block; }
#more-tools-menu a {
  display: block;
  padding: 10px 16px;
  color: #333;
  text-decoration: none;
  font-size: 14px;
  border-bottom: 1px solid #f0f0f0;
  transition: background 0.15s;
}
#more-tools-menu a:last-child { border-bottom: none; }
#more-tools-menu a:hover { background: #f5f5f5; }
#more-tools-menu a .module-badge {
  font-size: 11px;
  background: #667eea;
  color: #fff;
  padding: 1px 5px;
  border-radius: 3px;
  margin-right: 6px;
}

@media (max-width: 600px) {
  .header { padding: 10px 12px; }
  .header h1 { font-size: 16px; }
  #more-tools-wrap { margin-left: auto;}
  #more-tools-btn{min-height:40px;}
}